mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-03 21:48:27 +00:00
fix: payment schedule table is empty while duplicating record
(cherry picked from commit fb3f08a441)
# Conflicts:
# erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
This commit is contained in:
@@ -302,7 +302,15 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
|
|
||||||
if (this.frm.doc.__onload && this.frm.doc.__onload.load_after_mapping) return;
|
if (this.frm.doc.__onload && this.frm.doc.__onload.load_after_mapping) return;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
erpnext.utils.get_party_details(this.frm, "erpnext.accounts.party.get_party_details",
|
erpnext.utils.get_party_details(this.frm, "erpnext.accounts.party.get_party_details",
|
||||||
|
=======
|
||||||
|
let payment_terms_template = this.frm.doc.payment_terms_template;
|
||||||
|
|
||||||
|
erpnext.utils.get_party_details(
|
||||||
|
this.frm,
|
||||||
|
"erpnext.accounts.party.get_party_details",
|
||||||
|
>>>>>>> fb3f08a441 (fix: payment schedule table is empty while duplicating record)
|
||||||
{
|
{
|
||||||
posting_date: this.frm.doc.posting_date,
|
posting_date: this.frm.doc.posting_date,
|
||||||
bill_date: this.frm.doc.bill_date,
|
bill_date: this.frm.doc.bill_date,
|
||||||
@@ -311,9 +319,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
account: this.frm.doc.credit_to,
|
account: this.frm.doc.credit_to,
|
||||||
price_list: this.frm.doc.buying_price_list,
|
price_list: this.frm.doc.buying_price_list,
|
||||||
fetch_payment_terms_template: cint(
|
fetch_payment_terms_template: cint(
|
||||||
(this.frm.doc.is_return == 0) &
|
(this.frm.doc.is_return == 0) & !this.frm.doc.ignore_default_payment_terms_template
|
||||||
!this.frm.doc.ignore_default_payment_terms_template &
|
|
||||||
(this.frm.doc.__run_link_triggers !== false)
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
@@ -322,7 +328,18 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
me.frm.doc.tax_withholding_category = me.frm.supplier_tds;
|
me.frm.doc.tax_withholding_category = me.frm.supplier_tds;
|
||||||
me.frm.set_df_property("apply_tds", "read_only", me.frm.supplier_tds ? 0 : 1);
|
me.frm.set_df_property("apply_tds", "read_only", me.frm.supplier_tds ? 0 : 1);
|
||||||
me.frm.set_df_property("tax_withholding_category", "hidden", me.frm.supplier_tds ? 0 : 1);
|
me.frm.set_df_property("tax_withholding_category", "hidden", me.frm.supplier_tds ? 0 : 1);
|
||||||
|
<<<<<<< HEAD
|
||||||
})
|
})
|
||||||
|
=======
|
||||||
|
|
||||||
|
// while duplicating, don't change payment terms
|
||||||
|
if (me.frm.doc.__run_link_triggers === false) {
|
||||||
|
me.frm.set_value("payment_terms_template", payment_terms_template);
|
||||||
|
me.frm.refresh_field("payment_terms_template");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
>>>>>>> fb3f08a441 (fix: payment schedule table is empty while duplicating record)
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_tds(frm) {
|
apply_tds(frm) {
|
||||||
|
|||||||
@@ -2217,6 +2217,8 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
}
|
}
|
||||||
|
|
||||||
payment_terms_template() {
|
payment_terms_template() {
|
||||||
|
console.log("payment_terms_template outside");
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
const doc = this.frm.doc;
|
const doc = this.frm.doc;
|
||||||
if(doc.payment_terms_template && doc.doctype !== 'Delivery Note' && !doc.is_return) {
|
if(doc.payment_terms_template && doc.doctype !== 'Delivery Note' && !doc.is_return) {
|
||||||
|
|||||||
Reference in New Issue
Block a user