Revert "fix: purchase receipt item showing wrong expense account" (#51398)

This commit is contained in:
Mihir Kandoi
2025-12-30 20:14:57 +05:30
committed by GitHub
parent 0c08fb9303
commit cb5926f59b
3 changed files with 2 additions and 16 deletions

View File

@@ -748,7 +748,6 @@ def make_purchase_receipt(source_name, target_doc=None, args=None):
"sales_order_item": "sales_order_item",
"wip_composite_asset": "wip_composite_asset",
},
"field_no_map": ["expense_account"],
"postprocess": update_item,
"condition": lambda doc: (
True if is_unit_price_row(doc) else abs(doc.received_qty) < abs(doc.qty)

View File

@@ -755,7 +755,7 @@ class PurchaseReceipt(BuyingController):
stock_asset_rbnb = (
self.get_company_default("asset_received_but_not_billed")
if d.is_fixed_asset
else (d.expense_account or self.get_company_default("stock_received_but_not_billed"))
else self.get_company_default("stock_received_but_not_billed")
)
landed_cost_entries = self.get_item_account_wise_lcv_entries()
if d.is_fixed_asset:
@@ -809,7 +809,7 @@ class PurchaseReceipt(BuyingController):
stock_asset_rbnb = (
self.get_company_default("asset_received_but_not_billed")
if d.is_fixed_asset
else (d.expense_account or self.get_company_default("stock_received_but_not_billed"))
else self.get_company_default("stock_received_but_not_billed")
)
stock_value_diff = get_stock_value_difference(self.name, d.name, d.rejected_warehouse)

View File

@@ -434,19 +434,6 @@ def get_basic_details(ctx: ItemDetailsCtx, item, overwrite_warehouse=True) -> It
expense_account = get_asset_category_account(
fieldname="fixed_asset_account", item=ctx.item_code, company=ctx.company
)
elif ctx.doctype == "Purchase Receipt":
from erpnext.accounts.utils import get_company_default
if not (
frappe.get_value("Company", ctx.company, "enable_provisional_accounting_for_non_stock_items")
and not item.is_stock_item
and ctx.qty
):
expense_account = (
get_company_default(ctx.company, "stock_received_but_not_billed")
if not frappe.in_test
else f'Stock Received But Not Billed - {frappe.get_value("Company", ctx.company, "abbr")}'
)
# Set the UOM to the Default Sales UOM or Default Purchase UOM if configured in the Item Master
if not ctx.uom: