Ë
    Énjë  ã                   ó”   — d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	m
Z
  ej                  e«      ZddlmZ  eee	¬	«      d
„ «       Zy)aM  
Django signals for the accounting app.

Auto-creates a Receipt (with PDF) whenever an AccountTransaction is saved
for the first time.

Failure policy
--------------
- Receipt *row* creation (number generation + DB insert): NOT caught here.
  Any error propagates and rolls back the enclosing transaction save.
  A transaction without a receipt number is unacceptable.
- PDF generation: caught and logged (non-fatal).  The PDF is regenerated
  on demand the first time someone hits the download endpoint, so a
  transient reportlab error should not prevent the transaction being recorded.
é    N)Ú	post_save)Úreceiver)ÚContentFileé   )ÚAccountTransactionÚReceipt)Úpost_delete)Úsenderc                 ód   — |j                   r$ddlm}  ||j                   |j                  «       yy)zƒ
    Recalculates a member's financial rollups if an AccountTransaction
    is hard deleted (e.g. from tests or Django Admin).
    r   )Úrecalculate_member_financialsN)ÚmemberÚutilsr   Útransaction_date)r
   ÚinstanceÚkwargsr   s       ú</var/www/kalinger_portal/trust-backend/accounting/signals.pyÚhandle_transaction_deleter   "   s'   € ð ‡‚Ý8Ù% h§o¡o°x×7PÑ7PÕQð ó    )Ú__doc__ÚloggingÚdjango.db.models.signalsr   Údjango.dispatchr   Údjango.core.files.baser   Úmodelsr   r   Ú	getLoggerÚ__name__Úloggerr	   r   © r   r   ú<module>r      sN   ðñó  å .Ý $Ý .ç /à	ˆ×	Ñ	˜8Ó	$€õ 1á	ˆ+Ð0Ô1ñRó 2ñRr   