Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Purchase Receipt GL Entries #37642

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions erpnext/assets/doctype/asset/test_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,7 @@ def create_asset_category():
"fixed_asset_account": "_Test Fixed Asset - _TC",
"accumulated_depreciation_account": "_Test Accumulated Depreciations - _TC",
"depreciation_expense_account": "_Test Depreciations - _TC",
"capital_work_in_progress_account": "CWIP Account - _TC",
},
)
asset_category.append(
Expand Down
7 changes: 0 additions & 7 deletions erpnext/controllers/stock_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ def make_gl_entries(self, gl_entries=None, from_repost=False):
gl_entries = self.get_gl_entries(warehouse_account)
make_gl_entries(gl_entries, from_repost=from_repost)

update_regional_gl_entries(gl_entries, self)

def validate_serialized_batch(self):
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos

Expand Down Expand Up @@ -1226,8 +1224,3 @@ def create_item_wise_repost_entries(voucher_type, voucher_no, allow_zero_rate=Fa
repost_entries.append(repost_entry)

return repost_entries


@erpnext.allow_regional
def update_regional_gl_entries(gl_list, doc):
return
14 changes: 7 additions & 7 deletions erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,17 +542,19 @@ def make_divisional_loss_gl_entry(item, outgoing_amount):
d, gl_entries, self.posting_date, d.get("provisional_expense_account")
)
elif flt(d.qty) and (flt(d.valuation_rate) or self.is_return):
is_asset_pr = any(d.is_fixed_asset for d in self.get("items"))
remarks = self.get("remarks") or _("Accounting Entry for {0}").format(
"Asset" if is_asset_pr else "Stock"
"Asset" if d.is_fixed_asset else "Stock"
)

if not (erpnext.is_perpetual_inventory_enabled(self.company) or is_asset_pr):
return
if not (
(erpnext.is_perpetual_inventory_enabled(self.company) and d.item_code in stock_items)
or d.is_fixed_asset
):
continue

stock_asset_rbnb = (
self.get_company_default("asset_received_but_not_billed")
if is_asset_pr
if d.is_fixed_asset
else self.get_company_default("stock_received_but_not_billed")
)
landed_cost_entries = get_item_account_wise_additional_cost(self.name)
Expand Down Expand Up @@ -758,8 +760,6 @@ def update_billing_status(self, update_modified=True):
pr_doc = self if (pr == self.name) else frappe.get_doc("Purchase Receipt", pr)
update_billing_percentage(pr_doc, update_modified=update_modified)

self.load_from_db()

def reserve_stock_for_sales_order(self):
if self.is_return or not cint(
frappe.db.get_single_value("Stock Settings", "auto_reserve_stock_for_sales_order_on_purchase")
Expand Down
Loading