feat(Selling): Gross Profit In Quotation (#21795)

* added valuation rate and gross_profit in quotation item table

* modified code to not fetch valuation_rate manually, used set_gross_profit from selling controller
This commit is contained in:
Abhishek Balam
2020-05-26 18:37:02 +05:30
committed by GitHub
parent 49b2b155b6
commit 18e7b60acc
4 changed files with 37 additions and 5 deletions

View File

@@ -1711,7 +1711,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
},
set_gross_profit: function(item) {
if (this.frm.doc.doctype == "Sales Order" && item.valuation_rate) {
if (["Sales Order", "Quotation"].includes(this.frm.doc.doctype) && item.valuation_rate) {
var rate = flt(item.rate) * flt(this.frm.doc.conversion_rate || 1);
item.gross_profit = flt(((rate - item.valuation_rate) * item.stock_qty), precision("amount", item));
}