From f6a0d789d0f14abadc58a7417b4b1e69f3cba4a6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 4 Jul 2016 17:24:21 +0530 Subject: [PATCH] Payment entry fixes --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 6e441e4276..441760bd9e 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -49,6 +49,7 @@ class PaymentEntry(AccountsController): self.set_remarks() def on_submit(self): + self.setup_party_account_field() if self.difference_amount: frappe.throw(_("Difference Amount must be zero")) self.make_gl_entries() @@ -127,7 +128,7 @@ class PaymentEntry(AccountsController): def validate_account_type(self, account, account_types): account_type = frappe.db.get_value("Account", account, "account_type") if account_type not in account_types: - frappe.throw(_("Account Type for {0} must be {1}").format(comma_or(account_types))) + frappe.throw(_("Account Type for {0} must be {1}").format(account, comma_or(account_types))) def set_exchange_rate(self): if self.paid_from and not self.source_exchange_rate: @@ -380,7 +381,7 @@ class PaymentEntry(AccountsController): gle = party_gl_dict.copy() gle.update({ - dr_or_cr + "_in_account_currency": d.unallocated_amount, + dr_or_cr + "_in_account_currency": self.unallocated_amount, dr_or_cr: base_unallocated_amount })