fix: make `Material Request Item` required if `Material Request` is set in PO
(cherry picked from commit a9d91189b0)
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
* refactor: rename field `Over Order Allowance` to `Blanket Order Allowance`
(cherry picked from commit 8ffa2bfe25)
* chore: patch to rename field `over_order_allowance`
(cherry picked from commit fcfcf6957e)
# Conflicts:
# erpnext/patches.txt
* chore: `conflicts`
---------
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
fix: billed_qty to show a sum of all invoiced qty from the purchase order item.
(cherry picked from commit 8a72f4f58a)
Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
* feat: Party auto-matcher from Bank Transaction data
- Created Bank Party Mapper
- Created class to auto match by account/iban or party name/description(fuzzy)
- Automatch and set in transaction or create mapper
- `rapidfuzz` introduced
* chore: Single query with or filter to search Party Mapper by name/desc
* feat: Store Party bank details in party records (Customer/Supplier/Employee/Shareholder)
* fix: Don't set description as key in Mapper doc if matched by description
- Description is volatile and will keep changing
- It will lead to multiple Bank Party Mapper docs for the same party that will never be referenced again
- Parts of the descripton keep changing which is why it will never match a mapper record
- If matched by desc, dont create mapper record.
* feat: Manually Update/Correct Party in Bank Transaction
- On updating bank trans.n party after submit, the corresponding mapper doc will be updated too
- The mapper doc in turn will update all linked bank transactions that do not have this updated value
- Added Bank Party Mapper hidden link in Bank Transaction
- Rename field in BPM to `Party Name` as it does not hold description data
- If a BT matches with a BPM record, link that record in the BT
* chore: Perform automatch on submit
- misc: Clearer naming
* chore: Make auto matching party configurable
- Checkbox in Accounts settings "Enable Automatic Party Matching"
- Check before invoking automatching methods
- misc: Remove TODO comments
* fix: Match by both Account No and IBAN & other cleanups
- A BT could have both account and iban, and a Supplier could have only IBAN set
- In this case, matching by either (only account) gives no match
- Match by Account OR IBAN, use `or_filters`
- If matched, set both account no. and IBAN in Bank Party Mapper
- Explain AutoMatchParty
- Add type hints to return values
- Use `set_value` to set values in BT after matching since its an after submit event
* test: Match by Account No, IBAN, Party Name, Desc and match correction
* fix: Remove bank details fields from Shareholder
* fix: Use existing bank fields to match by bank account no/IBAN
- Remove newly added fields in Party doctypes to store bank details
- Use Bank Account's fields to match against account no/iban
- For employee, if Bank Account does not exist, find in Employee doctype against account no/iban
* fix: Tests
* feat: Optional Fuzzy Matching & Skip Matches for multiple similar matches
- Fuzzy matching can be enabled optionally in the settings
- If a query gets multiple matches with the same score, do not set a party as it is an extremely close call
- misc: Add 'cancelled' status to Bank transaction
- Test for skipping matching with extremely close matches
* chore: Remove Bank Party Mapper implementation
- Matching by Acc No/IBAN can easily happen with Bank Accounts. It's not a tedious query
- Historical lookups for Party Name/Desc match are very tricky. The user could have manually set a match and we would not know. Also this leaves the Bank Party Mapper only useful for Party Name/Desc lookups, which feels excessive.
- We want to reduce the number of places the same data is stored and reduce confusion
- The Party Name/Desc will optionally happen fuzzily, or not at all
- There will be no Mapper lookups
* chore: Remove instances of `bank_party_mapper` and use `new_doc`
* fix: Taxes aren't discounted on early payment discount
- Deductions in payment entry must be split into income loss and tax loss
- Compute total discount in percentage, makes discounting different amounts proportionately easier
(cherry picked from commit 768c3a4927)
* fix: Recalculate difference amount after setting deductions
(cherry picked from commit 75ec0a0a85)
* fix: Set deductions in base currency
- Use field precision to get more accurate values
(cherry picked from commit dc2998f544)
* fix: Back update discounted amount in Invoice based on discount type
- Discount value was always trated as a percentage on back updation
(cherry picked from commit 2ae5834290)
* test: PE from SI with early payment discount amount & PE assertions in discount % test
(cherry picked from commit c217bb2018)
* fix: Set deduction amount in company currency on Doctype
- Even via JS, deductions amount is always in company currency
- Since there is nothing dynamic about this field, set it in the doctype spec itself
- fixed: Inconsistency between label currency and field currency formatted value
(cherry picked from commit 7f2e7badff)
* fix: Don't add to deductions if amount is 0
- misc: better docstring
(cherry picked from commit f02fc8acf0)
* fix: Paid amount must be discounted considering accounting currency
- Accounting is in the same currency if party currency and company currency is the same
- If accounting is in the same currency, paid and recvd amount is in the base currency
- Then, discount amount must also be in the base currency as it is deducted from paid amount
- Received amount must be in base currency if not multi currency
- cleanup: Deductions setting broken into smaller functions
(cherry picked from commit 761f68d7bf)
* fix: Multi-currency SI with base currency PE
- Return total discount loss in base currency
- Allocate payment based on terms: Set allocated amount in references table in base currency if accounting is in that currency
- Allocate payment based on terms: While back updating set paid amount (payment schedule) in transaction currency always
- minor: discount msgprint in correct currency
(cherry picked from commit b09c2381ca)
* test: Multi currency SI with multi-currency accounting and single currency accounting + Early payment discount
(cherry picked from commit 9abf0ef615)
* fix: Handle rounding more gracefully
- Round off pending discount loss to avoid miniscule losses rounded to 0.0 that are added in deductions
- Use base amounts to calculate base losses instead of using conversion factor which increases rounding error
- Round of total base loss instead of individual income and tax losses to reduce rounding error
- Use default round off account for pending rounding loss in deductions
(cherry picked from commit caa1a3dccf)
* fix: Provision to apply early payment discount if payment is recorded late
- Party could have paid on time but payment is recorded late
- Prompt for reference date so that discount is applied while mapping
- Prompt only if discount in payment schedule of valid doctypes
- test: Reference date and impact on PE
- `make_payment_entry` (JS) must be able to access `this`
(cherry picked from commit d6d0163514)
* feat: Make Tax loss booking optional
- Checkbox in Accounts Settings
- Apply checkbox in PE deductions setting logic
- Adjust tests
(cherry picked from commit 216a46bd66)
# Conflicts:
# erpnext/accounts/doctype/accounts_settings/accounts_settings.json
* fix: Merge conflicts
---------
Co-authored-by: marination <maricadsouza221197@gmail.com>
fix: Party Name in SOA print when viewed from Customer/Supplier master (#34597)
fix: Party Name in SOA print when viewd from Customer/Supplier master
(cherry picked from commit 50c1172f29)
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>