Commit Graph

136 Commits

Author SHA1 Message Date
rohitwaghchaure
e6a1ad8016
fix: not able to submit stock entry with 350 items (#27523) 2021-09-15 20:42:47 +05:30
Frappe PR Bot
d4d5e2786f
fix: Maintain same rate in Stock Ledger until stock become positive (#27227) (#27478)
* fix: Maintain same rate in Stock Ledger until stock become positive

* fix: Maintain same rate in Stock Ledger until stock become positive

(cherry picked from commit 10754831c33b3459d5a45c98f875afa48a444627)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-09-15 17:07:58 +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 Menat
c1d986a0c6
fix: revert "refactor: simplify initialize_previous_data" (#27270)
This reverts commit 2f5624e588541103adb4a3170f2886590dcee42e.
2021-08-31 19:43:42 +05:30
Ankush Menat
e7109c18db
fix: negative qty validation on stock reco cancellation (#27170)
* test: negative stock validation on SR cancel

* fix: negative stock setting ignored in stock reco

In stock reconcilation cancellation negative stock setting is ignored as
`db.get_value` is returning string `'0'` which is not casted to int/bool
for further logic. This causes negative qty, which evantually gets
caught by reposting but by design this should stop cancellation.

* test: typo and minor refactor
2021-08-26 16:40:45 +05:30
rohitwaghchaure
fe4540d74d
fix: allow to change rate manually in case of stand-alone credit note (#27036)
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-08-26 12:52:36 +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
rohitwaghchaure
31fe5f5b92
fix: added progress bar in repost item valuation (#26680) 2021-08-02 11:01:30 +05:30
Nabin Hait
97bce3af9a refactor: Optimized code for reposting item valuation 2021-07-12 13:33:08 +05:30
marination
8c441263f8 fix: Sider 2021-07-05 21:59:04 +05:30
marination
4038977e2e fix: Handle Stock Reco cancellation and limit reposting
- Handled cancellation of reco with and without prior SLE
- Repost / Recalculate balance qty only till next stock reco
2021-07-05 21:58:57 +05:30
marination
8418c4bfe0 fix: Include Stock Reco logic in update_qty_in_future_sle 2021-07-05 21:58:50 +05:30
Rohit Waghchaure
e5fb23972a fix: available qty for consumption 2021-06-20 15:28:25 +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
Ankush Menat
9891780f5a
perf(minor): remove unnecessary comprehensions (port #25645) 2021-06-11 18:40:22 +05:30
Ankush Menat
4dcac4ae81
refactor(minor): Use identity instead of equality
Ignore false positive.
2021-05-21 13:49:58 +05:30
Ankush Menat
9979cf5fcc
fix: wrong quantity after transaction for parallel stock transactions
When two transactions are inserted parallelly then previous SLE could be
incorrect for some of them. Locking SLE table would prevent reading from
it till transaction is complete.
2021-05-21 12:31:06 +05:30
Rohit Waghchaure
bb3e5d00f4 fix: allow to receive same serial numbers multiple times 2021-05-06 12:38:35 +05:30
rohitwaghchaure
00ea336b52
fix: stock ledger entry created against draft stock entry (#25540) 2021-05-01 13:53:39 +05:30
rohitwaghchaure
1bdc457777
Merge pull request #25304 from ankush/fix_sl_rounding
fix(stock_ledger): round off values near to zero
2021-04-15 14:44:09 +05:30
rohitwaghchaure
ce6c3b5b74
fix: incorrect incoming rate for the sales return (#25306) 2021-04-13 20:55:52 +05:30
Ankush Menat
6a014d12c1
fix(stock_ledger): round off values near to zero 2021-04-12 20:21:27 +05:30
Sagar Vora
e50324aed7
perf: reduce number of queries for checking if future SL entry exists (#25064) 2021-03-31 12:44:03 +05:30
Sagar Vora
868c0bf45b
perf: reduce no of queries for checking if future sl entry exists (#24881) 2021-03-27 16:10:20 +05:30
Nabin Hait
d46b23699c
fix: optimize reposting of gle and sle (#24702)
* fix(india): escape for special characters in JSON (#24695)

JSON does not accept special whitespace characters like tab, carriage
return, line feed

Ref: https://www.ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf

Related issue: ISS-20-21-09811

* fix: Accounting Dimension creation background job timeout

* fix(regional): vehicle no is mandatory for ewaybill generation (#24679)

* fix: vehicle no required for e-invoice

* fix: ewaybill generation dialog condition

* fix: excluding unidentified accounts from gstr-1

* fix: optimize reposting of sle and gle (#24694)

* fix: optimize update_gl_entries_after method

* fix: Optimized reposting patch

* fix: accounting dimensions

* added reload_doc in patch

* Update item_reposting_for_incorrect_sl_and_gl.py

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>

* fix: Replaced spaces with tabs

* fix: merge conflict

* fix: test cases

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
Co-authored-by: pateljannat <pateljannat2308@gmail.com>
Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2021-02-23 16:38:52 +05:30
Nabin Hait
19f8fa59d3
fix: optimize reposting of sle and gle (#24694)
* fix: optimize update_gl_entries_after method

* fix: Optimized reposting patch

* fix: accounting dimensions

* added reload_doc in patch

* Update item_reposting_for_incorrect_sl_and_gl.py

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2021-02-22 22:27:22 +05:30
Nabin Hait
186a045e28 fix: update qty in future sle (#24649)
* fix: update qty in future sle

* fix: validate cancellation due to ongoing reposting

* fix: process sle against current timestamp
2021-02-18 21:28:28 +05:30
Nabin Hait
deddcc513d fix: stock and account balance syncing (#24644)
* fix: stock and account balance syncing

* fix: stock and account balance syncing

* fix: stock and account balance syncing

* fix: minor fix
2021-02-18 21:28:16 +05:30
Nabin Hait
f2be0805f7 fix: formatting query args (#24627) 2021-02-18 21:25:59 +05:30
rohitwaghchaure
83792ec009 fix: reposting issue with same posting date and posting time (#24570)
* fix: reposting issue with same posting date and posting time

* Update erpnext/stock/stock_ledger.py

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-02-18 21:24:48 +05:30
Nabin Hait
d826bee13a
fix: update qty in future sle (#24649)
* fix: update qty in future sle

* fix: validate cancellation due to ongoing reposting

* fix: process sle against current timestamp
2021-02-18 14:14:21 +05:30
Nabin Hait
9b178bcd10
fix: stock and account balance syncing (#24644)
* fix: stock and account balance syncing

* fix: stock and account balance syncing

* fix: stock and account balance syncing

* fix: minor fix
2021-02-16 14:57:00 +05:30
Nabin Hait
243661b37b
fix: formatting query args (#24627) 2021-02-15 19:27:49 +05:30
rohitwaghchaure
aa00eb9898
fix: reposting issue with same posting date and posting time (#24570)
* fix: reposting issue with same posting date and posting time

* Update erpnext/stock/stock_ledger.py

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-02-11 13:23:01 +05:30
Nabin Hait
7177579051
fix: Dependant sle logic fixes (#24489)
* fix: Dependant sle logic fixes

* fix: negative qty validation

* fix: Travis fixes
2021-02-02 22:03:07 +05:30
Nabin Hait
243d59b0c3
Reposting logic fixes (#24520)
* fix: Dependant sle logic fixes

* fix: negative qty validation

* fix: Travis fixes

* fix: test fix
2021-02-02 16:55:13 +05:30
Deepesh Garg
b4be292217
fix: Item valuation for internal stock transfers (#24200)
* fix: Item valuation for internal stocktransfers

* fix: Consider conversion factor for invoices

* fix: Add missing set warehouse fields

* fix: Add validations and other fixes

* fix: Fixes in flow

* fix: Internal sales item link in Purchase Invoice

* fix: Debugging

* fix: Debug travis

* fix: Remove commented code

* fix: Rate forcing in sales order

* fix: Unreallized profit in Sales Register

* fix: Item wise gst sales register fix

* fix: From warehouse in Purchase Order

* fix: Target field in Sales Invoice

* fix: remove self

* fix: GST Purchasse register and other fixes

* fix: Add shipping_address to no field map

* fix: Ref doc map

* fix: Test Cases

* fix: address mapping between sales and purchase document

* fix: Import Error

* fix: Tax updation for internal invoices

* fix: Purchase Order and Invoice linking

* fix: Internal Party validation fix

* fix: validation

* fix(india): GST Taxes for intra state transfer

* fix(india): GST Taxes for intra state transfer

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-01-28 13:09:56 +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
Deepesh Garg
cb0bc2dcaf fix: Negative SLE not created for fraction qty or qty less than 1 2020-08-23 20:43:50 +05:30
Marica
97715f2877
fix: Message for missing valuation rate (#21686) 2020-05-11 20:45:37 +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
marination
6f0dc8257c fix: Typo in stock level validation in Stock Ledger 2020-04-01 11:04:14 +05:30
Nabin Hait
328c4f9b92 fix: Get outgoing rate of serial no from SLE if serial no already transferred to another company 2020-01-02 19:00:47 +05:30
rohitwaghchaure
805b8634da fix: incorrect stock value difference when stock move from negative to positive (#18887) 2019-09-05 12:18:33 +05:30
Rohit Waghchaure
d03d8204ab fix: incorrect valuation rate calculated because of string replacement issue 2019-08-28 17:22:50 +05:30
Mangesh-Khairnar
0df513434e fix: valuation rate in stock ledger (#18744)
* fix: valuation rate in stock ledger

* test: allow zero valuation rate for items
2019-08-19 10:04:52 +05:30
deepeshgarg007
f9c0ef3eb3 fix: Check zero valuation rate only for valid doctypes 2019-07-30 19:01:53 +05:30
Nabin Hait
ca25b925f5 fix: Calcellation logic for reconciliation of serialized items 2019-07-22 17:00:32 +05:30
Rohit Waghchaure
66aa37f1e2 provision to add batch number in the stock reconciliation 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