feat(Payment Request): Added a toggle for using the payment schedule (backport #53922) (#53928)

* feat(Payment Request): Added a toggle for using the payment schedule

(cherry picked from commit 8ec15b537e)

---------

Co-authored-by: Jatin3128 <jatinsarna8@gmail.com>
Co-authored-by: Jatin3128 <140256508+Jatin3128@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2026-03-31 12:26:29 +05:30
committed by GitHub
parent 8be7793f89
commit 5ade905ee8
3 changed files with 21 additions and 2 deletions

View File

@@ -65,6 +65,7 @@
"payment_options_section",
"enable_loyalty_point_program",
"column_break_ctam",
"fetch_payment_schedule_in_payment_request",
"invoicing_settings_tab",
"accounts_transactions_settings_section",
"over_billing_allowance",
@@ -688,6 +689,19 @@
"fieldname": "enable_accounting_dimensions",
"fieldtype": "Check",
"label": "Enable Accounting Dimensions"
},
{
"default": "1",
"description": "Enable Subscription tracking in invoice",
"fieldname": "enable_subscription",
"fieldtype": "Check",
"label": "Enable Subscription"
},
{
"default": "1",
"fieldname": "fetch_payment_schedule_in_payment_request",
"fieldtype": "Check",
"label": "Fetch Payment Schedule In Payment Request"
}
],
"grid_page_length": 50,
@@ -697,7 +711,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2026-02-27 01:04:09.415288",
"modified": "2026-03-30 07:32:58.182018",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -73,6 +73,7 @@ class AccountsSettings(Document):
enable_loyalty_point_program: DF.Check
enable_party_matching: DF.Check
exchange_gain_loss_posting_date: DF.Literal["Invoice", "Payment", "Reconciliation Date"]
fetch_payment_schedule_in_payment_request: DF.Check
fetch_valuation_rate_for_internal_transaction: DF.Check
general_ledger_remarks_length: DF.Int
ignore_account_closing_balance: DF.Check

View File

@@ -459,8 +459,12 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
reference_name: frm.doc.name,
},
});
const value = await frappe.db.get_single_value(
"Accounts Settings",
"fetch_payment_schedule_in_payment_request"
);
if (!schedules.length) {
if (!value || !schedules.length) {
this.make_payment_request();
return;
}