fix failing test case
This commit is contained in:
parent
4712ed6377
commit
35c84fe4f2
@ -762,29 +762,20 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
|
|||||||
pe.received_amount = received_amount
|
pe.received_amount = received_amount
|
||||||
pe.allocate_payment_amount = 1
|
pe.allocate_payment_amount = 1
|
||||||
pe.letter_head = doc.get("letter_head")
|
pe.letter_head = doc.get("letter_head")
|
||||||
|
args = {
|
||||||
|
'party_account': party_account, 'company': pe.company, 'party_type': pe.party_type,
|
||||||
|
'party': pe.party, 'posting_date': pe.posting_date
|
||||||
|
}
|
||||||
|
references = get_outstanding_reference_documents(args=args)
|
||||||
|
|
||||||
if doc.get("payment_schedule"):
|
for reference in references:
|
||||||
for d in doc.get("payment_schedule"):
|
|
||||||
invoice_amount = d.payment_amount * doc.conversion_rate \
|
|
||||||
if party_account_currency == doc.company_currency else d.payment_amount
|
|
||||||
paid_amount = get_paid_amount(dt, dn, party_type, pe.party, party_account, d.due_date)
|
|
||||||
outstanding_amount = invoice_amount - paid_amount
|
|
||||||
pe.append("references", {
|
|
||||||
"reference_doctype": dt,
|
|
||||||
"reference_name": dn,
|
|
||||||
"due_date": d.due_date,
|
|
||||||
"total_amount": invoice_amount,
|
|
||||||
"outstanding_amount": outstanding_amount,
|
|
||||||
"allocated_amount": outstanding_amount
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
pe.append("references", {
|
pe.append("references", {
|
||||||
"reference_doctype": dt,
|
'reference_doctype': reference.voucher_type,
|
||||||
"reference_name": dn,
|
'reference_name': reference.voucher_no,
|
||||||
"due_date": doc.get("due_date"),
|
'due_date': reference.due_date,
|
||||||
"total_amount": grand_total,
|
'total_amount': reference.invoice_amount,
|
||||||
"outstanding_amount": outstanding_amount,
|
'outstanding_amount': reference.outstanding_amount,
|
||||||
"allocated_amount": outstanding_amount
|
'allocated_amount': reference.outstanding_amount
|
||||||
})
|
})
|
||||||
|
|
||||||
pe.setup_party_account_field()
|
pe.setup_party_account_field()
|
||||||
|
|||||||
@ -212,7 +212,7 @@ class TestPaymentEntry(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertRaises(InvalidPaymentEntry, pe1.validate)
|
self.assertRaises(InvalidPaymentEntry, pe1.validate)
|
||||||
|
|
||||||
si1 = create_sales_invoice()
|
si1 = create_sales_invoice()
|
||||||
|
|
||||||
# create full payment entry against si1
|
# create full payment entry against si1
|
||||||
pe2 = get_payment_entry("Sales Invoice", si1.name, bank_account="_Test Cash - _TC")
|
pe2 = get_payment_entry("Sales Invoice", si1.name, bank_account="_Test Cash - _TC")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user