mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
chore: resolve conflicts
This commit is contained in:
@@ -22,7 +22,6 @@ frappe.ui.form.on(cur_frm.doctype, {
|
|||||||
} else {
|
} else {
|
||||||
var account_type = ["Tax", "Chargeable", "Income Account", "Expenses Included In Valuation"];
|
var account_type = ["Tax", "Chargeable", "Income Account", "Expenses Included In Valuation"];
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
query: "erpnext.controllers.queries.tax_account_query",
|
query: "erpnext.controllers.queries.tax_account_query",
|
||||||
@@ -30,18 +29,6 @@ frappe.ui.form.on(cur_frm.doctype, {
|
|||||||
"account_type": account_type,
|
"account_type": account_type,
|
||||||
"company": doc.company,
|
"company": doc.company,
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
},
|
|
||||||
included_in_print_rate: function(frm, cdt, cdn) {
|
|
||||||
let tax = frappe.get_doc(cdt, cdn);
|
|
||||||
try {
|
|
||||||
me.validate_taxes_and_charges(cdt, cdn);
|
|
||||||
me.validate_inclusive_tax(tax, frm);
|
|
||||||
} catch(e) {
|
|
||||||
tax.included_in_print_rate = 0;
|
|
||||||
refresh_field("included_in_print_rate", tax.name, tax.parentfield);
|
|
||||||
throw e;
|
|
||||||
>>>>>>> 50d56db0c2 (fix: specify precision for net_amount (#39481))
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
frm.set_query("cost_center", "taxes", function(doc) {
|
frm.set_query("cost_center", "taxes", function(doc) {
|
||||||
@@ -66,24 +53,14 @@ frappe.ui.form.on(cur_frm.doctype, {
|
|||||||
erpnext.taxes.set_conditional_mandatory_rate_or_amount(frm.open_grid_row());
|
erpnext.taxes.set_conditional_mandatory_rate_or_amount(frm.open_grid_row());
|
||||||
},
|
},
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
allocate_advances_automatically: function(frm) {
|
allocate_advances_automatically: function(frm) {
|
||||||
frm.trigger('fetch_advances');
|
frm.trigger('fetch_advances');
|
||||||
},
|
},
|
||||||
=======
|
|
||||||
validate_inclusive_tax: function(tax, frm) {
|
|
||||||
this.frm = this.frm || frm;
|
|
||||||
let actual_type_error = function() {
|
|
||||||
var msg = __("Actual type tax cannot be included in Item rate in row {0}", [tax.idx])
|
|
||||||
frappe.throw(msg);
|
|
||||||
};
|
|
||||||
>>>>>>> 50d56db0c2 (fix: specify precision for net_amount (#39481))
|
|
||||||
|
|
||||||
only_include_allocated_payments: function(frm) {
|
only_include_allocated_payments: function(frm) {
|
||||||
frm.trigger('fetch_advances');
|
frm.trigger('fetch_advances');
|
||||||
},
|
},
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
fetch_advances: function(frm) {
|
fetch_advances: function(frm) {
|
||||||
if(frm.doc.allocate_advances_automatically) {
|
if(frm.doc.allocate_advances_automatically) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
@@ -91,23 +68,6 @@ frappe.ui.form.on(cur_frm.doctype, {
|
|||||||
method: "set_advances",
|
method: "set_advances",
|
||||||
callback: function(r, rt) {
|
callback: function(r, rt) {
|
||||||
refresh_field("advances");
|
refresh_field("advances");
|
||||||
=======
|
|
||||||
if(cint(tax.included_in_print_rate)) {
|
|
||||||
if(tax.charge_type == "Actual") {
|
|
||||||
// inclusive tax cannot be of type Actual
|
|
||||||
actual_type_error();
|
|
||||||
} else if (tax.charge_type == "On Previous Row Amount" && this.frm &&
|
|
||||||
!cint(this.frm.doc["taxes"][tax.row_id - 1].included_in_print_rate)
|
|
||||||
) {
|
|
||||||
// referred row should also be an inclusive tax
|
|
||||||
on_previous_row_error(tax.row_id);
|
|
||||||
} else if (tax.charge_type == "On Previous Row Total" && this.frm) {
|
|
||||||
var taxes_not_included = $.map(this.frm.doc["taxes"].slice(0, tax.row_id),
|
|
||||||
function(t) { return cint(t.included_in_print_rate) ? null : t; });
|
|
||||||
if(taxes_not_included.length > 0) {
|
|
||||||
// all rows above this tax should be inclusive
|
|
||||||
on_previous_row_error(tax.row_id == 1 ? "1" : "1 - " + tax.row_id);
|
|
||||||
>>>>>>> 50d56db0c2 (fix: specify precision for net_amount (#39481))
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -270,7 +230,8 @@ cur_frm.cscript.validate_taxes_and_charges = function(cdt, cdn) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.validate_inclusive_tax = function(tax) {
|
cur_frm.cscript.validate_inclusive_tax = function(tax, frm) {
|
||||||
|
this.frm = this.frm || frm;
|
||||||
var actual_type_error = function() {
|
var actual_type_error = function() {
|
||||||
var msg = __("Actual type tax cannot be included in Item rate in row {0}", [tax.idx])
|
var msg = __("Actual type tax cannot be included in Item rate in row {0}", [tax.idx])
|
||||||
frappe.throw(msg);
|
frappe.throw(msg);
|
||||||
@@ -286,12 +247,12 @@ cur_frm.cscript.validate_inclusive_tax = function(tax) {
|
|||||||
if(tax.charge_type == "Actual") {
|
if(tax.charge_type == "Actual") {
|
||||||
// inclusive tax cannot be of type Actual
|
// inclusive tax cannot be of type Actual
|
||||||
actual_type_error();
|
actual_type_error();
|
||||||
} else if(tax.charge_type == "On Previous Row Amount" &&
|
} else if(tax.charge_type == "On Previous Row Amount" && this.frm &&
|
||||||
!cint(this.frm.doc["taxes"][tax.row_id - 1].included_in_print_rate)
|
!cint(this.frm.doc["taxes"][tax.row_id - 1].included_in_print_rate)
|
||||||
) {
|
) {
|
||||||
// referred row should also be an inclusive tax
|
// referred row should also be an inclusive tax
|
||||||
on_previous_row_error(tax.row_id);
|
on_previous_row_error(tax.row_id);
|
||||||
} else if(tax.charge_type == "On Previous Row Total") {
|
} else if(tax.charge_type == "On Previous Row Total" && this.frm) {
|
||||||
var taxes_not_included = $.map(this.frm.doc["taxes"].slice(0, tax.row_id),
|
var taxes_not_included = $.map(this.frm.doc["taxes"].slice(0, tax.row_id),
|
||||||
function(t) { return cint(t.included_in_print_rate) ? null : t; });
|
function(t) { return cint(t.included_in_print_rate) ? null : t; });
|
||||||
if(taxes_not_included.length > 0) {
|
if(taxes_not_included.length > 0) {
|
||||||
@@ -334,7 +295,7 @@ if(!erpnext.taxes.flags[cur_frm.cscript.tax_table]) {
|
|||||||
var tax = frappe.get_doc(cdt, cdn);
|
var tax = frappe.get_doc(cdt, cdn);
|
||||||
try {
|
try {
|
||||||
cur_frm.cscript.validate_taxes_and_charges(cdt, cdn);
|
cur_frm.cscript.validate_taxes_and_charges(cdt, cdn);
|
||||||
cur_frm.cscript.validate_inclusive_tax(tax);
|
cur_frm.cscript.validate_inclusive_tax(tax, frm);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
tax.included_in_print_rate = 0;
|
tax.included_in_print_rate = 0;
|
||||||
refresh_field("included_in_print_rate", tax.name, tax.parentfield);
|
refresh_field("included_in_print_rate", tax.name, tax.parentfield);
|
||||||
|
|||||||
@@ -183,15 +183,9 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
|
|
||||||
$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; });
|
$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; });
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if (!this.discount_amount_applied && cur_frm) {
|
if (!this.discount_amount_applied && cur_frm) {
|
||||||
cur_frm.cscript.validate_taxes_and_charges(tax.doctype, tax.name);
|
cur_frm.cscript.validate_taxes_and_charges(tax.doctype, tax.name);
|
||||||
me.validate_inclusive_tax(tax);
|
me.validate_inclusive_tax(tax);
|
||||||
=======
|
|
||||||
if (!this.discount_amount_applied) {
|
|
||||||
erpnext.accounts.taxes.validate_taxes_and_charges(tax.doctype, tax.name);
|
|
||||||
erpnext.accounts.taxes.validate_inclusive_tax(tax, this.frm);
|
|
||||||
>>>>>>> 50d56db0c2 (fix: specify precision for net_amount (#39481))
|
|
||||||
}
|
}
|
||||||
frappe.model.round_floats_in(tax);
|
frappe.model.round_floats_in(tax);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user