Commit Graph

114 Commits

Author SHA1 Message Date
Ankush Menat
f38690f703 fix: check if Moving average item can use batchwise valuation 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
1553fa9c90 refactor!: drop deprecated and dead code 2022-02-11 11:23:37 +05:30
Ankush Menat
61c5ad44d3 refactor: get incoming fifo/lifo rate functions
Re-use same logic for computing incoming rate.
2022-02-06 20:12:15 +05:30
Ankush Menat
08810dbcce fix: add unique constraint on bin at db level 2022-01-30 18:42:59 +05:30
Ankush Menat
33c4a0b5a9 fix: bad default for non-existing serial nos
serial_no field should have empty string if it doesn't have any serial
nos
2022-01-21 15:27:10 +05:30
Noah Jacob
20216fa9f1
fix: updated packed_items getting fetched on Sales Return / Credit Note (#28607)
* fix: updated packed_items getting fetched on sales return

* fix: updated test cases for product bundle returns

* fix: moved calculate_mapped_packed_items_return to stock.utils

* fix: updated packed_items getting fetched on Return/Credit Note

* refactor: change var name to avoid `self`

* fix: check item code before assigning parent item

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-01-21 11:50:13 +05:30
rohitwaghchaure
f02e6b4631
fix: incorrect posting time fetching incorrect qty (#29103) 2022-01-03 14:28:34 +05:30
Ankush Menat
75bc404cbe test: stock frozen validation 2021-12-10 12:39:38 +05:30
Ankush Menat
d37541d3fb fix: ensure that reposting is finished before freezing stock/account 2021-12-10 12:31:49 +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
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
ff9cfe0d14 fix: sort by creation to break tie 2021-10-29 16:56:15 +05:30
Ankush Menat
f4b60a48f5 refactor: simplify sr no fetching 2021-10-29 16:56:15 +05:30
Ankush Menat
2aa019ae4c fix: fetch serial nos from ledger unconditionally 2021-10-29 16:56:15 +05:30
Noah Jacob
deb6b38fab refactor: replaced db.sql with qb 2021-10-29 16:56:15 +05:30
Noah Jacob
b44945380d fix: incorrect amount of serial_nos fetched 2021-10-29 16:56:15 +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
Chillar Anand
915b34391c
chore: Clean up imports (#27302)
* chore: Added isort to pre-commit config

* chore: Sort imports with isort

* chore: Clean up imports with pycln

* chore: Sort imports with isort

* chore: Fix import issues

* chore: Clean up sider issues

* chore: Remove import errors from flake8 ignore list

* chore: Clean up lint issues
2021-09-02 16:44:59 +05:30
Ankush
9152715f90
perf: various minor perf fixes for ledger postings (#26775)
* 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>
2021-08-11 11:17:50 +05:30
Noah Jacob
d8668f78f4
fix: validation check when no conversion_factor (#26219) 2021-07-15 18:32:15 +05:30
Rohit Waghchaure
4d81d45a0e fix: time out while submitting the stock transactions with more than 50 items 2021-06-19 16:15:08 +05:30
rohitwaghchaure
00ea336b52
fix: stock ledger entry created against draft stock entry (#25540) 2021-05-01 13:53:39 +05:30
Jannat Patel
30c8873f24
fix: validation for disabled warehouse (#24539)
* fix: validation for disabled warehouse

* fix: better function name

* fix: validation in stock ledger entry
2021-02-11 11:46:48 +05:30
Nabin Hait
a77b8c9fcc
Repost item valuation (#24031)
* feat: Reposting logic for future finished/transferred item

* feat: added fields to identify needs to recalculate rate while reposting

* refactor: Set rate for outgoing and finished items

* refactor: Arranged fields in Stock Entry item table and added fields to identify finished and scrap item

* refactor: Arranged fields in Stock Entry item table and added fields to identify finished and scrap item

* refactor: Get outgoing rate for purchase return

* refactor: Get incoming rate for sales return

* test: Added tests for reposting valuation of transferred/finished/returned items

* feat: added incoming rate field in DN, SI and Packed Item table

* feat: get incoming rate for returned item

* fix: no error while getting valuation rate in stock entry

* fix: update stock ledger for DN and SI

* feat: update item valuation rate in PR and PI based on supplied items cost

* feat: SLE reposting logic for sales return and subcontracted item with test cases

* feat: update qty in future sle

* feat: repost future sle and gle via Repost Item Valuation

* fix: Skip unwanted function calling while reposting

* fix: repost sle for specific item and warehouse

* test: Modified tests for backdated stock reco

* fix: ignore cancelled sle in few methods

* feat: role allowed to do backdated entry

* feat: Show reposting status on stock valuation related reports

* fix: minor fixes

* fix: fixed sider issues

* fix: serial no fix related to immutable ledger

* fix: Test cases fixes related to perpetual inventory

* fix: Test cases fixed

* fix: Fixed reposting on cancel and test cases

* feat: Restart reposting item valuation

* refactor: Code cleanup using small functions and test case fixes

* fix: minor fixes

* fix: Raise on error while reposting item valuation

* fix: minor fix

* fix: Tests fixed

* fix: skip some validation ig gle made from reposting

* fix: test fixes

* fix: debugging stock and account validation

* fix: debugging stock and account validation

* fix: debugging travis for stock and account sync validation

* fix: debugging travis

* fix: debugging travis

* fix: debugging travis
2020-12-21 14:45:50 +05:30
Anurag Mishra
09b8ca0ddb fix: list index out of range on incilding uom 2020-11-04 15:04:50 +05:30
marination
6f7e9d2904 fix: '>=' not supported between instances of 'str' and 'int' 2020-06-03 17:13:58 +05:30
Deepesh Garg
2a9c5badc6
feat: Immutable ledger (#18740)
* fix: Reverse GL entry on cancellation of document

* fix: Removed set posting time field for multiple docs

* fix: Stop future reposting and reverse entry for purchase receipt and delivery note

* fix: Change is_cancelled field from select to check

* Revert "fix: Removed set posting time field for multiple docs"

This reverts commit 81fb808db7da69ab1e58ba226c0cd0b77e5b90c8.

* fix: Multiple fixes in GL Entry

* fix: Remove future reporting from doctypes

* fix: Canceled entry filters in Stock Ledger and General Ledger Report

* fix: Remove print statement

* fix: Validation for back dated entries

* fix: Codacy fixes

* fix: Add ignore links to multiple doctypes

* fix: Codacy Fixes

* fix: Ignore GL Entry and Stock Ledger entry while cancel

* fix: Test case fixes

* fix: Patch

* fix: Codacy

* fix: Budget Test Cases

* fix: Patch

* fix: Patch

* fix: Multiple test cases

* fix: changes in make_reverse_entry function

* fix: Update patch

* fix: Test Cases

* fix: Test Case fixes

* fix: Move patch upward in patches.txt

* fix: Budget Test Cases

* fix: Test Case and codacy

* fix: Patch

* fix: Minor label and UX fixes

* fix: Move freezing date check

* fix: Test Cases

* fix: Test cases

* fix: Test Cases

* fix: Test Case

* fix: Remove update_gl_entries_after function

* fix: Remove update_gl_entries_after function

* fix: Test Cases

* fix: Fiscal Year wise backdated entry

* fix: Update entries only for current SLE

* fix: Remove is_cancelled

* fix: Test Cases

* fix: Test cases

* fix: Test Cases

* fix: Uncomment account and stock balance sync logic

* fix: Stock balance and Account balance out of sync fixes

* fix: Test Cases

* fix: Test cases for POS, Stock Reco and Purchase Receipt

* fix: Stock Reco tests

* fix: Test stock reco precision

* fix: Test stock reco for fifo precision

* fix: Test stock reco for fifo precision

* fix: Stock Entry test case

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-30 10:38:58 +05:30
Rohit Waghchaure
560f822dbf fix: get serial nos based on posting date and time 2020-04-07 14:42:02 +05:30
rohitwaghchaure
b5a670cdb9
fix: serial no material transfer performance issue (#20747) 2020-02-27 18:18:10 +05:30
Rohit Waghchaure
cf55c9c6da fix: stock reconciliation shwoing incorrect current serial no and qty 2019-11-14 18:22:20 +05:30
rohitwaghchaure
001ee5ee1b fix: dictionary changed size during iteration (#19546) 2019-11-11 17:43:48 +05:30
rohitwaghchaure
ed1cc18ab5 fix: stock ledger report not showing data if the UOM filter has selected (#19179) 2019-09-30 15:15:52 +05:30
Suraj Shetty
bc001d2d9a feat: Add stock ageing data to stock balance report (#19036)
* feat: Add stock ageing data to stock balance report

* fix: Use fifo queue warehouse wise

* fix: "Stock Ledger Entry" get query

* fix: Remove unwanted quotes in item details query

* fix: Check if no SLE was passed

* fix: Codacy

* fix: Add logic to include additional UOM columns

* fix: Show stock ageing data optionally
2019-09-16 19:57:04 +05:30
rohitwaghchaure
f1fab871b8 fix: mismatch between warehouse tree value and warehouse based stock balance report value (#18879) 2019-09-05 14:47:43 +05:30
Rohit Waghchaure
87c4b06437 Test cases for serial no 2019-06-02 16:29:07 +05:30
Rohit Waghchaure
05d3bcb63d stock recon for serial no, batch no 2019-06-02 16:29:06 +05:30
itusedyetnew
8aafbd22de
stock_values_on append function on string 2019-03-20 11:10:41 +05:30
Aditya Hase
0c16424d7d fix(naming): Use creation instead of name to order SLEs 2019-01-08 00:09:36 +05:30
Saif
b4cf72c770 Adding "Include UOM" in Reports with Qty and Rates (#15541)
* Added Include UOM field for Stock Balane, Stock Ledger and Stock Projected Qty

* Add columns in result list-of-lists instead of converting reports to list-of-dicts

* For requested changes
-Merged conversion factor query with item detail queries
-Ensuring snail_case
-Made columns consistently list-of-dicts
2018-10-18 17:59:47 +05:30
Nabin Hait
a804d6d487 Fixed merge conflict 2018-08-29 13:34:58 +05:30
Shreya Shah
e0a47aeb2f Improve performance for warehouse tree (#15207)
* Fix conflicts

* Modify query structure

* Remove whitespaces
2018-08-28 13:46:22 +05:30
Sachin Mane
19a5a5dcf4 improve performance of stock_value retrieval using tabBin instead of … (#14584)
* improve performance of stock_value retrieval using tabBin instead of stock ledger

* rename fn

* rename fn

* Update warehouse.py
2018-06-21 13:01:48 +05:30
Achilles Rasquinha
b4de7e3d07 removed has_key, used pythonic in (#13236)
* removed has_key, used pythonic in

* Update bom.py
2018-03-09 12:35:47 +05:30
Achilles Rasquinha
56b2e12af8 Python 3 fixes [merge asap] (#12884)
* Python 3 fixes

* fixed compare
2018-02-13 14:42:40 +05:30
Nabin Hait
7ba092eaf9
Fixes for making stock entry against Pro Order (#12721) 2018-02-01 10:51:27 +05:30
rohitwaghchaure
60febc5465 [Fix] Gross profit validation issue (#12516) 2018-01-17 14:40:59 +05:30