fix: Accounting for internal transfer invoices within same company

This commit is contained in:
Deepesh Garg
2020-11-27 22:02:19 +05:30
parent 07e86e0c3d
commit 614c04e357
13 changed files with 446 additions and 263 deletions

View File

@@ -77,7 +77,7 @@ class StockController(AccountsController):
if sle_list:
for sle in sle_list:
if warehouse_account.get(sle.warehouse):
# from warehouse account/ target warehouse account
# from warehouse account
self.check_expense_account(item_row)
@@ -102,9 +102,14 @@ class StockController(AccountsController):
"is_opening": item_row.get("is_opening") or self.get("is_opening") or "No",
}, warehouse_account[sle.warehouse]["account_currency"], item=item_row))
# expense account
# expense account/ target_warehouse / source_warehouse
if item_row.target_warehouse:
expense_account = warehouse_account[item_row.target_warehouse]["account"]
else:
expense_account = item_row.expense_account
gl_list.append(self.get_gl_dict({
"account": item_row.expense_account,
"account": expense_account,
"against": warehouse_account[sle.warehouse]["account"],
"cost_center": item_row.cost_center,
"project": item_row.project or self.get('project'),