fix: Unable to submit backdated stock transactions for different items (#22648)

* fix: Unable to submit backdated stock transactions for different items

* fix: Test cases

* fix: Test Cases

* fix: Test Cases

* fix: Test for stock account JV

* fix: Journal Entry Test
This commit is contained in:
Deepesh Garg
2020-07-28 08:49:44 +05:30
committed by GitHub
parent 3c136ebf92
commit 9119b4c538
6 changed files with 102 additions and 46 deletions

View File

@@ -158,8 +158,10 @@ def validate_account_for_perpetual_inventory(gl_map):
if account not in aii_accounts:
continue
# Always use current date to get stock and account balance as there can future entries for
# other items
account_bal, stock_bal, warehouse_list = get_stock_and_account_balance(account,
gl_map[0].posting_date, gl_map[0].company)
getdate(), gl_map[0].company)
if gl_map[0].voucher_type=="Journal Entry":
# In case of Journal Entry, there are no corresponding SL entries,
@@ -169,7 +171,6 @@ def validate_account_for_perpetual_inventory(gl_map):
frappe.throw(_("Account: {0} can only be updated via Stock Transactions")
.format(account), StockAccountInvalidTransaction)
# This has been comment for a temporary, will add this code again on release of immutable ledger
elif account_bal != stock_bal:
precision = get_field_precision(frappe.get_meta("GL Entry").get_field("debit"),
currency=frappe.get_cached_value('Company', gl_map[0].company, "default_currency"))