* test: payment entry over allocation.
* fix: validate allocated_amount against latest outstanding amount.
* fix: payment entry get outstanding documents for advance payments
* fix: only fetch latest outstanding_amount.
* fix: throw if reference is allocated
* test: throw error if a reference has been partially allocated after inital creation.
* chore: test name
* fix: remove unused part of test
* chore: linter
* chore: more user friendly error messages
* fix: only validate outstanding amount if partly paid and don't filter by cost center
* chore: minor refactor for doc.cost_center
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
---------
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
I just applied semgrep autofix. Untested completed, review before merging.
```yaml
- id: frappe-set-value-semantics
patterns:
- pattern-either:
- pattern: frappe.db.set_value($DOCTYPE, None, $...AFTER)
- pattern: frappe.db.set_value($DOCTYPE, $DOCTYPE, $...AFTER)
fix: frappe.db.set_single_value($DOCTYPE, $...AFTER)
message: |
If $DOCTYPE is a single doctype then using `frappe.db.set_value` is discouraged for setting values in DB. Use db.set_single_value for single doctype instead.
languages: [python]
severity: ERROR
```
* fix: payment against credit note should be linked to parent invoice
* test: AR/AP report for payment against cr note scenario
* fix: cr_note shows up as outstanding invoice
Payment made against cr_note causes it be reported as outstanding invoice
The ultimate goal of this commit is to add an updated Portuguese Chart of Accounts (CoA), based on Portugal's SNC norm. Account numbers are included. "Account types" shall ideally be confirmed and improved by an accountant. Howbeit, the account types are mostly inspired on former OpenERP, now designated Odoo.
* fix: account group totals calculation to consider include_in_gross
(cherry picked from commit 8dcb9302b417618505ea24e5566c017eff451c1e)
* refactor: remove unused parameters
(cherry picked from commit 50822f207ec5272d4d71a2b6579693da2088105d)
* refactor: merge separate loops for calculating group / leaf node totals
rename function
remove return statement as the list is mutated
(cherry picked from commit 1a3b9c5bdfb9fac04a3a7d8724e6b3c3b593ec19)
* fix: add total col for gross and net profit
(cherry picked from commit cb9b4fbb91f4b73916416167932064ef5965eed1)
---------
Co-authored-by: Anoop Kurungadam <anoop@earthianslive.com>