mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
fix: GLE for subcontracted PR is fg item rate is zero
This commit is contained in:
@@ -223,6 +223,15 @@ class PurchaseReceipt(BuyingController):
|
|||||||
|
|
||||||
if not stock_value_diff:
|
if not stock_value_diff:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# If PR is sub-contracted and fg item rate is zero
|
||||||
|
# in that case if account for shource and target warehouse are same,
|
||||||
|
# then GL entries should not be posted
|
||||||
|
if flt(stock_value_diff) == flt(d.rm_supp_cost) \
|
||||||
|
and warehouse_account.get(self.supplier_warehouse) \
|
||||||
|
and warehouse_account[d.warehouse]["account"] == warehouse_account[self.supplier_warehouse]["account"]:
|
||||||
|
continue
|
||||||
|
|
||||||
gl_entries.append(self.get_gl_dict({
|
gl_entries.append(self.get_gl_dict({
|
||||||
"account": warehouse_account[d.warehouse]["account"],
|
"account": warehouse_account[d.warehouse]["account"],
|
||||||
"against": stock_rbnb,
|
"against": stock_rbnb,
|
||||||
@@ -232,6 +241,7 @@ class PurchaseReceipt(BuyingController):
|
|||||||
}, warehouse_account[d.warehouse]["account_currency"], item=d))
|
}, warehouse_account[d.warehouse]["account_currency"], item=d))
|
||||||
|
|
||||||
# stock received but not billed
|
# stock received but not billed
|
||||||
|
if d.base_net_amount:
|
||||||
stock_rbnb_currency = get_account_currency(stock_rbnb)
|
stock_rbnb_currency = get_account_currency(stock_rbnb)
|
||||||
gl_entries.append(self.get_gl_dict({
|
gl_entries.append(self.get_gl_dict({
|
||||||
"account": stock_rbnb,
|
"account": stock_rbnb,
|
||||||
|
|||||||
Reference in New Issue
Block a user