[fix] Always show Sales invoice in Gross profit report
This commit is contained in:
parent
bc799885d0
commit
885c70984d
@ -175,16 +175,15 @@ class GrossProfitGenerator(object):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
if row.update_stock or row.dn_detail:
|
if row.update_stock or row.dn_detail:
|
||||||
|
parenttype, parent, item_row = row.parenttype, row.parent, row.item_row
|
||||||
if row.dn_detail:
|
if row.dn_detail:
|
||||||
row.parenttype = "Delivery Note"
|
parenttype, parent, item_row = "Delivery Note", row.delivery_note, row.dn_detail
|
||||||
row.parent = row.delivery_note
|
|
||||||
row.item_row = row.dn_detail
|
|
||||||
|
|
||||||
my_sle = self.sle.get((item_code, row.warehouse))
|
my_sle = self.sle.get((item_code, row.warehouse))
|
||||||
for i, sle in enumerate(my_sle):
|
for i, sle in enumerate(my_sle):
|
||||||
# find the stock valution rate from stock ledger entry
|
# find the stock valution rate from stock ledger entry
|
||||||
if sle.voucher_type == row.parenttype and row.parent == sle.voucher_no and \
|
if sle.voucher_type == parenttype and parent == sle.voucher_no and \
|
||||||
sle.voucher_detail_no == row.item_row:
|
sle.voucher_detail_no == item_row:
|
||||||
previous_stock_value = len(my_sle) > i+1 and \
|
previous_stock_value = len(my_sle) > i+1 and \
|
||||||
flt(my_sle[i+1].stock_value) or 0.0
|
flt(my_sle[i+1].stock_value) or 0.0
|
||||||
return previous_stock_value - flt(sle.stock_value)
|
return previous_stock_value - flt(sle.stock_value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user