Commit Graph

296 Commits

Author SHA1 Message Date
mergify[bot]
b877fa60db fix: Remove current fiscal year from Global Defaults (#35960)
* fix: Remove current fiscal year from Global Defaults (#35960)

* fix: Remove current fiscal year from Global Defaults

* fix: Remove button to set default

* fix: Add utils to get fiscal year

* fix: Incorrect import

* feat: Add hook for naming series parser

(cherry picked from commit 6270607c6d)

# Conflicts:
#	erpnext/accounts/doctype/fiscal_year/fiscal_year.py
#	erpnext/patches.txt
#	erpnext/public/js/utils.js

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-07-17 11:52:37 +05:30
mergify[bot]
59b3277696 fix: also check on_hold (#35910)
fix: also check on_hold (#35910)

(cherry picked from commit 5aa02b8571)

Co-authored-by: RJPvT <48353029+RJPvT@users.noreply.github.com>
2023-07-10 20:34:32 +05:30
mergify[bot]
ebf3c0173e feat: Closing balance for period closing and reporting (#34257)
* feat: Introduce opening entry for reporting

(cherry picked from commit 9739d8b52a)

* feat: Introduce opening entry for reporting

(cherry picked from commit b44a19bd1a)

* fix: Add patches to create accounting dimension in Closing Balance

(cherry picked from commit 36c08d0835)

* feat: Cascade closing balances on PCV submit

(cherry picked from commit c3f39c3f32)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
#	erpnext/patches.txt

* feat: Add views in standard filter

(cherry picked from commit e18336ebe7)

* chore: Rewrite query using query builder

(cherry picked from commit 7fa7d6b5e4)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py

* feat: Add validations against period closing voucher

(cherry picked from commit f92c63fb10)

* fix: Order by issue in aggregation query

(cherry picked from commit 6607c8bd82)

* fix: Add patch to update closing balances

(cherry picked from commit a663df376c)

* fix: Closing balance entries for period closing voucher

(cherry picked from commit 436fc03eda)

* fix: Update patch to generate closing balance entries

(cherry picked from commit 95c9aafda9)

# Conflicts:
#	erpnext/patches.txt

* perf: Apply closing balance in Trial Balance report

(cherry picked from commit e5f603c9d9)

# Conflicts:
#	erpnext/accounts/report/trial_balance/trial_balance.py

* chore: Minor fixes

(cherry picked from commit c089c4156c)

# Conflicts:
#	erpnext/patches.txt

* fix: Aggregation with previous closing balance

(cherry picked from commit 4a2046dfb6)

# Conflicts:
#	erpnext/patches.txt

* test: Add static posting dates to tests

(cherry picked from commit 310f71c313)

* chore: Add index to period closing voucher column

(cherry picked from commit 5dabc98ba5)

* chore: rename Closing Balance to Account Closing Balance

(cherry picked from commit 3249a79f07)

* test: Add test case for closing balance

(cherry picked from commit f0267feca8)

* chore: Use account closing balance in set gl entries

(cherry picked from commit 0157fa15eb)

# Conflicts:
#	erpnext/accounts/report/financial_statements.py

* fix: Update patch

(cherry picked from commit 76775a3e49)

* fix: Account sub query

(cherry picked from commit 7f11373b58)

* chore: Simplify query

(cherry picked from commit 00fe3042b2)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py

* chore: Add missing validations

(cherry picked from commit 0aadb680eb)

* chore: Remove unnecessary list comprehension

(cherry picked from commit 44053db010)

# Conflicts:
#	erpnext/accounts/report/financial_statements.py

* fix: Ignore opening entries if PCV posted

(cherry picked from commit f9397a87ac)

# Conflicts:
#	erpnext/accounts/report/financial_statements.py

* fix: Don't validate if no GL Entry exists

(cherry picked from commit 528ab503f2)

* chore: Fix Typo

(cherry picked from commit 3fd95200da)

* fix: Validation for cancelation

(cherry picked from commit 30eb6c8512)

* fix: Partial trial balance view

(cherry picked from commit b7dcf27b01)

* fix: CS financial statement param

(cherry picked from commit f8cff09129)

* chore: Improve validation message

(cherry picked from commit 8ce1da111e)

* chore: Resolve conflicts

* chore: Resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-07-10 18:04:45 +05:30
ruthra kumar
862c5145c1 refactor: submit and make JV through background job
(cherry picked from commit 4f51c5a433)

# Conflicts:
#	erpnext/setup/doctype/company/company.json
2023-07-10 07:31:19 +00:00
mergify[bot]
b0234489ca fix: Remove special treatment for P&L Accounts (#35602)
fix: Remove special treatment for P&L Accounts

(cherry picked from commit 0bd4de4504)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-06-23 15:55:51 +05:30
mergify[bot]
39b5147768 perf: Journal Entries (backport #34918) (#35054)
* refactor: rewrite `get_stock_value_on()` queries in `QB`

(cherry picked from commit e43bc38e05)

* refactor: sum up SLE value in query

(cherry picked from commit 9a37ac6c25)

* refactor: `get_stock_value_on()` to get stock value of multiple warehouses at once

(cherry picked from commit e782a054c8)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-04-25 21:53:07 +05:30
mergify[bot]
5923a80a0f feat: Reconcile Payments in background (#34596)
feat: Reconcile Payments in background (#34596)

* feat: auto reconcile in background

* chore: Option to enable auto reconciliation in settings

* refactor: validate if feature is enabled in settings

* refactor: check for running job while using reconciliation tool

* chore: using doc to get filter values

* chore: use frappe.db.get_value in validations

* chore: cleanup commented out code

* chore: replace get_list with get_all

* chore: use block scope variable

* chore: type information for functions

* refactor: flag to ignore job validation check

* refactor: update parent doc status if all reconciled

* chore: create test_records file

* test: create a bunch of vouchers for testing auto reconcile

* chore: renamed auto_reconcile to process_payment_reconciliation

* chore: another child doctype to hold payments

* chore: remove duplicate field

* chore: add fetched payments to log

* chore: Popup comment message update

* chore: replace get_all with get_value

* chore: replace label in settings page

* chore: remove unit test and records

* refactor: status in reconciliation log

* refactor: set status in log as well

* chore: fix field name

* chore: change triggered job name

* chore: use status field in list view of log

* chore: status while there are no allocations

* refactor: split trigger function into two

* chore: adding cancelled status

* refactor: function trigger queued docs

* chore: cron job scheduled

* chore: fixing accouts settings json file

* chore: typos and variable scope

* chore: use 'pluck' in db call

* chore: remove redundant whitelist decorator

* chore: use single DB call to fetch values

* chore: replace get_all with get_value

* refactor: use raw db calls to fetch reconciliation log records

Using get_doc on `Process Payment Reconciliation Log` is costly when
handling large volumes of invoices.

Use raw frappe.db.get_all to selectively pull status and reconciled count

* chore: update status on successful batch operation

* chore: make payment table readonly

* chore: ability to pause the background job

* chore: remove isolate_each_allocation

* chore: more description in progress bar

* refactor: partially working state

* refactor: update reconcile flag and setting hard limits for fetching

* chore: make allocation editable -- NEED TO REVERT

* chore: pause button

* refactor: skip setter function in Payment Entry for better performan

* refactor: split reconcile function and skip a setter function

1. Split reconcile function into 2
2. While reconciling against payment entry, skip a
set_missing_ref_details setter method

* chore: increase payment limit

* refactor: replace frappe.db.get_all with frappe.db.get_value

* chore: remove unwanted doctypes

* refactor: make allocation table readonly

* perf: update ref_details only for newly linked invoices

* chore: rename skip flag

* refactor(UI): receivable_payable field should auto populate

* refactor: no control statements in finally block

* chore: cleanup section and rename checkbox

* chore: update new fieldname in code

* chore: update error msg

* refactor: start and pause integrated into status

pause checkbox has been removed

* refactor: added cancelled status to the log doctype

1. Moved the status section to the bottom in parent doc
2. Using alerts to indicate Job trigger status

(cherry picked from commit ed14d1ce44)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-04-25 19:20:06 +05:30
ruthra kumar
8c5d644671 refactor: move set_missing_ref_detials out of set_missing_values
(cherry picked from commit 11cb2db3fe)
2023-04-20 13:29:47 +05:30
ruthra kumar
fd6db41b6e fix: removing redundant validation
(cherry picked from commit d52f7e2820)
2023-03-28 16:59:42 +05:30
ruthra kumar
c71d03555f fix: IntegrityError while cancelling journals against cr note
(cherry picked from commit b9a7ff7c3d)
2023-02-13 08:45:18 +00:00
ruthra kumar
8a498ed029 perf: improve reconciliation speed on JE's with 1000's of rows
1. No need to keep old PLE's on reconciliation.
2. Added Validation to catch debit-credit mismatch on JE's
3. Only update outstanding amount for newly reconciled invoices

(cherry picked from commit 11cf694d9a)
2023-01-16 04:12:07 +00:00
ruthra kumar
9b2b2812ca fix: cost_center filter gives incorrect output
filtering on cost center gives invoices that are reconciled as having outstanding

(cherry picked from commit 6d9d730759)
2022-12-15 09:33:07 +00:00
ruthra kumar
a399e2d765 refactor: split delete gl utility function into two
(cherry picked from commit 9209ec59c2)
2022-11-09 08:57:23 +00:00
ruthra kumar
9a5e238702 fix: party type and party mandatory on updating outstanding
(cherry picked from commit 43b80683eb)
2022-10-21 06:07:09 +00:00
ruthra kumar
a88ac4016a refactor: split ple creation function into two
refactor create_payment_ledger_entry function into 2.
one for generating ple map and one for DB entry creation

(cherry picked from commit 9b50221bf0)
2022-10-17 13:16:20 +00:00
Deepesh Garg
d9519f24aa chore: Remove HRMS related code (#32607)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
(cherry picked from commit dc3fe85921)
2022-10-17 06:09:25 +00:00
ruthra kumar
62cabdf792 fix: delete old ple's on item value repost
(cherry picked from commit 65992304bc)
2022-10-13 08:32:51 +00:00
ruthra kumar
8ba503bf0e fix: unlink payment on invoice cancellation
(cherry picked from commit 537d953f4c)
2022-10-10 11:12:38 +00:00
mergify[bot]
8851826a57 fix: fixes query builder order by issue in postgres (backport #32441) (#32465)
fix: fixes query builder order by issue in postgres (#32441)

* fix: fixes query builder order by issue in postgres

* fix: linter

(cherry picked from commit 69efd2ee24)

Co-authored-by: Shridhar Patil <shridhar.p@zerodha.com>
2022-10-03 16:25:23 +05:30
Nabin Hait
f752822bb3 fix: abbreviation issue on renaming cost center
(cherry picked from commit af21a11e1e)
2022-09-16 04:07:44 +00:00
ruthra kumar
f7898b4954 refactor: re-add remarks field to payment ledger and AR/AP report
(cherry picked from commit 5782c4469a)
2022-08-29 14:19:46 +00:00
ruthra kumar
0faa7b0432 fix: posting_date of linked vouchers should not affect outstanding
posting_date filter should not be applied for linked vouchers.

(cherry picked from commit 5f1562c5b2)
2022-08-08 10:59:05 +00:00
Rucha Mahabal
108cce2785 refactor: rewrite raw sql queries with frappe.qb and database API 2022-07-07 19:00:19 +05:30
Rucha Mahabal
ef02e58859 Merge branch 'develop' into hr-separation 2022-07-07 13:46:54 +05:30
ruthra kumar
219855311d fix: wrong amount fetched in payment reconciliation tool
- fetch amount on account currency for outstanding invoices and
- unreconcilied dr/cr notes
- fix currency field name in payment ledger entry creation
2022-07-01 12:47:07 +05:30
Rucha Mahabal
3051f6e7f2 fix: Update triggers on Payment Reconciliation 2022-06-30 21:37:55 +05:30
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