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

@@ -361,7 +361,7 @@ class SellingController(StockController):
self.po_no = ', '.join(list(set([d.po_no for d in po_nos if d.po_no])))
def set_gross_profit(self):
if self.doctype == "Sales Order":
if self.doctype in ["Sales Order", "Quotation"]:
for item in self.items:
item.gross_profit = flt(((item.base_rate - item.valuation_rate) * item.stock_qty), self.precision("amount", item))