Commit Graph

270 Commits

Author SHA1 Message Date
ruthra kumar
7312f22f35 refactor: update voucher outstanding from payment ledger
Outstanding amount is updated from payment ledger, only for
receivable/payable accounts. For remaining account types, update happens
from GL Entry.
2022-06-17 17:57:07 +05:30
ruthra kumar
524c175cf0 refactor: delink gl entry from reconciliation 2022-06-17 17:57:07 +05:30
ruthra kumar
8c87674c62 refactor: outstanding_invoice function and helper class
outstanding invoice function has been refactored to use payment ledger
2022-06-17 17:57:07 +05:30
ruthra kumar
7b383880c6 feat: helper class for quering Payment Ledger 2022-06-17 17:57:07 +05:30
Conor
74a782d81d
refactor: DB independent quoting and truthy/falsy values (#31358)
* refactor: DB independent quoting and truthy/falsy values

* style: reformat to black spec

* fix: ifnull -> coalesce

* fix: coalesce -> Coalesce

* fix: revert pypika comparison

* refactor: convert queries to QB

* fix: incorrect value types for query

`=` query makes no sense with list of values

* fix: remove warehouse docstatus condition

* fix: keep using base rate as rate

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-17 17:01:27 +05:30
Ankush Menat
86919d2a6d
test: silent test failure in stock assertions (#31377)
If actual values are not present then test is silently passing, # of
actual values should be at least equal to expected values.
2022-06-15 21:19:09 +05:30
Ankush Menat
5c6f22f275
refactor: simpler batching for GLE reposting (#31374)
* refactor: simpler batching for GLE reposting

* test: add "actual" test for chunked GLE reposting
2022-06-15 19:30:26 +05:30
Ankush Menat
2535d5edd0
perf: GLE reposting with progress and chunking (#31343)
If stock voucher count goes >1000 then fetching all gles and reposting
them all at once requires much more memory and can cause crash.

- This PR ensures that GLE reposting is done in chunks of 100 vouchers.
- This PR also starts keeping track of how many such chunks were
  processed so in future progress is resumed in event of timeout.
2022-06-14 18:20:33 +05:30
Gavin D'souza
0727d1d99b refactor: get_fiscal_years API
* Optimize fiscal year options generation
* Don't pass unrequired criterions / values to prepared query
* Use QB notation for raw query
2022-06-13 12:43:08 +05:30
Ankush Menat
eb53a9727d perf: commit GL reposting periodically
If you have a huge list of docs to repost then maintaining transaction
throughtout entire GL reposting is not only unnecessary but also creates
performance issues. Periodically commiting the changes prevents lost
progress and reduces memory usage.
2022-06-09 11:37:43 +05:30
Ankush Menat
67c26325ee fix: unnecessary GLE reposts
In Sales/Purchase invoices credit/debit are flipped and negated while making GLE,
this is unflipped while posting them but if we compare the flipped ones
it will always result in comparison failure and repost it.
2022-06-09 11:37:40 +05:30
ruthra kumar
451cf3a937 refactor: helper class for ple creation and delinking
Helper functions for delinking ple and for creating payment ledger
entry for transactions on receivable/payable account types
2022-05-20 18:21:47 +05:30
Ankush Menat
700e864d90 fix: sort stock vouchers before reposting GLE 2022-04-19 17:40:26 +05:30
marination
d75d5ebe8d chore: Remove Values Out of Sync from Repost hourly job
- It runs after repost (after commiting), so it has 0 impact on repost itself
- Just that scheduled job log shows up as failed, while actually repost is done and repost document is "Completed"
- The check is inaccurate also, so best to remove this
- Users cant do anything about it anyway. This just piles up phantom failed jobs unneccessarily
2022-04-14 12:30:06 +05:30
Ankush Menat
494bd9ef78 style: format code with black 2022-03-28 18:52:46 +05:30
Ankush Menat
9c7df2eec5 fix: ignore duplicates explicitly 2022-02-23 14:27:45 +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
Anuja Pawar
1a6e98ed48
fix(Payment Reconciliation): clear child tables on company/party change (#28008) 2021-10-29 20:52:47 +05:30
Saqib
9051735529
perf: fetching of account balance in chart of accounts (#27661) 2021-10-04 11:44:46 +05:30
rohitwaghchaure
058d98342a
fix: missed to add voucher_type, voucher_no to get GL Entries (#27368)
* fix: missed to add voucher_type, voucher_no to get gl entries

* test: get voucherwise details utilities

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-09-07 12:14:40 +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
Anuja Pawar
3e404f15ff
refactor: payment reconciliation tool (#27128) 2021-08-31 18:59:29 +05:30
Shadrak Gurupnor
7433757489
fix: patches were breaking during migration (#27200)
* fix: patches were breaking during migrating

* fix: patches were breaking during migration
2021-08-27 18:00:16 +05:30
Deepesh Garg
df185045a1
Merge branch 'develop' into payment_entry_validations_and_trigger_develop 2021-08-23 10:34:28 +05:30
Deepesh Garg
13fb71f642
Merge branch 'develop' into payment_entry_validations_and_trigger_develop 2021-08-11 18:20:42 +05:30
Deepesh Garg
7141860c04 test: Update exchange rate in test cases 2021-08-11 11:50:39 +05:30
Deepesh Garg
b5162390e5 fix: Only do specific validations on reference unlink 2021-08-11 11:50:39 +05:30
Deepesh Garg
188bba8feb fix: Validation for receivingfrom customer against negative outstanding 2021-08-11 11:50:39 +05:30
Deepesh Garg
c5276f3fd3 fix: Multiple fixes in payment entry 2021-08-11 11:50:16 +05:30
Afshan
976ae13c1e
Merge branch 'develop' into payment-reconc-party-validation-fix 2021-08-11 11:49:27 +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
Saqib
5c9d4db0e9
Merge branch 'develop' into payment-reconc-party-validation-fix 2021-08-04 13:57:00 +05:30
Rohit Waghchaure
2a14f255cf fix: COGS account in purchase receipt 2021-07-31 11:14:14 +05:30
Subin Tom
b8845b9ed9 Fix: Payment Entry party validation issue 2021-07-30 16:30:18 +05:30
Ankush Menat
5764b49767
fix: remove incorrect field check from reposting 2021-07-29 15:41:22 +05:30
Deepesh Garg
a72589cb7e fix: Add accounts and templates for reverse charge 2021-07-13 16:48:06 +05:30
Saqib
a20999cfbc
fix: exchange gain loss not set for advances linked with invoices (#25369) 2021-07-12 14:33:23 +05:30
Ankush Menat
9891780f5a
perf(minor): remove unnecessary comprehensions (port #25645) 2021-06-11 18:40:22 +05:30
Deepesh Garg
f54d596ae1 fix: Precision issues while allocating advance amoount 2021-03-31 14:06:02 +05:30
Rohit Waghchaure
bc8c9de26d fix: patch failing because of incorrect gl entries 2021-02-23 18:26:48 +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
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
rohitwaghchaure
d60ff83b6f
fix: added patch to fix incorrect stock qty and account value (#24628) 2021-02-16 09:12:27 +05:30
Nabin Hait
b99c77b753
Reposting fixes (#24202)
* fix: finished item validation and rate

* fix: Check if stock and account balance in sync after reposting

* fix: validate stock accounts in journal entry

* fix: validate expense against budget
2020-12-25 18:12:35 +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
Anuja P
550cb9c78f fix: suggested changes 2020-12-07 11:11:00 +05:30
Anuja P
b6cf75d2a8 fix: error messsage indent fix 2020-12-05 22:25:17 +05:30
Anuja P
2e4faf96f2 fix: Added TDS Payable account number and an error message 2020-12-05 13:36:43 +05:30
Mangesh-Khairnar
5c29eb08c4 Merge branch 'develop' of https://github.com/frappe/erpnext into mpesa-integration 2020-10-19 18:29:46 +05:30