Merge pull request #23327 from iRaySpace/stock-controller-fix

fix(stock_controller): precision based on `debit_in_account_currency`
This commit is contained in:
rohitwaghchaure
2020-10-12 17:38:00 +05:30
committed by GitHub

View File

@@ -54,6 +54,7 @@ class StockController(AccountsController):
gl_list = []
warehouse_with_no_account = []
precision = frappe.get_precision('GL Entry', 'debit_in_account_currency')
for item_row in voucher_details:
sle_list = sle_map.get(item_row.name)
if sle_list:
@@ -79,7 +80,7 @@ class StockController(AccountsController):
"against": item_row.expense_account,
"cost_center": item_row.cost_center,
"remarks": self.get("remarks") or "Accounting Entry for Stock",
"debit": flt(sle.stock_value_difference, 2),
"debit": flt(sle.stock_value_difference, precision),
"is_opening": item_row.get("is_opening") or self.get("is_opening") or "No",
}, warehouse_account[sle.warehouse]["account_currency"]))
@@ -89,7 +90,7 @@ class StockController(AccountsController):
"against": warehouse_account[sle.warehouse]["account"],
"cost_center": item_row.cost_center,
"remarks": self.get("remarks") or "Accounting Entry for Stock",
"credit": flt(sle.stock_value_difference, 2),
"credit": flt(sle.stock_value_difference, precision),
"project": item_row.get("project") or self.get("project"),
"is_opening": item_row.get("is_opening") or self.get("is_opening") or "No"
}))