mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
Merge pull request #46960 from frappe/mergify/bp/version-15-hotfix/pr-46959
fix: interaction with due date / payment terms / payment schedule (backport #46959)
This commit is contained in:
@@ -1039,39 +1039,48 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
due_date() {
|
due_date(doc, cdt) {
|
||||||
// due_date is to be changed, payment terms template and/or payment schedule must
|
// due_date is to be changed, payment terms template and/or payment schedule must
|
||||||
// be removed as due_date is automatically changed based on payment terms
|
// be removed as due_date is automatically changed based on payment terms
|
||||||
|
if (doc.doctype !== cdt) {
|
||||||
|
// triggered by change to the due_date field in payment schedule child table
|
||||||
|
// do nothing to avoid infinite clearing loop
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// if there is only one row in payment schedule child table, set its due date as the due date
|
// if there is only one row in payment schedule child table, set its due date as the due date
|
||||||
if (this.frm.doc.payment_schedule.length == 1){
|
if (doc.payment_schedule.length == 1){
|
||||||
this.frm.doc.payment_schedule[0].due_date = this.frm.doc.due_date;
|
doc.payment_schedule[0].due_date = doc.due_date;
|
||||||
this.frm.refresh_field("payment_schedule");
|
this.frm.refresh_field("payment_schedule");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.frm.doc.due_date &&
|
doc.due_date &&
|
||||||
!this.frm.updating_party_details &&
|
!this.frm.updating_party_details &&
|
||||||
!this.frm.doc.is_pos &&
|
!doc.is_pos &&
|
||||||
(
|
(
|
||||||
this.frm.doc.payment_terms_template ||
|
doc.payment_terms_template ||
|
||||||
this.frm.doc.payment_schedule?.length
|
doc.payment_schedule?.length
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
const to_clear = [];
|
const to_clear = [];
|
||||||
if (this.frm.doc.payment_terms_template) {
|
if (doc.payment_terms_template) {
|
||||||
to_clear.push("Payment Terms Template");
|
to_clear.push(__(frappe.meta.get_label(cdt, "payment_terms_template")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.frm.doc.payment_schedule?.length) {
|
if (doc.payment_schedule?.length) {
|
||||||
to_clear.push("Payment Schedule Table");
|
to_clear.push(__(frappe.meta.get_label(cdt, "payment_schedule")));
|
||||||
}
|
}
|
||||||
|
|
||||||
frappe.confirm(
|
frappe.confirm(
|
||||||
__(
|
__(
|
||||||
"Do you want to clear the selected {0}?",
|
"For the new {0} to take effect, would you like to clear the current {1}?",
|
||||||
[frappe.utils.comma_and(to_clear.map(dt => __(dt)))]
|
[
|
||||||
|
__(frappe.meta.get_label(cdt, "due_date")),
|
||||||
|
frappe.utils.comma_and(to_clear)
|
||||||
|
],
|
||||||
|
"Clear payment terms template and/or payment schedule when due date is changed"
|
||||||
),
|
),
|
||||||
() => {
|
() => {
|
||||||
this.frm.set_value("payment_terms_template", "");
|
this.frm.set_value("payment_terms_template", "");
|
||||||
|
|||||||
@@ -8340,6 +8340,7 @@ Please set a Company,Bitte legen Sie eine Firma fest,
|
|||||||
"Sorry, this coupon code's validity has expired",Die Gültigkeit dieses Gutscheincodes ist leider abgelaufen,
|
"Sorry, this coupon code's validity has expired",Die Gültigkeit dieses Gutscheincodes ist leider abgelaufen,
|
||||||
"Sorry, this coupon code is no longer valid",Dieser Gutscheincode ist leider nicht mehr gültig,
|
"Sorry, this coupon code is no longer valid",Dieser Gutscheincode ist leider nicht mehr gültig,
|
||||||
For the 'Apply Rule On Other' condition the field {0} is mandatory,Für die Bedingung 'Regel auf andere anwenden' ist das Feld {0} obligatorisch,
|
For the 'Apply Rule On Other' condition the field {0} is mandatory,Für die Bedingung 'Regel auf andere anwenden' ist das Feld {0} obligatorisch,
|
||||||
|
"For the new {0} to take effect, would you like to clear the current {1}?","Möchten sie die/den aktuelle(n) {1} entfernen, damit das neue {0} angewendet wird?",Clear payment terms template and/or payment schedule when due date is changed
|
||||||
{1} Not in Stock,{1} Nicht auf Lager,
|
{1} Not in Stock,{1} Nicht auf Lager,
|
||||||
Only {0} in Stock for item {1},Nur {0} auf Lager für Artikel {1},
|
Only {0} in Stock for item {1},Nur {0} auf Lager für Artikel {1},
|
||||||
Please enter a coupon code,Bitte geben Sie einen Gutscheincode ein,
|
Please enter a coupon code,Bitte geben Sie einen Gutscheincode ein,
|
||||||
|
|||||||
|
Can't render this file because it is too large.
|
Reference in New Issue
Block a user