chore: rename and add trigger in journal entry

(cherry picked from commit 0ccb6d8242)
This commit is contained in:
ruthra kumar
2023-08-29 21:49:21 +05:30
committed by Mergify
parent f4e1959cc7
commit 84e4a2509c
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"); frm.trigger("make_inter_company_journal_entry");
}, __('Make')); }, __('Make'));
} }
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm);
}, },
before_save: function(frm) { before_save: function(frm) {
if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) { if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) {

View File

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

View File

@@ -4,7 +4,7 @@ erpnext.accounts.unreconcile_payments = {
add_unreconcile_btn(frm) { add_unreconcile_btn(frm) {
if (frm.doc.docstatus == 1) { if (frm.doc.docstatus == 1) {
frappe.call({ 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": { "args": {
"doctype": frm.doc.doctype, "doctype": frm.doc.doctype,
"docname": frm.doc.name "docname": frm.doc.name