diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js index 93e6bffea1..868e59aeff 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js @@ -17,6 +17,19 @@ // Booking Entry Id // -------------------- +cur_frm.cscript.onload_post_render = function(doc) { + $(cur_frm.get_field("reconcile").input).addClass("btn-info"); +} + +cur_frm.cscript.refresh = function(doc) { + cur_frm.set_intro(""); + if(!doc.voucher_no) { + cur_frm.set_intro("Select the Invoice against which you want to allocate payments."); + } else { + cur_frm.set_intro("Set allocated amount against each Payment Entry and click 'Allocate'."); + } +} + cur_frm.fields_dict.voucher_no.get_query = function(doc) { if (!doc.account) msgprint("Please select Account first"); else { diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index 81b94a22c3..e72d23eff3 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -107,7 +107,6 @@ class DocType: ch.total_amt = flt(d.get('total_amt')) ch.against_account = d.get('against_account') ch.remarks = d.get('remark') - ch.amt_to_be_reconciled = flt(ch.amt_due) ch.voucher_detail_no = d.get('voucher_detail_no') #-------------------------------------------------- @@ -128,7 +127,7 @@ class DocType: lst = [] for d in getlist(self.doclist, 'ir_payment_details'): - if d.selected and flt(d.amt_to_be_reconciled) > 0: + if flt(d.amt_to_be_reconciled) > 0: args = { 'voucher_no' : d.voucher_no, 'voucher_detail_no' : d.voucher_detail_no, @@ -146,6 +145,6 @@ class DocType: if lst: get_obj('GL Control').reconcile_against_document(lst) - msgprint("Successfully reconciled.") + msgprint("Successfully allocated.") else: - msgprint("No payment entries selected.", raise_exception=1) + msgprint("No amount allocated.", raise_exception=1) diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt index 4ae813af03..91d2613561 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt @@ -2,21 +2,17 @@ { "owner": "Administrator", "docstatus": 0, - "creation": "2012-03-27 14:35:42", + "creation": "2012-07-03 13:30:46", "modified_by": "Administrator", - "modified": "2012-03-27 14:35:42" + "modified": "2012-12-31 10:34:43" }, { - "section_style": "Simple", - "module": "Accounts", - "doctype": "DocType", "issingle": 1, - "document_type": "Other", "name": "__common__", - "colour": "White:FFF", - "_last_update": "1316509358", - "show_in_menu": 1, - "version": 37 + "doctype": "DocType", + "module": "Accounts", + "document_type": "Other", + "hide_toolbar": 1 }, { "name": "__common__", @@ -37,6 +33,148 @@ "name": "Payment to Invoice Matching Tool", "doctype": "DocType" }, + { + "doctype": "DocField", + "label": "Account", + "options": "Account", + "fieldname": "account", + "fieldtype": "Link", + "reqd": 1, + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Voucher Type", + "options": "Sales Invoice\nPurchase Invoice\nJournal Voucher", + "fieldname": "voucher_type", + "fieldtype": "Select", + "reqd": 1, + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Voucher No", + "options": "[Select]", + "fieldname": "voucher_no", + "fieldtype": "Link", + "reqd": 1, + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Pull Payment Entries", + "options": "get_payment_entries", + "fieldname": "pull_payment_entries", + "fieldtype": "Button", + "permlevel": 0 + }, + { + "print_width": "50%", + "doctype": "DocField", + "width": "50%", + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Total Amount", + "fieldname": "total_amount", + "fieldtype": "Currency", + "permlevel": 1 + }, + { + "doctype": "DocField", + "label": "Outstanding Amount", + "fieldname": "pending_amt_to_reconcile", + "fieldtype": "Currency", + "permlevel": 1 + }, + { + "doctype": "DocField", + "label": "Payment Entries", + "fieldname": "payment_entries", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "Update allocated amount in the above table and then click \"Allocate\" button", + "doctype": "DocField", + "label": "Payment Entries", + "options": "Payment to Invoice Matching Tool Detail", + "fieldname": "ir_payment_details", + "fieldtype": "Table", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Allocate", + "options": "reconcile", + "fieldname": "reconcile", + "fieldtype": "Button", + "permlevel": 0 + }, + { + "doctype": "DocField", + "options": "Simple", + "fieldname": "section_break0", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "print_width": "50%", + "doctype": "DocField", + "label": "Filter By Date", + "width": "50%", + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "From Date", + "fieldname": "from_date", + "fieldtype": "Date", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "To Date", + "fieldname": "to_date", + "fieldtype": "Date", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Help HTML", + "options": "Click \"Pull Payment Entries\" to refresh the table with filters.", + "fieldname": "help_html", + "fieldtype": "HTML", + "permlevel": 0 + }, + { + "print_width": "50%", + "doctype": "DocField", + "label": "Filter By Amount", + "width": "50%", + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Amount >=", + "fieldname": "amt_greater_than", + "fieldtype": "Data", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Amount <=", + "fieldname": "amt_less_than", + "fieldtype": "Data", + "permlevel": 0 + }, { "create": 1, "doctype": "DocPerm", @@ -59,159 +197,8 @@ "permlevel": 0 }, { + "doctype": "DocPerm", "role": "All", - "permlevel": 1, - "doctype": "DocPerm" - }, - { - "colour": "White:FFF", - "doctype": "DocField", - "width": "50%", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "doctype": "DocField", - "options": "Account", - "fieldname": "account", - "fieldtype": "Link", - "label": "Account", - "permlevel": 0 - }, - { - "doctype": "DocField", - "options": "Sales Invoice\nPurchase Invoice\nJournal Voucher", - "fieldname": "voucher_type", - "fieldtype": "Select", - "label": "Voucher Type", - "permlevel": 0 - }, - { - "colour": "White:FFF", - "doctype": "DocField", - "label": "Voucher No", - "trigger": "Client", - "fieldname": "voucher_no", - "fieldtype": "Link", - "permlevel": 0 - }, - { - "doctype": "DocField", - "width": "50%", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "doctype": "DocField", - "label": "Total Amount", - "fieldname": "total_amount", - "fieldtype": "Currency", "permlevel": 1 - }, - { - "doctype": "DocField", - "label": "Pending Amt To Reconcile", - "fieldname": "pending_amt_to_reconcile", - "fieldtype": "Currency", - "permlevel": 1 - }, - { - "colour": "White:FFF", - "doctype": "DocField", - "label": "Payment Entries", - "fieldname": "payment_entries", - "fieldtype": "Section Break", - "permlevel": 0 - }, - { - "colour": "White:FFF", - "doctype": "DocField", - "label": "