mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
[fix] [minor] gl entries for purchase invoice
This commit is contained in:
@@ -152,7 +152,7 @@ def update_outstanding_amt(account, against_voucher_type, against_voucher, on_ca
|
|||||||
|
|
||||||
# Validation : Outstanding can not be negative
|
# Validation : Outstanding can not be negative
|
||||||
if bal < 0 and not on_cancel:
|
if bal < 0 and not on_cancel:
|
||||||
webnotes.throw(_("Outstanding for Voucher ") + gainst_voucher + _(" will become ") +
|
webnotes.throw(_("Outstanding for Voucher ") + against_voucher + _(" will become ") +
|
||||||
fmt_money(bal) + _(". Outstanding cannot be less than zero. \
|
fmt_money(bal) + _(". Outstanding cannot be less than zero. \
|
||||||
Please match exact outstanding."))
|
Please match exact outstanding."))
|
||||||
|
|
||||||
|
|||||||
@@ -355,8 +355,10 @@ class DocType(BuyingController):
|
|||||||
# item gl entries
|
# item gl entries
|
||||||
stock_item_and_auto_accounting_for_stock = False
|
stock_item_and_auto_accounting_for_stock = False
|
||||||
stock_items = self.get_stock_items()
|
stock_items = self.get_stock_items()
|
||||||
|
warehouse_account = self.get_warehouse_account()
|
||||||
for item in self.doclist.get({"parentfield": "entries"}):
|
for item in self.doclist.get({"parentfield": "entries"}):
|
||||||
if auto_accounting_for_stock and item.item_code in stock_items:
|
if auto_accounting_for_stock and item.item_code in stock_items \
|
||||||
|
and warehouse_account.get(item.warehouse):
|
||||||
if flt(item.valuation_rate):
|
if flt(item.valuation_rate):
|
||||||
# if auto inventory accounting enabled and stock item,
|
# if auto inventory accounting enabled and stock item,
|
||||||
# then do stock related gl entries
|
# then do stock related gl entries
|
||||||
|
|||||||
Reference in New Issue
Block a user