From 740a11263fd5670041db45e368eead0fef61bc4c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 29 Sep 2015 12:54:50 +0530 Subject: [PATCH] [minor] validate invoice number is selected in Payment Reconciliation --- .../doctype/payment_reconciliation/payment_reconciliation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index bfdb041867..d95c3bf3a5 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -70,7 +70,7 @@ class PaymentReconciliation(Document): non_reconciled_invoices = [] dr_or_cr = "debit" if self.party_type == "Customer" else "credit" cond = self.check_condition(dr_or_cr) - + invoice_list = frappe.db.sql(""" select voucher_no, voucher_type, posting_date, @@ -141,6 +141,9 @@ class PaymentReconciliation(Document): def reconcile(self, args): for e in self.get('payments'): + if not e.invoice_number: + frappe.throw(_("Row {0}: Please select Invoice Number for reconcilation").format(e.idx)) + if " | " in e.invoice_number: e.invoice_type, e.invoice_number = e.invoice_number.split(" | ")