Added status field in sales invoice and purchase invoice

This commit is contained in:
Rohit Waghchaure
2016-11-08 12:39:33 +05:30
parent 31f6436f75
commit 2f1db57fe1
11 changed files with 126 additions and 6 deletions

View File

@@ -720,4 +720,13 @@ def get_advance_payment_entries(party_type, party, party_account,
and docstatus = 1 and unallocated_amount > 0
""".format(party_account_field), (party_account, party_type, party, payment_type), as_dict=1)
return list(payment_entries_against_order) + list(unallocated_payment_entries)
return list(payment_entries_against_order) + list(unallocated_payment_entries)
def update_invoice_status():
# Daily update the status of the invoices
frappe.db.sql(""" update `tabSales Invoice` set status = 'Overdue'
where due_date < CURDATE() and docstatus = 1 and outstanding_amount > 0""")
frappe.db.sql(""" update `tabPurchase Invoice` set status = 'Overdue'
where due_date < CURDATE() and docstatus = 1 and outstanding_amount > 0""")