mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
Merge pull request #55586 from frappe/mergify/bp/version-16-hotfix/pr-55149
fix(stock): set stock received but not billed account for purchase (backport #55149)
This commit is contained in:
@@ -540,10 +540,21 @@ def get_basic_details(ctx: ItemDetailsCtx, item, overwrite_warehouse=True) -> It
|
|||||||
ctx.name, ctx.conversion_rate, item.name, out.conversion_factor
|
ctx.name, ctx.conversion_rate, item.name, out.conversion_factor
|
||||||
)
|
)
|
||||||
|
|
||||||
|
expense_account_field = "default_expense_account"
|
||||||
|
if (
|
||||||
|
item.is_stock_item
|
||||||
|
and erpnext.is_perpetual_inventory_enabled(ctx.company)
|
||||||
|
and (
|
||||||
|
ctx.doctype == "Purchase Receipt"
|
||||||
|
or (ctx.doctype == "Purchase Invoice" and ctx.get("update_stock"))
|
||||||
|
)
|
||||||
|
):
|
||||||
|
expense_account_field = "stock_received_but_not_billed"
|
||||||
|
|
||||||
# if default specified in item is for another company, fetch from company
|
# if default specified in item is for another company, fetch from company
|
||||||
for d in [
|
for d in [
|
||||||
["Account", "income_account", "default_income_account"],
|
["Account", "income_account", "default_income_account"],
|
||||||
["Account", "expense_account", "default_expense_account"],
|
["Account", "expense_account", expense_account_field],
|
||||||
["Cost Center", "cost_center", "cost_center"],
|
["Cost Center", "cost_center", "cost_center"],
|
||||||
["Warehouse", "warehouse", ""],
|
["Warehouse", "warehouse", ""],
|
||||||
]:
|
]:
|
||||||
|
|||||||
Reference in New Issue
Block a user