def post_make_down_payment_invoice(cls, sender, issuer, document, new_document, **kwargs): """ Post make down payment invoice hook handler - Add timeline and notification entries - Add a statistic entry """ from vosae_statistics.models import DownPaymentInvoiceStatistics # Add timeline and notification entries post_make_invoice_task.delay(issuer, document, new_document) # Saves statistic DownPaymentInvoiceStatistics( tenant=new_document.tenant, date=new_document.current_revision.invoicing_date, amount=new_document.amount, organization=new_document.organization, contact=new_document.contact, location=new_document.current_revision.billing_address if new_document.account_type == 'RECEIVABLE' else new_document.current_revision.sender_address, account_type=new_document.account_type, down_payment_invoice=new_document).save()
def post_make_invoice(cls, sender, issuer, document, new_document, **kwargs): """ Post make invoice hook handler - Add timeline and notification entries """ # Add timeline and notification entries post_make_invoice_task.delay(issuer, document, new_document)
def post_make_down_payment_invoice(cls, sender, issuer, document, new_document, **kwargs): """ Post make down payment invoice hook handler - Add timeline and notification entries - Add a statistic entry """ from vosae_statistics.models import DownPaymentInvoiceStatistics # Add timeline and notification entries post_make_invoice_task.delay(issuer, document, new_document) # Saves statistic DownPaymentInvoiceStatistics( tenant=new_document.tenant, date=new_document.current_revision.invoicing_date, amount=new_document.amount, organization=new_document.organization, contact=new_document.contact, location=new_document.current_revision.billing_address if new_document.account_type == 'RECEIVABLE' else new_document.current_revision.sender_address, account_type=new_document.account_type, down_payment_invoice=new_document ).save()