fix: default_advance_account field in Process Payment Reconciliation
(cherry picked from commit 143209f91a)
# Conflicts:
# erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.json
# erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.py
This commit is contained in:
@@ -20,6 +20,17 @@ frappe.ui.form.on("Process Payment Reconciliation", {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frm.set_query("default_advance_account", function (doc) {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
company: doc.company,
|
||||||
|
is_group: 0,
|
||||||
|
account_type: doc.party_type == "Customer" ? "Receivable" : "Payable",
|
||||||
|
root_type: doc.party_type == "Customer" ? "Liability" : "Asset",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
frm.set_query("cost_center", function (doc) {
|
frm.set_query("cost_center", function (doc) {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
@@ -102,6 +113,7 @@ frappe.ui.form.on("Process Payment Reconciliation", {
|
|||||||
company(frm) {
|
company(frm) {
|
||||||
frm.set_value("party", "");
|
frm.set_value("party", "");
|
||||||
frm.set_value("receivable_payable_account", "");
|
frm.set_value("receivable_payable_account", "");
|
||||||
|
frm.set_value("default_advance_account", "");
|
||||||
},
|
},
|
||||||
party_type(frm) {
|
party_type(frm) {
|
||||||
frm.set_value("party", "");
|
frm.set_value("party", "");
|
||||||
@@ -109,6 +121,7 @@ frappe.ui.form.on("Process Payment Reconciliation", {
|
|||||||
|
|
||||||
party(frm) {
|
party(frm) {
|
||||||
frm.set_value("receivable_payable_account", "");
|
frm.set_value("receivable_payable_account", "");
|
||||||
|
frm.set_value("default_advance_account", "");
|
||||||
if (!frm.doc.receivable_payable_account && frm.doc.party_type && frm.doc.party) {
|
if (!frm.doc.receivable_payable_account && frm.doc.party_type && frm.doc.party) {
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: "erpnext.accounts.party.get_party_account",
|
method: "erpnext.accounts.party.get_party_account",
|
||||||
@@ -119,7 +132,12 @@ frappe.ui.form.on("Process Payment Reconciliation", {
|
|||||||
},
|
},
|
||||||
callback: (r) => {
|
callback: (r) => {
|
||||||
if (!r.exc && r.message) {
|
if (!r.exc && r.message) {
|
||||||
frm.set_value("receivable_payable_account", r.message);
|
if (typeof r.message === "string") {
|
||||||
|
frm.set_value("receivable_payable_account", r.message);
|
||||||
|
} else if (Array.isArray(r.message)) {
|
||||||
|
frm.set_value("receivable_payable_account", r.message[0]);
|
||||||
|
frm.set_value("default_advance_account", r.message[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
frm.refresh();
|
frm.refresh();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"column_break_io6c",
|
"column_break_io6c",
|
||||||
"party",
|
"party",
|
||||||
"receivable_payable_account",
|
"receivable_payable_account",
|
||||||
|
"default_advance_account",
|
||||||
"filter_section",
|
"filter_section",
|
||||||
"from_invoice_date",
|
"from_invoice_date",
|
||||||
"to_invoice_date",
|
"to_invoice_date",
|
||||||
@@ -141,12 +142,27 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "section_break_a8yx",
|
"fieldname": "section_break_a8yx",
|
||||||
"fieldtype": "Section Break"
|
"fieldtype": "Section Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "eval:doc.party",
|
||||||
|
"description": "Only 'Payment Entries' made against this advance account are supported.",
|
||||||
|
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/advance-in-separate-party-account",
|
||||||
|
"fieldname": "default_advance_account",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Default Advance Account",
|
||||||
|
"mandatory_depends_on": "doc.party_type",
|
||||||
|
"options": "Account",
|
||||||
|
"reqd": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2023-08-11 10:56:51.699137",
|
"modified": "2023-08-11 10:56:51.699137",
|
||||||
|
=======
|
||||||
|
"modified": "2024-08-27 14:48:56.715320",
|
||||||
|
>>>>>>> 143209f91a (fix: `default_advance_account` field in Process Payment Reconciliation)
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Process Payment Reconciliation",
|
"name": "Process Payment Reconciliation",
|
||||||
@@ -180,4 +196,4 @@
|
|||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": [],
|
||||||
"title_field": "company"
|
"title_field": "company"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,35 @@ from frappe.utils.scheduler import is_scheduler_inactive
|
|||||||
|
|
||||||
|
|
||||||
class ProcessPaymentReconciliation(Document):
|
class ProcessPaymentReconciliation(Document):
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
bank_cash_account: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
default_advance_account: DF.Link
|
||||||
|
error_log: DF.LongText | None
|
||||||
|
from_invoice_date: DF.Date | None
|
||||||
|
from_payment_date: DF.Date | None
|
||||||
|
party: DF.DynamicLink
|
||||||
|
party_type: DF.Link
|
||||||
|
receivable_payable_account: DF.Link
|
||||||
|
status: DF.Literal[
|
||||||
|
"", "Queued", "Running", "Paused", "Completed", "Partially Reconciled", "Failed", "Cancelled"
|
||||||
|
]
|
||||||
|
to_invoice_date: DF.Date | None
|
||||||
|
to_payment_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
|
>>>>>>> 143209f91a (fix: `default_advance_account` field in Process Payment Reconciliation)
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_receivable_payable_account()
|
self.validate_receivable_payable_account()
|
||||||
self.validate_bank_cash_account()
|
self.validate_bank_cash_account()
|
||||||
@@ -76,6 +105,7 @@ def get_pr_instance(doc: str):
|
|||||||
"party_type",
|
"party_type",
|
||||||
"party",
|
"party",
|
||||||
"receivable_payable_account",
|
"receivable_payable_account",
|
||||||
|
"default_advance_account",
|
||||||
"from_invoice_date",
|
"from_invoice_date",
|
||||||
"to_invoice_date",
|
"to_invoice_date",
|
||||||
"from_payment_date",
|
"from_payment_date",
|
||||||
|
|||||||
Reference in New Issue
Block a user