Skip to content

Commit

Permalink
fix: internal Purchase Receipt GL Entries
Browse files Browse the repository at this point in the history
(cherry picked from commit 6fca9ad)
  • Loading branch information
s-aga-r authored and mergify[bot] committed Apr 20, 2023
1 parent a2d2beb commit b73422e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,19 @@ def make_item_gl_entries(self, gl_entries, warehouse_account=None):

outgoing_amount = d.base_net_amount
if self.is_internal_supplier and d.valuation_rate:
outgoing_amount = d.valuation_rate * d.stock_qty
outgoing_amount = abs(
frappe.db.get_value(
"Stock Ledger Entry",
{
"voucher_type": "Purchase Receipt",
"voucher_no": self.name,
"voucher_detail_no": d.name,
"warehouse": d.from_warehouse,
"is_cancelled": 0,
},
"stock_value_difference",
)
)
credit_amount = outgoing_amount

if credit_amount:
Expand Down

0 comments on commit b73422e

Please sign in to comment.