* 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
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>
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
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
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.
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.
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.