mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user