fix failing tests

This commit is contained in:
tunde 2017-09-21 10:23:40 +01:00
parent ae0eb718a3
commit 99849f8eab

View File

@ -769,14 +769,18 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
references = get_outstanding_reference_documents(args=args)
for reference in references:
pe.append("references", {
'reference_doctype': reference.voucher_type,
'reference_name': reference.voucher_no,
'due_date': reference.due_date,
'total_amount': reference.invoice_amount,
'outstanding_amount': reference.outstanding_amount,
'allocated_amount': reference.outstanding_amount
})
if reference.voucher_no == dn:
allocated_amount = min(paid_amount, reference.outstanding_amount)
pe.append("references", {
'reference_doctype': reference.voucher_type,
'reference_name': reference.voucher_no,
'due_date': reference.due_date,
'total_amount': reference.invoice_amount,
'outstanding_amount': reference.outstanding_amount,
'allocated_amount': reference.outstanding_amount
})
if paid_amount:
paid_amount -= allocated_amount
pe.setup_party_account_field()
pe.set_missing_values()
@ -785,6 +789,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.set_amounts()
return pe
def get_paid_amount(dt, dn, party_type, party, account, due_date):
if party_type=="Customer":
dr_or_cr = "credit_in_account_currency - debit_in_account_currency"