Compare commits

..

863 Commits

Author SHA1 Message Date
Abdeali Chharchhoda
2db2c8bce1 refactor: Move PR link filters to client side 2024-11-27 15:52:45 +05:30
Abdeali Chharchhoda
cabe7ea028 Merge branch 'develop' into refactor-payment-request 2024-11-27 15:36:35 +05:30
ruthra kumar
1b45ba81a5 Merge pull request #44377 from ljain112/fix-payment-ref
fix:  correct placeholder index in message
2024-11-27 14:55:00 +05:30
ljain112
d61cb9a4bf fix: correct placeholder index in message 2024-11-27 13:44:33 +05:30
Abdeali Chharchhoda
2dd2083463 Merge branch 'develop' into refactor-payment-request 2024-11-27 12:07:16 +05:30
ruthra kumar
d03dc1b855 Merge pull request #44343 from aerele/process-statement-of-account-email
fix: show cc on the process statement of accounts email
2024-11-27 10:22:17 +05:30
rohitwaghchaure
123e3ef263 feat: provision to disable item attribute (#44358) 2024-11-27 09:46:36 +05:30
Raffael Meyer
e094473c65 feat(Dunning): separate tab "Address & Contact" (#44363) 2024-11-26 21:10:34 +01:00
Raffael Meyer
3f92a57d63 fix: unify company address query in sales transactions (#44361)
* fix: unify company address query in sales transactions

* refactor: get the correct field label
2024-11-26 20:03:06 +01:00
rohitwaghchaure
0fd50b5048 fix: added validation for quality inspection (#44351) 2024-11-26 19:48:42 +05:30
rohitwaghchaure
2ab7ec5437 fix: billed qty and received amount in PO analysis report (#44349) 2024-11-26 18:07:43 +05:30
ruthra kumar
6c5f57b22b Merge pull request #44347 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-26 17:52:25 +05:30
ruthra kumar
f8655cb26a Merge pull request #44345 from ruthra-kumar/fix_broken_export_in_p_l_statements
fix: broken export on financial statements
2024-11-26 17:48:29 +05:30
ruthra kumar
ea6e022fad test: export functionality on P&L statement 2024-11-26 16:36:18 +05:30
Frappe PR Bot
ce27d37fc3 fix: Persian translations 2024-11-26 16:27:41 +05:30
Frappe PR Bot
60a2d74d74 fix: Turkish translations 2024-11-26 16:27:36 +05:30
ruthra kumar
1da61a43e7 chore: remove debugging statement 2024-11-26 15:48:54 +05:30
ruthra kumar
c66d57d490 fix: broken export on statements 2024-11-26 15:33:04 +05:30
venkat102
2dd5699f6d fix: show cc on the email 2024-11-26 14:58:57 +05:30
Abdeali Chharchhoda
37ceb09955 revert: remove default Payment Request indicator color 2024-11-26 12:10:05 +05:30
ruthra kumar
4983dac27b Merge pull request #44319 from vishakhdesai/hd-ticket-21161
fix: use field precision in Sales and Purchase Order
2024-11-26 11:46:50 +05:30
ruthra kumar
1baed9f46e Merge pull request #44304 from ernestoruiz89/patch-2
chore: Add translations to QI validations in Update stock_controller.py
2024-11-26 11:36:05 +05:30
ruthra kumar
2fcfd41eb6 Merge pull request #44257 from aerele/number-card-dynamic-filter
fix: add company dynamic filters in number cards
2024-11-26 10:53:48 +05:30
ruthra kumar
48d9e9c362 Merge pull request #44320 from Abdeali099/fix-pos-qty
fix: Increase quantity by `1 UOM` when adding an item from the selector in `POS`
2024-11-26 10:29:41 +05:30
rohitwaghchaure
e56a98d5ba fix: Required By date issue (#44326) 2024-11-25 20:28:56 +05:30
rohitwaghchaure
bf28b2c771 fix: item none not found (#44324) 2024-11-25 20:12:12 +05:30
rohitwaghchaure
52f0d67bae Merge pull request #44260 from rohitwaghchaure/fixed-github-40144
feat: available qty at company in sales transactions
2024-11-25 19:58:54 +05:30
Frappe PR Bot
e5bfdf8cfb fix: sync translations from crowdin (#44322) 2024-11-25 11:19:33 +00:00
ruthra kumar
ca0e20b2cf Merge pull request #44321 from ruthra-kumar/clear_unallocated_payments_on_pos
refactor: clear unallocated payments from POS Invoice
2024-11-25 16:40:35 +05:30
Rohit Waghchaure
d8b9aef14f feat: available qty at company in sales transactions 2024-11-25 16:27:46 +05:30
Abdeali Chharchhoda
112b4c705b revert: use + flt(value) instead of direct increment 2024-11-25 16:18:22 +05:30
ruthra kumar
eebd058891 refactor: clear unallocated payments from POS Invoice 2024-11-25 15:56:41 +05:30
Abdeali Chharchhoda
e37a039660 Merge branch 'develop' into fix-pos-qty 2024-11-25 15:10:06 +05:30
Abdeali Chharchhoda
84dcbe6639 fix: Show available stock qty in stock_uom instead of uom 2024-11-25 14:48:41 +05:30
Abdeali Chharchhoda
bbab850135 fix: Increase quantity by 1 UOM when adding an item from the selector in POS 2024-11-25 14:13:26 +05:30
vishakhdesai
1a1e2c7e01 fix: use field precision instead of hardcoded precision in so and po 2024-11-25 12:50:35 +05:30
ruthra kumar
efc22d5615 Merge pull request #44274 from aerele/rfq-price-list-currency
fix: set price_list_currency only if it exists
2024-11-25 12:38:31 +05:30
ruthra kumar
d8af140770 Merge pull request #44163 from aerele/show_child_data_for_company
feat: Show Aggregate Value from Subsidiary Companies
2024-11-25 12:08:47 +05:30
ruthra kumar
8e72e35a21 Merge pull request #44290 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-25 10:23:20 +05:30
ruthra kumar
f4ad935f15 Merge pull request #44297 from Abdeali099/report-column-label-translation
refactor: added translate function for some columns of report
2024-11-25 10:08:34 +05:30
Frappe PR Bot
7e06e05584 chore: update POT file (#44309) 2024-11-24 16:49:43 +01:00
Frappe PR Bot
026c5b76ff fix: Persian translations 2024-11-24 16:25:10 +05:30
Frappe PR Bot
ae0ed1f56f fix: Swedish translations 2024-11-24 16:25:05 +05:30
David Arnold
a9485b91b0 feat: add more fine-grained deprecation warning control (#44307)
* feat: add more fine-grained deprecation warning control

see: https://github.com/frappe/frappe/wiki/Deprecations

* chore: ensure frappe deprecation dumpster is reused where possible; and loaded to parse PYTHONWARNINGS (!)
2024-11-24 00:37:42 +01:00
David Arnold
f1bd6e492a chore: use local deprecation (#44306) 2024-11-23 22:25:12 +00:00
David Arnold
2e04eeb661 fix: net_amount calculation (#44231)
fix: tax_item_rate calculation
2024-11-23 22:10:33 +00:00
Ernesto Ruiz
6754f15487 chore: Add translations to QI validations in Update stock_controller.py
chore: Add translations to QI validations in Update stock_controller.py
2024-11-23 09:07:18 -06:00
Frappe PR Bot
4289804681 fix: Persian translations 2024-11-23 16:29:52 +05:30
Abdeali Chharchhoda
91955e27c3 fix: Dashboard for Payment Request 2024-11-23 15:10:23 +05:30
Abdeali Chharchhoda
e1c4d6e1e6 refactor: Used object to get payment request status indicator 2024-11-23 14:47:31 +05:30
David Arnold
e9ea9ee57b fix: update calling signature (#44299) 2024-11-23 00:29:00 +00:00
Abdeali Chharchhoda
e545c913b5 refactor: added translate function for some columns of report 2024-11-22 19:50:52 +05:30
Frappe PR Bot
f244ad78df fix: Swedish translations 2024-11-22 16:30:25 +05:30
ruthra kumar
15c607306a Merge pull request #44246 from aerele/validate_for_closed_fiscal_year
fix: Get submitted documents in validate_for_closed_fiscal_year
2024-11-22 15:51:37 +05:30
ruthra kumar
367f56179b Merge pull request #44266 from aerele/pricing-rule-round-free-qty
fix: make free qty round on large transaction qty
2024-11-22 15:50:10 +05:30
ruthra kumar
2a31807407 Merge pull request #44277 from aerele/pos-item-group-filter
fix: filter with item group only if it is mentioned in pos profile
2024-11-22 15:44:44 +05:30
ruthra kumar
c3e5d6336c Merge pull request #44264 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-22 15:43:54 +05:30
Smit Vora
30f9b2b806 Merge pull request #44263 from vorasmit/fix-toggle-amount 2024-11-22 12:08:58 +05:30
venkat102
09641073e3 fix: filter with item group only if it is mentioned in pos profile 2024-11-22 11:53:07 +05:30
Sugesh393
f0b9cb4019 fix: set price_list_currency only if it exists 2024-11-22 11:36:57 +05:30
ruthra kumar
160bb10db8 Merge pull request #44194 from aerele/tds-tax-on-excess-amount
fix: include current invoice amount when tax_on_excess_amount is checked
2024-11-22 11:06:25 +05:30
Smit Vora
a10e175bc9 test: test case for toggling debit and credit if negative 2024-11-21 19:44:02 +05:30
venkat102
013a6fc6ec test: add unit test to validate free qty round on large transaction qty 2024-11-21 18:37:14 +05:30
Smit Vora
8e759c32c4 fix: toggle debit credit amounts for transaction currency too; minor refactor 2024-11-21 18:30:37 +05:30
venkat102
f9b8165385 fix: make free qty round on large transaction qty 2024-11-21 18:27:15 +05:30
Frappe PR Bot
fbdc40114b fix: Persian translations 2024-11-21 16:34:12 +05:30
Frappe PR Bot
4eb32023f5 fix: Swedish translations 2024-11-21 16:34:07 +05:30
rohitwaghchaure
57293aa18a fix: no permission to read Doctype (#44256) 2024-11-21 13:13:21 +05:30
Sugesh393
29762c4826 fix: remove irrelavent filters 2024-11-21 12:09:24 +05:30
Sugesh393
4e7725de66 fix: add company dynamic filters in number cards 2024-11-21 11:05:49 +05:30
Raffael Meyer
4b53075f84 refactor: use frappe._dict() instead of {} (#44255)
* refactor: use `frappe._dict()` instead of `{}`

A downstream function (`_get_item_tax_template`) expects this to be a frappe._dict and fails otherwise.

* refactor: use `ItemDetails()`
2024-11-21 00:36:20 +01:00
Raffael Meyer
8d8070e8eb fix: use of ctx (#44253)
* fix: rename args to ctx in caller

* fix: use `.get("items")` to avoid conflict with `.items()` method
2024-11-20 19:03:26 +01:00
ruthra kumar
4d96a20205 Merge pull request #44249 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-20 17:06:57 +05:30
Frappe PR Bot
f5cf417f53 fix: Persian translations 2024-11-20 16:34:49 +05:30
Frappe PR Bot
93fef93a1d fix: Turkish translations 2024-11-20 16:34:41 +05:30
Frappe PR Bot
77cba04b13 fix: Swedish translations 2024-11-20 16:34:36 +05:30
vimalraj27
c607e5f940 fix: Get submitted documents in validate_for_closed_fiscal_year 2024-11-20 13:27:21 +05:30
ruthra kumar
1737269358 Merge pull request #44197 from ljain112/fi-rev-dr-credit-reco
fix: payment reco for jv with negative dr or cr amount
2024-11-20 12:46:57 +05:30
Nihantra C. Patel
9ea8bd7a3c Merge pull request #44240 from Nihantra-Patel/fix_pos_warehouse
fix: non group pos warehouse
2024-11-20 12:10:42 +05:30
Nihantra C. Patel
d526be0394 fix: non group pos warehouse 2024-11-20 12:00:41 +05:30
ruthra kumar
3b9e226d93 Merge pull request #44220 from Abdeali099/payment-request-search-option-query
refactor: Update `Payment Request` search query in PE's reference
2024-11-20 11:50:48 +05:30
rohitwaghchaure
cc571aca8f fix: added Stock UOM field for RM in work order (#44185)
fix: added UOM field for RM in work order
2024-11-20 11:20:47 +05:30
ruthra kumar
8bd7ad5bf0 Merge pull request #44203 from ljain112/fix-so-calender
fix: disable conversion to user tz for sales order calender
2024-11-20 10:46:31 +05:30
ruthra kumar
a971417f25 Merge pull request #44207 from ljain112/validate-sales_person
fix: validate sales team to ensure all sales person are enabled
2024-11-20 10:40:34 +05:30
David Arnold
9673bf85ec refactor: pass typed arguments to get_item_details methods (#44230)
* refactor: pass proper types to get_item_details methods

* chore: excempt previous commit from git blame
2024-11-20 02:31:03 +01:00
David Arnold
4ec23b5525 refactor: make stem utility for normalizing ctx args from dict json-str or Document (#44228) 2024-11-20 00:40:16 +01:00
David Arnold
af2a622afb fix: partial fix for #44291 (#44229)
This is only a partial fix and improves the situaton.

A proper fix will need to have items _always_ track their tax-related
account head, namely for item-wise tax templates as well as default
document taxes that are applied "On Net Total", in order to achive
proper assignment of the net_amount.

Currently there is no way to always identify the orignating account head per item.
2024-11-19 23:15:22 +00:00
David Arnold
daabe847b0 refactor: cleanup args structure akin to some typing (#44226)
* refactor: cleanup args structure akin to some typing

this clarification is a human precondition to being able to fix https://github.com/frappe/erpnext/issues/44219

* chore: excempt previous commit from git blame

* fix: adapt signature
2024-11-19 22:27:57 +00:00
Abdeali Chharchhoda
4ab3499a17 refactor: Update Payment Request search query in PE's reference 2024-11-19 18:00:35 +05:30
ruthra kumar
a9bb6b9970 Merge pull request #44190 from cogk/fix-coa-setup-wizard
fix(setup): Fix typo in COA setup
2024-11-19 17:44:01 +05:30
David Arnold
8b05f954c2 Merge pull request #44215 from blaggacao/fix/item-tax-detail-ro
fix: field read only property on taxes net_amount
2024-11-19 12:58:28 +01:00
Corentin Forler
a245cc6b07 fix(setup): Fix typo in COA setup 2024-11-19 17:18:25 +05:30
ruthra kumar
cb4b4e212c Merge pull request #44213 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-19 17:11:39 +05:30
Nikolas Beckel
9d31bf7647 fix: check if pricing rule matches with coupon code (#44104)
* fix: check if pricing rule matches with coupon code

* fix: correct linting error
2024-11-19 17:10:55 +05:30
ruthra kumar
64833fccb4 Merge pull request #44214 from ruthra-kumar/wrong_eval_expression
fix: incorrect eval expression
2024-11-19 17:05:51 +05:30
David
b2f8b610fc fix: field read only property on taxes net_amount 2024-11-19 12:29:56 +01:00
ruthra kumar
76ea94d906 fix: incorrect eval expression 2024-11-19 16:36:34 +05:30
Frappe PR Bot
8a12104073 fix: Swedish translations 2024-11-19 16:17:20 +05:30
rohitwaghchaure
b21fb8f8b6 fix: update project cost from timesheet (#44211) 2024-11-19 16:12:22 +05:30
Khaled Bin Amir
a2199db5e5 feat: Add 'ABBR' variable to support company abbreviation in naming series (#43260)
* Add ABBR variable in naming settings

* Add ABBR variable in naming settings

* Update utils.py

* chore: resolve linter

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2024-11-19 15:15:27 +05:30
hyaray
b3c558f0c0 chore: typo in Manufaturing Settings 2024-11-19 14:54:05 +05:30
ruthra kumar
7ff6901883 Merge pull request #44204 from ruthra-kumar/update_owners
chore: update codeowners
2024-11-19 14:46:59 +05:30
ljain112
548dbb33eb fix: validate sales team to ensure all sales person are enabled 2024-11-19 14:32:43 +05:30
ruthra kumar
ed54b9b8c7 Merge pull request #44145 from ajiragroup/ajiragroup-patch-1
fix: updated label "Is short year" to "Is Short/Long year" for both short and long fiscal years
2024-11-19 14:25:37 +05:30
ruthra kumar
8d4f2eeb07 Merge pull request #44189 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-19 14:14:53 +05:30
ruthra kumar
3273b808a0 chore: update codeowners 2024-11-19 14:12:36 +05:30
ljain112
cdf098c193 fix: disable conversion to user tz for sales order calender 2024-11-19 12:38:34 +05:30
ljain112
6f9ea6422d fix: added test cases 2024-11-19 12:17:35 +05:30
ruthra kumar
a202f564b1 Merge pull request #44188 from ismxilxrif/develop
chore: update oldest_items.json, change owner back to administrator
2024-11-19 12:02:40 +05:30
ajiragroup
1d6b9b405f refactor: update label and description on short year checkbox
Is short/long year.
2024-11-19 12:01:43 +05:30
Ismail Arif
7ceb24fb4c chore: update oldest_items.json, change owner back to administrator
Signed-off-by: Ismail Arif <38789073+ismxilxrif@users.noreply.github.com>
2024-11-19 09:56:35 +08:00
ljain112
fee79b9445 fix: payment reco for jv with negative dr or cr amount 2024-11-18 20:08:11 +05:30
rohitwaghchaure
495528a758 fix: patch (#44191) 2024-11-18 17:59:55 +05:30
ruthra kumar
44b0f92c72 Merge pull request #44134 from aerele/gl-debit-transaction-currency
fix: set debit in transaction currency in GL Entry
2024-11-18 17:11:59 +05:30
ruthra kumar
4aab6f55f5 refactor: update test case 2024-11-18 16:39:06 +05:30
ruthra kumar
6681882bd8 refactor: assume any of the foreign currency as transaction currency
On a foreign currency payment entry, assume any one of the foreign
currency as the transaction currency
2024-11-18 16:25:44 +05:30
venkat102
4820273595 test: add unit test for tax on excess amount 2024-11-18 15:48:39 +05:30
venkat102
b74f2896cd fix: include current invoice amount when tax_on_excess_amount is checked 2024-11-18 15:42:01 +05:30
Frappe PR Bot
a712ff603b fix: Esperanto translations 2024-11-18 15:38:31 +05:30
Frappe PR Bot
5122489790 fix: German translations 2024-11-18 15:38:27 +05:30
Frappe PR Bot
3468f27e8b fix: Bosnian translations 2024-11-18 15:38:22 +05:30
Frappe PR Bot
31a2fe4bd0 fix: Persian translations 2024-11-18 15:38:18 +05:30
Frappe PR Bot
94703698c0 fix: Chinese Simplified translations 2024-11-18 15:38:12 +05:30
Frappe PR Bot
92d76b5a63 fix: Turkish translations 2024-11-18 15:38:09 +05:30
Frappe PR Bot
d8c20f4dd8 fix: Swedish translations 2024-11-18 15:38:04 +05:30
Frappe PR Bot
26dd896741 fix: Russian translations 2024-11-18 15:37:59 +05:30
Frappe PR Bot
a1c88a6302 fix: Polish translations 2024-11-18 15:37:54 +05:30
Frappe PR Bot
1fbb5203c6 fix: Hungarian translations 2024-11-18 15:37:50 +05:30
Frappe PR Bot
41c7ce7cfb fix: Arabic translations 2024-11-18 15:37:45 +05:30
Frappe PR Bot
7f0e881894 fix: Spanish translations 2024-11-18 15:37:40 +05:30
Frappe PR Bot
475611697f fix: French translations 2024-11-18 15:37:35 +05:30
Smit Vora
2ada270e78 Merge pull request #44025 from Ninad1306/disable_rounded_total_for_quotation 2024-11-18 11:29:19 +05:30
ruthra kumar
806ec72a0e Merge pull request #44127 from vishakhdesai/set-default-party-type-pe
fix: set default Party Type based on Payment Type in Payment Entry
2024-11-18 10:13:44 +05:30
ruthra kumar
f00693c043 Merge pull request #44147 from vishakhdesai/pos-rate-calculation-issue
fix: set conversion factor before applying price list
2024-11-18 10:07:52 +05:30
ruthra kumar
cdc4b02964 Merge pull request #44157 from UmakanthKaspa/bugfix-disable-add-rows-allocations-table
fix: apply "cannot_add_rows" directly to table field for more efficient solution
2024-11-18 10:04:38 +05:30
ruthra kumar
345955e021 Merge pull request #44170 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-18 09:57:42 +05:30
Frappe PR Bot
7d4ff2777a chore: update POT file (#44169) 2024-11-17 15:06:37 +01:00
Raffael Meyer
2a8dbc5cd5 feat: new DocTypes "Code List" and "Common Code" (#43425)
Co-authored-by: David <dgx.arnold@gmail.com>
2024-11-17 15:05:33 +01:00
David Arnold
d3fb375260 Merge pull request #44171 from blaggacao/fix/migration-item-tax-detail
fix(migration): to new item_wise_tax_detail
2024-11-17 12:25:12 +01:00
David
2ec8a0e943 fix(migration): to new item_wise_tax_detail 2024-11-17 11:58:53 +01:00
Frappe PR Bot
4dbe2fdfd3 fix: Swedish translations 2024-11-17 15:40:10 +05:30
Frappe PR Bot
c5f22e7616 fix: sync translations from crowdin (#44164)
* fix: Swedish translations

* fix: Spanish translations

* fix: Swedish translations

* fix: Persian translations
2024-11-16 12:24:02 +01:00
rohitwaghchaure
9bf16df41e feat: inventory dimension for rejected materials (#44156) 2024-11-15 17:03:22 +05:30
l0gesh29
c23af6af41 feat: Show Aggregate Value from Subsidiary Companies 2024-11-15 12:54:04 +05:30
ruthra kumar
29f8777079 Merge pull request #43414 from vishakhdesai/exchange-rate-revaluation-issue
fix: Get Entries not showing accounts with no gain or loss in Exchange Rate Revaluation issue fixed
2024-11-15 12:47:31 +05:30
ruthra kumar
98fa51be5a Merge pull request #44158 from ruthra-kumar/broken_ui_on_currency_exchange
fix: broken UI on currency exchange
2024-11-15 12:21:12 +05:30
ruthra kumar
e91b65e7bd fix: broken UI on currency exchange 2024-11-15 12:14:42 +05:30
UmakanthKaspa
5dd8eafdfc refactor: set 'cannot_add_rows' directly in the allocations table field (optimized approach) 2024-11-15 05:43:25 +00:00
ruthra kumar
f908112935 Merge pull request #44089 from UmakanthKaspa/fix/invoice-sorting-payment-reconciliation
fix: apply posting date sorting to invoices in Payment Reconciliation similar to payments
2024-11-15 10:28:51 +05:30
ruthra kumar
a16ab653f2 Merge pull request #44148 from UmakanthKaspa/bugfix-disable-add-rows-allocations-table
Fix: Disable "Add Row" button in allocations table during UnReconcile process
2024-11-15 10:16:37 +05:30
rohitwaghchaure
93c8b4c39a fix: validation for serial no (#44133) 2024-11-15 10:04:59 +05:30
rohitwaghchaure
e8bbf6492f fix: stock ledger variance report filter options (#44137) 2024-11-15 10:04:37 +05:30
UmakanthKaspa
13ca2700f8 fix: correctly set 'cannot_add_rows' property on allocations table field 2024-11-15 09:38:11 +05:30
ruthra kumar
31ca9eaf2d Merge pull request #44142 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-15 06:19:44 +05:30
vishakhdesai
9749fe23cc fix: set conversion factor before applying price list 2024-11-14 17:31:34 +05:30
David Arnold
7e9fc9f4df Merge pull request #43372 from blaggacao/feat/log-net-total-on-taxes-and-charges
fix: item wise tax details and net amounts
2024-11-14 12:40:59 +01:00
Frappe PR Bot
897dc51cb7 fix: Turkish translations 2024-11-14 14:32:38 +05:30
Frappe PR Bot
7a2df9f0b8 fix: Swedish translations 2024-11-14 14:32:28 +05:30
Frappe PR Bot
4f9a0f23fd fix: Spanish translations 2024-11-14 14:32:17 +05:30
ruthra kumar
7be10a744d Merge pull request #43189 from ruthra-kumar/fix_for_rule_on_other
fix: broken apply on other item
2024-11-14 13:23:18 +05:30
ruthra kumar
0cb5a0cd0f Merge pull request #44138 from frappe/mergify/copy/develop/pr-43651
fix: bulk update invoice remarks during site upgrade (copy #43651)
2024-11-14 13:15:10 +05:30
ruthra kumar
e5119a749c fix: broken apply on other item pricing rule 2024-11-14 12:53:21 +05:30
Varun Verma
b7ad525960 fix: bulk update invoice remarks during site upgrade
fixes issue #43634

(cherry picked from commit cc07402b5e)
2024-11-14 07:19:17 +00:00
sudarsan2001
4a1cd5a8d6 chore: change account name 2024-11-14 10:59:51 +05:30
sudarsan2001
e8b8a589be test: add unit test to validate gl values 2024-11-14 01:28:16 +05:30
sudarsan2001
29a6eb21a3 fix: set debit in transaction currency in GL Entry 2024-11-14 01:11:12 +05:30
Frappe PR Bot
972d62bca7 fix: sync translations from crowdin (#44086) 2024-11-13 18:19:02 +01:00
vishakhdesai
19222690d3 fix: set default party type in Payment Entry 2024-11-13 17:27:49 +05:30
ruthra kumar
6d4b0e242e Merge pull request #44124 from ruthra-kumar/add_partialy_billed_in_purchase_receipt
refactor: 'Partly Billed' status for Purchase Receipt
2024-11-13 17:22:31 +05:30
ruthra kumar
c58bbd25f2 refactor: 'Partly Billed' status for Purchase Receipt 2024-11-13 16:56:08 +05:30
rohitwaghchaure
13834014b5 fix: Cannot read properties of undefined (reading 'work_order_closed') (#44117) 2024-11-13 15:52:48 +05:30
Nihantra C. Patel
6dc4934e59 Merge pull request #44116 from Nihantra-Patel/fix_dropshipping_address
fix: Drop Shipping address based on customer shopping address
2024-11-13 15:30:45 +05:30
Nihantra Patel
c7499f3528 fix: Drop Shipping address based on customer shopping address 2024-11-13 14:55:45 +05:30
NaviN
494fd7ceea fix: update per_billed value in Purchase Receipt while creating Debit Note (#43977)
* fix: update per_billed value in Purchase Receipt while creating Debit Note

* test: add unit test for validating per_billed value for partial Debit Note
2024-11-13 12:23:16 +05:30
rohitwaghchaure
0828c74fe3 fix: incorrect produced qty in Production Plan Summary (#44112) 2024-11-13 12:10:37 +05:30
rohitwaghchaure
c0ffaa444c fix: consider service item cost in the RM cost of the BOM (#43962) 2024-11-12 21:59:04 +05:30
rohitwaghchaure
e8882718c9 fix: not able to cancel DN (#44108) 2024-11-12 17:41:55 +05:30
David
3732dd1b1f refactor!: store item wise tax details as a more flexible dict 2024-11-12 12:39:04 +01:00
David
5af88a7fb1 fix: pos invoice merge to more detailed item wise tax detail 2024-11-12 12:39:04 +01:00
David
27a07b9eb3 test: adapt pos invoice text 2024-11-12 12:39:04 +01:00
David
2b0cc76523 test: add test for item tax detail 2024-11-12 12:39:03 +01:00
David (aider)
961e7b107d feat: Add net_total to Taxes And Charges doctypes and modify relevant controllers 2024-11-12 12:39:00 +01:00
David Arnold
ab1593654e Merge pull request #44018 from blaggacao/feat/add-deprecation-dumpster
feat: add deprecation dumpster
2024-11-12 12:38:46 +01:00
David
8463247dcf feat: don't enforce dumpster location; allow in-place deprecations; diverge from frappe practice 2024-11-12 11:40:30 +01:00
rohitwaghchaure
8805e74784 fix: not able to reconcile expired batches (#44012) 2024-11-12 15:48:28 +05:30
rohitwaghchaure
774845f886 fix: purchase receipt creation from SCR (#44095) 2024-11-12 15:43:20 +05:30
Ninad1306
5a6261d3b4 test: test to validate rounded total 2024-11-12 15:25:14 +05:30
ruthra kumar
586864c8ea Merge pull request #44053 from aerele/pos_barcode_search_fix
Pos barcode search fix
2024-11-12 12:44:32 +05:30
ruthra kumar
f072b1266e refactor: simpler filtering 2024-11-12 11:39:30 +05:30
ruthra kumar
f0e5036879 Merge pull request #44065 from aerele/pos-partial-return-payment-fix
fix: update payment amount for partial pos return
2024-11-12 09:48:54 +05:30
UmakanthKaspa
d6703eb88b fix: remove trailing whitespace 2024-11-11 18:06:53 +05:30
ruthra kumar
46676de341 Merge pull request #44072 from aerele/pos-create-return-button-fix
fix: bind this object explicitly on callback event function
2024-11-11 16:50:02 +05:30
HarryPaulo
cfe6af1f68 fix: add field conversion_factor when include_uom is settled (#43701) 2024-11-11 16:08:30 +05:30
rohitwaghchaure
9223ef2f37 fix: item mapping from modal to batch form (#44090) 2024-11-11 16:07:16 +05:30
UmakanthKaspa
0bd83d920d fix: apply posting date sorting to invoices in Payment Reconciliation similar to payments 2024-11-11 09:18:09 +00:00
ruthra kumar
ed56a1e26a Merge pull request #43695 from Vishv-024/sales_register_and_parchase_register
fix: exception on register reports when filtered on cost center
2024-11-11 14:47:09 +05:30
ruthra kumar
1d11131afe refactor(test): assertion refactoring and exact decimals 2024-11-11 14:16:49 +05:30
ruthra kumar
c53e9637dd refactor(test): pass all mandatory fields 2024-11-11 13:06:09 +05:30
Nihantra C. Patel
c81eb6c824 fix: populate payment schedule from payment terms (#44082) 2024-11-11 13:04:54 +05:30
s-aga-r
9a758ea826 chore: update CODEOWNERS (#44074) 2024-11-11 07:19:30 +00:00
ruthra kumar
d6030e7112 refactor(test): fix incorrect assertion 2024-11-11 12:37:02 +05:30
ruthra kumar
c255f34eea test: journals with cost center 2024-11-11 12:34:51 +05:30
Nihantra C. Patel
8c99acb1b9 fix: task path (#44073) 2024-11-11 12:33:30 +05:30
rohitwaghchaure
6cb169cd6b Merge pull request #44071 from aerele/pos-page-item-selector-fix
fix: add default height to POS item card selector
2024-11-11 12:09:14 +05:30
Kavin
5e790a0fce fix: bind this object explicitly on callback event function 2024-11-11 11:56:56 +05:30
Kavin
5f5a514d6f fix: add default height to POS item card selector 2024-11-11 11:53:49 +05:30
rohitwaghchaure
7cfd6a5151 Merge pull request #44058 from Vishnu7025/type_error_fix
fix: type error while saving pick list
2024-11-11 11:53:14 +05:30
rohitwaghchaure
0e6425486a Merge pull request #44064 from rohitwaghchaure/fixed-support-25064
fix: slow reposting due to SABB update
2024-11-11 11:52:28 +05:30
Kavin
53ef6336b6 fix: update payment amount for partial pos return 2024-11-11 11:21:48 +05:30
Rohit Waghchaure
2447b3f424 fix: slow reposting due to SABB update 2024-11-11 11:12:33 +05:30
HENRY Florian
1fe6efdeb9 feat: add template taxe for charts of account France - Plan Comptable General avec code (#42757)
* feat: add template taxe for charts of account France - Plan Comptable General avec code

* feat: add template taxe for charts of account France - Plan Comptable General avec code

* feat: add template taxe for charts of account France - Plan Comptable General avec code

* feat: add template taxe for charts of account France - Plan Comptable General avec code

* feat: add template taxe for charts of account France - Plan Comptable General avec code
2024-11-11 10:17:51 +05:30
HENRY Florian
8383883977 fix: when company is created with other company template Chart of Account the Create Taxe Template failed (#42755)
fix: when company if create with other company template Created Template Taxe failed
2024-11-11 10:16:17 +05:30
Frappe PR Bot
c9cb359815 fix: sync translations from crowdin (#44036) 2024-11-10 18:38:25 +01:00
Frappe PR Bot
56f05c5dd6 chore: update POT file (#44059) 2024-11-10 18:33:17 +01:00
vishnu
22de0ecbdc fix: tyeerror while saving pick list 2024-11-10 06:55:16 +00:00
Bhavan23
488b60fc27 refactor: Relocate doc variable for better scope management 2024-11-09 19:55:50 +05:30
Bhavan23
5e7cf3899b feat: Add item group filtering for search results 2024-11-09 19:54:50 +05:30
Smit Vora
e3cd6539c3 fix: better gls for purchases with tax witholding (#42743)
* fix: better gls for purchases with tax witholding

* test: test case for purchase invoice gl entries with tax witholding

* fix: use flag `_skip_merge` instead of skipping merge based on against account

* test: fix test `test_single_threshold_tds` for newer implementation
2024-11-09 09:44:21 +00:00
Ninad1306
f8524d526b fix: added disable_rounded_total field 2024-11-08 12:51:05 +05:30
Nihantra C. Patel
4ea2071265 fix: duplicate items and outdated item price in POS (#42978)
* fix: duplicate items and outdated item price in POS

* fix: duplicate items and outdated item price in POS --formatter
2024-11-08 12:42:19 +05:30
Venkatesh
42dcdcde1a fix: sort by ascending to get the first period closing voucher (#44029) 2024-11-08 12:30:54 +05:30
rohitwaghchaure
0399ccc51e fix: item not set in the batch quick entry form (#44028) 2024-11-08 12:10:51 +05:30
ruthra kumar
657201b324 test: basic report output 2024-11-08 12:08:05 +05:30
Vishv-silveroak
f01e1a8e20 fix: exception on register reports when filtered on cost center
1
2024-11-08 12:03:38 +05:30
ruthra kumar
dfe233fa0a Merge pull request #43873 from NethminaHiker360/fix-43865-sales-order
fix: add missing fields to field_no_map array
2024-11-08 11:29:05 +05:30
ruthra kumar
a978fd13e0 Merge pull request #43762 from bhavesh95863/fix-item-update
fix: handle NoneType error when updating ordered_qty in SO for remove…
2024-11-08 10:39:35 +05:30
Ravindu Nethmina
70f090c1ec refactor: add "margin_type" and "margin_rate_or_amount" to no copy 2024-11-08 10:24:06 +05:30
ruthra kumar
625ce41f39 Merge pull request #43273 from ljain112/fix-voucher-types
fix: improved the conditions for determining voucher subtypes
2024-11-08 10:19:41 +05:30
bhaveshkumar.j
442cdd7ce4 fix: NoneType while updating ordered_qty in SO for removed items 2024-11-08 10:14:20 +05:30
David
1313d81c5f feat: add deprecation dumpster 2024-11-07 19:51:50 +01:00
Frappe PR Bot
284fffe334 fix: sync translations from crowdin (#44002) 2024-11-07 13:38:37 +01:00
ruthra kumar
a10b38e8dd Merge pull request #43689 from ruthra-kumar/allow_multiple_payment_requests
refactor: allow multiple payment requests through customer portal
2024-11-07 15:20:00 +05:30
ruthra kumar
18c13a2cff refactor: handle PR's in advance stage 2024-11-07 14:49:41 +05:30
Smit Vora
ad6cc352f1 test: test voucher subtype for sales invoice 2024-11-07 13:35:54 +05:30
Smit Vora
f9dc9bdc0f Merge branch 'develop' into fix-voucher-types 2024-11-07 13:11:55 +05:30
Nihantra C. Patel
44832c3b5c fix: task showing limit in customer portal (#44003) 2024-11-07 06:55:48 +00:00
ruthra kumar
cda7800777 refactor: cancel old PR and invalidate tokens 2024-11-06 17:35:46 +05:30
ruthra kumar
e14a8f7752 Merge pull request #43972 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-06 14:31:31 +05:30
Sagar Vora
77aabce95e Merge pull request #43993 from sagarvora/fix-m00 2024-11-06 14:06:28 +05:30
Sagar Vora
e13e688987 fix: ensure list has items 2024-11-06 14:04:30 +05:30
Sagar Vora
c62596b323 fix: error when saving POS merge log (#43989) 2024-11-06 07:51:19 +00:00
Nihantra C. Patel
834d18840c fix: removed single quotes from deferred revenue (#43985) 2024-11-06 12:02:29 +05:30
Frappe PR Bot
2cb69f81c5 fix: Turkish translations 2024-11-06 11:03:21 +05:30
Ikko Eltociear Ashimine
30954ed645 chore: update serial_batch_bundle.py (#43981)
Avaliable -> Available
2024-11-06 10:06:00 +05:30
rohitwaghchaure
134c24b9c5 perf: too many writes error during reposting (#43978)
perf: too many writes error
2024-11-06 09:30:33 +05:30
Khushi Rawat
f5a8e72198 Merge pull request #43979 from khushi8112/correct-precision-for-asset-values
fix: added precision validation
2024-11-06 00:31:42 +05:30
Khushi Rawat
7daadcf420 fix: add precision validation 2024-11-05 23:36:26 +05:30
ruthra kumar
29a1fe8040 Merge pull request #43971 from ruthra-kumar/additional_changes_to_advance_ledger
refactor: update permission requirement for advance ledger
2024-11-05 10:58:30 +05:30
Frappe PR Bot
a817f21a8e fix: Swedish translations 2024-11-05 10:49:43 +05:30
Frappe PR Bot
c698b95523 fix: Spanish translations 2024-11-05 10:49:28 +05:30
ruthra kumar
e41560d30b refactor: update advance ledger role requirement 2024-11-05 10:32:02 +05:30
ruthra kumar
c832d9fb9a refactor: avoid permission issue for non-admin 2024-11-05 10:25:32 +05:30
Raffael Meyer
65088cbb1b fix: show "Send SMS" only when enabled (#43941) 2024-11-05 01:27:35 +01:00
ruthra kumar
dcaadbd528 Merge pull request #43388 from CaseSolvedUK/po-so-dash
fix: SO link on PO and add in missing dashboard references on both
2024-11-04 14:01:05 +05:30
ruthra kumar
50e477c3a3 Merge pull request #43955 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-04 13:16:23 +05:30
rohitwaghchaure
7cfe1c8d59 perf: avoid reposting of entries created after stock reco (#43950) 2024-11-04 13:04:35 +05:30
ruthra kumar
98a22b28b3 Merge pull request #43929 from ramyasusee/ramya-dev
fix: Map reference number while reversing Journal Entry
2024-11-04 12:27:54 +05:30
ramyasusee
77de783cd4 fix: map reference number while reversing journal 2024-11-04 12:03:08 +05:30
ruthra kumar
2b25f0ebc2 Merge pull request #43835 from hyaray/patch-16
Update fiscal_year.js
2024-11-04 11:17:27 +05:30
hyaray
d54283ded5 refactor: use year current year start date as default 2024-11-04 11:14:03 +05:30
Frappe PR Bot
280b5477d1 fix: Esperanto translations 2024-11-04 10:39:11 +05:30
Frappe PR Bot
6474b4551d fix: German translations 2024-11-04 10:39:07 +05:30
Frappe PR Bot
81181a8ec0 fix: Bosnian translations 2024-11-04 10:39:04 +05:30
Frappe PR Bot
0c3e59d852 fix: Persian translations 2024-11-04 10:39:00 +05:30
Frappe PR Bot
ec3d7c48b4 fix: Chinese Simplified translations 2024-11-04 10:38:52 +05:30
Frappe PR Bot
400b315309 fix: Turkish translations 2024-11-04 10:38:49 +05:30
Frappe PR Bot
a01917c6bd fix: Swedish translations 2024-11-04 10:38:45 +05:30
Frappe PR Bot
b4e772291c fix: Russian translations 2024-11-04 10:38:41 +05:30
Frappe PR Bot
f4d22fc26a fix: Polish translations 2024-11-04 10:38:38 +05:30
Frappe PR Bot
b43990962b fix: Hungarian translations 2024-11-04 10:38:36 +05:30
Frappe PR Bot
bb171c3db6 fix: Arabic translations 2024-11-04 10:38:32 +05:30
Frappe PR Bot
2414b9c0fc fix: Spanish translations 2024-11-04 10:38:29 +05:30
Frappe PR Bot
4e38524f07 fix: French translations 2024-11-04 10:38:26 +05:30
ruthra kumar
09d012cebf Merge pull request #43945 from frappe/l10n_develop
fix: sync translations from crowdin
2024-11-04 10:13:26 +05:30
Frappe PR Bot
8f7ce743e1 chore: update POT file (#43953) 2024-11-03 09:59:19 +00:00
Frappe PR Bot
a399142bd1 fix: Swedish translations 2024-11-03 09:25:50 +05:30
Frappe PR Bot
67d3f90c8c fix: Turkish translations 2024-11-02 09:15:49 +05:30
ruthra kumar
b3b7b1ad1f Merge pull request #43709 from ruthra-kumar/ledger_for_advance_payment
feat: Ledger for advance payment
2024-11-01 14:04:02 +05:30
Frappe PR Bot
7e6fc95db4 fix: Turkish translations 2024-11-01 09:00:58 +05:30
Frappe PR Bot
2d540c7110 fix: Swedish translations 2024-11-01 09:00:54 +05:30
rohitwaghchaure
ba9fb4effc fix: validation trigger (#43926) 2024-10-31 22:55:01 +05:30
rohitwaghchaure
01bb1612da fix: valuation rate for sales / purchase return for serial / batch nos (#43925) 2024-10-31 22:54:29 +05:30
ruthra kumar
cf7b8f1b41 test: PO advance and currency from journal 2024-10-31 10:36:22 +05:30
ruthra kumar
ca85c75e39 test: PO 'Advance Paid' and curreny when using payment 2024-10-31 10:36:22 +05:30
ruthra kumar
14cef3d4c4 chore: move tests to advance payment ledger doctype 2024-10-31 10:36:22 +05:30
ruthra kumar
1825082512 test: advance and currency from Journal 2024-10-31 10:36:22 +05:30
ruthra kumar
9c1a4e284c refactor: use dr / cr account currency field for journals 2024-10-31 10:36:22 +05:30
ruthra kumar
6c731561f3 test: USD Sales Order with advance payment 2024-10-31 10:36:22 +05:30
ruthra kumar
ae6a81cd07 refactor: handle currency on advance payment ledger 2024-10-31 10:36:22 +05:30
ruthra kumar
ad88bde448 refactor: move creation logic to controller 2024-10-31 10:36:22 +05:30
ruthra kumar
8e3bf7dc09 refactor: handle 'no data' situation in patch 2024-10-31 10:36:22 +05:30
ruthra kumar
767ae6a372 chore: update ignore_linked_doctypes for Journal Entry 2024-10-31 10:36:22 +05:30
ruthra kumar
8ab7194b1d chore: update patchex.txt 2024-10-31 10:36:22 +05:30
ruthra kumar
b927f2f4a0 refactor: patch to migrating old SO / PO to advance ledger 2024-10-31 10:36:22 +05:30
ruthra kumar
35a8a18728 refactor(test): reconciliation shouldn't affect advance paid 2024-10-31 10:36:22 +05:30
ruthra kumar
fca5e95248 refactor: link journal entry to advance payment ledger 2024-10-31 10:36:22 +05:30
ruthra kumar
14357bccba fix: deleting SO/PO will remove its advance payment ledger entry 2024-10-31 10:36:22 +05:30
ruthra kumar
c4197c3f31 refactor(test): advance_paid stays after reconciliation 2024-10-31 10:36:22 +05:30
ruthra kumar
e2891a60d5 chore: remove duplicate test class 2024-10-31 10:36:22 +05:30
ruthra kumar
3c53b92f05 refactor: remove advance payment ledgers on document deletion 2024-10-31 10:36:22 +05:30
ruthra kumar
2b2360bf7b refactor: calculate advance from advance ledger 2024-10-31 10:36:22 +05:30
ruthra kumar
575ca5b900 refactor: create advance ledger entries on submit and cancel 2024-10-31 10:36:22 +05:30
ruthra kumar
f176a82198 refactor: make all fields readonly 2024-10-31 10:36:22 +05:30
ruthra kumar
2d6efd7cc8 feat: advance payment ledger doctype 2024-10-31 10:36:22 +05:30
ruthra kumar
c7d6923452 Merge pull request #43937 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-31 09:55:02 +05:30
Frappe PR Bot
9006b8da2e fix: Chinese Simplified translations 2024-10-31 08:47:31 +05:30
Frappe PR Bot
91f745ce14 fix: Turkish translations 2024-10-31 08:47:28 +05:30
Raffael Meyer
2dd0f8b7e2 feat: remove Payroll Entry from Bank Account dashboard (#43931) 2024-10-30 14:15:53 +00:00
Shariq Ansari
46c96f6e95 Merge pull request #43921 from shariquerik/create-opp-fix 2024-10-30 13:47:42 +05:30
Shariq Ansari
603383bca7 fix: cannot create opp from lead without prospect 2024-10-30 12:04:17 +05:30
ruthra kumar
f12ec7a87e Merge pull request #43869 from aerele/tds-single-threshold
fix: calculate tds with net amount when invoice exceeds single threshold amount
2024-10-30 10:43:16 +05:30
ruthra kumar
5c8adbbd42 Merge pull request #43913 from nabinhait/pcv-opening-entry-fix
fix: find first PCV to consider opening entries
2024-10-30 10:24:02 +05:30
ruthra kumar
cce70f6657 Merge pull request #43886 from peniel-technology/develop
fix: remarks field in payment reconciliation
2024-10-30 10:19:25 +05:30
ruthra kumar
2564b7076f Merge pull request #43884 from ljain112/fix-pos-os
fix: recalculate outstanding after save on checkout for POS Invoice
2024-10-30 10:06:29 +05:30
ruthra kumar
24c86fb07d Merge pull request #43914 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-30 09:31:36 +05:30
Frappe PR Bot
64469fa328 fix: Swedish translations 2024-10-30 08:48:37 +05:30
Frappe PR Bot
237c972864 fix: Spanish translations 2024-10-30 08:48:20 +05:30
Nabin Hait
2201fc62a2 fix: find first PCV to consider opening entries 2024-10-30 00:25:18 +05:30
Khushi Rawat
22d46adf63 Merge pull request #43899 from khushi8112/rate-of-depreciation
fix: consider opening asset values while calculating depreciation rate
2024-10-30 00:05:22 +05:30
Nabin Hait
7994b05cef fix: restored report tests for manufacturing (#43907) 2024-10-29 23:22:38 +05:30
Nabin Hait
3a0d27b393 fix: Patch for reposting account closing balance (#43905) 2024-10-29 23:00:41 +05:30
Nabin Hait
966e8fa85e fix: rounding issue of required qty in subcontracting order (#43810)
* fix: rounding issue of required qty in subcontracting order

* fix: uom issue in test case

* fix: test case
2024-10-29 22:36:56 +05:30
Nabin Hait
0bba6442c0 fix: Calculate gross margin on update of project costing from invoices (#43876)
* fix: Calculate gross margin on update of project costing from invoices

* chore: linter issues
2024-10-29 18:21:19 +05:30
Ahmed Shareef
2d5b079949 fix: remarks field in payment reconciliation 2024-10-29 16:47:44 +04:00
Khushi Rawat
9d0fe7aa56 fix: consider opening asset values while calculating asset depreciation rate 2024-10-29 17:47:48 +05:30
Nabin Hait
adba1168c1 fix: calculate percentage received and delivered considering over-receipt and over-delivery (#43870) 2024-10-29 16:54:07 +05:30
Nabin Hait
34295d0344 fix: post account closing balance against pcv closing account (#43887) 2024-10-29 16:53:11 +05:30
ruthra kumar
aff63b92b7 Merge pull request #43856 from IMS94/fix-43811-sales-register
fix: add parenttype clause to invoice tax query in sales_register report
2024-10-29 15:39:20 +05:30
ruthra kumar
3edab67c55 Merge pull request #43698 from lbrandh/project_chart
fix: Project name instead of ID in chart
2024-10-29 15:23:23 +05:30
rohitwaghchaure
0c93bc31a5 fix: do not copy serial numbers from DN to SI (#43885) 2024-10-29 15:07:10 +05:30
lukas.brandhoff
736d1a1105 refactor: include 'Project Name' in Project summary report
Keep name field for backwards compatibility
2024-10-29 14:58:08 +05:30
ruthra kumar
a93d89c126 Merge pull request #43823 from ljain112/fix-portal
fix: Handle None value for item description in customer portal invoice view
2024-10-29 14:44:18 +05:30
ruthra kumar
85ccc9e0d8 Merge pull request #43824 from ljain112/fix-ad-field
fix: accounting dimension fieldname
2024-10-29 13:45:28 +05:30
ljain112
9ce2184c66 fix: recalculate outstanding after save on checkout for POS Invoice 2024-10-29 12:15:59 +05:30
Venkatesh
99d1c5f342 fix: use period closing voucher object to call get_account_closing_ba… (#43880)
fix: use period closing voucher object to call get_account_closing_balances method
2024-10-29 11:47:40 +05:30
ruthra kumar
624293750c Merge pull request #43803 from aerele/party_name_payment_request
feat: add party name in payment request
2024-10-29 11:16:32 +05:30
Raffael Meyer
b42e7d4b32 refactor(Timesheet): move methods to Timesheet Detail (#43794) 2024-10-29 01:05:32 +01:00
mergify[bot]
b4d4c4a736 fix: purchase return validation issue (backport #43871) (#43874)
fix: purchase return validation issue (#43871)

(cherry picked from commit a7cc7b28c0)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-10-28 17:21:36 +05:30
rohitwaghchaure
0a70be5b99 fix: work order finish button not showing (#43875) 2024-10-28 17:21:06 +05:30
venkat102
94badb464d test: add unit test to validate purchase invoice exceeding single threshold value 2024-10-28 12:43:55 +05:30
venkat102
ef694a40a1 fix: calculate tds with net amount when invoice exceeds single threshold amount 2024-10-28 12:42:58 +05:30
ruthra kumar
c74bc51b41 Merge pull request #43862 from ruthra-kumar/fix_garbage_description_in_razorpay
refactor: fix garbage title, desc and name in razorpay
2024-10-28 12:22:54 +05:30
ruthra kumar
7e45d1555a Merge pull request #43685 from ljain112/fix-arap-report
fix: do not check for payment terms details for return invoices.
2024-10-28 11:22:36 +05:30
ruthra kumar
7332ec8fbd refactor: fix garbage title, desc and name in razorpay 2024-10-28 10:47:34 +05:30
rohitwaghchaure
ad6ce09b86 fix: incorrect value of available_qty_for_consumption in subcontracti… (#43836)
fix: incorrect value of available_qty_for_consumption in subcontracting receipt
2024-10-28 10:42:07 +05:30
ruthra kumar
6d7c5871de Merge pull request #43833 from ljain112/fix-exp-acc
refactor: query for expense_account moved to setup hook in purchase invoice
2024-10-28 09:43:20 +05:30
ruthra kumar
31da5c0cc0 Merge pull request #43851 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-28 09:37:42 +05:30
Imesha Sudasingha
e30ab141f4 fix: add parenttype clause to invoice tax query in sales_register report 2024-10-28 03:43:56 +00:00
Frappe PR Bot
99a3a07e63 fix: Russian translations 2024-10-28 08:27:16 +05:30
Frappe PR Bot
dc19fe02d3 fix: Polish translations 2024-10-28 08:27:12 +05:30
Frappe PR Bot
d2306f67ef fix: Chinese Simplified translations 2024-10-28 08:27:09 +05:30
Frappe PR Bot
2c3f60f74d fix: Hungarian translations 2024-10-28 08:27:06 +05:30
Frappe PR Bot
da798ee9c5 fix: Esperanto translations 2024-10-28 08:27:03 +05:30
Frappe PR Bot
2cae324924 fix: Swedish translations 2024-10-28 08:27:00 +05:30
Frappe PR Bot
1c0550e944 fix: Spanish translations 2024-10-28 08:26:56 +05:30
Frappe PR Bot
49443a01aa fix: Arabic translations 2024-10-28 08:26:53 +05:30
Frappe PR Bot
b6feff03a0 fix: Bosnian translations 2024-10-28 08:26:50 +05:30
Frappe PR Bot
4223a2b73e fix: Turkish translations 2024-10-28 08:26:45 +05:30
Frappe PR Bot
b5b63d5ae6 fix: French translations 2024-10-28 08:26:42 +05:30
Frappe PR Bot
67a0022d37 fix: Persian translations 2024-10-28 08:26:38 +05:30
Frappe PR Bot
67423e0b09 fix: German translations 2024-10-28 08:26:35 +05:30
Frappe PR Bot
46adceb8a7 chore: update POT file (#43853) 2024-10-27 11:10:31 +01:00
Frappe PR Bot
147b07f1c2 fix: German translations 2024-10-27 08:23:56 +05:30
Frappe PR Bot
ffbc9f8dfd fix: sync translations from crowdin (#43827) 2024-10-26 19:52:05 +02:00
Raffael Meyer
1d40e3dbe3 fix(RFQ): make strings translatable (#43843) 2024-10-26 19:22:29 +02:00
Nabin Hait
c330a292d2 fix: Negative stock validation against inventory dimension (#43834) 2024-10-26 13:03:38 +05:30
rohitwaghchaure
5a967bc868 fix: basic rate not editable in Stock Entry Detail (#43837) 2024-10-25 18:41:49 +05:30
ljain112
912e1e3f3d fix: hide payment terms for return and paid purchase invoices 2024-10-25 18:14:07 +05:30
ljain112
8b700eadc7 fix: do not set payment terms for return invoices 2024-10-25 18:09:01 +05:30
ljain112
a9ac0cc223 refactor: query for expense_account moved to setup hook in purchase invoice 2024-10-25 17:11:27 +05:30
ruthra kumar
8647c67b35 Merge pull request #43830 from ruthra-kumar/missing_bill_no_in_general_ledger
fix: set bill_no before `against_voucher` gets concatenated
2024-10-25 14:00:11 +05:30
ruthra kumar
7bade7f1fe fix: set bill_no before against_voucher gets concatenated 2024-10-25 13:31:01 +05:30
Nabin Hait
91f6f75a5b fix: map item_ID instead of item_code while creating subcontracting order from PO (#43822) 2024-10-24 22:10:43 +05:30
David Arnold
349c2b1cdc Merge pull request #43821 from blaggacao/ci/add-upstream-dispatch
ci: trigger ci runs from upstream fix
2024-10-24 14:52:13 +02:00
ljain112
ceb449c75b fix: Handle None value for item description in customer portal invoice view 2024-10-24 18:10:08 +05:30
David
2f747a274f ci: trigger ci runs from upstream fix 2024-10-24 14:26:55 +02:00
David Arnold
6a2ed74de2 Merge pull request #43819 from blaggacao/ci/add-upstream-dispatch
ci: trigger ci runs from upstream
2024-10-24 13:12:29 +02:00
David
c314b71917 ci: trigger ci runs from upstream 2024-10-24 12:11:07 +02:00
Deepesh Garg
af472054f6 fix: Unnecessary validation for non deferred sales invoices (#43816) 2024-10-24 12:58:47 +05:30
ruthra kumar
076486e1f8 Merge pull request #43813 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-24 10:26:20 +05:30
Frappe PR Bot
67fe7f294a fix: Turkish translations 2024-10-24 08:26:06 +05:30
Raffael Meyer
fe1e1b12c3 chore(Timesheet): add type hints (#43793) 2024-10-23 22:52:42 +00:00
ljain112
ca31a19eb7 fix: validate fieldname 2024-10-23 18:14:30 +05:30
ljain112
023b7b9a60 fix: scrub "-" from fieldname in accounting dimension 2024-10-23 18:13:42 +05:30
Nabin Hait
96ea64fd00 fix: consider gle based on balances in company currency (#43804) 2024-10-23 17:08:48 +05:30
ruthra kumar
e8f3d1323c Merge pull request #43755 from IamSaiyyamChhetri/company_filter_issue
fix: Add Company Filter
2024-10-23 16:49:29 +05:30
IamSaiyyamChhetri
9909d760a5 fix: add company filter for project
- In Project dt Sales Order field
- In Sales Order dt Project field
2024-10-23 16:45:44 +05:30
ruthra kumar
031e33a2d1 Merge pull request #43796 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-23 16:17:19 +05:30
Nabin Hait
0c71df9a75 fix: wrong fieldname (#43799) 2024-10-23 14:35:09 +05:30
RAVIBHARATHI P C
0acb609d97 feat: add party name in payment request 2024-10-23 14:27:13 +05:30
Nabin Hait
8b7e153616 perf: performance optimizations for accounting reports by refactoring account closing balance and period closing voucher (#43435)
* fix: Gl Entry form cleanup

* fix: Added indexes in gl entry table

* perf: Refactored period closing voucher to handle large volume of gle

* fix: fixes as per new period start and end date fields in PCV

* perf: performance optimization for  accounting reports

* perf: performance optimizations for account closing balance patch

* fix: test cases

* fix: lenter issues - direct use of sql query

* fix: test cases

* fix: test cases

* fix: test cases
2024-10-23 11:53:09 +05:30
Frappe PR Bot
4183581515 fix: Russian translations 2024-10-23 08:18:54 +05:30
Frappe PR Bot
4250c9c8ed fix: Polish translations 2024-10-23 08:18:51 +05:30
Frappe PR Bot
b44d309466 fix: Swedish translations 2024-10-23 08:18:47 +05:30
Frappe PR Bot
977f6a1121 fix: Spanish translations 2024-10-23 08:18:42 +05:30
Frappe PR Bot
2a113831e1 fix: German translations 2024-10-23 08:18:37 +05:30
Raffael Meyer
345d32432b fix: use correct variable in error message (#43790) 2024-10-22 17:24:40 +02:00
Smit Vora
c9c8755a2a Merge pull request #43787 from ljain112/refactor-payment-request 2024-10-22 20:17:38 +05:30
Smit Vora
679bab1d09 Merge pull request #43769 from Ninad1306/auto_create_pr_from_sr 2024-10-22 20:12:08 +05:30
ljain112
669ea3ad35 refactor: condition check before get_doc 2024-10-22 19:51:50 +05:30
Smit Vora
cc7ac8bcc7 Merge pull request #43462 from vishakhdesai/journal-entry-issue 2024-10-22 19:34:31 +05:30
Ninad Parikh
004c4e21d4 fix: Required Changes to Support e-Waybill Generation for Material Transfer Return (#43061) 2024-10-22 19:28:02 +05:30
Smit Vora
f8f7335412 Merge pull request #43752 from ljain112/fix-order-pages 2024-10-22 19:09:05 +05:30
Ninad1306
66211dafd6 fix: better implementation, handle missing purchase order 2024-10-22 17:24:46 +05:30
Raffael Meyer
c4faa0e101 refactor: validate_return_against_account (#43778) 2024-10-22 13:44:28 +02:00
Ninad1306
59887bbc13 test: auto create purchase receipt 2024-10-22 17:00:11 +05:30
ruthra kumar
cfe1c8fd6a Merge pull request #43775 from cogk/fix-deferred-accounting
fix(deferred_revenue): Escape account in query
2024-10-22 16:11:08 +05:30
Corentin Forler
c7b3ae41d4 fix(deferred_revenue): Escape account in query 2024-10-22 12:14:28 +02:00
Khushi Rawat
bd0c6056a5 Merge pull request #43770 from frappe/revert-43703-update-depreciation-checkbox-to-select
chore: revert use selectbox instead of checkbox
2024-10-22 13:16:58 +05:30
Khushi Rawat
d47ab7870d Revert "chore: use selectbox instead of checkbox" 2024-10-22 12:37:06 +05:30
Ninad1306
60ceb91ace fix: map doc from purchase order 2024-10-22 12:16:59 +05:30
ruthra kumar
18bc82fc9c Merge pull request #43766 from ruthra-kumar/allow_unreconcile_on_bank_cash_entry
refactor: allow unreconcile on bank and cash entry type journals
2024-10-22 12:04:41 +05:30
ruthra kumar
2c4f37f488 refactor: allow unreconcile on bank and cash entry type journals 2024-10-22 11:59:57 +05:30
ruthra kumar
f3fd07f0ca Merge pull request #43761 from bhavesh95863/fix-coupon-code
fix: coupon code validation logic
2024-10-22 10:06:25 +05:30
Khushi Rawat
10f359700e Merge pull request #43378 from khushi8112/add-email-field-to-asset-maintenance-log
feat: added task assignee email field in asset maintenance log
2024-10-22 01:13:14 +05:30
bhaveshkumar.j
1561a9e1bf fix: remove extra space 2024-10-21 18:23:39 +00:00
bhaveshkumar.j
d04257a32d fix: coupon code validation logic 2024-10-21 18:22:30 +00:00
Shariq Ansari
01fcb083c0 Merge pull request #43759 from shariquerik/lead-connection-fix 2024-10-21 20:24:58 +05:30
Shariq Ansari
0dc518b1c3 fix: lead create opp from connection not working 2024-10-21 20:16:35 +05:30
Nabin Hait
e94ffb87cd fix: Workspace link for Work Order Consumed Materials report (#43753) 2024-10-21 15:33:30 +05:30
ljain112
fc2cac62c1 fix: only show pay button for specific doctype in portal 2024-10-21 13:53:40 +05:30
Khushi Rawat
52f1c7fac2 Merge pull request #43703 from khushi8112/update-depreciation-checkbox-to-select
chore: use selectbox instead of checkbox
2024-10-21 13:47:09 +05:30
ruthra kumar
66c726bf86 Merge pull request #42461 from HarryPaulo/fix-lock-screen-on-load-invoices
fix: Freeze Screen on load invoices on POS Closing Entry
2024-10-21 12:26:13 +05:30
ruthra kumar
feed761a5e Merge pull request #43720 from ljain112/fix-party-balance
fix: party_balance based on company in payment entry
2024-10-21 12:22:49 +05:30
ruthra kumar
0f19b59d53 Merge pull request #43727 from aerele/deferred-expense-period
fix: get period estimate till service end date
2024-10-21 12:19:09 +05:30
ruthra kumar
9404303755 Merge pull request #43726 from ljain112/fix-process-statemets--of-accounts
fix: "show_remarks" checkbox in Process statement of accounts
2024-10-21 12:13:28 +05:30
ruthra kumar
51536f8433 Merge pull request #43730 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-21 12:10:57 +05:30
ruthra kumar
1acfc5446e Merge pull request #43735 from ZeWaren/adds-french-npo-accounts
feat: Add the chart of accounts for French NPOs
2024-10-21 11:21:31 +05:30
ruthra kumar
3eaaca7309 Merge pull request #43728 from aerele/reconciliation-against-advance
fix: get party advance amount based on account
2024-10-21 11:16:44 +05:30
Frappe PR Bot
55cd72256f fix: Chinese Simplified translations 2024-10-21 07:56:34 +05:30
Frappe PR Bot
ff7fdec107 fix: Hungarian translations 2024-10-21 07:56:31 +05:30
Frappe PR Bot
fc37cfb6fd fix: Esperanto translations 2024-10-21 07:56:28 +05:30
Frappe PR Bot
820e7e958b fix: Swedish translations 2024-10-21 07:56:25 +05:30
Frappe PR Bot
37e5c1999f fix: Spanish translations 2024-10-21 07:56:21 +05:30
Frappe PR Bot
04bde39527 fix: Arabic translations 2024-10-21 07:56:17 +05:30
Frappe PR Bot
2f1014d2b7 fix: Bosnian translations 2024-10-21 07:56:14 +05:30
Frappe PR Bot
9c9f455324 fix: Turkish translations 2024-10-21 07:56:11 +05:30
Frappe PR Bot
5bf78bf8cf fix: French translations 2024-10-21 07:56:08 +05:30
Frappe PR Bot
0ad49936e6 fix: Persian translations 2024-10-21 07:56:04 +05:30
Frappe PR Bot
18cbb01700 fix: German translations 2024-10-21 07:56:01 +05:30
Khushi Rawat
de47f3aa00 fix: removed checkbox 2024-10-21 04:40:55 +05:30
Khushi Rawat
1e60e8db03 chore: Merge branch develop to head branch 2024-10-21 01:27:18 +05:30
Frappe PR Bot
89abe25c56 chore: update POT file (#43736) 2024-10-20 14:33:32 +02:00
Frappe PR Bot
3157427d76 fix: Swedish translations 2024-10-20 07:48:50 +05:30
Erwan Martin
548f23e440 feat: Add the chart of accounts for French NPOs
The French chart of accounts for NPOs is a variation of the general chart.
This adds the latest version of it: .2018-06.
Reference: https://www.associations.gouv.fr/le-nouveau-plan-comptable-depuis-le-1er-janvier-2020.html
2024-10-19 18:18:01 +02:00
Khushi Rawat
d24634fe2a Merge pull request #43723 from khushi8112/depreciation-on-sale-of-asset
fix: do not make new depreciation for fully depreciated asset
2024-10-19 21:47:28 +05:30
Frappe PR Bot
10bd442902 fix: Spanish translations 2024-10-19 07:49:46 +05:30
venkat102
d7fa95dd2f fix: get party advance amount based on account 2024-10-18 18:42:45 +05:30
ljain112
f4600df1f7 fix: "show_remarks" checkbox in Process statement of accounts 2024-10-18 18:02:25 +05:30
venkat102
a7ba7e9c28 fix: get period estimate till service end date 2024-10-18 18:00:40 +05:30
Khushi Rawat
25de412371 fix: do not make new depreciation for fully depreciated asset 2024-10-18 16:47:57 +05:30
ljain112
97c9adf06b fix: party_balance based on company in payment entry 2024-10-18 13:28:46 +05:30
ruthra kumar
ee8cae11ee Merge pull request #43295 from doancan/patch-1
fix: translate Update default_success_action.py
2024-10-18 11:47:03 +05:30
Doğancan
804558e5bf refactor: update default_success_action.py
The _(doctype) inside get_message is removed from the .format() method. The reason is that _(doctype) would attempt to translate the doctype itself, which is generally not required since the doctypes in doctype_list are system-level terms. The main string "{0} has been submitted successfully" should be translated, and then it should receive the doctype name as an argument.
2024-10-18 11:19:31 +05:30
ruthra kumar
61566f7171 Merge pull request #43180 from devdiogenes/pos-invoice-call-super-onload_post_render
fix: Call super onload_post_render inside pos_invoice.js
2024-10-18 10:41:07 +05:30
ruthra kumar
8db68d3495 Merge pull request #42898 from niyazrazak/patch-21
fix: incorrect amount in bank clearance
2024-10-18 10:32:38 +05:30
ruthra kumar
272e9f2dd3 Merge pull request #43714 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-18 10:19:34 +05:30
Frappe PR Bot
e828cd383e fix: Persian translations 2024-10-18 07:46:29 +05:30
rohitwaghchaure
4fd4a37dc9 fix: added validation for UOM must be whole number (#43710) 2024-10-17 15:07:34 +05:30
David Arnold
21f5482022 Merge pull request #43694 from blaggacao/chore/remove-no-op-ad-hoc-test-record-creation
chore(tests): remove noop ad-hoc record creation
2024-10-17 08:53:22 +02:00
ruthra kumar
a91ca4d822 Merge pull request #43704 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-17 10:14:22 +05:30
Frappe PR Bot
97a27aba9e fix: Chinese Simplified translations 2024-10-17 07:31:12 +05:30
David Arnold
2047246e20 Merge pull request #43702 from blaggacao/tests/fix-setup-class-methods
fix(testing): setup class must invoke super
2024-10-16 20:36:14 +02:00
Khushi Rawat
7ba0015de6 chore: use selectbox instead of checkbox 2024-10-16 23:44:02 +05:30
David
895143a847 fix(testing): setup class must invoke super 2024-10-16 18:56:18 +02:00
David Arnold
05569466be Merge pull request #43700 from blaggacao/tests/no-global-record-deletions
test: don't delete global test records (it's forbidden)
2024-10-16 17:46:05 +02:00
David
e46736ce35 test: don't delete global test records (it's forbidden) 2024-10-16 17:07:23 +02:00
David Arnold
dcf08604da Merge pull request #43697 from blaggacao/fix/fy-test-record-creation
test: don't create current fiscal year as it fails to create
2024-10-16 16:15:35 +02:00
David
d7ab7fd672 test: don't create current fiscal year as it fails to create 2024-10-16 15:50:55 +02:00
David Arnold
f6b55d14d5 Merge pull request #43696 from blaggacao/tests/remove-unneeded-flags
test: remove no-op flags in preparation of cleaning upstream
2024-10-16 15:26:57 +02:00
David
0b98fbe960 test: remove no-op flags in preparation of cleaning upstream 2024-10-16 15:01:03 +02:00
David
ac5e449592 chore(tests): remove noop ad-hoc record creation 2024-10-16 13:26:23 +02:00
rohitwaghchaure
a671fe13d4 fix: list view and form status not same for purchase order (#43690) 2024-10-16 13:42:39 +05:30
ruthra kumar
07f8899f80 Merge pull request #43488 from cogk/fix-hide-print-labels-for-terms-and-conditions
fix: Hide print labels for Terms and Conditions
2024-10-16 10:45:19 +05:30
ruthra kumar
cca02fffab Merge pull request #43688 from frappe/l10n_develop
fix: sync translations from crowdin
2024-10-16 10:33:41 +05:30
Frappe PR Bot
1cc010a161 fix: Turkish translations 2024-10-16 07:35:54 +05:30
ljain112
6703b7d1ae fix: do not check for payment terms details for return invoices. 2024-10-15 18:38:42 +05:30
ruthra kumar
e3ab46a1af Merge pull request #43663 from ljain112/fix-pcv-eneque
fix: run gl_entries and closing voucher processes in same function
2024-10-15 17:03:35 +05:30
ruthra kumar
f0adc16d86 Merge pull request #43661 from ljain112/fix-consolidated-report
fix: missing child company accounts in consolidated balance sheet
2024-10-15 16:59:08 +05:30
ruthra kumar
fc66408194 Merge pull request #43602 from ljain112/fix-closing-balances
fix: added parentheses for correct query formation for logical OR condition
2024-10-15 16:44:31 +05:30
Frappe PR Bot
4e8f3fefac fix: sync translations from crowdin (#43583) 2024-10-15 13:09:05 +02:00
ruthra kumar
14c649108c Merge pull request #43600 from ljain112/fix-bank-reco-stmt
fix: added string for translation in bank reconciliation statement
2024-10-15 16:31:00 +05:30
ruthra kumar
bfdb896a4e Merge pull request #43643 from Sanket322/ensure_db_before_fetch
fix: check for the existence of a doctype before querying.
2024-10-15 16:28:44 +05:30
rohitwaghchaure
05915415de fix: refetch items from BOM if 'Use Multi-Level BOM' has changed usin… (#43672)
fix: refetch items from BOM if 'Use Multi-Level BOM' has changed using api
2024-10-15 16:08:58 +05:30
rohitwaghchaure
a52756f1d4 fix: conversion factor issue (#43645) 2024-10-15 15:45:13 +05:30
rohitwaghchaure
29ff682eca fix: incorrect warehouse in the serial no selector for rejection (#43671) 2024-10-15 15:43:29 +05:30
ruthra kumar
0a7da4f1f6 Merge pull request #43557 from ljain112/fix-promo-scheme
fix: delete invalid pricing rule on change of applicable_for values
2024-10-15 15:24:40 +05:30
ruthra kumar
0a56bd79e5 Merge pull request #43662 from ljain112/fix-tax
fix: removed unused query
2024-10-15 13:22:33 +05:30
ljain112
af4daa5b0f fix: run gl_entries and closing voucher processes in same function 2024-10-15 12:42:48 +05:30
rohitwaghchaure
6087a57b0c fix: zero incoming rate for delivery note return (#43642) 2024-10-15 11:57:02 +05:30
rohitwaghchaure
7979d3a534 Merge pull request #43570 from aerele/update_actual_qty
fix: update item details with actual quantity
2024-10-15 11:55:59 +05:30
ljain112
5f590ddfa2 fix: removed unused query 2024-10-15 11:52:44 +05:30
ljain112
7fae9d57d2 fix: missing child company accounts in consolidated balance sheet 2024-10-15 11:41:00 +05:30
ruthra kumar
d42ea3d400 Merge pull request #43655 from frappe/mergify/copy/develop/pr-43521
fix: Link opportunity from RFQ to supplier quotation (copy #43521)
2024-10-15 10:33:53 +05:30
Syed Mujeer Hashmi
528748d37c fix: Link opportunity from RFQ to supplier quotation
(cherry picked from commit eb1f1255eb)
2024-10-15 04:39:54 +00:00
ruthra kumar
7dedcc428b Merge pull request #43426 from aerele/balancesheet-report-summary
fix: show total amount on report summary
2024-10-15 06:02:33 +05:30
ruthra kumar
22dd6f01e4 Merge pull request #43601 from aerele/unreconcile-payment-naming
refactor: remove 'format:' based naming
2024-10-14 21:14:22 +05:30
Venkatesh
8751d09d69 Merge branch 'frappe:develop' into balancesheet-report-summary 2024-10-14 21:11:41 +05:30
venkat102
e8e1ec0e85 refactor: remove 'format:' based naming 2024-10-14 20:49:59 +05:30
Smit Vora
5a8224886d Merge pull request #43614 from Ninad1306/pricing_rule_fix
fix: ignore free item when qty is zero
2024-10-14 16:19:45 +05:30
Nihantra C. Patel
d57624b182 fix: quotation to so frappe crm (#43644) 2024-10-14 14:04:47 +05:30
Sanket322
48ed12bdd7 fix: check for existence of doctype before querying 2024-10-14 12:25:32 +05:30
Smit Vora
1587d2063f Merge pull request #43638 from Abdeali099/payment-request-fixes
fix: Use `ref_doc.get()` for `party_account_currency`
2024-10-14 11:37:12 +05:30
Abdeali Chharchhoda
b79549422a fix: Use ref_doc.get() for party_account_currency 2024-10-13 19:58:20 +05:30
Frappe PR Bot
61dba713f5 chore: update POT file (#43636) 2024-10-13 13:57:01 +01:00
ruthra kumar
a9afd7efd2 Merge pull request #43627 from ruthra-kumar/fix_approach2_advance_order_to_invoice
fix: reconciled advance from reported in reconciliation tool
2024-10-13 08:36:48 +05:30
ruthra kumar
e7505e92c9 chore: better comments for context 2024-10-13 08:08:54 +05:30
ruthra kumar
f1ec61c19e test: reconciled Invoice should not showup in tool
Scenario should be tested on 'Advance in separate party account'
2024-10-13 08:04:34 +05:30
ruthra kumar
8a6978e550 test: unreconciliation of individual SO from Advance Payment 2024-10-13 08:04:34 +05:30
ruthra kumar
a21a406d04 refactor(test): utility methods for enabling advance in separate acc 2024-10-13 08:04:34 +05:30
ruthra kumar
e7bb960bb5 refactor: use hooks to identify advance doctypes 2024-10-13 08:04:34 +05:30
ruthra kumar
a112581acd refactor: reference update logic in advance 2024-10-13 08:04:34 +05:30
ruthra kumar
b409f74620 fix: don't update reference to SI / PI on advances 2024-10-13 08:04:34 +05:30
David Arnold
043bfdffbf ci: add action to matrix-run individual tests 2024-10-13 03:22:55 +02:00
David
969994c4a3 ci: run each test individually 2024-10-13 02:58:27 +02:00
David Arnold
6efcb91bce Merge pull request #43630 from blaggacao/chore/move-to-toml
chore(tests): move to compact, human readable, commentable toml layout for test records
2024-10-13 02:03:45 +02:00
David
b1bfc2f791 chore(tests): fix wrong unscrub 2024-10-13 01:40:08 +02:00
David
bb917207c2 chore(tests): move to compact, human readable, commentable toml layout for test records 2024-10-13 01:31:28 +02:00
David Arnold
cc954d9c67 Merge pull request #43612 from blaggacao/refactor/alignment-in-test-record-creation
test: step 2 refactor towards idempotency
2024-10-13 00:31:30 +02:00
David
8867702f2c chore: update imports 2024-10-13 00:06:58 +02:00
David
c17de26e44 test: make tests independent of selling price validation 2024-10-13 00:06:48 +02:00
David Arnold
727b395e62 Merge pull request #43620 from blaggacao/test/item-group-test-idempotency
test: prepare item group test idempotency
2024-10-12 12:18:51 +02:00
David
5cc86dae2b test: increase error context on test_item_group 2024-10-12 11:58:11 +02:00
David
eeee06fd7c test: fix test_sales_invoice setup 2024-10-12 11:28:19 +02:00
David
4f2db78247 test: fix test_purchase_invoice setup 2024-10-12 11:28:19 +02:00
David
fc6a7ca56a test: fix test_pos_invoice setup 2024-10-12 11:28:19 +02:00
David
cba398f186 test: fix test_asset_repair setup 2024-10-12 11:28:18 +02:00
David
56c99fe7e1 refactor: use cls.globalTestRecords instead of declaring test_records 2024-10-12 11:28:18 +02:00
David Arnold
d8b0b92925 test: don't load test records into db during module import
test: don't load test records into db during module import
2024-10-11 13:42:50 +02:00
David
d32326fca1 test: don't load test records into db during module import 2024-10-11 13:24:30 +02:00
rohitwaghchaure
8beee1982f fix: show incorrect entries filter in Stock Ledger Invariant Check report (#43619)
fix: show incorrect entry filter in Stock Ledger Invariant Check report
2024-10-11 14:17:34 +05:30
Ninad1306
a2b41a0c16 test: test case to validate free item is ignored when qty is zero 2024-10-11 14:02:50 +05:30
rohitwaghchaure
16e8156f01 fix: height and font size plant floor (#43618) 2024-10-11 13:41:16 +05:30
Ninad1306
7ae98f77ee fix: ignore free item when qty is zero 2024-10-11 11:33:27 +05:30
ljain112
c0da8f11f7 fix: added parentheses for correct query formation for logical OR condition 2024-10-11 11:07:19 +05:30
David Arnold
172b2835b8 Merge pull request #43610 from blaggacao/refactor/alignment-in-test-record-creation
test: step 1 refactor towards idempotency
2024-10-11 05:19:22 +02:00
David
a2d22c3f42 chore: remove redundant declarations of test_records 2024-10-11 05:00:20 +02:00
Khushi Rawat
ec51a981e5 Merge branch 'develop' into add-email-field-to-asset-maintenance-log 2024-10-11 01:23:06 +05:30
David Arnold
922b5d1be5 refactor: clarify test record module iface (treewide)
This aims at reducing the deprecation warning pressure on a standard Erpnext test run.
2024-10-10 19:21:19 +02:00
David
ed5bead87d refactor: clarify test record module iface (treewide) 2024-10-10 13:26:26 +02:00
David Arnold
2fc4f86191 Merge pull request #43603 from blaggacao/ci/fix-ill-specced-test
tests: fix item detail test module
2024-10-10 12:31:50 +02:00
David
9bb00d53bd test: fix item detail test module
```console
======================================================================
 ERROR  setUpClass (erpnext.stock.tests.test_get_item_details.TestGetItemDetail)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/frappe-bench/apps/frappe/frappe/tests/classes/integration_test_case.py", line 53, in setUpClass
    raise NotImplementedError(
    __class__ = <class 'frappe.tests.classes.integration_test_case.IntegrationTestCase'>
    cls = <class 'erpnext.stock.tests.test_get_item_details.TestGetItemDetail'>
    ignore = ['BOM']
    to_add = ['Customer', 'Supplier', 'Item', 'Price List', 'Item Price']
NotImplementedError: IGNORE_TEST_RECORD_DEPENDENCIES is only implement for test modules within a doctype folder <module 'erpnext.stock.tests.test_get_item_details' from '/home/runner/frappe-bench/apps/erpnext/erpnext/stock/tests/test_get_item_details.py'> None
```
2024-10-10 12:13:47 +02:00
venkat102
d60600efb2 fix: check for empty row to get total amount 2024-10-10 12:07:20 +05:30
ljain112
c99d9f7037 fix: added string for translation in bank reconciliation statement 2024-10-10 11:27:26 +05:30
rohitwaghchaure
ab171326f3 fix: production plan bom error (#43591) 2024-10-09 15:15:42 +05:30
rohitwaghchaure
48a12e7213 fix: make LCV button not working for PI and PR (#43592) 2024-10-09 15:15:24 +05:30
rohitwaghchaure
fc67867a60 fix: allow to change the batch in the subcontracting receipt (#43584) 2024-10-09 13:04:13 +05:30
Nihantra C. Patel
7fc51cc832 Merge pull request #43585 from Vishv-024/trends_report
fix: the purchase receipt trends and delivery note trends report
2024-10-09 12:35:44 +05:30
Nihantra C. Patel
b3e4463a4f fix: trends date filter issue --formatter 2024-10-09 12:15:36 +05:30
Vishv-silveroak
2e9dda1588 fix: fix the purchase receipt trends and delivery note trends report 2024-10-09 10:51:01 +05:30
Frappe PR Bot
22a0da929f fix: sync translations from crowdin (#43389) 2024-10-08 17:58:18 +01:00
Bhavan23
5044297321 fix: update formatings 2024-10-08 18:14:00 +05:30
Bhavan23
5f4a523340 fix: update formatings 2024-10-08 17:49:12 +05:30
rohitwaghchaure
6ddda6c949 fix: 'NoneType' object has no attribute 'has_serial_no' (#43514) 2024-10-08 17:41:09 +05:30
rohitwaghchaure
5130f7d411 fix: Accepted and Rejected warehouse cannot be same (#43568) 2024-10-08 17:40:35 +05:30
Smit Vora
3e5ecb44db Merge pull request #43271 from ljain112/fix-tcs
fix: deduct advances adjusted for threshold check for tcs
2024-10-08 17:34:30 +05:30
ljain112
2613bdd868 test: added test for change in applicable_for_value in promotional scheme 2024-10-08 17:06:05 +05:30
rohitwaghchaure
69127e8609 fix: Unknown column 'serial_no' in 'field list' (#43515) 2024-10-08 16:50:26 +05:30
Bhavan23
17fdd42645 test: Validate the actual quantity when creating a material request from the sales order 2024-10-08 16:24:28 +05:30
Bhavan23
930208117c Merge branch 'develop' of github.com:aerele/erpnext into update_actual_qty 2024-10-08 16:23:25 +05:30
Bhavan23
9dbdfec9b7 fix: update item details with actual quantity. 2024-10-08 16:18:31 +05:30
rohitwaghchaure
7a0a893d08 fix: validation for corrective job card (#43555) 2024-10-08 13:48:36 +05:30
ljain112
42746fc630 fix: delete invalid pricing rule on change of applicable_for 2024-10-08 12:54:28 +05:30
ljain112
efe238cefd test: added test cases for the tcs deduction for advances adjusted. 2024-10-08 11:24:44 +05:30
Smit Vora
6909d271e5 Merge pull request #43397 from ljain112/fix-tds-advance
fix: do not include advances for tds vouchers
2024-10-08 10:38:03 +05:30
Deepesh Garg
7e012708a6 Merge pull request #43528 from frappe/extend_voucher_types
chore: Allow apps to extend voucher subtypes
2024-10-08 08:55:00 +05:30
David Arnold
726abae8b5 Merge pull request #43549 from blaggacao/test-refactoring/batch-1728346378
Refactor: Use IntegrationTestCase in multiple files
2024-10-08 02:33:10 +02:00
David
58c49dc9d2 refactor: Use IntegrationTestCase in multiple files
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-08 02:13:00 +02:00
David Arnold
ef464ecab8 Merge pull request #43548 from blaggacao/test-refactoring/batch-1728345166
Refactor: Use IntegrationTestCase in multiple files
2024-10-08 02:12:57 +02:00
David
9024621231 refactor: Use IntegrationTestCase in multiple files
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-08 01:52:47 +02:00
David Arnold
504bd428d5 Merge pull request #43547 from blaggacao/test-refactoring/batch-1728343954
Refactor: Use IntegrationTestCase in multiple files
2024-10-08 01:52:45 +02:00
David
d1fa1af271 refactor: Use IntegrationTestCase in multiple files
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-08 01:32:35 +02:00
David Arnold
2e975810a0 Merge pull request #43545 from blaggacao/try/fix
fix: underspecified test
2024-10-08 01:28:02 +02:00
David
76ec548bf0 fix: underspecified test 2024-10-08 01:09:41 +02:00
David Arnold
a321552879 Merge pull request #43543 from blaggacao/test-refactoring/batch-1728340917
Refactor: Use IntegrationTestCase in multiple files
2024-10-08 01:02:13 +02:00
David
e75eebc7a0 refactor: Use IntegrationTestCase in multiple files
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-08 00:42:00 +02:00
David Arnold
c6d6ef2aa9 Merge pull request #43539 from blaggacao/test-refactoring/test-bank-guarantee-py
Refactor: Use IntegrationTestCase in test_bank_guarantee.py
2024-10-08 00:12:30 +02:00
David
87cab90451 refactor: Use IntegrationTestCase in test_bank_guarantee.py
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-07 23:53:15 +02:00
David Arnold
8d3a8ed460 Merge pull request #43538 from blaggacao/test-refactoring/test-bank-clearance-py
Refactor: Use IntegrationTestCase in test_bank_clearance.py
2024-10-07 23:04:52 +02:00
David
a0a98b149f refactor: Use IntegrationTestCase in test_bank_clearance.py
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-07 22:44:41 +02:00
David Arnold
ab3da9bf84 Merge pull request #43537 from blaggacao/test-refactoring/test-bank-account-type-py
Refactor: Use IntegrationTestCase in test_bank_account_type.py
2024-10-07 22:44:40 +02:00
David
36ae2436a3 refactor: Use IntegrationTestCase in test_bank_account_type.py
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-07 22:24:29 +02:00
David Arnold
14f33304ca Merge pull request #43536 from blaggacao/test-refactoring/test-bank-account-subtype-py
Refactor: Use IntegrationTestCase in test_bank_account_subtype.py
2024-10-07 22:24:28 +02:00
David
9979efce56 refactor: Use IntegrationTestCase in test_bank_account_subtype.py
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-07 22:04:16 +02:00
David Arnold
c8385ebef4 Merge pull request #43535 from blaggacao/test-refactoring/test-bank-account-py
Refactor: Use IntegrationTestCase in test_bank_account.py
2024-10-07 22:04:15 +02:00
David
34fc2c1e81 refactor: Use IntegrationTestCase in test_bank_account.py
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-07 21:44:04 +02:00
David Arnold
b50506d0a1 Merge pull request #43534 from blaggacao/test-refactoring/test-bank-py
Refactor: Use IntegrationTestCase in test_bank.py
2024-10-07 21:44:03 +02:00
David
f0c433de9f refactor: Use IntegrationTestCase in test_bank.py
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-07 21:23:52 +02:00
David Arnold
d7d8802939 Merge pull request #43533 from blaggacao/test-refactoring/test-accounts-settings-py
Refactor: Use IntegrationTestCase in test_accounts_settings.py
2024-10-07 21:23:51 +02:00
David
fbce860f00 refactor: Use IntegrationTestCase in test_accounts_settings.py
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-07 20:18:35 +02:00
David Arnold
05bb9fe167 Merge pull request #43532 from blaggacao/test-refactoring/test-accounting-period-py
Refactor: Use IntegrationTestCase in test_accounting_period.py
2024-10-07 20:17:27 +02:00
Deepesh Garg
ca8820b566 chore: Allow apps to extend voucher subtypes 2024-10-07 23:32:50 +05:30
David
3461e50e89 refactor: Use IntegrationTestCase in test_accounting_period.py
Signed-off-by: David <dgx.arnold@gmail.com>
2024-10-07 19:57:11 +02:00
David Arnold
12b20ddf7f Merge pull request #43530 from blaggacao/test-refactoring/test-accounting-dimension-py
Refactor: Use IntegrationTestCase for test_accounting_dimension.py
2024-10-07 19:33:41 +02:00
David
8c80dcef7e refactor: Use IntegrationTestCase in test_accounting_dimension.py 2024-10-07 19:13:09 +02:00
Deepesh Garg
8a1e38a43b chore: Allow apps to extend voucher subtypes 2024-10-07 22:14:10 +05:30
Deepesh Garg
a1525d9b8e chore: Allow apps to extend voucher subtypes 2024-10-07 21:43:49 +05:30
Smit Vora
3eabc2bcde Merge pull request #43391 from ljain112/fix-pcv
fix: create Account Closing Balance even though there are no transaction in period
2024-10-07 21:40:34 +05:30
Smit Vora
e5d47c2337 Merge pull request #43384 from ljain112/fix-parenttype-pur-reg
fix: add parenttype condition for item table in Purchase Register Report
2024-10-07 21:21:01 +05:30
Smit Vora
da0720ce14 Merge pull request #43385 from ljain112/fix-pos-item
fix: include parent item group in query
2024-10-07 21:16:25 +05:30
David Arnold
622c8590f4 Merge pull request #43522 from blaggacao/test-refactoring/test-account-py
Refactor: Use IntegrationTestCase for test_account.py
2024-10-07 17:06:53 +02:00
Smit Vora
e8a0896848 Merge pull request #43520 from Abdeali099/payment-request-fixes
fix: Payment Request's minor fixes
2024-10-07 20:32:10 +05:30
David
a46e6b69dc refactor: Use IntegrationTestCase in test_account.py 2024-10-07 16:44:04 +02:00
Abdeali Chharchhoda
3d303e7fad test: fixes after developed merge 2024-10-07 19:33:31 +05:30
Abdeali Chharchhoda
a31c4e97c6 Merge branch 'develop' into payment-request-fixes 2024-10-07 19:12:29 +05:30
David Arnold
cd112795d3 Merge pull request #43507 from blaggacao/tests/unit-test-case
treewide: unit test cases boilerplate
2024-10-07 15:03:53 +02:00
David
d937a6cfcd test: fix purchase invoice creation in test 2024-10-07 14:45:41 +02:00
David
2adb417408 refactor: add bare unit test cases
mainly for LLMs to catch up with the convention
2024-10-07 13:13:00 +02:00
David
bda415a83d refactor: import from new location 2024-10-07 13:12:57 +02:00
Abdeali Chharchhoda
4444d90470 test: Change Accounts Settings for multi currency (https://github.com/frappe/erpnext/pull/42427#discussion_r1789859737) 2024-10-07 16:24:36 +05:30
Abdeali Chharchhoda
48d153825f fix: Remove the get_paid_amount_against_order function as it is no longer used 2024-10-07 16:17:06 +05:30
Abdeali Chharchhoda
ebe09e05ec chore: Added last empty line in PR's json 2024-10-07 16:08:03 +05:30
rohitwaghchaure
13eb3c5c14 fix: read only filters in multidialog fields (#43503) 2024-10-07 13:43:37 +05:30
Frappe PR Bot
8c43b44cf6 chore: update POT file (#43506) 2024-10-06 11:20:13 +01:00
Corentin Forler
ade121dac6 fix(stock): Grab posting date/time from SABB (#43493) 2024-10-06 09:48:22 +05:30
Ninad Parikh
26fc8ce209 fix: Update Values before after_mapping hook is called (#42682)
* fix: update values before after_mapping hook is called

* fix: appropriate function name
2024-10-06 08:52:58 +05:30
Raffael Meyer
9872645d3e fix(Quotation): calculate row values for alternative items (#43054) 2024-10-03 20:33:58 +00:00
Raffael Meyer
4912288433 fix: translate display text passed to validate_expense_account (#43057) 2024-10-03 20:18:51 +00:00
Raffael Meyer
b24722e60f fix(Dunning): logic for fetching text (#43160) 2024-10-02 15:02:08 +01:00
Raffael Meyer
89e855f210 fix: generalize link formatter (#43199) 2024-10-02 15:01:12 +01:00
Corentin Forler
e3b93b7d4b fix: Hide print labels for Terms and Conditions 2024-10-02 15:02:30 +02:00
David Arnold
82f4fcf138 Merge pull request #43474 from blaggacao/ci/add-trick
ci: use dynamic total job
2024-10-02 13:44:45 +02:00
David
33229381c7 ci: use dynamic total job 2024-10-02 13:25:39 +02:00
Sagar Vora
7d4b73eacc Merge pull request #43475 from sagarvora/set-margin-values
fix: set margin fields for purchase documents when updating items
2024-10-02 15:20:58 +05:30
Sagar Vora
7bc51d7d30 Merge pull request #43481 from sagarvora/ces-patch 2024-10-02 15:12:03 +05:30
Sagar Vora
c5889c5d2e fix: patch to update Currency Exchange Settings for frankfurter.app 2024-10-02 15:10:19 +05:30
Sagar Vora
70a7d1b75d Merge pull request #43476 from cogk/fix-api-endpoint-for-frankfurter 2024-10-02 14:40:55 +05:30
Sagar Vora
c444de017a test: update test for API change 2024-10-02 14:28:54 +05:30
Corentin Forler
33e72111c7 fix: Fix API endpoint for Frankfurter 2024-10-02 10:07:05 +02:00
Sagar Vora
7be4d56be2 fix: set margin fields for purchase documents when updating items 2024-10-02 13:14:30 +05:30
rohitwaghchaure
6433019624 fix: status plant floor (#43466) 2024-10-01 14:37:57 +05:30
rohitwaghchaure
895b072bad fix: Stock UOM not fetched when Stock Entry create from Item Dashboard (#43457) 2024-10-01 14:27:55 +05:30
rahulgupta8848
2384309b43 feat: multiple purchase invoice in asset repair doctype (#43460)
Co-authored-by: “rahulgupta8848” <“rahul.gupta@8848digital.com”>
2024-10-01 13:00:51 +05:30
V Shankar
c5d5421c0f feat: search attribute value in multiple variant creation dialog (#43408)
* feat: search attr value in multiple variant creation dialog

* fix: pre commit
2024-10-01 12:55:32 +05:30
Vishakh Desai
30954586d8 fix: get stock accounts from the doc instead of db in validate_stock_accounts 2024-10-01 12:53:42 +05:30
rohitwaghchaure
1c7154c7ca fix: removed validation for materials return (#43461) 2024-10-01 12:53:34 +05:30
Vishv-silveroak
661efadf41 Serial no report (#43444)
* chore: remove the field that which is not exiting in serial no

* chore: remove the field that which is not exiting in serial no

* chore: remove the field that which is not exiting in serial no
2024-10-01 12:27:05 +05:30
Nihantra C. Patel
c492a5ba9d Merge pull request #43455 from Nihantra-Patel/fix_wwibav
fix: add company filter in Warehouse wise Item Balance Age and Value
2024-10-01 11:16:13 +05:30
Nihantra Patel
75950f86cf fix: add company filter in Warehouse wise Item Balance Age and Value 2024-10-01 10:50:43 +05:30
rohitwaghchaure
912ba7789c fix: negative stock error for batch (#43450) 2024-10-01 08:19:05 +05:30
David Arnold
d25feedb7e Merge pull request #43428 from blaggacao/fix/no-undue-tax-rounding
fix!: don't round unduly
2024-09-30 17:22:02 +02:00
ljain112
d76cc21086 fix: patch 2024-09-30 20:10:36 +05:30
rohitwaghchaure
94092bb749 Merge pull request #43448 from rohitwaghchaure/fixed-support-22814
fix: last purchase rate for purchase invoice
2024-09-30 20:05:00 +05:30
Rohit Waghchaure
fb9d106633 fix: last purchase rate for purchase invoice 2024-09-30 18:28:12 +05:30
David Arnold
37f03444c1 Merge pull request #43446 from blaggacao/fix/return-default-wh
fix(return): set default return warehouse
2024-09-30 14:27:00 +02:00
David
fa65291e98 fix(return): set default return warehouse
This captures the case of manual modifications to the return and ensures
that by default, the correct return warehouse will be set
2024-09-30 14:07:25 +02:00
David Arnold
6f61d88472 Merge pull request #43282 from blaggacao/feat/email-to-empty-pi
feat: allow to create empty pi via email append to
2024-09-30 14:05:56 +02:00
rohitwaghchaure
06b99e2020 Merge pull request #43437 from rohitwaghchaure/fixed-support-22559
fix: adjustment entry for stock reco
2024-09-30 14:26:25 +05:30
rohitwaghchaure
d4e8ce232f Merge pull request #43436 from rohitwaghchaure/fixed-support-22504
fix: 'NoneType' object has no attribute 'has_serial_no'
2024-09-30 13:39:59 +05:30
Rohit Waghchaure
4e463b7d6d fix: adjustmen entry for stock reco 2024-09-30 13:38:54 +05:30
Rohit Waghchaure
28f9fd2507 fix: 'NoneType' object has no attribute 'has_serial_no' 2024-09-30 12:05:17 +05:30
rohitwaghchaure
1abcb29cef Merge pull request #43382 from rohitwaghchaure/plant-floor-design-changes
fix: plant floor design changes
2024-09-29 22:36:32 +05:30
rohitwaghchaure
b3033da254 Merge pull request #43420 from rohitwaghchaure/fixed-ledger-report
fix: Stock Ledger Invariant Check report
2024-09-29 22:35:50 +05:30
Richard Case
ca3c680909 fix: tests for work order consumption (#41814)
* fix: tests for work order automatic SABB creation

* fix: qty

* chore: show created sabb

* chore: fix syntax

* fix: check SABB qty

* fix: add batched consumable to manufacture

* fix: missing fg qty field

* fix: improve test debug

* chore: linting

* chore: removed extra hash icons

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2024-09-29 21:24:28 +05:30
Rohit Waghchaure
3c1cdeb3ec fix: plant floor design changes 2024-09-29 21:17:47 +05:30
David
eeb8aba950 fix!: don't round unduly
BREAKING: If you previously relied on the undue rounding of the tax
amount within the item wise tax detail, revise your code and config.
2024-09-29 16:56:15 +02:00
venkat102
c87cd5da04 fix: show total amount on report summary 2024-09-29 17:42:23 +05:30
rohitwaghchaure
8e33e0e1d2 fix: Data missing in table: None, MandatoryError (#43422) 2024-09-29 11:10:24 +05:30
rohitwaghchaure
ca16089d9d fix: use serial and batch fields (#43421) 2024-09-29 10:12:19 +05:30
Rohit Waghchaure
d7daedc5b2 fix: Stock Ledger Invariant Check report 2024-09-29 09:18:52 +05:30
rohitwaghchaure
a594c05296 fix: quality inspection creation (#43416) 2024-09-28 23:53:44 +05:30
Vishakh Desai
9cc22b4cac fix: linters 2024-09-28 12:53:43 +05:30
Vishakh Desai
6de6f55b39 fix: Get Entries not showing accounts with no gain or loss in Exchange Rate Revaluation issue 2024-09-28 12:48:14 +05:30
Khushi Rawat
cb32e2b526 Merge pull request #43399 from khushi8112/added-capitalized-asset-column
feat: added 'cost of new capitalized asset' column
2024-09-27 23:52:22 +05:30
Deepesh Garg
3faabd29c2 Merge pull request #43410 from frappe/ignore_transaciton_deletion_check
fix: Ignore transaction deletion check on ledger entry insertion
2024-09-27 23:51:38 +05:30
Deepesh Garg
998f6a92a4 fix: Ignore transaction deletion check on ledger entry insertion 2024-09-27 23:29:39 +05:30
ljain112
7ef918421e fix: do not include advances for tds vouchers 2024-09-26 19:52:57 +05:30
Khushi Rawat
1eb9cc33fc feat: added 'cost of new capitalized asset' column 2024-09-26 16:49:01 +05:30
ljain112
43deaea96b fix: create Account Closing Balance even though there are no transaction in period 2024-09-26 13:41:16 +05:30
CaseSolved
be6970c850 chore: linting 2024-09-25 19:29:06 +01:00
CaseSolved
2017fd80d1 fix: SO link on PO and add in missing dashboard references on both 2024-09-25 19:18:48 +01:00
rohitwaghchaure
e4e96d2a44 fix: serial and batch no selector (#43387) 2024-09-25 22:15:10 +05:30
ljain112
28abf191fc fix: add parenttype condition for item table in Purchase Register Report 2024-09-25 18:26:10 +05:30
ljain112
ad0090068d fix: include parent item group in query 2024-09-25 18:24:42 +05:30
Frappe PR Bot
9998aa2deb fix: sync translations from crowdin (#43350) 2024-09-25 01:31:42 +02:00
rohitwaghchaure
a63dca0984 fix: Cannot read properties of undefined (reading 'price_list_rate') (#43376) 2024-09-25 00:02:33 +05:30
rohitwaghchaure
8c32ebee68 fix: not able to cancel Quality Inspection (#43374) 2024-09-24 22:05:23 +05:30
Frappe PR Bot
05102a887f chore: update POT file (#43373) 2024-09-24 15:38:04 +00:00
Khushi Rawat
0dd9fd3ded Merge pull request #43348 from khushi8112/missing-condition-in-asset-depreciation-report
fix: asset depreciation and balances report correction
2024-09-24 17:59:17 +05:30
Khushi Rawat
5911934dc7 feat: added assignee email field in asset maintenance log 2024-09-24 17:43:04 +05:30
Khushi Rawat
07d40d29a7 style: added comment 2024-09-24 17:40:33 +05:30
Khushi Rawat
bdfbec4de8 chore: Merge branch 'develop' 2024-09-24 17:28:21 +05:30
Raffael Meyer
5172629e06 fix(Bank Account): dashboard connections (#43365)
* refactor(Bank Account): move dashboard links to DocType definition

* fix(Bank Account): rearrange dashboard links

* fix(Bank Account): add Bank Transaction to connections
2024-09-24 17:03:22 +05:30
jabir-elat
9974b7c4ae fix: closing amount reset to expected amount on save (#43358) 2024-09-24 16:04:30 +05:30
ruthra kumar
59071f1cd4 Merge pull request #43356 from ruthra-kumar/ignore_0_outstanding_on_ar_report
fix: AR / AP report to ignore 0.0 outstanding
2024-09-24 15:43:29 +05:30
ruthra kumar
6954bfcb10 Merge pull request #43235 from vishakhdesai/general-ledger-duplicate-rows-issue
fix: set group_by condition to "Group by Voucher (Consolidated)" if `None` and voucher_no is set
2024-09-24 14:53:12 +05:30
ruthra kumar
6e2cf79e2c fix: AR / AP report to ignore 0.0 outstanding 2024-09-24 12:14:36 +05:30
ruthra kumar
c671a6c42f Merge pull request #43310 from aerele/pos-bank-clearance
fix: update clearance date in invoice payment table
2024-09-24 10:58:43 +05:30
Khushi Rawat
9f4ed22368 Merge branch 'develop' of https://github.com/frappe/erpnext into missing-condition-in-asset-depreciation-report 2024-09-24 01:42:13 +05:30
Khushi Rawat
c06039028c fix(minor): include condition to check docstatus 2024-09-24 01:41:54 +05:30
rohitwaghchaure
9e8be8db51 fix: stock dashboard (#43347) 2024-09-24 00:05:18 +05:30
Khushi Rawat
4242ac527d fix: added date condition 2024-09-23 23:47:48 +05:30
ruthra kumar
2f6003c360 Merge pull request #43283 from barredterra/shipping-rule-query
fix: shipping rule must match the company
2024-09-23 20:10:26 +05:30
ruthra kumar
c202be6d2e Merge pull request #43257 from ljain112/fix-pos-invoice
fix: item_query in pos_invoice
2024-09-23 19:58:47 +05:30
ruthra kumar
3e13a43278 Merge pull request #43253 from Nihantra-Patel/pos_return_v15
fix: partial return on POS invoice
2024-09-23 19:54:51 +05:30
ruthra kumar
8e7659ea0e Merge pull request #43307 from aerele/gl-ple-column
fix: change dynamic link doctype fieldtype to data
2024-09-23 17:51:29 +05:30
ruthra kumar
8fccc70136 Merge pull request #43308 from aerele/report-chart-currency
fix: show chart tool tip in report currency
2024-09-23 17:39:46 +05:30
ruthra kumar
fc9b1ef7a3 Merge pull request #43316 from ruthra-kumar/fix_incorrect_outstanding_on_non_pos_with_write_off_account
fix: incorrect outstanding on non-pos invoice with write_off_account
2024-09-23 17:35:53 +05:30
ruthra kumar
3fb4d8fbf1 Merge pull request #43331 from ruthra-kumar/incorrect_transaction_currency_val_in_gl_entry
fix: transaction exchange rate on GL's for Multi currency Journals
2024-09-23 17:32:00 +05:30
ruthra kumar
4be6878e58 Merge pull request #43321 from ljain112/fix-payment-advance
fix: handle missing liability account scenario in `set_liability_account`
2024-09-23 17:29:45 +05:30
ruthra kumar
0db382123c Merge pull request #43328 from aerele/tax-rule-filter
fix: allow tax rule filter on tax category name with %
2024-09-23 17:16:07 +05:30
ruthra kumar
c524825d2d test: transaction exchange rate on multi-currency journals 2024-09-23 17:12:31 +05:30
ruthra kumar
8cd9ad5361 fix: transaction exchange rate on GL's for Multi currency Journals 2024-09-23 17:02:00 +05:30
Frappe PR Bot
8e3b84ff5c fix: sync translations from crowdin (#43313) 2024-09-23 10:02:27 +02:00
venkat102
3aaa13cb29 fix: make to tax category on tax rule to filter with percent 2024-09-23 12:45:14 +05:30
Frappe PR Bot
621f0f343a chore: update POT file (#43324) 2024-09-22 12:51:08 +02:00
HENRY Florian
6e34d52506 fix: bump pycountry version in ERPNext to be compatible with the frappe one (#43317)
* fix: pycountry dependency is now in frappe develop branch with 24.6.1 version

* fix: bump pycountry version in ERPNext to be compatible with the frappe one
2024-09-21 12:19:42 +02:00
ljain112
ee7ab4b065 fix: handle missing liability account scenario in set_liability_account 2024-09-21 15:02:40 +05:30
ruthra kumar
d5e2906e59 fix: incorrect outstanding on non-pos invoice with write_off_account 2024-09-21 12:37:16 +05:30
Abdeali Chharchhodawala
93f867570f fix: multiple issues in Payment Request (#42427)
* fix: multiple issues in Payment Request

* chore: minor changes

* fix: remove  bug

* fix: replace `round` with `flt`

* fix: update `set_advance_payment_status()` logic

* fix: removed bug of `set_advance_payment_status`

* fix: changes as per review

* refactor: replace sql query of `matched_payment_requests` to query builder

* fix: replace `locals` with `get_doc` in set_query

* fix: changes during review

* fix: minor review changes

* fix: remove unnecessary code for setting payment entry received amount

* fix: logic for ser payment_request if PE made from transaction

* fix: Use rounded total to make Payment Request from `Sales Invoice` or `Purchase Invoice`

* refactor: enhance logic of `set_open_payment_requests_to_references`

* fix: added one optional arg `created_from_payment_request`

* fix: handle multiple allocation of PR at PE's reference

* fix: logic for PR if outstanding docs fetch

* fix: formatted Link field for `Payment Request` for PE's references

* fix: replace `get_all()` with `get_list()` for getting Payment Request for Link field

* fix: replace `get_all()` with `get_list()` for getting Payment Request for Link field

* chore: format `payment_entry.js` file

* style: Show preview popup of `Payment Request`

* fix: remove minor bug

* fix: add virtual field for Payment Term and Request `outstanding_amount` in PE's reference

* fix: get outstanding amount in PE's reference on realtime

* fix: move allocation of allocated_amount to server side (no change)

* fix: some minor changes to allocation

* fix: Split `Payment Request` if PE is created from PR and there are `Payment Terms`

* fix: minor logic changes

* fix: Allocation of allocated_amount if `paid_amount` is changes

* fix: improve logic of allocation

* fix: set matched payment request if unset

* fix: minor changes

* fix: Allocate single Payment Request if PE created from PR

* fix: improve code logic

* fix: Removed duplication code

* fix: proper message title

* refactor: Rename method of Allocation Amount to References

* refactor: Changing `grand_total` description based on `party_type`

* refactor: update Payment Request

* fix: Remove virtual property of payment_term_oustanding from references

* fix: fetch party account currency for creating payment request

* fix: use transaction currency as base in payment request

* fix: party amount for creating payment entry

* fix: allow for proportional amount paid by bank

* fix: Changed field order in Payment Request

* fix: Minor refactor in Payment Entry Reference table data

* test: Added test cases for allow Payment at `Partially Paid` status for PR

* test: Update partial paid status test case

* test: Update test case for same currency PR

* refactor: Wider the `msgprint` dialog for after save PE

* test: Update PR test cases

* chore: Remove dirty lines

* test: Checking `Advance Payment Status`

* fix: formatting update

* fix: Use `flt` where doing subtraction

* test: PR test case with Payment Term for same currency

* fix: remove redundant `flt`

* test: Add test cases for PR

---------

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2024-09-21 07:04:46 +05:30
HENRY Florian
40d97f4fe9 refactor: use common functionality to validate account number (#42842)
feat: Allow unique Account number by root type (not unique for accros all Accounts)
2024-09-21 06:46:57 +05:30
Kavin
c218f7527f refactor: update clearance date in payment entry 2024-09-20 18:24:00 +05:30
rohitwaghchaure
b127a0c8b7 fix: ui clean-up (#43305)
fix: ui cleanup
2024-09-20 15:42:17 +05:30
Frappe PR Bot
b05bee4d53 fix: sync translations from crowdin (#43263) 2024-09-20 11:14:14 +02:00
Kavin
ce8600520f test: add test case for updating clearance date on pos invoice 2024-09-20 14:33:03 +05:30
Kavin
487c2a29a6 fix: update clearance date in invoice payment table 2024-09-20 14:29:10 +05:30
venkat102
91a27bda84 fix: add currency in financial statement 2024-09-20 12:22:03 +05:30
venkat102
827b3f4542 fix: show chart tool tip in report currency 2024-09-20 11:43:00 +05:30
venkat102
1e46f7344a fix: change dynamic link doctype fieldtype to data 2024-09-20 10:53:45 +05:30
David Arnold
3e54ad55ac Merge pull request #43301 from blaggacao/fix/undue-db-write-on-payment-entry
chore: cant write in (potential) read-only mode
2024-09-19 16:49:31 +02:00
David
87d7c4f70e chore: cant write in (potential) read-only mode 2024-09-19 16:30:26 +02:00
ruthra kumar
444f085fc5 Merge pull request #43291 from frappe/mergify/copy/develop/pr-43213
fix: Payment Ledger Report currency fieldtype fix (copy #43213)
2024-09-19 09:17:48 +05:30
ruthra kumar
729c3c6344 Merge pull request #43274 from doancan/translate-fix
fix: translate in js
2024-09-19 08:55:34 +05:30
sameer Chauhan
67c6010273 fix: Payment Ledger Report currency fieldtype fix
(cherry picked from commit ad2d6a1625)
2024-09-19 03:21:29 +00:00
rohitwaghchaure
3e7a7a54bf fix: incorrect stock balance for inventory dimension (#43284) 2024-09-19 08:47:27 +05:30
barredterra
df8f4086f6 fix: shipping rule must match the company 2024-09-18 19:39:51 +02:00
David
0cab2ae644 feat: allow to create empty pi via email append to 2024-09-18 19:35:28 +02:00
Shariq Ansari
256d0208d7 Merge pull request #43279 from shariquerik/crm-erpnext-2
fix: create_address is failing while creating customer
2024-09-18 22:15:08 +05:30
Shariq Ansari
acc1d52ac8 fix: create_address is failing 2024-09-18 21:56:53 +05:30
Nihantra C. Patel
16177f277c Merge pull request #43276 from Nihantra-Patel/fix_tran_so_to_po
fix: Translation for button SO to PO
2024-09-18 21:43:05 +05:30
Nihantra C. Patel
a5275e9f28 fix: Translation for button SO to PO 2024-09-18 21:36:02 +05:30
ljain112
00eee16190 fix: improved the conditions for determining voucher subtypes 2024-09-18 19:38:14 +05:30
Doğancan
25faec5662 fix: translate in js 2024-09-18 17:06:07 +03:00
ljain112
767c8f92be fix: deduct advances adjusted for threshold check for tcs 2024-09-18 13:08:38 +05:30
ruthra kumar
6d59039955 Merge pull request #43239 from aerele/pricing-rule-list-currency
fix: add currency in options for rate field in pricing rule
2024-09-18 11:58:18 +05:30
ruthra kumar
f388f8682f Merge pull request #43216 from aerele/cc-allocation
fix: get cost center allocation percentage only from the applicable allocation
2024-09-18 11:18:22 +05:30
Khushi Rawat
a5e9af3f4d Merge pull request #43210 from khushi8112/finance-book-filter
fix: updated filtering in depreciation and balances report
2024-09-18 01:55:50 +05:30
ruthra kumar
063348434c Merge pull request #43226 from aerele/reconcile-after-period-closing
fix: map rows on journal entry by validating account, party, debit and credit value
2024-09-17 20:03:51 +05:30
ljain112
7f82a06e65 fix: item_query in pos_invoice 2024-09-17 19:10:31 +05:30
Navin-S-R
720a330617 fix: create fiscal year without overlapping existing Fiscal Years 2024-09-17 18:55:28 +05:30
Navin-S-R
768bb0312a refactor: update formatting changes 2024-09-17 17:21:26 +05:30
ruthra kumar
f45638015f refactor(test): make use existing test data and dynamic fy creation 2024-09-17 16:49:23 +05:30
Nihantra C. Patel
18bdd06652 fix: partial return on POS invoice 2024-09-17 15:35:07 +05:30
Nihantra C. Patel
76289fa8dc fix: partial return on POS invoice 2024-09-17 14:51:26 +05:30
ruthra kumar
75babd4c18 fix: ignore repost logic on Payment Reconciliation 2024-09-17 14:40:04 +05:30
ruthra kumar
e29e1e45c4 Merge pull request #43188 from rtdany10/gp_so_issue
fix: invalid gp calculation
2024-09-17 12:02:13 +05:30
Sumit Bhanushali
891d383d09 Merge pull request #43247 from frappe/revert-43236-fix-app-route
Revert "fix: dont hardcode workspace in app route"
2024-09-17 11:11:54 +05:30
Sumit Bhanushali
ea8912b916 Revert "fix: dont hardcode workspace in app route" 2024-09-17 10:37:06 +05:30
ruthra kumar
fdd62f7400 Merge pull request #42969 from lbrandh/project_completion
fix: A project without tasks should be able to complete
2024-09-17 10:18:26 +05:30
ruthra kumar
d228ac325e Merge pull request #43225 from aerele/jv-fx-amount
fix(ux): set amount based on account currency while adding new row
2024-09-17 10:17:48 +05:30
Sumit Bhanushali
5ef81f2ef1 Merge pull request #43236 from frappe/fix-app-route
fix: dont hardcode workspace in app route
2024-09-17 10:01:42 +05:30
Frappe PR Bot
b36569938d fix: sync translations from crowdin (#43219) 2024-09-16 20:27:22 +00:00
Khushi Rawat
cd484c5f50 Merge pull request #43233 from khushi8112/gl-entry-for-capitalized-asset
fix: do not validate purchase document for composite asset
2024-09-17 00:17:15 +05:30
Shariq Ansari
614f6489e7 Merge pull request #43238 from shariquerik/crm-erpnext-1
fix: create and link address while creating prospect & customer
2024-09-16 22:14:17 +05:30
Smit Vora
d9d8404217 Merge pull request #43176 from ljain112/fix-pos-discount
fix: hide and reset discount control on new POS order
2024-09-16 19:53:04 +05:30
Shariq Ansari
035c15794c fix: create and link address while creating prospect & customer 2024-09-16 18:53:42 +05:30
krishna
636c0131fa fix: add currency in options for rate field in pricing rule 2024-09-16 18:44:58 +05:30
Smit Vora
705d3dec53 Merge pull request #42849 from ljain112/fix-tds-po
fix: TDS workflow consistency in Purchase Order
2024-09-16 18:44:48 +05:30
Sumit Bhanushali
26774ebd78 fix: dont hardcode workspace in app route 2024-09-16 18:21:48 +05:30
Vishakh Desai
a6b0cb6cac fix: set group_by condition if empty and voucher_no is set 2024-09-16 15:40:49 +05:30
Khushi Rawat
5fd058dde9 fix: do not validate purchase document for composite asset 2024-09-16 12:35:35 +05:30
ruthra kumar
902ce9c46d Merge pull request #43224 from aerele/journal-last-row-fx-amount
fix(ux): set amount on foreign currency when foreign currency account…
2024-09-16 11:44:54 +05:30
ruthra kumar
4eeae8011e refactor(test): fix linter 2024-09-16 11:14:54 +05:30
ruthra kumar
309f74cafb Merge pull request #42809 from Vishnu7025/fix_so
fix: warehouse not mapping correctly during Delivery Note creation.
2024-09-16 11:01:12 +05:30
ruthra kumar
e5b699821f refactor(test): set valuation rate for stocked item 2024-09-16 10:18:51 +05:30
ruthra kumar
44767e9baa Merge pull request #43212 from ljain112/fix-patch
fix: prevent KeyError by checking `report_filter` existence
2024-09-16 09:17:14 +05:30
Frappe PR Bot
42f01d4302 chore: update POT file (#43227) 2024-09-15 12:45:46 +02:00
Navin-S-R
0ff04f774d fix(ux): set amount based on account currency while adding new row 2024-09-14 17:39:50 +05:30
Navin-S-R
f47ea46806 test: reconcile payment jv from closed fiscal year 2024-09-14 17:31:53 +05:30
venkat102
2b66842d34 fix(ux): set amount on foreign currency when foreign currency account is selected on last row of journal 2024-09-14 16:00:53 +05:30
Navin-S-R
b634aa9cfb fix: map rows on journal entry by validating account, party, debit and credit value 2024-09-14 15:58:02 +05:30
Shariq Ansari
4b125eab55 Merge pull request #43198 from nabinhait/crm-integration
feat: API for crm integration
2024-09-14 14:28:56 +05:30
Ananyobrata Pal
a435441536 fix(holiday-list): use same date format for same holiday error message (#42606)
* fix(holiday-list): use same date format for same holiday error message

* chore: fix formatting

---------

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2024-09-14 07:25:14 +00:00
David Arnold
4acd12d610 Merge pull request #43181 from frappe/chore/no-stale-on-draft
chore: exempt draft prs from stale bot
2024-09-13 17:48:21 +02:00
David
08771a6d70 chore: exempt draft prs from stale bot 2024-09-13 17:30:30 +02:00
venkat102
3c65b98b49 fix: cancel cost center allocation and journal entry after test 2024-09-13 18:46:10 +05:30
ljain112
c1d2cc2c14 fix: prevent KeyError by checking report_filter existence 2024-09-13 17:30:52 +05:30
venkat102
4d5d6150e1 test: add unit test for validating multiple cost center allocation with different child cost center 2024-09-13 16:54:29 +05:30
venkat102
36e5945c66 fix: fetch cost center allocation percentage only from the applicable allocation 2024-09-13 16:48:32 +05:30
Khushi Rawat
af52f0e71f chore: resolved failing check 2024-09-13 14:49:01 +05:30
Khushi Rawat
8c8e25214c chore: resolved linter check with #nosemgrep 2024-09-13 14:45:29 +05:30
Khushi Rawat
a7a0499f83 Merge branch 'develop' of https://github.com/frappe/erpnext into finance-book-filter 2024-09-13 13:26:45 +05:30
Khushi Rawat
3a34eecdcf fix: updated filtering in depreciation and balances report 2024-09-13 13:26:21 +05:30
rohitwaghchaure
ce34bb9793 fix: item list view in website (#43165) 2024-09-13 12:03:57 +05:30
rohitwaghchaure
d9e4ed13cb fix: batch based item price not working (#43172) 2024-09-13 12:03:36 +05:30
rohitwaghchaure
2b96e37c34 fix: currency changing while making PO from Supplier Quotation (#43187) 2024-09-13 12:03:12 +05:30
ruthra kumar
38db54fdb1 Merge pull request #43192 from ruthra-kumar/use_fixture_on_pricing_rule_tests
refactor(test): use test fixture on pricing rule test suite
2024-09-13 10:48:09 +05:30
ruthra kumar
fb07d4ba9b Merge pull request #43191 from aerele/delete-gain-loss-exchange-jv
fix: delete exchange gain loss journal entry while deleting payment entry
2024-09-13 10:47:45 +05:30
Frappe PR Bot
e3246db973 fix: sync translations from crowdin (#43141)
* fix: Persian translations

* fix: Persian translations

* fix: Turkish translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Turkish translations
2024-09-12 21:36:31 +02:00
Nabin Hait
b7bf9f80f2 feat: API for crm integration 2024-09-12 19:38:30 +05:30
ruthra kumar
0ea1d6d960 refactor(test): use test fixture on pricing rule test suite 2024-09-12 16:48:25 +05:30
Navin-S-R
7855d3034b test: add unit test for deletion of gain loss jv while deleting payment entry 2024-09-12 15:26:55 +05:30
Navin-S-R
9886cf0d46 fix: delete exchange gain loss journal entry while deleting payment entry 2024-09-12 15:25:54 +05:30
Dany Robert
c79851239c fix: invalid gp calculation 2024-09-12 09:18:19 +00:00
Sagar Vora
941177ed62 Merge pull request #43171 from vishakhdesai/payment-entry-bug-fix 2024-09-12 12:01:31 +05:30
rahulgupta8848
e07bc5af41 feat: validating asset scrap date (#43093)
* feat: validating asset scrap date

* refactor: refactorization of scrap asset function

---------

Co-authored-by: “rahulgupta8848” <“rahul.gupta@8848digital.com”>
2024-09-12 11:37:17 +05:30
Smit Vora
9cfb91a025 Merge pull request #43182 from vorasmit/fix-type
fix: typo with po_date when creating remarks
2024-09-12 11:13:31 +05:30
Smit Vora
a55502e0f1 fix: typo with po_date when creating remarks 2024-09-12 10:36:32 +05:30
David Arnold
b615bf65d7 Merge pull request #42074 from blaggacao/feat/utm-analytics
feat/utm analytics
2024-09-12 05:15:29 +02:00
David
96a6673510 feat(analytics): comply erpnext with utm methodology 2024-09-12 04:47:51 +02:00
devdiogenes
4a3eca963c fix: Call super onload_post_render inside pos_invoice.js 2024-09-11 20:42:45 +00:00
David Arnold
7a21574cfb Merge pull request #43177 from frappe/chore/make-stalebot-more-bearable
chore: add no-stale label
2024-09-11 17:24:33 +02:00
David
941564daf8 chore: add no-stale label 2024-09-11 17:06:22 +02:00
ljain112
5b0053f8dd fix: hide and reset discount control on new POS order 2024-09-11 18:54:55 +05:30
Vishakh Desai
502cf0eb8d fix: set party_type null when payment_type is changed to Internal Transfer 2024-09-11 14:21:48 +05:30
rohitwaghchaure
1bf60248d9 perf: timeout error (#43154) 2024-09-10 18:41:46 +05:30
rohitwaghchaure
05f9015c0b fix: bom cost update is not working (#43155) 2024-09-10 18:41:10 +05:30
rohitwaghchaure
5c7dff0e84 fix: concurrency issue while picking materials (#43087) 2024-09-10 15:11:13 +05:30
ruthra kumar
4807ec266e Merge pull request #43146 from ruthra-kumar/fix_permission_issue_on_guest_pr_creation
fix: permission on Payment Request creation by Guest
2024-09-10 14:47:25 +05:30
ruthra kumar
cfb9caca58 Merge pull request #43144 from ruthra-kumar/utility_report_for_invalid_ledger_entries
feat: utility report for identifying invalid ledger entries
2024-09-10 14:35:12 +05:30
ruthra kumar
ea02e5f15a fix: permission on guest PR creation 2024-09-10 14:29:13 +05:30
ljain112
0b942a0614 fix: do not auto apply tds in purchase order 2024-09-10 13:11:09 +05:30
ruthra kumar
43198c946b refactor: allow all accounts 2024-09-10 13:03:49 +05:30
ruthra kumar
2126b10a92 refactor: fetch as dictionary 2024-09-10 12:58:05 +05:30
ruthra kumar
b05b378ef0 refactor: barebones methods with basic logic 2024-09-10 12:08:48 +05:30
Khushi Rawat
82cf85be6c Merge pull request #43114 from khushi8112/primary-action-button-not-showing
fix: primary action button not showing
2024-09-09 22:28:40 +05:30
ruthra kumar
71412a7b7e refactor(test): set company on item 2024-09-09 17:55:59 +05:30
ruthra kumar
dccbc1f432 refactor: standard filters 2024-09-09 17:16:57 +05:30
ruthra kumar
58a879bb39 refactor(test): DN should auto-select warehouses based on reservation 2024-09-09 17:07:37 +05:30
ruthra kumar
c345c75dca refactor(test): create and reserve stock against 2 diff warehouses 2024-09-09 16:19:37 +05:30
ruthra kumar
dab6709549 test: utilize test mixin and barebones test case 2024-09-09 16:19:29 +05:30
rohitwaghchaure
80f101f92e fix: incorrect actual cost in Procurement Tracker report (#43109) 2024-09-09 15:53:41 +05:30
Raffael Meyer
1bb2745fc3 fix: return type of get_party_details (#43131) 2024-09-09 10:00:49 +00:00
Martin Heini
2a44242746 refactor: update default sales tax for Switzerland (#42902)
* Updated default sales tax for switzerland

* Add new reduced rate and special rate too
2024-09-09 15:13:01 +05:30
ruthra kumar
ad0619a60c Merge pull request #42801 from barredterra/dn-translatability
fix(Delivery Note): translatability of validation errors
2024-09-09 14:43:00 +05:30
ruthra kumar
62113ab789 Merge pull request #43056 from barredterra/msg-opening-invoice
fix(Opening Invoice Creation Tool): translatability of messages
2024-09-09 14:29:55 +05:30
ruthra kumar
6c3a8400af Merge pull request #43051 from pra17shant/fix-unreconcile-redirect
fix: unreconcile allocation child table redirect url voucher no issue
2024-09-09 14:28:49 +05:30
ruthra kumar
3b8f0df239 Merge pull request #43064 from aerele/pricing_rule
fix: validate the item code when updating the other item's price rule
2024-09-09 14:13:00 +05:30
Nihantra C. Patel
c998c1ed35 Merge pull request #43121 from Nihantra-Patel/fix_available_batch_report
fix: set today in 'On This Date' in Available Batch Report
2024-09-09 13:55:37 +05:30
ruthra kumar
832c4aaf82 feat: utility report to identify invalid ledger entries 2024-09-09 12:31:32 +05:30
rahulgupta8848
8202f505cc feat: added revaluation surplus and impairment acc in standard charts… (#43022)
feat: added revaluation surplus and impairment acc in standard charts of accounts

Co-authored-by: “rahulgupta8848” <“rahul.gupta@8848digital.com”>
2024-09-09 12:12:00 +05:30
ruthra kumar
6a811ea24a Merge pull request #43058 from kittiu/enh-bulk_transaction_hook
refactor: use hooks to extend bulk_transaction
2024-09-09 11:32:08 +05:30
Nihantra C. Patel
9fd55e4c83 fix: set today in 'On This Date' in Available Batch Report 2024-09-09 11:27:59 +05:30
ruthra kumar
d8b988dd9c Merge pull request #43095 from aerele/common_party_on_foreign_currency
fix: check multi-currency on jv for common party accounting with foreign currency
2024-09-09 10:34:47 +05:30
rohitwaghchaure
5a1a37e915 Merge pull request #43071 from rohitwaghchaure/fixed-support-21512
fix: Cannot read properties of null (reading 'doc')
2024-09-09 09:00:13 +05:30
Smit Vora
e5a49f738b fix: multiple fixes related to remarks for GL Report (#42753)
* fix: show remarks in report only if it exists

* fix: additional fixes to reduce redundancy in report print format

* fix: revert changes for supplier invoice reference

* fix: update remarks before submit to ensure all available details before submit are used

* fix: patch to update invoice remarks where it's not set

* fix: update remarks in payment ledger entry
2024-09-09 01:53:44 +00:00
Smit Vora
6b1acc3283 Merge pull request #42816 from sagarvora/onload-tx
fix: ensure `SellingController.onload` gets called for SO & DN
2024-09-09 07:13:30 +05:30
Sanket322
05de8994b0 refactor: age range in one field (#42736)
* fix: age range in one field

* fix: patch for custom reports

* refactor: stock ageing and account payable report

* fix: fixing the test cases

* fix: common patch for reports with ageing

* refactor: rename variable and minor refactor

* fix: fixing the test case
2024-09-09 06:40:17 +05:30
Khushi Rawat
f3445d645d fix: pass company from asset to asset capitalization 2024-09-08 23:23:54 +05:30
Frappe PR Bot
da48d4599a fix: sync translations from crowdin (#43034)
* fix: Turkish translations

* fix: Swedish translations

* fix: German translations

* fix: Turkish translations

* fix: German translations

* fix: Turkish translations

* fix: Turkish translations

* fix: Persian translations

* fix: Swedish translations
2024-09-08 12:19:58 +02:00
Kitti U
d4dd01d8d1 feat: provide hook point for bulk transaction tasks 2024-09-07 17:46:19 +07:00
ruthra kumar
ee94fb37c8 refactor(test): use change_settings decorator 2024-09-07 11:39:06 +05:30
Khushi Rawat
5ce5b1b6a2 fix: unhide action button after form redirect 2024-09-07 01:33:12 +05:30
venkat102
454e18ad5f fix: uncomment internal parties 2024-09-06 20:03:56 +05:30
venkat102
740a04a704 test: add unit test for common party with foreign currency 2024-09-06 20:01:35 +05:30
venkat102
00938bfd4d fix: check multi-currency on jv for common party accounting with foreign currency 2024-09-06 19:53:40 +05:30
Rohit Waghchaure
62c3389bd6 fix: Cannot read properties of null (reading 'doc') 2024-09-05 16:20:56 +05:30
Bhavan23
e2f3e8713e Merge branch 'develop' of github.com:aerele/erpnext into pricing_rule 2024-09-05 10:44:28 +05:30
barredterra
f3c5803198 fix(Opening Invoice Creation Tool): translatability of messages 2024-09-04 18:05:02 +02:00
Prashant Kamble
5d6f6a2fb9 fix: unreconcile allocation child table redirect url voucher no issue 2024-09-04 11:21:05 +00:00
ljain112
b9048ca6fa fix: set tax_withholding_category from Purchase Order while creating pi form po 2024-09-04 13:57:03 +05:30
ljain112
b216d71278 fix: consistent behaviour on refresh 2024-09-03 13:58:30 +05:30
ljain112
be6c174b43 fix: do not check appy_tds in Purchase Order Automatically 2024-09-03 11:44:55 +05:30
Bhavan23
45de18069c fix: validate the item code when updating the other item's price rule 2024-08-31 17:32:19 +05:30
lukas.brandhoff
268962c25f fix: A project without tasks should be able to complete 2024-08-28 09:17:28 +00:00
NIYAZ RAZAK
9a11df59fc fix: incorrect amount in bank clearance 2024-08-24 12:56:33 +03:00
ljain112
a7888b26a7 fix: tds workflow in purchase order 2024-08-23 12:34:07 +05:30
ljain112
eeb6e75dcf fix: revert 091c5496b2 2024-08-20 10:58:45 +05:30
Sagar Vora
8431e3c275 fix: ensure SellingController.onload gets called for SO & DN 2024-08-19 08:16:11 +05:30
vishnu
3b9f8aa378 fix: warehouse not mapping correctly during Delivery Note creation. 2024-08-18 09:56:12 +00:00
barredterra
08646b7ab7 refactor: extract common validation method 2024-08-17 02:36:16 +02:00
barredterra
34df6e39dc fix(Delivery Note): translatability of validation errors 2024-08-17 02:27:36 +02:00
HarryPaulo
486d396174 fix: Freeze Screen on load invoices on POS Closing Entry 2024-07-24 08:57:27 -03:00
833 changed files with 402712 additions and 381261 deletions

View File

@@ -38,3 +38,7 @@ ec74a5e56617bbd76ac402451468fd4668af543d
# ruff formatting
a308792ee7fda18a681e9181f4fd00b36385bc23
# noisy typing refactoring of get_item_details
7b7211ac79c248a79ba8a999ff34e734d874c0ae
d827ed21adc7b36047e247cbb0dc6388d048a7f9

View File

@@ -12,9 +12,16 @@ pip install frappe-bench
githubbranch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}}
frappeuser=${FRAPPE_USER:-"frappe"}
frappebranch=${FRAPPE_BRANCH:-$githubbranch}
frappecommitish=${FRAPPE_BRANCH:-$githubbranch}
mkdir frappe
pushd frappe
git init
git remote add origin "https://github.com/${frappeuser}/frappe"
git fetch origin "${frappecommitish}" --depth 1
git checkout FETCH_HEAD
popd
git clone "https://github.com/${frappeuser}/frappe" --branch "${frappebranch}" --depth 1
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
mkdir ~/frappe-bench/sites/test_site

8
.github/stale.yml vendored
View File

@@ -12,6 +12,14 @@ exemptProjects: true
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Skip the stale action for draft PRs
exemptDraftPr: true
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- hotfix
- no-stale
pulls:
daysUntilStale: 15
daysUntilClose: 3

View File

@@ -137,7 +137,8 @@ jobs:
update_to_version 15
echo "Updating to latest version"
git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
git -C "apps/frappe" fetch --depth 1 upstream "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
git -C "apps/frappe" checkout -q -f FETCH_HEAD
git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
pgrep honcho | xargs kill

View File

@@ -0,0 +1,130 @@
name: Individual
on:
workflow_dispatch:
concurrency:
group: server-individual-tests-develop-${{ github.event_name }}-${{ github.event.number || github.event_name == 'workflow_dispatch' && github.run_id || '' }}
cancel-in-progress: false
jobs:
discover:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Clone
uses: actions/checkout@v4
- id: set-matrix
run: |
# Use grep and find to get the list of test files
matrix=$(find . -path '*/doctype/*/test_*.py' | xargs grep -l 'def test_' | awk '{
# Remove ./ prefix, file extension, and replace / with .
gsub(/^\.\//, "", $0)
gsub(/\.py$/, "", $0)
gsub(/\//, ".", $0)
# Add to array
tests[NR] = $0
}
END {
# Start JSON array
printf "{\n \"include\": [\n"
# Loop through array and create JSON objects
for (i=1; i<=NR; i++) {
printf " {\"test\": \"%s\"}", tests[i]
if (i < NR) printf ","
printf "\n"
}
# Close JSON array
printf " ]\n}"
}')
# Output the matrix
echo "matrix=$(echo "$matrix" | jq -c)" >> $GITHUB_OUTPUT
# For debugging (optional)
echo "Generated matrix:"
echo "$matrix"
test:
needs: discover
runs-on: ubuntu-latest
timeout-minutes: 60
env:
NODE_ENV: "production"
strategy:
fail-fast: false
matrix: ${{fromJson(needs.discover.outputs.matrix)}}
name: Test
services:
mysql:
image: mariadb:10.6
env:
MARIADB_ROOT_PASSWORD: 'root'
ports:
- 3306:3306
options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Clone
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
check-latest: true
- name: Add to Hosts
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
DB: mariadb
TYPE: server
FRAPPE_USER: ${{ github.event.inputs.user }}
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
- name: Run Tests
run: 'cd ~/frappe-bench/ && bench --site test_site run-tests --app erpnext --module ${{ matrix.test }}'

View File

@@ -1,6 +1,8 @@
name: Server (Mariadb)
on:
repository_dispatch:
types: [frappe-framework-change]
pull_request:
paths-ignore:
- '**.js'
@@ -117,10 +119,10 @@ jobs:
DB: mariadb
TYPE: server
FRAPPE_USER: ${{ github.event.inputs.user }}
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
FRAPPE_BRANCH: ${{ github.event.client_payload.sha || github.event.inputs.branch }}
- name: Run Tests
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds 4 --build-number ${{ matrix.container }}'
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds ${{ strategy.job-total }} --build-number ${{ matrix.container }}'
env:
TYPE: server
CAPTURE_COVERAGE: ${{ github.event_name != 'pull_request' }}

View File

@@ -3,22 +3,22 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
erpnext/accounts/ @deepeshgarg007 @ruthra-kumar
erpnext/assets/ @anandbaburajan @deepeshgarg007
erpnext/regional @deepeshgarg007 @ruthra-kumar
erpnext/selling @deepeshgarg007 @ruthra-kumar
erpnext/support/ @deepeshgarg007
erpnext/accounts/ @ruthra-kumar
erpnext/assets/ @khushi8112
erpnext/regional @ruthra-kumar
erpnext/selling @ruthra-kumar
erpnext/support/ @ruthra-kumar
pos*
erpnext/buying/ @rohitwaghchaure @s-aga-r
erpnext/maintenance/ @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @rohitwaghchaure @s-aga-r
erpnext/quality_management/ @rohitwaghchaure @s-aga-r
erpnext/stock/ @rohitwaghchaure @s-aga-r
erpnext/subcontracting @rohitwaghchaure @s-aga-r
erpnext/buying/ @rohitwaghchaure
erpnext/maintenance/ @rohitwaghchaure
erpnext/manufacturing/ @rohitwaghchaure
erpnext/quality_management/ @rohitwaghchaure
erpnext/stock/ @rohitwaghchaure
erpnext/subcontracting @rohitwaghchaure
erpnext/controllers/ @deepeshgarg007 @rohitwaghchaure
erpnext/patches/ @deepeshgarg007
erpnext/controllers/ @ruthra-kumar @rohitwaghchaure
erpnext/patches/ @ruthra-kumar
.github/ @deepeshgarg007
pyproject.toml @phot0n
.github/ @ruthra-kumar
pyproject.toml @akhilnarang

View File

@@ -1,7 +1,9 @@
import functools
import inspect
from typing import TypeVar
import frappe
from frappe.model.document import Document
from frappe.utils.user import is_website_user
__version__ = "16.0.0-dev"
@@ -160,3 +162,34 @@ def check_app_permission():
return False
return True
T = TypeVar("T")
def normalize_ctx_input(T: type) -> callable:
"""
Normalizes the first argument (ctx) of the decorated function by:
- Converting Document objects to dictionaries
- Parsing JSON strings
- Casting the result to the specified type T
"""
def decorator(func: callable):
# conserve annotations for frappe.utils.typing_validations
@functools.wraps(func, assigned=(a for a in functools.WRAPPER_ASSIGNMENTS if a != "__annotations__"))
def wrapper(ctx: T | Document | dict | str, *args, **kwargs):
if isinstance(ctx, Document):
ctx = T(**ctx.as_dict())
elif isinstance(ctx, dict):
ctx = T(**ctx)
else:
ctx = T(**frappe.parse_json(ctx))
return func(ctx, *args, **kwargs)
# set annotations from function
wrapper.__annotations__.update({k: v for k, v in func.__annotations__.items() if k != "ctx"})
return wrapper
return decorator

View File

@@ -58,7 +58,7 @@ def build_conditions(process_type, account, company):
)
if account:
conditions += f"AND {deferred_account}='{account}'"
conditions += f"AND {deferred_account}={frappe.db.escape(account)}"
elif company:
conditions += f"AND p.company = {frappe.db.escape(company)}"

View File

@@ -102,14 +102,12 @@ class Account(NestedSet):
self.name = get_autoname_with_number(self.account_number, self.account_name, self.company)
def validate(self):
from erpnext.accounts.utils import validate_field_number
if frappe.local.flags.allow_unverified_charts:
return
self.validate_parent()
self.validate_parent_child_account_type()
self.validate_root_details()
validate_field_number("Account", self.name, self.account_number, self.company, "account_number")
self.validate_account_number()
self.validate_group_or_ledger()
self.set_root_and_report_type()
self.validate_mandatory()
@@ -310,6 +308,22 @@ class Account(NestedSet):
if frappe.db.get_value("GL Entry", {"account": self.name}):
frappe.throw(_("Currency can not be changed after making entries using some other currency"))
def validate_account_number(self, account_number=None):
if not account_number:
account_number = self.account_number
if account_number:
account_with_same_number = frappe.db.get_value(
"Account",
{"account_number": account_number, "company": self.company, "name": ["!=", self.name]},
)
if account_with_same_number:
frappe.throw(
_("Account Number {0} already used in account {1}").format(
account_number, account_with_same_number
)
)
def create_account_for_child_company(self, parent_acc_name_map, descendants, parent_acc_name):
for company in descendants:
company_bold = frappe.bold(company)
@@ -463,19 +477,6 @@ def get_account_autoname(account_number, account_name, company):
return " - ".join(parts)
def validate_account_number(name, account_number, company):
if account_number:
account_with_same_number = frappe.db.get_value(
"Account", {"account_number": account_number, "company": company, "name": ["!=", name]}
)
if account_with_same_number:
frappe.throw(
_("Account Number {0} already used in account {1}").format(
account_number, account_with_same_number
)
)
@frappe.whitelist()
def update_account_number(name, account_name, account_number=None, from_descendant=False):
account = frappe.get_cached_doc("Account", name)
@@ -516,7 +517,7 @@ def update_account_number(name, account_name, account_number=None, from_descenda
frappe.throw(message, title=_("Rename Not Allowed"))
validate_account_number(name, account_number, account.company)
account.validate_account_number(account_number)
if account_number:
frappe.db.set_value("Account", name, "account_number", account_number.strip())
else:

View File

@@ -109,7 +109,8 @@
"Utility Expenses": {},
"Write Off": {},
"Exchange Gain/Loss": {},
"Gain/Loss on Asset Disposal": {}
"Gain/Loss on Asset Disposal": {},
"Impairment": {}
},
"root_type": "Expense"
},
@@ -132,7 +133,8 @@
"Source of Funds (Liabilities)": {
"Capital Account": {
"Reserves and Surplus": {},
"Shareholders Funds": {}
"Shareholders Funds": {},
"Revaluation Surplus": {}
},
"Current Liabilities": {
"Accounts Payable": {

View File

@@ -72,6 +72,7 @@ def get():
_("Write Off"): {},
_("Exchange Gain/Loss"): {},
_("Gain/Loss on Asset Disposal"): {},
_("Impairment"): {},
},
"root_type": "Expense",
},
@@ -104,6 +105,7 @@ def get():
_("Dividends Paid"): {"account_type": "Equity"},
_("Opening Balance Equity"): {"account_type": "Equity"},
_("Retained Earnings"): {"account_type": "Equity"},
_("Revaluation Surplus"): {"account_type": "Equity"},
"root_type": "Equity",
},
}

View File

@@ -1,11 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import unittest
import frappe
from frappe.test_runner import make_test_records
from frappe.tests import IntegrationTestCase
from frappe.utils import nowdate
from erpnext.accounts.doctype.account.account import (
@@ -15,10 +13,10 @@ from erpnext.accounts.doctype.account.account import (
)
from erpnext.stock import get_company_default_inventory_account, get_warehouse_account
test_dependencies = ["Company"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Company"]
class TestAccount(unittest.TestCase):
class TestAccount(IntegrationTestCase):
def test_rename_account(self):
if not frappe.db.exists("Account", "1210 - Debtors - _TC"):
acc = frappe.new_doc("Account")
@@ -203,8 +201,6 @@ class TestAccount(unittest.TestCase):
In a parent->child company setup, child should inherit parent account currency if explicitly specified.
"""
make_test_records("Company")
frappe.local.flags.pop("ignore_root_company_validation", None)
def create_bank_account():
@@ -328,7 +324,7 @@ class TestAccount(unittest.TestCase):
def _make_test_records(verbose=None):
from frappe.test_runner import make_test_objects
from frappe.tests.utils import make_test_objects
accounts = [
# [account_name, parent_account, is_group]

View File

@@ -1,6 +0,0 @@
[
{
"doctype": "Account",
"name": "_Test Account 1"
}
]

View File

@@ -0,0 +1,3 @@
[[Account]]
name = "_Test Account 1"

View File

@@ -113,9 +113,9 @@ def get_previous_closing_entries(company, closing_date, accounting_dimensions):
entries = []
last_period_closing_voucher = frappe.db.get_all(
"Period Closing Voucher",
filters={"docstatus": 1, "company": company, "posting_date": ("<", closing_date)},
filters={"docstatus": 1, "company": company, "period_end_date": ("<", closing_date)},
fields=["name"],
order_by="posting_date desc",
order_by="period_end_date desc",
limit=1,
)

View File

@@ -2,8 +2,17 @@
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class TestAccountClosingBalance(FrappeTestCase):
class UnitTestAccountClosingBalance(UnitTestCase):
"""
Unit tests for AccountClosingBalance.
Use this class for testing individual functions and methods.
"""
pass
class TestAccountClosingBalance(IntegrationTestCase):
pass

View File

@@ -58,7 +58,7 @@ frappe.ui.form.on("Accounting Dimension", {
},
label: function (frm) {
frm.set_value("fieldname", frappe.model.scrub(frm.doc.label));
frm.set_value("fieldname", frm.doc.label.replace(/ /g, "_").replace(/-/g, "_").toLowerCase());
},
document_type: function (frm) {

View File

@@ -7,6 +7,7 @@ import json
import frappe
from frappe import _, scrub
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
from frappe.database.schema import validate_column_name
from frappe.model import core_doctypes_list
from frappe.model.document import Document
from frappe.utils import cstr
@@ -60,6 +61,7 @@ class AccountingDimension(Document):
if not self.is_new():
self.validate_document_type_change()
validate_column_name(self.fieldname)
self.validate_dimension_defaults()
def validate_document_type_change(self):

View File

@@ -1,17 +1,17 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
test_dependencies = ["Cost Center", "Location", "Warehouse", "Department"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Cost Center", "Location", "Warehouse", "Department"]
class TestAccountingDimension(unittest.TestCase):
class TestAccountingDimension(IntegrationTestCase):
def setUp(self):
create_dimension()

View File

@@ -12,7 +12,7 @@ from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension imp
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.exceptions import InvalidAccountDimensionError, MandatoryAccountDimensionError
test_dependencies = ["Location", "Cost Center", "Department"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Location", "Cost Center", "Department"]
class TestAccountingDimensionFilter(unittest.TestCase):

View File

@@ -101,6 +101,8 @@ def validate_accounting_period_on_doc_save(doc, method=None):
date = doc.available_for_use_date
elif doc.doctype == "Asset Repair":
date = doc.completion_date
elif doc.doctype == "Period Closing Voucher":
date = doc.period_end_date
else:
date = doc.posting_date

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_months, nowdate
from erpnext.accounts.doctype.accounting_period.accounting_period import (
@@ -12,10 +12,10 @@ from erpnext.accounts.doctype.accounting_period.accounting_period import (
)
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
test_dependencies = ["Item"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Item"]
class TestAccountingPeriod(unittest.TestCase):
class TestAccountingPeriod(IntegrationTestCase):
def test_overlap(self):
ap1 = create_accounting_period(
start_date="2018-04-01", end_date="2018-06-30", company="Wind Power LLC"

View File

@@ -1,9 +1,10 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
class TestAccountsSettings(unittest.TestCase):
class TestAccountsSettings(IntegrationTestCase):
def tearDown(self):
# Just in case `save` method succeeds, we need to take things back to default so that other tests
# don't break

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
// frappe.ui.form.on("Advance Payment Ledger Entry", {
// refresh(frm) {
// },
// });

View File

@@ -0,0 +1,113 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-10-16 16:57:12.085072",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"company",
"voucher_type",
"voucher_no",
"against_voucher_type",
"against_voucher_no",
"amount",
"currency",
"event"
],
"fields": [
{
"fieldname": "voucher_type",
"fieldtype": "Link",
"label": "Voucher Type",
"options": "DocType",
"read_only": 1
},
{
"fieldname": "voucher_no",
"fieldtype": "Dynamic Link",
"label": "Voucher No",
"options": "voucher_type",
"read_only": 1
},
{
"fieldname": "against_voucher_type",
"fieldtype": "Link",
"label": "Against Voucher Type",
"options": "DocType",
"read_only": 1
},
{
"fieldname": "against_voucher_no",
"fieldtype": "Dynamic Link",
"label": "Against Voucher No",
"options": "against_voucher_type",
"read_only": 1
},
{
"fieldname": "amount",
"fieldtype": "Currency",
"label": "Amount",
"read_only": 1
},
{
"fieldname": "currency",
"fieldtype": "Link",
"label": "Currency",
"options": "Currency",
"read_only": 1
},
{
"fieldname": "event",
"fieldtype": "Data",
"label": "Event",
"read_only": 1
},
{
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"read_only": 1
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-11-05 10:31:28.736671",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Advance Payment Ledger Entry",
"owner": "Administrator",
"permissions": [
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"share": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Auditor",
"share": 1
}
],
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,27 @@
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class AdvancePaymentLedgerEntry(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from frappe.types import DF
against_voucher_no: DF.DynamicLink | None
against_voucher_type: DF.Link | None
amount: DF.Currency
company: DF.Link | None
currency: DF.Link | None
event: DF.Data | None
voucher_no: DF.DynamicLink | None
voucher_type: DF.Link | None
# end: auto-generated types
pass

View File

@@ -0,0 +1,228 @@
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import nowdate, today
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
# On IntegrationTestCase, the doctype test records and all
# link-field test record depdendencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
class TestAdvancePaymentLedgerEntry(AccountsTestMixin, IntegrationTestCase):
"""
Integration tests for AdvancePaymentLedgerEntry.
Use this class for testing interactions between multiple components.
"""
def setUp(self):
self.create_company()
self.create_usd_receivable_account()
self.create_usd_payable_account()
self.create_item()
self.clear_old_entries()
def tearDown(self):
frappe.db.rollback()
def create_sales_order(self, qty=1, rate=100, currency="INR", do_not_submit=False):
"""
Helper method
"""
so = make_sales_order(
company=self.company,
customer=self.customer,
currency=currency,
item=self.item,
qty=qty,
rate=rate,
transaction_date=today(),
do_not_submit=do_not_submit,
)
return so
def create_purchase_order(self, qty=1, rate=100, currency="INR", do_not_submit=False):
"""
Helper method
"""
po = create_purchase_order(
company=self.company,
customer=self.supplier,
currency=currency,
item=self.item,
qty=qty,
rate=rate,
transaction_date=today(),
do_not_submit=do_not_submit,
)
return po
def test_so_advance_paid_and_currency_with_payment(self):
self.create_customer("_Test USD Customer", "USD")
so = self.create_sales_order(currency="USD", do_not_submit=True)
so.conversion_rate = 80
so.submit()
pe_exchange_rate = 85
pe = get_payment_entry(so.doctype, so.name, bank_account=self.cash)
pe.reference_no = "1"
pe.reference_date = nowdate()
pe.paid_from = self.debtors_usd
pe.paid_from_account_currency = "USD"
pe.source_exchange_rate = pe_exchange_rate
pe.paid_amount = so.grand_total
pe.received_amount = pe_exchange_rate * pe.paid_amount
pe.references[0].outstanding_amount = 100
pe.references[0].total_amount = 100
pe.references[0].allocated_amount = 100
pe.save().submit()
so.reload()
self.assertEqual(so.advance_paid, 100)
self.assertEqual(so.party_account_currency, "USD")
# cancel advance payment
pe.reload()
pe.cancel()
so.reload()
self.assertEqual(so.advance_paid, 0)
self.assertEqual(so.party_account_currency, "USD")
def test_so_advance_paid_and_currency_with_journal(self):
self.create_customer("_Test USD Customer", "USD")
so = self.create_sales_order(currency="USD", do_not_submit=True)
so.conversion_rate = 80
so.submit()
je_exchange_rate = 85
je = frappe.get_doc(
{
"doctype": "Journal Entry",
"company": self.company,
"voucher_type": "Journal Entry",
"posting_date": so.transaction_date,
"multi_currency": True,
"accounts": [
{
"account": self.debtors_usd,
"party_type": "Customer",
"party": so.customer,
"credit": 8500,
"credit_in_account_currency": 100,
"is_advance": "Yes",
"reference_type": so.doctype,
"reference_name": so.name,
"exchange_rate": je_exchange_rate,
},
{
"account": self.cash,
"debit": 8500,
"debit_in_account_currency": 8500,
},
],
}
)
je.save().submit()
so.reload()
self.assertEqual(so.advance_paid, 100)
self.assertEqual(so.party_account_currency, "USD")
# cancel advance payment
je.reload()
je.cancel()
so.reload()
self.assertEqual(so.advance_paid, 0)
self.assertEqual(so.party_account_currency, "USD")
def test_po_advance_paid_and_currency_with_payment(self):
self.create_supplier("_Test USD Supplier", "USD")
po = self.create_purchase_order(currency="USD", do_not_submit=True)
po.conversion_rate = 80
po.submit()
pe_exchange_rate = 85
pe = get_payment_entry(po.doctype, po.name, bank_account=self.cash)
pe.reference_no = "1"
pe.reference_date = nowdate()
pe.paid_to = self.creditors_usd
pe.paid_to_account_currency = "USD"
pe.target_exchange_rate = pe_exchange_rate
pe.received_amount = po.grand_total
pe.paid_amount = pe_exchange_rate * pe.received_amount
pe.references[0].outstanding_amount = 100
pe.references[0].total_amount = 100
pe.references[0].allocated_amount = 100
pe.save().submit()
po.reload()
self.assertEqual(po.advance_paid, 100)
self.assertEqual(po.party_account_currency, "USD")
# cancel advance payment
pe.reload()
pe.cancel()
po.reload()
self.assertEqual(po.advance_paid, 0)
self.assertEqual(po.party_account_currency, "USD")
def test_po_advance_paid_and_currency_with_journal(self):
self.create_supplier("_Test USD Supplier", "USD")
po = self.create_purchase_order(currency="USD", do_not_submit=True)
po.conversion_rate = 80
po.submit()
je_exchange_rate = 85
je = frappe.get_doc(
{
"doctype": "Journal Entry",
"company": self.company,
"voucher_type": "Journal Entry",
"posting_date": po.transaction_date,
"multi_currency": True,
"accounts": [
{
"account": self.creditors_usd,
"party_type": "Supplier",
"party": po.supplier,
"debit": 8500,
"debit_in_account_currency": 100,
"is_advance": "Yes",
"reference_type": po.doctype,
"reference_name": po.name,
"exchange_rate": je_exchange_rate,
},
{
"account": self.cash,
"credit": 8500,
"credit_in_account_currency": 8500,
},
],
}
)
je.save().submit()
po.reload()
self.assertEqual(po.advance_paid, 100)
self.assertEqual(po.party_account_currency, "USD")
# cancel advance payment
je.reload()
je.cancel()
po.reload()
self.assertEqual(po.advance_paid, 0)
self.assertEqual(po.party_account_currency, "USD")

View File

@@ -13,6 +13,7 @@
"col_break_1",
"description",
"included_in_paid_amount",
"set_by_item_tax_template",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
@@ -20,11 +21,13 @@
"rate",
"section_break_9",
"currency",
"net_amount",
"tax_amount",
"total",
"allocated_amount",
"column_break_13",
"base_tax_amount",
"base_net_amount",
"base_total"
],
"fields": [
@@ -174,12 +177,40 @@
"label": "Account Currency",
"options": "Currency",
"read_only": 1
},
{
"columns": 2,
"fieldname": "net_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Net Amount",
"options": "currency",
"read_only": 1
},
{
"fieldname": "base_net_amount",
"fieldtype": "Currency",
"label": "Net Amount (Company Currency)",
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"default": "0",
"fieldname": "set_by_item_tax_template",
"fieldtype": "Check",
"hidden": 1,
"label": "Set by Item Tax Template",
"print_hide": 1,
"read_only": 1,
"report_hide": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-03-27 13:05:58.437605",
"modified": "2024-11-22 19:16:22.346267",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Advance Taxes and Charges",

View File

@@ -18,6 +18,7 @@ class AdvanceTaxesandCharges(Document):
account_head: DF.Link
add_deduct_tax: DF.Literal["Add", "Deduct"]
allocated_amount: DF.Currency
base_net_amount: DF.Currency
base_tax_amount: DF.Currency
base_total: DF.Currency
charge_type: DF.Literal[
@@ -27,11 +28,13 @@ class AdvanceTaxesandCharges(Document):
currency: DF.Link | None
description: DF.SmallText
included_in_paid_amount: DF.Check
net_amount: DF.Currency
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
rate: DF.Float
row_id: DF.Data | None
set_by_item_tax_template: DF.Check
tax_amount: DF.Currency
total: DF.Currency
# end: auto-generated types

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestBank(unittest.TestCase):
class TestBank(IntegrationTestCase):
pass

View File

@@ -208,8 +208,49 @@
"label": "Disabled"
}
],
"links": [],
"modified": "2024-03-27 13:06:37.049542",
"links": [
{
"group": "Transactions",
"link_doctype": "Payment Request",
"link_fieldname": "bank_account"
},
{
"group": "Transactions",
"link_doctype": "Payment Order",
"link_fieldname": "bank_account"
},
{
"group": "Transactions",
"link_doctype": "Bank Guarantee",
"link_fieldname": "bank_account"
},
{
"group": "Transactions",
"link_doctype": "Bank Transaction",
"link_fieldname": "bank_account"
},
{
"group": "Accounting",
"link_doctype": "Payment Entry",
"link_fieldname": "bank_account"
},
{
"group": "Accounting",
"link_doctype": "Journal Entry",
"link_fieldname": "bank_account"
},
{
"group": "Party",
"link_doctype": "Customer",
"link_fieldname": "default_bank_account"
},
{
"group": "Party",
"link_doctype": "Supplier",
"link_fieldname": "default_bank_account"
}
],
"modified": "2024-10-30 09:41:14.113414",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Account",

View File

@@ -1,20 +0,0 @@
from frappe import _
def get_data():
return {
"fieldname": "bank_account",
"non_standard_fieldnames": {
"Customer": "default_bank_account",
"Supplier": "default_bank_account",
},
"transactions": [
{
"label": _("Payments"),
"items": ["Payment Entry", "Payment Request", "Payment Order", "Payroll Entry"],
},
{"label": _("Party"), "items": ["Customer", "Supplier"]},
{"items": ["Bank Guarantee"]},
{"items": ["Journal Entry"]},
],
}

View File

@@ -1,15 +1,13 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe import ValidationError
# test_records = frappe.get_test_records('Bank Account')
from frappe.tests import IntegrationTestCase
class TestBankAccount(unittest.TestCase):
class TestBankAccount(IntegrationTestCase):
def test_validate_iban(self):
valid_ibans = [
"GB82 WEST 1234 5698 7654 32",

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestBankAccountSubtype(unittest.TestCase):
class TestBankAccountSubtype(IntegrationTestCase):
pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestBankAccountType(unittest.TestCase):
class TestBankAccountType(IntegrationTestCase):
pass

View File

@@ -108,8 +108,18 @@ class BankClearance(Document):
if not d.clearance_date:
d.clearance_date = None
payment_entry = frappe.get_doc(d.payment_document, d.payment_entry)
payment_entry.db_set("clearance_date", d.clearance_date)
if d.payment_document == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
{"parent": d.payment_entry, "account": self.get("account"), "amount": [">", 0]},
"clearance_date",
d.clearance_date,
)
else:
frappe.db.set_value(
d.payment_document, d.payment_entry, "clearance_date", d.clearance_date
)
clearance_date_updated = True
@@ -158,7 +168,7 @@ def get_payment_entries_for_bank_clearance(
"Payment Entry" as payment_document, name as payment_entry,
reference_no as cheque_number, reference_date as cheque_date,
if(paid_from=%(account)s, paid_amount + total_taxes_and_charges, 0) as credit,
if(paid_from=%(account)s, 0, received_amount) as debit,
if(paid_from=%(account)s, 0, received_amount + total_taxes_and_charges) as debit,
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency
from `tabPayment Entry`

View File

@@ -1,21 +1,32 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_months, getdate
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.stock.doctype.item.test_item import create_item
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
from erpnext.tests.utils import if_lending_app_installed, if_lending_app_not_installed
class TestBankClearance(unittest.TestCase):
class TestBankClearance(IntegrationTestCase):
@classmethod
def setUpClass(cls):
clear_payment_entries()
clear_loan_transactions()
super().setUpClass()
create_warehouse(
warehouse_name="_Test Warehouse",
properties={"parent_warehouse": "All Warehouses - _TC"},
company="_Test Company",
)
create_item("_Test Item")
create_cost_center(cost_center_name="_Test Cost Center", company="_Test Company")
make_bank_account()
add_transactions()
@@ -83,18 +94,31 @@ class TestBankClearance(unittest.TestCase):
bank_clearance.get_payment_entries()
self.assertEqual(len(bank_clearance.payment_entries), 3)
def test_update_clearance_date_on_si(self):
sales_invoice = make_pos_sales_invoice()
def clear_payment_entries():
frappe.db.delete("Payment Entry")
date = getdate()
bank_clearance = frappe.get_doc("Bank Clearance")
bank_clearance.account = "_Test Bank Clearance - _TC"
bank_clearance.from_date = add_months(date, -1)
bank_clearance.to_date = date
bank_clearance.include_pos_transactions = 1
bank_clearance.get_payment_entries()
self.assertNotEqual(len(bank_clearance.payment_entries), 0)
for payment in bank_clearance.payment_entries:
if payment.payment_entry == sales_invoice.name:
payment.clearance_date = date
@if_lending_app_installed
def clear_loan_transactions():
for dt in [
"Loan Disbursement",
"Loan Repayment",
]:
frappe.db.delete(dt)
bank_clearance.update_clearance_date()
si_clearance_date = frappe.db.get_value(
"Sales Invoice Payment",
{"parent": sales_invoice.name, "account": bank_clearance.account},
"clearance_date",
)
self.assertEqual(si_clearance_date, date)
def make_bank_account():
@@ -115,9 +139,45 @@ def add_transactions():
def make_payment_entry():
pi = make_purchase_invoice(supplier="_Test Supplier", qty=1, rate=690)
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
supplier = create_supplier(supplier_name="_Test Supplier")
pi = make_purchase_invoice(
supplier=supplier,
supplier_warehouse="_Test Warehouse - _TC",
expense_account="Cost of Goods Sold - _TC",
uom="Nos",
qty=1,
rate=690,
)
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank Clearance - _TC")
pe.reference_no = "Conrad Oct 18"
pe.reference_date = "2018-10-24"
pe.insert()
pe.submit()
def make_pos_sales_invoice():
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
)
mode_of_payment = frappe.get_doc({"doctype": "Mode of Payment", "name": "Cash"})
if not frappe.db.get_value("Mode of Payment Account", {"company": "_Test Company", "parent": "Cash"}):
mode_of_payment.append(
"accounts", {"company": "_Test Company", "default_account": "_Test Bank Clearance - _TC"}
)
mode_of_payment.save()
customer = make_customer(customer="_Test Customer")
si = create_sales_invoice(customer=customer, item="_Test Item", is_pos=1, qty=1, rate=1000, do_not_save=1)
si.set("payments", [])
si.append(
"payments", {"mode_of_payment": "Cash", "account": "_Test Bank Clearance - _TC", "amount": 1000}
)
si.insert()
si.submit()
return si

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestBankGuarantee(unittest.TestCase):
class TestBankGuarantee(IntegrationTestCase):
pass

View File

@@ -4,7 +4,7 @@
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, today
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
@@ -15,7 +15,7 @@ from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_pay
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
class TestBankReconciliationTool(AccountsTestMixin, FrappeTestCase):
class TestBankReconciliationTool(AccountsTestMixin, IntegrationTestCase):
def setUp(self):
self.create_company()
self.create_customer()

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2020, Frappe Technologies and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestBankStatementImport(unittest.TestCase):
class TestBankStatementImport(IntegrationTestCase):
pass

View File

@@ -2,13 +2,22 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import nowdate
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import create_bank_account
class TestAutoMatchParty(FrappeTestCase):
class UnitTestBankTransaction(UnitTestCase):
"""
Unit tests for BankTransaction.
Use this class for testing individual functions and methods.
"""
pass
class TestAutoMatchParty(IntegrationTestCase):
@classmethod
def setUpClass(cls):
create_bank_account()

View File

@@ -6,7 +6,7 @@ import json
import frappe
from frappe import utils
from frappe.model.docstatus import DocStatus
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
get_linked_payments,
@@ -18,19 +18,20 @@ from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.tests.utils import if_lending_app_installed
test_dependencies = ["Item", "Cost Center"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Item", "Cost Center"]
class TestBankTransaction(FrappeTestCase):
class UnitTestBankTransaction(UnitTestCase):
"""
Unit tests for BankTransaction.
Use this class for testing individual functions and methods.
"""
pass
class TestBankTransaction(IntegrationTestCase):
def setUp(self):
for dt in [
"Bank Transaction",
"Payment Entry",
"Payment Entry Reference",
"POS Profile",
]:
frappe.db.delete(dt)
clear_loan_transactions()
make_pos_profile()
# generate and use a uniq hash identifier for 'Bank Account' and it's linked GL 'Account' to avoid validation error
@@ -222,11 +223,6 @@ class TestBankTransaction(FrappeTestCase):
self.assertEqual(linked_payments[0]["name"], repayment_entry.name)
@if_lending_app_installed
def clear_loan_transactions():
frappe.db.delete("Loan Repayment")
def create_bank_account(
bank_name="Citi Bank", gl_account="_Test Bank - _TC", bank_account_name="Checking Account"
):

View File

@@ -2,8 +2,17 @@
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class TestBisectAccountingStatements(FrappeTestCase):
class UnitTestBisectAccountingStatements(UnitTestCase):
"""
Unit tests for BisectAccountingStatements.
Use this class for testing individual functions and methods.
"""
pass
class TestBisectAccountingStatements(IntegrationTestCase):
pass

View File

@@ -2,8 +2,17 @@
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class TestBisectNodes(FrappeTestCase):
class UnitTestBisectNodes(UnitTestCase):
"""
Unit tests for BisectNodes.
Use this class for testing individual functions and methods.
"""
pass
class TestBisectNodes(IntegrationTestCase):
pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import now_datetime, nowdate
from erpnext.accounts.doctype.budget.budget import BudgetError, get_actual_expense
@@ -11,10 +11,10 @@ from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journ
from erpnext.accounts.utils import get_fiscal_year
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
test_dependencies = ["Monthly Distribution"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Monthly Distribution"]
class TestBudget(unittest.TestCase):
class TestBudget(IntegrationTestCase):
def test_monthly_budget_crossed_ignore(self):
set_total_expense_zero(nowdate(), "cost_center")

View File

@@ -13,13 +13,13 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Campaign",
"options": "Campaign"
"options": "UTM Campaign"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-03-27 13:06:44.142625",
"modified": "2024-06-28 11:04:09.815940",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Campaign Item",
@@ -29,4 +29,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestCashierClosing(unittest.TestCase):
class TestCashierClosing(IntegrationTestCase):
pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestChartofAccountsImporter(unittest.TestCase):
class TestChartofAccountsImporter(IntegrationTestCase):
pass

View File

@@ -1,10 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
# test_records = frappe.get_test_records('Cheque Print Template')
from frappe.tests import IntegrationTestCase
class TestChequePrintTemplate(unittest.TestCase):
class TestChequePrintTemplate(IntegrationTestCase):
pass

View File

@@ -1,18 +1,13 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import unittest
import frappe
test_records = frappe.get_test_records("Cost Center")
from frappe.tests import IntegrationTestCase
class TestCostCenter(unittest.TestCase):
class TestCostCenter(IntegrationTestCase):
def test_cost_center_creation_against_child_node(self):
if not frappe.db.get_value("Cost Center", {"name": "_Test Cost Center 2 - _TC"}):
frappe.get_doc(test_records[1]).insert()
cost_center = frappe.get_doc(
{
"doctype": "Cost Center",

View File

@@ -1,23 +0,0 @@
[
{
"company": "_Test Company",
"cost_center_name": "_Test Cost Center",
"doctype": "Cost Center",
"is_group": 0,
"parent_cost_center": "_Test Company - _TC"
},
{
"company": "_Test Company",
"cost_center_name": "_Test Cost Center 2",
"doctype": "Cost Center",
"is_group": 0,
"parent_cost_center": "_Test Company - _TC"
},
{
"company": "_Test Company",
"cost_center_name": "_Test Write Off Cost Center",
"doctype": "Cost Center",
"is_group": 0,
"parent_cost_center": "_Test Company - _TC"
}
]

View File

@@ -0,0 +1,18 @@
[["Cost Center"]]
company = "_Test Company"
cost_center_name = "_Test Cost Center"
is_group = 0
parent_cost_center = "_Test Company - _TC"
[["Cost Center"]]
company = "_Test Company"
cost_center_name = "_Test Cost Center 2"
is_group = 0
parent_cost_center = "_Test Company - _TC"
[["Cost Center"]]
company = "_Test Company"
cost_center_name = "_Test Write Off Cost Center"
is_group = 0
parent_cost_center = "_Test Company - _TC"

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, today
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
@@ -17,13 +17,15 @@ from erpnext.accounts.doctype.cost_center_allocation.cost_center_allocation impo
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
class TestCostCenterAllocation(unittest.TestCase):
class TestCostCenterAllocation(IntegrationTestCase):
def setUp(self):
cost_centers = [
"Main Cost Center 1",
"Main Cost Center 2",
"Main Cost Center 3",
"Sub Cost Center 1",
"Sub Cost Center 2",
"Sub Cost Center 3",
]
for cc in cost_centers:
create_cost_center(cost_center_name=cc, company="_Test Company")
@@ -36,7 +38,7 @@ class TestCostCenterAllocation(unittest.TestCase):
)
jv = make_journal_entry(
"_Test Cash - _TC", "Sales - _TC", 100, cost_center="Main Cost Center 1 - _TC", submit=True
"Cash - _TC", "Sales - _TC", 100, cost_center="Main Cost Center 1 - _TC", submit=True
)
expected_values = [["Sub Cost Center 1 - _TC", 0.0, 60], ["Sub Cost Center 2 - _TC", 0.0, 40]]
@@ -120,7 +122,7 @@ class TestCostCenterAllocation(unittest.TestCase):
def test_valid_from_based_on_existing_gle(self):
# GLE posted against Sub Cost Center 1 on today
jv = make_journal_entry(
"_Test Cash - _TC",
"Cash - _TC",
"Sales - _TC",
100,
cost_center="Main Cost Center 1 - _TC",
@@ -141,6 +143,53 @@ class TestCostCenterAllocation(unittest.TestCase):
jv.cancel()
def test_multiple_cost_center_allocation_on_same_main_cost_center(self):
coa1 = create_cost_center_allocation(
"_Test Company",
"Main Cost Center 3 - _TC",
{"Sub Cost Center 1 - _TC": 30, "Sub Cost Center 2 - _TC": 30, "Sub Cost Center 3 - _TC": 40},
valid_from=add_days(today(), -5),
)
coa2 = create_cost_center_allocation(
"_Test Company",
"Main Cost Center 3 - _TC",
{"Sub Cost Center 1 - _TC": 50, "Sub Cost Center 2 - _TC": 50},
valid_from=add_days(today(), -1),
)
jv = make_journal_entry(
"Cash - _TC",
"Sales - _TC",
100,
cost_center="Main Cost Center 3 - _TC",
posting_date=today(),
submit=True,
)
expected_values = {"Sub Cost Center 1 - _TC": 50, "Sub Cost Center 2 - _TC": 50}
gle = frappe.qb.DocType("GL Entry")
gl_entries = (
frappe.qb.from_(gle)
.select(gle.cost_center, gle.debit, gle.credit)
.where(gle.voucher_type == "Journal Entry")
.where(gle.voucher_no == jv.name)
.where(gle.account == "Sales - _TC")
.orderby(gle.cost_center)
).run(as_dict=1)
self.assertTrue(gl_entries)
for gle in gl_entries:
self.assertTrue(gle.cost_center in expected_values)
self.assertEqual(gle.debit, 0)
self.assertEqual(gle.credit, expected_values[gle.cost_center])
coa1.cancel()
coa2.cancel()
jv.cancel()
def create_cost_center_allocation(
company,

View File

@@ -62,7 +62,7 @@
"unique": 1
},
{
"depends_on": "eval !doc.from_external_ecomm_platform",
"depends_on": "eval: !doc.from_external_ecomm_platform",
"fieldname": "pricing_rule",
"fieldtype": "Link",
"label": "Pricing Rule",
@@ -125,7 +125,7 @@
}
],
"links": [],
"modified": "2024-06-28 06:17:01.833399",
"modified": "2024-11-19 16:35:11.836441",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Coupon Code",
@@ -186,4 +186,4 @@
"states": [],
"title_field": "coupon_name",
"track_changes": 1
}
}

View File

@@ -1,13 +1,13 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
test_dependencies = ["Item"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Item"]
def test_create_test_data():
@@ -110,7 +110,7 @@ def test_create_test_data():
coupon_code.insert()
class TestCouponCode(unittest.TestCase):
class TestCouponCode(IntegrationTestCase):
def setUp(self):
test_create_test_data()

View File

@@ -109,7 +109,7 @@ def get_api_endpoint(service_provider: str | None = None, use_http: bool = False
if service_provider == "exchangerate.host":
api = "api.exchangerate.host/convert"
elif service_provider == "frankfurter.app":
api = "frankfurter.app/{transaction_date}"
api = "api.frankfurter.app/{transaction_date}"
protocol = "https://"
if use_http:

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestCurrencyExchangeSettings(unittest.TestCase):
class TestCurrencyExchangeSettings(IntegrationTestCase):
pass

View File

@@ -19,16 +19,6 @@
"currency",
"column_break_11",
"conversion_rate",
"address_and_contact_section",
"customer_address",
"address_display",
"contact_person",
"contact_display",
"column_break_16",
"company_address",
"company_address_display",
"contact_mobile",
"contact_email",
"section_break_6",
"dunning_type",
"column_break_8",
@@ -56,7 +46,21 @@
"income_account",
"column_break_48",
"cost_center",
"amended_from"
"amended_from",
"address_and_contact_tab",
"address_and_contact_section",
"customer_address",
"address_display",
"column_break_vodj",
"contact_person",
"contact_display",
"contact_mobile",
"contact_email",
"section_break_xban",
"column_break_16",
"company_address",
"company_address_display",
"column_break_lqmf"
],
"fields": [
{
@@ -178,10 +182,8 @@
"label": "Rate of Interest (%) Yearly"
},
{
"collapsible": 1,
"fieldname": "address_and_contact_section",
"fieldtype": "Section Break",
"label": "Address and Contact"
"fieldtype": "Section Break"
},
{
"fieldname": "address_display",
@@ -377,11 +379,28 @@
{
"fieldname": "column_break_48",
"fieldtype": "Column Break"
},
{
"fieldname": "address_and_contact_tab",
"fieldtype": "Tab Break",
"label": "Address & Contact"
},
{
"fieldname": "column_break_vodj",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_xban",
"fieldtype": "Section Break"
},
{
"fieldname": "column_break_lqmf",
"fieldtype": "Column Break"
}
],
"is_submittable": 1,
"links": [],
"modified": "2024-03-27 13:08:19.176146",
"modified": "2024-11-26 13:46:07.760867",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Dunning",

View File

@@ -220,19 +220,31 @@ def get_linked_dunnings_as_per_state(sales_invoice, state):
@frappe.whitelist()
def get_dunning_letter_text(dunning_type, doc, language=None):
def get_dunning_letter_text(dunning_type: str, doc: str | dict, language: str | None = None) -> dict:
DOCTYPE = "Dunning Letter Text"
FIELDS = ["body_text", "closing_text", "language"]
if isinstance(doc, str):
doc = json.loads(doc)
if not language:
language = doc.get("language")
if language:
filters = {"parent": dunning_type, "language": language}
else:
filters = {"parent": dunning_type, "is_default_language": 1}
letter_text = frappe.db.get_value(
"Dunning Letter Text", filters, ["body_text", "closing_text", "language"], as_dict=1
)
if letter_text:
return {
"body_text": frappe.render_template(letter_text.body_text, doc),
"closing_text": frappe.render_template(letter_text.closing_text, doc),
"language": letter_text.language,
}
letter_text = frappe.db.get_value(
DOCTYPE, {"parent": dunning_type, "language": language}, FIELDS, as_dict=1
)
if not letter_text:
letter_text = frappe.db.get_value(
DOCTYPE, {"parent": dunning_type, "is_default_language": 1}, FIELDS, as_dict=1
)
if not letter_text:
return {}
return {
"body_text": frappe.render_template(letter_text.body_text, doc),
"closing_text": frappe.render_template(letter_text.closing_text, doc),
"language": letter_text.language,
}

View File

@@ -1,7 +1,7 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, nowdate, today
from erpnext import get_default_cost_center
@@ -16,10 +16,19 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
create_sales_invoice_against_cost_center,
)
test_dependencies = ["Company", "Cost Center"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Company", "Cost Center"]
class TestDunning(FrappeTestCase):
class UnitTestDunning(UnitTestCase):
"""
Unit tests for Dunning.
Use this class for testing individual functions and methods.
"""
pass
class TestDunning(IntegrationTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestDunningType(unittest.TestCase):
class TestDunningType(IntegrationTestCase):
pass

View File

@@ -1,36 +0,0 @@
[
{
"doctype": "Dunning Type",
"dunning_type": "_Test First Notice",
"company": "_Test Company",
"is_default": 1,
"dunning_fee": 0.0,
"rate_of_interest": 0.0,
"dunning_letter_text": [
{
"language": "en",
"body_text": "We have still not received payment for our invoice",
"closing_text": "We kindly request that you pay the outstanding amount immediately, including interest and late fees."
}
],
"income_account": "Sales - _TC",
"cost_center": "_Test Cost Center - _TC"
},
{
"doctype": "Dunning Type",
"dunning_type": "_Test Second Notice",
"company": "_Test Company",
"is_default": 0,
"dunning_fee": 10.0,
"rate_of_interest": 10.0,
"dunning_letter_text": [
{
"language": "en",
"body_text": "We have still not received payment for our invoice",
"closing_text": "We kindly request that you pay the outstanding amount immediately, including interest and late fees."
}
],
"income_account": "Sales - _TC",
"cost_center": "_Test Cost Center - _TC"
}
]

View File

@@ -0,0 +1,28 @@
[["Dunning Type"]]
dunning_type = "_Test First Notice"
company = "_Test Company"
is_default = 1
dunning_fee = 0.0
rate_of_interest = 0.0
income_account = "Sales - _TC"
cost_center = "_Test Cost Center - _TC"
[["Dunning Type".dunning_letter_text]]
language = "en"
body_text = "We have still not received payment for our invoice"
closing_text = "We kindly request that you pay the outstanding amount immediately, including interest and late fees."
[["Dunning Type"]]
dunning_type = "_Test Second Notice"
company = "_Test Company"
is_default = 0
dunning_fee = 10.0
rate_of_interest = 10.0
income_account = "Sales - _TC"
cost_center = "_Test Cost Center - _TC"
[["Dunning Type".dunning_letter_text]]
language = "en"
body_text = "We have still not received payment for our invoice"
closing_text = "We kindly request that you pay the outstanding amount immediately, including interest and late fees."

View File

@@ -74,6 +74,21 @@ class ExchangeRateRevaluation(Document):
if not (self.company and self.posting_date):
frappe.throw(_("Please select Company and Posting Date to getting entries"))
def before_submit(self):
self.remove_accounts_without_gain_loss()
def remove_accounts_without_gain_loss(self):
self.accounts = [account for account in self.accounts if account.gain_loss]
if not self.accounts:
frappe.throw(_("At least one account with exchange gain or loss is required"))
frappe.msgprint(
_("Removing rows without exchange gain or loss"),
alert=True,
indicator="yellow",
)
def on_cancel(self):
self.ignore_linked_doctypes = "GL Entry"
@@ -248,23 +263,23 @@ class ExchangeRateRevaluation(Document):
new_exchange_rate = get_exchange_rate(d.account_currency, company_currency, posting_date)
new_balance_in_base_currency = flt(d.balance_in_account_currency * new_exchange_rate)
gain_loss = flt(new_balance_in_base_currency, precision) - flt(d.balance, precision)
if gain_loss:
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": d.balance_in_account_currency,
"gain_loss": gain_loss,
}
)
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": d.balance_in_account_currency,
"gain_loss": gain_loss,
}
)
# Handle Accounts with '0' balance in Account/Base Currency
for d in [x for x in account_details if x.zero_balance]:
@@ -288,23 +303,22 @@ class ExchangeRateRevaluation(Document):
current_exchange_rate * d.balance_in_account_currency
)
if gain_loss:
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": new_balance_in_account_currency,
"gain_loss": gain_loss,
}
)
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": new_balance_in_account_currency,
"gain_loss": gain_loss,
}
)
return accounts

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -11,7 +11,7 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
class TestExchangeRateRevaluation(AccountsTestMixin, FrappeTestCase):
class TestExchangeRateRevaluation(AccountsTestMixin, IntegrationTestCase):
def setUp(self):
self.create_company()
self.create_usd_receivable_account()
@@ -35,7 +35,7 @@ class TestExchangeRateRevaluation(AccountsTestMixin, FrappeTestCase):
company_doc.unrealized_exchange_gain_loss_account = company_doc.exchange_gain_loss_account
company_doc.save()
@change_settings(
@IntegrationTestCase.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)
@@ -88,7 +88,7 @@ class TestExchangeRateRevaluation(AccountsTestMixin, FrappeTestCase):
)[0]
self.assertEqual(acc_balance.balance, 8500.0)
@change_settings(
@IntegrationTestCase.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)
@@ -158,7 +158,7 @@ class TestExchangeRateRevaluation(AccountsTestMixin, FrappeTestCase):
self.assertEqual(acc_balance.balance, 0.0)
self.assertEqual(acc_balance.balance_in_account_currency, 0.0)
@change_settings(
@IntegrationTestCase.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)
@@ -247,7 +247,7 @@ class TestExchangeRateRevaluation(AccountsTestMixin, FrappeTestCase):
self.assertEqual(flt(acc_balance.balance, precision), 0.0)
self.assertEqual(flt(acc_balance.balance_in_account_currency, precision), 0.0)
@change_settings(
@IntegrationTestCase.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)

View File

@@ -1,14 +1,14 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
class TestFinanceBook(unittest.TestCase):
class TestFinanceBook(IntegrationTestCase):
def test_finance_book(self):
finance_book = create_finance_book()

View File

@@ -4,10 +4,7 @@
frappe.ui.form.on("Fiscal Year", {
onload: function (frm) {
if (frm.doc.__islocal) {
frm.set_value(
"year_start_date",
frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)
);
frm.set_value("year_start_date", frappe.datetime.year_start());
}
},
year_start_date: function (frm) {

View File

@@ -72,10 +72,10 @@
},
{
"default": "0",
"description": "Less than 12 months.",
"description": "More/Less than 12 months.",
"fieldname": "is_short_year",
"fieldtype": "Check",
"label": "Is Short Year",
"label": "Is Short/Long Year",
"set_only_once": 1
}
],

View File

@@ -1,16 +1,15 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import now_datetime
test_ignore = ["Company"]
IGNORE_TEST_RECORD_DEPENDENCIES = ["Company"]
class TestFiscalYear(unittest.TestCase):
class TestFiscalYear(IntegrationTestCase):
def test_extra_year(self):
if frappe.db.exists("Fiscal Year", "_Test Fiscal Year 2000"):
frappe.delete_doc("Fiscal Year", "_Test Fiscal Year 2000")
@@ -39,8 +38,21 @@ def test_record_generator():
]
start = 2012
this_year = now_datetime().year
end = now_datetime().year + 25
for year in range(start, end):
# The current year fails to load with the following error:
# Year start date or end date is overlapping with 2024. To avoid please set company
# This is a quick-fix: if current FY is needed, please refactor test data properly
for year in range(start, this_year):
test_records.append(
{
"doctype": "Fiscal Year",
"year": f"_Test Fiscal Year {year}",
"year_start_date": f"{year}-01-01",
"year_end_date": f"{year}-12-31",
}
)
for year in range(this_year + 1, end):
test_records.append(
{
"doctype": "Fiscal Year",

View File

@@ -6,38 +6,50 @@
"document_type": "Document",
"engine": "InnoDB",
"field_order": [
"dates_section",
"posting_date",
"transaction_date",
"column_break_avko",
"fiscal_year",
"due_date",
"account_details_section",
"account",
"account_currency",
"column_break_ifvf",
"against",
"party_type",
"party",
"cost_center",
"debit",
"credit",
"account_currency",
"debit_in_account_currency",
"credit_in_account_currency",
"against",
"transaction_details_section",
"voucher_type",
"voucher_no",
"voucher_subtype",
"transaction_currency",
"column_break_dpsx",
"against_voucher_type",
"against_voucher",
"voucher_type",
"voucher_subtype",
"voucher_no",
"voucher_detail_no",
"transaction_exchange_rate",
"amounts_section",
"debit_in_account_currency",
"debit",
"debit_in_transaction_currency",
"column_break_bm1w",
"credit_in_account_currency",
"credit",
"credit_in_transaction_currency",
"dimensions_section",
"cost_center",
"column_break_lmnm",
"project",
"remarks",
"more_info_section",
"finance_book",
"company",
"is_opening",
"is_advance",
"fiscal_year",
"company",
"finance_book",
"column_break_8abq",
"to_rename",
"due_date",
"is_cancelled",
"transaction_currency",
"debit_in_transaction_currency",
"credit_in_transaction_currency",
"transaction_exchange_rate"
"remarks"
],
"fields": [
{
@@ -285,13 +297,67 @@
"fieldname": "voucher_subtype",
"fieldtype": "Small Text",
"label": "Voucher Subtype"
},
{
"fieldname": "dates_section",
"fieldtype": "Section Break",
"label": "Dates"
},
{
"fieldname": "column_break_avko",
"fieldtype": "Column Break"
},
{
"fieldname": "account_details_section",
"fieldtype": "Section Break",
"label": "Account Details"
},
{
"fieldname": "column_break_ifvf",
"fieldtype": "Column Break"
},
{
"fieldname": "transaction_details_section",
"fieldtype": "Section Break",
"label": "Transaction Details"
},
{
"fieldname": "amounts_section",
"fieldtype": "Section Break",
"label": "Amounts"
},
{
"fieldname": "column_break_dpsx",
"fieldtype": "Column Break"
},
{
"fieldname": "more_info_section",
"fieldtype": "Section Break",
"label": "More Info"
},
{
"fieldname": "column_break_bm1w",
"fieldtype": "Column Break"
},
{
"fieldname": "dimensions_section",
"fieldtype": "Section Break",
"label": "Dimensions"
},
{
"fieldname": "column_break_lmnm",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_8abq",
"fieldtype": "Column Break"
}
],
"icon": "fa fa-list",
"idx": 1,
"in_create": 1,
"links": [],
"modified": "2024-03-27 13:09:45.205364",
"modified": "2024-08-22 13:03:39.997475",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",

View File

@@ -430,8 +430,9 @@ def update_against_account(voucher_type, voucher_no):
def on_doctype_update():
frappe.db.add_index("GL Entry", ["against_voucher_type", "against_voucher"])
frappe.db.add_index("GL Entry", ["voucher_type", "voucher_no"])
frappe.db.add_index("GL Entry", ["posting_date", "company"])
frappe.db.add_index("GL Entry", ["party_type", "party"])
def rename_gle_sle_docs():

View File

@@ -1,17 +1,16 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import unittest
import frappe
from frappe.model.naming import parse_naming_series
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.gl_entry.gl_entry import rename_gle_sle_docs
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
class TestGLEntry(unittest.TestCase):
class TestGLEntry(IntegrationTestCase):
def test_round_off_entry(self):
frappe.db.set_value("Company", "_Test Company", "round_off_account", "_Test Write Off - _TC")
frappe.db.set_value("Company", "_Test Company", "round_off_cost_center", "_Test Cost Center - _TC")

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, nowdate
from erpnext.accounts.doctype.account.test_account import create_account
@@ -12,7 +12,7 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries
class TestInvoiceDiscounting(unittest.TestCase):
class TestInvoiceDiscounting(IntegrationTestCase):
def setUp(self):
self.ar_credit = create_account(
account_name="_Test Accounts Receivable Credit",

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestItemTaxTemplate(unittest.TestCase):
class TestItemTaxTemplate(IntegrationTestCase):
pass

View File

@@ -1,79 +0,0 @@
[
{
"doctype": "Item Tax Template",
"title": "_Test Account Excise Duty @ 10",
"company": "_Test Company",
"taxes": [
{
"doctype": "Item Tax Template Detail",
"parentfield": "taxes",
"tax_rate": 10,
"tax_type": "_Test Account Excise Duty - _TC"
}
]
},
{
"doctype": "Item Tax Template",
"title": "_Test Account Excise Duty @ 12",
"company": "_Test Company",
"taxes": [
{
"doctype": "Item Tax Template Detail",
"parentfield": "taxes",
"tax_rate": 12,
"tax_type": "_Test Account Excise Duty - _TC"
}
]
},
{
"doctype": "Item Tax Template",
"title": "_Test Account Excise Duty @ 15",
"company": "_Test Company",
"taxes": [
{
"doctype": "Item Tax Template Detail",
"parentfield": "taxes",
"tax_rate": 15,
"tax_type": "_Test Account Excise Duty - _TC"
}
]
},
{
"doctype": "Item Tax Template",
"title": "_Test Account Excise Duty @ 20",
"company": "_Test Company",
"taxes": [
{
"doctype": "Item Tax Template Detail",
"parentfield": "taxes",
"tax_rate": 20,
"tax_type": "_Test Account Excise Duty - _TC"
}
]
},
{
"doctype": "Item Tax Template",
"title": "_Test Item Tax Template 1",
"company": "_Test Company",
"taxes": [
{
"doctype": "Item Tax Template Detail",
"parentfield": "taxes",
"tax_rate": 5,
"tax_type": "_Test Account Excise Duty - _TC"
},
{
"doctype": "Item Tax Template Detail",
"parentfield": "taxes",
"tax_rate": 10,
"tax_type": "_Test Account Education Cess - _TC"
},
{
"doctype": "Item Tax Template Detail",
"parentfield": "taxes",
"tax_rate": 15,
"tax_type": "_Test Account S&H Education Cess - _TC"
}
]
}
]

View File

@@ -0,0 +1,62 @@
[["Item Tax Template"]]
title = "_Test Account Excise Duty @ 10"
company = "_Test Company"
[["Item Tax Template".taxes]]
doctype = "Item Tax Template Detail"
parentfield = "taxes"
tax_rate = 10
tax_type = "_Test Account Excise Duty - _TC"
[["Item Tax Template"]]
title = "_Test Account Excise Duty @ 12"
company = "_Test Company"
[["Item Tax Template".taxes]]
doctype = "Item Tax Template Detail"
parentfield = "taxes"
tax_rate = 12
tax_type = "_Test Account Excise Duty - _TC"
[["Item Tax Template"]]
title = "_Test Account Excise Duty @ 15"
company = "_Test Company"
[["Item Tax Template".taxes]]
doctype = "Item Tax Template Detail"
parentfield = "taxes"
tax_rate = 15
tax_type = "_Test Account Excise Duty - _TC"
[["Item Tax Template"]]
title = "_Test Account Excise Duty @ 20"
company = "_Test Company"
[["Item Tax Template".taxes]]
doctype = "Item Tax Template Detail"
parentfield = "taxes"
tax_rate = 20
tax_type = "_Test Account Excise Duty - _TC"
[["Item Tax Template"]]
title = "_Test Item Tax Template 1"
company = "_Test Company"
[["Item Tax Template".taxes]]
doctype = "Item Tax Template Detail"
parentfield = "taxes"
tax_rate = 5
tax_type = "_Test Account Excise Duty - _TC"
[["Item Tax Template".taxes]]
doctype = "Item Tax Template Detail"
parentfield = "taxes"
tax_rate = 10
tax_type = "_Test Account Education Cess - _TC"
[["Item Tax Template".taxes]]
doctype = "Item Tax Template Detail"
parentfield = "taxes"
tax_rate = 15
tax_type = "_Test Account S&H Education Cess - _TC"

View File

@@ -360,21 +360,23 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
accounts_add(doc, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn);
row.exchange_rate = 1;
$.each(doc.accounts, function (i, d) {
if (d.account && d.party && d.party_type) {
row.account = d.account;
row.party = d.party;
row.party_type = d.party_type;
row.exchange_rate = d.exchange_rate;
}
});
// set difference
if (doc.difference) {
if (doc.difference > 0) {
row.credit_in_account_currency = doc.difference;
row.credit_in_account_currency = doc.difference / row.exchange_rate;
row.credit = doc.difference;
} else {
row.debit_in_account_currency = -doc.difference;
row.debit_in_account_currency = -doc.difference / row.exchange_rate;
row.debit = -doc.difference;
}
}
@@ -680,6 +682,7 @@ $.extend(erpnext.journal_entry, {
callback: function (r) {
if (r.message) {
$.extend(d, r.message);
erpnext.journal_entry.set_amount_on_last_row(frm, dt, dn);
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, dt, dn);
refresh_field("accounts");
}
@@ -687,4 +690,26 @@ $.extend(erpnext.journal_entry, {
});
}
},
set_amount_on_last_row: function (frm, dt, dn) {
let row = locals[dt][dn];
let length = frm.doc.accounts.length;
if (row.idx != length) return;
let difference = frm.doc.accounts.reduce((total, row) => {
if (row.idx == length) return total;
return total + row.debit - row.credit;
}, 0);
if (difference) {
if (difference > 0) {
row.credit_in_account_currency = difference / row.exchange_rate;
row.credit = difference;
} else {
row.debit_in_account_currency = -difference / row.exchange_rate;
row.debit = -difference;
}
}
refresh_field("accounts");
},
});

View File

@@ -188,6 +188,7 @@ class JournalEntry(AccountsController):
self.validate_cheque_info()
self.check_credit_limit()
self.make_gl_entries()
self.make_advance_payment_ledger_entries()
self.update_advance_paid()
self.update_asset_value()
self.update_inter_company_jv()
@@ -195,6 +196,11 @@ class JournalEntry(AccountsController):
self.update_booked_depreciation()
def on_update_after_submit(self):
# Flag will be set on Reconciliation
# Reconciliation tool will anyways repost ledger entries. So, no need to check and do implicit repost.
if self.flags.get("ignore_reposting_on_reconciliation"):
return
self.needs_repost = self.check_if_fields_updated(fields_to_check=[], child_tables={"accounts": []})
if self.needs_repost:
self.validate_for_repost()
@@ -213,8 +219,10 @@ class JournalEntry(AccountsController):
"Repost Accounting Ledger Items",
"Unreconcile Payment",
"Unreconcile Payment Entries",
"Advance Payment Ledger Entry",
)
self.make_gl_entries(1)
self.make_advance_payment_ledger_entries()
self.update_advance_paid()
self.unlink_advance_entry_reference()
self.unlink_asset_reference()
@@ -257,7 +265,7 @@ class JournalEntry(AccountsController):
frappe.throw(_("Journal Entry type should be set as Depreciation Entry for asset depreciation"))
def validate_stock_accounts(self):
stock_accounts = get_stock_accounts(self.company, self.doctype, self.name)
stock_accounts = get_stock_accounts(self.company, accounts=self.accounts)
for account in stock_accounts:
account_bal, stock_bal, warehouse_list = get_stock_and_account_balance(
account, self.posting_date, self.company
@@ -1668,6 +1676,8 @@ def make_reverse_journal_entry(source_name, target_doc=None):
"debit": "credit",
"credit_in_account_currency": "debit_in_account_currency",
"credit": "debit",
"reference_type": "reference_type",
"reference_name": "reference_name",
},
},
},

View File

@@ -1,11 +1,8 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import unittest
import frappe
from frappe.tests.utils import change_settings
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import flt, nowdate
from erpnext.accounts.doctype.account.test_account import get_inventory_account
@@ -13,25 +10,36 @@ from erpnext.accounts.doctype.journal_entry.journal_entry import StockAccountInv
from erpnext.exceptions import InvalidAccountCurrency
class TestJournalEntry(unittest.TestCase):
@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
class UnitTestJournalEntry(UnitTestCase):
"""
Unit tests for JournalEntry.
Use this class for testing individual functions and methods.
"""
pass
class TestJournalEntry(IntegrationTestCase):
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
def test_journal_entry_with_against_jv(self):
jv_invoice = frappe.copy_doc(test_records[2])
base_jv = frappe.copy_doc(test_records[0])
jv_invoice = frappe.copy_doc(self.globalTestRecords["Journal Entry"][2])
base_jv = frappe.copy_doc(self.globalTestRecords["Journal Entry"][0])
self.jv_against_voucher_testcase(base_jv, jv_invoice)
def test_jv_against_sales_order(self):
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
sales_order = make_sales_order(do_not_save=True)
base_jv = frappe.copy_doc(test_records[0])
base_jv = frappe.copy_doc(self.globalTestRecords["Journal Entry"][0])
self.jv_against_voucher_testcase(base_jv, sales_order)
def test_jv_against_purchase_order(self):
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
purchase_order = create_purchase_order(do_not_save=True)
base_jv = frappe.copy_doc(test_records[1])
base_jv = frappe.copy_doc(self.globalTestRecords["Journal Entry"][1])
self.jv_against_voucher_testcase(base_jv, purchase_order)
def jv_against_voucher_testcase(self, base_jv, test_voucher):
@@ -515,6 +523,72 @@ class TestJournalEntry(unittest.TestCase):
self.assertEqual(row.debit_in_account_currency, 100)
self.assertEqual(row.credit_in_account_currency, 100)
def test_toggle_debit_credit_if_negative(self):
from erpnext.accounts.general_ledger import process_gl_map
# Create JV with defaut cost center - _Test Cost Center
frappe.db.set_single_value("Accounts Settings", "merge_similar_account_heads", 0)
jv = frappe.new_doc("Journal Entry")
jv.posting_date = nowdate()
jv.company = "_Test Company"
jv.user_remark = "test"
jv.extend(
"accounts",
[
{
"account": "_Test Cash - _TC",
"debit": 100 * -1,
"debit_in_account_currency": 100 * -1,
"exchange_rate": 1,
},
{
"account": "_Test Bank - _TC",
"credit": 100 * -1,
"credit_in_account_currency": 100 * -1,
"exchange_rate": 1,
},
],
)
jv.flags.ignore_validate = True
jv.save()
self.assertEqual(len(jv.accounts), 2)
gl_map = jv.build_gl_map()
for row in gl_map:
if row.account == "_Test Cash - _TC":
self.assertEqual(row.debit, 100 * -1)
self.assertEqual(row.debit_in_account_currency, 100 * -1)
self.assertEqual(row.debit_in_transaction_currency, 100 * -1)
gl_map = process_gl_map(gl_map, False)
for row in gl_map:
if row.account == "_Test Cash - _TC":
self.assertEqual(row.credit, 100)
self.assertEqual(row.credit_in_account_currency, 100)
self.assertEqual(row.credit_in_transaction_currency, 100)
def test_transaction_exchange_rate_on_journals(self):
jv = make_journal_entry("_Test Bank - _TC", "_Test Receivable USD - _TC", 100, save=False)
jv.accounts[0].update({"debit_in_account_currency": 8500, "exchange_rate": 1})
jv.accounts[1].update({"party_type": "Customer", "party": "_Test Customer USD", "exchange_rate": 85})
jv.submit()
actual = frappe.db.get_all(
"GL Entry",
filters={"voucher_no": jv.name, "is_cancelled": 0},
fields=["account", "transaction_exchange_rate"],
order_by="account",
)
expected = [
{"account": "_Test Bank - _TC", "transaction_exchange_rate": 1.0},
{"account": "_Test Receivable USD - _TC", "transaction_exchange_rate": 85.0},
]
self.assertEqual(expected, actual)
def make_journal_entry(
account1,
@@ -563,6 +637,3 @@ def make_journal_entry(
jv.submit()
return jv
test_records = frappe.get_test_records("Journal Entry")

View File

@@ -1,94 +0,0 @@
[
{
"cheque_date": "2013-03-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "Debtors - _TC",
"party_type": "Customer",
"party": "_Test Customer",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "_Test Bank - _TC",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
},
{
"cheque_date": "2013-02-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "_Test Payable - _TC",
"party_type": "Supplier",
"party": "_Test Supplier",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "_Test Bank - _TC",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
},
{
"cheque_date": "2013-02-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "Debtors - _TC",
"party_type": "Customer",
"party": "_Test Customer",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "Sales - _TC",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
}
]

View File

@@ -0,0 +1,81 @@
[["Journal Entry"]]
cheque_date = "2013-03-14"
cheque_no = "33"
company = "_Test Company"
naming_series = "_T-Journal Entry-"
posting_date = "2013-02-14"
user_remark = "test"
voucher_type = "Bank Entry"
[["Journal Entry".accounts]]
account = "Debtors - _TC"
party_type = "Customer"
party = "_Test Customer"
credit_in_account_currency = 400.0
debit_in_account_currency = 0.0
doctype = "Journal Entry Account"
parentfield = "accounts"
cost_center = "_Test Cost Center - _TC"
[["Journal Entry".accounts]]
account = "_Test Bank - _TC"
credit_in_account_currency = 0.0
debit_in_account_currency = 400.0
doctype = "Journal Entry Account"
parentfield = "accounts"
cost_center = "_Test Cost Center - _TC"
[["Journal Entry"]]
cheque_date = "2013-02-14"
cheque_no = "33"
company = "_Test Company"
naming_series = "_T-Journal Entry-"
posting_date = "2013-02-14"
user_remark = "test"
voucher_type = "Bank Entry"
[["Journal Entry".accounts]]
account = "_Test Payable - _TC"
party_type = "Supplier"
party = "_Test Supplier"
credit_in_account_currency = 0.0
debit_in_account_currency = 400.0
doctype = "Journal Entry Account"
parentfield = "accounts"
cost_center = "_Test Cost Center - _TC"
[["Journal Entry".accounts]]
account = "_Test Bank - _TC"
credit_in_account_currency = 400.0
debit_in_account_currency = 0.0
doctype = "Journal Entry Account"
parentfield = "accounts"
cost_center = "_Test Cost Center - _TC"
[["Journal Entry"]]
cheque_date = "2013-02-14"
cheque_no = "33"
company = "_Test Company"
naming_series = "_T-Journal Entry-"
posting_date = "2013-02-14"
user_remark = "test"
voucher_type = "Bank Entry"
[["Journal Entry".accounts]]
account = "Debtors - _TC"
party_type = "Customer"
party = "_Test Customer"
credit_in_account_currency = 0.0
debit_in_account_currency = 400.0
doctype = "Journal Entry Account"
parentfield = "accounts"
cost_center = "_Test Cost Center - _TC"
[["Journal Entry".accounts]]
account = "Sales - _TC"
credit_in_account_currency = 400.0
debit_in_account_currency = 0.0
doctype = "Journal Entry Account"
parentfield = "accounts"
cost_center = "_Test Cost Center - _TC"

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestJournalEntryTemplate(unittest.TestCase):
class TestJournalEntryTemplate(IntegrationTestCase):
pass

View File

@@ -3,14 +3,14 @@
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase
from frappe.utils import nowdate
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.accounts.utils import run_ledger_health_checks
class TestLedgerHealth(AccountsTestMixin, FrappeTestCase):
class TestLedgerHealth(AccountsTestMixin, IntegrationTestCase):
def setUp(self):
self.create_company()
self.create_customer()

View File

@@ -2,8 +2,17 @@
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class TestLedgerHealthMonitor(FrappeTestCase):
class UnitTestLedgerHealthMonitor(UnitTestCase):
"""
Unit tests for LedgerHealthMonitor.
Use this class for testing individual functions and methods.
"""
pass
class TestLedgerHealthMonitor(IntegrationTestCase):
pass

View File

@@ -1,14 +1,14 @@
# Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.ledger_merge.ledger_merge import start_merge
class TestLedgerMerge(unittest.TestCase):
class TestLedgerMerge(IntegrationTestCase):
def test_merge_success(self):
if not frappe.db.exists("Account", "Indirect Expenses - _TC"):
acc = frappe.new_doc("Account")

View File

@@ -1,18 +1,19 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import today
from erpnext.accounts.doctype.loyalty_program.test_loyalty_program import create_records
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
class TestLoyaltyPointEntry(unittest.TestCase):
class TestLoyaltyPointEntry(IntegrationTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Create test records
create_records()
cls.loyalty_program_name = "Test Single Loyalty"

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cint, flt, getdate, today
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
@@ -13,9 +13,10 @@ from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
from erpnext.accounts.party import get_dashboard_info
class TestLoyaltyProgram(unittest.TestCase):
class TestLoyaltyProgram(IntegrationTestCase):
@classmethod
def setUpClass(self):
def setUpClass(cls):
super().setUpClass()
# create relevant item, customer, loyalty program, etc
create_records()

View File

@@ -1,10 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
# test_records = frappe.get_test_records('Mode of Payment')
from frappe.tests import IntegrationTestCase
class TestModeofPayment(unittest.TestCase):
class TestModeofPayment(IntegrationTestCase):
pass

View File

@@ -1,13 +1,10 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import unittest
import frappe
test_records = frappe.get_test_records("Monthly Distribution")
from frappe.tests import IntegrationTestCase
class TestMonthlyDistribution(unittest.TestCase):
class TestMonthlyDistribution(IntegrationTestCase):
pass

View File

@@ -1,44 +0,0 @@
[{
"doctype": "Monthly Distribution",
"distribution_id": "_Test Distribution",
"fiscal_year": "_Test Fiscal Year 2013",
"percentages": [
{
"month": "January",
"percentage_allocation": "8"
}, {
"month": "February",
"percentage_allocation": "8"
}, {
"month": "March",
"percentage_allocation": "8"
}, {
"month": "April",
"percentage_allocation": "8"
}, {
"month": "May",
"percentage_allocation": "8"
}, {
"month": "June",
"percentage_allocation": "8"
}, {
"month": "July",
"percentage_allocation": "8"
}, {
"month": "August",
"percentage_allocation": "8"
}, {
"month": "September",
"percentage_allocation": "8"
}, {
"month": "October",
"percentage_allocation": "8"
}, {
"month": "November",
"percentage_allocation": "10"
}, {
"month": "December",
"percentage_allocation": "10"
}
]
}]

View File

@@ -0,0 +1,52 @@
[["Monthly Distribution"]]
distribution_id = "_Test Distribution"
fiscal_year = "_Test Fiscal Year 2013"
[["Monthly Distribution".percentages]]
month = "January"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "February"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "March"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "April"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "May"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "June"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "July"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "August"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "September"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "October"
percentage_allocation = "8"
[["Monthly Distribution".percentages]]
month = "November"
percentage_allocation = "10"
[["Monthly Distribution".percentages]]
month = "December"
percentage_allocation = "10"

View File

@@ -28,7 +28,12 @@ frappe.ui.form.on("Opening Invoice Creation Tool", {
frm.refresh_fields();
frm.page.clear_indicator();
frm.dashboard.hide_progress();
frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
if (frm.doc.invoice_type == "Sales") {
frappe.msgprint(__("Opening Sales Invoices have been created."));
} else {
frappe.msgprint(__("Opening Purchase Invoices have been created."));
}
},
1500,
data.title
@@ -48,12 +53,19 @@ frappe.ui.form.on("Opening Invoice Creation Tool", {
!frm.doc.import_in_progress && frm.trigger("make_dashboard");
frm.page.set_primary_action(__("Create Invoices"), () => {
let btn_primary = frm.page.btn_primary.get(0);
let freeze_message;
if (frm.doc.invoice_type == "Sales") {
freeze_message = __("Creating Sales Invoices ...");
} else {
freeze_message = __("Creating Purchase Invoices ...");
}
return frm.call({
doc: frm.doc,
btn: $(btn_primary),
method: "make_invoices",
freeze: 1,
freeze_message: __("Creating {0} Invoice", [frm.doc.invoice_type]),
freeze_message: freeze_message,
});
});

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import (
create_dimension,
@@ -12,12 +12,21 @@ from erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_crea
get_temporary_opening_account,
)
test_dependencies = ["Customer", "Supplier", "Accounting Dimension"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Customer", "Supplier", "Accounting Dimension"]
class TestOpeningInvoiceCreationTool(FrappeTestCase):
class UnitTestOpeningInvoiceCreationTool(UnitTestCase):
"""
Unit tests for OpeningInvoiceCreationTool.
Use this class for testing individual functions and methods.
"""
pass
class TestOpeningInvoiceCreationTool(IntegrationTestCase):
@classmethod
def setUpClass(self):
def setUpClass(cls):
if not frappe.db.exists("Company", "_Test Opening Invoice Company"):
make_company()
create_dimension()

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestPartyLink(unittest.TestCase):
class TestPartyLink(IntegrationTestCase):
pass

View File

@@ -26,6 +26,10 @@ frappe.ui.form.on("Payment Entry", {
}
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
if (frm.is_new()) {
set_default_party_type(frm);
}
},
setup: function (frm) {
@@ -174,6 +178,21 @@ frappe.ui.form.on("Payment Entry", {
};
});
frm.set_query("payment_request", "references", function (doc, cdt, cdn) {
const row = frappe.get_doc(cdt, cdn);
return {
query: "erpnext.accounts.doctype.payment_request.payment_request.get_open_payment_requests_query",
filters: {
reference_doctype: row.reference_doctype,
reference_name: row.reference_name,
company: doc.company,
status: ["!=", "Paid"],
outstanding_amount: [">", 0], // for compatibility with old data
docstatus: 1,
},
};
});
frm.set_query("sales_taxes_and_charges_template", function () {
return {
filters: {
@@ -191,7 +210,15 @@ frappe.ui.form.on("Payment Entry", {
},
};
});
frm.add_fetch(
"payment_request",
"outstanding_amount",
"payment_request_outstanding",
"Payment Entry Reference"
);
},
refresh: function (frm) {
erpnext.hide_company(frm);
frm.events.hide_unhide_fields(frm);
@@ -216,6 +243,7 @@ frappe.ui.form.on("Payment Entry", {
);
}
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
frappe.flags.allocate_payment_amount = true;
},
validate_company: (frm) => {
@@ -383,9 +411,19 @@ frappe.ui.form.on("Payment Entry", {
},
payment_type: function (frm) {
set_default_party_type(frm);
if (frm.doc.payment_type == "Internal Transfer") {
$.each(
["party", "party_balance", "paid_from", "paid_to", "references", "total_allocated_amount"],
[
"party",
"party_type",
"party_balance",
"paid_from",
"paid_to",
"references",
"total_allocated_amount",
],
function (i, field) {
frm.set_value(field, null);
}
@@ -789,7 +827,7 @@ frappe.ui.form.on("Payment Entry", {
);
if (frm.doc.payment_type == "Pay")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount, 1);
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount, true);
else frm.events.set_unallocated_amount(frm);
frm.set_paid_amount_based_on_received_amount = false;
@@ -810,7 +848,7 @@ frappe.ui.form.on("Payment Entry", {
}
if (frm.doc.payment_type == "Receive")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount, 1);
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount, true);
else frm.events.set_unallocated_amount(frm);
},
@@ -981,6 +1019,7 @@ frappe.ui.form.on("Payment Entry", {
c.outstanding_amount = d.outstanding_amount;
c.bill_no = d.bill_no;
c.payment_term = d.payment_term;
c.payment_term_outstanding = d.payment_term_outstanding;
c.allocated_amount = d.allocated_amount;
c.account = d.account;
@@ -1030,7 +1069,8 @@ frappe.ui.form.on("Payment Entry", {
frm.events.allocate_party_amount_against_ref_docs(
frm,
frm.doc.payment_type == "Receive" ? frm.doc.paid_amount : frm.doc.received_amount
frm.doc.payment_type == "Receive" ? frm.doc.paid_amount : frm.doc.received_amount,
false
);
},
});
@@ -1044,93 +1084,13 @@ frappe.ui.form.on("Payment Entry", {
return ["Sales Invoice", "Purchase Invoice"];
},
allocate_party_amount_against_ref_docs: function (frm, paid_amount, paid_amount_change) {
var total_positive_outstanding_including_order = 0;
var total_negative_outstanding = 0;
var total_deductions = frappe.utils.sum(
$.map(frm.doc.deductions || [], function (d) {
return flt(d.amount);
})
);
paid_amount -= total_deductions;
$.each(frm.doc.references || [], function (i, row) {
if (flt(row.outstanding_amount) > 0)
total_positive_outstanding_including_order += flt(row.outstanding_amount);
else total_negative_outstanding += Math.abs(flt(row.outstanding_amount));
allocate_party_amount_against_ref_docs: async function (frm, paid_amount, paid_amount_change) {
await frm.call("allocate_amount_to_references", {
paid_amount: paid_amount,
paid_amount_change: paid_amount_change,
allocate_payment_amount: frappe.flags.allocate_payment_amount ?? false,
});
var allocated_negative_outstanding = 0;
if (
(frm.doc.payment_type == "Receive" && frm.doc.party_type == "Customer") ||
(frm.doc.payment_type == "Pay" && frm.doc.party_type == "Supplier") ||
(frm.doc.payment_type == "Pay" && frm.doc.party_type == "Employee")
) {
if (total_positive_outstanding_including_order > paid_amount) {
var remaining_outstanding = total_positive_outstanding_including_order - paid_amount;
allocated_negative_outstanding =
total_negative_outstanding < remaining_outstanding
? total_negative_outstanding
: remaining_outstanding;
}
var allocated_positive_outstanding = paid_amount + allocated_negative_outstanding;
} else if (["Customer", "Supplier"].includes(frm.doc.party_type)) {
total_negative_outstanding = flt(total_negative_outstanding, precision("outstanding_amount"));
if (paid_amount > total_negative_outstanding) {
if (total_negative_outstanding == 0) {
frappe.msgprint(
__("Cannot {0} {1} {2} without any negative outstanding invoice", [
frm.doc.payment_type,
frm.doc.party_type == "Customer" ? "to" : "from",
frm.doc.party_type,
])
);
return false;
} else {
frappe.msgprint(
__("Paid Amount cannot be greater than total negative outstanding amount {0}", [
total_negative_outstanding,
])
);
return false;
}
} else {
allocated_positive_outstanding = total_negative_outstanding - paid_amount;
allocated_negative_outstanding =
paid_amount +
(total_positive_outstanding_including_order < allocated_positive_outstanding
? total_positive_outstanding_including_order
: allocated_positive_outstanding);
}
}
$.each(frm.doc.references || [], function (i, row) {
if (frappe.flags.allocate_payment_amount == 0) {
//If allocate payment amount checkbox is unchecked, set zero to allocate amount
row.allocated_amount = 0;
} else if (
frappe.flags.allocate_payment_amount != 0 &&
(!row.allocated_amount || paid_amount_change)
) {
if (row.outstanding_amount > 0 && allocated_positive_outstanding >= 0) {
row.allocated_amount =
row.outstanding_amount >= allocated_positive_outstanding
? allocated_positive_outstanding
: row.outstanding_amount;
allocated_positive_outstanding -= flt(row.allocated_amount);
} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
row.allocated_amount =
Math.abs(row.outstanding_amount) >= allocated_negative_outstanding
? -1 * allocated_negative_outstanding
: row.outstanding_amount;
allocated_negative_outstanding -= Math.abs(flt(row.allocated_amount));
}
}
});
frm.refresh_fields();
frm.events.set_total_allocated_amount(frm);
},
@@ -1678,6 +1638,62 @@ frappe.ui.form.on("Payment Entry", {
return current_tax_amount;
},
cost_center: function (frm) {
if (frm.doc.posting_date && (frm.doc.paid_from || frm.doc.paid_to)) {
return frappe.call({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_party_and_account_balance",
args: {
company: frm.doc.company,
date: frm.doc.posting_date,
paid_from: frm.doc.paid_from,
paid_to: frm.doc.paid_to,
ptype: frm.doc.party_type,
pty: frm.doc.party,
cost_center: frm.doc.cost_center,
},
callback: function (r, rt) {
if (r.message) {
frappe.run_serially([
() => {
frm.set_value(
"paid_from_account_balance",
r.message.paid_from_account_balance
);
frm.set_value("paid_to_account_balance", r.message.paid_to_account_balance);
frm.set_value("party_balance", r.message.party_balance);
},
]);
}
},
});
}
},
after_save: function (frm) {
const { matched_payment_requests } = frappe.last_response;
if (!matched_payment_requests) return;
const COLUMN_LABEL = [
[__("Reference DocType"), __("Reference Name"), __("Allocated Amount"), __("Payment Request")],
];
frappe.msgprint({
title: __("Unset Matched Payment Request"),
message: COLUMN_LABEL.concat(matched_payment_requests),
as_table: true,
wide: true,
primary_action: {
label: __("Allocate Payment Request"),
action() {
frappe.hide_msgprint();
frm.call("set_matched_payment_requests", { matched_payment_requests }, () => {
frm.dirty();
});
},
},
});
},
});
frappe.ui.form.on("Payment Entry Reference", {
@@ -1770,35 +1786,16 @@ frappe.ui.form.on("Payment Entry Deduction", {
frm.events.set_unallocated_amount(frm);
},
});
frappe.ui.form.on("Payment Entry", {
cost_center: function (frm) {
if (frm.doc.posting_date && (frm.doc.paid_from || frm.doc.paid_to)) {
return frappe.call({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_party_and_account_balance",
args: {
company: frm.doc.company,
date: frm.doc.posting_date,
paid_from: frm.doc.paid_from,
paid_to: frm.doc.paid_to,
ptype: frm.doc.party_type,
pty: frm.doc.party,
cost_center: frm.doc.cost_center,
},
callback: function (r, rt) {
if (r.message) {
frappe.run_serially([
() => {
frm.set_value(
"paid_from_account_balance",
r.message.paid_from_account_balance
);
frm.set_value("paid_to_account_balance", r.message.paid_to_account_balance);
frm.set_value("party_balance", r.message.party_balance);
},
]);
}
},
});
}
},
});
function set_default_party_type(frm) {
if (frm.doc.party) return;
let party_type;
if (frm.doc.payment_type == "Receive") {
party_type = "Customer";
} else if (frm.doc.payment_type == "Pay") {
party_type = "Supplier";
}
if (party_type) frm.set_value("party_type", party_type);
}

View File

@@ -7,8 +7,10 @@ from functools import reduce
import frappe
from frappe import ValidationError, _, qb, scrub, throw
from frappe.query_builder import Tuple
from frappe.query_builder.functions import Count
from frappe.utils import cint, comma_or, flt, getdate, nowdate
from frappe.utils.data import comma_and, fmt_money
from frappe.utils.data import comma_and, fmt_money, get_link_to_form
from pypika import Case
from pypika.functions import Coalesce, Sum
@@ -180,14 +182,18 @@ class PaymentEntry(AccountsController):
self.set_status()
self.set_total_in_words()
def before_save(self):
self.set_matched_unset_payment_requests_to_response()
def on_submit(self):
if self.difference_amount:
frappe.throw(_("Difference Amount must be zero"))
self.make_gl_entries()
self.update_outstanding_amounts()
self.update_advance_paid()
self.update_payment_schedule()
self.set_payment_req_status()
self.update_payment_requests()
self.make_advance_payment_ledger_entries()
self.update_advance_paid() # advance_paid_status depends on the payment request amount
self.set_status()
def set_liability_account(self):
@@ -228,9 +234,21 @@ class PaymentEntry(AccountsController):
self.is_opening = "No"
return
liability_account = get_party_account(
self.party_type, self.party, self.company, include_advance=True
)[1]
accounts = get_party_account(self.party_type, self.party, self.company, include_advance=True)
liability_account = accounts[1] if len(accounts) > 1 else None
fieldname = (
"default_advance_received_account"
if self.party_type == "Customer"
else "default_advance_paid_account"
)
if not liability_account:
throw(
_("Please set default {0} in Company {1}").format(
frappe.bold(frappe.get_meta("Company").get_label(fieldname)), frappe.bold(self.company)
)
)
self.set(self.party_account_field, liability_account)
@@ -255,34 +273,40 @@ class PaymentEntry(AccountsController):
"Repost Accounting Ledger Items",
"Unreconcile Payment",
"Unreconcile Payment Entries",
"Advance Payment Ledger Entry",
)
super().on_cancel()
self.make_gl_entries(cancel=1)
self.update_outstanding_amounts()
self.update_advance_paid()
self.delink_advance_entry_references()
self.update_payment_schedule(cancel=1)
self.set_payment_req_status()
self.update_payment_requests(cancel=True)
self.make_advance_payment_ledger_entries()
self.update_advance_paid() # advance_paid_status depends on the payment request amount
self.set_status()
def set_payment_req_status(self):
from erpnext.accounts.doctype.payment_request.payment_request import update_payment_req_status
def update_payment_requests(self, cancel=False):
from erpnext.accounts.doctype.payment_request.payment_request import (
update_payment_requests_as_per_pe_references,
)
update_payment_req_status(self, None)
update_payment_requests_as_per_pe_references(self.references, cancel=cancel)
def update_outstanding_amounts(self):
self.set_missing_ref_details(force=True)
def validate_duplicate_entry(self):
reference_names = []
reference_names = set()
for d in self.get("references"):
if (d.reference_doctype, d.reference_name, d.payment_term) in reference_names:
key = (d.reference_doctype, d.reference_name, d.payment_term, d.payment_request)
if key in reference_names:
frappe.throw(
_("Row #{0}: Duplicate entry in References {1} {2}").format(
d.idx, d.reference_doctype, d.reference_name
)
)
reference_names.append((d.reference_doctype, d.reference_name, d.payment_term))
reference_names.add(key)
def set_bank_account_data(self):
if self.bank_account:
@@ -308,6 +332,8 @@ class PaymentEntry(AccountsController):
if self.payment_type == "Internal Transfer":
return
self.validate_allocated_amount_as_per_payment_request()
if self.party_type in ("Customer", "Supplier"):
self.validate_allocated_amount_with_latest_data()
else:
@@ -320,6 +346,27 @@ class PaymentEntry(AccountsController):
if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(d.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
def validate_allocated_amount_as_per_payment_request(self):
"""
Allocated amount should not be greater than the outstanding amount of the Payment Request.
"""
if not self.references:
return
pr_outstanding_amounts = get_payment_request_outstanding_set_in_references(self.references)
if not pr_outstanding_amounts:
return
for ref in self.references:
if ref.payment_request and ref.allocated_amount > pr_outstanding_amounts[ref.payment_request]:
frappe.throw(
msg=_(
"Row #{0}: Allocated Amount cannot be greater than Outstanding Amount of Payment Request {1}"
).format(ref.idx, get_link_to_form("Payment Request", ref.payment_request)),
title=_("Invalid Allocated Amount"),
)
def term_based_allocation_enabled_for_reference(
self, reference_doctype: str, reference_name: str
) -> bool:
@@ -524,7 +571,10 @@ class PaymentEntry(AccountsController):
continue
if field == "exchange_rate" or not d.get(field) or force:
d.db_set(field, value)
if self.get("_action") in ("submit", "cancel"):
d.db_set(field, value)
else:
d.set(field, value)
def validate_payment_type(self):
if self.payment_type not in ("Receive", "Pay", "Internal Transfer"):
@@ -1193,6 +1243,12 @@ class PaymentEntry(AccountsController):
if self.payment_type in ("Receive", "Pay") and not self.get("party_account_field"):
self.setup_party_account_field()
company_currency = erpnext.get_company_currency(self.company)
if self.paid_from_account_currency != company_currency:
self.currency = self.paid_from_account_currency
elif self.paid_to_account_currency != company_currency:
self.currency = self.paid_to_account_currency
gl_entries = []
self.add_party_gl_entries(gl_entries)
self.add_bank_gl_entries(gl_entries)
@@ -1216,6 +1272,10 @@ class PaymentEntry(AccountsController):
if not self.party_account:
return
advance_payment_doctypes = frappe.get_hooks("advance_payment_receivable_doctypes") + frappe.get_hooks(
"advance_payment_payable_doctypes"
)
if self.payment_type == "Receive":
against_account = self.paid_to
else:
@@ -1261,11 +1321,30 @@ class PaymentEntry(AccountsController):
{
dr_or_cr: allocated_amount_in_company_currency,
dr_or_cr + "_in_account_currency": d.allocated_amount,
"against_voucher_type": d.reference_doctype,
"against_voucher": d.reference_name,
"cost_center": cost_center,
}
)
if self.book_advance_payments_in_separate_party_account:
if d.reference_doctype in advance_payment_doctypes:
# Upon reconciliation, whole ledger will be reposted. So, reference to SO/PO is fine
gle.update(
{
"against_voucher_type": d.reference_doctype,
"against_voucher": d.reference_name,
}
)
else:
# Do not reference Invoices while Advance is in separate party account
gle.update({"against_voucher_type": self.doctype, "against_voucher": self.name})
else:
gle.update(
{
"against_voucher_type": d.reference_doctype,
"against_voucher": d.reference_name,
}
)
gl_entries.append(gle)
if self.unallocated_amount:
@@ -1274,13 +1353,22 @@ class PaymentEntry(AccountsController):
base_unallocated_amount = self.unallocated_amount * exchange_rate
gle = party_gl_dict.copy()
gle.update(
{
dr_or_cr + "_in_account_currency": self.unallocated_amount,
dr_or_cr: base_unallocated_amount,
}
)
gle.update(
self.get_gl_dict(
{
"account": self.party_account,
"party_type": self.party_type,
"party": self.party,
"against": against_account,
"account_currency": self.party_account_currency,
"cost_center": self.cost_center,
dr_or_cr + "_in_account_currency": self.unallocated_amount,
dr_or_cr: base_unallocated_amount,
},
item=self,
)
)
if self.book_advance_payments_in_separate_party_account:
gle.update(
{
@@ -1692,6 +1780,380 @@ class PaymentEntry(AccountsController):
return current_tax_fraction
def set_matched_unset_payment_requests_to_response(self):
"""
Find matched Payment Requests for those references which have no Payment Request set.\n
And set to `frappe.response` to show in the frontend for allocation.
"""
if not self.references:
return
matched_payment_requests = get_matched_payment_request_of_references(
[row for row in self.references if not row.payment_request]
)
if not matched_payment_requests:
return
frappe.response["matched_payment_requests"] = matched_payment_requests
@frappe.whitelist()
def allocate_amount_to_references(self, paid_amount, paid_amount_change, allocate_payment_amount):
"""
Allocate `Allocated Amount` and `Payment Request` against `Reference` based on `Paid Amount` and `Outstanding Amount`.\n
:param paid_amount: Paid Amount / Received Amount.
:param paid_amount_change: Flag to check if `Paid Amount` is changed or not.
:param allocate_payment_amount: Flag to allocate amount or not. (Payment Request is also dependent on this flag)
"""
if not self.references:
return
if not allocate_payment_amount:
for ref in self.references:
ref.allocated_amount = 0
return
# calculating outstanding amounts
precision = self.precision("paid_amount")
total_positive_outstanding_including_order = 0
total_negative_outstanding = 0
paid_amount -= sum(flt(d.amount, precision) for d in self.deductions)
for ref in self.references:
reference_outstanding_amount = ref.outstanding_amount
abs_outstanding_amount = abs(reference_outstanding_amount)
if reference_outstanding_amount > 0:
total_positive_outstanding_including_order += abs_outstanding_amount
else:
total_negative_outstanding += abs_outstanding_amount
# calculating allocated outstanding amounts
allocated_negative_outstanding = 0
allocated_positive_outstanding = 0
# checking party type and payment type
if (self.payment_type == "Receive" and self.party_type == "Customer") or (
self.payment_type == "Pay" and self.party_type in ("Supplier", "Employee")
):
if total_positive_outstanding_including_order > paid_amount:
remaining_outstanding = flt(
total_positive_outstanding_including_order - paid_amount, precision
)
allocated_negative_outstanding = min(remaining_outstanding, total_negative_outstanding)
allocated_positive_outstanding = paid_amount + allocated_negative_outstanding
elif self.party_type in ("Supplier", "Employee"):
if paid_amount > total_negative_outstanding:
if total_negative_outstanding == 0:
frappe.msgprint(
_("Cannot {0} from {1} without any negative outstanding invoice").format(
self.payment_type,
self.party_type,
)
)
else:
frappe.msgprint(
_("Paid Amount cannot be greater than total negative outstanding amount {0}").format(
total_negative_outstanding
)
)
return
else:
allocated_positive_outstanding = flt(total_negative_outstanding - paid_amount, precision)
allocated_negative_outstanding = paid_amount + min(
total_positive_outstanding_including_order, allocated_positive_outstanding
)
# inner function to set `allocated_amount` to those row which have no PR
def _allocation_to_unset_pr_row(
row, outstanding_amount, allocated_positive_outstanding, allocated_negative_outstanding
):
if outstanding_amount > 0 and allocated_positive_outstanding >= 0:
row.allocated_amount = min(allocated_positive_outstanding, outstanding_amount)
allocated_positive_outstanding = flt(
allocated_positive_outstanding - row.allocated_amount, precision
)
elif outstanding_amount < 0 and allocated_negative_outstanding:
row.allocated_amount = min(allocated_negative_outstanding, abs(outstanding_amount)) * -1
allocated_negative_outstanding = flt(
allocated_negative_outstanding - abs(row.allocated_amount), precision
)
return allocated_positive_outstanding, allocated_negative_outstanding
# allocate amount based on `paid_amount` is changed or not
if not paid_amount_change:
for ref in self.references:
allocated_positive_outstanding, allocated_negative_outstanding = _allocation_to_unset_pr_row(
ref,
ref.outstanding_amount,
allocated_positive_outstanding,
allocated_negative_outstanding,
)
allocate_open_payment_requests_to_references(self.references, self.precision("paid_amount"))
else:
payment_request_outstanding_amounts = (
get_payment_request_outstanding_set_in_references(self.references) or {}
)
references_outstanding_amounts = get_references_outstanding_amount(self.references) or {}
remaining_references_allocated_amounts = references_outstanding_amounts.copy()
# Re allocate amount to those references which have PR set (Higher priority)
for ref in self.references:
if not ref.payment_request:
continue
# fetch outstanding_amount of `Reference` (Payment Term) and `Payment Request` to allocate new amount
key = (ref.reference_doctype, ref.reference_name, ref.get("payment_term"))
reference_outstanding_amount = references_outstanding_amounts[key]
pr_outstanding_amount = payment_request_outstanding_amounts[ref.payment_request]
if reference_outstanding_amount > 0 and allocated_positive_outstanding >= 0:
# allocate amount according to outstanding amounts
outstanding_amounts = (
allocated_positive_outstanding,
reference_outstanding_amount,
pr_outstanding_amount,
)
ref.allocated_amount = min(outstanding_amounts)
# update amounts to track allocation
allocated_amount = ref.allocated_amount
allocated_positive_outstanding = flt(
allocated_positive_outstanding - allocated_amount, precision
)
remaining_references_allocated_amounts[key] = flt(
remaining_references_allocated_amounts[key] - allocated_amount, precision
)
payment_request_outstanding_amounts[ref.payment_request] = flt(
payment_request_outstanding_amounts[ref.payment_request] - allocated_amount, precision
)
elif reference_outstanding_amount < 0 and allocated_negative_outstanding:
# allocate amount according to outstanding amounts
outstanding_amounts = (
allocated_negative_outstanding,
abs(reference_outstanding_amount),
pr_outstanding_amount,
)
ref.allocated_amount = min(outstanding_amounts) * -1
# update amounts to track allocation
allocated_amount = abs(ref.allocated_amount)
allocated_negative_outstanding = flt(
allocated_negative_outstanding - allocated_amount, precision
)
remaining_references_allocated_amounts[key] += allocated_amount # negative amount
payment_request_outstanding_amounts[ref.payment_request] = flt(
payment_request_outstanding_amounts[ref.payment_request] - allocated_amount, precision
)
# Re allocate amount to those references which have no PR (Lower priority)
for ref in self.references:
if ref.payment_request:
continue
key = (ref.reference_doctype, ref.reference_name, ref.get("payment_term"))
reference_outstanding_amount = remaining_references_allocated_amounts[key]
allocated_positive_outstanding, allocated_negative_outstanding = _allocation_to_unset_pr_row(
ref,
reference_outstanding_amount,
allocated_positive_outstanding,
allocated_negative_outstanding,
)
@frappe.whitelist()
def set_matched_payment_requests(self, matched_payment_requests):
"""
Set `Payment Request` against `Reference` based on `matched_payment_requests`.\n
:param matched_payment_requests: List of tuple of matched Payment Requests.
---
Example: [(reference_doctype, reference_name, allocated_amount, payment_request), ...]
"""
if not self.references or not matched_payment_requests:
return
if isinstance(matched_payment_requests, str):
matched_payment_requests = json.loads(matched_payment_requests)
# modify matched_payment_requests
# like (reference_doctype, reference_name, allocated_amount): payment_request
payment_requests = {}
for row in matched_payment_requests:
key = tuple(row[:3])
payment_requests[key] = row[3]
for ref in self.references:
if ref.payment_request:
continue
key = (ref.reference_doctype, ref.reference_name, ref.allocated_amount)
if key in payment_requests:
ref.payment_request = payment_requests[key]
del payment_requests[key] # to avoid duplicate allocation
def get_matched_payment_request_of_references(references=None):
"""
Get those `Payment Requests` which are matched with `References`.\n
- Amount must be same.
- Only single `Payment Request` available for this amount.
Example: [(reference_doctype, reference_name, allocated_amount, payment_request), ...]
"""
if not references:
return
# to fetch matched rows
refs = {
(row.reference_doctype, row.reference_name, row.allocated_amount)
for row in references
if row.reference_doctype and row.reference_name and row.allocated_amount
}
if not refs:
return
PR = frappe.qb.DocType("Payment Request")
# query to group by reference_doctype, reference_name, outstanding_amount
subquery = (
frappe.qb.from_(PR)
.select(
PR.reference_doctype,
PR.reference_name,
PR.outstanding_amount.as_("allocated_amount"),
PR.name.as_("payment_request"),
Count("*").as_("count"),
)
.where(Tuple(PR.reference_doctype, PR.reference_name, PR.outstanding_amount).isin(refs))
.where(PR.status != "Paid")
.where(PR.docstatus == 1)
.groupby(PR.reference_doctype, PR.reference_name, PR.outstanding_amount)
)
# query to fetch matched rows which are single
matched_prs = (
frappe.qb.from_(subquery)
.select(
subquery.reference_doctype,
subquery.reference_name,
subquery.allocated_amount,
subquery.payment_request,
)
.where(subquery.count == 1)
.run()
)
return matched_prs if matched_prs else None
def get_references_outstanding_amount(references=None):
"""
Fetch accurate outstanding amount of `References`.\n
- If `Payment Term` is set, then fetch outstanding amount from `Payment Schedule`.
- If `Payment Term` is not set, then fetch outstanding amount from `References` it self.
Example: {(reference_doctype, reference_name, payment_term): outstanding_amount, ...}
"""
if not references:
return
refs_with_payment_term = get_outstanding_of_references_with_payment_term(references) or {}
refs_without_payment_term = get_outstanding_of_references_with_no_payment_term(references) or {}
return {**refs_with_payment_term, **refs_without_payment_term}
def get_outstanding_of_references_with_payment_term(references=None):
"""
Fetch outstanding amount of `References` which have `Payment Term` set.\n
Example: {(reference_doctype, reference_name, payment_term): outstanding_amount, ...}
"""
if not references:
return
refs = {
(row.reference_doctype, row.reference_name, row.payment_term)
for row in references
if row.reference_doctype and row.reference_name and row.payment_term
}
if not refs:
return
PS = frappe.qb.DocType("Payment Schedule")
response = (
frappe.qb.from_(PS)
.select(PS.parenttype, PS.parent, PS.payment_term, PS.outstanding)
.where(Tuple(PS.parenttype, PS.parent, PS.payment_term).isin(refs))
).run(as_dict=True)
if not response:
return
return {(row.parenttype, row.parent, row.payment_term): row.outstanding for row in response}
def get_outstanding_of_references_with_no_payment_term(references):
"""
Fetch outstanding amount of `References` which have no `Payment Term` set.\n
- Fetch outstanding amount from `References` it self.
Note: `None` is used for allocation of `Payment Request`
Example: {(reference_doctype, reference_name, None): outstanding_amount, ...}
"""
if not references:
return
outstanding_amounts = {}
for ref in references:
if ref.payment_term:
continue
key = (ref.reference_doctype, ref.reference_name, None)
if key not in outstanding_amounts:
outstanding_amounts[key] = ref.outstanding_amount
return outstanding_amounts
def get_payment_request_outstanding_set_in_references(references=None):
"""
Fetch outstanding amount of `Payment Request` which are set in `References`.\n
Example: {payment_request: outstanding_amount, ...}
"""
if not references:
return
referenced_payment_requests = {row.payment_request for row in references if row.payment_request}
if not referenced_payment_requests:
return
PR = frappe.qb.DocType("Payment Request")
response = (
frappe.qb.from_(PR)
.select(PR.name, PR.outstanding_amount)
.where(PR.name.isin(referenced_payment_requests))
).run()
return dict(response) if response else None
def validate_inclusive_tax(tax, doc):
def _on_previous_row_error(row_range):
@@ -2144,7 +2606,9 @@ def get_party_details(company, party_type, party, date, cost_center=None):
account_balance = get_balance_on(party_account, date, cost_center=cost_center)
_party_name = "title" if party_type == "Shareholder" else party_type.lower() + "_name"
party_name = frappe.db.get_value(party_type, party, _party_name)
party_balance = get_balance_on(party_type=party_type, party=party, cost_center=cost_center)
party_balance = get_balance_on(
party_type=party_type, party=party, company=company, cost_center=cost_center
)
if party_type in ["Customer", "Supplier"]:
party_bank_account = get_party_bank_account(party_type, party)
bank_account = get_default_company_bank_account(company, party_type, party)
@@ -2323,6 +2787,7 @@ def get_payment_entry(
payment_type=None,
reference_date=None,
ignore_permissions=False,
created_from_payment_request=False,
):
doc = frappe.get_doc(dt, dn)
over_billing_allowance = frappe.db.get_single_value("Accounts Settings", "over_billing_allowance")
@@ -2472,9 +2937,179 @@ def get_payment_entry(
pe.set_difference_amount()
# If PE is created from PR directly, then no need to find open PRs for the references
if not created_from_payment_request:
allocate_open_payment_requests_to_references(pe.references, pe.precision("paid_amount"))
return pe
def get_open_payment_requests_for_references(references=None):
"""
Fetch all unpaid Payment Requests for the references. \n
- Each reference can have multiple Payment Requests. \n
Example: {("Sales Invoice", "SINV-00001"): {"PREQ-00001": 1000, "PREQ-00002": 2000}}
"""
if not references:
return
refs = {
(row.reference_doctype, row.reference_name)
for row in references
if row.reference_doctype and row.reference_name and row.allocated_amount
}
if not refs:
return
PR = frappe.qb.DocType("Payment Request")
response = (
frappe.qb.from_(PR)
.select(PR.name, PR.reference_doctype, PR.reference_name, PR.outstanding_amount)
.where(Tuple(PR.reference_doctype, PR.reference_name).isin(list(refs)))
.where(PR.status != "Paid")
.where(PR.docstatus == 1)
.orderby(Coalesce(PR.transaction_date, PR.creation), order=frappe.qb.asc)
).run(as_dict=True)
if not response:
return
reference_payment_requests = {}
for row in response:
key = (row.reference_doctype, row.reference_name)
if key not in reference_payment_requests:
reference_payment_requests[key] = {row.name: row.outstanding_amount}
else:
reference_payment_requests[key][row.name] = row.outstanding_amount
return reference_payment_requests
def allocate_open_payment_requests_to_references(references=None, precision=None):
"""
Allocate unpaid Payment Requests to the references. \n
---
- Allocation based on below factors
- Reference Allocated Amount
- Reference Outstanding Amount (With Payment Terms or without Payment Terms)
- Reference Payment Request's outstanding amount
---
- Allocation based on below scenarios
- Reference's Allocated Amount == Payment Request's Outstanding Amount
- Allocate the Payment Request to the reference
- This PR will not be allocated further
- Reference's Allocated Amount < Payment Request's Outstanding Amount
- Allocate the Payment Request to the reference
- Reduce the PR's outstanding amount by the allocated amount
- This PR can be allocated further
- Reference's Allocated Amount > Payment Request's Outstanding Amount
- Allocate the Payment Request to the reference
- Reduce Allocated Amount of the reference by the PR's outstanding amount
- Create a new row for the remaining amount until the Allocated Amount is 0
- Allocate PR if available
---
- Note:
- Priority is given to the first Payment Request of respective references.
- Single Reference can have multiple rows.
- With Payment Terms or without Payment Terms
- With Payment Request or without Payment Request
"""
if not references:
return
# get all unpaid payment requests for the references
references_open_payment_requests = get_open_payment_requests_for_references(references)
if not references_open_payment_requests:
return
if not precision:
precision = references[0].precision("allocated_amount")
# to manage new rows
row_number = 1
MOVE_TO_NEXT_ROW = 1
TO_SKIP_NEW_ROW = 2
while row_number <= len(references):
row = references[row_number - 1]
reference_key = (row.reference_doctype, row.reference_name)
# update the idx to maintain the order
row.idx = row_number
# unpaid payment requests for the reference
reference_payment_requests = references_open_payment_requests.get(reference_key)
if not reference_payment_requests:
row_number += MOVE_TO_NEXT_ROW # to move to next reference row
continue
# get the first payment request and its outstanding amount
payment_request, pr_outstanding_amount = next(iter(reference_payment_requests.items()))
allocated_amount = row.allocated_amount
# allocate the payment request to the reference and PR's outstanding amount
row.payment_request = payment_request
if pr_outstanding_amount == allocated_amount:
del reference_payment_requests[payment_request]
row_number += MOVE_TO_NEXT_ROW
elif pr_outstanding_amount > allocated_amount:
# reduce the outstanding amount of the payment request
reference_payment_requests[payment_request] -= allocated_amount
row_number += MOVE_TO_NEXT_ROW
else:
# split the reference row to allocate the remaining amount
del reference_payment_requests[payment_request]
row.allocated_amount = pr_outstanding_amount
allocated_amount = flt(allocated_amount - pr_outstanding_amount, precision)
# set the remaining amount to the next row
while allocated_amount:
# create a new row for the remaining amount
new_row = frappe.copy_doc(row)
references.insert(row_number, new_row)
# get the first payment request and its outstanding amount
payment_request, pr_outstanding_amount = next(
iter(reference_payment_requests.items()), (None, None)
)
# update new row
new_row.idx = row_number + 1
new_row.payment_request = payment_request
new_row.allocated_amount = min(
pr_outstanding_amount if pr_outstanding_amount else allocated_amount, allocated_amount
)
if not payment_request or not pr_outstanding_amount:
row_number += TO_SKIP_NEW_ROW
break
elif pr_outstanding_amount == allocated_amount:
del reference_payment_requests[payment_request]
row_number += TO_SKIP_NEW_ROW
break
elif pr_outstanding_amount > allocated_amount:
reference_payment_requests[payment_request] -= allocated_amount
row_number += TO_SKIP_NEW_ROW
break
else:
allocated_amount = flt(allocated_amount - pr_outstanding_amount, precision)
del reference_payment_requests[payment_request]
row_number += MOVE_TO_NEXT_ROW
def update_accounting_dimensions(pe, doc):
"""
Updates accounting dimensions in Payment Entry based on the accounting dimensions in the reference document

View File

@@ -4,7 +4,7 @@
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, flt, nowdate
from erpnext.accounts.doctype.account.test_account import create_account
@@ -25,10 +25,19 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.setup.doctype.employee.test_employee import make_employee
test_dependencies = ["Item"]
EXTRA_TEST_RECORD_DEPENDENCIES = ["Item", "Currency Exchange"]
class TestPaymentEntry(FrappeTestCase):
class UnitTestPaymentEntry(UnitTestCase):
"""
Unit tests for PaymentEntry.
Use this class for testing individual functions and methods.
"""
pass
class TestPaymentEntry(IntegrationTestCase):
def tearDown(self):
frappe.db.rollback()
@@ -383,7 +392,7 @@ class TestPaymentEntry(FrappeTestCase):
self.assertEqual(si.payment_schedule[0].outstanding, 0)
self.assertEqual(si.payment_schedule[0].discounted_amount, 50)
@change_settings(
@IntegrationTestCase.change_settings(
"Accounts Settings",
{
"allow_multi_currency_invoices_against_single_party_account": 1,
@@ -610,12 +619,9 @@ class TestPaymentEntry(FrappeTestCase):
self.assertEqual(flt(pe.references[0].exchange_gain_loss, 2), -94.74)
def test_payment_entry_retrieves_last_exchange_rate(self):
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import (
save_new_records,
test_records,
)
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import save_new_records
save_new_records(test_records)
save_new_records(self.globalTestRecords["Currency Exchange"])
pe = frappe.new_doc("Payment Entry")
pe.payment_type = "Pay"
@@ -956,6 +962,50 @@ class TestPaymentEntry(FrappeTestCase):
self.assertEqual(flt(expected_party_balance), party_balance)
self.assertEqual(flt(expected_party_account_balance, 2), flt(party_account_balance, 2))
def test_gl_of_multi_currency_payment_transaction(self):
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import save_new_records
save_new_records(self.globalTestRecords["Currency Exchange"])
paid_from = create_account(
parent_account="Current Liabilities - _TC",
account_name="_Test Cash USD",
company="_Test Company",
account_type="Cash",
account_currency="USD",
)
payment_entry = create_payment_entry(
party="_Test Supplier USD",
paid_from=paid_from,
paid_to="_Test Payable USD - _TC",
paid_amount=100,
save=True,
)
payment_entry.source_exchange_rate = 84.4
payment_entry.target_exchange_rate = 84.4
payment_entry.save()
payment_entry = payment_entry.submit()
gle = qb.DocType("GL Entry")
gl_entries = (
qb.from_(gle)
.select(
gle.account,
gle.debit,
gle.credit,
gle.debit_in_account_currency,
gle.credit_in_account_currency,
gle.debit_in_transaction_currency,
gle.credit_in_transaction_currency,
)
.orderby(gle.account)
.where(gle.voucher_no == payment_entry.name)
.run()
)
expected_gl_entries = (
(paid_from, 0.0, 8440.0, 0.0, 100.0, 0.0, 100.0),
("_Test Payable USD - _TC", 8440.0, 0.0, 100.0, 0.0, 100.0, 0.0),
)
self.assertEqual(gl_entries, expected_gl_entries)
def test_multi_currency_payment_entry_with_taxes(self):
payment_entry = create_payment_entry(
party="_Test Supplier USD", paid_to="_Test Payable USD - _TC", save=True
@@ -1090,7 +1140,7 @@ class TestPaymentEntry(FrappeTestCase):
}
self.assertDictEqual(ref_details, expected_response)
@change_settings(
@IntegrationTestCase.change_settings(
"Accounts Settings",
{
"unlink_payment_on_cancellation_of_invoice": 1,
@@ -1185,7 +1235,7 @@ class TestPaymentEntry(FrappeTestCase):
si3.cancel()
si3.delete()
@change_settings(
@IntegrationTestCase.change_settings(
"Accounts Settings",
{
"unlink_payment_on_cancellation_of_invoice": 1,
@@ -1791,6 +1841,79 @@ class TestPaymentEntry(FrappeTestCase):
# 'Is Opening' should always be 'No' for normal advance payments
self.assertEqual(gl_with_opening_set, [])
@IntegrationTestCase.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
def test_delete_linked_exchange_gain_loss_journal(self):
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
)
debtors = create_account(
account_name="Debtors USD",
parent_account="Accounts Receivable - _TC",
company="_Test Company",
account_currency="USD",
account_type="Receivable",
)
# create a customer
customer = make_customer(customer="_Test Party USD")
cust_doc = frappe.get_doc("Customer", customer)
cust_doc.default_currency = "USD"
test_account_details = {
"company": "_Test Company",
"account": debtors,
}
cust_doc.append("accounts", test_account_details)
cust_doc.save()
# create a sales invoice
si = create_sales_invoice(
customer=customer,
currency="USD",
conversion_rate=83.970000000,
debit_to=debtors,
do_not_save=1,
)
si.party_account_currency = "USD"
si.save()
si.submit()
# create a payment entry for the invoice
pe = get_payment_entry("Sales Invoice", si.name)
pe.reference_no = "1"
pe.reference_date = frappe.utils.nowdate()
pe.paid_amount = 100
pe.source_exchange_rate = 90
pe.append(
"deductions",
{
"account": "_Test Exchange Gain/Loss - _TC",
"cost_center": "_Test Cost Center - _TC",
"amount": 2710,
},
)
pe.save()
pe.submit()
# check creation of journal entry
jv = frappe.get_all(
"Journal Entry Account",
{"reference_type": pe.doctype, "reference_name": pe.name, "docstatus": 1},
pluck="parent",
)
self.assertTrue(jv)
# check cancellation of payment entry and journal entry
pe.cancel()
self.assertTrue(pe.docstatus == 2)
self.assertTrue(frappe.db.get_value("Journal Entry", {"name": jv[0]}, "docstatus") == 2)
# check deletion of payment entry and journal entry
pe.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, pe.doctype, pe.name)
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, "Journal Entry", jv[0])
def create_payment_entry(**args):
payment_entry = frappe.new_doc("Payment Entry")

Some files were not shown because too many files have changed in this diff Show More