Commit Graph

187 Commits

Author SHA1 Message Date
Marica
d6078aa911
fix: Respect system precision for user facing balance qty values (#30837)
* fix: Respect system precision for user facing balance qty values

- `get_precision` -> `set_precision`
- Use system wide currency precision for `stock_value`
- Round of qty defiiciency as per user defined precision (system flt precision), so that it is WYSIWYG for users

* fix: Consider system precision when validating future negative qty

* test: Immediate Negative Qty precision test

- Test for Immediate Negative Qty precision
- Stock Entry Negative Qty message: Format available qty in system precision
- Pass `stock_uom` as confugrable option in `make_item`

* test: Future Negative Qty validation with precision

* fix: Use `get_field_precision` for currency precision as it used to

- `get_field_precision` defaults to number format for precision (maintain old behaviour)
- Don't pass `currency` to `get_field_precision` as its not used anymore
2022-06-17 15:13:13 +05:30
Ankush Menat
7e2fbc050a fix: sort before picking next stock reco 2022-05-09 13:16:02 +05:30
Ankush Menat
7c839c4503 fix: double future qty updates
update_qty_in_future_sle is reprocessing rows which are already
processed by process_sle_against_current_voucher
2022-05-09 11:28:21 +05:30
Ankush Menat
e1c1687661 refactor: use db agnostic CombineDatetime 2022-04-26 11:03:32 +05:30
Ankush Menat
8f519545b0 test: repost queue progress 2022-04-19 17:38:36 +05:30
Ankush Menat
ecdb49314f fix: dependent GLE reposting 2022-04-19 17:38:36 +05:30
Ankush Menat
a281998bcb fix: prevent deleting repost queue for cancelled transactions 2022-04-08 14:57:55 +05:30
Sagar Sharma
d074c93ac7 refactor!: change "is_subcontracted" field type from "Select" to "Check" 2022-04-01 13:22:44 +05:30
Ankush Menat
494bd9ef78 style: format code with black 2022-03-28 18:52:46 +05:30
Ankush Menat
b93ce78df1 chore: dont supress errors server side
not required after https://github.com/frappe/frappe/pull/16284
2022-03-16 17:50:34 +05:30
Ankush Menat
7dd10367f4 fix: only update valuation rate if not None 2022-03-10 18:08:29 +05:30
mergify[bot]
7a3d30161f
fix: translate error message titles (#30105)
(cherry picked from commit 456ebc32f00be56cc9972cc76ac412776581060a)

Co-authored-by: Türker Tunalı <turker.tunali@gmail.com>
2022-03-08 10:42:30 +05:30
Ankush Menat
701878f60b revert "fix: FIFO valuation in case of multi-item entries"
This reverts commit b8ee193d1a124668691b3d8181ce4e3bf612afe0.

This is huge performance regression for large docs.
2022-03-02 13:11:04 +05:30
Ankush Menat
ccd2ce56b1 fix: FIFO valuation in case of multi-item entries 2022-03-02 13:11:04 +05:30
Ankush Menat
eb8495a401 docs: explain make_sl_entries arguments 2022-03-02 12:27:18 +05:30
Ankush Menat
efc4b943f8 fix: ignore serial no during landed cost voucher 2022-03-02 12:27:18 +05:30
Ankush Menat
609d2fccad fix: reset stock value if no qty 2022-02-21 18:02:40 +05:30
Ankush Menat
35483242b3 fix: extend round_off_if_near_zero fix to other methods 2022-02-21 18:02:40 +05:30
Ankush Menat
b534fee2c7 refactor: use queue difference instead of actual values 2022-02-21 18:02:40 +05:30
Ankush Menat
aba7a7ce4e fix: handle negative inventory inside a batch 2022-02-21 18:02:40 +05:30
Ankush Menat
d7ca83ef0b refactor: code duplication for fallback rates 2022-02-21 18:02:40 +05:30
Ankush Menat
d130233ffc test: fix expected test failures 2022-02-21 18:02:40 +05:30
Ankush Menat
102fff24c8 refactor: convert query to QB and make creation optional 2022-02-21 18:02:40 +05:30
Ankush Menat
ab926521bd fix: correct incoming rate for batched items 2022-02-21 18:02:40 +05:30
Ankush Menat
342d09a671 feat: get_valuation_rate batch wise
This function is used to show valuation rate on frontend and also as
fallback in case values aren't available. Add "batch_no" param to get
batch specific valuation rates.

Co-Authored-By: Alan Tom <2.alan.tom@gmail.com>
2022-02-21 18:02:40 +05:30
Ankush Menat
ce0514c8db feat: batch wise valuation rates
start with most used case: negative inventory isn't enabled

- simple addition of qty and value when new batch qty is added
- fetch outgoing rate from stock movement of specific batch
2022-02-21 18:02:40 +05:30
Ankush Menat
eb8b424722
feat: item-wise negative stock setting (#29761) 2022-02-12 13:08:28 +05:30
Ankush Menat
f089d39675 refactor: better method name
Co-authored-by: gavin <gavin18d@gmail.com>
2022-02-06 20:12:15 +05:30
Ankush Menat
97e18a1cd0 feat: allow selecting LIFO valuation 2022-02-06 20:12:11 +05:30
Ankush Menat
b855030e7c refactor: valuation class to allow extending 2022-02-06 20:12:11 +05:30
Marica
dbda10e092
Merge pull request #28987 from ankush/fix/srvaluation
fix: incorrect serial no valuation
2022-01-17 16:55:21 +05:30
Ankush Menat
66bf21f143
fix(patch): sle.serial_no = "\n" causes incorrect queue (#29306)
This happens due to old data.
2022-01-16 20:45:59 +05:30
Ankush Menat
82ea958730
fix: ignore cancelled SLEs (#29303) 2022-01-16 20:19:04 +05:30
Ankush Menat
b0cf6195e9
fix: only add stock queue if FIFO (#29302) 2022-01-16 13:02:23 +05:30
Ankush Menat
b9642a1036 fix: incorrect incoming rate computation for sr no 2022-01-16 12:39:34 +05:30
Ankush Menat
ff9a6e8e89 fix: correct bin qty on backdated transactions
When making a backdated transactions current balance qty depends on
evaluation of whole ledger inbetween, instead of doing that just fetch
the last sle's qty_after_transaction when future transactions are
detected against SLE

fix: don't update bin's actual_qty

1. it's already updated by repost_current_voucher
2. update if future sle exists
2021-12-20 20:05:49 +05:30
Ankush Menat
107b404105 chore: rename FifoValuation to FIFOValuation 2021-12-20 13:20:03 +05:30
Ankush Menat
a00d8d02b2 refactor: outgoing rate and defaults for remove_stock 2021-12-20 13:20:03 +05:30
Ankush Menat
4b29fb6d08 refactor: move Fifo Valuation to a new class 2021-12-20 13:20:03 +05:30
Ankush Menat
5eba57528c fix: check future negative stock for batches
batch's ledger is only maintained in form of `actual_qty` on batch's
SLEs. To validate if batch has any negative qty in future, cumulative
total of `actual_qty` is required to ensure it never goes negative.
2021-12-08 15:52:40 +05:30
Ankush Menat
cef84c25a7 refactor: simplify the way SLEs are submitted 2021-12-03 14:51:25 +05:30
Ankush Menat
97060c45e9 refactor: replace misleading variable name 2021-12-03 14:51:25 +05:30
Ankush Menat
aa024fc9da fix: ignore permissions while creating repost
If user reached this code then they already have permission to create
stock transaction, hence ignore permission checks while
creating/cancelling repost item valuation entries.
2021-11-22 12:40:18 +05:30
Ankush Menat
8fe5feb6a4 chore: remove all six compat code 2021-11-05 11:16:29 +05:30
Ankush Menat
6098e92ba9 chore: remove utf-8 compat code 2021-11-05 11:16:29 +05:30
Ankush Menat
f7ffe04a4b fix: use warehouse to find company 2021-11-01 14:13:56 +05:30
Ankush Menat
a0727b2e82 fix: pass company while fetching valuation rate
If company is not supplied and valuation rate is 0, then default
company is used for checking if perpetual inventory is enabled or not.
This makes little sense as different companies can have different
setting for perpetual inventory.
2021-11-01 14:13:56 +05:30
Ankush Menat
4ebae7c5dc
Merge branch 'develop' into optimize-get-item-details 2021-10-12 20:39:49 +05:30
Ankush Menat
7bafa11d57
fix: undo changes to allow negative stock flag 2021-10-12 20:39:10 +05:30
Deepesh Garg
6f107da165
perf: Add indexes in stock queries and speed up bin updation #27758
perf: Add indexes in stock queries and speed up bin updation
2021-10-12 20:15:55 +05:30