chore: rename and add trigger in journal entry

This commit is contained in:
ruthra kumar 2023-08-29 21:49:21 +05:30
parent 69683776a5
commit 0ccb6d8242
3 changed files with 4 additions and 2 deletions

View File

@ -50,6 +50,8 @@ frappe.ui.form.on("Journal Entry", {
frm.trigger("make_inter_company_journal_entry");
}, __('Make'));
}
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm);
},
make_inter_company_journal_entry: function(frm) {

View File

@ -54,7 +54,7 @@ class UnreconcilePayments(Document):
@frappe.whitelist()
def doc_has_payments(doctype, docname):
def doc_has_references(doctype, docname):
if doctype in ["Sales Invoice", "Purchase Invoice"]:
return frappe.db.count(
"Payment Ledger Entry",

View File

@ -4,7 +4,7 @@ erpnext.accounts.unreconcile_payments = {
add_unreconcile_btn(frm) {
if (frm.doc.docstatus == 1) {
frappe.call({
"method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.doc_has_payments",
"method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.doc_has_references",
"args": {
"doctype": frm.doc.doctype,
"docname": frm.doc.name