fix: no permission for accounts settings on payment reconciliation

This commit is contained in:
ruthra kumar 2023-06-21 14:19:02 +05:30
parent 2a24423ad2
commit ad758b8d85
2 changed files with 26 additions and 18 deletions

View File

@ -85,8 +85,11 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
// check for any running reconciliation jobs
if (this.frm.doc.receivable_payable_account) {
frappe.db.get_single_value("Accounts Settings", "auto_reconcile_payments").then((enabled) => {
if(enabled) {
this.frm.call({
doc: this.frm.doc,
method: 'is_auto_process_enabled',
callback: (r) => {
if (r.message) {
this.frm.call({
'method': "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.is_any_doc_running",
"args": {
@ -105,6 +108,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
}
});
}
}
});
}

View File

@ -252,6 +252,10 @@ class PaymentReconciliation(Document):
return difference_amount
@frappe.whitelist()
def is_auto_process_enabled(self):
return frappe.db.get_single_value("Accounts Settings", "auto_reconcile_payments")
@frappe.whitelist()
def calculate_difference_on_allocation_change(self, payment_entry, invoice, allocated_amount):
invoice_exchange_map = self.get_invoice_exchange_map(invoice, payment_entry)