mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-29 06:38:24 +00:00
Landed Cost on_submit and gl entries for PR
This commit is contained in:
@@ -193,9 +193,13 @@ class BuyingController(StockController):
|
||||
"UOM Conversion Detail", {"parent": item.item_code, "uom": item.uom},
|
||||
"conversion_factor")) or 1
|
||||
qty_in_stock_uom = flt(item.qty * item.conversion_factor)
|
||||
rm_supp_cost = item.rm_supp_cost if self.doctype=="Purchase Receipt" else 0.0
|
||||
item.valuation_rate = ((item.base_amount + item.item_tax_amount + rm_supp_cost)
|
||||
/ qty_in_stock_uom)
|
||||
rm_supp_cost = flt(item.rm_supp_cost) if self.doctype=="Purchase Receipt" else 0.0
|
||||
|
||||
landed_cost_voucher_amount = flt(item.landed_cost_voucher_amount) \
|
||||
if self.doctype == "Purchase Receipt" else 0.0
|
||||
|
||||
item.valuation_rate = ((item.base_amount + item.item_tax_amount + rm_supp_cost
|
||||
+ landed_cost_voucher_amount) / qty_in_stock_uom)
|
||||
else:
|
||||
item.valuation_rate = 0.0
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ class StockController(AccountsController):
|
||||
from erpnext.stock.stock_ledger import make_sl_entries
|
||||
make_sl_entries(sl_entries, is_amended)
|
||||
|
||||
def make_cancel_gl_entries(self):
|
||||
def make_gl_entries_on_cancel(self):
|
||||
if frappe.db.sql("""select name from `tabGL Entry` where voucher_type=%s
|
||||
and voucher_no=%s""", (self.doctype, self.name)):
|
||||
self.make_gl_entries()
|
||||
|
||||
Reference in New Issue
Block a user