* perf: only validate if voucher is journal entry
* perf: optimize merge GLE
- Order fields such that comparison will fail faster
- Break out of loops if not matched
* perf: don't try to match SLE if count mismatch
* refactor: simplify initialize_previous_data
* perf: use cache for fetching valuation_method
These are set only once fields
* refactor: simplify get_future_stock_vouchers
* refactor: simplify get_voucherwise_gl_entries
* perf: fetch only required fields for GL comparison
`select *` fetches all fields, output of this function is only used for
comparing.
* perf: reorder conditions in PL cost center check
* perf: reduce query while validating new gle
* perf: use cache for validating warehouse props
These properties don't change often, no need to query everytime.
* perf: use cached stock settings to validate SLE
* docs: update misleading docstring
Co-authored-by: Marica <maricadsouza221197@gmail.com>
* fix: Faulty Gl Entry for Asset LCVs
- Both Gl entries were crediting in their respective accounts
- Asset Account must be debited into
* fix: Use keyword arguments instead of positional for better readability
* chore: Test for LCV for draft asset created via Purchase Receipt
* fix: Faulty Gl Entry for Asset LCVs
- Both Gl entries were crediting in their respective accounts
- Asset Account must be debited into
* fix: Use keyword arguments instead of positional for better readability
* chore: Test for LCV for draft asset created via Purchase Receipt
* fix: price list with 0 value are ignored
Steps to reproduce:
1. Create 2 item price for two different supplier. One of them should be
zero.
2. Create PO
3. Add supplier with non-zero price and add item.
4. change supplier. Price won't change. If price was non-zero it
would've changed.
Root cause: falsiness check instead of null value check is used for
checking if price list value exists. 0 is evaluated as false.
* refactor: make get_price_list_rate function pure
(cherry picked from commit 16d4de5130)
Co-authored-by: Ankush <ankush@iwebnotes.com>
* fix: price list with 0 value are ignored
Steps to reproduce:
1. Create 2 item price for two different supplier. One of them should be
zero.
2. Create PO
3. Add supplier with non-zero price and add item.
4. change supplier. Price won't change. If price was non-zero it
would've changed.
Root cause: falsiness check instead of null value check is used for
checking if price list value exists. 0 is evaluated as false.
* refactor: make get_price_list_rate function pure
problem: exchange rate API is returning exchange rates for "_Test currency".
These tests were relying on failure of that function.
(cherry picked from commit 27a29eb6bc)
Co-authored-by: Ankush <ankush@iwebnotes.com>