[Enhance] Companywise perpetual inventory setting

This commit is contained in:
Rohit Waghchaure
2017-06-16 15:21:36 +05:30
parent 80ef298519
commit a5f40941ae
32 changed files with 2160 additions and 1980 deletions

View File

@@ -21,7 +21,7 @@ class StockController(AccountsController):
if self.docstatus == 2:
delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
if cint(self.get_company_default("enable_perpetual_inventory")):
warehouse_account = get_warehouse_account_map()
if self.docstatus==1:
@@ -95,7 +95,7 @@ class StockController(AccountsController):
def update_stock_ledger_entries(self, sle):
sle.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse,
self.doctype, self.name, currency=self.company_currency)
self.doctype, self.name, currency=self.company_currency, company=self.company)
sle.stock_value = flt(sle.qty_after_transaction) * flt(sle.valuation_rate)
sle.stock_value_difference = flt(sle.actual_qty) * flt(sle.valuation_rate)