diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js index 1355ea4965..ab6db9d381 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js @@ -44,7 +44,7 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext } }); }, - + refresh: function() { this.frm.disable_save(); }, @@ -77,8 +77,8 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext var invoices = []; $.each(me.frm.doc.invoices || [], function(i, row) { - if (row.invoice_number && !inList(invoices, row.invoice_number)) - invoices.push(row.invoice_number); + if (row.invoice_number && !inList(invoices, row.invoice_number)) + invoices.push(row.invoice_type + " | " + row.invoice_number); }); frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number", diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json index e7d0f76505..c88928823d 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json @@ -130,7 +130,7 @@ "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, - "label": "Column Break", + "label": "", "no_copy": 0, "permlevel": 0, "print_hide": 0, @@ -362,7 +362,7 @@ "is_submittable": 0, "issingle": 1, "istable": 0, - "modified": "2015-02-05 05:11:42.105088", + "modified": "2015-09-21 03:41:24.672227", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Reconciliation", diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index 743df3704d..ff0d15bb66 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, @@ -140,12 +140,16 @@ class PaymentReconciliation(Document): ent.outstanding_amount = e.get('outstanding_amount') def reconcile(self, args): + for e in self.get('payments'): + if " | " in e.invoice_number: + e.invoice_type, e.invoice_number = e.invoice_number.split(" | ") + self.get_invoice_entries() self.validate_invoice() dr_or_cr = "credit" if self.party_type == "Customer" else "debit" lst = [] for e in self.get('payments'): - if e.invoice_type and e.invoice_number and e.allocated_amount: + if e.invoice_number and e.allocated_amount: lst.append({ 'voucher_no' : e.journal_entry, 'voucher_detail_no' : e.voucher_detail_number, diff --git a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json index 5450b10dd2..26c77437a9 100644 --- a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json +++ b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json @@ -124,7 +124,7 @@ "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, - "label": "Column Break", + "label": "", "no_copy": 0, "permlevel": 0, "print_hide": 0, @@ -135,51 +135,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "allocated_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Allocated amount", - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "default": "Sales Invoice", - "fieldname": "invoice_type", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Invoice Type", - "no_copy": 0, - "options": "\nSales Invoice\nPurchase Invoice\nJournal Entry", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -202,6 +157,28 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "allocated_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Allocated amount", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -243,27 +220,6 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Column Break", - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 } ], "hide_heading": 0, @@ -273,7 +229,7 @@ "is_submittable": 0, "issingle": 0, "istable": 1, - "modified": "2014-12-25 16:26:48.345281", + "modified": "2015-09-21 03:39:40.320070", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Reconciliation Payment",