mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 08:05:00 +00:00
fix: set cost center in taxes if not set
(cherry picked from commit b75940bf0e)
# Conflicts:
# erpnext/public/js/controllers/transaction.js
This commit is contained in:
committed by
ruthra kumar
parent
19f81c9204
commit
4dcd502b76
@@ -2137,16 +2137,22 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
||||
this.frm.doc.name).options,
|
||||
"master_name": this.frm.doc.taxes_and_charges
|
||||
},
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
if(me.frm.doc.shipping_rule && me.frm.doc.taxes) {
|
||||
for (let tax of r.message) {
|
||||
callback: function (r) {
|
||||
if (!r.exc) {
|
||||
let taxes = r.message;
|
||||
taxes.forEach((tax) => {
|
||||
if (me.frm.doc?.cost_center && !tax.cost_center) {
|
||||
tax.cost_center = me.frm.doc.cost_center;
|
||||
}
|
||||
});
|
||||
if (me.frm.doc.shipping_rule && me.frm.doc.taxes) {
|
||||
for (let tax of taxes) {
|
||||
me.frm.add_child("taxes", tax);
|
||||
}
|
||||
|
||||
refresh_field("taxes");
|
||||
} else {
|
||||
me.frm.set_value("taxes", r.message);
|
||||
me.frm.set_value("taxes", taxes);
|
||||
me.calculate_taxes_and_totals();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user