Add Payment Entry for Expenses

This commit is contained in:
Ben Cornwell-Mott
2017-07-14 17:34:45 -07:00
committed by Nabin Hait
parent 316477b422
commit 118ceda46f
5 changed files with 166 additions and 101 deletions

View File

@@ -621,7 +621,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None):
'invoice_amount': flt(d.invoice_amount),
'payment_amount': flt(d.payment_amount),
'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision),
'due_date': frappe.db.get_value(d.voucher_type, d.voucher_no, "due_date"),
'due_date': frappe.db.get_value(d.voucher_type, d.voucher_no, "posting_date") if party_type=="Employee" else frappe.db.get_value(d.voucher_type, d.voucher_no, "due_date"),
}))
outstanding_invoices = sorted(outstanding_invoices, key=lambda k: k['due_date'] or getdate(nowdate()))