Compare commits

...

1179 Commits

Author SHA1 Message Date
Ankush Menat
401f276334 perf: Drop cost center index
This was only added to allow renaming for one user (?) can be added if
there's a more serious use case than that.
2025-04-21 22:40:30 +05:30
Ankush Menat
f25524ff95 perf: Drop paty_type + party index
party alone provides almost all of cardinality.

party_type might be separately useful in some cases but I don't see
anything here.
2025-04-21 22:40:30 +05:30
Ankush Menat
34896f1cd1 perf: remove voucher_type + voucher_no index
Voucher_no is real source of cardinality here... voucher_type will just
be 10-20 unique types, not really helping much here.
2025-04-21 22:40:30 +05:30
Ankush Menat
4cbc92649f perf: Only created company indexes in multi-company setups
A vast vast majority of installations don't have multiple companies, so
this unnecessary index is an overhead for them.
2025-04-21 22:40:30 +05:30
Ankush Menat
1b85fbf0e5 perf: Drop party_type index
It's covered by party_type + party index. So this is not required at all.

Party type is also a rarely used as most selective filter => By nature it has very low cardinality.
2025-04-21 22:40:27 +05:30
rohitwaghchaure
a599632f8a Merge pull request #47186 from rohitwaghchaure/fixed-github-47112
fix: disabled UOM showing in the list
2025-04-21 22:12:26 +05:30
Rohit Waghchaure
3745825052 fix: disbaled UOM showing in the list 2025-04-21 21:24:58 +05:30
rohitwaghchaure
5835502937 Merge pull request #47144 from rohitwaghchaure/fixed-bin-recalculate-qty
fix: provision to recalculate the qty in the Bin
2025-04-21 21:18:07 +05:30
Frappe PR Bot
c7e5442565 fix: sync translations from crowdin (#47163) 2025-04-21 17:26:25 +02:00
Diptanil Saha
f3838c0b61 Merge pull request #47182 from diptanilsaha/fix-pos-item-selector-cart-ui
fix: pos item selector cart ui
2025-04-21 18:30:35 +05:30
diptanilsaha
83cf17f07c fix: row gap in item details form 2025-04-21 18:16:45 +05:30
diptanilsaha
52d73de6b6 fix: cart item toggle highlight 2025-04-21 17:57:40 +05:30
ruthra kumar
c5db4ca43a Merge pull request #47179 from frappe/broken_markdown
chore: broken markdown
2025-04-21 17:01:15 +05:30
ruthra kumar
9244ecdaff chore: broken markdown 2025-04-21 16:59:33 +05:30
ruthra kumar
21df80b750 Merge pull request #47106 from yashhhYB/yashhhYB-patch-1
docs(readme): add Frappe School badge for learning ERPNext
2025-04-21 16:41:25 +05:30
Yash Bodade
911c7b969c docs(readme): add Frappe School badge for learning ERPNext
This PR adds a badge linking to [Frappe School](https://frappe.school) to promote learning resources directly from the README. It helps newcomers discover structured tutorials and improves onboarding.

### Changes Made

- Added a Frappe School badge below the title in `README.md`

### Screenshot

[![Learn on Frappe School](https://img.shields.io/badge/Frappe%20School-Learn%20ERPNext-blue?style=flat-square)](https://frappe.school)

---
2025-04-21 16:39:55 +05:30
diptanilsaha
e035120f41 fix: item with no image 2025-04-21 16:17:24 +05:30
ruthra kumar
a7bf999a4f Merge pull request #47019 from Z4nzu/fix_italy_localization
fix(italy): Add tax-related custom fields to POS Invoice Item
2025-04-21 16:08:47 +05:30
ruthra kumar
b9fc173a98 Merge pull request #47067 from ljain112/fix-error-message
fix: correct error message in validate_internal_transfer_qty
2025-04-21 15:57:56 +05:30
diptanilsaha
374da68829 fix: added gap in item details form 2025-04-21 15:53:29 +05:30
diptanilsaha
3e9fc558a8 fix: item images on pos 2025-04-21 15:43:15 +05:30
Diptanil Saha
cb2ad4acdb fix: update country wise fiscal year (#47141) 2025-04-21 14:19:24 +05:30
Diptanil Saha
f52cbf6165 fix: pos disable customer selection at payment (#47169) 2025-04-21 11:53:03 +05:30
Ankush Menat
8b602c4608 chore: translations link (#47168) 2025-04-21 05:54:34 +00:00
Frappe PR Bot
32d5597d23 chore: update POT file (#47165) 2025-04-20 13:45:26 +02:00
Frappe PR Bot
d19b197524 fix: sync translations from crowdin (#47139)
* fix: Chinese Simplified translations

* fix: Thai translations

* fix: Portuguese translations
2025-04-19 21:42:26 +02:00
Rohit Waghchaure
36081413d8 fix: provision to recalculate the qty in the Bin 2025-04-19 16:26:57 +05:30
Sagar Vora
eac96cb186 Merge pull request #47154 from sagarvora/fix-dimension-copying 2025-04-19 12:51:08 +05:30
Sagar Vora
7dbe27da19 fix: respect mapped accounting dimensions 2025-04-19 11:16:48 +05:30
Raffael Meyer
baa0c8bd5f chore: migrate pre-commit config (#47132) 2025-04-17 11:59:48 +00:00
Raffael Meyer
e945b4cc06 fix: create default warehouse (#47125) 2025-04-17 13:17:02 +02:00
ruthra kumar
048997f809 Merge pull request #47118 from aerele/tb-group-by-account
fix: add group by after user permission condition
2025-04-17 16:05:19 +05:30
Frappe PR Bot
e5eafc49ee fix: sync translations from crowdin (#47035) 2025-04-17 11:41:55 +02:00
venkat102
756d496235 fix: add group by after user permission condition 2025-04-17 00:12:43 +05:30
rohitwaghchaure
5d35e31281 Merge pull request #46944 from rohitwaghchaure/fixed-production=plan-lables
fix: production plan label description
2025-04-16 23:17:55 +05:30
Rohit Waghchaure
2de61e955a fix: production plan label description 2025-04-16 23:03:58 +05:30
rohitwaghchaure
659119adc2 Merge pull request #47050 from mihir-kandoi/st35798
fix: consider per_ordered instead of per_billed when creating PO from MR
2025-04-16 16:28:00 +05:30
Shariq Ansari
f4c4a0cc0f Merge pull request #47108 from shariquerik/revert-disable-customer 2025-04-16 10:21:06 +05:30
Shariq Ansari
fc16199a49 revert: disable customer if creating from opportunity 2025-04-16 10:18:29 +05:30
ruthra kumar
0b22f87db9 Merge pull request #46770 from ljain112/fix-dunnig
fix: correct outstanding amount for invoice in dunning
2025-04-15 17:50:25 +05:30
ruthra kumar
7728126b1f Merge pull request #46996 from Sanket322/contact_adress_in_add_column
fix: Allow adding Address/Contact fields to `Address And Contacts` report
2025-04-15 17:45:27 +05:30
rohitwaghchaure
88b5d40202 Merge pull request #46973 from rtdany10/reservation-precision
fix: precision issue on qty_to_be_reserved
2025-04-15 17:36:39 +05:30
ruthra kumar
67600b76e8 Merge pull request #47001 from aerele/inter-company-order-echange-rate
fix: fetch exchange rate while creating inter-company order and invoice
2025-04-15 17:35:58 +05:30
ruthra kumar
39174f9dc0 chore: translatable labels 2025-04-15 17:32:46 +05:30
Marica
445263bb85 Merge pull request #47007 from HUMENTH/patch-2
chore: Fix typo "Item Wise Tax Detail "
2025-04-15 17:01:04 +05:30
Khushi Rawat
e41720f1a3 fix: enabled allow on submit for asset name field (#47093) 2025-04-15 16:59:16 +05:30
marination
be556167b1 fix: Modify .json from desk to change modified 2025-04-15 13:15:50 +02:00
ruthra kumar
573809cece Merge pull request #46951 from cogk/fix-use-party_name-instead-of-customer-in-set_query-of-quotation-items
fix: Use `party_name` instead of `customer` in `set_query` of Quotation items
2025-04-15 15:45:27 +05:30
ruthra kumar
a2b326a988 Merge pull request #46640 from ljain112/fix-ledger-summary
perf: refactored customer ledger summary for performance
2025-04-15 11:52:15 +05:30
ruthra kumar
eb1b401653 Merge pull request #46789 from aerele/order-tax-table
fix: map tax table while creating purchase order from sales order
2025-04-15 11:41:15 +05:30
ruthra kumar
71f0f7a0b5 test: basic supplier ledger summary 2025-04-15 11:37:59 +05:30
ruthra kumar
9a3a80dfd3 test: basic output of customer ledger summary report 2025-04-15 11:37:57 +05:30
ljain112
3b613c44a6 chore: added test for Fetch Overdue Payments in dunning 2025-04-15 11:36:19 +05:30
ruthra kumar
9bae57e2b4 Merge pull request #46754 from muruthigitau/create-payment-gateway-account
feat: add optional company parameter to create_payment_gateway_account
2025-04-15 11:07:49 +05:30
muruthigitau
6608735006 refactor: optional company param to create_payment_gateway_account 2025-04-15 10:55:26 +05:30
Raffael Meyer
fb9cb779f4 test(Payment Entry): account type is set (#47071) 2025-04-14 19:06:25 +02:00
Raffael Meyer
a854beeb40 fix(Payment Entry): set account type if missing (#47069) 2025-04-14 18:32:19 +02:00
ljain112
5063f1174e fix: correct error message in validate_internal_transfer_qty 2025-04-14 19:06:22 +05:30
rohitwaghchaure
e3f1677786 Merge pull request #47057 from rohitwaghchaure/fixed-github-46675
fix: not able to complete work order with reserved qty
2025-04-14 18:08:52 +05:30
rohitwaghchaure
083a666188 Merge pull request #47058 from rohitwaghchaure/fixed-support-36030
fix: consider negative stock qty in stock reconciliation
2025-04-14 18:08:30 +05:30
ruthra kumar
95686fc255 Merge pull request #46782 from iamkhanraheel/fix-customer-payment-autofetch
fix: fetch customer related data in making payment entry from customer
2025-04-14 17:32:49 +05:30
Rohit Waghchaure
15272d0e56 fix: consider negative stock qty in stock reco 2025-04-14 14:37:04 +05:30
Rohit Waghchaure
27d674d54a fix: not able to complete work order with reserved qty 2025-04-14 14:33:51 +05:30
ruthra kumar
46783c1377 Merge pull request #47049 from frappe/revert-46900-fix-against-voucher
Revert "fix: remove against_voucher and against_voucher_type column from General Ledger Report"
2025-04-14 13:18:36 +05:30
ruthra kumar
adb331ef71 fix: revert #46900 - against_voucher filter in general ledger 2025-04-14 13:01:40 +05:30
Mihir Kandoi
5a524854de fix: consider per_ordered instead of per_billed when creating PO from MR 2025-04-14 12:36:59 +05:30
rohitwaghchaure
61a3e01bd3 Merge pull request #46620 from mihir-kandoi/46618
fix: add fetch from to currency and set default to empty in item price
2025-04-14 12:13:07 +05:30
rohitwaghchaure
ea917f946c Merge pull request #46938 from mihir-kandoi/st35392
fix: group sub assemblies in production plan
2025-04-14 12:10:36 +05:30
Mihir Kandoi
8df18762a9 fix: test cases error 2025-04-14 11:09:45 +05:30
Sagar Vora
205443a9e0 Merge pull request #47016 from barredterra/employee-user-perms 2025-04-14 10:27:19 +05:30
Deepesh Garg
acfa2465df Merge pull request #47043 from deepeshgarg007/trial_balance_memory
fix: Group GLs by account for TB generation
2025-04-13 19:26:29 +05:30
barredterra
08f21c7905 fix: remove hook that does nothing 2025-04-13 15:29:38 +02:00
Deepesh Garg
f894c6d275 fix: Group GLs by account for TB generation 2025-04-13 18:53:11 +05:30
Frappe PR Bot
eff2f34048 chore: update POT file (#47042) 2025-04-13 12:35:01 +02:00
ruthra kumar
8ef31c8fc0 Merge pull request #47012 from ljain112/fix-pur-resigister-item
fix: correct doctype in item_wise_purchase register
2025-04-12 07:10:32 +05:30
rohitwaghchaure
b4be1503e3 Merge pull request #47026 from rohitwaghchaure/fixed-removed-unused-code
fix: batchwise valuation for MA item
2025-04-11 21:56:30 +05:30
Rohit Waghchaure
504b8c0a68 fix: batchwise valuation for MA item 2025-04-11 21:20:05 +05:30
Frappe PR Bot
78583ac632 fix: sync translations from crowdin (#47009) 2025-04-11 16:41:50 +02:00
rohitwaghchaure
dc8616d2ab Merge pull request #47022 from rohitwaghchaure/fixed-condition-for-use_batchwise_valuation
fix: condition for use_batchwise_valuation
2025-04-11 19:34:45 +05:30
Mihir Kandoi
a7394329ca fix: test cases 2025-04-11 19:30:35 +05:30
Rohit Waghchaure
cc171d9706 fix: condition for use_batchwise_valuation 2025-04-11 19:17:47 +05:30
rohitwaghchaure
e2a7856a44 Merge pull request #47020 from rohitwaghchaure/fixed-display-depends-on
fix: removed display depends on
2025-04-11 19:14:57 +05:30
Rohit Waghchaure
e0bf45e03b fix: removed display depends on 2025-04-11 18:58:09 +05:30
Hardik Zinzuvadiya
02bb63a5f7 fix(italy): Add missing tax fields to POS Invoice Item 2025-04-11 12:57:25 +00:00
rohitwaghchaure
890040db86 Merge pull request #47015 from rohitwaghchaure/fixed-support-35994-1
fix: allow to use batch-wise valuation for moving average items
2025-04-11 17:07:20 +05:30
Rohit Waghchaure
65ba79bb85 fix: allow to use batchwise valuation for moving average items 2025-04-11 16:48:41 +05:30
barredterra
046bcfa606 fix(Employee): add/delete user permission 2025-04-11 13:14:52 +02:00
Mihir Kandoi
f071255340 fix: logic and added test case 2025-04-11 16:22:28 +05:30
ljain112
b8b8dce733 fix: correct doctype in item_wise_purchase register 2025-04-11 15:06:03 +05:30
Himanshu Shivhare
9624d56abd chore: Fix typo "Item Wise Tax Detail " 2025-04-10 23:18:43 +05:30
rohitwaghchaure
4abc39ef62 Merge pull request #46997 from rohitwaghchaure/fixed-support-35003
fix: update the modified date in for SLEs and GLs after rename
2025-04-10 17:39:35 +05:30
rohitwaghchaure
8b0fd7b00f Merge pull request #47002 from rohitwaghchaure/fixed-support-34140
feat: Allow to Make Quality Inspection after Purchase / Delivery
2025-04-10 17:39:04 +05:30
Rohit Waghchaure
8eaa2afeb7 feat: Allow to Make Quality Inspection after Purchase / Delivery 2025-04-10 16:28:23 +05:30
venkat102
145a6c5e2a fix: fetch exchange rate while creating inter-company order and invoice 2025-04-10 16:07:20 +05:30
Rohit Waghchaure
dc5a5ef258 fix: update the modified date in for SLEs and GLs after rename 2025-04-10 15:53:06 +05:30
Sanket322
d9ca7e755f fix: add Address and Contact in Add Column 2025-04-10 13:03:11 +05:30
rohitwaghchaure
511a01c26c Merge pull request #46965 from rohitwaghchaure/fixed-reposting-error-recreate-ledgers
fix: Recreate Stock Ledgers issue
2025-04-10 11:42:51 +05:30
rohitwaghchaure
2ef8b581cd Merge pull request #46978 from rohitwaghchaure/fixed-support-32497
fix: bypass validation during reposting
2025-04-10 11:42:20 +05:30
Rohit Waghchaure
3697b9fd9b fix: bypass validation during reposting 2025-04-10 11:26:44 +05:30
Frappe PR Bot
8383c826c3 Merge pull request #46963 from frappe/l10n_develop
fix: sync translations from crowdin
2025-04-09 16:47:24 +02:00
Dany Robert
860699ee7b fix: precision issue on qty_to_be_reserved 2025-04-09 18:39:36 +05:30
rohitwaghchaure
358e3581c2 Merge pull request #46972 from rtdany10/reservation-precision
fix: precision loss causing reservation error
2025-04-09 18:09:37 +05:30
Dany Robert
e3c0dbe79f fix: precision loss causing reservation error 2025-04-09 17:38:00 +05:30
Diptanil Saha
67fcc172d7 Merge pull request #46964 from diptanilsaha/pos-profile-add-project-field
fix: added missing project field on pos profile
2025-04-09 15:34:26 +05:30
Marica
2fee4958d7 Merge pull request #46933 from rohitwaghchaure/fixed-support-32029
fix: item code not showing in the error message
2025-04-09 15:32:21 +05:30
Rohit Waghchaure
229a4cef45 fix: Recreate Stock Ledgers issue 2025-04-09 12:37:02 +05:30
diptanilsaha
821d64241a fix: added missing project field on pos profile 2025-04-09 11:37:51 +05:30
Raffael Meyer
147852a5af Merge pull request #46959 from barredterra/refactor-due-date
fix: interaction with due date / payment terms / payment schedule
2025-04-08 21:00:41 +02:00
barredterra
c00f62d54a chore: add context 2025-04-08 20:54:52 +02:00
barredterra
57be8a85d6 fix: clarify confirmation message 2025-04-08 20:53:29 +02:00
barredterra
8a4db69581 fix: use the actual field label 2025-04-08 20:53:04 +02:00
barredterra
c55c77f4e9 fix: recognize trigger from child table 2025-04-08 20:40:50 +02:00
barredterra
87c21a89fe refactor: use doc parameter instead of this.frm.doc 2025-04-08 20:39:14 +02:00
Corentin Forler
a16fd451ee fix: Use party_name instead of customer in Quotation set_query 2025-04-08 15:33:22 +02:00
Raffael Meyer
fa719d8695 fix: make report's "printed on" translatable (#46913)
* fix: make report's "printed on" translatable

* fix: go for lower case "on" because we already have translations for that

* fix: remove redundant letter head

* fix(General Ledger): make table header translatable
2025-04-08 15:22:13 +02:00
barredterra
6dc65f1a19 fix(General Ledger): make table header translatable 2025-04-08 15:19:46 +02:00
barredterra
5837f257bc fix: remove redundant letter head 2025-04-08 15:08:40 +02:00
barredterra
b0d5642785 fix: go for lower case "on" because we already have translations for that 2025-04-08 15:01:21 +02:00
rohitwaghchaure
495428ba4e Merge pull request #46383 from mihir-kandoi/st29657-2
feat: available serial no report
2025-04-08 17:46:12 +05:30
rohitwaghchaure
984bb7c7ea Merge pull request #46942 from mihir-kandoi/st35203
fix: ignore backflush setting on subcontracting return
2025-04-08 17:44:21 +05:30
ruthra kumar
6f89f7e945 Merge pull request #46892 from mihir-kandoi/st35406
fix: use get instead of dot operator to access dict value to prevent no attribute error
2025-04-08 17:03:22 +05:30
Mihir Kandoi
7479e1ec32 fix: ignore backflush setting on subcontracting return 2025-04-08 15:10:42 +05:30
Mihir Kandoi
f58abed935 fix: group sub assemblies in production plan 2025-04-08 15:02:12 +05:30
ruthra kumar
c8d6968a66 Merge pull request #46631 from aerele/fix/update_outstanding_for_self
fix: update outstanding for self
2025-04-08 14:27:13 +05:30
rohitwaghchaure
72846dc64f Merge pull request #46171 from JK-1117/fix-reconciliation-inventory-dimension
Fix validation mismatch in inventory dimension fields
2025-04-08 14:26:25 +05:30
Rohit Waghchaure
86dee69c2f fix: item code not showing in the error message 2025-04-08 13:30:12 +05:30
ruthra kumar
ea8ab256ad Merge pull request #46626 from ljain112/fix-pr-amount
fix: correct payment request amount
2025-04-08 13:18:35 +05:30
ruthra kumar
673e3c7849 Merge pull request #46821 from ljain112/cust-query
fix: removed customer_group query in customer.js
2025-04-08 12:57:02 +05:30
Shariq Ansari
5dfc0d32d6 Merge pull request #46903 from shariquerik/restrict-customer-change
fix: restrict customer change if creating from opportunity
2025-04-08 12:06:10 +05:30
ruthra kumar
c58e7c22f5 Merge pull request #46819 from cogk/fix-fieldtype-unreconcile-dialog
fix: Fix fieldtype in UnReconcile dialog
2025-04-08 11:25:35 +05:30
ruthra kumar
b1051dadd5 Merge pull request #46709 from ljain112/user-permission
fix: user permissions in sales and purchase report
2025-04-08 11:09:54 +05:30
ruthra kumar
49822c553a Merge pull request #46804 from ljain112/fix-os-precision
fix: update outstanding with precision
2025-04-08 09:58:44 +05:30
ruthra kumar
4f758701fe Merge pull request #46917 from frappe/l10n_develop
fix: sync translations from crowdin
2025-04-08 09:55:42 +05:30
Frappe PR Bot
b5d7fe6734 fix: Persian translations 2025-04-08 08:51:17 +05:30
rohitwaghchaure
6ee6d3508a Merge pull request #46893 from rohitwaghchaure/fixed-support-35192
fix: inventory dimensions columns visibility depends on filter
2025-04-08 08:49:33 +05:30
rohitwaghchaure
903ff67a22 Merge pull request #46898 from rohitwaghchaure/fixed-support-33798-1
fix: removed hardcoded search fields to fix performance issue
2025-04-08 08:49:10 +05:30
barredterra
186d7abf0a fix: make report's "printed on" translatable 2025-04-08 02:28:46 +02:00
Diptanil Saha
6fae98afda fix: pos opening entry's status not getting updated on cancel (#46909) 2025-04-07 20:44:47 +05:30
Diptanil Saha
3de1b22480 fix: validate if pos is opened before pos invoice creation (#46907)
* fix: validate if pos is opened before pos invoice creation

* fix: added title on throw dialog

* test: fixed failing test
2025-04-07 20:33:27 +05:30
ruthra kumar
79bd731188 Merge pull request #46895 from ljain112/fix-filter-gl
fix: empty party filter on change of party type in General Ledger Report
2025-04-07 17:42:02 +05:30
Shariq Ansari
dc4819e897 fix: restrict customer change if creating from opportunity 2025-04-07 17:17:42 +05:30
ruthra kumar
274cb898ea Merge pull request #46900 from ljain112/fix-against-voucher
fix: remove against_voucher and against_voucher_type column from General Ledger Report
2025-04-07 17:10:50 +05:30
ljain112
6d1f119a0f fix: remove against_voucher from General Ledger Report 2025-04-07 16:28:52 +05:30
Frappe PR Bot
56eaa504ec fix: sync translations from crowdin (#46872)
* fix: Persian translations

* fix: French translations

* fix: Spanish translations

* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Esperanto translations

* fix: Portuguese, Brazilian translations

* fix: Thai translations

* fix: Croatian translations
2025-04-07 12:13:55 +02:00
Rohit Waghchaure
216bf2456e fix: removed hardcoded search fields to fix performance issue 2025-04-07 14:46:16 +05:30
ruthra kumar
15d632f8de Merge pull request #46728 from rtdany10/inv_date_issue
fix: update posting date before running validations
2025-04-07 14:30:39 +05:30
ljain112
9c68bc22fa fix: empty party filter on change of party type in General Ledger Report. 2025-04-07 14:09:52 +05:30
Rohit Waghchaure
2b411fb7f5 fix: inventory dimensions columns visibility depends on filter 2025-04-07 11:47:27 +05:30
Mihir Kandoi
7fb75f0482 fix: use get instead of dot operator to access dict value 2025-04-07 11:06:19 +05:30
ruthra kumar
7f0af3c667 Merge pull request #46637 from aerele/allocate-payment-term
fix(payment term): allocate payment amount when payment term is fetched from order
2025-04-07 11:03:24 +05:30
ruthra kumar
8759824aa7 Merge pull request #46784 from mohsinalimat/develop
fix: correct mapping(schedule_date) sales order to material request
2025-04-07 10:43:26 +05:30
ruthra kumar
0d72d58860 Merge pull request #46743 from aerele/auto-bank-reconcile
fix: include auto_reconcile_vouchers flag in background job
2025-04-07 10:19:59 +05:30
rohitwaghchaure
9c685c5af0 Merge pull request #46836 from mihir-kandoi/st35124
fix: remove all serial/batch fields when use button is unselected
2025-04-07 10:19:16 +05:30
ruthra kumar
82bf88635c Merge pull request #46727 from aerele/apply_docstatus
fix: use docstatus for status filter
2025-04-07 10:13:00 +05:30
Diptanil Saha
21954b9f9c fix: pos closed dialog on pos closing entry (#46881) 2025-04-06 21:26:14 +05:30
Frappe PR Bot
b4430a14a6 chore: update POT file (#46876) 2025-04-06 13:50:52 +02:00
rohitwaghchaure
5786596fc0 Merge pull request #46845 from rohitwaghchaure/fixed-support-35337
fix: slow query
2025-04-06 16:10:28 +05:30
rohitwaghchaure
c9cc5122dd Merge pull request #46875 from TurkerTunali/patch-13
perf: Stock entry cancel is slow
2025-04-06 16:09:08 +05:30
ruthra kumar
2948a33f40 Merge pull request #46716 from barredterra/dunning-customer-dashboard
feat(Customer): add Dunning to dashboard
2025-04-06 15:50:45 +05:30
ruthra kumar
a55a4efb22 Merge pull request #46658 from SruthysCode/fix_accounts_payable
chore: adjusted dimension placement in Accounts Payable
2025-04-06 15:39:22 +05:30
Türker Tunalı
ddbb44c6a2 perf: Stock entry cancel is slow
Some queries still use "timestamp" function instead of "posting_datetime". In my instance single stock entry cancel ends with request timeout. Using "posting_datetime" field directly improves the situation.

cont: https://github.com/frappe/erpnext/pull/46293
2025-04-06 12:25:42 +03:00
Rohit Waghchaure
f82c8ea5eb fix: slow query 2025-04-06 13:41:14 +05:30
rohitwaghchaure
6fd15abd15 Merge pull request #46853 from rohitwaghchaure/fixed-support-35243
fix: stock entry repack amount calculation
2025-04-06 09:44:59 +05:30
Sagar Vora
4ef5f6a392 Merge pull request #46870 from sagarvora/perf-validate
perf: reduce query when validating any doc
2025-04-05 23:38:30 +05:30
Sagar Vora
b863296e53 perf: reduce query when validating any doc 2025-04-05 23:06:52 +05:30
Raffael Meyer
04df09cfca fix(Dunning): undefined variable (#46868) 2025-04-05 15:19:23 +00:00
Raffael Meyer
e25517a3ce refactor(Payment Entry): reduce indentation (#46864) 2025-04-05 16:41:23 +02:00
Raffael Meyer
7d12e9afd4 fix: make message translatable (#46863) 2025-04-05 15:56:33 +02:00
Frappe PR Bot
27deed6d94 fix: sync translations from crowdin (#46858)
* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Chinese Simplified translations

* fix: Bosnian translations

* fix: Esperanto translations

* fix: Portuguese, Brazilian translations

* fix: Thai translations

* fix: Croatian translations
2025-04-05 12:33:37 +02:00
ruthra kumar
ae1f6912f8 Merge pull request #46625 from Abdeali099/bank-transaction-entries
refactor: Update Bank Transaction `set_query` implemetation
2025-04-05 07:04:26 +05:30
Rohit Waghchaure
544ceb93cd fix: stock entry repack amount calculation 2025-04-04 13:38:45 +05:30
Frappe PR Bot
89f58f7822 fix: sync translations from crowdin (#46849)
* fix: Spanish translations

* fix: French translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Croatian translations
2025-04-04 00:45:09 +02:00
ruthra kumar
4cb6b70048 Merge pull request #46818 from cogk/fix-translate-unreconcile-dialog
fix: Translate UnReconcile dialog title
2025-04-03 06:51:59 +05:30
Md Hussain Nagaria
ef4f662c31 chore: update links to Frappe School (#46823) 2025-04-02 12:15:10 +05:30
rohitwaghchaure
7b5406b940 Merge pull request #46832 from rohitwaghchaure/fixed-support-33851-3
fix: set draft QC in purchase document on creation of qc
2025-04-01 19:46:36 +05:30
ljain112
038355f87b fix: correct function name 2025-04-01 17:43:11 +05:30
ljain112
fca46e0b2d fix: child values for tree doctypes and query refactor 2025-04-01 17:18:01 +05:30
Rohit Waghchaure
2553dea78e fix: set draft QC in purchase document on creation of qc 2025-04-01 15:11:03 +05:30
Mihir Kandoi
22ffdb9e77 fix: remove all serial/batch fields when use button is unselected 2025-04-01 14:15:47 +05:30
rohitwaghchaure
8dae5047c2 Merge pull request #46831 from rohitwaghchaure/fixed-support-35187
fix: current batch qty showing zero in the stock reconciliation
2025-04-01 14:08:54 +05:30
Sagar Vora
db0c5ae48d Merge pull request #46829 from vishakhdesai/gt-diff
fix: use `grand_total_diff` instead of `rounding_adjustment` in `taxes_and_totals`
2025-04-01 13:30:48 +05:30
Rohit Waghchaure
a5c62f8623 fix: current batch qty showing zero in the stock reconciliation 2025-04-01 13:15:06 +05:30
vishakhdesai
fd252da6b1 fix: use grand_total_diff instead of rounding_adjustment in taxes_and_totals 2025-04-01 12:43:34 +05:30
Diptanil Saha
5d5b6acc79 fix: pos checking opened entry closed or not (#46726)
* fix: pos checking opened entry closed or not

* fix: linter issue

* fix: linter issue
2025-04-01 12:40:47 +05:30
Abdeali Chharchhoda
4ae11d4384 chore: formatting 2025-04-01 12:12:37 +05:30
Abdeali Chharchhoda
fb054d4904 Merge branch 'develop' into bank-transaction-entries 2025-04-01 12:12:07 +05:30
rohitwaghchaure
63ef0a5a99 Merge pull request #46808 from rohitwaghchaure/fixed-support-34914
fix: condition to update the last purchase rate
2025-03-31 20:44:28 +05:30
ljain112
f49adfdd98 fix: removed customer_group query in customer.js 2025-03-31 18:06:33 +05:30
Corentin Forler
665645721b fix: Fix fieldtype in UnReconcile dialog 2025-03-31 13:54:51 +02:00
Corentin Forler
f2cfb03c2c fix: Translate UnReconcile dialog title 2025-03-31 13:51:47 +02:00
rohitwaghchaure
c7db13c275 Merge pull request #46815 from rohitwaghchaure/fixed-support-35177
feat: allow UOMs to select for which conversion rate defined in item
2025-03-31 16:22:17 +05:30
Rohit Waghchaure
b1dfbbe85e feat: allow UOMs to select for which converstion rate defined in item master 2025-03-31 15:53:55 +05:30
Vishakh Desai
3a9dca0563 Merge pull request #46812 from vishakhdesai/fix-taxes-and-totals
fix: revert resetting `rounding_adjustment`
2025-03-31 10:23:13 +00:00
Vishakh Desai
f25bf6dbd2 fix: improved rounding adjustment when applying discount (#46720)
* fix: rounding adjustment in apply_discount_amount taxes_and_totals

* refactor: minor changes

* fix: set the rounding difference while calculating tax total in the last tax row and add test case

* fix: failing test case

* fix: made changes in get_total_for_discount_amount in taxes_and_totals

* fix: failing test cases

* fix: changes as per review

* refactor: remove unnecessary use of flt

* refactor: improve logic

* refactor: minor change

* refactor: minor changes

* fix: add a test case for applying discount with previous row total in taxes

* fix: failing test case

* refactor: flatter code, remove `flt` usage for accuracy

---------

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2025-03-31 09:25:09 +00:00
Rohit Waghchaure
bad901e7da fix: condition to update the last puurchase rate 2025-03-31 14:23:47 +05:30
rohitwaghchaure
1e780945e8 Merge pull request #46806 from rohitwaghchaure/fixed-suupport-35020
feat: option to recreate Stock Ledger Entries against stock transactions
2025-03-31 14:13:35 +05:30
Marc Ramser
21b8ad6aa5 feat(regional): Address Template for Germany & Add Switzerland Template (#46737)
* Add Address template for Switzerland

* Fix address template for germany

If an ERPNext instance is set to German and used by a business outside Germany (e.g., in Switzerland or Austria), customer addresses in Germany are displayed in their national format. However, for postal services, the international format (including the country) is required.".

This is just a workaround. IMHO the correct fix would be to check where the company is located and based on that use the national or the international template.
2025-03-31 10:32:36 +02:00
Rohit Waghchaure
218dbd6911 feat: option to recreate Stock Ledger Entries against stock transactions 2025-03-31 13:48:21 +05:30
ljain112
aadda9f606 fix: update outstanding with precision 2025-03-31 12:37:28 +05:30
Vishakh Desai
646cf54679 fix: multiple Bank Reconciliation Tool issues (#46644)
* fix: bank reconciliation tool issue

* refactor: separate Bank Transaction linking from other logic

* fix: delink old pe on update_after_submit in bank transaction

* fix: failing test case fixed

* fix: changes as per review

* refactor: rename `gles` to `gl_entries`

---------

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2025-03-31 05:55:41 +00:00
rohitwaghchaure
9aff191bb1 Merge pull request #46801 from rohitwaghchaure/fixed-ux-for-job-card
fix: UX for partial job card completion
2025-03-30 22:51:30 +05:30
Rohit Waghchaure
8e8a724d82 fix: UX for partial job card completion 2025-03-30 19:01:15 +05:30
Frappe PR Bot
6df932f789 chore: update POT file (#46798) 2025-03-30 13:25:09 +02:00
iamkhanraheel
19279dffea fix: change cur_frm to frm 2025-03-29 16:41:28 +05:30
Sugesh393
a393195866 test: add unit test to validate tax values in Purchase Order from Sales Order 2025-03-29 15:35:01 +05:30
Sugesh393
1e18569be7 fix: map tax table while creating purchase order from sales order 2025-03-29 15:34:22 +05:30
MohsinAli
732e950265 fix: correct mapping(schedule_date) sales order to material request 2025-03-29 11:03:24 +05:30
iamkhanraheel
4284701442 refactor: remove print func 2025-03-29 06:15:22 +05:30
iamkhanraheel
3a4ba0c790 fix: fetch customer related data in making payment entry from customer 2025-03-29 03:59:57 +05:30
rohitwaghchaure
f55e8d1f4a Merge pull request #46777 from rohitwaghchaure/fixed-support-33851-1
fix: incorrect condition
2025-03-28 23:48:07 +05:30
rohitwaghchaure
b93957197e Merge pull request #46775 from rohitwaghchaure/fixed-support-34440
fix: for deadlock issue keep status as In Progress
2025-03-28 23:45:25 +05:30
rohitwaghchaure
dc75a385b7 Merge pull request #46760 from rohitwaghchaure/fixed-support-29324
fix: valuation rate not updating for raw materials
2025-03-28 23:44:42 +05:30
Rohit Waghchaure
0c1a8e9c58 fix: incorrect condition 2025-03-28 23:43:25 +05:30
Abdeali Chharchhodawala
8c9d630ee4 Merge pull request #46683 from Abdeali099/set-employee-contact-details
fix: Set complete contact details for `Employee` in PE
2025-03-28 18:17:47 +05:30
ljain112
c2bdd30e6d fix: correct outstanding amount for invoice in dunning 2025-03-28 13:26:28 +05:30
Rohit Waghchaure
e6ff7f0e9f fix: for deadlock issue keep status as In Progress 2025-03-28 13:10:12 +05:30
Diptanil Saha
45b45efee5 fix: pos button and on hover color (#46762)
* fix: pos button and on hover color

Changed the POS 'New Order' button color to frappe's color scheme and fixed the on hover text color on 'Toggle Recent Orders'

* fix: on hover text unreadable in dark mode
2025-03-28 08:54:51 +05:30
venkat102
7bf1a39861 fix: update payment amount if automatically_fetch_payment_terms is enabled 2025-03-27 22:28:20 +05:30
Rohit Waghchaure
5af8378471 fix: valuation rate not updating for raw materials 2025-03-27 21:32:38 +05:30
Mihir Kandoi
036af54d54 refactor: split and clean execute function to be more readable 2025-03-27 21:10:03 +05:30
Mihir Kandoi
668fdc8f92 fix: remove incorrect default field 2025-03-27 20:56:05 +05:30
ruthra kumar
11800e3cd8 Merge pull request #46719 from ljain112/fix-val-contact
fix: do not use self object for setting party and party type
2025-03-27 11:07:41 +05:30
venkat102
35fbbc2057 fix: include auto_reconcile_vouchers flag in background job 2025-03-27 01:04:38 +05:30
rohitwaghchaure
6275b236ee Merge pull request #46739 from rohitwaghchaure/fixed-support-34851
fix: slow query
2025-03-26 22:08:53 +05:30
Rohit Waghchaure
5ddb36af87 fix: slow query 2025-03-26 21:50:18 +05:30
Frappe PR Bot
d35ae3ef5e fix: sync translations from crowdin (#46738)
* fix: French translations

* fix: Chinese Simplified translations
2025-03-26 16:43:53 +01:00
rohitwaghchaure
b9d70e2ea4 Merge pull request #46732 from rohitwaghchaure/fixed-job-card-hours-issue
fix: not able to set hours manually in job card
2025-03-26 15:54:31 +05:30
rohitwaghchaure
cf2d67f145 Merge pull request #46733 from rohitwaghchaure/fixed-support-34788
fix: decimal values causing incorrect batch picking
2025-03-26 15:42:47 +05:30
Rohit Waghchaure
338b09debb fix: not able to set hours manually in job card 2025-03-26 15:38:44 +05:30
Rohit Waghchaure
7bfe703b04 fix: decimal values causing incorrect batch picking 2025-03-26 15:20:21 +05:30
Mihir Kandoi
26de902496 perf: take query out of loop 2025-03-26 14:39:45 +05:30
rohitwaghchaure
1d8c252ee7 Merge pull request #46710 from rohitwaghchaure/fixed-support-34516
fix: expense account in the stock entry
2025-03-26 11:59:14 +05:30
Dany Robert
d04dbd8ed9 fix: update posting date before running validations 2025-03-26 11:37:35 +05:30
rethik
31e59354c9 fix: use docstatus for status filter 2025-03-26 11:10:08 +05:30
Frappe PR Bot
9d2f9ad4c0 fix: sync translations from crowdin (#46724)
* fix: Swedish translations

* fix: Chinese Simplified translations
2025-03-25 18:21:18 +01:00
ljain112
80b746d4dd fix: do not use self object for setting party and party type 2025-03-25 17:51:41 +05:30
rohitwaghchaure
e2412072d9 Merge pull request #46718 from rohitwaghchaure/fixed-github-46708
fix: disable use multi level BOM for track Semi Finished Goods
2025-03-25 17:29:08 +05:30
Rohit Waghchaure
bf3b0d607f fix: disable use multi level BOM for track Semi Finished Goods 2025-03-25 17:24:48 +05:30
barredterra
638d825d8c feat(Customer): add Dunning to dashboard 2025-03-25 11:12:35 +01:00
ljain112
f4bc1dfd00 fix: user permissions in sales and purchase report 2025-03-25 14:15:24 +05:30
ruthra kumar
435bb1c7b0 Merge pull request #46616 from ljain112/conversion-rate
fix: do not validate if conversion rate is 1 for different currency
2025-03-25 14:11:21 +05:30
Rohit Waghchaure
89569d4b32 fix: expense account in the stock entry 2025-03-25 13:41:27 +05:30
ruthra kumar
a88259591b Merge pull request #46617 from ljain112/fix-ui-sales
refactor: removed redundant message display for each item row cost center update
2025-03-25 12:15:43 +05:30
ruthra kumar
a8ed8b26f1 Merge pull request #46622 from ljain112/feat-pr-acc-repost
feat: repost accounting ledger for purchase receipt
2025-03-25 11:48:33 +05:30
Frappe PR Bot
9af130598a fix: sync translations from crowdin (#46698)
* fix: French translations

* fix: Spanish translations

* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Esperanto translations

* fix: Portuguese, Brazilian translations

* fix: Thai translations

* fix: Croatian translations
2025-03-24 16:54:40 +01:00
Raffael Meyer
eb350012b0 ci: apply label "skip-release-notes" based on PR title (#46694)
Workflow copied from frappe/frappe
2025-03-24 15:22:17 +00:00
Raffael Meyer
70d9db7557 ci: invert language mapping (#46693)
* ci: invert language mapping

* ci: add skip-release-notes on crowdin PRs
2025-03-24 16:17:51 +01:00
barredterra
56a0c4642f ci: add skip-release-notes on crowdin PRs 2025-03-24 16:05:13 +01:00
barredterra
41f2b136d5 ci: invert language mapping 2025-03-24 16:04:17 +01:00
Raffael Meyer
9a8f0f3aef ci: fix language code mapping (#46692)
* ci: fix language code mapping

Keys are expected to be not the locale_with_underscore but the codes according to https://support.crowdin.com/developer/language-codes/

* chore: remove redundant translation files
2025-03-24 13:35:35 +00:00
Sagar Vora
d35a533d8b Merge pull request #46669 from vishakhdesai/bank-clearance-fix
fix: don't filter payment entries on Bank Account in Payment Clearance
2025-03-24 17:49:02 +05:30
ruthra kumar
ea224e131c Merge pull request #46577 from ljain112/jv-ccl
fix: customer credit limit check based on `bypass_credit_limit_check` in Journal Entry
2025-03-24 13:30:42 +05:30
ruthra kumar
8f647b4172 Merge pull request #46574 from ljain112/fix-order-payment-reco
fix: correct invoice order in payment reconcillaiton
2025-03-24 12:23:22 +05:30
ruthra kumar
9c82f4bb0f Merge pull request #46440 from aerele/payable-receivable-report
fix: add base_outstanding and base_paid_amount in payment schedule table
2025-03-24 11:43:57 +05:30
vishakhdesai
fa2fd5bf88 fix: don't filter payment entries on Bank Account in Payment Clearance 2025-03-24 11:23:53 +05:30
ruthra kumar
eda0e2152d Merge pull request #46569 from barredterra/language_map
ci: configure language mapping for crowdin
2025-03-24 10:39:34 +05:30
ruthra kumar
becb53ba5d Merge pull request #46518 from barredterra/so-set-deliver_date
fix(Sales Order): make `set_missing_values` set delivery date in item rows
2025-03-24 10:09:40 +05:30
ruthra kumar
03fde2c039 Merge pull request #46386 from FHenry/dev_whitelist_getchart
feat(accounting/regional): allow chart_of_account.get_chart to be whilelist
2025-03-24 09:59:07 +05:30
Khushi Rawat
eec2e7e833 fix: correct accumulated depreciation calculation for disposed assets (#46660) 2025-03-23 18:38:06 +05:30
Frappe PR Bot
93bd9a40cd chore: update POT file (#46659) 2025-03-23 11:05:00 +01:00
Sruthy
361a55a703 chore: adjusted dimension placement in Accounts Payable 2025-03-23 05:50:03 +00:00
HarryPaulo
b0dccadd26 fix: decimal garbage on variable total (#46621)
* fix: decimal dirty on variable total

* fix: linters

* fix: decimal garbage, code improvement
2025-03-21 14:14:16 +01:00
rohitwaghchaure
d3f8263890 Merge pull request #46642 from rohitwaghchaure/fixed-patch-table-issue
fix: patch
2025-03-21 18:08:17 +05:30
rohitwaghchaure
91c899f3f9 Merge pull request #46641 from rohitwaghchaure/fixed-rename-costing-timeout
perf: timeout while renaming cost center
2025-03-21 18:07:36 +05:30
Md Hussain Nagaria
e0f8e72c4d Merge pull request #46636 from frappe/fix-arg-usage
fix: unwired order_by argument in get_transaction_list
2025-03-21 15:47:25 +05:30
Rohit Waghchaure
e73570910c fix: patch 2025-03-21 15:31:20 +05:30
Rohit Waghchaure
92be7cbbbf perf: timeout while renaming cost center 2025-03-21 15:30:23 +05:30
ljain112
e84e49345a perf: refactored customer ledger summary for performance 2025-03-21 15:18:18 +05:30
venkat102
7785296573 test: validate payment schedule based on invoice amount 2025-03-21 13:18:19 +05:30
venkat102
5618859bd8 fix(payment term): allocate payment amount when payment term is fetched from order 2025-03-21 13:17:32 +05:30
Hussain Nagaria
2c1077d332 fix: unwired order_by argument
* lol on how it was updated from modified in both the places (version 15), but wasn't fixed
2025-03-21 11:38:41 +05:30
Raffael Meyer
2fd1d4d3ab Merge pull request #46627 from mihir-kandoi/date_added_to_wrong_patch
fix: date added to wrong patch
2025-03-20 19:25:05 +01:00
Bhavan23
7b0882600a test: add unit test to validate outstanding amount for update_outstanding_for_self checkbox enabled 2025-03-20 19:20:41 +05:30
Bhavan23
222f1834f1 fix(accounting): update outstanding amount based on update_outstanding_for_self
fix(accounting): against voucher has been already paid show proper message and update update_outstanding_for_self as 1
2025-03-20 19:19:47 +05:30
ljain112
913c60d77b fix: correct payment request amount 2025-03-20 19:10:36 +05:30
Mihir Kandoi
dc45c3b39c fix: date added to wrong patch 2025-03-20 15:55:33 +05:30
Abdeali Chharchhoda
85dd1dd4c7 fix: add Not Cancelled filter for payment_entry in Bank Transaction 2025-03-20 15:19:01 +05:30
Mihir Kandoi
80c17cc005 fix: remove get_items query.run outside of if condition 2025-03-20 15:17:59 +05:30
Abdeali Chharchhoda
257802aeda refactor: move payment_document query to setup 2025-03-20 15:12:06 +05:30
ljain112
b36e356469 feat: repost accounting ledger for purchase receipt 2025-03-20 13:25:53 +05:30
Mihir Kandoi
393434dfd9 fix: add fetch from to currency and set default to empty in item price 2025-03-19 20:32:27 +05:30
ljain112
4376ca5f1d refactor: removed redundant message display for each item row cost center update 2025-03-19 17:20:25 +05:30
ljain112
e8a66d03bc fix: do not validate if conversion rate is 1 for different currency 2025-03-19 16:52:13 +05:30
ruthra kumar
21e22b577a Merge pull request #46591 from ruthra-kumar/revert_to_json_for_test_records
Revert "chore(tests): move to compact, human readable, commentable to…
2025-03-19 16:50:14 +05:30
rohitwaghchaure
f2da369a07 Merge pull request #46608 from mihir-kandoi/st34183
fix: fetch bom_no when updating items in sales order
2025-03-19 15:44:22 +05:30
Mihir Kandoi
386df968c2 fix: remove duplicate 2025-03-19 15:25:50 +05:30
rohitwaghchaure
97debcb27b Merge pull request #46573 from mihir-kandoi/fix_set_landed_cost_based_on_pi
Fix set landed cost based on pi
2025-03-19 15:20:45 +05:30
Marc Ramser
f4aba561ce feat(projects): add option to hide timesheets for project users (#46173)
* feat: add option to hide timesheets for project users

* Added a new "Hide timesheets" checkbox field to Project User doctype that allows to control timesheet visibility for specific users. When enabled, the timesheets section will not be displayed on the project page for that user.

* Update projects.html
2025-03-19 13:34:15 +05:30
rohitwaghchaure
eb7cf2608c Merge pull request #46595 from rohitwaghchaure/fixed-support-34185
fix: not able to make PR against stand alone Debit Note
2025-03-19 13:34:01 +05:30
ruthra kumar
c2cf1d14e6 Merge pull request #46605 from yatridholakia/fix-broken-links
fix: broken Frappe School links
2025-03-19 13:12:43 +05:30
Mihir Kandoi
b3c400f998 fix: take function call outside loop 2025-03-19 13:04:08 +05:30
Mihir Kandoi
508727a57a fix: fetch bom_no when updating items in sales order 2025-03-19 12:52:34 +05:30
ruthra kumar
b1f15358dd Merge pull request #46596 from rohitwaghchaure/fixed-support-32083-2
fix: debit in transaction currency
2025-03-19 11:55:52 +05:30
Yatri Dholakia
343940a9f3 fix: broken Frappe School links 2025-03-19 04:20:20 +00:00
Rohit Waghchaure
e4acf20a62 fix: debit in transaction currency 2025-03-18 21:26:25 +05:30
Rohit Waghchaure
6a52c30591 fix: not able to make PR against stand alone Debit Note 2025-03-18 21:20:40 +05:30
rohitwaghchaure
0985441fc3 Merge pull request #46593 from rohitwaghchaure/fixed-batch-valuation-test-case
test: test case for FIFO batch valuation
2025-03-18 19:19:38 +05:30
Rohit Waghchaure
ad9ac1f058 test: test case for FIFO batch valuation 2025-03-18 18:41:57 +05:30
ruthra kumar
4683e03353 chore: include company in test record 2025-03-18 17:50:44 +05:30
rohitwaghchaure
57d7ac4954 Merge pull request #46588 from rohitwaghchaure/fixed-support-34111
fix: SABB validation for packed items
2025-03-18 17:31:39 +05:30
ruthra kumar
54d96f34f2 Revert "chore(tests): move to compact, human readable, commentable toml layout for test records"
This reverts commit bb917207c2.
2025-03-18 17:27:01 +05:30
rohitwaghchaure
327af0ceac Merge pull request #46579 from rohitwaghchaure/fixed-valuation-for-batch-ma
fix: valuation for moving average with batches
2025-03-18 16:33:36 +05:30
Rohit Waghchaure
3756bf231b fix: SABB validation for packed items 2025-03-18 16:28:31 +05:30
Khushi Rawat
29d77aa19f fix: repost future sle and gle after capitalization (#46576) 2025-03-18 15:59:58 +05:30
rohitwaghchaure
182b4ef266 Merge pull request #46554 from mihir-kandoi/fix_rename_sc_fields
fix: add validation to rename_subcontracting_fields patch
2025-03-18 15:59:09 +05:30
rohitwaghchaure
59f2302b77 Merge pull request #46575 from mihir-kandoi/st34161
fix: fetch quality inspection parameter group
2025-03-18 15:56:18 +05:30
Rohit Waghchaure
cdfbc73f4c fix: valuation for moving average with batches 2025-03-18 15:54:23 +05:30
Smit Vora
1e2f5940fd Merge pull request #46515 from vorasmit/fix-qty-conversion
fix: ensure qty conversion when creating production plan from SO
2025-03-18 14:24:49 +05:30
ljain112
8a84faebed fix: customer credit limit check based on bypass_credit_limit_check in Journal Entry 2025-03-18 14:16:35 +05:30
Mihir Kandoi
0a482c7ea8 fix: fetch quality inspection parameter group 2025-03-18 13:08:48 +05:30
ljain112
5c34a5aaed fix: correct invoice order in payment reconcillaiton 2025-03-18 12:49:29 +05:30
Mihir Kandoi
7e669c0728 fix: patch 2025-03-18 11:43:16 +05:30
Mihir Kandoi
75ab5f2bd0 fix: set landed cost based on purchase invoice rate 2025-03-18 11:22:46 +05:30
ruthra kumar
e1ba08a28d Merge pull request #46566 from ruthra-kumar/correct_account_currency_in_offset_account
fix: set correct currency for offset account gl entries
2025-03-18 11:14:04 +05:30
ruthra kumar
3eaa9bfca4 Merge pull request #46508 from ruthra-kumar/use_base_total_for_uae_report
fix: use base currency total for UAE VAT 201 report
2025-03-18 10:58:58 +05:30
barredterra
c6cfbd7a65 chore: remove redundant translation files 2025-03-17 23:52:34 +01:00
barredterra
efeab38199 ci: configure language mapping for crowdin 2025-03-17 23:42:47 +01:00
ruthra kumar
c32e11e69d fix: set correct currency for offset account gl entries 2025-03-17 20:28:34 +05:30
Ejaaz Khan
dd214fedd8 Merge pull request #46564 from iamejaaz/remove-default-print
refactor: remove default print format from sales invoice
2025-03-17 20:07:07 +05:30
Ejaaz Khan
f10d1f2b1f refactor: remove default print format from sales invoice 2025-03-17 19:34:04 +05:30
ruthra kumar
a70354a0a4 Merge pull request #46563 from frappe/l10n_develop
fix: sync translations from crowdin
2025-03-17 17:08:42 +05:30
Frappe PR Bot
c7ad7eecbb fix: Croatian translations 2025-03-17 16:56:17 +05:30
Frappe PR Bot
4687ba22d4 fix: Bosnian translations 2025-03-17 16:56:04 +05:30
Frappe PR Bot
b25e0bd2b0 fix: Persian translations 2025-03-17 16:55:59 +05:30
Frappe PR Bot
ca1eec355c fix: Swedish translations 2025-03-17 16:55:50 +05:30
Frappe PR Bot
addc26fb2b fix: French translations 2025-03-17 16:55:33 +05:30
ruthra kumar
88ec083e4c Merge pull request #46557 from aerele/transaction-deletion-record
fix(Transaction Deletion Record): sql syntax error while deleting lead address
2025-03-17 16:37:41 +05:30
rohitwaghchaure
798664dfbf Merge pull request #46555 from rohitwaghchaure/fixed-support-33798
fix: performance issue for item list view
2025-03-17 16:36:53 +05:30
rohitwaghchaure
368892a82f Merge pull request #46553 from rohitwaghchaure/fixed-bom-uom
fix: not able to select the item in the BOM
2025-03-17 16:35:19 +05:30
rohitwaghchaure
173a954d8c Merge pull request #46552 from rohitwaghchaure/fixed-support-32083-1
fix: Debit and Credit not equal for Purchase Invoice
2025-03-17 16:34:51 +05:30
venkat102
af0d6eeae8 fix(Transaction Deletion Record): sql syntax error while fetching lead address 2025-03-17 16:13:42 +05:30
ruthra kumar
b666b8bbd4 Merge pull request #46539 from frappe/l10n_develop
fix: sync translations from crowdin
2025-03-17 15:13:45 +05:30
Rohit Waghchaure
d758fde881 fix: performance issue for item list view 2025-03-17 13:48:14 +05:30
Mihir Kandoi
6c3117dc0d fix: add validation to rename_subcontracting_fields patch 2025-03-17 13:11:46 +05:30
Rohit Waghchaure
96d0cd23f1 fix: not able to select the item in the BOM 2025-03-17 13:00:32 +05:30
Rohit Waghchaure
ecb31b7c9f fix: Debit and Credit not equal for Purchase Invoice 2025-03-17 12:57:44 +05:30
Ankush Menat
e47a87839b perf: faster count estimation (#46550)
These count queries themselves take quite a long time. `estimate_count`
uses info_schema stats to guess the time.

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2025-03-17 07:09:21 +00:00
rohitwaghchaure
90b6e00237 Merge pull request #46504 from rohitwaghchaure/fixed-support-33851
fix: dashboard link for QC from PR
2025-03-17 10:06:09 +05:30
Frappe PR Bot
ba50d01f6b fix: Croatian translations 2025-03-16 16:37:39 +05:30
Frappe PR Bot
5c5b29745b fix: Thai translations 2025-03-16 16:37:36 +05:30
Frappe PR Bot
350c4e5d9f fix: Portuguese, Brazilian translations 2025-03-16 16:37:33 +05:30
Frappe PR Bot
b68627240c fix: Esperanto translations 2025-03-16 16:37:31 +05:30
Frappe PR Bot
06732da687 fix: German translations 2025-03-16 16:37:28 +05:30
Frappe PR Bot
3fbbf5a609 fix: Bosnian translations 2025-03-16 16:37:24 +05:30
Frappe PR Bot
0e593fddf4 fix: Persian translations 2025-03-16 16:37:21 +05:30
Frappe PR Bot
a0d50e146e fix: Chinese Simplified translations 2025-03-16 16:37:17 +05:30
Frappe PR Bot
a3f3724fc6 fix: Turkish translations 2025-03-16 16:37:15 +05:30
Frappe PR Bot
0c58b2cf7e fix: Swedish translations 2025-03-16 16:37:12 +05:30
Frappe PR Bot
a536400a0c fix: Russian translations 2025-03-16 16:37:09 +05:30
Frappe PR Bot
825e8325eb fix: Polish translations 2025-03-16 16:37:06 +05:30
Frappe PR Bot
84889718ca fix: Hungarian translations 2025-03-16 16:37:03 +05:30
Frappe PR Bot
a30a5ce645 fix: Arabic translations 2025-03-16 16:37:00 +05:30
Frappe PR Bot
eaa386da2f fix: Spanish translations 2025-03-16 16:36:57 +05:30
Frappe PR Bot
63129cecf3 fix: French translations 2025-03-16 16:36:54 +05:30
Raffael Meyer
43791abdd3 Merge pull request #46545 from frappe/pot_develop_2025-03-16
chore: update POT file
2025-03-16 11:49:00 +01:00
frappe-pr-bot
40a84a3dfb chore: update POT file 2025-03-16 09:34:53 +00:00
Frappe PR Bot
0821a46302 fix: Bosnian translations 2025-03-15 16:33:06 +05:30
Frappe PR Bot
b21a823cc4 fix: Persian translations 2025-03-15 16:33:02 +05:30
Sagar Vora
e5fdbeefc3 Merge pull request #46536 from sagarvora/remove-init
chore: remove unnecessary init method
2025-03-15 11:55:36 +05:30
Sagar Vora
52ef4f38fe chore: remove unnecessary init method 2025-03-15 11:41:40 +05:30
Sagar Vora
dd8956a3cf Merge pull request #46531 from sagarvora/perf/mariadb-2
ci: use `mysqlclient` in tests
2025-03-15 10:01:22 +05:30
Sagar Vora
25623325ce ci: use mysqlclient in tests 2025-03-15 09:48:40 +05:30
Sagar Vora
70aa9e5f50 Merge pull request #46533 from sagarvora/fix-dupl-se
fix: exclude current doc when checking for duplicate
2025-03-15 00:06:33 +05:30
Sagar Vora
d8ef5e4d58 fix: exclude current doc when checking for duplicate 2025-03-14 23:51:30 +05:30
Raffael Meyer
3be570b44a Merge pull request #45924 from PatrickDEissler/develop
fix(Employee): remove User Permissions if create_user_permission is unchecked
2025-03-14 13:57:42 +01:00
Shariq Ansari
3c7583495e Merge pull request #46529 from shariquerik/handle-party-type-erpenxt-crm-integration
fix: also consider CRM Deal as party type for ERPNext CRM Integration
2025-03-14 16:03:03 +05:30
Shariq Ansari
f59620fd55 Merge branch 'develop' into handle-party-type-erpenxt-crm-integration 2025-03-14 16:00:42 +05:30
Shariq Ansari
04edbf7efe fix: also consider CRM Deal as party type for ERPNext CRM Integration 2025-03-14 15:54:03 +05:30
Mihir Kandoi
c7e7da6500 Merge pull request #46513 from mihir-kandoi/46043
fix: get bom_no from sales order item and material request item
2025-03-14 13:05:36 +05:30
Mihir Kandoi
1b560ce949 Merge pull request #46514 from mihir-kandoi/46060
fix: UOM conversion error when creating pick list from material trans…
2025-03-14 12:42:17 +05:30
Mihir Kandoi
8bb2a15732 Merge pull request #46512 from mihir-kandoi/hide_subcontracted_qty_field
fix: hide subcontracted qty field if PO is not subcontracted
2025-03-14 12:41:22 +05:30
ruthra kumar
e80129627a test: report ouput on foreign currency PI 2025-03-14 11:50:16 +05:30
ruthra kumar
229147a434 Merge pull request #46497 from Sanket322/use_party_explicitly
fix: use `party` explicitly instead of party_field
2025-03-14 10:21:35 +05:30
ruthra kumar
784e61e3e9 Merge pull request #46488 from aerele/validate-address-contact-permission
refactor: replace get_list with get_all for dynamic link child access
2025-03-14 09:51:03 +05:30
ruthra kumar
e6a3a19641 Merge pull request #46519 from frappe/l10n_develop
fix: sync translations from crowdin
2025-03-14 09:28:15 +05:30
Frappe PR Bot
3adb9eefd7 fix: Persian translations 2025-03-14 07:17:18 +05:30
barredterra
fc279c85bd fix(Sales Order): make set_missing_values set delivery date in item rows 2025-03-13 18:56:59 +01:00
Mihir Kandoi
8411e2e01f fix: wrong field mapping 2025-03-13 20:19:47 +05:30
Mihir Kandoi
840ea070a9 fix: UOM conversion error when creating pick list from material transfer request 2025-03-13 18:33:39 +05:30
Smit Vora
75882cc81c fix: ensure qty conversion when creating production plan from SO 2025-03-13 18:33:22 +05:30
Mihir Kandoi
ac354505ef fix: get bom_no from sales order item and material request item 2025-03-13 18:11:20 +05:30
Mihir Kandoi
6e8521d761 fix: hide subcontracted qty field if PO is not subcontracted 2025-03-13 17:28:48 +05:30
ruthra kumar
46f4babcd0 fix: use base currency total 2025-03-13 14:23:51 +05:30
Diptanil Saha
0552209310 refactor: print receipt on order complete on pos (#46501) 2025-03-13 14:22:05 +05:30
Rohit Waghchaure
551f89f14b fix: dashboard link for QC from PR 2025-03-13 13:50:25 +05:30
mergify[bot]
378a554ea2 fix: add parenttype condition to payment schedule query in accounts receivable report (backport #46370) 2025-03-13 12:00:29 +05:30
Sanket322
5057e3fe30 fix: use party explicitly 2025-03-13 11:29:20 +05:30
ruthra kumar
6572fba435 Merge pull request #46494 from frappe/l10n_develop
fix: sync translations from crowdin
2025-03-13 08:42:29 +05:30
ruthra kumar
f2a709f953 Merge pull request #46491 from cogk/fix-disable-and-rename-project-template
feat: Allow disabling and renaming Project Template
2025-03-13 08:42:19 +05:30
Frappe PR Bot
0ba9712935 fix: Croatian translations 2025-03-13 06:56:54 +05:30
Frappe PR Bot
cc2ce30bd4 fix: Bosnian translations 2025-03-13 06:56:48 +05:30
Frappe PR Bot
d9662959d2 fix: Persian translations 2025-03-13 06:56:44 +05:30
Sanket Shah
38955af802 fix: using in for lookup in list instead of directly assigning (#46492)
fix: using in for lookup in list instead of assigning

Co-authored-by: Sanket322 <shahsanket322003.com>
2025-03-12 22:37:08 +05:30
Corentin Forler
43303f2cf6 feat: Allow disabling and renaming Project Template 2025-03-12 14:27:44 +01:00
Sugesh393
8f7f0b81f6 refactor: replace get_list with get_all for dynamic link child access 2025-03-12 17:54:39 +05:30
ruthra kumar
95b8355cff Merge pull request #46251 from aerele/fix/bank-reconciliation-timeout
fix(bank-reconciliation): run bank reconciliation as a background job
2025-03-12 17:20:06 +05:30
Sugesh G
f8c659d8d5 fix: pricing rule not ignored in Sales Order (#46248)
* fix: pricing rule not ignored in Sales Order

* test: update parameter do_not_submit to do_not_save
2025-03-12 16:27:48 +05:30
Mihir Kandoi
08c7e8a602 feat: add is_transporter filter to supplier field in purchase invoice… (#46430)
* feat: add is_transporter filter to supplier field in purchase invoice and receipt

* fix: add filter to purchase order as well
2025-03-12 16:24:57 +05:30
Priyansh Shah
d371236684 fix: validations and account type filter for Tax Withholding Category (#46207)
fix: validations and account type filter for tax withholding category
2025-03-12 16:21:12 +05:30
Bhavansathru
ba96c86576 fix(invoice):validate return invoice qty (#46451)
* fix(invoice): validate return quantity when update stock is unchecked

* test: add unit test for validating fully returned invoice quantity
2025-03-12 16:19:24 +05:30
Sugesh G
0bdb81db53 fix: use shipping_address_name for address validation in sales invoice (#46473)
* fix: validate address and contact related to party

* fix: solve unboundlocal error

* refactor: improve variable scope

* refactor: translatable strings

* fix: use shipping_address_name for address validation in sales invoice

* test: add new unit test for address and contact validation

* chore: to avoid keyerror

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-03-12 16:13:35 +05:30
Sudharsanan Ashok
9e808c832f fix: calculate due date based on payment term (#46416) 2025-03-12 16:10:14 +05:30
Mihir Kandoi
41c93c8832 fix: return None if document does not have status field in get_status… (#46415)
* fix: return None if document does not have status field in get_status function

* chore: add comment
2025-03-12 16:05:08 +05:30
Mihir Kandoi
67e9389a02 fix: error when creating delivery note from pick list (#46417) 2025-03-12 15:27:47 +05:30
Mihir Kandoi
5a72edcb82 fix: enable no copy for serial no field (#46381)
* fix: enable no copy for serial no field

* fix: remove no copy from serial no field of purchase receipt item

* fix: remove no copy from serial no field of delivery note item

* Revert "fix: remove no copy from serial no field of purchase receipt item"

This reverts commit 5d1752030b.

---------

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2025-03-12 15:11:55 +05:30
rohitwaghchaure
b6c0448075 Merge pull request #46470 from rohitwaghchaure/fixed-support-33560
fix: do not recalculate qty for batch items during reposting
2025-03-12 12:17:07 +05:30
Frappe PR Bot
b270140e61 fix: sync translations from crowdin (#46435)
* fix: French translations

* fix: Spanish translations

* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Esperanto translations

* fix: Portuguese, Brazilian translations

* fix: Thai translations

* fix: Croatian translations

* fix: Chinese Simplified translations

* fix: Bosnian translations
2025-03-12 10:49:50 +05:30
Rohit Waghchaure
0753c018d2 fix: do not recalculate qty for batch items during reposting 2025-03-12 10:49:21 +05:30
Venkatesh
b72f6f5a3d fix(payment entry): fetch default bank account based on company (#46379) 2025-03-12 10:49:13 +05:30
Diptanil Saha
8ba4ac3b86 fix: credit note creation during pos invoice consolidation (#46277)
* fix: credit note creation during pos invoice consolidation

* fix: added check to skip merging empty list of return pos invoices

* fix: sql query

* fix: using return invoice name instead of return invoice object

* fix: added pos invoice field in sales invoice item
2025-03-12 10:44:21 +05:30
Dany Robert
0a5ca0c35f fix: validate last_gl_update exists before comparing (#46464) 2025-03-12 10:36:50 +05:30
Mihir Kandoi
8bce42e633 fix: rename sla fields patch (#46465)
* fix: rename sla fields patch

* fix: rerun patch
2025-03-12 10:34:20 +05:30
Mihir Kandoi
6f010915fe Merge pull request #46424 from mihir-kandoi/45440
fix: show remaining qty on 'Complete Job' button instead of full qty
2025-03-12 00:30:55 +05:30
Mihir Kandoi
52b76736d3 Merge pull request #46455 from mihir-kandoi/fix_production_analytics
fix: error in production analytics report
2025-03-12 00:29:41 +05:30
Mihir Kandoi
f5d5508035 Merge pull request #46460 from mihir-kandoi/fix_rename_sle_fields_2
fix: rename sla fields patch
2025-03-12 00:26:35 +05:30
Mihir Kandoi
b6c18849c5 fix: rename sla fields patch 2025-03-12 00:03:08 +05:30
rohitwaghchaure
c1a8de9fcd Merge pull request #46452 from mihir-kandoi/fix_sla_fields_patch
fix: sla fields patch
2025-03-11 23:37:10 +05:30
Raffael Meyer
f1398a50e7 Merge pull request #46453 from barredterra/ignore-release-label
ci: ignore PRs labeled with "skip-release-notes" when generating release notes
2025-03-11 17:34:09 +01:00
Mihir Kandoi
03e66468f6 fix: error in production analytics report 2025-03-11 22:02:23 +05:30
barredterra
57007bf937 ci: ignore PRs labeled with "skip-release-notes" when generating release notes 2025-03-11 17:11:35 +01:00
Mihir Kandoi
d653899372 fix: sla fields patch 2025-03-11 21:18:18 +05:30
ruthra kumar
74208a3e06 Merge pull request #46448 from frappe/revert-45958-validate-party-address
Revert "fix: validate address and contact related to party"
2025-03-11 18:12:42 +05:30
ruthra kumar
b81ad55acd Merge pull request #46398 from aerele/coa-name-fix
chore: rename print and stationery account
2025-03-11 17:32:20 +05:30
ruthra kumar
24e4d92202 Revert "Merge pull request #45958 from aerele/validate-party-address"
This reverts commit 18fdd17e94.
2025-03-11 17:30:52 +05:30
ruthra kumar
44835126db Merge pull request #46344 from aerele/e-invoicing-regional-validation
fix: make 'company_tax_id' and 'company_fiscal_code' as mandatory
2025-03-11 17:11:26 +05:30
ruthra kumar
121798ba85 chore: translatable strings 2025-03-11 16:55:04 +05:30
ruthra kumar
a2881b5be0 Merge pull request #45818 from vishakhdesai/set-correct-account-currency-deferred-expense
fix: set correct account currency for deferred expense account
2025-03-11 16:35:19 +05:30
vishakhdesai
398083853c fix: set correct account currency for deferred expence account in PI 2025-03-11 15:33:36 +05:30
Sugesh G
18fdd17e94 Merge pull request #45958 from aerele/validate-party-address
fix: validate address and contact related to party
2025-03-11 14:28:23 +05:30
rohitwaghchaure
9b7e936169 Merge pull request #46436 from rohitwaghchaure/fixed-support-32871-1
fix: filter batches that going to be zero
2025-03-11 13:31:40 +05:30
Sugesh393
7e92e4967a fix: add patch to update base_outstanding and base_paid_amount 2025-03-11 11:52:42 +05:30
Sugesh393
6c2f9a563e fix: add base_outstanding and base_paid_amount in payment schedule table 2025-03-11 11:49:35 +05:30
ruthra kumar
66d5aab8ac Merge pull request #46372 from aerele/update-account-number
fix(account): update account number from parent company
2025-03-11 11:01:08 +05:30
ruthra kumar
9dd801ff3b Merge pull request #46426 from asmitahase/employee-tree
fix: clear cashe on employee hierarchy change
2025-03-11 10:41:46 +05:30
Rohit Waghchaure
aba512c1c6 fix: filter batches that going to be zero 2025-03-11 10:13:34 +05:30
Raffael Meyer
c962b2e97b Merge pull request #45955 from barredterra/buying-translatability
refactor: improve translatability in buying controller
2025-03-11 02:07:12 +01:00
Raffael Meyer
5caef24335 chore: fix file naming for Crowdin integration (#46434) 2025-03-11 01:03:56 +00:00
rohitwaghchaure
7a584d3228 Merge pull request #46427 from frappe/mergify/bp/develop/pr-46414
fix: not able to save work order with alternative item (backport #46414)
2025-03-10 23:14:05 +05:30
Frappe PR Bot
04e9134016 fix: sync translations from crowdin (#46394)
* fix: Croatian translations

* fix: Bosnian translations

* fix: Croatian translations

* fix: French translations

* fix: Spanish translations

* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Esperanto translations

* fix: Portuguese, Brazilian translations

* fix: Thai translations

* fix: Croatian translations
2025-03-10 13:43:58 +01:00
Rohit Waghchaure
ac7fc608aa fix: not able to save work order with alternative item
(cherry picked from commit 6ca1f9bc73)
2025-03-10 12:10:54 +00:00
Asmita Hase
6789578b27 fix: clear cashe on employee hierarchy change to reflect updated permissions 2025-03-10 17:06:03 +05:30
ruthra kumar
3376f37012 Merge pull request #46423 from frappe/revert-46172-credit_note_column
Revert "fix: Show Credit Note amount in credit note column"
2025-03-10 16:56:31 +05:30
ruthra kumar
9aacd90633 Merge pull request #46407 from mahsem/typo_sales_invoice_print
fix: typo in sales_invoice_print
2025-03-10 16:47:27 +05:30
Mihir Kandoi
db93302a53 fix: show remaining qty on 'Complete Job' button instead of full qty 2025-03-10 16:44:16 +05:30
Akhil Narang
f9cac1c186 fix(README): recommend using .localhost instead of .dev (#46422)
All `.dev` domains have HSTS enforced by default and so require SSL to access.

`.localhost` hosts automatically resolve without requiring edits to hosts files

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-03-10 16:27:01 +05:30
ruthra kumar
5a9767ca67 Revert "fix: Show Credit Note amount in credit note column" 2025-03-10 16:24:43 +05:30
rohitwaghchaure
9026b67333 Merge pull request #46418 from rohitwaghchaure/fixed-support-33273
fix: stock balance in and out value
2025-03-10 15:34:45 +05:30
Rohit Waghchaure
e917bd5334 fix: stock balance in and out value 2025-03-10 14:44:29 +05:30
ruthra kumar
98690c42b0 Merge pull request #46412 from ruthra-kumar/revert_mergify_and_lock_thread_changes
ci: re-enable label backports and decrease lock frequency
2025-03-10 08:47:05 +05:30
ruthra kumar
97733c8974 ci: re-enable label backports and decrease lock frequency 2025-03-10 08:31:22 +05:30
Frappe PR Bot
0afcf59ba1 chore: update POT file (#46406) 2025-03-09 11:50:11 +01:00
mahsem
f7bcae83e4 fix: typo in sales_invoice_print 2025-03-09 11:11:54 +01:00
rohitwaghchaure
0bd80f98a8 Merge pull request #46395 from mihir-kandoi/st33499
fix: consider account freeze date in recalculate_amount_difference_fi…
2025-03-08 20:20:52 +05:30
ruthra kumar
262798e319 Merge pull request #46401 from ruthra-kumar/fix_typo
chore: fix typo
2025-03-08 15:11:00 +05:30
ruthra kumar
a4c913a794 chore: fix typo 2025-03-08 14:54:11 +05:30
ruthra kumar
60379241d8 Merge pull request #46400 from ruthra-kumar/lock_frequently
ci: increase conversion lock frequency
2025-03-08 14:40:02 +05:30
ruthra kumar
ab8134aec6 ci: lock frequently 2025-03-08 14:21:11 +05:30
ruthra kumar
eca5a8e6ab Merge pull request #46399 from ruthra-kumar/temp_disable_label_backports
ci: temporarily disable label based backports
2025-03-08 13:37:06 +05:30
ruthra kumar
d2732e376c ci: temporarily disable label based backports 2025-03-08 13:20:44 +05:30
chethank1407
615997b774 chore: rename print and stationery account 2025-03-08 13:04:50 +05:30
ruthra kumar
f5d061d2dd Merge pull request #46064 from ruthra-kumar/transaction_currency_from_parent_document
fix: Debit and Credit mismatch on transaction currency debit and credit values
2025-03-08 12:05:13 +05:30
ruthra kumar
f1d8feec15 refactor: internal transfer gl 2025-03-08 11:45:12 +05:30
Mihir Kandoi
cd72532789 fix: consider stock freeze date in recalculate_amount_difference_field patch 2025-03-08 11:38:28 +05:30
Mihir Kandoi
696f931678 fix: consider account freeze date in recalculate_amount_difference_field patch 2025-03-08 11:31:33 +05:30
ruthra kumar
55d0636123 test: assert total debit and credit for trx currency 2025-03-08 09:35:08 +05:30
ruthra kumar
455a55b2ce refactor: handle rounding diff for trx currency dr and cr 2025-03-08 09:35:08 +05:30
ruthra kumar
4cd3f3531c refactor: trx currency dr and cr for tax rows and item rows 2025-03-08 09:35:08 +05:30
ruthra kumar
7528ef147a refactor: convert tax amount using exchange rate 2025-03-08 09:35:08 +05:30
ruthra kumar
6545467aec fix: incorrect category in list 2025-03-08 09:35:08 +05:30
ruthra kumar
bc792c61e9 chore: typo 2025-03-08 09:35:08 +05:30
ruthra kumar
b348aa3b37 refactor: isolate to specific doctypes 2025-03-08 09:35:08 +05:30
ruthra kumar
23d465805b refactor(test): save first to let the tax table populate 2025-03-08 09:35:08 +05:30
ruthra kumar
a31770d122 fix(test): incorrect transaction exchange rate in test case 2025-03-08 09:35:08 +05:30
ruthra kumar
ceca5b4c72 refactor: set transaction currency and rate before gl map 2025-03-08 09:35:08 +05:30
ruthra kumar
5c86e3ce85 refactor: handle payment entry 2025-03-08 09:35:08 +05:30
ruthra kumar
9f3847c0f8 refactor: handle Journal entries 2025-03-08 09:35:08 +05:30
ruthra kumar
d1d06885dc refactor: move utility method to controller 2025-03-08 09:35:08 +05:30
ruthra kumar
3e292ef2cb refactor: set transaction currency dr/cr in sales invoice 2025-03-08 09:35:08 +05:30
ruthra kumar
ee93ed8c97 refactor: handle stocked items 2025-03-08 09:35:08 +05:30
ruthra kumar
7ff3977394 refactor: handle stocked items 2025-03-08 09:35:08 +05:30
ruthra kumar
e9af567033 refactor: set tr currency dr & cr directly on parent document 2025-03-08 09:35:08 +05:30
ruthra kumar
b115bf2e2a refactor: use highest precision for storing exc rate 2025-03-08 09:35:08 +05:30
ruthra kumar
f5f138ef9d Merge pull request #46393 from ruthra-kumar/fix_error_on_internal_transfer_po_so
fix: attribute error on internal so and po
2025-03-08 09:30:14 +05:30
ruthra kumar
f585fd6b88 fix: attribute error on internal so and po 2025-03-08 09:14:36 +05:30
Florian HENRY
49dcd96909 feat(accounting): allow chart_of_account.get_chart to be whilelist 2025-03-07 12:29:51 +01:00
Mihir Kandoi
501f07803e refactor: import functions in new report instead of redundant code 2025-03-07 12:05:31 +05:30
Mihir Kandoi
5592d8e87f feat: available serial no report 2025-03-07 11:54:15 +05:30
maasanto
faa340c8b5 feat: Add first and last name fields to quick entry customer creation (#46281)
* feat: Add First and Last Name Fields to Quick Entry Customer Creation Form

* fix: added first and last_name fields to customer dt

* chore: linter issues

* chore: linter issue

* chore: linter issue

---------

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2025-03-07 10:31:45 +05:30
Mihir Kandoi
98111dac17 Merge pull request #46374 from mihir-kandoi/33265
fix: rare precision issue preventing submission of subcontracting order
2025-03-06 22:15:18 +05:30
Mihir Kandoi
33b71544db fix: rare precision issue preventing submission of subcontracting order 2025-03-06 20:58:08 +05:30
venkat102
4a4894bc01 fix(account): update account number from parent company 2025-03-06 18:33:53 +05:30
mergify[bot]
18832c057c fix: auto email report creation (backport #46343) (#46364)
fix: auto email report creation (#46343)

* fix(financial_statements): mandatory based on filter_based_on value

* fix(financial_statements.js): include options for multiselect

(cherry picked from commit 5cc251a172)

Co-authored-by: Justine Jay <jjaycaneza@gmail.com>
2025-03-06 18:12:42 +05:30
Bhavansathru
7b6ebad9e6 fix: validate accounting dimension company in Journal Entry & Stock Entry (#46204)
* fix: validate accounting dimension company in journal entry and stock entry

* test: update test cases to validate company-based accounting dimension

* fix(test): ensure 'Pick List' company matches 'Delivery Note' to prevent test failures

* chore: remove redundant lines of code
2025-03-06 17:51:20 +05:30
Ninad Parikh
d01367eefe fix: base_net_rate Required to Check Valid Range (#46332)
fix: base_net_rate required to check valid range
2025-03-06 17:34:25 +05:30
ruthra kumar
ba2f887be9 Merge pull request #46363 from ruthra-kumar/incorrect_yaml_format
ci: fix incorrect yaml format
2025-03-06 17:33:09 +05:30
Sanket Shah
606dcb0ad1 fix: change fieldname for cash_flow to export (#46353)
fix: change fieldname for cash_flow

Co-authored-by: Sanket322 <shahsanket322003.com>
2025-03-06 17:20:12 +05:30
Shariq Ansari
884709deb8 fix: Allow rename prospect doctype (#46352)
fix: allow rename prospect doctype
2025-03-06 17:19:14 +05:30
ruthra kumar
81d460e4bd ci: fix incorrect yaml format 2025-03-06 17:17:37 +05:30
ruthra kumar
87e7f0f4d7 Merge pull request #46349 from frappe/l10n_develop
fix: sync translations from crowdin
2025-03-06 17:04:28 +05:30
rohitwaghchaure
2e207d651d Merge pull request #46354 from mihir-kandoi/46351
fix: recalculate_amount_difference_field patch
2025-03-06 13:27:43 +05:30
rohitwaghchaure
93779c88d2 Merge pull request #46355 from mihir-kandoi/46348
fix: rename_sla_fields patch
2025-03-06 13:18:01 +05:30
Mihir Kandoi
95d1976931 fix: check if set_landed_cost_based_on_purchase_invoice_rate is enabled before running patch 2025-03-06 13:11:31 +05:30
Mihir Kandoi
0492b941ff fix: recalculate_amount_difference_field patch 2025-03-06 12:58:53 +05:30
Mihir Kandoi
e8d4a487c6 fix: rename_sla_fields patch 2025-03-06 12:57:27 +05:30
Frappe PR Bot
40c92b0988 fix: Bosnian translations 2025-03-06 09:53:15 +05:30
rohitwaghchaure
137090ca77 Merge pull request #46339 from rohitwaghchaure/fixed-report-incorrect-sabb
fix: doctype name
2025-03-05 21:16:49 +05:30
Bhavan23
abd044eb0d fix: make 'company_tax_id' and 'company_fiscal_code' as mandatory 2025-03-05 20:09:21 +05:30
Rohit Waghchaure
d039310d80 fix: doctype name 2025-03-05 18:07:17 +05:30
Ejaaz Khan
38aa7cab8a feat: create sales invoice print format (#45403)
* feat: create sales invoice print format

* fix: linter issue

* style: remove border from table

* refactor: change label to uppercase and show taxes

* refactor: format date and add translation on label

* refactor: remove default header and format labels

* refactor: change label style and small fix

* chore: Qty in title case

---------

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2025-03-05 12:36:59 +00:00
Sugesh G
8caf7f275e fix(pos): get parent item group without user permission (#46020)
* fix(pos): get parent item group without user permission

* feat: add item group filter based on user permission

---------

Co-authored-by: venkat102 <venkatesharunachalam659@gmail.com>
2025-03-05 18:06:42 +05:30
Diptanil Saha
35512d40bb fix: replacing serial and batch bundle on pos with auto fetch serial nos (#46236)
* fix: replacing serial and batch bundle on pos with auto fetch serial nos

* fix: reserved serial no

added a check to look for serial no in reserved serial nos list before removing it as there might be a situation where an item is returned which was already consolidated.
2025-03-05 17:41:43 +05:30
Khushi Rawat
f50d479bfd fix: exclude already consumed purchase receipt items from asset capitalization (#46329)
* feat: link purchase receipt row item to capitalization

* fix: avoid fetching already consumed stock and asset items during capitalization

* fix(patch): added patch to link purchase receipt item to stock item child table

* fix: added nosemgrep

* refactor: rename  to
2025-03-05 17:39:24 +05:30
rohitwaghchaure
cb004709ff Merge pull request #46330 from rohitwaghchaure/fixed-support-33209
fix: Accounting Period validation throwing for different companies
2025-03-05 16:40:07 +05:30
Prateek Karamchandani
4f559b6df2 fix: allow variant uom to differ from template uom (#45850) 2025-03-05 16:37:42 +05:30
Mihir Kandoi
58ed697ba5 fix: uom reverts to default upon selecting do not explode (#45693)
* fix: uom reverts to default upon selecting do not explode

* fix: logical error failing tests
2025-03-05 16:33:57 +05:30
Venkatesh
4ef7e6424a fix: set stock adjustment account in difference account (#45606)
* fix: set stock adjustment account in difference account

* fix(stock entry): fetch stock difference account for manufacture entry
2025-03-05 16:32:03 +05:30
rohitwaghchaure
6c0b18b19f Merge pull request #46313 from mihir-kandoi/st33100
fix: production analytics report
2025-03-05 16:23:13 +05:30
Rohit Waghchaure
b1508efca2 fix: Accounting Period validation throwing for different companies 2025-03-05 16:19:47 +05:30
mergify[bot]
82c0995f2e fix: Close and Reopen buttons dissapear after saving changes (backport #46048) (#46325)
fix: Close and Reopen buttons dissapear after saving changes (#46048)

* fix: Close and Reopen buttons dissapear after saving changes

* style: linter issue

---------

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit 506dd3c6b9)

Co-authored-by: Ben Kebdani <benkebdani@users.noreply.github.com>
2025-03-05 16:18:56 +05:30
Diptanil Saha
c4eb577a76 chore: erpnext demo url update (#46327) 2025-03-05 15:47:20 +05:30
Corentin Forler
a700345cee refactor: Remove duplicate inherited method (#46030)
The method add_taxes_from_item_tax_template is defined identically in the erpnext.taxes_and_totals class, that erpnext.TransactionController extends.
2025-03-05 15:38:05 +05:30
0xD0M1M0
104f60cc57 fix: Naming of Purchase Amount (#46051)
* fix: Naming of Purchase Amount

* fix: linters
2025-03-05 15:24:23 +05:30
Mihir Kandoi
6cc3d67835 feat: add new Closed and Stopped rows 2025-03-05 15:14:54 +05:30
Diptanil Saha
926e4ecc4f fix: adding cost center on pos invoice items while applying product discount (#46082) 2025-03-05 15:14:31 +05:30
Lakshit Jain
1f685efcaf fix: consolidate gl entries by project in General Ledger Report (#46314) 2025-03-05 15:08:52 +05:30
Sugesh G
425fb12e91 fix: consider journal entry and return invoice in paid_amount calculation (#46129)
* fix: consider journal entry and return invoice in paid_amount calculation

* test: add new unit test to consider journal entry and return invoice in paid_amount calculation
2025-03-05 14:47:22 +05:30
Fab
c5f90c823d Merge pull request #45840 from gms-electronics/40254-italian-einvoice
fix:[regional] Italian einvoice xml generated with wrong prices (#40254)
2025-03-05 14:45:54 +05:30
rohitwaghchaure
70128881a8 Merge pull request #45947 from mihir-kandoi/st31369
fix: set landed cost based on purchase invoice rate
2025-03-05 14:31:31 +05:30
rohitwaghchaure
694098a578 Merge pull request #45761 from rohitwaghchaure/fixed-support-31024
fix: incorrect batch picked in the pick list
2025-03-05 14:19:53 +05:30
Mihir Kandoi
961258a4ce fix: use else instead of unnecessary elif 2025-03-05 13:56:10 +05:30
Mihir Kandoi
772e9ecfaa fix: production analytics report 2025-03-05 13:48:34 +05:30
Raffael Meyer
94547188bf feat(Sales Invoice): add items row via "Fetch Timesheet" (#46071) 2025-03-05 13:21:40 +05:30
Diógenes Souza
89bcdd6fa5 fix: Wrong Overdue Status in Sales Invoices (Floating-point arithmetic) (#46146)
* fix: Wrong Overdue Status in Sales Invoices (Floating-point arithmetic)

* style: after run pre-commit
2025-03-05 13:16:45 +05:30
Venkatesh
2d26bff870 fix: use value from currency exchange when exchange api is disabled (#46137) 2025-03-05 13:15:20 +05:30
Mihir Kandoi
3bb6a311de Merge branch 'develop' into st31369 2025-03-05 12:48:19 +05:30
rohitwaghchaure
27446a68b7 Merge pull request #45987 from mihir-kandoi/st31052-3
fix: rename some sla fields
2025-03-05 12:45:53 +05:30
Nabin Hait
5513e24b00 fix(workspace): enable is_query_report on purchase reports (#46249)
* fix(workspace): enable is_query_report on purchase reports

* fix: resolved conflict

---------

Co-authored-by: venkat102 <venkatesharunachalam659@gmail.com>
2025-03-05 12:30:09 +05:30
Khushi Rawat
4a542b22a4 fix: depreciation and balances report correction (#46259) 2025-03-05 12:29:23 +05:30
Lakshit Jain
88fcdbb81e fix: only include submitted docs for internal received quantity validation (#46262) 2025-03-05 12:27:47 +05:30
ruthra kumar
0f6062efee Merge pull request #46294 from ruthra-kumar/temporary_exclude_old_prs
ci: dont lock really old pull requests
2025-03-05 12:26:22 +05:30
Sudharsanan Ashok
6117706ab5 feat(received items to be billed): add company and date filters (#46271)
* feat(received items to be billed): add company and date filters

* feat(delivered to be billed): add company and date filters

* feat: add company and date conditions

* chore: remove debugger
2025-03-05 12:25:43 +05:30
rohitwaghchaure
65a229abb1 Merge pull request #46226 from mihir-kandoi/refactor_sc_feilds
refactor: rename subcontracting fields
2025-03-05 12:25:08 +05:30
rohitwaghchaure
93fe9203da Merge pull request #46258 from mihir-kandoi/46196
fix: delivery note from sales order uom conversion mistake
2025-03-05 12:20:59 +05:30
Frappe PR Bot
4c810a878c fix: sync translations from crowdin (#46287)
* fix: French translations

* fix: Arabic translations

* fix: Persian translations

* fix: Bosnian translations

* fix: Portuguese, Brazilian translations

* fix: Thai translations

* fix: Croatian translations
2025-03-05 12:19:53 +05:30
Kunhi
a8d1cbc1c3 fix: Add company filter at get_invoice method (#46238) 2025-03-05 12:18:17 +05:30
Mihir Kandoi
01b5fb2f91 Merge branch 'develop' into st31052-3 2025-03-05 12:14:01 +05:30
Mihir Kandoi
ceaf217341 Merge branch 'develop' into st31369 2025-03-05 12:13:13 +05:30
rohitwaghchaure
62837099fc Merge pull request #46046 from mihir-kandoi/st32237-2
perf: optimize query in project.py
2025-03-05 12:10:16 +05:30
rohitwaghchaure
2b703c233b Merge pull request #46068 from mihir-kandoi/st32081
fix: use valuation method from settings in stock ageing report
2025-03-05 12:07:46 +05:30
Priyansh Shah
59e99f167d fix: Include additional account types for Expense Account in LCV (#46206)
fix: additional account types in filters for the Expense account selection
2025-03-05 12:07:25 +05:30
ruthra kumar
bb12551599 ci: dont lock really old pull requests
temporary change. mergify incorrectly triggers backport for really old
pull requests
2025-03-05 12:01:43 +05:30
Ankush Menat
41fe30ea6e chore: erpnext.com -> frappe.io/erpnext (#46288) 2025-03-05 05:32:21 +00:00
rohitwaghchaure
55de0176e8 Merge pull request #46279 from rohitwaghchaure/fixed-support-32979
fix: rate changing on the deliver note
2025-03-04 21:41:31 +05:30
rohitwaghchaure
1bdfd44d4c Merge pull request #46208 from rohitwaghchaure/fixed-support-32747
fix: stock reservation issue while making Purchase Invoice
2025-03-04 20:09:48 +05:30
Rohit Waghchaure
6f40849d55 fix: rate changing on the deliver note 2025-03-04 20:01:50 +05:30
Smit Vora
f006fd99d2 Merge pull request #46039 from Sanket322/address_template_for_usa
fix: Ensure new line is added regardless of postal code presence
2025-03-04 18:05:16 +05:30
Smit Vora
f8dd4e0961 Merge pull request #46010 from Sanket322/check_pos_permission
fix: Add permission check in POS's `Toggle Recent Orders`
2025-03-04 18:03:27 +05:30
Smit Vora
60247eeed5 Merge pull request #46260 from ljain112/fix-billed-items-report
fix: do not include opening invoices in billed items to be received report
2025-03-04 16:48:35 +05:30
Smit Vora
1332ea02d1 Merge pull request #45896 from ljain112/fix-pe-allocate
fix: auto allocation for negative amount outstanding for Customers in Payment Entry
2025-03-04 16:47:51 +05:30
ruthra kumar
6cbce114a6 Merge pull request #45682 from cogk/fix-filters-posting_date-not-always-string
fix(stock): Cast filters.to_date before string concatenation
2025-03-04 15:58:06 +05:30
ruthra kumar
24f684c58f Merge pull request #45751 from aerele/invoice-tds-link
fix: change voucher_type and voucher_name field type to data
2025-03-04 15:39:12 +05:30
ruthra kumar
6151f9c912 Merge pull request #46172 from Sanket322/credit_note_column
fix: Show Credit Note amount in credit note column
2025-03-04 13:27:33 +05:30
ljain112
c1ddf444c6 fix: do not include opening invoices in billed items to be received report 2025-03-04 12:49:48 +05:30
Mihir Kandoi
49a43d355d fix: delivery note from sales order uom conversion mistake 2025-03-04 11:48:28 +05:30
ruthra kumar
0d44b5d3ce Merge pull request #46257 from frappe/l10n_develop
fix: sync translations from crowdin
2025-03-04 10:05:56 +05:30
Frappe PR Bot
e6514eda50 fix: Bosnian translations 2025-03-04 09:40:48 +05:30
Sanket Shah
e4b0ab6656 fix: Convert tuple of tuples to list of dicts for dot notation access (#46062)
fix: use as_dict to convert tuples into list of dict

Co-authored-by: Sanket322 <shahsanket322003.com>
2025-03-03 21:38:11 +05:30
Bhavan23
a29c6a5aea fix: run bank reconciliation as a background job to prevent request timeout 2025-03-03 18:10:59 +05:30
barredterra
8db1fcd19c refactor: improve translatability in buying controller (2)
Added full stops and support for custom fieldnames. Improved wording.
2025-03-03 13:22:46 +01:00
Smit Vora
17eb57efdc Merge pull request #46192 from Ninad1306/budget_variance_report_fix
fix: Exclude Cancelled GL Entries
2025-03-03 16:58:09 +05:30
Smit Vora
117b847de7 Merge pull request #45972 from Ninad1306/update_taxes
fix: Set Taxes Before Calculating Taxes and Totals
2025-03-03 16:57:01 +05:30
Frappe PR Bot
03fc1d7a00 fix: sync translations from crowdin (#46234)
* fix: French translations

* fix: Spanish translations

* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Esperanto translations
2025-03-03 12:24:13 +01:00
rohitwaghchaure
25d39a38f1 Merge pull request #46231 from rohitwaghchaure/fixed-support-32871
fix: incorrect batch picked
2025-03-03 14:48:48 +05:30
rohitwaghchaure
d3a1fbbfef Merge pull request #46239 from rohitwaghchaure/fixed-support-32836
fix: incorrectly billed amount in the purchase receipt
2025-03-03 14:44:13 +05:30
ruthra kumar
efd7e05bb6 Merge pull request #46070 from nirmal2010/batch_price_update_billed
fix: Batch Price gets updated only if it is a billed item
2025-03-03 14:27:05 +05:30
ruthra kumar
0a2193e458 chore: linter fix 2025-03-03 14:05:41 +05:30
Nirmalrajaa K
1a56b83054 fix: Batch Price gets updated only if it is a billed item 2025-03-03 14:05:40 +05:30
Nirmalrajaa K
9597b1a69e fix: Batch Price gets updated only if it is a billed item 2025-03-03 14:05:26 +05:30
Rohit Waghchaure
a5271fdb2e fix: incorrectly billed amount in the purchase receipt 2025-03-03 13:55:52 +05:30
Khushi Rawat
4bf84f5c84 fix(asset depreciation schedules): enable auto commit
Merge pull request #46201 from aerele/asset-depreciation-patch
2025-03-03 12:11:08 +05:30
rohitwaghchaure
47648329ed Merge pull request #46223 from mihir-kandoi/st30672-3
fix: dont update rate of free item when batch is updated
2025-03-03 10:15:01 +05:30
Diptanil Saha
62c3915ecb refactor: using function to unset grand total to default mode of payment in pos (#46228) 2025-03-03 01:56:23 +05:30
Frappe PR Bot
9078e3798d fix: sync translations from crowdin (#46222)
fix: Bosnian translations
2025-03-02 19:04:06 +01:00
Frappe PR Bot
e803ed72e6 chore: update POT file (#46225) 2025-03-02 13:50:04 +01:00
Mihir Kandoi
b4f65154f5 refactor: rename subcontracting fields 2025-03-02 17:16:17 +05:30
Rohit Waghchaure
d2564cad68 fix: incorrect batch picked 2025-03-02 12:36:17 +05:30
rohitwaghchaure
5bee30ff2f Merge pull request #46219 from rohitwaghchaure/fixed-support-32834
fix: stock qty not recalculate on changing of the qty
2025-03-02 12:15:32 +05:30
Mihir Kandoi
7c9c0c7776 fix: error 2025-03-02 12:07:31 +05:30
Mihir Kandoi
a3596f717b fix: dont update rate of free item when batch is updated 2025-03-02 11:29:39 +05:30
Rohit Waghchaure
464e3339fe fix: stock qty not recalculate on changing of the qty 2025-03-01 21:34:06 +05:30
Frappe PR Bot
912f9bfd8e fix: sync translations from crowdin (#46216)
* fix: French translations

* fix: Chinese Simplified translations
2025-03-01 09:05:40 +01:00
rohitwaghchaure
1c124b3c90 Merge pull request #46202 from rohitwaghchaure/fixed-fields-stock-settings
fix: rearrange stock settings fields
2025-03-01 12:26:32 +05:30
Diptanil Saha
d2fad44e89 fix: pos item detail serial no field (#46211) 2025-02-28 22:36:24 +05:30
Ankush Menat
999f1cf96d fix: don't allow renaming account while system is actively in use (#46176) 2025-02-28 19:39:50 +05:30
Rohit Waghchaure
64985bffe0 fix: stock reservation issue while making Purchase Invoice 2025-02-28 19:28:20 +05:30
Diptanil Saha
8fb09decd2 fix: pos item selection using serial no (#46200) 2025-02-28 15:38:21 +05:30
Rohit Waghchaure
93f461c6f3 fix: rearrange stock settings fields 2025-02-28 15:30:42 +05:30
venkat102
a4b24f7451 fix(asset depreciation schedules): enable auto commit 2025-02-28 15:14:25 +05:30
Frappe PR Bot
48f9769c05 fix: sync translations from crowdin (#46170)
* fix: Persian translations

* fix: Bosnian translations

* fix: Swedish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations
2025-02-28 10:25:48 +01:00
ruthra kumar
e965c44908 Merge pull request #46169 from frappe/mergify/ruthra-kumar/config-update
ci(Mergify): configuration update
2025-02-28 13:34:29 +05:30
ruthra kumar
0c1e8bbfbb Merge pull request #46186 from rohitwaghchaure/fixed-support-32566
fix: removed mandatory property for the cost center field
2025-02-28 13:33:00 +05:30
Ninad1306
3251a331dd fix: exclude cancelled gl entries 2025-02-28 11:08:30 +05:30
Sagar Vora
453bcd7513 Merge pull request #46177 from vishakhdesai/payment-entry-fix 2025-02-28 10:42:26 +05:30
Ankush Menat
ded0aab680 perf: don't track seen for POS Invoice (#46187)
This is a moving doctype. Do people even browse the list view? 

It doesn't make much sense, either. POS INvoices are rarely "reviewed" by multiple users.
2025-02-28 04:57:57 +00:00
Rohit Waghchaure
079cf772aa fix: removed mandatory property for the cost center field 2025-02-28 09:48:19 +05:30
vishakhdesai
2dbef23244 fix: payment entry exchange gain loss issue 2025-02-27 18:18:49 +05:30
Sanket322
6719bbeb10 fix: test case for debit note 2025-02-27 17:14:29 +05:30
Sanket322
9b2b477ae0 fix: fixing test case 2025-02-27 16:52:13 +05:30
Sanket322
ccb4bdbe4c fix: if invoice is return then add amount in proper column 2025-02-27 13:17:57 +05:30
JK1117
daa5bebdd0 fix: use source_fieldname to validate inventory dimension 2025-02-27 15:17:39 +08:00
JK1117
4e63ee1a70 feat: fetch source_fieldname for inventory dimension 2025-02-27 15:17:10 +08:00
ruthra kumar
967f5ac7f3 ci(Mergify): configuration update
Signed-off-by: ruthra kumar <null>
2025-02-27 06:54:24 +05:30
ruthra kumar
fcf374928f Merge pull request #46155 from frappe/l10n_develop
fix: sync translations from crowdin
2025-02-26 13:52:06 +05:30
ruthra kumar
ac640a22b7 Merge pull request #46156 from aerele/autofetch-timesheet
fix: no permission to get project settings in sales invoice
2025-02-26 13:51:01 +05:30
venkat102
221f1468cb fix: no permission to get project settings in sales invoice 2025-02-26 11:01:40 +05:30
Frappe PR Bot
da4b28bf2f fix: Bosnian translations 2025-02-26 08:32:13 +05:30
rohitwaghchaure
5a6e06a140 Merge pull request #46097 from rohitwaghchaure/fixed-valuation-for-batch-sabb
fix: valuation rate for batch
2025-02-25 23:14:00 +05:30
ruthra kumar
45d72cbefc Merge pull request #45908 from aerele/autofetch-timesheet
fix(projects settings): add checkbox to auto fetch timesheet in sales invoice
2025-02-25 22:26:16 +05:30
Smit Vora
fd3fec3912 Merge pull request #46117 from Ninad1306/add_status_in_po_analysis_report 2025-02-25 18:36:41 +05:30
Ninad1306
936d7d4342 fix(report): filter sales / purchase orders based on date filters 2025-02-25 17:13:09 +05:30
Ninad1306
2394e76e7d fix(report): allow Closed sales orders to be visible 2025-02-25 15:59:46 +05:30
Ankush Menat
f62aa8fc57 fix(patch): Ensure SLE indexes (#46131)
Because of the way this change was pushed in parts, some sites don't see
this as "update" and don't have the new indexes.
2025-02-25 09:43:53 +00:00
Frappe PR Bot
8284efdf66 fix: sync translations from crowdin (#46111)
* fix: Spanish translations

* fix: Swedish translations

* fix: Bosnian translations

* fix: Persian translations

* fix: Bosnian translations
2025-02-25 10:21:09 +01:00
Patrick Eissler
3876cf0c2b refactor: make linter happy 2025-02-24 08:51:36 +01:00
Patrick Eissler
85f46d6e32 fix: only update User Permissions if a relevant field has changed 2025-02-24 08:47:17 +01:00
Ninad1306
3b2879d3a1 fix(report): allow Closed purchase orders to be visible 2025-02-24 12:42:05 +05:30
Mihir Kandoi
6073f5a6f9 test: added test 2025-02-23 22:26:52 +05:30
Rohit Waghchaure
b88305a95f fix: valuation rate for batch 2025-02-23 22:04:52 +05:30
Frappe PR Bot
987a95d2b5 fix: sync translations from crowdin (#46036)
* fix: Persian translations

* fix: Bosnian translations

* fix: Turkish translations

* fix: Persian translations

* fix: Bosnian translations
2025-02-23 10:38:54 +01:00
Marica
c3b45c933a Merge pull request #45932 from 0xD0M1M0/fix_discount_payment_entry
fix: discount accounting
2025-02-21 20:37:06 +05:30
Ravibharathi
1ec182430d feat: add total weight in shipment (#46049)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2025-02-21 15:15:21 +01:00
Mihir Kandoi
da09c278c8 fix: use valuation method from settings in stock ageing report 2025-02-21 19:08:12 +05:30
Diptanil Saha
8e6959dfad fix: pos opening entry dialog not saving on change data (#46066) 2025-02-21 17:50:51 +05:30
Mihir Kandoi
f7594e2ff9 fix: revamp logic (split parent and child) 2025-02-21 11:04:14 +05:30
0xD0M1M0
a91fe5cbb3 feat: add testcase for discount_payment_entry 2025-02-20 17:12:21 +01:00
0xD0M1M0
8c5aea15ac Merge branch 'frappe:develop' into fix_discount_payment_entry 2025-02-20 15:57:51 +01:00
Mihir Kandoi
2f1e253e19 fix: syntax error 2025-02-20 15:28:13 +05:30
Mihir Kandoi
5e66231ca4 perf: replace if function in query 2025-02-20 15:03:19 +05:30
rohitwaghchaure
f68730f444 Merge pull request #46037 from rohitwaghchaure/fixed-support-31955
fix: inventory dimension for maintenance visit
2025-02-20 11:41:41 +05:30
Sanket322
746adfd057 refactor: add new line ragardless of postal code 2025-02-20 11:33:53 +05:30
Rohit Waghchaure
cd4ba69262 fix: inventory dimension for maintence visit 2025-02-20 09:05:35 +05:30
Frappe PR Bot
78dedc0773 fix: sync translations from crowdin (#45997) 2025-02-19 14:20:18 +01:00
rohitwaghchaure
75379b79fc Merge pull request #46021 from rohitwaghchaure/fixed-support-31874
fix: incorrect stock value difference for adjustment entry
2025-02-19 16:39:45 +05:30
Khushi Rawat
83cafb892c Merge pull request #46022 from khushi8112/fetch-asset-location-from-purchase-doc
fix: reset location only if there is value in row item location field
2025-02-19 16:30:20 +05:30
Akhil Narang
a1cbcda4c5 Merge pull request #46003 from akhilnarang/fix-xss
fix(send_message): escape HTML in the text
2025-02-19 16:14:19 +05:30
Mihir Kandoi
0c465b0f32 Merge branch 'develop' into st31369 2025-02-19 16:04:26 +05:30
Rohit Waghchaure
df83e427a3 fix: incorrect stock value difference for adjustment entry 2025-02-19 16:02:39 +05:30
Khushi Rawat
7f8d08c8eb fix: reset location only if there is value in row item location field 2025-02-19 16:02:01 +05:30
rohitwaghchaure
8e42764274 Merge pull request #45838 from CaseSolvedUK/item-fix
fix: remove public access to list items
2025-02-19 15:50:13 +05:30
mergify[bot]
65c45a3f5b feat: added ability to use custom html format for process statement of accounts (copy #45746) (#46011)
feat: added ability to use custom html format for process statement of accounts (#45746)

* feat: added ability to use custom print format for process statement of accounts documents.

* fix: handles missing hook issues

* chore: linter changes

---------

Co-authored-by: Boy4099 <mashtawayne4099@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
(cherry picked from commit a0cd08e9ea)

Co-authored-by: Steve Wilson <stevew9009@gmail.com>
2025-02-19 15:44:35 +05:30
Ejaaz Khan
941085000a fix: round sum amount in JE auditing PF (#45961) 2025-02-19 15:40:55 +05:30
Venkatesh
17a2f44290 fix(pos profile): check company while validating mandatory accounting dimension (#45974) 2025-02-19 15:39:01 +05:30
Sanket Shah
24394765a6 fix: handle division by zero error (#45966)
Co-authored-by: Sanket322 <shahsanket322003.com>
2025-02-19 15:37:54 +05:30
Khushi Rawat
fa31a0282e Merge pull request #45898 from nabinhait/asset-depr-schedule-patch
fix: patch for creating asset depreciation schedule records
2025-02-19 15:37:27 +05:30
Khushi Rawat
38e1054eb7 Merge pull request #45872 from khushi8112/set-purchase-doc-row-item-to-asset
fix: enable asset value editing for duplicate item code
2025-02-19 15:30:53 +05:30
Khushi Rawat
2bb79197aa fix: reset location only if there is value in row item location field 2025-02-19 15:04:26 +05:30
Sanket322
a08bc6b913 fix: use get_list to check permissions 2025-02-19 14:02:11 +05:30
Bhavansathru
73e82b7afa fix: fetch child account data for selected parent (#45904)
* fix: fetch child account data for selected parent

* fix: change reference name

---------

Co-authored-by: venkat102 <venkatesharunachalam659@gmail.com>
2025-02-19 13:57:31 +05:30
Mihir Kandoi
dcec446e55 fix: patch path 2025-02-19 13:10:13 +05:30
Khushi Rawat
4821c44227 Merge pull request #45895 from khushi8112/fix-scrapping-of-fully-depreciated-asset
fix: do not reschedule depreciation for fully depreciated asset on scrap
2025-02-19 13:06:39 +05:30
Mihir Kandoi
1230127d24 fix: patch 2025-02-19 13:03:45 +05:30
Khushi Rawat
44c1425e73 fix: validate if no matching item found 2025-02-19 13:01:27 +05:30
rohitwaghchaure
4b87610d95 Merge pull request #45750 from mihir-kandoi/st20447
feat: added option to enforce free item qty in pricing rule
2025-02-19 12:49:01 +05:30
Akhil Narang
448a5db20f fix(send_message): escape HTML in the text
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-02-19 12:23:10 +05:30
ruthra kumar
5fed3866b6 Merge pull request #45882 from aerele/quotation-exchange-rate
fix(quotation): fetch exchange rate on currency change
2025-02-19 10:50:38 +05:30
Mihir Kandoi
019303dd12 fix: tests 2025-02-18 22:02:13 +05:30
Mihir Kandoi
1b831e9abd fix: tests 2025-02-18 21:30:24 +05:30
Mihir Kandoi
baa0dd1235 fix: rename some sla fields 2025-02-18 21:30:21 +05:30
rohitwaghchaure
f05c1d7e7b Merge pull request #45980 from mihir-kandoi/st31872
fix: check if employee is currently working on another workstation
2025-02-18 20:41:22 +05:30
rohitwaghchaure
32f616ad87 Merge pull request #45977 from rohitwaghchaure/fixed-support-31935
fix: millisecond issue for posting datetime
2025-02-18 20:08:15 +05:30
rohitwaghchaure
93a8440908 Merge pull request #45971 from mihir-kandoi/st32087
fix: set sco_qty field of PO to non negative
2025-02-18 19:58:00 +05:30
rohitwaghchaure
be813b5bba Merge pull request #45976 from rohitwaghchaure/fixed-support-32073
fix: slow query
2025-02-18 19:56:37 +05:30
Rohit Waghchaure
ac9e5c0163 fix: millisecond issue for posting datetime 2025-02-18 18:58:45 +05:30
Mihir Kandoi
4487edb255 fix: throw correct exception 2025-02-18 14:49:52 +05:30
Mihir Kandoi
8234e659c8 fix: check if employee is currently working on another workstation 2025-02-18 14:22:39 +05:30
ruthra kumar
927eae79d5 Merge pull request #45765 from aerele/dimensions-in-order-item
fix: add accounting dimensions section in sales order item
2025-02-18 14:10:49 +05:30
Ninad1306
196ef7ac4e test: validate fetching of taxes based on taxes and charges template 2025-02-18 14:03:35 +05:30
Rohit Waghchaure
8cfab57fc8 fix: slow query 2025-02-18 13:52:26 +05:30
rohitwaghchaure
74621eeb1b Merge pull request #45970 from rohitwaghchaure/fixed-support-32040
fix: serial no status for internal transfer delivery note
2025-02-18 13:51:00 +05:30
ruthra kumar
1eea76cbad Merge pull request #45723 from aerele/validate-payment-request-total
fix: validate payment request total of partly paid invoice
2025-02-18 13:11:08 +05:30
Rohit Waghchaure
3333331a3d fix: serial no status for internal transfer delivery note 2025-02-18 12:59:10 +05:30
Ninad1306
0fd0695bbb fix: set taxes before calculating taxes and totals 2025-02-18 12:52:33 +05:30
Mihir Kandoi
dfc3dc4944 fix: set sco_qty field of PO to non negative 2025-02-18 12:37:07 +05:30
ruthra kumar
7c7aa831ec Merge pull request #45965 from frappe/l10n_develop
fix: sync translations from crowdin
2025-02-18 12:12:22 +05:30
Diptanil Saha
70260c8c86 fix: pos checkout button color on dark mode (#45967) 2025-02-18 11:48:04 +05:30
ruthra kumar
c46af238d4 Merge pull request #45687 from aerele/validate_equity_account
fix: add validation to allow equity account
2025-02-18 11:44:34 +05:30
Frappe PR Bot
7e61b67ba8 fix: German translations 2025-02-18 05:48:36 +05:30
Frappe PR Bot
5e8124900f fix: Bosnian translations 2025-02-18 05:48:32 +05:30
Frappe PR Bot
3788339ea0 fix: Swedish translations 2025-02-18 05:48:20 +05:30
Frappe PR Bot
fe47ca8566 fix: sync translations from crowdin (#45927)
* fix: Swedish translations

* fix: Bosnian translations

* fix: Bosnian translations

* fix: French translations

* fix: Spanish translations

* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Esperanto translations
2025-02-17 20:07:11 +01:00
Mihir Kandoi
154e9813c4 fix: revert last commit 2025-02-17 21:52:49 +05:30
Mihir Kandoi
844f1636c0 fix: set default value to 0 as per new logic 2025-02-17 18:47:35 +05:30
Mihir Kandoi
7cf8e498c4 fix: fiscal year error 2025-02-17 18:44:33 +05:30
Mihir Kandoi
f3d598881c refactor: rename field 2025-02-17 18:21:22 +05:30
Mihir Kandoi
a41024813b perf: patch 2025-02-17 18:08:31 +05:30
rohitwaghchaure
2fcc5e3f55 Merge pull request #45946 from rohitwaghchaure/fixed-support-32008
fix: provision to enable naming series for SABB
2025-02-17 17:00:34 +05:30
barredterra
b9450288f5 refactor: improve translatability in buying controller 2025-02-17 12:16:39 +01:00
Rohit Waghchaure
fe43975cdd fix: provision to enable naming series for SABB 2025-02-17 16:36:55 +05:30
rohitwaghchaure
c2b4a79b5b Merge pull request #45950 from rohitwaghchaure/fixed-bom-creator-issue
fix: remove unused fields
2025-02-17 16:11:55 +05:30
Soham Kulkarni
98cc1558d3 Small UI changes (#45938)
* fix: change erpnext logo and home workpsace icon

* fix: actually change home workspace icon

* fix: typo in hooks.py
2025-02-17 15:40:22 +05:30
Rohit Waghchaure
f206034a79 fix: remove unused fields 2025-02-17 15:40:17 +05:30
0xD0M1M0
6f1bc5225a fix: auto create asset due to message error (#45934)
* fix: auto create asset due to message error

* fix: linters
2025-02-17 15:12:26 +05:30
Diptanil Saha
5506b44b6f fix: improve pos return (#45671)
* fix: pos return validation for zero qty item

* fix: pos return invoice onload ui

* feat: added item qty returned in pos ui

* refactor: removed console log statement

* feat: check return can be made before loading it on pos

* fix: pos edit invoice onload ui

* fix: returned

* refactor: code cleanup
2025-02-17 15:00:56 +05:30
venkat102
5880f1d5c6 fix: enable fetch_timesheet_in_sales_invoice in test 2025-02-17 14:49:32 +05:30
Mihir Kandoi
17d415b105 fix: set landed cost based on purchase invoice rate 2025-02-17 14:36:15 +05:30
Diptanil Saha
d94802067b fix: disable partial payment in pos (#45752)
* fix: disable partial payment in pos

* test: disable partial payment

* test: removed print statement

* test: using save method to auto calculate paid_amount

* test: paid_amount calculation using save method

* test: added save method to calculate paid_amount

* test: outstanding amount

* test: added test for partial payments in pos invoice

* fix: custom validation error for partial payment

* test: using partial payment validation

* fix: validate only on submit
2025-02-17 14:26:50 +05:30
rohitwaghchaure
6c8cb9717d Merge pull request #45941 from rohitwaghchaure/fixed-support-31066
fix: letter head for quality inspection
2025-02-17 13:57:23 +05:30
Rohit Waghchaure
cdd41373b6 fix: letter head for quality inspection 2025-02-17 13:20:52 +05:30
ruthra kumar
419b149d05 Merge pull request #45630 from ruthra-kumar/remove_acc_balance_field_from_payment_entry
refactor: remove redundant balance fields from Payment Entry
2025-02-17 10:58:02 +05:30
Frappe PR Bot
019f6422be chore: update POT file (#45935) 2025-02-16 12:15:43 +01:00
0xD0M1M0
947a4fb091 fix: only negative for "Pay" 2025-02-15 22:36:34 +01:00
0xD0M1M0
03d515208a fix: discount accounting 2025-02-15 21:23:05 +01:00
rohitwaghchaure
9e4c82e055 Merge pull request #45914 from rohitwaghchaure/fixed-reposting-issue
fix: start reposting button not working
2025-02-14 21:28:20 +05:30
Patrick Eissler
92f63a026b chore: use existing utility function 2025-02-14 16:28:40 +01:00
Patrick Eissler
dee46c6954 fix(Employee): remove User Permissions if create_user_permission is unchecked 2025-02-14 15:14:03 +01:00
Diptanil Saha
60a5f4f30d fix: pos accounting dimension fieldname error (#45899)
* fix: pos accounting dimension fieldname error

* fix: method to get enabled accounting dimensions

* fix: fetch enabled accounting dimensions

* fix: clear flags for accounting_dimensions_details on_update

* refactor: validation for doctype

* fix: using get_checks_for_pl_and_bs_accounts for accounting dimensions
2025-02-14 17:31:53 +05:30
Diptanil Saha
bee26e046e fix: prevent duplicate pos fields in pos settings (#45873)
fix: restrict duplicate pos fields in pos settings
2025-02-14 17:26:54 +05:30
Frappe PR Bot
e6b6849940 fix: sync translations from crowdin (#45876)
* fix: Swedish translations

* fix: Turkish translations

* fix: Persian translations

* fix: Bosnian translations

* fix: Spanish translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Persian translations

* fix: Bosnian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations
2025-02-14 12:26:34 +01:00
ruthra kumar
6e67a1ba7c Merge pull request #45912 from aerele/add-payment-gateway
fix: include missing payment_gateway parameter in Payment Request URL
2025-02-14 16:44:04 +05:30
Diptanil Saha
f0a6399056 feat: disable auto setting grand total to default mode of payment (#45591) 2025-02-14 16:43:11 +05:30
Rohit Waghchaure
c81ce29e4c fix: start reposting button not working 2025-02-14 15:33:45 +05:30
rohitwaghchaure
0a364ed1c9 Merge pull request #45903 from rohitwaghchaure/fixed-support-31510
fix: allow scrap item with zero qty
2025-02-14 15:15:55 +05:30
Navin-S-R
dbac8cfc94 fix: include missing payment_gateway parameter in Payment Request URL 2025-02-14 13:14:27 +05:30
venkat102
43b13b91be fix: check value as int 2025-02-13 23:24:05 +05:30
venkat102
914ad357fd fix(sales invoice): check fetch_timesheet_in_sales_invoice enabled before fetching the timesheet 2025-02-13 23:07:45 +05:30
venkat102
876082ea2f fix(project settings): add checkbox to auto fetch timesheet in sales invoice 2025-02-13 23:05:34 +05:30
Rohit Waghchaure
706cb64279 fix: allow scrap item with zero qty 2025-02-13 19:10:21 +05:30
Nabin Hait
7324dcb7c8 fix: patch for creating asset depreciation schedule records 2025-02-13 18:02:56 +05:30
ljain112
6275b44a0b fix: auto allocation for negative amount outstanding for Customers in Payment Entry 2025-02-13 14:56:11 +05:30
Khushi Rawat
fd4c4f98fa fix: do not reschedule depreciation for fully depreciated asset on scrap 2025-02-13 14:21:29 +05:30
ruthra kumar
a81867bc43 Merge pull request #45804 from aerele/auto-email-multiselect
fix(report): add options to multiselectlist fields
2025-02-13 14:16:16 +05:30
ruthra kumar
6886f5ef41 Merge pull request #45874 from ruthra-kumar/incorrect_taxable_amount_on_other_charges_calculation
fix: incorrect taxable_amount on `other_charges_calculation`
2025-02-13 13:08:56 +05:30
Diptanil Saha
72f8fc8a7b style: pos checkout button color (#45890)
style: pos checkout button color
2025-02-13 00:09:21 +05:30
rohitwaghchaure
5f554e1ec3 Merge pull request #45786 from barredterra/skip-warning-for-free-items
fix: skip warning for free items
2025-02-12 14:48:25 +05:30
venkat102
2f77a8bed1 fix(quotation): fetch exchange rate on currency change 2025-02-12 12:54:30 +05:30
rohitwaghchaure
b839094551 Merge pull request #45879 from rohitwaghchaure/fixed-SABB-naming
fix: changed naming series to random for SABB
2025-02-12 10:19:17 +05:30
Rohit Waghchaure
a007dc285d fix: changed naming series to random for SABB 2025-02-12 09:55:20 +05:30
rohitwaghchaure
3e990153a4 Merge pull request #45865 from mihir-kandoi/st30672-2
fix: dont update rate of free item on save
2025-02-12 08:42:19 +05:30
rohitwaghchaure
591ad7641f Merge pull request #45875 from mihir-kandoi/serial-batch-bundle-precision-fix
fix: add precision in serial_batch_bundle.py
2025-02-12 08:35:29 +05:30
Mihir Kandoi
4bf85d1a5a fix: add precision in serial_batch_bundle.py 2025-02-11 22:51:17 +05:30
ruthra kumar
6ab2106322 fix: incorrect taxable_amount on other_charges_calculation 2025-02-11 17:52:15 +05:30
rohitwaghchaure
c522071b58 Merge pull request #45862 from rohitwaghchaure/fixed-support-31345
fix: remove serial no if qty is zero
2025-02-11 16:56:56 +05:30
rohitwaghchaure
5df8609b33 Merge pull request #45869 from rohitwaghchaure/fixed-support-31464
fix: stock reco current valuation rate
2025-02-11 16:53:04 +05:30
Mihir Kandoi
4dcac56486 fix: add is_new in if condition 2025-02-11 16:29:01 +05:30
Khushi Rawat
da1b4cb9ab fix: link correct row item of purchase doc 2025-02-11 16:17:42 +05:30
Rohit Waghchaure
8d8f3afb39 fix: stock reco current valuation rate 2025-02-11 16:14:39 +05:30
Khushi Rawat
8af9dcb33e fix: make purchase_receipt_item and purchase_invoice_item fields of data type 2025-02-11 16:05:02 +05:30
Diptanil Saha
b95b13ecd8 fix: added validation for required invoice_fields in POS (#45780)
fix: added missing validation for required invoice_fields
2025-02-11 16:04:36 +05:30
Mihir Kandoi
6591e76a63 fix: dont update rate of free item on save 2025-02-11 15:32:35 +05:30
Smit Vora
c33c6b6560 Merge pull request #45532 from ljain112/fix-lcv-gl
fix: correct amt in account currency for lcv with manually distributed charges.
2025-02-11 15:32:01 +05:30
Rohit Waghchaure
e1b7688a17 fix: incorrect batch picked in the pick list 2025-02-11 15:13:13 +05:30
Smit Vora
0fdaa541f1 Merge pull request #45772 from ljain112/po-portal
fix: Party name in Supplier Portal for Purchase Order
2025-02-11 15:01:27 +05:30
Smit Vora
0bae273d41 fix: do not allow "Finance Book" in Accounting Dimensions (#45696) 2025-02-11 14:55:32 +05:30
Lakshit Jain
494310293c fix(regional): removed payment schedule validation in sales invoice for italy (#45852) 2025-02-11 14:50:55 +05:30
Rohit Waghchaure
3a4ae8c463 fix: remove serial no if qty is zero 2025-02-11 13:31:24 +05:30
ruthra kumar
110412d8ad Merge pull request #45794 from ljain112/fix-gl-rev
fix: correct amount in transaction currency for reverse gl entries
2025-02-11 12:59:24 +05:30
ruthra kumar
675b3330d9 Merge pull request #45792 from ljain112/fix-gl-val
fix: do not validate party against Receivable and Payable account for cancelled gl entries
2025-02-11 12:13:40 +05:30
ruthra kumar
8296e28689 Merge pull request #45839 from frappe/l10n_develop
fix: sync translations from crowdin
2025-02-11 10:39:43 +05:30
ruthra kumar
3977a7a06e Merge pull request #45781 from Sanket322/total_row_in_non_group
fix: Added Total Row for `Gross Profit` Report in Non-Grouped Invoices
2025-02-11 10:20:08 +05:30
ruthra kumar
1c725dee5d Merge pull request #45832 from ruthra-kumar/fix_migration_issue_for_reconciliation_sync
fix: possible model sync issue
2025-02-11 09:54:48 +05:30
Frappe PR Bot
e8871257a2 fix: Bosnian translations 2025-02-11 03:39:50 +05:30
Frappe PR Bot
a11b8db389 fix: Turkish translations 2025-02-11 03:39:41 +05:30
Frappe PR Bot
3c8214827c fix: Swedish translations 2025-02-11 03:39:37 +05:30
CaseSolved
2bd596ee3d fix: remove public access to list items 2025-02-10 20:46:41 +00:00
ruthra kumar
0069581aa3 fix: possible model sync issue 2025-02-10 17:16:09 +05:30
Raffael Meyer
cbcdc5e7e5 Merge pull request #45745 from HenningWendtland/buying-project
fix: map project from rfq to supplier quotation
2025-02-10 12:05:51 +01:00
Diptanil Saha
0b9c28620f fix: pos numpad editable action buttons (#45823) 2025-02-10 16:23:54 +05:30
HenningWendtland
8fa39bec61 fix: add project field map from mr to rfq 2025-02-10 11:45:58 +01:00
rohitwaghchaure
03290ef45f Merge pull request #45774 from DaizyModi/fix-attribute-error
fix: AttributeError in `get_item_details` when selecting/scanning batch in Delivery Note
2025-02-10 15:47:19 +05:30
ruthra kumar
71a507d30b Merge pull request #45747 from Sanket322/valid_response_json
fix: Handle Empty JSON in Report Parsing
2025-02-10 11:42:01 +05:30
ruthra kumar
e6176db2c9 Merge pull request #45809 from frappe/l10n_develop
fix: sync translations from crowdin
2025-02-10 11:01:56 +05:30
ruthra kumar
bcad6cb757 Merge pull request #45762 from ruthra-kumar/sync_received_and_paid_if_unset
refactor: set received and paid amount based on each other, if unset
2025-02-10 10:36:43 +05:30
ruthra kumar
95f6b586ff Merge pull request #45793 from asmitahase/employee-image
fix: unable to remove image from employee
2025-02-10 10:32:12 +05:30
ruthra kumar
c636cc33b3 refactor: remove paid_to_account_balance 2025-02-10 10:16:19 +05:30
ruthra kumar
9b5c4a0144 refactor: remove paid_from_account_balance 2025-02-10 10:16:04 +05:30
ruthra kumar
1bb6cd33a3 refactor: remove party_balance 2025-02-10 10:15:39 +05:30
rohitwaghchaure
4178154b19 Merge pull request #45810 from rohitwaghchaure/fixed-support-31257
fix: not able to select the item in the sales invoice
2025-02-10 10:08:50 +05:30
Rohit Waghchaure
35388e7a04 fix: not able to select the item in the sales invoice 2025-02-10 09:27:36 +05:30
Frappe PR Bot
91f6c65c0a fix: Esperanto translations 2025-02-10 03:17:28 +05:30
Frappe PR Bot
7137331355 fix: German translations 2025-02-10 03:17:25 +05:30
Frappe PR Bot
5e2879e9ea fix: Bosnian translations 2025-02-10 03:17:22 +05:30
Frappe PR Bot
06a93ffc80 fix: Persian translations 2025-02-10 03:17:19 +05:30
Frappe PR Bot
862ca7ddd3 fix: Chinese Simplified translations 2025-02-10 03:17:16 +05:30
Frappe PR Bot
e4530232e4 fix: Turkish translations 2025-02-10 03:17:12 +05:30
Frappe PR Bot
ed7ad79c2c fix: Swedish translations 2025-02-10 03:17:09 +05:30
Frappe PR Bot
ec9af4ae29 fix: Russian translations 2025-02-10 03:17:06 +05:30
Frappe PR Bot
5c002df014 fix: Polish translations 2025-02-10 03:17:03 +05:30
Frappe PR Bot
814be2b80a fix: Hungarian translations 2025-02-10 03:17:00 +05:30
Frappe PR Bot
b0bb3ca798 fix: Arabic translations 2025-02-10 03:16:57 +05:30
Frappe PR Bot
7e752756cf fix: Spanish translations 2025-02-10 03:16:54 +05:30
Frappe PR Bot
613c2a0379 fix: French translations 2025-02-10 03:16:50 +05:30
Frappe PR Bot
e2b586d5a3 fix: sync translations from crowdin (#45798)
* fix: Swedish translations

* fix: Bosnian translations

* fix: Swedish translations

* fix: Persian translations

* fix: Bosnian translations
2025-02-09 13:47:15 +01:00
Frappe PR Bot
b0d197119f chore: update POT file (#45805) 2025-02-09 11:20:14 +01:00
venkat102
8785342fce fix(report): add options to multiselectlist fields 2025-02-08 22:55:20 +05:30
ljain112
0809e00455 fix: do not validate party against Receivable and Payable account for cancelled gl entries 2025-02-07 18:30:26 +05:30
ljain112
6077c248b0 fix: correct amount in tansaction currency for reverse gl entries 2025-02-07 17:48:45 +05:30
Asmita Hase
0207d2d7b6 fix: unable to remove image from employee
fix: employee image disappears when newly created user_id is linked to employee
2025-02-07 17:27:44 +05:30
ruthra kumar
7b955b2ea6 Merge pull request #45725 from karm1000/set_max_date
fix: set max_date range for date of birth to today in employee
2025-02-07 16:15:10 +05:30
barredterra
772776ad8a fix: skip warning for free items 2025-02-07 11:43:25 +01:00
ruthra kumar
0df18daf10 Merge pull request #45644 from aerele/update-party-balance
fix: add allow_on_submit for party_balance, paid_from_account_balance and paid_to_account_balance
2025-02-07 16:10:17 +05:30
ruthra kumar
8f3cc6af16 Merge pull request #45640 from aerele/repost-accounting-ledger-payment-entry
feat: add repost accounting ledger entry for payment entry
2025-02-07 16:09:42 +05:30
harshpwctech
88e68bb803 Bug fix in email_campaign's update_status function. (#45679)
During the scheduler event of set_email_campaign_status, the function calling update_status isn't saving the modified status field.
2025-02-07 13:13:19 +05:30
ruthra kumar
b80b5574d3 Merge pull request #45639 from ruthra-kumar/incorrect_tds_on_0_rate_ldc
fix: '0' rate LDC's Invoice net totals should be ignored
2025-02-07 13:12:53 +05:30
Sanket322
2d32ddacc3 fix: add total row in non_grouped_invoices 2025-02-07 12:37:33 +05:30
ruthra kumar
0cdd346f8f test: ldc @ 0 rate 2025-02-07 12:18:01 +05:30
Frappe PR Bot
3d5b52f3bf fix: sync translations from crowdin (#45776)
* fix: Swedish translations

* fix: Bosnian translations
2025-02-07 00:17:18 +01:00
rohitwaghchaure
c83398471c Merge pull request #45767 from rohitwaghchaure/fixed-support-30947
fix: the project document timed out while opening
2025-02-06 22:07:22 +05:30
DaizyModi
820b32eb8a fix: Attibute error selling_price_list 2025-02-06 21:54:57 +05:30
ljain112
fc8663421b fix: Party name in Supplier Portal for Purchase Order 2025-02-06 18:37:22 +05:30
Rohit Waghchaure
33d03b1542 fix: the project document timed out while opening 2025-02-06 16:04:51 +05:30
rohitwaghchaure
fd8c78628f Merge pull request #45763 from rohitwaghchaure/fixed-support-30415
fix: stock reservation not working for sales invoice with update stock
2025-02-06 15:05:07 +05:30
Rohit Waghchaure
0c9d0ea1f4 fix: stock reservation not working for sales invoice with update stock 2025-02-06 14:46:19 +05:30
ruthra kumar
99e721e622 refactor: set paid amount based on received amount if unset 2025-02-06 14:15:24 +05:30
ruthra kumar
5ff540bd82 refactor: set received amount based on paid amount 2025-02-06 14:00:48 +05:30
Sugesh393
7d47869f4b fix: add accounting dimensions section in sales order item 2025-02-06 13:31:10 +05:30
Sugesh393
f8472c32d9 test: add unit test to validate payment request grand_total for partly paid invoice 2025-02-06 11:59:29 +05:30
ruthra kumar
325c4e3536 fix: '0' rate LDC's Invoice net totals should be ignored 2025-02-06 11:05:04 +05:30
Frappe PR Bot
52c687ecc9 fix: sync translations from crowdin (#45756)
* fix: Swedish translations

* fix: Turkish translations

* fix: Bosnian translations
2025-02-05 23:32:06 +01:00
Mihir Kandoi
ac3259b8f1 test: added test 2025-02-05 21:34:19 +05:30
Mihir Kandoi
366ae85d85 fix: tests 2025-02-05 19:18:01 +05:30
Mihir Kandoi
19c01b1457 feat: added option to enforce free item qty in pricing rule 2025-02-05 18:48:52 +05:30
Sugesh393
f8ab021920 fix: change voucher_type and voucher_no field type to data 2025-02-05 18:40:21 +05:30
Sanket322
133e0417b8 fix: handle response when json is None 2025-02-05 17:41:07 +05:30
HenningWendtland
d0479036bb fix: map project from rfq to supplier quotation 2025-02-05 12:11:13 +01:00
rohitwaghchaure
54a8d41f88 Merge pull request #45739 from mihir-kandoi/st30984
fix: create job card with wip warehouse set to source warehouse if material transfer to wip warehouse is skipped in work order
2025-02-05 16:39:11 +05:30
rohitwaghchaure
e72687d3eb Merge pull request #45741 from rohitwaghchaure/fixed-removed-unused-field
fix: removed unused field
2025-02-05 16:38:45 +05:30
ruthra kumar
fb7bba8cd0 Merge pull request #45604 from aerele/item_tax_template
fix: filter the item tax template using the input text
2025-02-05 16:30:07 +05:30
rohitwaghchaure
ab486d2515 Merge pull request #45734 from mihir-kandoi/st31003
fix: added correct options for incoming_rate field of delivery note item
2025-02-05 16:16:42 +05:30
Rohit Waghchaure
2d7a576da5 fix: removed unused field 2025-02-05 16:11:44 +05:30
rohitwaghchaure
6a2f2ae3fe Merge pull request #45692 from mihir-kandoi/st30672
fix: fetch rate from item price list when document is saved
2025-02-05 15:52:37 +05:30
Mihir Kandoi
723e902470 fix: create job card with wip warehouse set to source warehouse if material transfer to wip warehouse is skipped in work order 2025-02-05 15:48:08 +05:30
Khushi Rawat
f6fca3acec Merge pull request #45735 from khushi8112/asset-value-adjustment-cancellation-issue
fix: set asset value correctly after cancelling value adjustment
2025-02-05 15:25:47 +05:30
ruthra kumar
218670a720 Merge pull request #45717 from iamejaaz/30567-purchase-invoice-duplicate
fix(Purchase Invoice): default payment terms template selected while duplicating
2025-02-05 15:16:57 +05:30
Khushi Rawat
fee3846144 fix: set asset value correctly after cancelling value adjustment 2025-02-05 15:06:55 +05:30
Mihir Kandoi
417bf49a8d fix: added correct options for incoming_rate field of delivery note item 2025-02-05 14:55:51 +05:30
ruthra kumar
54279ee21d Merge pull request #45590 from aerele/tax-withholding-category
fix: remove tds account in taxes table on change of Tax Withholding C…
2025-02-05 14:08:29 +05:30
ruthra kumar
98e727a061 Merge pull request #45447 from aerele/pricing-rule-pos-qty
fix(pos): add item in the existing item row when discount is applied
2025-02-05 13:59:08 +05:30
ruthra kumar
79d4852d7d Merge pull request #45686 from aerele/process-statement-of-accounts
fix: allow multiple email ids
2025-02-05 13:48:57 +05:30
Mihir Kandoi
07adfadd58 test: added test 2025-02-05 13:12:25 +05:30
ruthra kumar
7f34b490f4 Merge pull request #45610 from ljain112/fix-pe-inv
fix: respect user set account if not advance account for getting outsanding invoices in payment entry
2025-02-05 12:09:16 +05:30
ruthra kumar
85378f9d1a chore: fix typo 2025-02-05 11:52:52 +05:30
Sugesh393
899c18df18 fix: validate payment request total of partly paid invoice 2025-02-05 11:00:55 +05:30
Frappe PR Bot
848b98e6d6 fix: sync translations from crowdin (#45720)
* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations
2025-02-05 00:22:13 +01:00
rohitwaghchaure
b57a2612ce Merge pull request #45678 from mihir-kandoi/45572-2
fix: copy correct uom from delivery note when creating packing list
2025-02-05 00:35:19 +05:30
rohitwaghchaure
0edba914fa Merge pull request #45710 from mihir-kandoi/30355
fix: show only items with inspection enabled on create QI dialog
2025-02-05 00:33:39 +05:30
Ejaaz Khan
bfc01441a0 refactor: remove log 2025-02-05 00:09:16 +05:30
Ejaaz Khan
fb3f08a441 fix: payment schedule table is empty while duplicating record 2025-02-05 00:06:48 +05:30
Ejaaz Khan
18127603fe fix: default payment terms template selected while duplicating 2025-02-04 23:39:29 +05:30
Karm Soni
cd87ad0613 fix: set max_date range for date of birth to today in employee 2025-02-04 19:22:51 +05:30
Mihir Kandoi
ffd10d1fe9 fix: semgrep 2025-02-04 17:50:26 +05:30
Aayush Dalal
d1c927530e fix: handling company in bank reconciliation tool (#45582)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-02-04 11:44:01 +00:00
Mihir Kandoi
c92ec312b9 fix: show only items with inspection enabled on create QI dialog 2025-02-04 16:33:27 +05:30
rohitwaghchaure
3947b5943e Merge pull request #45701 from mihir-kandoi/st30429
fix: subcontracting validation precision issue
2025-02-04 15:23:03 +05:30
rohitwaghchaure
ab2d6fdefd Merge pull request #45698 from rohitwaghchaure/feat-report-incorrect-sabb
feat: report to find incorrect SABB
2025-02-04 15:15:41 +05:30
Diptanil Saha
a20116816e fix: pos payment cash shortcut decimal (#45702) 2025-02-04 15:08:37 +05:30
Rohit Waghchaure
7e24395e00 feat: report to find incorrect SABB 2025-02-04 13:47:55 +05:30
Mihir Kandoi
8720d412bd fix: subcontracting valiation precision issue 2025-02-04 13:21:09 +05:30
Diptanil Saha
51a65899ec fix: point of sale padding (#45697) 2025-02-04 13:09:27 +05:30
ljain112
a44be73a98 fix: do not allow "Finance Book" in Accounting Dimensions 2025-02-04 12:24:15 +05:30
Shariq Ansari
2482a3a205 Merge pull request #45694 from shariquerik/cannot-create-customer 2025-02-04 12:10:19 +05:30
Shariq Ansari
716edeb465 fix: only system manager was able to create customer & prospect 2025-02-04 11:54:05 +05:30
Mihir Kandoi
fee318a275 fix: logical error failing tests 2025-02-04 11:46:11 +05:30
rethik
f82837a4a2 fix: remove party type from validate 2025-02-04 11:07:41 +05:30
Sudharsanan11
9950e4aa0c fix: check billing address 2025-02-04 10:59:10 +05:30
Mihir Kandoi
1e4b9fbdf0 fix: fetch rate from item price list when document is saved 2025-02-04 10:54:57 +05:30
Frappe PR Bot
4c39dc5493 fix: sync translations from crowdin (#45691) 2025-02-04 01:35:52 +01:00
rohitwaghchaure
2394dd71e6 Merge pull request #45680 from rohitwaghchaure/fixed-sabb-query
fix: slow SABB query
2025-02-03 20:56:38 +05:30
rethik
9422ce5aee test: add unit test to validate account type and party type 2025-02-03 19:29:59 +05:30
rethik
2c8e3f3409 fix: add validate to allow equity account and party_type shareholder 2025-02-03 19:22:37 +05:30
Sudharsanan11
423decb93c fix: allow multiple email ids 2025-02-03 18:27:32 +05:30
ruthra kumar
daf9c9d34a Merge pull request #45247 from UmakanthKaspa/feature/update-item-name
feat: show item name alongside item code in the update items dialog
2025-02-03 16:53:21 +05:30
ruthra kumar
d762180231 refactor: reuse values from get_item_details 2025-02-03 16:45:12 +05:30
Corentin Forler
b7d801d571 fix(stock): Cast filters.to_date before string concatenation 2025-02-03 11:32:03 +01:00
Rohit Waghchaure
81978a0bd8 fix: slow SABB query 2025-02-03 15:34:29 +05:30
UmakanthKaspa
7b6e8b9c29 feat: show item name alongside item code in the update items dialog 2025-02-03 15:31:16 +05:30
Mihir Kandoi
3cdaa80526 fix: copy correct uom from devliery note when creating packing list 2025-02-03 14:49:50 +05:30
ruthra kumar
adfbfe5b32 Merge pull request #45660 from frappe/pot_develop_2025-02-02
chore: update POT file
2025-02-03 14:31:41 +05:30
Ankush Menat
827afbfa2e fix: track employee changes (#45674)
closes https://github.com/frappe/erpnext/issues/45571
2025-02-03 08:51:50 +00:00
ruthra kumar
1fb3a4333d Merge pull request #45631 from deepeshgarg007/current_subscription_invoice
fix: Do not check for cancelled invoices
2025-02-03 14:11:13 +05:30
ruthra kumar
4b434d01f3 Merge pull request #45659 from frappe/mergify/bp/develop/pr-45617
fix: ignore expired batch for pick list (backport #45617)
2025-02-03 14:07:45 +05:30
ruthra kumar
cd0faf12a4 Merge pull request #45661 from frappe/l10n_develop
fix: sync translations from crowdin
2025-02-03 14:06:20 +05:30
Shariq Ansari
1362e2b6bf Merge pull request #45637 from shariquerik/notes-tab 2025-02-03 13:22:36 +05:30
Shariq Ansari
018df3135a fix: renamed Commments Tab to Notes tab in Lead doctype 2025-02-03 12:12:36 +05:30
rohitwaghchaure
0a25fe981b Merge pull request #45619 from mihir-kandoi/45442
feat: set bank account of company to default company bank account fro…
2025-02-03 12:00:35 +05:30
rohitwaghchaure
60da21be55 Merge pull request #45621 from mihir-kandoi/delivered-button
fix: delivered button of purchase order
2025-02-03 11:51:37 +05:30
rohitwaghchaure
3cdc636111 Merge pull request #45648 from mihir-kandoi/st30593
fix: consider process_loss_qty in work order
2025-02-03 11:50:31 +05:30
Frappe PR Bot
bd2c3711c0 fix: Bosnian translations 2025-02-03 03:17:38 +05:30
Frappe PR Bot
589325e14b fix: Persian translations 2025-02-03 03:17:35 +05:30
Frappe PR Bot
cd20d7aa8e fix: Chinese Simplified translations 2025-02-03 03:17:31 +05:30
frappe-pr-bot
99c3fb6ba5 chore: update POT file 2025-02-02 09:35:01 +00:00
Dany Robert
2a258c1629 fix: ignore expired batch for pick list
(cherry picked from commit 786db3d0fa)
2025-02-02 08:04:04 +00:00
Frappe PR Bot
4b345cf495 fix: sync translations from crowdin (#45656)
* fix: Swedish translations

* fix: Persian translations

* fix: Bosnian translations
2025-02-01 23:48:25 +01:00
Frappe PR Bot
33ce49730a fix: sync translations from crowdin (#45650) 2025-02-01 20:01:17 +01:00
Mihir Kandoi
95fda47b6c fix: consider process_loss_qty in work order 2025-02-01 00:35:12 +05:30
rohitwaghchaure
75567dc9ff Merge pull request #45646 from rohitwaghchaure/fixed-support-30611
fix: not able to make manufacturing entry for alternate items
2025-01-31 23:47:43 +05:30
Rohit Waghchaure
1607aa1a44 fix: not able to make manufacturing entry for alternate items 2025-01-31 23:28:54 +05:30
rohitwaghchaure
1a83316112 Merge pull request #45642 from rohitwaghchaure/fixed-support-30559
fix: actual qty showing blank for sub-assembly items
2025-01-31 22:38:04 +05:30
Sugesh393
707c01487e fix: add allow_on_submit for party_balance, paid_from_account_balance and paid_to_account_balance 2025-01-31 17:49:28 +05:30
Rohit Waghchaure
5be2e71a35 fix: actual qty showing blank for sub-assembly items 2025-01-31 16:49:55 +05:30
l0gesh29
5676d60ed3 feat: add repost accounting ledger entry for payment entry 2025-01-31 16:00:00 +05:30
rohitwaghchaure
3e35c48cf7 Merge pull request #45626 from rohitwaghchaure/fixed-support-29212-1
fix: validation to prevent submission, if the SABB is not linked to a stock transaction
2025-01-31 14:43:12 +05:30
Rohit Waghchaure
f976115a2b fix: validation to prevent submission if the SABB is not linked to a stock transaction 2025-01-31 14:04:27 +05:30
ruthra kumar
e2db3b9cfc Merge pull request #45615 from ljain112/fix-pe-erroe
fix: correct error message in payment entry
2025-01-31 12:56:14 +05:30
Deepesh Garg
2c94867b0e fix: Do not check for cancelled invoices 2025-01-31 12:17:53 +05:30
rohitwaghchaure
a913c9b202 Merge pull request #45629 from mihir-kandoi/st30495
fix: attribute 'msgbox' not found in sales invoice.js
2025-01-31 12:03:47 +05:30
Diptanil Saha
fe51535392 fix: pos print receipt on submit (#45632) 2025-01-31 12:00:00 +05:30
Deepesh Garg
701fc02050 fix: Do not check for cancelled invoices 2025-01-31 11:44:51 +05:30
Mihir Kandoi
5643385c22 fix: attribute 'msgbox' not found in sales invoice.js 2025-01-31 11:26:01 +05:30
Diptanil Saha
5a1851dfe3 fix: loading print receipt only at order complete (#45627) 2025-01-31 11:17:48 +05:30
ruthra kumar
437444fe04 Merge pull request #45623 from frappe/l10n_develop
fix: sync translations from crowdin
2025-01-31 10:54:40 +05:30
Frappe PR Bot
00f9a36980 fix: Swedish translations 2025-01-31 03:11:13 +05:30
Mihir Kandoi
41649cf52d fix: bind this to function 2025-01-30 22:53:00 +05:30
ljain112
592704cfd0 fix: correct error message in payment entry 2025-01-30 17:27:44 +05:30
rohitwaghchaure
b3ffb82586 Merge pull request #45612 from rohitwaghchaure/fixed-posting-date
fix: posting_date to posting_datetime in stock related queries
2025-01-30 17:05:26 +05:30
Rohit Waghchaure
e61ab48145 fix: posting_date to posting_datetime in stock related queries 2025-01-30 16:04:06 +05:30
rohitwaghchaure
b8ee15269c Merge pull request #45609 from rohitwaghchaure/fixed-support-30336
fix: reposting issue with s3 backup
2025-01-30 15:58:14 +05:30
Mihir Kandoi
ce7702cc19 feat: set bank account of company to default company bank account from masters 2025-01-30 12:50:01 +05:30
ljain112
9faf78d3e5 fix: respect user set account if not advance account for getting outstanding invoices in payment entry 2025-01-30 12:32:14 +05:30
Rohit Waghchaure
6b454ca9a7 fix: reposting issue with s3 backup 2025-01-30 11:59:40 +05:30
Frappe PR Bot
9a34c4c1ec fix: sync translations from crowdin (#45608)
* fix: Turkish translations

* fix: Persian translations
2025-01-30 11:20:01 +05:30
Bhavan23
4dd37ba033 fix: filter the item tax template using the input text 2025-01-29 22:19:30 +05:30
rohitwaghchaure
968e235a3f Merge pull request #45486 from rohitwaghchaure/fixed-SABB-performance-issue
perf: stock entry with batch
2025-01-29 20:49:09 +05:30
rohitwaghchaure
90eefac6f6 Merge pull request #45600 from rohitwaghchaure/fixed-validation-msg
fix: validation message
2025-01-29 20:41:39 +05:30
Rohit Waghchaure
4c8dff942d fix: validation message 2025-01-29 20:36:58 +05:30
rohitwaghchaure
378afd2f65 Merge pull request #45596 from frappe/mergify/bp/develop/pr-45595
fix: do not allow to manually submit the SABB (backport #45595)
2025-01-29 16:44:12 +05:30
Sanket Shah
aaf720ab61 fix: Gross Profit Report with Correct Totals and Gross Margin (#45548)
Co-authored-by: Sanket322 <shahsanket322003.com>
2025-01-29 16:42:51 +05:30
Rohit Waghchaure
d042c841e4 fix: do not allow to manually submit the SABB
(cherry picked from commit 2b16eb5381)
2025-01-29 11:08:59 +00:00
ruthra kumar
409e512d47 Merge pull request #45569 from ljain112/fix-vch-outstanding
fix: update voucher outstanding from payment ledger
2025-01-29 16:11:02 +05:30
Safvan Huzain
3f2e93dcb6 fix(query): remove duplicate docstatus condition (#45586)
fix: remove duplicate docstatus condition in query
2025-01-29 10:27:01 +00:00
l0gesh29
79b5a3e1dd fix: remove tds account in taxes table on change of Tax Withholding Category 2025-01-29 15:37:38 +05:30
ruthra kumar
72b940e3d3 Merge pull request #45441 from ljain112/fix-tax-withhel-details
fix: show payment entries in tax withheld vouchers
2025-01-29 15:35:50 +05:30
ruthra kumar
9ae8e94e6c Merge pull request #45585 from ruthra-kumar/auto_add_taxes
refactor: auto add taxes from template
2025-01-29 15:28:12 +05:30
ruthra kumar
d1086722bf refactor: auto add taxes from template 2025-01-29 14:38:50 +05:30
Sugesh G
d748b491ee fix: use currency from opportunity while creating quotation (#45540) 2025-01-29 12:35:45 +05:30
rohitwaghchaure
5e8e7dd3d8 Merge pull request #45536 from rtdany10/precision-return
fix: return qty error due to precision
2025-01-29 12:19:54 +05:30
Ejaaz Khan
5a023dc8d4 fix: add multiple item issue in stock entry (#45544) 2025-01-29 12:19:01 +05:30
Lakshit Jain
9f20854bd9 fix: get stock balance filtered by company for validating stock value in jv (#45549)
* fix: get stock balance filtered by company for validating stock value in jv

* test: error is raised  on validate
2025-01-29 12:16:11 +05:30
ruthra kumar
a64a4f9b20 Merge pull request #45575 from frappe/l10n_develop
fix: sync translations from crowdin
2025-01-29 11:25:43 +05:30
Frappe PR Bot
ac32c554af fix: Turkish translations 2025-01-29 03:14:46 +05:30
Frappe PR Bot
ceb4f249cb fix: Swedish translations 2025-01-29 03:14:43 +05:30
rohitwaghchaure
2609f9809d Merge pull request #43270 from rohitwaghchaure/feat-stock-reservation-for-wo
feat: stock reservation for Work Order
2025-01-28 18:06:57 +05:30
ljain112
dd77070351 fix: update voucher outstanding from payment ledger 2025-01-28 17:54:16 +05:30
Rohit Waghchaure
4d050441b3 feat: stock reservation for Work Order 2025-01-28 16:42:57 +05:30
Akhil Narang
8e77b26641 Merge pull request #45554 from akhilnarang/fixup-44604
fix(book_appointment): stop trying to use pytz api with zoneinfo
2025-01-28 16:25:27 +05:30
Akhil Narang
b08da0f6bd fix(book_appointment): stop trying to use pytz api with zoneinfo
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-28 16:09:26 +05:30
ruthra kumar
b1eb604363 Merge pull request #45560 from ruthra-kumar/rename_swiss_coa
chore: rename file to standard name format
2025-01-28 16:03:19 +05:30
ruthra kumar
7bc075376b chore: rename file to standard name format 2025-01-28 14:34:49 +05:30
ruthra kumar
7e7209e448 Merge pull request #45452 from aerele/payment-entry-transaction-currency
fix(payment entry): get amount in transaction currency
2025-01-28 14:33:30 +05:30
ruthra kumar
9964ddc0e9 Merge pull request #45551 from eagleautomate/swiss_coa
feat: Add chart of accounts for Switzerland
2025-01-28 11:33:57 +05:30
Sanket Shah
9933d3c8ff fix: update fields on change of item code In Update Items of Sales Order (#45125)
* fix: update fields on change of item code

* fix: minor update

* fix: set the new values always

* Revert "fix: set the new values always"

This reverts commit 44daa0a641.

---------

Co-authored-by: Sanket322 <shahsanket322003.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-01-28 11:27:28 +05:30
ruthra kumar
813cfdfff6 Merge pull request #45552 from frappe/l10n_develop
fix: sync translations from crowdin
2025-01-28 11:03:49 +05:30
Rohit Waghchaure
0b1b964b77 perf: stock entry with batch 2025-01-28 09:49:37 +05:30
Frappe PR Bot
d1fbeb11cb fix: Turkish translations 2025-01-28 03:03:54 +05:30
Frappe PR Bot
dc7e7118af fix: Swedish translations 2025-01-28 03:03:50 +05:30
Frappe PR Bot
26afba142e fix: French translations 2025-01-28 03:03:33 +05:30
eagleautomate
2c644ec2ef feat: Add chart of accounts for Switzerland
240812 Schulkontenrahmen VEB - DE
2025-01-27 19:29:36 +05:30
ruthra kumar
47c2c5377c Merge pull request #45345 from Sanket322/set_discount_properly
fix:  maintain existing discounts in get_pricing_rule_for_item
2025-01-27 16:01:46 +05:30
Dany Robert
3078578692 fix: return qty error due to precision 2025-01-27 09:54:06 +00:00
ruthra kumar
49570a5544 Merge pull request #45302 from aerele/validate-dimensions-company
feat: add company level validation for accounting dimension
2025-01-27 14:53:49 +05:30
meera-greycube
e88f96b92d feat : company field required for multi company setup (#45415)
* Update vehicle.json

feat : company field required for multi company setup

* Update vehicle.json

allow_rename fixed in vehicle.json

* fix: fix permission issue
2025-01-27 14:28:11 +05:30
ruthra kumar
e55d4030ec Merge pull request #45284 from aerele/pos-return-currency
fix: set party_account_currency for pos_invoice returns
2025-01-27 14:27:41 +05:30
ljain112
db38e7bf5a fix: correct amt in account currency for lcv with manually distributed charges. 2025-01-27 14:22:36 +05:30
Raffael Meyer
11f65f20a0 feat(Sales Invoice): allow linking to project without adding timesheets (#44295)
* feat(Sales Invoice): allow linking to project without adding timesheets

* test: add timesheet data
2025-01-27 13:20:57 +05:30
Diptanil Saha
2ac8c92e7f fix: currency decimal on POS Past Order List (#45524)
* fix: currency decimal on POS

* fix: removed precision
2025-01-27 13:02:24 +05:30
ruthra kumar
fb285749dd Merge pull request #45300 from HarryPaulo/fix-prevent-commit
fix: prevent unnecessary db.commit for contact insert
2025-01-27 12:18:07 +05:30
Frappe PR Bot
887645e55f fix: sync translations from crowdin (#45522)
* fix: French translations

* fix: Spanish translations

* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Esperanto translations
2025-01-26 23:19:32 +01:00
venkat102
af97f42429 fix(payment entry): get amount in transaction currency 2025-01-26 19:52:06 +05:30
Frappe PR Bot
eabdd5992b chore: update POT file (#45451) 2025-01-26 13:54:13 +01:00
Frappe PR Bot
29341245b8 fix: sync translations from crowdin (#45444)
* fix: Swedish translations

* fix: Turkish translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Persian translations
2025-01-26 12:15:18 +05:30
rohitwaghchaure
b5afd901f3 Merge pull request #45443 from rohitwaghchaure/fixed-support-29487
fix: allow to fix negative stock for batch using stock reco
2025-01-25 15:03:22 +05:30
Rohit Waghchaure
2e8cde3378 fix: allow to fix negative stock for batch using stock reco 2025-01-25 14:44:25 +05:30
ljain112
d97e78e5d3 fix: variable names 2025-01-25 13:16:06 +05:30
ljain112
55733d4f18 fix: show payment entries in Tax Withheld Vouchers 2025-01-25 13:04:12 +05:30
venkat102
bee2c04d0b fix(pos): add item in the existing item row when discount is applied 2025-01-25 12:59:04 +05:30
rohitwaghchaure
53704b98b5 fix: do not check budget during reposting (#45432) 2025-01-24 12:00:45 +00:00
rohitwaghchaure
bad1ac9fbc Merge pull request #45423 from rohitwaghchaure/fixed-support-29882
fix: precision issue in stock entry
2025-01-24 17:07:16 +05:30
Raffael Meyer
4008ca5ddd feat(UX): scroll to required field (#44367) 2025-01-24 16:36:46 +05:30
Rohit Waghchaure
9f3b8520fe fix: precision issue in stock entry 2025-01-24 16:07:25 +05:30
Sanket Shah
d862e9b771 fix: validate items against selling settings (#45288)
fix: validate_for_duplicate_items

Co-authored-by: Sanket322 <shahsanket322003.com>
2025-01-24 15:10:43 +05:30
Venkatesh
97acbb3134 fix: disable load_after_mapping when purchase order created from sales order (#45405) 2025-01-24 15:02:56 +05:30
Raffael Meyer
a9bc395e98 fix: secure bulk transaction (#45386) 2025-01-24 14:44:26 +05:30
Tufan Kaynak
42edb9f5b1 fix(material request): mapping Sales Order Item Delivery Date to Mate… (#45227)
* fix(material request): mapping Sales Order Item Delivery Date to Material Request Item Required By

as mentioned in https://discuss.frappe.io/t/item-delivery-date-on-sales-order-is-not-transferred-to-material-request-item-required-by-date/140479 
fixing
When you create a Material Request directly on the Sales Order via → Create → Material Request, Delivery Date on Sales Order Item is not transferred to Material Request Item Required By date.

* fix(linters): meaningless linters formatting message applied

In order to pass the linters test which I find meaningless as it asks for the comma after the last item in a dictionary data type

* fix(linters): formatting code for linters pass

Linters formatting applied
2025-01-24 14:20:20 +05:30
Martin Luessi
e82911041d fix: remove unnecessary auth from plaid connector (#44305) 2025-01-24 13:11:32 +05:30
rohitwaghchaure
3d7f1026ca Merge pull request #45335 from rohitwaghchaure/fixed-valuation-for-batch
fix: valuation for batch
2025-01-24 12:50:55 +05:30
Diptanil Saha
54d234e05d fix: resolved pos return setting to default mode of payment instead of user selection (#45377)
* fix: resolved pos return setting to default mode of payment instead of user selection

* refactor: removed console log statement

* refactor: moved get_payment_data to sales_and_purchase_return.py
2025-01-24 12:41:01 +05:30
Diptanil Saha
78c7c1c631 feat: full screen on pos (#45404)
* feat: full screen on pos

* refactor: variables for label

* fix: refactor and handled button label change

* refactor: rename enable fullscreen label
2025-01-24 07:07:36 +00:00
Rohit Waghchaure
8028dd2683 fix: version 2025-01-24 12:32:16 +05:30
mahsem
cd3f03696e fix: use frappe.datetime.str_to_user (#45216)
* fix: default_datetime_format

* fix: add_format_datetime

* fix: update to str_to_user  in point_of_sale/pos_controller.js

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>

* fix: convert_to_str_to_user

* fix: linters

* fix: whitespace

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-01-24 12:16:47 +05:30
Sugesh G
6ec18fb40d fix: set expense_account and cost_center based on company in stock entry (#45159)
* fix: set expense_account and cost_center based on company in stock entry

* fix: remove is_perpetual_inventory_enabled validation for cost_center
2025-01-24 12:13:44 +05:30
ruthra kumar
5bf90dccbb Merge pull request #45412 from frappe/l10n_develop
fix: sync translations from crowdin
2025-01-24 11:05:12 +05:30
Frappe PR Bot
9888c62e13 fix: Swedish translations 2025-01-24 02:26:17 +05:30
Rohit Waghchaure
5088d8576f fix: valuation for batch 2025-01-23 20:38:14 +05:30
Raffael Meyer
d92f9330fa fix: get default stock uom (#45384)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2025-01-23 14:32:39 +01:00
mergify[bot]
d1329c2910 fix: add condition to check if item is delivered by supplier in make_purchase_order_for_default_supplier() (backport #45370) (#45409)
fix: add condition to check if item is delivered by supplier in make_purchase_order_for_default_supplier() (#45370)

(cherry picked from commit 69464ab7ff)

Co-authored-by: Shanuka Hewage <89955436+Shanuka-98@users.noreply.github.com>
2025-01-23 18:18:58 +05:30
meike289
1758e125e0 fix: fix creating documents from sales invoice (#45346)
Co-authored-by: Meike Nedwidek <nedwidek@kk-software.de>
2025-01-23 17:54:00 +05:30
ruthra kumar
85b6fdd067 Merge pull request #45248 from niyazrazak/patch-22
chore: consider currency precision in bank clearance
2025-01-23 16:57:28 +05:30
ruthra kumar
c889bdba0f chore: import statements and linter 2025-01-23 16:39:03 +05:30
ruthra kumar
766b5fa5ed Merge pull request #44790 from ruthra-kumar/configurable_posting_date_for_exc_gain_loss
refactor: configurable posting date for Exc Gain / Loss journal
2025-01-23 16:28:21 +05:30
ruthra kumar
3923b784e3 Merge pull request #45129 from marination/ac-match-simplify
fix: Wrong `bank_ac_no` filter + simplify logic in automatch
2025-01-23 16:27:49 +05:30
ruthra kumar
7b8a099d95 Merge pull request #44950 from mahsem/postal_code_move_and_fixes
fix: postal_code_move_and_fixes
2025-01-23 16:17:15 +05:30
ruthra kumar
a71718883e refactor: support JE posting date in semi-auto reconciilation tool 2025-01-23 16:11:35 +05:30
ruthra kumar
2f3281579a test: exc gain/loss posting date based on configuration 2025-01-23 14:44:40 +05:30
ruthra kumar
b2c3da135e refactor: only apply configuration on normal payments
patch to update default value
2025-01-23 14:12:24 +05:30
ruthra kumar
95af63e305 refactor: allow reconciliation date for exchange gain / loss 2025-01-23 13:48:09 +05:30
rohitwaghchaure
f79eea2261 Merge pull request #45394 from rohitwaghchaure/fixed-support-30031
fix: JobCardTimeLog' object has no attribute 'remaining_time_in_mins'
2025-01-23 13:22:17 +05:30
ruthra kumar
5257413a93 refactor: configurable posting date for Exc Gain / Loss journal 2025-01-23 13:06:30 +05:30
Rohit Waghchaure
41dda35db7 fix: JobCardTimeLog' object has no attribute 'remaining_time_in_mins' 2025-01-23 13:03:37 +05:30
Sanket322
50223c6bec fix: remove applied pricing rule 2025-01-23 11:55:12 +05:30
Sanket Shah
2a400dd3f8 perf: optimize DB calls with frappe.get_all (#45289)
* perf: reduce multiple db queries

* fix: use frappe._dict instread of extra iteration

---------

Co-authored-by: Sanket322 <shahsanket322003.com>
2025-01-23 11:29:41 +05:30
Frappe PR Bot
551fa500e8 fix: sync translations from crowdin (#45387)
* fix: Swedish translations

* fix: Turkish translations
2025-01-23 11:18:59 +05:30
Mihir Kandoi
fe43d20545 fix: added item_group filter in item_code field in stock balance report (#45340)
* fix: added item_group filter in item_code field in stock balance report

* feat: added filter to not show non stock items
2025-01-23 11:17:35 +05:30
rohitwaghchaure
8e18c572f4 Merge pull request #45367 from rohitwaghchaure/fixed-incorrect-calculation-of-qty
fix: batch qty calculation
2025-01-23 09:40:16 +05:30
Rohit Waghchaure
f07a71a882 fix: batch qty calculation 2025-01-22 21:06:43 +05:30
rohitwaghchaure
c5f21a5686 Merge pull request #45382 from rohitwaghchaure/fixed-support-29769
fix: precision issue causing incorrect status
2025-01-22 20:17:20 +05:30
Rohit Waghchaure
4a7586cc01 fix: precision issue causing incorrect status 2025-01-22 18:04:52 +05:30
ruthra kumar
3fbd2ca0d9 refactor: configurable posting date for Exc Gain / Loss journal 2025-01-22 17:54:00 +05:30
Diógenes Souza
b26f0b6633 fix: System was allowing to save payment schedule amount less than grand total (#45322)
* fix: System was allowing to save payment schedule amount less than grand_total

* style: After run pre-commit
2025-01-22 17:52:26 +05:30
Rethik M
05579959f2 fix: validate non-stock item for exchange loss/gain (#45306)
* fix: validate non-stock item

* test: add unit test to validate non-stock item exchange difference

* fix: use usd supplier
2025-01-22 17:44:53 +05:30
gavin
4481ca83ff fix: set preferred email in Employee via backend controller (#45320)
fix: set preferred email in Employee (backend)

Set "Preferred Email" for Employee via validate. Unset value when
prefered_contact_email is also unset.
2025-01-22 17:41:41 +05:30
Khushi Rawat
9ff3101b2d fix: added debounce to prevent multiple clicks (#45369)
* fix: added debounce to prevent multiple clicks

* fix: linters check
2025-01-22 17:26:38 +05:30
mergify[bot]
8b6a20d501 fix: precision on work order total qty (backport #45341) (#45361)
fix: precision on work order total qty (#45341)

* fix: precision on work order total qty

* chore: linters

(cherry picked from commit 53468202de)

Co-authored-by: Dany Robert <rtdany10@gmail.com>
2025-01-22 17:25:50 +05:30
Raffael Meyer
be2593bb51 refactor!: remove redundant title field from sales transactions (#45115)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2025-01-22 11:35:41 +00:00
Ejaaz Khan
5207917993 feat: set default view as tree-view (#45365)
feat: set default view as treeview
2025-01-22 16:18:31 +05:30
Deepesh Garg
84d379914c Merge pull request #45371 from deepeshgarg007/closing_balance_patch_rerun
fix: Do no query GLs if no PCVs are posted
2025-01-22 14:02:23 +05:30
Deepesh Garg
f4d1a54588 fix: Do no query GLs if no PCVs are posted 2025-01-22 13:46:37 +05:30
ruthra kumar
1c6a7830c3 Merge pull request #45363 from frappe/l10n_develop
fix: sync translations from crowdin
2025-01-22 12:12:43 +05:30
Frappe PR Bot
4455312b73 fix: Turkish translations 2025-01-22 01:34:43 +05:30
Sugesh393
36bae55299 chore: update variable names for improved readability 2025-01-21 17:38:24 +05:30
Niklas Liechti
dedb96d337 refactor: return job_id to be able to react to it when job is finished. (#45111) 2025-01-21 17:38:12 +05:30
ruthra kumar
d73c17aa98 Merge pull request #45242 from aerele/pos-invoice-item
fix: include pos invoice in modifing key for returned item validation
2025-01-21 16:34:59 +05:30
ruthra kumar
4f55356c79 Merge pull request #45215 from aerele/handle_aed_exchange_rate_manually
fix: calculate AED exchange rate based on pegged value with USD
2025-01-21 13:58:21 +05:30
Deepesh Garg
993f40fa43 perf: Ignore is_opening column in GL Queries (#45327)
* perf: Ignore is_opening column in GL Queries

* chore: Remove unwanted changes

* chore: Remove unwanted changes

* chore: Remove unwanted changes

* chore: Remove unwanted changes

* chore: Remove unwanted changes

* chore: Remove unwanted changes
2025-01-21 13:45:25 +05:30
ruthra kumar
2e535955b3 refactor: use dictionary for better expandability 2025-01-21 12:15:26 +05:30
ruthra kumar
dd923332cb refactor: fix type error 2025-01-21 12:15:26 +05:30
Frappe PR Bot
7b0c21e989 fix: sync translations from crowdin (#45323)
* fix: Swedish translations

* fix: Turkish translations

* fix: French translations

* fix: Spanish translations

* fix: Arabic translations

* fix: Hungarian translations

* fix: Polish translations

* fix: Russian translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Chinese Simplified translations

* fix: Persian translations

* fix: Bosnian translations

* fix: German translations

* fix: Esperanto translations

* fix: Swedish translations

* fix: Turkish translations

* fix: Persian translations
2025-01-20 22:57:21 +01:00
rohitwaghchaure
6c32397313 Merge pull request #45282 from mihir-kandoi/44976
feat: Add corrective job card operating cost as additional costs in s…
2025-01-20 22:48:46 +05:30
rohitwaghchaure
5638dac414 Merge pull request #45344 from iamejaaz/broken-bom-tree
fix: broken image issue in BOM Tree
2025-01-20 22:48:05 +05:30
Sanket322
e2a32b7257 fix: use user defined discount amount or default 2025-01-20 18:01:31 +05:30
Ejaaz Khan
7c6e279599 fix: broken image issue in BOM Tree 2025-01-20 17:49:18 +05:30
Diptanil Saha
68fb1b28eb fix: set invoice start date to subscription start date (#45342) 2025-01-20 17:06:02 +05:30
Mihir Kandoi
47f8a86003 fix: logical error in where condition of qb query 2025-01-20 12:41:28 +05:30
ruthra kumar
5fb158a6f7 Merge pull request #45202 from DaizyModi/fix-party-bank-acc-in-pe
fix: Correct Party Bank Account mapping in `Payment Entry` from Transactional Doctypes
2025-01-20 12:22:10 +05:30
ruthra kumar
30e87c37dc Merge pull request #45334 from mahsem/translation_fixes
fix: translation fixes
2025-01-20 12:11:32 +05:30
ruthra kumar
f9200a9575 Merge pull request #45167 from aerele/validate-sales-person
fix: validate linked sales person
2025-01-20 11:49:14 +05:30
mahsem
3697ba0772 fix: linters 2025-01-19 21:00:02 +01:00
mahsem
1d81a9f933 fix: translation fixes 2025-01-19 20:52:58 +01:00
Frappe PR Bot
da34d7923d chore: update POT file (#45331) 2025-01-19 11:47:50 +01:00
rohitwaghchaure
04364d680f Merge pull request #44783 from rohitwaghchaure/fixed-support-27273
fix: do not reset picked items
2025-01-18 14:22:54 +05:30
Rohit Waghchaure
34a80bfcd3 fix: do not reset picked items 2025-01-18 12:44:30 +05:30
rohitwaghchaure
76ba17808b Merge pull request #45298 from rohitwaghchaure/fixed-qi-company
fix: company in quality inspection
2025-01-18 12:14:54 +05:30
Rohit Waghchaure
397cd79e1e fix: company in quality inspection 2025-01-18 11:09:00 +05:30
Diptanil Saha
97e3770872 fix: fixed typo in manufacturing settings and field rename (#45238)
* chore: field rename and patch entry

* chore: patch file rename and description improvement

---------

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2025-01-17 11:54:39 +00:00
ruthra kumar
8f9b5aaae7 Merge pull request #44811 from sagarvora/fix-pcv-patch-99
fix!: ensure multiple PCVs in same fiscal year are considered in patch
2025-01-17 17:00:40 +05:30
Diptanil Saha
d13c03676b chore: quickbooks migrator integration removal (#45240) 2025-01-17 16:53:36 +05:30
Diptanil Saha
98d401bee4 fix: fetching items from blanket order to sales/purchase order (#45262)
* fix: blanket order with zero item quantity

* fix: item quantity validation

* refactor: resolve linter issue
2025-01-17 16:53:06 +05:30
Nabin Hait
ec487c14d9 fix: Ambiguous column error while creating Sales Return (#45275) 2025-01-17 16:51:07 +05:30
Nabin Hait
2d45d0e5d5 fix: updated modified timestamp for stock entry type (#45280) 2025-01-17 16:50:43 +05:30
Lakshit Jain
ada272a29b fix: round off tax withholding amount (#45271) 2025-01-17 16:50:15 +05:30
Patrick Eißler
8d66142865 fix(Project): re-phrase welcome email (#45175) 2025-01-17 12:17:32 +01:00
Sagar Vora
84e0b41c4f fix: ensure multiple PCVs in same fiscal year are considered in patch 2025-01-17 16:44:06 +05:30
Sanket Shah
19c8708e5e fix: don't update party-type on change of cost center in Journal Entry (#45291)
fix: don't update party-type on change of cost center

Co-authored-by: Sanket322 <shahsanket322003.com>
2025-01-17 16:42:04 +05:30
Ejaaz Khan
aa38895caf feat: add option to update modified on communication recieved (#45307) 2025-01-17 16:40:35 +05:30
rohitwaghchaure
9163f60191 fix: sales return for multi-uom (#45303) 2025-01-17 16:35:59 +05:30
Sugesh393
454067198e fix: set company related values 2025-01-17 11:46:17 +05:30
Sugesh393
c94091d68f test: add new unit test for company validation in accounting dimension 2025-01-17 11:45:51 +05:30
Sugesh393
60efd3e219 feat: add company level validation for accounting dimension 2025-01-17 11:41:52 +05:30
Frappe PR Bot
0e7e9b5f0a fix: sync translations from crowdin (#45299)
* fix: Turkish translations

* fix: Persian translations
2025-01-16 22:49:23 +01:00
HarryPaulo
87de5c7450 fix: prevent unnecessary db.commit for contact insert [Linters] 2025-01-16 17:51:22 -03:00
HarryPaulo
5f15b0b65b fix: prevent unnecessary db.commit 2025-01-16 17:40:54 -03:00
Mihir Kandoi
063a205e5a refactor: added condition which checks for corrective operation setting 2025-01-16 20:55:27 +05:30
rohitwaghchaure
43ce185429 Merge pull request #45283 from rohitwaghchaure/fixed-github-45219
fix: Does not allow to create Sub-Asseblies of Sub Assemblies
2025-01-16 14:57:56 +05:30
Rohit Waghchaure
318a945d66 fix: Does not allow to create Sub-Asseblies of Sub Assemblies 2025-01-16 13:51:11 +05:30
ruthra kumar
6628d290de Merge pull request #45285 from frappe/l10n_develop
fix: sync translations from crowdin
2025-01-16 11:10:32 +05:30
Mihir Kandoi
4fb48b7f22 test: Added test for new feature 2025-01-16 10:08:47 +05:30
Frappe PR Bot
ed2764ab8d fix: Persian translations 2025-01-15 23:49:21 +05:30
Frappe PR Bot
a7cd17ac8b fix: Turkish translations 2025-01-15 23:49:14 +05:30
Sugesh393
484ecf2479 test: add new unit test to check payments amount of pos_invoice returns 2025-01-15 18:27:57 +05:30
Sugesh393
2af6fca7fa fix: set party_account_currency for pos_invoice returns 2025-01-15 18:20:20 +05:30
Mihir Kandoi
2bf10f68a8 feat: Add corrective job card operating cost as additional costs in stock entry 2025-01-15 18:14:19 +05:30
rohitwaghchaure
cb91e8e69e Merge pull request #45278 from rohitwaghchaure/fixed-github-45246
fix: status of the serial no for the raw materials
2025-01-15 18:13:34 +05:30
Rohit Waghchaure
9607b16dcf fix: status of the serial no for the raw materials 2025-01-15 17:53:11 +05:30
Lakshit Jain
37a5767be5 fix: check if tds deducted based on Purchase Taxes and Charges (#45161) 2025-01-15 15:31:56 +05:30
rohitwaghchaure
195254756f Merge pull request #45270 from mihir-kandoi/st29053
fix: Skip WIP Warehouse transfer
2025-01-15 15:05:49 +05:30
Lakshit Jain
a4453fb77b fix: use currency defined in plan for subscription invoice (#45104) 2025-01-15 14:52:25 +05:30
Mihir Kandoi
6edb454eea test: Added new test to check wip skip 2025-01-15 13:49:11 +05:30
rohitwaghchaure
001d1eb3f9 Merge pull request #45259 from rohitwaghchaure/fixed-support-29045
fix: incorrect valuation for sales return with different warhouse
2025-01-14 18:33:34 +05:30
Rohit Waghchaure
3a2e816759 fix: incorrect valuation for sales return with different warhouse 2025-01-14 18:11:17 +05:30
ruthra kumar
ce9c606f71 refactor: allow users to configure interval for Semi-Auto payment reconciliation (#45211)
* refactor: configurable interval for reconciliation trigger

* refactor: set default value for interval

* refactor: configurable queue size

* refactor: use patch to setup default cron job

* refactor: use 'after_migrate' to setup cron for reconciliation

User specified interval will be used

* chore: type casting

* refactor: use scheduler_event to persist cron

* chore: rename field

* chore: use configured queue size

* chore: remove unwanted field
2025-01-14 16:59:15 +05:30
Mihir Kandoi
09d26a835f fix: tests 2025-01-14 16:27:49 +05:30
ruthra kumar
aea69af4ff Merge pull request #45182 from ruthra-kumar/configurable_reconciliation_dates
refactor: configurable reconciliation dates for Advance Payments
2025-01-14 15:18:46 +05:30
ruthra kumar
fd442a36a9 Merge pull request #45260 from ruthra-kumar/incorrect_label
fix: incorrect label in Item-wise sales register
2025-01-14 13:55:20 +05:30
ruthra kumar
9ee5fcc602 refactor: only update reconcile_effect_on advance in separate acc 2025-01-14 13:52:21 +05:30
ruthra kumar
d9013e1054 fix: incorrect label in Item-wise sales register 2025-01-14 13:34:12 +05:30
rohitwaghchaure
9bb7d4e428 Merge pull request #45241 from rohitwaghchaure/fixed-support-28979
fix: auto fetch batch and serial no for draft stock transactions
2025-01-14 12:35:17 +05:30
mahsem
a3165c5719 fix: change string to be able to translate (#45090)
* fix: change_string_to_translate

* fix: debit note translation

* chore: update 'modified' field

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-01-14 06:26:01 +00:00
ruthra kumar
601bc3026d Merge pull request #45249 from frappe/l10n_develop
fix: sync translations from crowdin
2025-01-14 11:17:27 +05:30
ruthra kumar
aeedaae761 Merge pull request #45078 from Sanket322/cancel_subscription
fix: don't create invoice if `current_invoice_start ` is in future
2025-01-14 10:12:33 +05:30
ruthra kumar
2e8723407f Merge pull request #45074 from Sanket322/set_shipping_address
fix: set billing and shipping address on change of company
2025-01-14 10:04:13 +05:30
ruthra kumar
4b483e176d Merge pull request #45001 from ljain112/fix-tds-excess
fix: deduct tds on excess amount if checked
2025-01-14 10:02:06 +05:30
ruthra kumar
f7a93640b0 Merge pull request #44798 from aerele/apply_pricing_rule
fix: update  discounting on mixed conditions
2025-01-14 09:58:03 +05:30
Frappe PR Bot
8f8cddb03c fix: Persian translations 2025-01-13 23:39:50 +05:30
Frappe PR Bot
ea4526ad30 fix: Turkish translations 2025-01-13 23:39:40 +05:30
Frappe PR Bot
6c5a9f5a74 fix: sync translations from crowdin (#45174) 2025-01-13 18:02:50 +01:00
Mihir Kandoi
bbb5f8056b fix: Skip WIP Warehouse transfer 2025-01-13 21:32:34 +05:30
NIYAZ RAZAK
83bb3926b1 chore: consider currency precision 2025-01-13 18:53:59 +03:00
ruthra kumar
9fa1865cb7 refactor: backwards compatibility 2025-01-13 17:17:18 +05:30
Rohit Waghchaure
88ab9be79c fix: auto fetch batch and serial no for draft stock transactions 2025-01-13 17:17:03 +05:30
venkat102
2936139c79 fix: include pos invoice in modifing key for returned item validation 2025-01-13 16:51:25 +05:30
ruthra kumar
a4271aa5d1 refactor: save reconcile effect on reference table 2025-01-13 16:20:58 +05:30
ruthra kumar
7e7775aa44 refactor: store reconciliation date in reference
Helps with reposting
2025-01-13 15:56:41 +05:30
Diptanil Saha
e529f82392 fix: batch number search on pos (#45209)
* fix: price of items with batch number not having seperate item price on pos search bar

* fix: introduced batch number based sorting
2025-01-13 12:06:46 +05:30
Ejaaz Khan
eea0eff001 fix: ui issues across multiple pages (#45224)
* fix: ui issues across multiple pages

* refactor: change cur_from to frm
2025-01-13 11:56:59 +05:30
Ejaaz Khan
6eb3b0b1c2 refactor: remove columns from list in child table (#45189) 2025-01-13 11:54:44 +05:30
Ejaaz Khan
53c282c86e refactor: remove party type from general ledger print format (#45196)
refactor: remove party type from print format
2025-01-13 11:52:45 +05:30
Frappe PR Bot
959434601d chore: update POT file (#45231) 2025-01-12 11:27:09 +01:00
rohitwaghchaure
c6c7d7832a Merge pull request #45207 from rohitwaghchaure/fixed-support-29140
fix: incorrect valuation rate for PI based revaluation
2025-01-11 10:07:54 +05:30
rohitwaghchaure
edb254e43e Merge pull request #45214 from rohitwaghchaure/fixed-support-29172
fix: delivery_document_no column issue
2025-01-11 10:07:26 +05:30
Kavin
455ef6f084 fix: calculate AED exchange rate based on pegged value with USD 2025-01-10 18:20:47 +05:30
Rohit Waghchaure
61efb2bb39 fix: delivery_document_no column issue 2025-01-10 18:19:48 +05:30
ruthra kumar
856ec08484 Merge pull request #45195 from sokumon/coa-ui
fix: coa actions cleanup
2025-01-10 16:08:19 +05:30
rohitwaghchaure
31005c5984 Merge pull request #45076 from frappe/valuation_in_ageing_report
feat: Added valuation of quantity for each age group in stock ageing …
2025-01-10 14:25:50 +05:30
Rohit Waghchaure
14ce2337df fix: incorrect valuation rate for PI based revaluation 2025-01-10 14:20:48 +05:30
ruthra kumar
e0517852bc test: ensure reconciliation date config takes effect 2025-01-10 12:17:13 +05:30
rohitwaghchaure
e4d3235b9c Merge pull request #45204 from frappe/mergify/bp/develop/pr-45197
fix: precision loss causing process loss variance (backport #45197)
2025-01-10 12:00:37 +05:30
rohitwaghchaure
5ccf4a1783 chore: fix conflicts 2025-01-10 11:25:53 +05:30
FATHIH MOHAMMED
1ef9f7f8fd fix: precision loss causing process loss variance
(cherry picked from commit d84601b2a3)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2025-01-10 05:49:59 +00:00
DaizyModi
376bdc75f4 fix: Correct Party Bank Account mapping in Payment Entry 2025-01-10 11:06:39 +05:30
ruthra kumar
c8e93e7a61 refactor: hide old checkbox 2025-01-09 20:41:29 +05:30
ruthra kumar
bb8d2c994c refactor: payment entry to handle posting date on configuation 2025-01-09 20:41:29 +05:30
ruthra kumar
fb6c72a247 refactor: test cases updated 2025-01-09 20:41:29 +05:30
ruthra kumar
a8a8ac71b6 refactor: patch to migrate checkbox to select 2025-01-09 20:41:27 +05:30
ruthra kumar
8b2c981fc3 refactor: introduce select fields in company and payment entry 2025-01-09 20:22:05 +05:30
sokumon
108a91d788 fix: coa actions cleanup 2025-01-09 16:49:24 +05:30
rohitwaghchaure
1f1c01d88e Merge pull request #44988 from frappe/35225
feat: Validate sub assembly and material request items in Production …
2025-01-09 16:28:29 +05:30
rohitwaghchaure
90339511aa Merge pull request #45190 from diptanilsaha/fix-typo-in-manufacturing-settings
fix: typo in manufacturing settings
2025-01-09 16:26:01 +05:30
diptanilsaha
a9b761f862 fix: typo in manufacturing settings 2025-01-09 16:05:40 +05:30
rohitwaghchaure
4ec824d71e Merge pull request #45183 from rohitwaghchaure/fixed-support-29059
fix: not able to see create Quality Inspection button
2025-01-09 14:36:52 +05:30
rohitwaghchaure
bb9dd7b8cc Merge pull request #45180 from rohitwaghchaure/fixed-support-28867
fix: do not add ordered items from Quotation to new Sales Order
2025-01-09 14:34:13 +05:30
Rohit Waghchaure
b291835ccd fix: not able to see create Quality Inspection button 2025-01-09 14:31:01 +05:30
Rohit Waghchaure
2e930eb97b fix: do not add ordered items from Quotation to new Sales Order 2025-01-09 13:52:34 +05:30
rohitwaghchaure
00dadc1a89 Merge pull request #45177 from rohitwaghchaure/fixed-support-29008
fix: timeout error for work order
2025-01-09 13:47:17 +05:30
Rohit Waghchaure
b4ceda6f2c fix: timeout error for work order 2025-01-09 13:27:43 +05:30
Khushi Rawat
7ea73d8265 chore: removal of decapitalization feature (#45162)
* chore: removal of decapitalization feature

* fix: rearrangement of asset capitalization doctype fields
2025-01-08 20:44:12 +05:30
Raffael Meyer
9e760e54a5 fix(Timesheet): ignore permissions when updating Task and Project (#45168) 2025-01-08 13:36:31 +01:00
Sudharsanan11
e614f07795 fix: validate linked sales person 2025-01-08 13:51:33 +05:30
Ejaaz Khan
81d8f257aa refactor: validate due date code and message according to doctype (#45126)
* refactor: change message of date comparision and refactor code

* refactor: commonify function call for sales and purchase invoice

* refactor: remove redundant mandatory error validation
2025-01-08 12:49:02 +05:30
Mihir Kandoi
dbb572eec1 test: Valuation of ageing stock 2025-01-08 11:52:24 +05:30
ruthra kumar
2b453219fc Merge pull request #45148 from frappe/l10n_develop
fix: sync translations from crowdin
2025-01-08 09:01:02 +05:30
ruthra kumar
ca44a31420 Merge pull request #45154 from ruthra-kumar/remove_possible_deadlock_in_auto_reconcile
fix: possible deadlock while using auto reconciliation
2025-01-08 09:00:42 +05:30
ruthra kumar
4620025dcd chore: remove 'Experimental' tag 2025-01-08 08:22:37 +05:30
ruthra kumar
5df9a8ab99 Merge pull request #45112 from marination/bank-reco-bank-balance
fix: Missing company filter breaks `get_account_balance` in Bank Reco
2025-01-08 08:16:21 +05:30
Frappe PR Bot
731822efac fix: Spanish translations 2025-01-07 21:48:22 +05:30
rohitwaghchaure
a24d7e8ecd Merge pull request #45144 from rohitwaghchaure/fixed-support-28796
fix: issue in returning components against the SCO
2025-01-07 18:31:18 +05:30
Rohit Waghchaure
729ce1dc50 fix: issue in returning components against the SCO 2025-01-07 18:11:56 +05:30
Diptanil Saha
31dd32dcdf fix: serial and batch no. buttons on pos (#45048) 2025-01-07 18:06:02 +05:30
Khushi Rawat
6850019649 feat: work in progress status for asset (#45066)
* feat: work in progress status for asset

* fix: test case correction

* fix(patch): added patch to update status of assets

* fix: updated tests
2025-01-07 17:38:21 +05:30
Diptanil Saha
2788739c1e feat: pos configuration for print receipt on complete order (#45024) 2025-01-07 17:35:01 +05:30
Diptanil Saha
9f77793f16 chore: removal of tally migration feature (#45100) 2025-01-07 17:28:46 +05:30
Ejaaz Khan
a0f17f8e73 refactor: change sales invoice button position (#45130) 2025-01-07 17:17:59 +05:30
Venkatesh
dc5bff9008 fix: ignore crm deal in tax_rule search filter (#45134) 2025-01-07 17:11:31 +05:30
marination
8521796811 fix: Wrong bank_ac_no filter + simplify convoluted logic 2025-01-07 13:28:55 +05:30
Sanket322
61d4593236 fix: minor update for readability 2025-01-07 12:44:29 +05:30
marination
d7bf73cffa fix: Override pre-commit behaviour due to conflicts with CI 2025-01-06 21:14:41 +05:30
marination
8de0fe78ea fix: Missing company filter breaks get_account_balance in Bank Reco 2025-01-06 20:27:06 +05:30
Mihir Kandoi
87f1f6e15c fix: Attempt to fix status updater 1 2025-01-06 19:47:44 +05:30
Mihir Kandoi
1f2d7da426 fix: Fixed final test case 2025-01-04 15:22:28 +05:30
Mihir Kandoi
f996f71d16 fix: Fixed more test cases 2025-01-04 15:17:31 +05:30
Mihir Kandoi
839b79ffd0 fix: Test case for ageing report 2025-01-03 20:00:36 +05:30
Sanket322
ce99764772 fix: pass right existing address 2025-01-03 18:04:56 +05:30
Sanket322
058fdca981 fix: don't create invoice if invoice start date is in future 2025-01-03 17:44:05 +05:30
Mihir Kandoi
2f80c4dee5 feat: Added valuation of quantity for each age group in stock ageing report 2025-01-03 16:51:44 +05:30
Sanket322
f46f1bead4 fix: set billing and shipping address on change of company 2025-01-03 16:44:24 +05:30
Mihir Kandoi
5dacfd5cda fix: Test case and refactored some code 2025-01-02 12:28:01 +05:30
Mihir Kandoi
015fd4a05b fix: Made requested changes by mentor and fixed some bugs in Production Plan Summary report 2025-01-01 16:51:48 +05:30
ljain112
a203e3ffaf fix: deduct tds on excess amount if checked 2024-12-31 13:46:50 +05:30
Mihir Kandoi
22d38c2af4 feat: Validate sub assembly and material request items in Production Plan and fix Production Plan summary reports not showing correct received quantity from subcontracted POs 2024-12-30 20:12:14 +05:30
mahsem
185bbb4c20 fix: postal_code_move_and_fixes 2024-12-28 09:25:30 +01:00
DHINESH00
547c8004eb fix: Semgrep rules 2024-12-23 11:23:23 +05:30
DHINESH00
d541259da9 fix: update discounting on mixed conditions 2024-12-19 17:15:11 +05:30
599 changed files with 345980 additions and 194207 deletions

View File

@@ -6,7 +6,7 @@ cd ~ || exit
sudo apt update
sudo apt remove mysql-server mysql-client
sudo apt install libcups2-dev redis-server mariadb-client
sudo apt install libcups2-dev redis-server mariadb-client libmariadb-dev
pip install frappe-bench

View File

@@ -8,6 +8,7 @@
"mail_login": "test@example.com",
"mail_password": "test",
"admin_password": "admin",
"use_mysqlclient": 1,
"root_login": "root",
"root_password": "root",
"host_name": "http://test_site:8000",

4
.github/release.yml vendored Normal file
View File

@@ -0,0 +1,4 @@
changelog:
exclude:
labels:
- skip-release-notes

View File

@@ -0,0 +1,30 @@
name: "Auto-label PRs based on title"
on:
pull_request_target:
types: [opened, reopened]
jobs:
add-label-if-prefix-matches:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check PR title and add label if it matches prefixes
uses: actions/github-script@v7
continue-on-error: true
with:
script: |
const title = context.payload.pull_request.title.toLowerCase();
const prefixes = ['chore', 'ci', 'style', 'test', 'refactor'];
// Check if the PR title starts with any of the prefixes
if (prefixes.some(prefix => title.startsWith(prefix))) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ['skip-release-notes']
});
}

View File

@@ -133,7 +133,7 @@ jobs:
run: cat ~/frappe-bench/bench_start.log || true
- name: Upload coverage data
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: github.event_name != 'pull_request'
with:
name: coverage-${{ matrix.container }}
@@ -149,7 +149,7 @@ jobs:
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: Upload coverage data
uses: codecov/codecov-action@v4

View File

@@ -2,29 +2,27 @@ pull_request_rules:
- name: Auto-close PRs on stable branch
conditions:
- and:
- and:
- author!=surajshetty3416
- author!=gavindsouza
- author!=rohitwaghchaure
- author!=nabinhait
- author!=ankush
- author!=deepeshgarg007
- author!=frappe-pr-bot
- author!=mergify[bot]
- or:
- base=version-13
- base=version-12
- base=version-14
- base=version-15
- base=version-16
- and:
- author!=surajshetty3416
- author!=gavindsouza
- author!=rohitwaghchaure
- author!=nabinhait
- author!=ankush
- author!=deepeshgarg007
- author!=frappe-pr-bot
- author!=mergify[bot]
- or:
- base=version-13
- base=version-12
- base=version-14
- base=version-15
- base=version-16
actions:
close:
comment:
message: |
@{{author}}, thanks for the contribution, but we do not accept pull requests on a stable branch. Please raise PR on an appropriate hotfix branch.
https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist#which-branch
message: |
@{{author}}, thanks for the contribution, but we do not accept pull requests on a stable branch. Please raise PR on an appropriate hotfix branch.
https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist#which-branch
- name: backport to develop
conditions:
- label="backport develop"
@@ -34,7 +32,6 @@ pull_request_rules:
- develop
assignees:
- "{{ author }}"
- name: backport to version-14-hotfix
conditions:
- label="backport version-14-hotfix"
@@ -44,7 +41,6 @@ pull_request_rules:
- version-14-hotfix
assignees:
- "{{ author }}"
- name: backport to version-15-hotfix
conditions:
- label="backport version-15-hotfix"
@@ -54,18 +50,6 @@ pull_request_rules:
- version-15-hotfix
assignees:
- "{{ author }}"
- name: backport to version-13-hotfix
conditions:
- label="backport version-13-hotfix"
actions:
backport:
branches:
- version-13-hotfix
assignees:
- "{{ author }}"
- name: Automatic merge on CI success and review
conditions:
- status-success=linters
@@ -96,6 +80,6 @@ pull_request_rules:
merge:
method: squash
commit_message_template: |
{{ title }} (#{{ number }})
{{ title }} (#{{ number }})
{{ body }}
{{ body }}

View File

@@ -1,5 +1,5 @@
exclude: 'node_modules|.git'
default_stages: [commit]
default_stages: [pre-commit]
fail_fast: false

View File

@@ -1,5 +1,5 @@
<div align="center">
<a href="https://erpnext.com">
<a href="https://frappe.io/erpnext">
<img src="./erpnext/public/images/v16/erpnext.svg" alt="ERPNext Logo" height="80px" width="80xp"/>
</a>
<h2>ERPNext</h2>
@@ -7,6 +7,7 @@
<p>Powerful, Intuitive and Open-Source ERP</p>
</p>
[![Learn on Frappe School](https://img.shields.io/badge/Frappe%20School-Learn%20ERPNext-blue?style=flat-square)](https://frappe.school)<br><br>
[![CI](https://github.com/frappe/erpnext/actions/workflows/server-tests-mariadb.yml/badge.svg?event=schedule)](https://github.com/frappe/erpnext/actions/workflows/server-tests-mariadb.yml)
[![docker pulls](https://img.shields.io/docker/pulls/frappe/erpnext-worker.svg)](https://hub.docker.com/r/frappe/erpnext-worker)
@@ -17,11 +18,11 @@
</div>
<div align="center">
<a href="https://erpnext-demo.frappe.cloud/app/home">Live Demo</a>
<a href="https://erpnext-demo.frappe.cloud/api/method/erpnext_demo.erpnext_demo.auth.login_demo">Live Demo</a>
-
<a href="https://erpnext.com">Website</a>
<a href="https://frappe.io/erpnext">Website</a>
-
<a href="https://docs.erpnext.com">Documentation</a>
<a href="https://docs.frappe.io/erpnext/">Documentation</a>
</div>
## ERPNext
@@ -114,26 +115,23 @@ To setup the repository locally follow the steps mentioned below:
2. In a separate terminal window, run the following commands:
```
# Create a new site
bench new-site erpnext.dev
# Map your site to localhost
bench --site erpnext.dev add-to-hosts
bench new-site erpnext.localhost
```
3. Get the ERPNext app and install it
```
# Get the ERPNext app
bench get-app https://github.com/frappe/erpnext
# Install the app
bench --site erpnext.dev install-app erpnext
bench --site erpnext.localhost install-app erpnext
```
4. Open the URL `http://erpnext.dev:8000/app` in your browser, you should see the app running
4. Open the URL `http://erpnext.localhost:8000/app` in your browser, you should see the app running
## Learning and community
1. [Frappe School](https://frappe.school) - Learn Frappe Framework and ERPNext from the various courses by the maintainers or from the community.
1. [Frappe School](https://school.frappe.io) - Learn Frappe Framework and ERPNext from the various courses by the maintainers or from the community.
2. [Official documentation](https://docs.erpnext.com/) - Extensive documentation for ERPNext.
3. [Discussion Forum](https://discuss.erpnext.com/) - Engage with community of ERPNext users and service providers.
4. [Telegram Group](https://erpnext_public.t.me) - Get instant help from huge community of users.
@@ -144,6 +142,7 @@ To setup the repository locally follow the steps mentioned below:
1. [Issue Guidelines](https://github.com/frappe/erpnext/wiki/Issue-Guidelines)
1. [Report Security Vulnerabilities](https://erpnext.com/security)
1. [Pull Request Requirements](https://github.com/frappe/erpnext/wiki/Contribution-Guidelines)
2. [Translations](https://crowdin.com/project/frappe)
## Logo and Trademark Policy

View File

@@ -4,7 +4,11 @@ files:
pull_request_title: "fix: sync translations from crowdin"
pull_request_labels:
- translation
- skip-release-notes
pull_request_reviewers:
- barredterra # change to your GitHub username if you copied this file
commit_message: "fix: %language% translations"
append_commit_message: false
languages_mapping:
two_letters_code:
pt-BR: pt_BR

View File

@@ -3,6 +3,7 @@
"allow_copy": 1,
"allow_import": 1,
"creation": "2013-01-30 12:49:46",
"default_view": "Tree",
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
"doctype": "DocType",
"document_type": "Setup",
@@ -194,7 +195,7 @@
"idx": 1,
"is_tree": 1,
"links": [],
"modified": "2024-08-19 15:19:11.095045",
"modified": "2025-01-22 10:40:35.766017",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",

View File

@@ -4,7 +4,7 @@
import frappe
from frappe import _, throw
from frappe.utils import cint, cstr
from frappe.utils import add_to_date, cint, cstr, pretty_date
from frappe.utils.nestedset import NestedSet, get_ancestors_of, get_descendants_of
import erpnext
@@ -479,6 +479,7 @@ def get_account_autoname(account_number, account_name, company):
@frappe.whitelist()
def update_account_number(name, account_name, account_number=None, from_descendant=False):
_ensure_idle_system()
account = frappe.get_cached_doc("Account", name)
if not account:
return
@@ -499,7 +500,7 @@ def update_account_number(name, account_name, account_number=None, from_descenda
"name",
)
if old_name:
if old_name and not from_descendant:
# same account in parent company exists
allow_child_account_creation = _("Allow Account Creation Against Child Company")
@@ -540,6 +541,7 @@ def update_account_number(name, account_name, account_number=None, from_descenda
@frappe.whitelist()
def merge_account(old, new):
_ensure_idle_system()
# Validate properties before merging
new_account = frappe.get_cached_doc("Account", new)
old_account = frappe.get_cached_doc("Account", old)
@@ -593,3 +595,31 @@ def sync_update_account_number_in_child(
for d in frappe.db.get_values("Account", filters=filters, fieldname=["company", "name"], as_dict=True):
update_account_number(d["name"], account_name, account_number, from_descendant=True)
def _ensure_idle_system():
# Don't allow renaming if accounting entries are actively being updated, there are two main reasons:
# 1. Correctness: It's next to impossible to ensure that renamed account is not being used *right now*.
# 2. Performance: Renaming requires locking out many tables entirely and severely degrades performance.
if frappe.flags.in_test:
return
last_gl_update = None
try:
# We also lock inserts to GL entry table with for_update here.
last_gl_update = frappe.db.get_value("GL Entry", {}, "modified", for_update=True, wait=False)
except frappe.QueryTimeoutError:
# wait=False fails immediately if there's an active transaction.
last_gl_update = add_to_date(None, seconds=-1)
if not last_gl_update:
return
if last_gl_update > add_to_date(None, minutes=-5):
frappe.throw(
_(
"Last GL Entry update was done {}. This operation is not allowed while system is actively being used. Please wait for 5 minutes before retrying."
).format(pretty_date(last_gl_update)),
title=_("System In Use"),
)

View File

@@ -10,6 +10,7 @@ frappe.treeview_settings["Account"] = {
fieldtype: "Select",
options: erpnext.utils.get_tree_options("company"),
label: __("Company"),
render_on_toolbar: true,
default: erpnext.utils.get_tree_default("company"),
on_change: function () {
var me = frappe.treeview_settings["Account"].treeview;
@@ -182,7 +183,9 @@ frappe.treeview_settings["Account"] = {
function () {
frappe.set_route("Tree", "Cost Center", { company: get_company() });
},
__("View")
__("View"),
"default",
true
);
treeview.page.add_inner_button(
@@ -190,31 +193,12 @@ frappe.treeview_settings["Account"] = {
function () {
frappe.set_route("Form", "Opening Invoice Creation Tool", { company: get_company() });
},
__("View")
__("View"),
"default",
true
);
treeview.page.add_inner_button(
__("Period Closing Voucher"),
function () {
frappe.set_route("List", "Period Closing Voucher", { company: get_company() });
},
__("View")
);
treeview.page.add_inner_button(
__("Journal Entry"),
function () {
frappe.new_doc("Journal Entry", { company: get_company() });
},
__("Create")
);
treeview.page.add_inner_button(
__("Company"),
function () {
frappe.new_doc("Company");
},
__("Create")
);
treeview.page.add_divider_to_button_group(__("View"));
// financial statements
for (let report of [
@@ -231,7 +215,7 @@ frappe.treeview_settings["Account"] = {
function () {
frappe.set_route("query-report", report, { company: get_company() });
},
__("Financial Statements")
__("View")
);
}
},

View File

@@ -116,6 +116,7 @@ def identify_is_group(child):
return is_group
@frappe.whitelist()
def get_chart(chart_template, existing_company=None):
chart = {}
if existing_company:

View File

@@ -0,0 +1,532 @@
{
"country_code": "ch",
"name": "240812 Schulkontenrahmen VEB - DE",
"tree": {
"Aktiven": {
"account_number": "1",
"is_group": 1,
"root_type": "Asset",
"Umlaufvermögen": {
"account_number": "10",
"is_group": 1,
"Flüssige Mittel": {
"account_number": "100",
"is_group": 1,
"Kasse": {
"account_number": "1000",
"account_type": "Cash"
},
"Bankguthaben": {
"account_number": "1020",
"account_type": "Bank"
}
},
"Kurzfristig gehaltene Aktiven mit Börsenkurs": {
"account_number": "106",
"is_group": 1,
"Wertschriften": {
"account_number": "1060"
},
"Wertberichtigungen Wertschriften": {
"account_number": "1069"
}
},
"Forderungen aus Lieferungen und Leistungen": {
"account_number": "110",
"is_group": 1,
"Forderungen aus Lieferungen und Leistungen (Debitoren)": {
"account_number": "1100"
},
"Delkredere": {
"account_number": "1109"
}
},
"Übrige kurzfristige Forderungen": {
"account_number": "114",
"is_group": 1,
"Vorschüsse und Darlehen": {
"account_number": "1140"
},
"Wertberichtigungen Vorschüsse und Darlehen": {
"account_number": "1149"
},
"Vorsteuer MWST Material, Waren, Dienstleistungen, Energie": {
"account_number": "1170"
},
"Vorsteuer MWST Investitionen, übriger Betriebsaufwand": {
"account_number": "1171"
},
"Verrechnungssteuer": {
"account_number": "1176"
},
"Forderungen gegenüber Sozialversicherungen und Vorsorgeeinrichtungen": {
"account_number": "1180"
},
"Quellensteuer": {
"account_number": "1189"
},
"Sonstige kurzfristige Forderungen": {
"account_number": "1190"
},
"Wertberichtigungen sonstige kurzfristige Forderungen": {
"account_number": "1199"
}
},
"Vorräte und nicht fakturierte Dienstleistungen": {
"account_number": "120",
"is_group": 1,
"Handelswaren": {
"account_number": "1200"
},
"Rohstoffe": {
"account_number": "1210"
},
"Werkstoffe": {
"account_number": "1220"
},
"Hilfs- und Verbrauchsmaterial": {
"account_number": "1230"
},
"Handelswaren in Konsignation": {
"account_number": "1250"
},
"Fertige Erzeugnisse": {
"account_number": "1260"
},
"Unfertige Erzeugnisse": {
"account_number": "1270"
},
"Nicht fakturierte Dienstleistungen": {
"account_number": "1280"
}
},
"Aktive Rechnungsabgrenzungen": {
"account_number": "130",
"is_group": 1,
"Bezahlter Aufwand des Folgejahres": {
"account_number": "1300"
},
"Noch nicht erhaltener Ertrag": {
"account_number": "1301"
}
}
},
"Anlagevermögen": {
"account_number": "14",
"is_group": 1,
"Finanzanlagen": {
"account_number": "140",
"is_group": 1,
"Wertschriften": {
"account_number": "1400"
},
"Wertberichtigungen Wertschriften": {
"account_number": "1409"
},
"Darlehen": {
"account_number": "1440"
},
"Hypotheken": {
"account_number": "1441"
},
"Wertberichtigungen langfristige Forderungen": {
"account_number": "1449"
}
},
"Beteiligungen": {
"account_number": "148",
"is_group": 1,
"Beteiligungen": {
"account_number": "1480"
},
"Wertberichtigungen Beteiligungen": {
"account_number": "1489"
}
},
"Mobile Sachanlagen": {
"account_number": "150",
"is_group": 1,
"Maschinen und Apparate": {
"account_number": "1500"
},
"Wertberichtigungen Maschinen und Apparate": {
"account_number": "1509"
},
"Mobiliar und Einrichtungen": {
"account_number": "1510"
},
"Wertberichtigungen Mobiliar und Einrichtungen": {
"account_number": "1519"
},
"Büromaschinen, Informatik, Kommunikationstechnologie": {
"account_number": "1520"
},
"Wertberichtigungen Büromaschinen, Informatik, Kommunikationstechnologie": {
"account_number": "1529"
},
"Fahrzeuge": {
"account_number": "1530"
},
"Wertberichtigungen Fahrzeuge": {
"account_number": "1539"
},
"Werkzeuge und Geräte": {
"account_number": "1540"
},
"Wertberichtigungen Werkzeuge und Geräte": {
"account_number": "1549"
}
},
"Immobile Sachanlagen": {
"account_number": "160",
"is_group": 1,
"Geschäftsliegenschaften": {
"account_number": "1600"
},
"Wertberichtigungen Geschäftsliegenschaften": {
"account_number": "1609"
}
},
"Immaterielle Werte": {
"account_number": "170",
"is_group": 1,
"Patente, Know-how, Lizenzen, Rechte, Entwicklungen": {
"account_number": "1700"
},
"Wertberichtigungen Patente, Know-how, Lizenzen, Rechte, Entwicklungen": {
"account_number": "1709"
},
"Goodwill": {
"account_number": "1770"
},
"Wertberichtigungen Goodwill": {
"account_number": "1779"
}
},
"Nicht einbezahltes Grund-, Gesellschafter- oder Stiftungskapital": {
"account_number": "180",
"is_group": 1,
"Nicht einbezahltes Aktien-, Stamm-, Anteilschein- oder Stiftungskapital": {
"account_number": "1850"
}
}
}
},
"Passiven": {
"account_number": "2",
"is_group": 1,
"root_type": "Liability",
"Kurzfristiges Fremdkapital": {
"account_number": "20",
"is_group": 1,
"Verbindlichkeiten aus Lieferungen und Leistungen": {
"account_number": "200",
"is_group": 1,
"Verbindlichkeiten aus Lieferungen und Leistungen (Kreditoren)": {
"account_number": "2000"
},
"Erhaltene Anzahlungen": {
"account_number": "2030"
}
},
"Kurzfristige verzinsliche Verbindlichkeiten": {
"account_number": "210",
"is_group": 1,
"Bankverbindlichkeiten": {
"account_number": "2100"
},
"Verbindlichkeiten aus Finanzierungsleasing": {
"account_number": "2120"
},
"Übrige verzinsliche Verbindlichkeiten": {
"account_number": "2140"
}
},
"Übrige kurzfristige Verbindlichkeiten": {
"account_number": "220",
"is_group": 1,
"Geschuldete MWST (Umsatzsteuer)": {
"account_number": "2200"
},
"Abrechnungskonto MWST": {
"account_number": "2201"
},
"Verrechnungssteuer": {
"account_number": "2206"
},
"Direkte Steuern": {
"account_number": "2208"
},
"Sonstige kurzfristige Verbindlichkeiten": {
"account_number": "2210"
},
"Beschlossene Ausschüttungen": {
"account_number": "2261"
},
"Sozialversicherungen und Vorsorgeeinrichtungen": {
"account_number": "2270"
},
"Quellensteuer": {
"account_number": "2279"
}
},
"Passive Rechnungsabgrenzungen und kurzfristige Rückstellungen": {
"account_number": "230",
"is_group": 1,
"Noch nicht bezahlter Aufwand": {
"account_number": "2300"
},
"Erhaltener Ertrag des Folgejahres": {
"account_number": "2301"
},
"Kurzfristige Rückstellungen": {
"account_number": "2330"
}
}
},
"Langfristiges Fremdkapital": {
"account_number": "24",
"is_group": 1,
"Langfristige verzinsliche Verbindlichkeiten": {
"account_number": "240",
"is_group": 1,
"Bankverbindlichkeiten": {
"account_number": "2400"
},
"Verbindlichkeiten aus Finanzierungsleasing": {
"account_number": "2420"
},
"Obligationenanleihen": {
"account_number": "2430"
},
"Darlehen": {
"account_number": "2450"
},
"Hypotheken": {
"account_number": "2451"
}
},
"Übrige langfristige Verbindlichkeiten": {
"account_number": "250",
"is_group": 1,
"Übrige langfristige Verbindlichkeiten (unverzinslich)": {
"account_number": "2500"
}
},
"Rückstellungen sowie vom Gesetz vorgesehene ähnliche Positionen": {
"account_number": "260",
"is_group": 1,
"Rückstellungen": {
"account_number": "2600"
}
}
},
"Eigenkapital (juristische Personen)": {
"account_number": "28",
"is_group": 1,
"Grund-, Gesellschafter- oder Stiftungskapital": {
"account_number": "280",
"is_group": 1,
"Aktien-, Stamm-, Anteilschein- oder Stiftungskapital": {
"account_number": "2800"
}
},
"Reserven und Jahresgewinn oder Jahresverlust": {
"account_number": "290",
"is_group": 1,
"Gesetzliche Kapitalreserve": {
"account_number": "2900"
},
"Reserve für eigene Kapitalanteile": {
"account_number": "2930"
},
"Aufwertungsreserve": {
"account_number": "2940"
},
"Gesetzliche Gewinnreserve": {
"account_number": "2950"
},
"Freiwillige Gewinnreserven": {
"account_number": "2960"
},
"Gewinnvortrag oder Verlustvortrag": {
"account_number": "2970"
},
"Jahresgewinn oder Jahresverlust": {
"account_number": "2979"
},
"Eigene Aktien, Stammanteile oder Anteilscheine (Minusposten)": {
"account_number": "2980"
}
}
}
},
"Betrieblicher Ertrag aus Lieferungen und Leistungen": {
"account_number": "3",
"is_group": 1,
"root_type": "Income",
"Produktionserlöse": {
"account_number": "3000"
},
"Handelserlöse": {
"account_number": "3200"
},
"Dienstleistungserlöse": {
"account_number": "3400"
},
"Übrige Erlöse aus Lieferungen und Leistungen": {
"account_number": "3600"
},
"Eigenleistungen": {
"account_number": "3700"
},
"Eigenverbrauch": {
"account_number": "3710"
},
"Erlösminderungen": {
"account_number": "3800"
},
"Verluste Forderungen (Debitoren), Veränderung Delkredere": {
"account_number": "3805"
},
"Bestandesänderungen unfertige Erzeugnisse": {
"account_number": "3900"
},
"Bestandesänderungen fertige Erzeugnisse": {
"account_number": "3901"
},
"Bestandesänderungen nicht fakturierte Dienstleistungen": {
"account_number": "3940"
}
},
"Aufwand für Material, Handelswaren, Dienstleistungen und Energie": {
"account_number": "4",
"is_group": 1,
"root_type": "Expense",
"Materialaufwand Produktion": {
"account_number": "4000"
},
"Handelswarenaufwand": {
"account_number": "4200"
},
"Aufwand für bezogene Dienstleistungen": {
"account_number": "4400"
},
"Energieaufwand zur Leistungserstellung": {
"account_number": "4500"
},
"Aufwandminderungen": {
"account_number": "4900"
}
},
"Personalaufwand": {
"account_number": "5",
"is_group": 1,
"root_type": "Expense",
"Lohnaufwand": {
"account_number": "5000"
},
"Sozialversicherungsaufwand": {
"account_number": "5700"
},
"Übriger Personalaufwand": {
"account_number": "5800"
},
"Leistungen Dritter": {
"account_number": "5900"
}
},
"Übriger betrieblicher Aufwand, Abschreibungen und Wertberichtigungen sowie Finanzergebnis": {
"account_number": "6",
"is_group": 1,
"root_type": "Expense",
"Raumaufwand": {
"account_number": "6000"
},
"Unterhalt, Reparaturen, Ersatz mobile Sachanlagen": {
"account_number": "6100"
},
"Leasingaufwand mobile Sachanlagen": {
"account_number": "6105"
},
"Fahrzeug- und Transportaufwand": {
"account_number": "6200"
},
"Fahrzeugleasing und -mieten": {
"account_number": "6260"
},
"Sachversicherungen, Abgaben, Gebühren, Bewilligungen": {
"account_number": "6300"
},
"Energie- und Entsorgungsaufwand": {
"account_number": "6400"
},
"Verwaltungsaufwand": {
"account_number": "6500"
},
"Informatikaufwand inkl. Leasing": {
"account_number": "6570"
},
"Werbeaufwand": {
"account_number": "6600"
},
"Sonstiger betrieblicher Aufwand": {
"account_number": "6700"
},
"Abschreibungen und Wertberichtigungen auf Positionen des Anlagevermögens": {
"account_number": "6800"
},
"Finanzaufwand": {
"account_number": "6900"
},
"Finanzertrag": {
"account_number": "6950"
}
},
"Betrieblicher Nebenerfolg": {
"account_number": "7",
"is_group": 1,
"root_type": "Income",
"Ertrag Nebenbetrieb": {
"account_number": "7000"
},
"Aufwand Nebenbetrieb": {
"account_number": "7010"
},
"Ertrag betriebliche Liegenschaft": {
"account_number": "7500"
},
"Aufwand betriebliche Liegenschaft": {
"account_number": "7510"
}
},
"Betriebsfremder, ausserordentlicher, einmaliger oder periodenfremder Aufwand und Ertrag": {
"account_number": "8",
"is_group": 1,
"root_type": "Expense",
"Betriebsfremder Aufwand": {
"account_number": "8000"
},
"Betriebsfremder Ertrag": {
"account_number": "8100"
},
"Ausserordentlicher, einmaliger oder periodenfremder Aufwand": {
"account_number": "8500"
},
"Ausserordentlicher, einmaliger oder periodenfremder Ertrag": {
"account_number": "8510"
},
"Direkte Steuern": {
"account_number": "8900"
}
},
"Abschluss": {
"account_number": "9",
"is_group": 1,
"root_type": "Equity",
"Jahresgewinn oder Jahresverlust": {
"account_number": "9200"
}
}
}
}

View File

@@ -98,7 +98,7 @@
"Office Maintenance Expenses": {},
"Office Rent": {},
"Postal Expenses": {},
"Print and Stationary": {},
"Print and Stationery": {},
"Rounded Off": {
"account_type": "Round Off"
},

View File

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

View File

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

View File

@@ -31,7 +31,8 @@
"label": "Reference Document Type",
"options": "DocType",
"read_only_depends_on": "eval:!doc.__islocal",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"default": "0",

View File

@@ -41,6 +41,11 @@ class AccountingDimension(Document):
self.set_fieldname_and_label()
def validate(self):
self.validate_doctype()
validate_column_name(self.fieldname)
self.validate_dimension_defaults()
def validate_doctype(self):
if self.document_type in (
*core_doctypes_list,
"Accounting Dimension",
@@ -49,6 +54,7 @@ class AccountingDimension(Document):
"Accounting Dimension Detail",
"Company",
"Account",
"Finance Book",
):
msg = _("Not allowed to create accounting dimension for {0}").format(self.document_type)
frappe.throw(msg)
@@ -61,9 +67,6 @@ 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):
doctype_before_save = frappe.db.get_value("Accounting Dimension", self.name, "document_type")
if doctype_before_save != self.document_type:
@@ -102,6 +105,7 @@ class AccountingDimension(Document):
def on_update(self):
frappe.flags.accounting_dimensions = None
frappe.flags.accounting_dimensions_details = None
def make_dimension_in_accounting_doctypes(doc, doclist=None):
@@ -262,7 +266,7 @@ def get_checks_for_pl_and_bs_accounts():
frappe.flags.accounting_dimensions_details = frappe.db.sql(
"""SELECT p.label, p.disabled, p.fieldname, c.default_dimension, c.company, c.mandatory_for_pl, c.mandatory_for_bs
FROM `tabAccounting Dimension`p ,`tabAccounting Dimension Detail` c
WHERE p.name = c.parent""",
WHERE p.name = c.parent AND p.disabled = 0""",
as_dict=1,
)

View File

@@ -12,7 +12,7 @@ frappe.ui.form.on("Accounts Settings", {
msg += " ";
msg += __("Please enable only if the understand the effects of enabling this.");
msg += "<br>";
msg += "Do you still want to enable immutable ledger?";
msg += __("Do you still want to enable immutable ledger?");
frappe.confirm(
msg,

View File

@@ -40,9 +40,14 @@
"show_payment_schedule_in_print",
"currency_exchange_section",
"allow_stale",
"column_break_yuug",
"stale_days",
"section_break_jpd0",
"auto_reconcile_payments",
"stale_days",
"auto_reconciliation_job_trigger",
"reconciliation_queue_size",
"column_break_resa",
"exchange_gain_loss_posting_date",
"invoicing_settings_tab",
"accounts_transactions_settings_section",
"over_billing_allowance",
@@ -72,6 +77,7 @@
"reports_tab",
"remarks_section",
"general_ledger_remarks_length",
"ignore_is_opening_check_for_reporting",
"column_break_lvjk",
"receivable_payable_remarks_length",
"payment_request_settings",
@@ -384,7 +390,7 @@
{
"fieldname": "section_break_jpd0",
"fieldtype": "Section Break",
"label": "Payment Reconciliations"
"label": "Payment Reconciliation Settings"
},
{
"default": "0",
@@ -489,6 +495,43 @@
"fieldname": "create_pr_in_draft_status",
"fieldtype": "Check",
"label": "Create in Draft Status"
},
{
"fieldname": "column_break_yuug",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_resa",
"fieldtype": "Column Break"
},
{
"default": "15",
"description": "Interval should be between 1 to 59 MInutes",
"fieldname": "auto_reconciliation_job_trigger",
"fieldtype": "Int",
"label": "Auto Reconciliation Job Trigger"
},
{
"default": "5",
"description": "Documents Processed on each trigger. Queue Size should be between 5 and 100",
"fieldname": "reconciliation_queue_size",
"fieldtype": "Int",
"label": "Reconciliation Queue Size"
},
{
"default": "0",
"description": "Ignores legacy Is Opening field in GL Entry that allows adding opening balance post the system is in use while generating reports",
"fieldname": "ignore_is_opening_check_for_reporting",
"fieldtype": "Check",
"label": "Ignore Is Opening check for reporting"
},
{
"default": "Payment",
"description": "Only applies for Normal Payments",
"fieldname": "exchange_gain_loss_posting_date",
"fieldtype": "Select",
"label": "Posting Date Inheritance for Exchange Gain / Loss",
"options": "Invoice\nPayment\nReconciliation Date"
}
],
"icon": "icon-cog",
@@ -496,7 +539,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-07-26 06:48:52.714630",
"modified": "2025-01-23 13:15:44.077853",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -10,6 +10,7 @@ from frappe.custom.doctype.property_setter.property_setter import make_property_
from frappe.model.document import Document
from frappe.utils import cint
from erpnext.accounts.utils import sync_auto_reconcile_config
from erpnext.stock.utils import check_pending_reposting
@@ -27,6 +28,7 @@ class AccountsSettings(Document):
allow_multi_currency_invoices_against_single_party_account: DF.Check
allow_stale: DF.Check
auto_reconcile_payments: DF.Check
auto_reconciliation_job_trigger: DF.Int
automatically_fetch_payment_terms: DF.Check
automatically_process_deferred_accounting_entry: DF.Check
book_asset_depreciation_entry_automatically: DF.Check
@@ -43,14 +45,17 @@ class AccountsSettings(Document):
enable_fuzzy_matching: DF.Check
enable_immutable_ledger: DF.Check
enable_party_matching: DF.Check
exchange_gain_loss_posting_date: DF.Literal["Invoice", "Payment", "Reconciliation Date"]
frozen_accounts_modifier: DF.Link | None
general_ledger_remarks_length: DF.Int
ignore_account_closing_balance: DF.Check
ignore_is_opening_check_for_reporting: DF.Check
make_payment_via_journal_entry: DF.Check
merge_similar_account_heads: DF.Check
over_billing_allowance: DF.Currency
post_change_gl_entries: DF.Check
receivable_payable_remarks_length: DF.Int
reconciliation_queue_size: DF.Int
role_allowed_to_over_bill: DF.Link | None
round_row_wise_tax: DF.Check
show_balance_in_coa: DF.Check
@@ -90,6 +95,8 @@ class AccountsSettings(Document):
if clear_cache:
frappe.clear_cache()
self.validate_and_sync_auto_reconcile_config()
def validate_stale_days(self):
if not self.allow_stale and cint(self.stale_days) <= 0:
frappe.msgprint(
@@ -114,3 +121,17 @@ class AccountsSettings(Document):
def validate_pending_reposts(self):
if self.acc_frozen_upto:
check_pending_reposting(self.acc_frozen_upto)
def validate_and_sync_auto_reconcile_config(self):
if self.has_value_changed("auto_reconciliation_job_trigger"):
if (
cint(self.auto_reconciliation_job_trigger) > 0
and cint(self.auto_reconciliation_job_trigger) < 60
):
sync_auto_reconcile_config(self.auto_reconciliation_job_trigger)
else:
frappe.throw(_("Cron Interval should be between 1 and 59 Min"))
if self.has_value_changed("reconciliation_queue_size"):
if cint(self.reconciliation_queue_size) < 5 or cint(self.reconciliation_queue_size) > 100:
frappe.throw(_("Queue Size should be between 5 and 100"))

View File

@@ -6,7 +6,7 @@ import frappe
from frappe import _, msgprint
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt, fmt_money, get_link_to_form, getdate
from frappe.utils import cint, flt, fmt_money, get_link_to_form, getdate
from pypika import Order
import erpnext
@@ -48,6 +48,7 @@ class BankClearance(Document):
entries = []
# get entries from all the apps
precision = cint(frappe.db.get_default("currency_precision")) or 2
for method_name in frappe.get_hooks("get_payment_entries_for_bank_clearance"):
entries += (
frappe.get_attr(method_name)(
@@ -77,7 +78,7 @@ class BankClearance(Document):
if not d.get("account_currency"):
d.account_currency = default_currency
formatted_amount = fmt_money(abs(amount), 2, d.account_currency)
formatted_amount = fmt_money(abs(amount), precision, d.account_currency)
d.amount = formatted_amount + " " + (_("Dr") if amount > 0 else _("Cr"))
d.posting_date = getdate(d.posting_date)
@@ -159,9 +160,6 @@ def get_payment_entries_for_bank_clearance(
as_dict=1,
)
if bank_account:
condition += "and bank_account = %(bank_account)s"
payment_entries = frappe.db.sql(
f"""
select
@@ -183,7 +181,6 @@ def get_payment_entries_for_bank_clearance(
"account": account,
"from": from_date,
"to": to_date,
"bank_account": bank_account,
},
as_dict=1,
)

View File

@@ -19,10 +19,15 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
onload: function (frm) {
if (!frm.doc.company) {
frm.set_value("company", frappe.defaults.get_default("company"));
}
// Set default filter dates
let today = frappe.datetime.get_today();
frm.doc.bank_statement_from_date = frappe.datetime.add_months(today, -1);
frm.doc.bank_statement_to_date = today;
frm.trigger("bank_account");
},
@@ -98,7 +103,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
make_reconciliation_tool(frm) {
frm.get_field("reconciliation_tool_cards").$wrapper.empty();
if (frm.doc.bank_account && frm.doc.bank_statement_to_date) {
if (frm.doc.company && frm.doc.bank_account && frm.doc.bank_statement_to_date) {
frm.trigger("get_cleared_balance").then(() => {
if (
frm.doc.bank_account &&
@@ -114,12 +119,13 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
get_account_opening_balance(frm) {
if (frm.doc.bank_account && frm.doc.bank_statement_from_date) {
if (frm.doc.company && frm.doc.bank_account && frm.doc.bank_statement_from_date) {
frappe.call({
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
args: {
bank_account: frm.doc.bank_account,
till_date: frappe.datetime.add_days(frm.doc.bank_statement_from_date, -1),
company: frm.doc.company,
},
callback: (response) => {
frm.set_value("account_opening_balance", response.message);
@@ -129,12 +135,13 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
get_cleared_balance(frm) {
if (frm.doc.bank_account && frm.doc.bank_statement_to_date) {
if (frm.doc.company && frm.doc.bank_account && frm.doc.bank_statement_to_date) {
return frappe.call({
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
args: {
bank_account: frm.doc.bank_account,
till_date: frm.doc.bank_statement_to_date,
company: frm.doc.company,
},
callback: (response) => {
frm.cleared_balance = response.message;

View File

@@ -8,6 +8,7 @@ import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.query_builder.functions import Sum
from frappe.utils import cint, flt
from erpnext import get_default_cost_center
@@ -79,10 +80,17 @@ def get_bank_transactions(bank_account, from_date=None, to_date=None):
@frappe.whitelist()
def get_account_balance(bank_account, till_date):
def get_account_balance(bank_account, till_date, company):
# returns account balance till the specified date
account = frappe.db.get_value("Bank Account", bank_account, "account")
filters = frappe._dict({"account": account, "report_date": till_date, "include_pos_transactions": 1})
filters = frappe._dict(
{
"account": account,
"report_date": till_date,
"include_pos_transactions": 1,
"company": company,
}
)
data = get_entries(filters)
balance_as_per_system = get_balance_on(filters["account"], filters["report_date"])
@@ -94,11 +102,7 @@ def get_account_balance(bank_account, till_date):
amounts_not_reflected_in_system = get_amounts_not_reflected_in_system(filters)
bank_bal = (
flt(balance_as_per_system) - flt(total_debit) + flt(total_credit) + amounts_not_reflected_in_system
)
return bank_bal
return flt(balance_as_per_system) - flt(total_debit) + flt(total_credit) + amounts_not_reflected_in_system
@frappe.whitelist()
@@ -370,10 +374,37 @@ def auto_reconcile_vouchers(
from_reference_date=None,
to_reference_date=None,
):
frappe.flags.auto_reconcile_vouchers = True
reconciled, partially_reconciled = set(), set()
bank_transactions = get_bank_transactions(bank_account)
if len(bank_transactions) > 10:
frappe.enqueue(
method="erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.start_auto_reconcile",
queue="long",
bank_transactions=bank_transactions,
from_date=from_date,
to_date=to_date,
filter_by_reference_date=filter_by_reference_date,
from_reference_date=from_reference_date,
to_reference_date=to_reference_date,
)
frappe.msgprint(_("Auto Reconciliation has started in the background"))
else:
start_auto_reconcile(
bank_transactions,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
)
def start_auto_reconcile(
bank_transactions, from_date, to_date, filter_by_reference_date, from_reference_date, to_reference_date
):
frappe.flags.auto_reconcile_vouchers = True
reconciled, partially_reconciled = set(), set()
for transaction in bank_transactions:
linked_payments = get_linked_payments(
transaction.name,
@@ -411,7 +442,6 @@ def auto_reconcile_vouchers(
frappe.msgprint(title=_("Auto Reconciliation"), msg=alert_message, indicator=indicator)
frappe.flags.auto_reconcile_vouchers = False
return reconciled, partially_reconciled
def get_auto_reconcile_message(partially_reconciled, reconciled):
@@ -488,16 +518,23 @@ def subtract_allocations(gl_account, vouchers):
voucher_allocated_amounts = get_total_allocated_amount(voucher_docs)
for voucher in vouchers:
rows = voucher_allocated_amounts.get((voucher.get("doctype"), voucher.get("name"))) or []
filtered_row = list(filter(lambda row: row.get("gl_account") == gl_account, rows))
if amount := None if not filtered_row else filtered_row[0]["total"]:
if amount := get_allocated_amount(voucher_allocated_amounts, voucher, gl_account):
voucher["paid_amount"] -= amount
copied.append(voucher)
return copied
def get_allocated_amount(voucher_allocated_amounts, voucher, gl_account):
if not (voucher_details := voucher_allocated_amounts.get((voucher.get("doctype"), voucher.get("name")))):
return
if not (row := voucher_details.get(gl_account)):
return
return row.get("total")
def check_matching(
bank_account,
company,
@@ -767,26 +804,20 @@ def get_je_matching_query(
je = frappe.qb.DocType("Journal Entry")
jea = frappe.qb.DocType("Journal Entry Account")
ref_condition = je.cheque_no == transaction.reference_number
ref_rank = frappe.qb.terms.Case().when(ref_condition, 1).else_(0)
amount_field = f"{cr_or_dr}_in_account_currency"
amount_equality = getattr(jea, amount_field) == transaction.unallocated_amount
amount_rank = frappe.qb.terms.Case().when(amount_equality, 1).else_(0)
filter_by_date = je.posting_date.between(from_date, to_date)
if cint(filter_by_reference_date):
filter_by_date = je.cheque_date.between(from_reference_date, to_reference_date)
query = (
subquery = (
frappe.qb.from_(jea)
.join(je)
.on(jea.parent == je.name)
.select(
(ref_rank + amount_rank + 1).as_("rank"),
Sum(getattr(jea, amount_field)).as_("paid_amount"),
ConstantColumn("Journal Entry").as_("doctype"),
je.name,
getattr(jea, amount_field).as_("paid_amount"),
je.cheque_no.as_("reference_no"),
je.cheque_date.as_("reference_date"),
je.pay_to_recd_from.as_("party"),
@@ -798,14 +829,26 @@ def get_je_matching_query(
.where(je.voucher_type != "Opening Entry")
.where(je.clearance_date.isnull())
.where(jea.account == common_filters.bank_account)
.where(amount_equality if exact_match else getattr(jea, amount_field) > 0.0)
.where(je.docstatus == 1)
.where(filter_by_date)
.groupby(je.name)
.orderby(je.cheque_date if cint(filter_by_reference_date) else je.posting_date)
)
if frappe.flags.auto_reconcile_vouchers is True:
query = query.where(ref_condition)
subquery = subquery.where(je.cheque_no == transaction.reference_number)
ref_rank = frappe.qb.terms.Case().when(subquery.reference_no == transaction.reference_number, 1).else_(0)
amount_equality = subquery.paid_amount == transaction.unallocated_amount
amount_rank = frappe.qb.terms.Case().when(amount_equality, 1).else_(0)
query = (
frappe.qb.from_(subquery)
.select(
"*",
(ref_rank + amount_rank + 1).as_("rank"),
)
.where(amount_equality if exact_match else subquery.paid_amount > 0.0)
)
return query

View File

@@ -99,9 +99,9 @@ class BankStatementImport(DataImport):
template_options=self.template_options,
now=run_now,
)
return True
return job_id
return False
return None
@frappe.whitelist()
@@ -113,7 +113,8 @@ def get_preview_from_template(data_import, import_file=None, google_sheets_url=N
@frappe.whitelist()
def form_start_import(data_import):
return frappe.get_doc("Bank Statement Import", data_import).start_import()
job_id = frappe.get_doc("Bank Statement Import", data_import).start_import()
return job_id is not None
@frappe.whitelist()

View File

@@ -45,45 +45,41 @@ class AutoMatchbyAccountIBAN:
if not (self.bank_party_account_number or self.bank_party_iban):
return None
result = self.match_account_in_party()
return result
return self.match_account_in_party()
def match_account_in_party(self) -> tuple | None:
"""Check if there is a IBAN/Account No. match in Customer/Supplier/Employee"""
result = None
parties = get_parties_in_order(self.deposit)
or_filters = self.get_or_filters()
"""
Returns (Party Type, Party) if a matching account is found in Bank Account or Employee:
1. Get party from a matching (iban/account no) Bank Account
2. If not found, get party from Employee with matching bank account details (iban/account no)
"""
if not (self.bank_party_account_number or self.bank_party_iban):
# Nothing to match
return None
for party in parties:
party_result = frappe.db.get_all(
"Bank Account", or_filters=or_filters, pluck="party", limit_page_length=1
)
# Search for a matching Bank Account that has party set
party_result = frappe.db.get_all(
"Bank Account",
or_filters=self.get_or_filters(),
filters={"party_type": ("is", "set"), "party": ("is", "set")},
fields=["party", "party_type"],
limit_page_length=1,
)
if result := party_result[0] if party_result else None:
return (result["party_type"], result["party"])
if party == "Employee" and not party_result:
# Search in Bank Accounts first for Employee, and then Employee record
if "bank_account_no" in or_filters:
or_filters["bank_ac_no"] = or_filters.pop("bank_account_no")
# If no party is found, search in Employee (since it has bank account details)
if employee_result := frappe.db.get_all(
"Employee", or_filters=self.get_or_filters("Employee"), pluck="name", limit_page_length=1
):
return ("Employee", employee_result[0])
party_result = frappe.db.get_all(
party, or_filters=or_filters, pluck="name", limit_page_length=1
)
if "bank_ac_no" in or_filters:
or_filters["bank_account_no"] = or_filters.pop("bank_ac_no")
if party_result:
result = (
party,
party_result[0],
)
break
return result
def get_or_filters(self) -> dict:
def get_or_filters(self, party: str | None = None) -> dict:
"""Return OR filters for Bank Account and IBAN"""
or_filters = {}
if self.bank_party_account_number:
or_filters["bank_account_no"] = self.bank_party_account_number
bank_ac_field = "bank_ac_no" if party == "Employee" else "bank_account_no"
or_filters[bank_ac_field] = self.bank_party_account_number
if self.bank_party_iban:
or_filters["iban"] = self.bank_party_iban
@@ -103,8 +99,7 @@ class AutoMatchbyPartyNameDescription:
if not (self.bank_party_name or self.description):
return None
result = self.match_party_name_desc_in_party()
return result
return self.match_party_name_desc_in_party()
def match_party_name_desc_in_party(self) -> tuple | None:
"""Fuzzy search party name and/or description against parties in the system"""
@@ -113,7 +108,7 @@ class AutoMatchbyPartyNameDescription:
for party in parties:
filters = {"status": "Active"} if party == "Employee" else {"disabled": 0}
field = party.lower() + "_name"
field = f"{party.lower()}_name"
names = frappe.get_all(party, filters=filters, fields=[f"{field} as party_name", "name"])
for field in ["bank_party_name", "description"]:
@@ -140,13 +135,7 @@ class AutoMatchbyPartyNameDescription:
)
party_name, skip = self.process_fuzzy_result(result)
if not party_name:
return None, skip
return (
party,
party_name,
), skip
return ((party, party_name), skip) if party_name else (None, skip)
def process_fuzzy_result(self, result: list | None):
"""
@@ -164,8 +153,8 @@ class AutoMatchbyPartyNameDescription:
if len(result) == 1:
return (first_result[PARTY_ID] if first_result[SCORE] > CUTOFF else None), True
second_result = result[1]
if first_result[SCORE] > CUTOFF:
second_result = result[1]
# If multiple matches with the same score, return None but discontinue matching
# Matches were found but were too close to distinguish between
if first_result[SCORE] == second_result[SCORE]:
@@ -177,8 +166,8 @@ class AutoMatchbyPartyNameDescription:
def get_parties_in_order(deposit: float) -> list:
parties = ["Supplier", "Employee", "Customer"] # most -> least likely to receive
if flt(deposit) > 0:
parties = ["Customer", "Supplier", "Employee"] # most -> least likely to pay
return parties
return (
["Customer", "Supplier", "Employee"] # most -> least likely to pay us
if flt(deposit) > 0
else ["Supplier", "Employee", "Customer"] # most -> least likely to receive from us
)

View File

@@ -2,27 +2,6 @@
// For license information, please see license.txt
frappe.ui.form.on("Bank Transaction", {
onload(frm) {
frm.set_query("payment_document", "payment_entries", function () {
const payment_doctypes = frm.events.get_payment_doctypes(frm);
return {
filters: {
name: ["in", payment_doctypes],
},
};
});
},
refresh(frm) {
if (!frm.is_dirty() && frm.doc.payment_entries.length > 0) {
frm.add_custom_button(__("Unreconcile Transaction"), () => {
frm.call("remove_payment_entries").then(() => frm.refresh());
});
}
},
bank_account: function (frm) {
set_bank_statement_filter(frm);
},
setup: function (frm) {
frm.set_query("party_type", function () {
return {
@@ -31,6 +10,41 @@ frappe.ui.form.on("Bank Transaction", {
},
};
});
frm.set_query("bank_account", function () {
return {
filters: { is_company_account: 1 },
};
});
frm.set_query("payment_document", "payment_entries", function () {
const payment_doctypes = frm.events.get_payment_doctypes(frm);
return {
filters: {
name: ["in", payment_doctypes],
},
};
});
frm.set_query("payment_entry", "payment_entries", function () {
return {
filters: {
docstatus: ["!=", 2],
},
};
});
},
refresh(frm) {
if (!frm.is_dirty() && frm.doc.payment_entries.length > 0) {
frm.add_custom_button(__("Unreconcile Transaction"), () => {
frm.call("remove_payment_entries").then(() => frm.refresh());
});
}
},
bank_account: function (frm) {
set_bank_statement_filter(frm);
},
get_payment_doctypes: function () {
@@ -39,31 +53,6 @@ frappe.ui.form.on("Bank Transaction", {
},
});
frappe.ui.form.on("Bank Transaction Payments", {
payment_entries_remove: function (frm, cdt, cdn) {
update_clearance_date(frm, cdt, cdn);
},
});
const update_clearance_date = (frm, cdt, cdn) => {
if (frm.doc.docstatus === 1) {
frappe
.xcall("erpnext.accounts.doctype.bank_transaction.bank_transaction.unclear_reference_payment", {
doctype: cdt,
docname: cdn,
bt_name: frm.doc.name,
})
.then((e) => {
if (e == "success") {
frappe.show_alert({
message: __("Document {0} successfully uncleared", [e]),
indicator: "green",
});
}
});
}
};
function set_bank_statement_filter(frm) {
frm.set_query("bank_statement", function () {
return {

View File

@@ -5,7 +5,7 @@ import frappe
from frappe import _
from frappe.model.docstatus import DocStatus
from frappe.model.document import Document
from frappe.utils import flt
from frappe.utils import flt, getdate
class BankTransaction(Document):
@@ -84,16 +84,16 @@ class BankTransaction(Document):
if not self.payment_entries:
return
pe = []
references = set()
for row in self.payment_entries:
reference = (row.payment_document, row.payment_entry)
if reference in pe:
if reference in references:
frappe.throw(
_("{0} {1} is allocated twice in this Bank Transaction").format(
row.payment_document, row.payment_entry
)
)
pe.append(reference)
references.add(reference)
def update_allocated_amount(self):
allocated_amount = (
@@ -104,6 +104,19 @@ class BankTransaction(Document):
self.allocated_amount = flt(allocated_amount, self.precision("allocated_amount"))
self.unallocated_amount = flt(unallocated_amount, self.precision("unallocated_amount"))
def delink_old_payment_entries(self):
if self.flags.updating_linked_bank_transaction:
return
old_doc = self.get_doc_before_save()
payment_entry_names = set(pe.name for pe in self.payment_entries)
for old_pe in old_doc.payment_entries:
if old_pe.name in payment_entry_names:
continue
self.delink_payment_entry(old_pe)
def before_submit(self):
self.allocate_payment_entries()
self.set_status()
@@ -113,13 +126,14 @@ class BankTransaction(Document):
def before_update_after_submit(self):
self.validate_duplicate_references()
self.allocate_payment_entries()
self.update_allocated_amount()
self.delink_old_payment_entries()
self.allocate_payment_entries()
self.set_status()
def on_cancel(self):
for payment_entry in self.payment_entries:
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
self.delink_payment_entry(payment_entry)
self.set_status()
@@ -152,43 +166,55 @@ class BankTransaction(Document):
- 0 > a: Error: already over-allocated
- clear means: set the latest transaction date as clearance date
"""
if self.flags.updating_linked_bank_transaction or not self.payment_entries:
return
remaining_amount = self.unallocated_amount
to_remove = []
payment_entry_docs = [(pe.payment_document, pe.payment_entry) for pe in self.payment_entries]
pe_bt_allocations = get_total_allocated_amount(payment_entry_docs)
gl_entries = get_related_bank_gl_entries(payment_entry_docs)
gl_bank_account = frappe.db.get_value("Bank Account", self.bank_account, "account")
for payment_entry in self.payment_entries:
if payment_entry.allocated_amount == 0.0:
unallocated_amount, should_clear, latest_transaction = get_clearance_details(
self,
payment_entry,
pe_bt_allocations.get((payment_entry.payment_document, payment_entry.payment_entry))
or [],
for payment_entry in list(self.payment_entries):
if payment_entry.allocated_amount != 0:
continue
allocable_amount, should_clear, clearance_date = get_clearance_details(
self,
payment_entry,
pe_bt_allocations.get((payment_entry.payment_document, payment_entry.payment_entry)) or {},
gl_entries.get((payment_entry.payment_document, payment_entry.payment_entry)) or {},
gl_bank_account,
)
if allocable_amount < 0:
frappe.throw(_("Voucher {0} is over-allocated by {1}").format(allocable_amount))
if remaining_amount <= 0:
self.remove(payment_entry)
continue
if allocable_amount == 0:
if should_clear:
self.clear_linked_payment_entry(payment_entry, clearance_date=clearance_date)
self.remove(payment_entry)
continue
should_clear = should_clear and allocable_amount <= remaining_amount
payment_entry.allocated_amount = min(allocable_amount, remaining_amount)
remaining_amount = flt(
remaining_amount - payment_entry.allocated_amount,
self.precision("unallocated_amount"),
)
if payment_entry.payment_document == "Bank Transaction":
self.update_linked_bank_transaction(
payment_entry.payment_entry, payment_entry.allocated_amount
)
elif should_clear:
self.clear_linked_payment_entry(payment_entry, clearance_date=clearance_date)
if 0.0 == unallocated_amount:
if should_clear:
latest_transaction.clear_linked_payment_entry(payment_entry)
to_remove.append(payment_entry)
elif remaining_amount <= 0.0:
to_remove.append(payment_entry)
elif 0.0 < unallocated_amount <= remaining_amount:
payment_entry.allocated_amount = unallocated_amount
remaining_amount -= unallocated_amount
if should_clear:
latest_transaction.clear_linked_payment_entry(payment_entry)
elif 0.0 < unallocated_amount:
payment_entry.allocated_amount = remaining_amount
remaining_amount = 0.0
elif 0.0 > unallocated_amount:
frappe.throw(_("Voucher {0} is over-allocated by {1}").format(unallocated_amount))
for payment_entry in to_remove:
self.remove(payment_entry)
self.update_allocated_amount()
@frappe.whitelist()
def remove_payment_entries(self):
@@ -199,14 +225,64 @@ class BankTransaction(Document):
def remove_payment_entry(self, payment_entry):
"Clear payment entry and clearance"
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
self.delink_payment_entry(payment_entry)
self.remove(payment_entry)
def clear_linked_payment_entry(self, payment_entry, for_cancel=False):
clearance_date = None if for_cancel else self.date
set_voucher_clearance(
payment_entry.payment_document, payment_entry.payment_entry, clearance_date, self
)
def delink_payment_entry(self, payment_entry):
if payment_entry.payment_document == "Bank Transaction":
self.update_linked_bank_transaction(payment_entry.payment_entry, allocated_amount=None)
else:
self.clear_linked_payment_entry(payment_entry, clearance_date=None)
def clear_linked_payment_entry(self, payment_entry, clearance_date=None):
doctype = payment_entry.payment_document
docname = payment_entry.payment_entry
# might be a bank transaction
if doctype not in get_doctypes_for_bank_reconciliation():
return
if doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
return
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
def update_linked_bank_transaction(self, bank_transaction_name, allocated_amount=None):
"""For when a second bank transaction has fixed another, e.g. refund"""
bt = frappe.get_doc(self.doctype, bank_transaction_name)
if allocated_amount:
bt.append(
"payment_entries",
{
"payment_document": self.doctype,
"payment_entry": self.name,
"allocated_amount": allocated_amount,
},
)
else:
pe = next(
(
pe
for pe in bt.payment_entries
if pe.payment_document == self.doctype and pe.payment_entry == self.name
),
None,
)
if not pe:
return
bt.flags.updating_linked_bank_transaction = True
bt.remove(pe)
bt.save()
def auto_set_party(self):
from erpnext.accounts.doctype.bank_transaction.auto_match_party import AutoMatchParty
@@ -238,71 +314,107 @@ def get_doctypes_for_bank_reconciliation():
return frappe.get_hooks("bank_reconciliation_doctypes")
def get_clearance_details(transaction, payment_entry, bt_allocations):
def get_clearance_details(transaction, payment_entry, bt_allocations, gl_entries, gl_bank_account):
"""
There should only be one bank gle for a voucher.
Could be none for a Bank Transaction.
But if a JE, could affect two banks.
Should only clear the voucher if all bank gles are allocated.
There should only be one bank gl entry for a voucher, except for JE.
For JE, there can be multiple bank gl entries for the same account.
In this case, the allocable_amount will be the sum of amounts of all gl entries of the account.
There will be no gl entry for a Bank Transaction so return the unallocated amount.
Should only clear the voucher if all bank gl entries are allocated.
"""
gl_bank_account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
gles = get_related_bank_gl_entries(payment_entry.payment_document, payment_entry.payment_entry)
unallocated_amount = min(
transaction.unallocated_amount,
get_paid_amount(payment_entry, transaction.currency, gl_bank_account),
)
unmatched_gles = len(gles)
latest_transaction = transaction
for gle in gles:
if gle["gl_account"] == gl_bank_account:
if gle["amount"] <= 0.0:
frappe.throw(
_("Voucher {0} value is broken: {1}").format(payment_entry.payment_entry, gle["amount"])
transaction_date = getdate(transaction.date)
if payment_entry.payment_document == "Bank Transaction":
bt = frappe.db.get_value(
"Bank Transaction",
payment_entry.payment_entry,
("unallocated_amount", "bank_account"),
as_dict=True,
)
if bt.bank_account != gl_bank_account:
frappe.throw(
_("Bank Account {} in Bank Transaction {} is not matching with Bank Account {}").format(
bt.bank_account, payment_entry.payment_entry, gl_bank_account
)
)
unmatched_gles -= 1
unallocated_amount = gle["amount"]
for a in bt_allocations:
if a["gl_account"] == gle["gl_account"]:
unallocated_amount = gle["amount"] - a["total"]
if frappe.utils.getdate(transaction.date) < a["latest_date"]:
latest_transaction = frappe.get_doc("Bank Transaction", a["latest_name"])
else:
# Must be a Journal Entry affecting more than one bank
for a in bt_allocations:
if a["gl_account"] == gle["gl_account"] and a["total"] == gle["amount"]:
unmatched_gles -= 1
return abs(bt.unallocated_amount), True, transaction_date
return unallocated_amount, unmatched_gles == 0, latest_transaction
if gl_bank_account not in gl_entries:
frappe.throw(
_("{} {} is not affecting bank account {}").format(
payment_entry.payment_document, payment_entry.payment_entry, gl_bank_account
)
)
allocable_amount = gl_entries.pop(gl_bank_account) or 0
if allocable_amount <= 0.0:
frappe.throw(
_("Invalid amount in accounting entries of {} {} for Account {}: {}").format(
payment_entry.payment_document, payment_entry.payment_entry, gl_bank_account, allocable_amount
)
)
matching_bt_allocaion = bt_allocations.pop(gl_bank_account, {})
allocable_amount = flt(
allocable_amount - matching_bt_allocaion.get("total", 0), transaction.precision("unallocated_amount")
)
should_clear = all(
gl_entries[gle_account] == bt_allocations.get(gle_account, {}).get("total", 0)
for gle_account in gl_entries
)
bt_allocation_date = matching_bt_allocaion.get("latest_date", None)
clearance_date = transaction_date if not bt_allocation_date else max(transaction_date, bt_allocation_date)
return allocable_amount, should_clear, clearance_date
def get_related_bank_gl_entries(doctype, docname):
def get_related_bank_gl_entries(docs):
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
return frappe.db.sql(
if not docs:
return {}
result = frappe.db.sql(
"""
SELECT
ABS(gle.credit_in_account_currency - gle.debit_in_account_currency) AS amount,
gle.account AS gl_account
FROM
`tabGL Entry` gle
LEFT JOIN
`tabAccount` ac ON ac.name=gle.account
WHERE
ac.account_type = 'Bank'
AND gle.voucher_type = %(doctype)s
AND gle.voucher_no = %(docname)s
AND is_cancelled = 0
""",
dict(doctype=doctype, docname=docname),
SELECT
gle.voucher_type AS doctype,
gle.voucher_no AS docname,
gle.account AS gl_account,
SUM(ABS(gle.credit_in_account_currency - gle.debit_in_account_currency)) AS amount
FROM
`tabGL Entry` gle
LEFT JOIN
`tabAccount` ac ON ac.name = gle.account
WHERE
ac.account_type = 'Bank'
AND (gle.voucher_type, gle.voucher_no) IN %(docs)s
AND gle.is_cancelled = 0
GROUP BY
gle.voucher_type, gle.voucher_no, gle.account
""",
{"docs": docs},
as_dict=True,
)
entries = {}
for row in result:
key = (row["doctype"], row["docname"])
if key not in entries:
entries[key] = {}
entries[key][row["gl_account"]] = row["amount"]
return entries
def get_total_allocated_amount(docs):
"""
Gets the sum of allocations for a voucher on each bank GL account
along with the latest bank transaction name & date
along with the latest bank transaction date
NOTE: query may also include just saved vouchers/payments but with zero allocated_amount
"""
if not docs:
@@ -311,11 +423,10 @@ def get_total_allocated_amount(docs):
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
result = frappe.db.sql(
"""
SELECT total, latest_name, latest_date, gl_account, payment_document, payment_entry FROM (
SELECT total, latest_date, gl_account, payment_document, payment_entry FROM (
SELECT
ROW_NUMBER() OVER w AS rownum,
SUM(btp.allocated_amount) OVER(PARTITION BY ba.account, btp.payment_document, btp.payment_entry) AS total,
FIRST_VALUE(bt.name) OVER w AS latest_name,
FIRST_VALUE(bt.date) OVER w AS latest_date,
ba.account AS gl_account,
btp.payment_document,
@@ -338,104 +449,14 @@ def get_total_allocated_amount(docs):
payment_allocation_details = {}
for row in result:
# Why is this *sometimes* a byte string?
if isinstance(row["latest_name"], bytes):
row["latest_name"] = row["latest_name"].decode()
row["latest_date"] = frappe.utils.getdate(row["latest_date"])
payment_allocation_details.setdefault((row["payment_document"], row["payment_entry"]), []).append(row)
row["latest_date"] = getdate(row["latest_date"])
payment_allocation_details.setdefault((row["payment_document"], row["payment_entry"]), {})[
row["gl_account"]
] = row
return payment_allocation_details
def get_paid_amount(payment_entry, currency, gl_bank_account):
if payment_entry.payment_document in ["Payment Entry", "Sales Invoice", "Purchase Invoice"]:
paid_amount_field = "paid_amount"
if payment_entry.payment_document == "Payment Entry":
doc = frappe.get_doc("Payment Entry", payment_entry.payment_entry)
if doc.payment_type == "Receive":
paid_amount_field = (
"received_amount" if doc.paid_to_account_currency == currency else "base_received_amount"
)
elif doc.payment_type == "Pay":
paid_amount_field = (
"paid_amount" if doc.paid_from_account_currency == currency else "base_paid_amount"
)
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, paid_amount_field
)
elif payment_entry.payment_document == "Journal Entry":
return abs(
frappe.db.get_value(
"Journal Entry Account",
{"parent": payment_entry.payment_entry, "account": gl_bank_account},
"sum(debit_in_account_currency-credit_in_account_currency)",
)
or 0
)
elif payment_entry.payment_document == "Expense Claim":
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, "total_amount_reimbursed"
)
elif payment_entry.payment_document == "Loan Disbursement":
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, "disbursed_amount"
)
elif payment_entry.payment_document == "Loan Repayment":
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "amount_paid")
elif payment_entry.payment_document == "Bank Transaction":
dep, wth = frappe.db.get_value(
"Bank Transaction", payment_entry.payment_entry, ("deposit", "withdrawal")
)
return abs(flt(wth) - flt(dep))
else:
frappe.throw(
f"Please reconcile {payment_entry.payment_document}: {payment_entry.payment_entry} manually"
)
def set_voucher_clearance(doctype, docname, clearance_date, self):
if doctype in get_doctypes_for_bank_reconciliation():
if (
doctype == "Payment Entry"
and frappe.db.get_value("Payment Entry", docname, "payment_type") == "Internal Transfer"
and len(get_reconciled_bank_transactions(doctype, docname)) < 2
):
return
if doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
return
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
elif doctype == "Bank Transaction":
# For when a second bank transaction has fixed another, e.g. refund
bt = frappe.get_doc(doctype, docname)
if clearance_date:
vouchers = [{"payment_doctype": "Bank Transaction", "payment_name": self.name}]
bt.add_payment_entries(vouchers)
bt.save()
else:
for pe in bt.payment_entries:
if pe.payment_document == self.doctype and pe.payment_entry == self.name:
bt.remove(pe)
bt.save()
break
def get_reconciled_bank_transactions(doctype, docname):
return frappe.get_all(
"Bank Transaction Payments",
@@ -444,13 +465,6 @@ def get_reconciled_bank_transactions(doctype, docname):
)
@frappe.whitelist()
def unclear_reference_payment(doctype, docname, bt_name):
bt = frappe.get_doc("Bank Transaction", bt_name)
set_voucher_clearance(doctype, docname, None, bt)
return docname
def remove_from_bank_transaction(doctype, docname):
"""Remove a (cancelled) voucher from all Bank Transactions."""
for bt_name in get_reconciled_bank_transactions(doctype, docname):

View File

@@ -3,6 +3,7 @@
"allow_copy": 1,
"allow_import": 1,
"creation": "2013-01-23 19:57:17",
"default_view": "Tree",
"description": "Track separate Income and Expense for product verticals or divisions.",
"doctype": "DocType",
"document_type": "Setup",
@@ -125,7 +126,7 @@
"idx": 1,
"is_tree": 1,
"links": [],
"modified": "2024-04-24 10:55:54.083042",
"modified": "2025-01-22 10:46:42.904001",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cost Center",

View File

@@ -0,0 +1,23 @@
[
{
"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

@@ -1,18 +0,0 @@
[["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

@@ -128,7 +128,7 @@ class TestCouponCode(IntegrationTestCase):
item_code="_Test Tesla Car",
rate=5000,
qty=1,
do_not_submit=True,
do_not_save=True,
)
self.assertEqual(so.items[0].rate, 5000)

View File

@@ -230,6 +230,7 @@ def get_dunning_letter_text(dunning_type: str, doc: str | dict, language: str |
if not language:
language = doc.get("language")
letter_text = None
if language:
letter_text = frappe.db.get_value(
DOCTYPE, {"parent": dunning_type, "language": language}, FIELDS, as_dict=1

View File

@@ -1,6 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import json
import frappe
from frappe.model import mapper
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, nowdate, today
@@ -77,6 +80,36 @@ class TestDunning(IntegrationTestCase):
dunning.reload()
self.assertEqual(dunning.status, "Resolved")
def test_fetch_overdue_payments(self):
"""
Create SI with overdue payment. Check if overdue payment is fetched in Dunning.
"""
si1 = create_sales_invoice_against_cost_center(
posting_date=add_days(today(), -1 * 6),
qty=1,
rate=100,
)
si2 = create_sales_invoice_against_cost_center(
posting_date=add_days(today(), -1 * 6),
qty=1,
rate=300,
)
dunning = create_dunning_from_sales_invoice(si1.name)
dunning.overdue_payments = []
method = "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_dunning"
updated_dunning = mapper.map_docs(method, json.dumps([si1.name, si2.name]), dunning)
self.assertEqual(len(updated_dunning.overdue_payments), 2)
self.assertEqual(updated_dunning.overdue_payments[0].sales_invoice, si1.name)
self.assertEqual(updated_dunning.overdue_payments[0].outstanding, si1.outstanding_amount)
self.assertEqual(updated_dunning.overdue_payments[1].sales_invoice, si2.name)
self.assertEqual(updated_dunning.overdue_payments[1].outstanding, si2.outstanding_amount)
def test_dunning_and_payment_against_partially_due_invoice(self):
"""
Create SI with first installment overdue. Check impact of Dunning and Payment Entry.

View File

@@ -0,0 +1,36 @@
[
{
"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

@@ -1,28 +0,0 @@
[["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

@@ -86,8 +86,7 @@
"fieldname": "party_type",
"fieldtype": "Link",
"label": "Party Type",
"options": "DocType",
"search_index": 1
"options": "DocType"
},
{
"fieldname": "party",
@@ -242,8 +241,7 @@
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"search_index": 1
"options": "Company"
},
{
"fieldname": "finance_book",
@@ -279,7 +277,8 @@
{
"fieldname": "transaction_exchange_rate",
"fieldtype": "Float",
"label": "Transaction Exchange Rate"
"label": "Transaction Exchange Rate",
"precision": "9"
},
{
"fieldname": "debit_in_transaction_currency",
@@ -357,7 +356,7 @@
"idx": 1,
"in_create": 1,
"links": [],
"modified": "2024-08-22 13:03:39.997475",
"modified": "2025-04-21 22:37:16.349564",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",
@@ -388,8 +387,9 @@
}
],
"quick_entry": 1,
"row_format": "Dynamic",
"search_fields": "voucher_no,account,posting_date,against_voucher",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -7,7 +7,7 @@ from frappe import _
from frappe.model.document import Document
from frappe.model.meta import get_field_precision
from frappe.model.naming import set_name_from_naming_options
from frappe.utils import flt, fmt_money
from frappe.utils import flt, fmt_money, now
import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -129,7 +129,7 @@ class GLEntry(Document):
if not self.get(k):
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
if not (self.party_type and self.party):
if not self.is_cancelled and not (self.party_type and self.party):
account_type = frappe.get_cached_value("Account", self.account, "account_type")
if account_type == "Receivable":
frappe.throw(
@@ -438,9 +438,14 @@ def update_against_account(voucher_type, voucher_no):
def on_doctype_update():
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"])
add_company_indexes()
def add_company_indexes():
"""Only add company indexes if more than one company exists."""
if frappe.db.count("Company", {"name": ("not like", "%(Demo)%")}) > 1:
frappe.db.add_index("GL Entry", ["posting_date", "company"])
frappe.db.add_index("GL Entry", ["company"])
def rename_gle_sle_docs():
@@ -456,7 +461,7 @@ def rename_temporarily_named_docs(doctype):
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
newname = doc.name
frappe.db.sql(
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0 where name = %s",
(newname, oldname),
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0, modified = %s where name = %s",
(newname, now(), oldname),
auto_commit=True,
)

View File

@@ -123,3 +123,20 @@ class TestGLEntry(IntegrationTestCase):
str(e),
"Party Type and Party can only be set for Receivable / Payable account_Test Account Cost for Goods Sold - _TC",
)
def test_validate_account_party_type_shareholder(self):
jv = make_journal_entry(
"Opening Balance Equity - _TC",
"Cash - _TC",
100,
"_Test Cost Center - _TC",
save=False,
submit=False,
)
for row in jv.accounts:
row.party_type = "Shareholder"
break
jv.save().submit()
self.assertEqual(1, jv.docstatus)

View File

@@ -0,0 +1,79 @@
[
{
"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

@@ -1,62 +0,0 @@
[["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

@@ -430,12 +430,6 @@ frappe.ui.form.on("Journal Entry Account", {
});
}
},
cost_center: function (frm, dt, dn) {
// Don't reset for Gain/Loss type journals, as it will make Debit and Credit values '0'
if (frm.doc.voucher_type != "Exchange Gain Or Loss") {
erpnext.journal_entry.set_account_details(frm, dt, dn);
}
},
account: function (frm, dt, dn) {
erpnext.journal_entry.set_account_details(frm, dt, dn);

View File

@@ -141,6 +141,7 @@ class JournalEntry(AccountsController):
self.validate_empty_accounts_table()
self.validate_inter_company_accounts()
self.validate_depr_entry_voucher_type()
self.validate_company_in_accounting_dimension()
self.validate_advance_accounts()
if self.docstatus == 0:
@@ -578,8 +579,22 @@ class JournalEntry(AccountsController):
if customers:
from erpnext.selling.doctype.customer.customer import check_credit_limit
customer_details = frappe._dict(
frappe.db.get_all(
"Customer Credit Limit",
filters={
"parent": ["in", customers],
"parenttype": ["=", "Customer"],
"company": ["=", self.company],
},
fields=["parent", "bypass_credit_limit_check"],
as_list=True,
)
)
for customer in customers:
check_credit_limit(customer, self.company)
ignore_outstanding_sales_order = bool(customer_details.get(customer))
check_credit_limit(customer, self.company, ignore_outstanding_sales_order)
def validate_cheque_info(self):
if self.voucher_type in ["Bank Entry"]:
@@ -827,14 +842,13 @@ class JournalEntry(AccountsController):
"Debit Note",
"Credit Note",
]:
invoice = frappe.db.get_value(
reference_type, reference_name, ["docstatus", "outstanding_amount"], as_dict=1
)
invoice = frappe.get_doc(reference_type, reference_name)
if invoice.docstatus != 1:
frappe.throw(_("{0} {1} is not submitted").format(reference_type, reference_name))
if total and flt(invoice.outstanding_amount) < total:
precision = invoice.precision("outstanding_amount")
if total and flt(invoice.outstanding_amount, precision) < flt(total, precision):
frappe.throw(
_("Payment against {0} {1} cannot be greater than Outstanding Amount {2}").format(
reference_type, reference_name, invoice.outstanding_amount
@@ -1062,14 +1076,15 @@ class JournalEntry(AccountsController):
gl_map = []
company_currency = erpnext.get_company_currency(self.company)
self.transaction_currency = company_currency
self.transaction_exchange_rate = 1
if self.multi_currency:
for row in self.get("accounts"):
if row.account_currency != company_currency:
self.currency = row.account_currency
self.conversion_rate = row.exchange_rate
# Journal assumes the first foreign currency as transaction currency
self.transaction_currency = row.account_currency
self.transaction_exchange_rate = row.exchange_rate
break
else:
self.currency = company_currency
for d in self.get("accounts"):
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
@@ -1094,6 +1109,18 @@ class JournalEntry(AccountsController):
"credit_in_account_currency": flt(
d.credit_in_account_currency, d.precision("credit_in_account_currency")
),
"transaction_currency": self.transaction_currency,
"transaction_exchange_rate": self.transaction_exchange_rate,
"debit_in_transaction_currency": flt(
d.debit_in_account_currency, d.precision("debit_in_account_currency")
)
if self.transaction_currency == d.account_currency
else flt(d.debit, d.precision("debit")) / self.transaction_exchange_rate,
"credit_in_transaction_currency": flt(
d.credit_in_account_currency, d.precision("credit_in_account_currency")
)
if self.transaction_currency == d.account_currency
else flt(d.credit, d.precision("credit")) / self.transaction_exchange_rate,
"against_voucher_type": d.reference_type,
"against_voucher": d.reference_name,
"remarks": remarks,

View File

@@ -154,10 +154,9 @@ class TestJournalEntry(IntegrationTestCase):
"credit_in_account_currency": 0 if diff > 0 else abs(diff),
},
)
jv.insert()
if account_bal == stock_bal:
self.assertRaises(StockAccountInvalidTransaction, jv.submit)
self.assertRaises(StockAccountInvalidTransaction, jv.save)
frappe.db.rollback()
else:
jv.submit()
@@ -584,7 +583,7 @@ class TestJournalEntry(IntegrationTestCase):
order_by="account",
)
expected = [
{"account": "_Test Bank - _TC", "transaction_exchange_rate": 1.0},
{"account": "_Test Bank - _TC", "transaction_exchange_rate": 85.0},
{"account": "_Test Receivable USD - _TC", "transaction_exchange_rate": 85.0},
]
self.assertEqual(expected, actual)
@@ -600,13 +599,14 @@ def make_journal_entry(
save=True,
submit=False,
project=None,
company=None,
):
if not cost_center:
cost_center = "_Test Cost Center - _TC"
jv = frappe.new_doc("Journal Entry")
jv.posting_date = posting_date or nowdate()
jv.company = "_Test Company"
jv.company = company or "_Test Company"
jv.user_remark = "test"
jv.multi_currency = 1
jv.set(

View File

@@ -0,0 +1,94 @@
[
{
"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

@@ -1,81 +0,0 @@
[["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

@@ -0,0 +1,44 @@
[{
"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

@@ -1,52 +0,0 @@
[["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

@@ -11,6 +11,7 @@ from frappe.utils.background_jobs import enqueue, is_job_enqueued
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
from erpnext.stock.utils import get_default_stock_uom
class OpeningInvoiceCreationTool(Document):
@@ -172,7 +173,7 @@ class OpeningInvoiceCreationTool(Document):
income_expense_account_field = (
"income_account" if row.party_type == "Customer" else "expense_account"
)
default_uom = frappe.db.get_single_value("Stock Settings", "stock_uom") or "Nos"
default_uom = get_default_stock_uom()
rate = flt(row.outstanding_amount) / flt(row.qty)
item_dict = frappe._dict(

View File

@@ -258,6 +258,10 @@ frappe.ui.form.on("Payment Entry", {
frappe.flags.allocate_payment_amount = true;
},
validate: async function (frm) {
await frm.events.set_exchange_gain_loss_deduction(frm);
},
validate_company: (frm) => {
if (!frm.doc.company) {
frappe.throw({ message: __("Please select a Company first."), title: __("Mandatory") });
@@ -374,7 +378,6 @@ frappe.ui.form.on("Payment Entry", {
frm.set_df_property("total_allocated_amount", "options", currency_field);
frm.set_df_property("unallocated_amount", "options", currency_field);
frm.set_df_property("total_taxes_and_charges", "options", currency_field);
frm.set_df_property("party_balance", "options", currency_field);
frm.set_currency_labels(
["total_amount", "outstanding_amount", "allocated_amount"],
@@ -422,15 +425,7 @@ frappe.ui.form.on("Payment Entry", {
if (frm.doc.payment_type == "Internal Transfer") {
$.each(
[
"party",
"party_type",
"party_balance",
"paid_from",
"paid_to",
"references",
"total_allocated_amount",
],
["party", "party_type", "paid_from", "paid_to", "references", "total_allocated_amount"],
function (i, field) {
frm.set_value(field, null);
}
@@ -478,13 +473,10 @@ frappe.ui.form.on("Payment Entry", {
$.each(
[
"party",
"party_balance",
"paid_from",
"paid_to",
"paid_from_account_currency",
"paid_from_account_balance",
"paid_to_account_currency",
"paid_to_account_balance",
"references",
"total_allocated_amount",
],
@@ -529,17 +521,14 @@ frappe.ui.form.on("Payment Entry", {
"paid_from_account_currency",
r.message.party_account_currency
);
frm.set_value("paid_from_account_balance", r.message.account_balance);
} else if (frm.doc.payment_type == "Pay") {
frm.set_value("paid_to", r.message.party_account);
frm.set_value(
"paid_to_account_currency",
r.message.party_account_currency
);
frm.set_value("paid_to_account_balance", r.message.account_balance);
}
},
() => frm.set_value("party_balance", r.message.party_balance),
() => frm.set_value("party_name", r.message.party_name),
() => frm.clear_table("references"),
() => frm.events.hide_unhide_fields(frm),
@@ -591,7 +580,6 @@ frappe.ui.form.on("Payment Entry", {
frm,
frm.doc.paid_from,
"paid_from_account_currency",
"paid_from_account_balance",
function (frm) {
if (frm.doc.payment_type == "Pay") {
frm.events.paid_amount(frm);
@@ -607,7 +595,6 @@ frappe.ui.form.on("Payment Entry", {
frm,
frm.doc.paid_to,
"paid_to_account_currency",
"paid_to_account_balance",
function (frm) {
if (frm.doc.payment_type == "Receive") {
if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
@@ -623,13 +610,7 @@ frappe.ui.form.on("Payment Entry", {
);
},
set_account_currency_and_balance: function (
frm,
account,
currency_field,
balance_field,
callback_function
) {
set_account_currency_and_balance: function (frm, account, currency_field, callback_function) {
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
if (frm.doc.posting_date && account) {
frappe.call({
@@ -644,8 +625,6 @@ frappe.ui.form.on("Payment Entry", {
frappe.run_serially([
() => frm.set_value(currency_field, r.message["account_currency"]),
() => {
frm.set_value(balance_field, r.message["account_balance"]);
if (
frm.doc.payment_type == "Receive" &&
currency_field == "paid_to_account_currency"
@@ -812,27 +791,41 @@ frappe.ui.form.on("Payment Entry", {
paid_amount: function (frm) {
frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
if (!frm.doc.received_amount) {
if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
frm.set_value("received_amount", frm.doc.paid_amount);
} else if (company_currency == frm.doc.paid_to_account_currency) {
frm.set_value("received_amount", frm.doc.base_paid_amount);
frm.set_value("base_received_amount", frm.doc.base_paid_amount);
}
}
frm.trigger("reset_received_amount");
frm.events.hide_unhide_fields(frm);
},
received_amount: function (frm) {
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
frm.set_paid_amount_based_on_received_amount = true;
if (!frm.doc.paid_amount && frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
frm.set_value("paid_amount", frm.doc.received_amount);
if (frm.doc.target_exchange_rate) {
frm.set_value("source_exchange_rate", frm.doc.target_exchange_rate);
}
frm.set_value("base_paid_amount", frm.doc.base_received_amount);
}
frm.set_value(
"base_received_amount",
flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate)
);
if (!frm.doc.paid_amount) {
if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
frm.set_value("paid_amount", frm.doc.received_amount);
if (frm.doc.target_exchange_rate) {
frm.set_value("source_exchange_rate", frm.doc.target_exchange_rate);
}
frm.set_value("base_paid_amount", frm.doc.base_received_amount);
} else if (company_currency == frm.doc.paid_from_account_currency) {
frm.set_value("paid_amount", frm.doc.base_received_amount);
frm.set_value("base_paid_amount", frm.doc.base_received_amount);
}
}
if (frm.doc.payment_type == "Pay")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount, true);
else frm.events.set_unallocated_amount(frm);
@@ -1670,37 +1663,6 @@ 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;
@@ -1879,8 +1841,6 @@ function prompt_for_missing_account(frm, account) {
(values) => resolve(values?.[account]),
__("Please Specify Account")
);
dialog.on_hide = () => resolve("");
});
}

View File

@@ -21,22 +21,20 @@
"party_name",
"book_advance_payments_in_separate_party_account",
"reconcile_on_advance_payment_date",
"advance_reconciliation_takes_effect_on",
"column_break_11",
"bank_account",
"party_bank_account",
"contact_person",
"contact_email",
"payment_accounts_section",
"party_balance",
"paid_from",
"paid_from_account_type",
"paid_from_account_currency",
"paid_from_account_balance",
"column_break_18",
"paid_to",
"paid_to_account_type",
"paid_to_account_currency",
"paid_to_account_balance",
"payment_amounts_section",
"paid_amount",
"paid_amount_after_tax",
@@ -202,14 +200,14 @@
"fieldtype": "Column Break"
},
{
"depends_on": "party",
"depends_on": "eval: doc.party && doc.party_type !== \"Employee\"",
"fieldname": "contact_person",
"fieldtype": "Link",
"label": "Contact",
"options": "Contact"
},
{
"depends_on": "contact_person",
"depends_on": "eval: (doc.contact_person || doc.party_type === \"Employee\") && doc.contact_email",
"fieldname": "contact_email",
"fieldtype": "Data",
"label": "Email",
@@ -222,15 +220,6 @@
"fieldtype": "Section Break",
"label": "Accounts"
},
{
"depends_on": "party",
"fieldname": "party_balance",
"fieldtype": "Currency",
"label": "Party Balance",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
},
{
"bold": 1,
"depends_on": "eval:(in_list([\"Internal Transfer\", \"Pay\"], doc.payment_type) || doc.party)",
@@ -252,15 +241,6 @@
"read_only": 1,
"reqd": 1
},
{
"depends_on": "paid_from",
"fieldname": "paid_from_account_balance",
"fieldtype": "Currency",
"label": "Account Balance (From)",
"options": "paid_from_account_currency",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "column_break_18",
"fieldtype": "Column Break"
@@ -285,15 +265,6 @@
"read_only": 1,
"reqd": 1
},
{
"depends_on": "paid_to",
"fieldname": "paid_to_account_balance",
"fieldtype": "Currency",
"label": "Account Balance (To)",
"options": "paid_to_account_currency",
"print_hide": 1,
"read_only": 1
},
{
"depends_on": "eval:(doc.paid_to && doc.paid_from)",
"fieldname": "payment_amounts_section",
@@ -783,6 +754,16 @@
"options": "No\nYes",
"print_hide": 1,
"search_index": 1
},
{
"default": "Oldest Of Invoice Or Advance",
"fetch_from": "company.reconciliation_takes_effect_on",
"fieldname": "advance_reconciliation_takes_effect_on",
"fieldtype": "Select",
"hidden": 1,
"label": "Advance Reconciliation Takes Effect On",
"no_copy": 1,
"options": "Advance Payment Date\nOldest Of Invoice Or Advance\nReconciliation Date"
}
],
"index_web_pages_for_search": 1,
@@ -796,7 +777,7 @@
"table_fieldname": "payment_entries"
}
],
"modified": "2024-11-07 11:19:19.320883",
"modified": "2025-03-24 16:18:19.920701",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
@@ -842,4 +823,4 @@
"states": [],
"title_field": "title",
"track_changes": 1
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -58,6 +58,8 @@ class TestPaymentEntry(IntegrationTestCase):
pe.insert()
pe.submit()
self.assertEqual(pe.paid_to_account_type, "Cash")
expected_gle = dict(
(d[0], d) for d in [["Debtors - _TC", 0, 1000, so.name], ["_Test Cash - _TC", 1000.0, 0, None]]
)
@@ -291,6 +293,48 @@ class TestPaymentEntry(IntegrationTestCase):
self.assertEqual(si.payment_schedule[0].paid_amount, 200.0)
self.assertEqual(si.payment_schedule[1].paid_amount, 36.0)
def test_payment_entry_against_payment_terms_with_discount_on_pi(self):
pi = make_purchase_invoice(do_not_save=1)
create_payment_terms_template_with_discount()
pi.payment_terms_template = "Test Discount Template"
frappe.db.set_value("Company", pi.company, "default_discount_account", "Write Off - _TC")
pi.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account Service Tax - _TC",
"cost_center": "_Test Cost Center - _TC",
"description": "Service Tax",
"rate": 18,
},
)
pi.save()
pi.submit()
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 1)
pe_with_tax_loss = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe_with_tax_loss.references[0].payment_term, "30 Credit Days with 10% Discount")
self.assertEqual(pe_with_tax_loss.payment_type, "Pay")
self.assertEqual(pe_with_tax_loss.references[0].allocated_amount, 295.0)
self.assertEqual(pe_with_tax_loss.paid_amount, 265.5)
self.assertEqual(pe_with_tax_loss.difference_amount, 0)
self.assertEqual(pe_with_tax_loss.deductions[0].amount, -25.0) # Loss on Income
self.assertEqual(pe_with_tax_loss.deductions[1].amount, -4.5) # Loss on Tax
self.assertEqual(pe_with_tax_loss.deductions[1].account, "_Test Account Service Tax - _TC")
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 0)
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe.references[0].payment_term, "30 Credit Days with 10% Discount")
self.assertEqual(pe.payment_type, "Pay")
self.assertEqual(pe.references[0].allocated_amount, 295.0)
self.assertEqual(pe.paid_amount, 265.5)
self.assertEqual(pe.deductions[0].amount, -29.5)
self.assertEqual(pe.difference_amount, 0)
def test_payment_entry_against_payment_terms_with_discount(self):
si = create_sales_invoice(do_not_save=1, qty=1, rate=200)
create_payment_terms_template_with_discount()
@@ -527,6 +571,8 @@ class TestPaymentEntry(IntegrationTestCase):
pe.insert()
pe.submit()
self.assertEqual(pe.paid_from_account_type, "Bank")
outstanding_amount, status = frappe.db.get_value(
"Purchase Invoice", pi.name, ["outstanding_amount", "status"]
)

View File

@@ -13,6 +13,7 @@
"payment_term_outstanding",
"account_type",
"payment_type",
"reconcile_effect_on",
"column_break_4",
"total_amount",
"outstanding_amount",
@@ -144,12 +145,18 @@
"is_virtual": 1,
"label": "Payment Request Outstanding",
"read_only": 1
},
{
"fieldname": "reconcile_effect_on",
"fieldtype": "Date",
"label": "Reconcile Effect On",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-09-16 18:11:50.019343",
"modified": "2025-01-13 15:56:18.895082",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",

View File

@@ -30,6 +30,7 @@ class PaymentEntryReference(Document):
payment_term: DF.Link | None
payment_term_outstanding: DF.Float
payment_type: DF.Data | None
reconcile_effect_on: DF.Date | None
reference_doctype: DF.Link
reference_name: DF.DynamicLink
total_amount: DF.Float

View File

@@ -335,6 +335,7 @@ class PaymentReconciliation(Document):
for payment in non_reconciled_payments:
row = self.append("payments", {})
row.update(payment)
row.is_advance = payment.book_advance_payments_in_separate_party_account
def get_invoice_entries(self):
# Fetch JVs, Sales and Purchase Invoices for 'invoices' to reconcile against
@@ -424,6 +425,9 @@ class PaymentReconciliation(Document):
def allocate_entries(self, args):
self.validate_entries()
exc_gain_loss_posting_date = frappe.db.get_single_value(
"Accounts Settings", "exchange_gain_loss_posting_date", cache=True
)
invoice_exchange_map = self.get_invoice_exchange_map(args.get("invoices"), args.get("payments"))
default_exchange_gain_loss_account = frappe.get_cached_value(
"Company", self.company, "exchange_gain_loss_account"
@@ -450,6 +454,11 @@ class PaymentReconciliation(Document):
res.difference_account = default_exchange_gain_loss_account
res.exchange_rate = inv.get("exchange_rate")
res.update({"gain_loss_posting_date": pay.get("posting_date")})
if not pay.get("is_advance"):
if exc_gain_loss_posting_date == "Invoice":
res.update({"gain_loss_posting_date": inv.get("invoice_date")})
elif exc_gain_loss_posting_date == "Reconciliation Date":
res.update({"gain_loss_posting_date": nowdate()})
if pay.get("amount") == 0:
entries.append(res)

View File

@@ -6,6 +6,7 @@ import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, add_years, flt, getdate, nowdate, today
from frappe.utils.data import getdate as convert_to_date
from erpnext import get_default_cost_center
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -1680,7 +1681,7 @@ class TestPaymentReconciliation(IntegrationTestCase):
{
"book_advance_payments_in_separate_party_account": 1,
"default_advance_paid_account": self.advance_payable_account,
"reconcile_on_advance_payment_date": 1,
"reconciliation_takes_effect_on": "Advance Payment Date",
},
)
@@ -1729,7 +1730,7 @@ class TestPaymentReconciliation(IntegrationTestCase):
{
"book_advance_payments_in_separate_party_account": 1,
"default_advance_received_account": self.advance_receivable_account,
"reconcile_on_advance_payment_date": 0,
"reconciliation_takes_effect_on": "Oldest Of Invoice Or Advance",
},
)
amount = 200.0
@@ -1838,7 +1839,7 @@ class TestPaymentReconciliation(IntegrationTestCase):
{
"book_advance_payments_in_separate_party_account": 1,
"default_advance_paid_account": self.advance_payable_account,
"reconcile_on_advance_payment_date": 0,
"reconciliation_takes_effect_on": "Oldest Of Invoice Or Advance",
},
)
amount = 200.0
@@ -2057,6 +2058,102 @@ class TestPaymentReconciliation(IntegrationTestCase):
self.assertEqual(pr.get("invoices"), [])
self.assertEqual(pr.get("payments"), [])
def test_advance_reconciliation_effect_on_same_date(self):
frappe.db.set_value(
"Company",
self.company,
{
"book_advance_payments_in_separate_party_account": 1,
"default_advance_received_account": self.advance_receivable_account,
"reconciliation_takes_effect_on": "Reconciliation Date",
},
)
inv_date = convert_to_date(add_days(nowdate(), -1))
adv_date = convert_to_date(add_days(nowdate(), -2))
si = self.create_sales_invoice(posting_date=inv_date, qty=1, rate=200)
pe = self.create_payment_entry(posting_date=adv_date, amount=80).save().submit()
pr = self.create_payment_reconciliation()
pr.from_invoice_date = add_days(nowdate(), -1)
pr.to_invoice_date = nowdate()
pr.from_payment_date = add_days(nowdate(), -2)
pr.to_payment_date = nowdate()
pr.default_advance_account = self.advance_receivable_account
# reconcile multiple payments against invoice
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# Difference amount should not be calculated for base currency accounts
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
si.reload()
self.assertEqual(si.status, "Partly Paid")
# check PR tool output post reconciliation
self.assertEqual(len(pr.get("invoices")), 1)
self.assertEqual(pr.get("invoices")[0].get("outstanding_amount"), 120)
self.assertEqual(pr.get("payments"), [])
# Assert Ledger Entries
gl_entries = frappe.db.get_all(
"GL Entry",
filters={"voucher_no": pe.name},
fields=["account", "posting_date", "voucher_no", "against_voucher", "debit", "credit"],
order_by="account, against_voucher, debit",
)
expected_gl = [
{
"account": self.advance_receivable_account,
"posting_date": adv_date,
"voucher_no": pe.name,
"against_voucher": pe.name,
"debit": 0.0,
"credit": 80.0,
},
{
"account": self.advance_receivable_account,
"posting_date": convert_to_date(nowdate()),
"voucher_no": pe.name,
"against_voucher": pe.name,
"debit": 80.0,
"credit": 0.0,
},
{
"account": self.debit_to,
"posting_date": convert_to_date(nowdate()),
"voucher_no": pe.name,
"against_voucher": si.name,
"debit": 0.0,
"credit": 80.0,
},
{
"account": self.bank,
"posting_date": adv_date,
"voucher_no": pe.name,
"against_voucher": None,
"debit": 80.0,
"credit": 0.0,
},
]
self.assertEqual(expected_gl, gl_entries)
# cancel PE
pe.reload()
pe.cancel()
pr.get_unreconciled_entries()
# check PR tool output
self.assertEqual(len(pr.get("invoices")), 1)
self.assertEqual(len(pr.get("payments")), 0)
self.assertEqual(pr.get("invoices")[0].get("outstanding_amount"), 200)
def make_customer(customer_name, currency=None):
if not frappe.db.exists("Customer", customer_name):

View File

@@ -1,9 +1,9 @@
import json
import frappe
from frappe import _, qb
from frappe import _
from frappe.model.document import Document
from frappe.query_builder.functions import Abs, Sum
from frappe.query_builder.functions import Sum
from frappe.utils import flt, nowdate
from frappe.utils.background_jobs import enqueue
@@ -12,7 +12,6 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
from erpnext.accounts.doctype.payment_entry.payment_entry import (
get_company_defaults,
get_payment_entry,
)
from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate
@@ -122,16 +121,14 @@ class PaymentRequest(Document):
title=_("Invalid Amount"),
)
existing_payment_request_amount = flt(
get_existing_payment_request_amount(self.reference_doctype, self.reference_name)
)
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if not hasattr(ref_doc, "order_type") or ref_doc.order_type != "Shopping Cart":
ref_amount = get_amount(ref_doc, self.payment_account)
if not ref_amount:
frappe.throw(_("Payment Entry is already created"))
existing_payment_request_amount = flt(get_existing_payment_request_amount(ref_doc))
if existing_payment_request_amount + flt(self.grand_total) > ref_amount:
frappe.throw(
_("Total Payment Request amount cannot be greater than {0} amount").format(
@@ -300,6 +297,7 @@ class PaymentRequest(Document):
"payer_name": data.customer_name,
"order_id": self.name,
"currency": self.currency,
"payment_gateway": self.payment_gateway,
}
)
@@ -553,19 +551,8 @@ def make_payment_request(**args):
ref_doc.db_update()
grand_total = grand_total - loyalty_amount
bank_account = (
get_party_bank_account(args.get("party_type"), args.get("party")) if args.get("party_type") else ""
)
draft_payment_request = frappe.db.get_value(
"Payment Request",
{"reference_doctype": ref_doc.doctype, "reference_name": ref_doc.name, "docstatus": 0},
)
# fetches existing payment request `grand_total` amount
existing_payment_request_amount = get_existing_payment_request_amount(ref_doc.doctype, ref_doc.name)
existing_paid_amount = get_existing_paid_amount(ref_doc.doctype, ref_doc.name)
existing_payment_request_amount = get_existing_payment_request_amount(ref_doc)
def validate_and_calculate_grand_total(grand_total, existing_payment_request_amount):
grand_total -= existing_payment_request_amount
@@ -577,7 +564,7 @@ def make_payment_request(**args):
if args.order_type == "Shopping Cart":
# If Payment Request is in an advanced stage, then create for remaining amount.
if get_existing_payment_request_amount(
ref_doc.doctype, ref_doc.name, ["Initiated", "Partially Paid", "Payment Ordered", "Paid"]
ref_doc, ["Initiated", "Partially Paid", "Payment Ordered", "Paid"]
):
grand_total = validate_and_calculate_grand_total(grand_total, existing_payment_request_amount)
else:
@@ -586,14 +573,10 @@ def make_payment_request(**args):
else:
grand_total = validate_and_calculate_grand_total(grand_total, existing_payment_request_amount)
if existing_paid_amount:
if ref_doc.party_account_currency == ref_doc.currency:
if ref_doc.conversion_rate:
grand_total -= flt(existing_paid_amount / ref_doc.conversion_rate)
else:
grand_total -= flt(existing_paid_amount)
else:
grand_total -= flt(existing_paid_amount / ref_doc.conversion_rate)
draft_payment_request = frappe.db.get_value(
"Payment Request",
{"reference_doctype": ref_doc.doctype, "reference_name": ref_doc.name, "docstatus": 0},
)
if draft_payment_request:
frappe.db.set_value(
@@ -601,6 +584,11 @@ def make_payment_request(**args):
)
pr = frappe.get_doc("Payment Request", draft_payment_request)
else:
bank_account = (
get_party_bank_account(args.get("party_type"), args.get("party"))
if args.get("party_type")
else ""
)
pr = frappe.new_doc("Payment Request")
if not args.get("payment_request_type"):
@@ -680,22 +668,35 @@ def make_payment_request(**args):
def get_amount(ref_doc, payment_account=None):
"""get amount based on doctype"""
grand_total = 0
dt = ref_doc.doctype
if dt in ["Sales Order", "Purchase Order"]:
grand_total = flt(ref_doc.rounded_total) or flt(ref_doc.grand_total)
grand_total = (flt(ref_doc.rounded_total) or flt(ref_doc.grand_total)) - ref_doc.advance_paid
elif dt in ["Sales Invoice", "Purchase Invoice"]:
if not ref_doc.get("is_pos"):
if (
dt == "Sales Invoice"
and ref_doc.is_pos
and ref_doc.payments
and any(
[
payment.type == "Phone" and payment.account == payment_account
for payment in ref_doc.payments
]
)
):
grand_total = sum(
[
payment.amount
for payment in ref_doc.payments
if payment.type == "Phone" and payment.account == payment_account
]
)
else:
if ref_doc.party_account_currency == ref_doc.currency:
grand_total = flt(ref_doc.rounded_total or ref_doc.grand_total)
grand_total = flt(ref_doc.outstanding_amount)
else:
grand_total = flt(
flt(ref_doc.base_rounded_total or ref_doc.base_grand_total) / ref_doc.conversion_rate
)
elif dt == "Sales Invoice":
for pay in ref_doc.payments:
if pay.type == "Phone" and pay.account == payment_account:
grand_total = pay.amount
break
grand_total = flt(flt(ref_doc.outstanding_amount) / ref_doc.conversion_rate)
elif dt == "POS Invoice":
for pay in ref_doc.payments:
if pay.type == "Phone" and pay.account == payment_account:
@@ -704,10 +705,7 @@ def get_amount(ref_doc, payment_account=None):
elif dt == "Fees":
grand_total = ref_doc.outstanding_amount
if grand_total > 0:
return flt(grand_total, get_currency_precision())
else:
frappe.throw(_("Payment Entry is already created"))
return flt(grand_total, get_currency_precision()) if grand_total > 0 else 0
def get_irequest_status(payment_requests: None | list = None) -> list:
@@ -750,7 +748,7 @@ def cancel_old_payment_requests(ref_dt, ref_dn):
frappe.db.set_value("Integration Request", ireq.name, "status", "Cancelled")
def get_existing_payment_request_amount(ref_dt, ref_dn, statuses: list | None = None) -> list:
def get_existing_payment_request_amount(ref_doc, statuses: list | None = None) -> list:
"""
Return the total amount of Payment Requests against a reference document.
"""
@@ -758,9 +756,9 @@ def get_existing_payment_request_amount(ref_dt, ref_dn, statuses: list | None =
query = (
frappe.qb.from_(PR)
.select(Sum(PR.grand_total))
.where(PR.reference_doctype == ref_dt)
.where(PR.reference_name == ref_dn)
.select(Sum(PR.outstanding_amount))
.where(PR.reference_doctype == ref_doc.doctype)
.where(PR.reference_name == ref_doc.name)
.where(PR.docstatus == 1)
)
@@ -769,30 +767,12 @@ def get_existing_payment_request_amount(ref_dt, ref_dn, statuses: list | None =
response = query.run()
return response[0][0] if response[0] else 0
os_amount_in_transaction_currency = flt(response[0][0] if response[0] else 0)
if ref_doc.currency != ref_doc.party_account_currency:
os_amount_in_transaction_currency = flt(os_amount_in_transaction_currency / ref_doc.conversion_rate)
def get_existing_paid_amount(doctype, name):
PL = frappe.qb.DocType("Payment Ledger Entry")
PER = frappe.qb.DocType("Payment Entry Reference")
query = (
frappe.qb.from_(PL)
.left_join(PER)
.on(
(PER.reference_doctype == PL.against_voucher_type) & (PER.reference_name == PL.against_voucher_no)
)
.select(Abs(Sum(PL.amount)).as_("total_paid_amount"))
.where(PL.against_voucher_type.eq(doctype))
.where(PL.against_voucher_no.eq(name))
.where(PL.amount < 0)
.where(PL.delinked == 0)
.where(PER.docstatus == 1)
.where(PER.payment_request.isnull())
)
response = query.run()
return response[0][0] if response[0] else 0
return os_amount_in_transaction_currency
def get_gateway_details(args): # nosemgrep

View File

@@ -465,6 +465,16 @@ class TestPaymentRequest(IntegrationTestCase):
self.assertEqual(pr.outstanding_amount, 800)
self.assertEqual(pr.grand_total, 1000)
self.assertRaisesRegex(
frappe.exceptions.ValidationError,
re.compile(r"Payment Request is already created"),
make_payment_request,
dt="Sales Order",
dn=so.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
# complete payment
pe = pr.create_payment_entry()
@@ -484,7 +494,7 @@ class TestPaymentRequest(IntegrationTestCase):
# creating a more payment Request must not allowed
self.assertRaisesRegex(
frappe.exceptions.ValidationError,
re.compile(r"Payment Request is already created"),
re.compile(r"Payment Entry is already created"),
make_payment_request,
dt="Sales Order",
dn=so.name,
@@ -516,6 +526,17 @@ class TestPaymentRequest(IntegrationTestCase):
self.assertEqual(pr.party_account_currency, "INR")
self.assertEqual(pr.status, "Initiated")
self.assertRaisesRegex(
frappe.exceptions.ValidationError,
re.compile(r"Payment Request is already created"),
make_payment_request,
dt="Purchase Invoice",
dn=pi.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
# to make partial payment
pe = pr.create_payment_entry(submit=False)
pe.paid_amount = 2000
@@ -544,7 +565,7 @@ class TestPaymentRequest(IntegrationTestCase):
# creating a more payment Request must not allowed
self.assertRaisesRegex(
frappe.exceptions.ValidationError,
re.compile(r"Payment Request is already created"),
re.compile(r"Payment Entry is already created"),
make_payment_request,
dt="Purchase Invoice",
dn=pi.name,
@@ -709,6 +730,73 @@ class TestPaymentRequest(IntegrationTestCase):
self.assertEqual(pr.grand_total, si.outstanding_amount)
def test_partial_paid_invoice_with_more_payment_entry(self):
pi = make_purchase_invoice(currency="INR", qty=1, rate=500)
pi.submit()
pi_1 = make_purchase_invoice(currency="INR", qty=1, rate=300)
pi_1.submit()
pr = make_payment_request(dt="Purchase Invoice", dn=pi.name, mute_email=1, submit_doc=0, return_doc=1)
pr.grand_total = 200
pr.submit()
pr.create_payment_entry()
pr_1 = make_payment_request(
dt="Purchase Invoice", dn=pi.name, mute_email=1, submit_doc=0, return_doc=1
)
pr_1.grand_total = 200
pr_1.submit()
pr_1.create_payment_entry()
pe = get_payment_entry(dt="Purchase Invoice", dn=pi.name)
pe.paid_amount = 200
pe.references[0].reference_doctype = pi.doctype
pe.references[0].reference_name = pi.name
pe.references[0].grand_total = pi.grand_total
pe.references[0].outstanding_amount = pi.outstanding_amount
pe.references[0].allocated_amount = 100
pe.append(
"references",
{
"reference_doctype": pi_1.doctype,
"reference_name": pi_1.name,
"grand_total": pi_1.grand_total,
"outstanding_amount": pi_1.outstanding_amount,
"allocated_amount": 100,
},
)
pr_2 = make_payment_request(dt="Purchase Invoice", dn=pi.name, mute_email=1)
pi.load_from_db()
self.assertEqual(pr_2.grand_total, pi.outstanding_amount)
def test_consider_journal_entry_and_return_invoice(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
si = create_sales_invoice(currency="INR", qty=5, rate=500)
je = make_journal_entry("_Test Cash - _TC", "Debtors - _TC", 500, save=False)
je.accounts[1].party_type = "Customer"
je.accounts[1].party = si.customer
je.accounts[1].reference_type = "Sales Invoice"
je.accounts[1].reference_name = si.name
je.accounts[1].credit_in_account_currency = 500
je.submit()
pe = get_payment_entry("Sales Invoice", si.name)
pe.paid_amount = 500
pe.references[0].allocated_amount = 500
pe.save()
pe.submit()
cr_note = create_sales_invoice(qty=-1, rate=500, is_return=1, return_against=si.name, do_not_save=1)
cr_note.update_outstanding_for_self = 0
cr_note.save()
cr_note.submit()
si.load_from_db()
pr = make_payment_request(dt="Sales Invoice", dn=si.name, mute_email=1)
self.assertEqual(pr.grand_total, si.outstanding_amount)
def test_partial_paid_invoice_with_submitted_payment_entry(self):
pi = make_purchase_invoice(currency="INR", qty=1, rate=5000)

View File

@@ -24,7 +24,9 @@
"paid_amount",
"discounted_amount",
"column_break_3",
"base_payment_amount"
"base_payment_amount",
"base_outstanding",
"base_paid_amount"
],
"fields": [
{
@@ -155,18 +157,34 @@
"fieldtype": "Currency",
"label": "Payment Amount (Company Currency)",
"options": "Company:company:default_currency"
},
{
"fieldname": "base_outstanding",
"fieldtype": "Currency",
"label": "Outstanding (Company Currency)",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"depends_on": "base_paid_amount",
"fieldname": "base_paid_amount",
"fieldtype": "Currency",
"label": "Paid Amount (Company Currency)",
"options": "Company:company:default_currency",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-03-27 13:10:11.356171",
"modified": "2025-03-11 11:06:51.792982",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": [],

View File

@@ -14,6 +14,8 @@ class PaymentSchedule(Document):
if TYPE_CHECKING:
from frappe.types import DF
base_outstanding: DF.Currency
base_paid_amount: DF.Currency
base_payment_amount: DF.Currency
description: DF.SmallText | None
discount: DF.Float

View File

@@ -0,0 +1,34 @@
[
{
"doctype":"Payment Term",
"due_date_based_on":"Day(s) after invoice date",
"payment_term_name":"_Test N30",
"description":"_Test Net 30 Days",
"invoice_portion":50,
"credit_days":30
},
{
"doctype":"Payment Term",
"due_date_based_on":"Day(s) after invoice date",
"payment_term_name":"_Test COD",
"description":"_Test Cash on Delivery",
"invoice_portion":50,
"credit_days":0
},
{
"doctype":"Payment Term",
"due_date_based_on":"Month(s) after the end of the invoice month",
"payment_term_name":"_Test EONM",
"description":"_Test End of Next Month",
"invoice_portion":100,
"credit_months":1
},
{
"doctype":"Payment Term",
"due_date_based_on":"Day(s) after invoice date",
"payment_term_name":"_Test N30 1",
"description":"_Test Net 30 Days",
"invoice_portion":100,
"credit_days":30
}
]

View File

@@ -1,28 +0,0 @@
[["Payment Term"]]
due_date_based_on = "Day(s) after invoice date"
payment_term_name = "_Test N30"
description = "_Test Net 30 Days"
invoice_portion = 50
credit_days = 30
[["Payment Term"]]
due_date_based_on = "Day(s) after invoice date"
payment_term_name = "_Test COD"
description = "_Test Cash on Delivery"
invoice_portion = 50
credit_days = 0
[["Payment Term"]]
due_date_based_on = "Month(s) after the end of the invoice month"
payment_term_name = "_Test EONM"
description = "_Test End of Next Month"
invoice_portion = 100
credit_months = 1
[["Payment Term"]]
due_date_based_on = "Day(s) after invoice date"
payment_term_name = "_Test N30 1"
description = "_Test Net 30 Days"
invoice_portion = 100
credit_days = 30

View File

@@ -0,0 +1,60 @@
[
{
"doctype":"Payment Terms Template",
"terms":[
{
"doctype":"Payment Terms Template Detail",
"due_date_based_on":"Day(s) after invoice date",
"idx":1,
"description":"Cash on Delivery",
"invoice_portion":50,
"credit_days":0,
"credit_months":0,
"payment_term":"_Test COD"
},
{
"doctype":"Payment Terms Template Detail",
"due_date_based_on":"Day(s) after invoice date",
"idx":2,
"description":"Net 30 Days ",
"invoice_portion":50,
"credit_days":30,
"credit_months":0,
"payment_term":"_Test N30"
}
],
"template_name":"_Test Payment Term Template"
},
{
"doctype":"Payment Terms Template",
"terms":[
{
"doctype":"Payment Terms Template Detail",
"due_date_based_on":"Month(s) after the end of the invoice month",
"idx":1,
"description":"_Test End of Next Months",
"invoice_portion":100,
"credit_days":0,
"credit_months":1,
"payment_term":"_Test EONM"
}
],
"template_name":"_Test Payment Term Template 1"
},
{
"doctype":"Payment Terms Template",
"terms":[
{
"doctype":"Payment Terms Template Detail",
"due_date_based_on":"Day(s) after invoice date",
"idx":1,
"description":"_Test Net Within 30 days",
"invoice_portion":100,
"credit_days":30,
"credit_months":0,
"payment_term":"_Test N30 1"
}
],
"template_name":"_Test Payment Term Template 3"
}
]

View File

@@ -1,49 +0,0 @@
[["Payment Terms Template"]]
template_name = "_Test Payment Term Template"
[["Payment Terms Template".terms]]
doctype = "Payment Terms Template Detail"
due_date_based_on = "Day(s) after invoice date"
idx = 1
description = "Cash on Delivery"
invoice_portion = 50
credit_days = 0
credit_months = 0
payment_term = "_Test COD"
[["Payment Terms Template".terms]]
doctype = "Payment Terms Template Detail"
due_date_based_on = "Day(s) after invoice date"
idx = 2
description = "Net 30 Days "
invoice_portion = 50
credit_days = 30
credit_months = 0
payment_term = "_Test N30"
[["Payment Terms Template"]]
template_name = "_Test Payment Term Template 1"
[["Payment Terms Template".terms]]
doctype = "Payment Terms Template Detail"
due_date_based_on = "Month(s) after the end of the invoice month"
idx = 1
description = "_Test End of Next Months"
invoice_portion = 100
credit_days = 0
credit_months = 1
payment_term = "_Test EONM"
[["Payment Terms Template"]]
template_name = "_Test Payment Term Template 3"
[["Payment Terms Template".terms]]
doctype = "Payment Terms Template Detail"
due_date_based_on = "Day(s) after invoice date"
idx = 1
description = "_Test Net Within 30 days"
invoice_portion = 100
credit_days = 30
credit_months = 0
payment_term = "_Test N30 1"

View File

@@ -139,7 +139,7 @@ class PeriodClosingVoucher(AccountsController):
self.cancel_gl_entries()
def make_gl_entries(self):
if self.get_gle_count_in_selected_period() > 5000:
if frappe.db.estimate_count("GL Entry") > 100_000:
frappe.enqueue(
process_gl_and_closing_entries,
doc=self,
@@ -154,16 +154,6 @@ class PeriodClosingVoucher(AccountsController):
else:
process_gl_and_closing_entries(self)
def get_gle_count_in_selected_period(self):
return frappe.db.count(
"GL Entry",
{
"posting_date": ["between", [self.period_start_date, self.period_end_date]],
"company": self.company,
"is_cancelled": 0,
},
)
def get_pcv_gl_entries(self):
self.pl_accounts_reverse_gle = []
self.closing_account_gle = []

View File

@@ -26,6 +26,7 @@ class TestPeriodClosingVoucher(IntegrationTestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center,
company=company,
save=False,
)
jv1.company = company
@@ -38,6 +39,7 @@ class TestPeriodClosingVoucher(IntegrationTestCase):
account1="Cost of Goods Sold - TPC",
account2="Cash - TPC",
cost_center=cost_center,
company=company,
save=False,
)
jv2.company = company
@@ -155,6 +157,7 @@ class TestPeriodClosingVoucher(IntegrationTestCase):
amount=400,
cost_center=cost_center,
posting_date="2021-03-15",
company=company,
)
jv.company = company
jv.finance_book = create_finance_book().name
@@ -197,6 +200,7 @@ class TestPeriodClosingVoucher(IntegrationTestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center,
company=company,
save=False,
)
jv1.company = company
@@ -219,6 +223,7 @@ class TestPeriodClosingVoucher(IntegrationTestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center1,
company=company,
save=False,
)
jv1.company = company
@@ -231,6 +236,7 @@ class TestPeriodClosingVoucher(IntegrationTestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center2,
company=company,
save=False,
)
jv2.company = company
@@ -260,6 +266,7 @@ class TestPeriodClosingVoucher(IntegrationTestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center2,
company=company,
save=False,
)

View File

@@ -124,6 +124,11 @@ class POSClosingEntry(StatusUpdater):
def on_submit(self):
consolidate_pos_invoices(closing_entry=self)
frappe.publish_realtime(
f"poe_{self.pos_opening_entry}_closed",
self,
docname=f"POS Opening Entry/{self.pos_opening_entry}",
)
def on_cancel(self):
unconsolidate_pos_invoices(closing_entry=self)

View File

@@ -39,10 +39,12 @@ class TestPOSClosingEntry(IntegrationTestCase):
pos_inv1 = create_pos_invoice(rate=3500, do_not_submit=1)
pos_inv1.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3500})
pos_inv1.save()
pos_inv1.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3200})
pos_inv2.save()
pos_inv2.submit()
pcv_doc = make_closing_entry_from_opening(opening_entry)
@@ -68,6 +70,7 @@ class TestPOSClosingEntry(IntegrationTestCase):
pos_inv = create_pos_invoice(rate=3500, do_not_submit=1, item_name="Test Item", without_item_code=1)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3500})
pos_inv.save()
pos_inv.submit()
pcv_doc = make_closing_entry_from_opening(opening_entry)
@@ -86,10 +89,12 @@ class TestPOSClosingEntry(IntegrationTestCase):
pos_inv1 = create_pos_invoice(rate=3500, do_not_submit=1)
pos_inv1.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3500})
pos_inv1.save()
pos_inv1.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3200})
pos_inv2.save()
pos_inv2.submit()
# make return entry of pos_inv2
@@ -111,10 +116,12 @@ class TestPOSClosingEntry(IntegrationTestCase):
pos_inv1 = create_pos_invoice(rate=3500, do_not_submit=1)
pos_inv1.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3500})
pos_inv1.save()
pos_inv1.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3200})
pos_inv2.save()
pos_inv2.submit()
pcv_doc = make_closing_entry_from_opening(opening_entry)
@@ -165,6 +172,7 @@ class TestPOSClosingEntry(IntegrationTestCase):
opening_entry = create_opening_entry(pos_profile, test_user.name)
pos_inv1 = create_pos_invoice(rate=350, do_not_submit=1, pos_profile=pos_profile.name)
pos_inv1.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3500})
pos_inv1.save()
pos_inv1.submit()
# if in between a mandatory accounting dimension is added to the POS Profile then
@@ -226,6 +234,7 @@ class TestPOSClosingEntry(IntegrationTestCase):
do_not_submit=True,
)
pos_inv.payments[0].amount = pos_inv.grand_total
pos_inv.save()
pos_inv.submit()
pos_inv2 = create_pos_invoice(
item_code=item_code,
@@ -236,11 +245,9 @@ class TestPOSClosingEntry(IntegrationTestCase):
do_not_submit=True,
)
pos_inv2.payments[0].amount = pos_inv2.grand_total
pos_inv2.save()
pos_inv2.submit()
batch_qty = frappe.db.get_value("Batch", batch_no, "batch_qty")
self.assertEqual(batch_qty, 10)
batch_qty_with_pos = get_batch_qty(batch_no, "_Test Warehouse - _TC", item_code)
self.assertEqual(batch_qty_with_pos, 0.0)
@@ -270,9 +277,6 @@ class TestPOSClosingEntry(IntegrationTestCase):
pcv_doc.reload()
pcv_doc.cancel()
batch_qty = frappe.db.get_value("Batch", batch_no, "batch_qty")
self.assertEqual(batch_qty, 10)
batch_qty_with_pos = get_batch_qty(batch_no, "_Test Warehouse - _TC", item_code)
self.assertEqual(batch_qty_with_pos, 0.0)

View File

@@ -8,7 +8,6 @@
"engine": "InnoDB",
"field_order": [
"customer_section",
"title",
"naming_series",
"customer",
"customer_name",
@@ -192,16 +191,6 @@
"fieldtype": "Section Break",
"options": "fa fa-user"
},
{
"allow_on_submit": 1,
"default": "{customer_name}",
"fieldname": "title",
"fieldtype": "Data",
"hidden": 1,
"label": "Title",
"no_copy": 1,
"print_hide": 1
},
{
"bold": 1,
"fieldname": "naming_series",
@@ -1584,7 +1573,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2024-11-26 13:10:50.309570",
"modified": "2025-01-06 15:03:19.957277",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",
@@ -1635,7 +1624,6 @@
"sort_order": "DESC",
"states": [],
"timeline_field": "customer",
"title_field": "title",
"track_changes": 1,
"track_seen": 1
}
"title_field": "customer_name",
"track_changes": 1
}

View File

@@ -20,6 +20,10 @@ from erpnext.controllers.queries import item_query as _item_query
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
class PartialPaymentValidationError(frappe.ValidationError):
pass
class POSInvoice(SalesInvoice):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.
@@ -161,7 +165,6 @@ class POSInvoice(SalesInvoice):
terms: DF.TextEditor | None
territory: DF.Link | None
timesheets: DF.Table[SalesInvoiceTimesheet]
title: DF.Data | None
to_date: DF.Date | None
total: DF.Currency
total_advance: DF.Currency
@@ -193,6 +196,7 @@ class POSInvoice(SalesInvoice):
# run on validate method of selling controller
super(SalesInvoice, self).validate()
self.validate_pos_opening_entry()
self.validate_auto_set_posting_time()
self.validate_mode_of_payment()
self.validate_uom_is_integer("stock_uom", "stock_qty")
@@ -211,6 +215,7 @@ class POSInvoice(SalesInvoice):
self.validate_payment_amount()
self.validate_loyalty_transaction()
self.validate_company_with_pos_company()
self.validate_full_payment()
if self.coupon_code:
from erpnext.accounts.doctype.pricing_rule.utils import validate_coupon_code
@@ -323,6 +328,18 @@ class POSInvoice(SalesInvoice):
_("Payment related to {0} is not completed").format(pay.mode_of_payment)
)
def validate_pos_opening_entry(self):
opening_entries = frappe.get_list(
"POS Opening Entry", filters={"pos_profile": self.pos_profile, "status": "Open", "docstatus": 1}
)
if len(opening_entries) == 0:
frappe.throw(
title=_("POS Opening Entry Missing"),
msg=_("No open POS Opening Entry found for POS Profile {0}.").format(
frappe.bold(self.pos_profile)
),
)
def validate_stock_availablility(self):
if self.is_return:
return
@@ -485,6 +502,20 @@ class POSInvoice(SalesInvoice):
if self.redeem_loyalty_points and self.loyalty_program and self.loyalty_points:
validate_loyalty_points(self, self.loyalty_points)
def validate_full_payment(self):
invoice_total = flt(self.rounded_total) or flt(self.grand_total)
if self.docstatus == 1:
if self.is_return and self.paid_amount != invoice_total:
frappe.throw(
msg=_("Partial Payment in POS Invoice is not allowed."), exc=PartialPaymentValidationError
)
if self.paid_amount < invoice_total:
frappe.throw(
msg=_("Partial Payment in POS Invoice is not allowed."), exc=PartialPaymentValidationError
)
def set_status(self, update=False, status=None, update_modified=True):
if self.is_new():
if self.get("amended_from"):

View File

@@ -7,7 +7,7 @@ import frappe
from frappe import _
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.pos_invoice.pos_invoice import make_sales_return
from erpnext.accounts.doctype.pos_invoice.pos_invoice import PartialPaymentValidationError, make_sales_return
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.stock.doctype.item.test_item import make_item
@@ -28,6 +28,12 @@ class TestPOSInvoice(IntegrationTestCase):
make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item", qty=800, basic_rate=100)
frappe.db.sql("delete from `tabTax Rule`")
from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile
from erpnext.accounts.doctype.pos_opening_entry.test_pos_opening_entry import create_opening_entry
cls.test_user, cls.pos_profile = init_user_and_profile()
create_opening_entry(cls.pos_profile, cls.test_user)
def tearDown(self):
if frappe.session.user != "Administrator":
frappe.set_user("Administrator")
@@ -317,7 +323,7 @@ class TestPOSInvoice(IntegrationTestCase):
)
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 2000, "default": 1}
)
pos.insert()
@@ -328,6 +334,11 @@ class TestPOSInvoice(IntegrationTestCase):
# partial return 1
pos_return1.get("items")[0].qty = -1
pos_return1.set("payments", [])
pos_return1.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": -1000, "default": 1}
)
pos_return1.paid_amount = -1000
pos_return1.submit()
pos_return1.reload()
@@ -342,6 +353,11 @@ class TestPOSInvoice(IntegrationTestCase):
# partial return 2
pos_return2 = make_sales_return(pos.name)
pos_return2.set("payments", [])
pos_return2.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": -1000, "default": 1}
)
pos_return2.paid_amount = -1000
pos_return2.submit()
self.assertEqual(pos_return2.get("items")[0].qty, -1)
@@ -377,6 +393,15 @@ class TestPOSInvoice(IntegrationTestCase):
inv.payments = []
self.assertRaises(frappe.ValidationError, inv.insert)
def test_partial_payment(self):
pos_inv = create_pos_invoice(rate=10000, do_not_save=1)
pos_inv.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 9000},
)
pos_inv.insert()
self.assertRaises(PartialPaymentValidationError, pos_inv.submit)
def test_serialized_item_transaction(self):
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
@@ -589,7 +614,13 @@ class TestPOSInvoice(IntegrationTestCase):
"Test Loyalty Customer", company="_Test Company", loyalty_program="Test Single Loyalty"
)
inv = create_pos_invoice(customer="Test Loyalty Customer", rate=10000)
inv = create_pos_invoice(customer="Test Loyalty Customer", rate=10000, do_not_save=1)
inv.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 10000},
)
inv.insert()
inv.submit()
lpe = frappe.get_doc(
"Loyalty Point Entry",
@@ -615,7 +646,13 @@ class TestPOSInvoice(IntegrationTestCase):
)
# add 10 loyalty points
create_pos_invoice(customer="Test Loyalty Customer", rate=10000)
pos_inv = create_pos_invoice(customer="Test Loyalty Customer", rate=10000, do_not_save=1)
pos_inv.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 10000},
)
pos_inv.paid_amount = 10000
pos_inv.submit()
before_lp_details = get_loyalty_program_details_with_points(
"Test Loyalty Customer", company="_Test Company", loyalty_program="Test Single Loyalty"
@@ -649,10 +686,12 @@ class TestPOSInvoice(IntegrationTestCase):
test_user, pos_profile = init_user_and_profile()
pos_inv = create_pos_invoice(rate=300, additional_discount_percentage=10, do_not_submit=1)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 270})
pos_inv.save()
pos_inv.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3200})
pos_inv2.save()
pos_inv2.submit()
consolidate_pos_invoices()
@@ -684,6 +723,7 @@ class TestPOSInvoice(IntegrationTestCase):
"included_in_print_rate": 1,
},
)
pos_inv.save()
pos_inv.submit()
pos_inv2 = create_pos_invoice(rate=300, qty=2, do_not_submit=1)
@@ -700,6 +740,7 @@ class TestPOSInvoice(IntegrationTestCase):
"included_in_print_rate": 1,
},
)
pos_inv2.save()
pos_inv2.submit()
consolidate_pos_invoices()
@@ -752,6 +793,7 @@ class TestPOSInvoice(IntegrationTestCase):
"included_in_print_rate": 1,
},
)
pos_inv2.save()
pos_inv2.submit()
consolidate_pos_invoices()
@@ -782,7 +824,10 @@ class TestPOSInvoice(IntegrationTestCase):
# POS Invoice 1, for the batch without bundle
pos_inv1 = create_pos_invoice(item="_BATCH ITEM Test For Reserve", rate=300, qty=15, do_not_save=1)
pos_inv1.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 4500},
)
pos_inv1.items[0].batch_no = batch_no
pos_inv1.save()
pos_inv1.submit()
@@ -798,8 +843,14 @@ class TestPOSInvoice(IntegrationTestCase):
# POS Invoice 2, for the batch with bundle
pos_inv2 = create_pos_invoice(
item="_BATCH ITEM Test For Reserve", rate=300, qty=10, batch_no=batch_no
item="_BATCH ITEM Test For Reserve", rate=300, qty=10, batch_no=batch_no, do_not_save=1
)
pos_inv2.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3000},
)
pos_inv2.save()
pos_inv2.submit()
pos_inv2.reload()
self.assertTrue(pos_inv2.items[0].serial_and_batch_bundle)
@@ -834,6 +885,10 @@ class TestPOSInvoice(IntegrationTestCase):
pos_inv1 = create_pos_invoice(
item=item.name, rate=300, qty=1, do_not_submit=1, batch_no="TestBatch 01"
)
pos_inv1.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 300},
)
pos_inv1.save()
pos_inv1.submit()
@@ -843,7 +898,8 @@ class TestPOSInvoice(IntegrationTestCase):
{
"item_code": item.name,
"warehouse": pos_inv2.items[0].warehouse,
"voucher_type": "Delivery Note",
"voucher_type": "POS Invoice",
"voucher_no": pos_inv2.name,
"qty": 2,
"avg_rate": 300,
"batches": frappe._dict({"TestBatch 01": 2}),

View File

@@ -8,11 +8,14 @@ import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import map_child_doc, map_doc
from frappe.query_builder import DocType
from frappe.utils import cint, flt, get_time, getdate, nowdate, nowtime
from frappe.utils.background_jobs import enqueue, is_job_enqueued
from frappe.utils.scheduler import is_scheduler_inactive
from erpnext.accounts.doctype.pos_profile.pos_profile import required_accounting_dimensions
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_checks_for_pl_and_bs_accounts,
)
from erpnext.controllers.taxes_and_totals import ItemWiseTaxDetail
@@ -117,17 +120,18 @@ class POSInvoiceMergeLog(Document):
returns = [d for d in pos_invoice_docs if d.get("is_return") == 1]
sales = [d for d in pos_invoice_docs if d.get("is_return") == 0]
sales_invoice, credit_note = "", ""
sales_invoice, credit_notes = "", {}
sales_invoice_doc = None
if sales:
sales_invoice_doc = self.process_merging_into_sales_invoice(sales)
sales_invoice = sales_invoice_doc.name
if returns:
credit_note = self.process_merging_into_credit_note(returns, sales_invoice_doc)
distinguished_returns = self.distinguish_return_pos_invoices(returns, sales_invoice_doc)
credit_notes = self.process_merging_into_credit_notes(distinguished_returns)
self.save() # save consolidated_sales_invoice & consolidated_credit_note ref in merge log
self.update_pos_invoices(pos_invoice_docs, sales_invoice, credit_note)
self.update_pos_invoices(pos_invoice_docs, sales_invoice, credit_notes)
def on_cancel(self):
pos_invoice_docs = [frappe.get_cached_doc("POS Invoice", d.pos_invoice) for d in self.pos_invoices]
@@ -157,34 +161,50 @@ class POSInvoiceMergeLog(Document):
return sales_invoice
def process_merging_into_credit_note(self, data, sales_invoice_doc=None):
credit_note = self.get_new_sales_invoice()
credit_note.is_return = 1
def process_merging_into_credit_notes(self, data):
credit_notes = {}
for key, value in data.items():
if not value:
continue
credit_note = self.merge_pos_invoice_into(credit_note, data)
referenes = {}
credit_note = self.get_new_sales_invoice()
credit_note.is_return = 1
if sales_invoice_doc:
credit_note.return_against = sales_invoice_doc.name
credit_note = self.merge_pos_invoice_into(credit_note, value)
credit_note.return_against = key
for d in sales_invoice_doc.items:
referenes[d.item_code] = d.name
credit_note.is_consolidated = 1
credit_note.set_posting_time = 1
credit_note.posting_date = getdate(self.posting_date)
credit_note.posting_time = get_time(self.posting_time)
# TODO: return could be against multiple sales invoice which could also have been consolidated?
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
credit_note.submit()
for d in credit_note.items:
d.sales_invoice_item = referenes.get(d.item_code)
self.consolidated_credit_note = credit_note.name
credit_notes[credit_note.name] = [d.name for d in value]
credit_note.is_consolidated = 1
credit_note.set_posting_time = 1
credit_note.posting_date = getdate(self.posting_date)
credit_note.posting_time = get_time(self.posting_time)
# TODO: return could be against multiple sales invoice which could also have been consolidated?
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
credit_note.submit()
return credit_notes
self.consolidated_credit_note = credit_note.name
def distinguish_return_pos_invoices(self, data, sales_invoice_doc=None):
return_invoices = {}
return credit_note.name
return_invoices[sales_invoice_doc.name if sales_invoice_doc else None] = []
for doc in data:
sales_invoices_of_return_against = frappe.db.get_value(
"POS Invoice", doc.return_against, "consolidated_invoice"
)
if sales_invoices_of_return_against:
if sales_invoices_of_return_against in return_invoices:
return_invoices[sales_invoices_of_return_against].append(doc)
else:
return_invoices[sales_invoices_of_return_against] = [doc]
else:
return_invoices[sales_invoice_doc.name if sales_invoice_doc else None].append(doc)
return return_invoices
def merge_pos_invoice_into(self, invoice, data):
items, payments, taxes = [], [], []
@@ -210,33 +230,20 @@ class POSInvoiceMergeLog(Document):
loyalty_amount_sum += doc.loyalty_amount
for item in doc.get("items"):
found = False
for i in items:
if (
i.item_code == item.item_code
and not i.serial_and_batch_bundle
and not i.serial_no
and not i.batch_no
and i.uom == item.uom
and i.net_rate == item.net_rate
and i.warehouse == item.warehouse
):
found = True
i.qty = i.qty + item.qty
i.amount = i.amount + item.net_amount
i.net_amount = i.amount
i.base_amount = i.base_amount + item.base_net_amount
i.base_net_amount = i.base_amount
if not found:
item.rate = item.net_rate
item.amount = item.net_amount
item.base_amount = item.base_net_amount
item.price_list_rate = 0
si_item = map_child_doc(item, invoice, {"doctype": "Sales Invoice Item"})
if item.serial_and_batch_bundle:
si_item.serial_and_batch_bundle = item.serial_and_batch_bundle
items.append(si_item)
item.rate = item.net_rate
item.amount = item.net_amount
item.base_amount = item.base_net_amount
item.price_list_rate = 0
si_item = map_child_doc(item, invoice, {"doctype": "Sales Invoice Item"})
si_item.pos_invoice = doc.name
si_item.pos_invoice_item = item.name
if doc.is_return:
si_item.sales_invoice_item = get_sales_invoice_item(
doc.return_against, item.pos_invoice_item
)
if item.serial_and_batch_bundle:
si_item.serial_and_batch_bundle = item.serial_and_batch_bundle
items.append(si_item)
for tax in doc.get("taxes"):
found = False
@@ -293,22 +300,23 @@ class POSInvoiceMergeLog(Document):
invoice.disable_rounded_total = cint(
frappe.db.get_value("POS Profile", invoice.pos_profile, "disable_rounded_total")
)
accounting_dimensions = required_accounting_dimensions()
accounting_dimensions = get_checks_for_pl_and_bs_accounts()
accounting_dimensions_fields = [d.fieldname for d in accounting_dimensions]
dimension_values = frappe.db.get_value(
"POS Profile", {"name": invoice.pos_profile}, accounting_dimensions, as_dict=1
"POS Profile", {"name": invoice.pos_profile}, accounting_dimensions_fields, as_dict=1
)
for dimension in accounting_dimensions:
dimension_value = dimension_values.get(dimension)
dimension_value = dimension_values.get(dimension.fieldname)
if not dimension_value:
if not dimension_value and (dimension.mandatory_for_pl or dimension.mandatory_for_bs):
frappe.throw(
_("Please set Accounting Dimension {} in {}").format(
frappe.bold(frappe.unscrub(dimension)),
frappe.bold(dimension.label),
frappe.get_desk_link("POS Profile", invoice.pos_profile),
)
)
invoice.set(dimension, dimension_value)
invoice.set(dimension.fieldname, dimension_value)
if self.merge_invoices_based_on == "Customer Group":
invoice.flags.ignore_pos_profile = True
@@ -325,16 +333,16 @@ class POSInvoiceMergeLog(Document):
return sales_invoice
def update_pos_invoices(self, invoice_docs, sales_invoice="", credit_note=""):
def update_pos_invoices(self, invoice_docs, sales_invoice="", credit_notes=None):
for doc in invoice_docs:
doc.load_from_db()
doc.update(
{
"consolidated_invoice": None
if self.docstatus == 2
else (credit_note if doc.is_return else sales_invoice)
}
)
inv = sales_invoice
if doc.is_return:
for key, value in credit_notes.items():
if doc.name in value:
inv = key
break
doc.update({"consolidated_invoice": None if self.docstatus == 2 else inv})
doc.set_status(update=True)
doc.save()
@@ -625,3 +633,26 @@ def get_error_message(message) -> str:
return message["message"]
except Exception:
return str(message)
def get_sales_invoice_item(return_against_pos_invoice, pos_invoice_item):
try:
SalesInvoice = DocType("Sales Invoice")
SalesInvoiceItem = DocType("Sales Invoice Item")
query = (
frappe.qb.from_(SalesInvoice)
.from_(SalesInvoiceItem)
.select(SalesInvoiceItem.name)
.where(
(SalesInvoice.name == SalesInvoiceItem.parent)
& (SalesInvoice.is_return == 0)
& (SalesInvoiceItem.pos_invoice == return_against_pos_invoice)
& (SalesInvoiceItem.pos_invoice_item == pos_invoice_item)
)
)
result = query.run(as_dict=True)
return result[0].name if result else None
except Exception:
return None

View File

@@ -40,14 +40,17 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 300})
pos_inv.save()
pos_inv.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3200})
pos_inv2.save()
pos_inv2.submit()
pos_inv3 = create_pos_invoice(customer="_Test Customer 2", rate=2300, do_not_submit=1)
pos_inv3.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 2300})
pos_inv3.save()
pos_inv3.submit()
consolidate_pos_invoices()
@@ -73,14 +76,17 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 300})
pos_inv.save()
pos_inv.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3200})
pos_inv2.save()
pos_inv2.submit()
pos_inv3 = create_pos_invoice(customer="_Test Customer 2", rate=2300, do_not_submit=1)
pos_inv3.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 2300})
pos_inv3.save()
pos_inv3.submit()
pos_inv_cn = make_sales_return(pos_inv.name)
@@ -135,6 +141,7 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
)
inv.insert()
inv.payments[0].amount = inv.grand_total
inv.save()
inv.submit()
inv2 = create_pos_invoice(qty=1, rate=100, do_not_save=True)
@@ -152,6 +159,7 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
)
inv2.insert()
inv2.payments[0].amount = inv.grand_total
inv2.save()
inv2.submit()
consolidate_pos_invoices()
@@ -291,7 +299,7 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
inv2.submit()
inv3 = create_pos_invoice(qty=3, rate=600, do_not_save=True)
inv3.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000})
inv3.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1800})
inv3.insert()
inv3.submit()
@@ -299,8 +307,8 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
inv.load_from_db()
consolidated_invoice = frappe.get_doc("Sales Invoice", inv.consolidated_invoice)
self.assertEqual(consolidated_invoice.outstanding_amount, 800)
self.assertNotEqual(consolidated_invoice.status, "Paid")
self.assertNotEqual(consolidated_invoice.outstanding_amount, 800)
self.assertEqual(consolidated_invoice.status, "Paid")
finally:
frappe.set_user("Administrator")
@@ -435,6 +443,7 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
do_not_submit=1,
)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 100})
pos_inv.save()
pos_inv.submit()
pos_inv_cn = make_sales_return(pos_inv.name)
@@ -449,6 +458,7 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
do_not_submit=1,
)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 100})
pos_inv2.save()
pos_inv2.submit()
consolidate_pos_invoices()

View File

@@ -70,3 +70,6 @@ class POSOpeningEntry(StatusUpdater):
def on_submit(self):
self.set_status(update=True)
def on_cancel(self):
self.set_status(update=True)

View File

@@ -25,11 +25,13 @@
"hide_unavailable_items",
"auto_add_item_to_cart",
"validate_stock_on_save",
"print_receipt_on_order_complete",
"column_break_16",
"update_stock",
"ignore_pricing_rule",
"allow_rate_change",
"allow_discount_change",
"disable_grand_total_to_default_mop",
"section_break_23",
"item_groups",
"column_break_25",
@@ -56,7 +58,8 @@
"apply_discount_on",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break"
"dimension_col_break",
"project"
],
"fields": [
{
@@ -374,24 +377,44 @@
},
{
"fieldname": "utm_campaign",
"print_hide": 1,
"fieldtype": "Link",
"label": "Campaign",
"options": "UTM Campaign"
"options": "UTM Campaign",
"print_hide": 1
},
{
"fieldname": "utm_source",
"print_hide": 1,
"fieldtype": "Link",
"label": "Source",
"options": "UTM Source"
"options": "UTM Source",
"print_hide": 1
},
{
"fieldname": "utm_medium",
"print_hide": 1,
"fieldtype": "Link",
"label": "Medium",
"options": "UTM Campaign"
"options": "UTM Campaign",
"print_hide": 1
},
{
"default": "0",
"fieldname": "print_receipt_on_order_complete",
"fieldtype": "Check",
"label": "Print Receipt on Order Complete"
},
{
"default": "0",
"fieldname": "disable_grand_total_to_default_mop",
"fieldtype": "Check",
"label": "Disable auto setting Grand Total to default Payment Mode"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
"options": "Project"
}
],
"icon": "icon-cog",
@@ -419,7 +442,7 @@
"link_fieldname": "pos_profile"
}
],
"modified": "2024-06-28 10:51:48.543766",
"modified": "2025-04-09 11:35:13.779613",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
@@ -445,6 +468,7 @@
"role": "Accounts User"
}
],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []

View File

@@ -4,9 +4,14 @@
import frappe
from frappe import _, msgprint, scrub, unscrub
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
from frappe.model.document import Document
from frappe.utils import get_link_to_form, now
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_checks_for_pl_and_bs_accounts,
)
class POSProfile(Document):
# begin: auto-generated types
@@ -35,6 +40,7 @@ class POSProfile(Document):
currency: DF.Link
customer: DF.Link | None
customer_groups: DF.Table[POSCustomerGroup]
disable_grand_total_to_default_mop: DF.Check
disable_rounded_total: DF.Check
disabled: DF.Check
expense_account: DF.Link | None
@@ -46,6 +52,8 @@ class POSProfile(Document):
letter_head: DF.Link | None
payments: DF.Table[POSPaymentMethod]
print_format: DF.Link | None
print_receipt_on_order_complete: DF.Check
project: DF.Link | None
select_print_heading: DF.Link | None
selling_price_list: DF.Link | None
tax_category: DF.Link | None
@@ -70,15 +78,19 @@ class POSProfile(Document):
self.validate_accounting_dimensions()
def validate_accounting_dimensions(self):
acc_dim_names = required_accounting_dimensions()
for acc_dim in acc_dim_names:
if not self.get(acc_dim):
acc_dims = get_checks_for_pl_and_bs_accounts()
for acc_dim in acc_dims:
if (
self.company == acc_dim.company
and not self.get(acc_dim.fieldname)
and (acc_dim.mandatory_for_pl or acc_dim.mandatory_for_bs)
):
frappe.throw(
_(
"{0} is a mandatory Accounting Dimension. <br>"
"Please set a value for {0} in Accounting Dimensions section."
).format(
unscrub(frappe.bold(acc_dim)),
frappe.bold(acc_dim.label),
),
title=_("Mandatory Accounting Dimension"),
)
@@ -196,17 +208,41 @@ class POSProfile(Document):
def get_item_groups(pos_profile):
item_groups = []
pos_profile = frappe.get_cached_doc("POS Profile", pos_profile)
permitted_item_groups = get_permitted_nodes("Item Group")
if pos_profile.get("item_groups"):
# Get items based on the item groups defined in the POS profile
for data in pos_profile.get("item_groups"):
item_groups.extend(
["%s" % frappe.db.escape(d.name) for d in get_child_nodes("Item Group", data.item_group)]
[
"%s" % frappe.db.escape(d.name)
for d in get_child_nodes("Item Group", data.item_group)
if not permitted_item_groups or d.name in permitted_item_groups
]
)
if not item_groups and permitted_item_groups:
item_groups = ["%s" % frappe.db.escape(d) for d in permitted_item_groups]
return list(set(item_groups))
def get_permitted_nodes(group_type):
nodes = []
permitted_nodes = get_permitted_documents(group_type)
if not permitted_nodes:
return nodes
for node in permitted_nodes:
if frappe.db.get_value(group_type, node, "is_group"):
nodes.extend([d.name for d in get_child_nodes(group_type, node)])
else:
nodes.append(node)
return nodes
def get_child_nodes(group_type, root):
lft, rgt = frappe.db.get_value(group_type, root, ["lft", "rgt"])
return frappe.db.sql(
@@ -216,23 +252,6 @@ def get_child_nodes(group_type, root):
)
def required_accounting_dimensions():
p = frappe.qb.DocType("Accounting Dimension")
c = frappe.qb.DocType("Accounting Dimension Detail")
acc_dim_doc = (
frappe.qb.from_(p)
.inner_join(c)
.on(p.name == c.parent)
.select(c.parent)
.where((c.mandatory_for_bs == 1) | (c.mandatory_for_pl == 1))
.where(p.disabled == 0)
).run(as_dict=1)
acc_dim_names = [scrub(d.parent) for d in acc_dim_doc]
return acc_dim_names
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def pos_profile_query(doctype, txt, searchfield, start, page_len, filters):

View File

@@ -1,7 +1,10 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from collections import Counter
import frappe
from frappe import _
from frappe.model.document import Document
@@ -22,4 +25,14 @@ class POSSettings(Document):
# end: auto-generated types
def validate(self):
pass
self.validate_invoice_fields()
def validate_invoice_fields(self):
invoice_fields = [field.fieldname for field in self.invoice_fields]
duplicate_invoice_fields = {key for key, value in Counter(invoice_fields).items() if value > 1}
if len(duplicate_invoice_fields):
for field in duplicate_invoice_fields:
frappe.throw(
title=_("Duplicate POS Fields"), msg=_("'{0}' has been already added.").format(field)
)

View File

@@ -53,6 +53,7 @@
"column_break_42",
"free_item_uom",
"round_free_qty",
"dont_enforce_free_item_qty",
"is_recursive",
"recurse_for",
"apply_recursion_over",
@@ -643,12 +644,19 @@
"fieldname": "has_priority",
"fieldtype": "Check",
"label": "Has Priority"
},
{
"default": "0",
"depends_on": "eval:doc.price_or_product_discount == 'Product'",
"fieldname": "dont_enforce_free_item_qty",
"fieldtype": "Check",
"label": "Don't Enforce Free Item Qty"
}
],
"icon": "fa fa-gift",
"idx": 1,
"links": [],
"modified": "2024-09-16 18:14:51.314765",
"modified": "2025-02-17 18:15:39.824639",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",

View File

@@ -60,6 +60,7 @@ class PricingRule(Document):
disable: DF.Check
discount_amount: DF.Currency
discount_percentage: DF.Float
dont_enforce_free_item_qty: DF.Check
for_price_list: DF.Link | None
free_item: DF.Link | None
free_item_rate: DF.Currency
@@ -415,8 +416,6 @@ def get_pricing_rule_for_item(args, doc=None, for_validate=False):
"parent": args.parent,
"parenttype": args.parenttype,
"child_docname": args.get("child_docname"),
"discount_percentage": 0.0,
"discount_amount": 0,
}
)
@@ -455,8 +454,7 @@ def get_pricing_rule_for_item(args, doc=None, for_validate=False):
if pricing_rule.coupon_code_based == 1:
if not args.coupon_code:
return item_details
continue
coupon_code = frappe.db.get_value(
doctype="Coupon Code", filters={"pricing_rule": pricing_rule.name}, fieldname="name"
)
@@ -647,7 +645,7 @@ def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None, ra
if pricing_rule.margin_type in ["Percentage", "Amount"]:
item_details.margin_rate_or_amount = 0.0
item_details.margin_type = None
elif pricing_rule.get("free_item"):
elif pricing_rule.get("free_item") and not pricing_rule.get("dont_enforce_free_item_qty"):
item_details.remove_free_item = (
item_code if pricing_rule.get("same_item") else pricing_rule.get("free_item")
)

View File

@@ -438,6 +438,54 @@ class TestPricingRule(IntegrationTestCase):
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item 2")
def test_dont_enforce_free_item_qty(self):
# this test is only for testing non-enforcement as all other tests in this file already test with enforcement
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule")
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
"apply_on": "Item Code",
"currency": "USD",
"items": [
{
"item_code": "_Test Item",
}
],
"selling": 1,
"rate_or_discount": "Discount Percentage",
"rate": 0,
"min_qty": 0,
"max_qty": 7,
"discount_percentage": 17.5,
"price_or_product_discount": "Product",
"same_item": 0,
"free_item": "_Test Item 2",
"free_qty": 1,
"company": "_Test Company",
}
pricing_rule = frappe.get_doc(test_record.copy()).insert()
# With enforcement
so = make_sales_order(item_code="_Test Item", qty=1, do_not_submit=True)
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item 2")
# Test 1 : Saving a document with an item with pricing list without it's corresponding free item will cause it the free item to be refetched on save
so.items.pop(1)
so.save()
so.reload()
self.assertEqual(len(so.items), 2)
# Without enforcement
pricing_rule.dont_enforce_free_item_qty = 1
pricing_rule.save()
# Test 2 : Deleted free item will not be fetched again on save without enforcement
so.items.pop(1)
so.save()
so.reload()
self.assertEqual(len(so.items), 1)
def test_cumulative_pricing_rule(self):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Cumulative Pricing Rule")
test_record = {
@@ -1461,6 +1509,7 @@ def make_pricing_rule(**args):
"discount_amount": args.discount_amount or 0.0,
"apply_multiple_pricing_rules": args.apply_multiple_pricing_rules or 0,
"has_priority": args.has_priority or 0,
"enforce_free_item_qty": args.dont_enforce_free_item_qty or 0,
}
)

View File

@@ -713,7 +713,10 @@ def apply_pricing_rule_for_free_items(doc, pricing_rule_args):
args.pop((item.item_code, item.pricing_rules))
for free_item in args.values():
doc.append("items", free_item)
if doc.is_new() or not frappe.get_value(
"Pricing Rule", free_item["pricing_rules"], "dont_enforce_free_item_qty"
):
doc.append("items", free_item)
def get_pricing_rule_items(pr_doc, other_items=False) -> list:

View File

@@ -1,7 +1,6 @@
{
"actions": [],
"autoname": "format:ACC-PPR-{#####}",
"beta": 1,
"creation": "2023-03-30 21:28:39.793927",
"default_view": "List",
"doctype": "DocType",
@@ -158,7 +157,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-08-27 14:48:56.715320",
"modified": "2025-01-08 08:22:14.798085",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Payment Reconciliation",
@@ -192,4 +191,4 @@
"sort_order": "DESC",
"states": [],
"title_field": "company"
}
}

View File

@@ -210,9 +210,9 @@ def trigger_reconciliation_for_queued_docs():
docs_to_trigger = []
unique_filters = set()
queue_size = 5
queue_size = frappe.db.get_single_value("Accounts Settings", "reconciliation_queue_size") or 5
fields = ["company", "party_type", "party", "receivable_payable_account"]
fields = ["company", "party_type", "party", "receivable_payable_account", "default_advance_account"]
def get_filters_as_tuple(fields, doc):
filters = ()

View File

@@ -1,7 +1,6 @@
{
"actions": [],
"autoname": "format:PPR-LOG-{##}",
"beta": 1,
"creation": "2023-03-13 15:00:09.149681",
"default_view": "List",
"doctype": "DocType",
@@ -110,7 +109,7 @@
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-03-27 13:10:18.769659",
"modified": "2025-01-08 08:22:19.104975",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Payment Reconciliation Log",

View File

@@ -20,6 +20,7 @@
"is_advance",
"section_break_5",
"difference_amount",
"gain_loss_posting_date",
"column_break_7",
"difference_account",
"exchange_rate",
@@ -153,11 +154,16 @@
"fieldtype": "Check",
"in_list_view": 1,
"label": "Reconciled"
},
{
"fieldname": "gain_loss_posting_date",
"fieldtype": "Date",
"label": "Difference Posting Date"
}
],
"istable": 1,
"links": [],
"modified": "2024-03-27 13:10:18.933928",
"modified": "2025-01-23 16:09:01.058574",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Payment Reconciliation Log Allocations",

View File

@@ -20,6 +20,7 @@ class ProcessPaymentReconciliationLogAllocations(Document):
difference_account: DF.Link | None
difference_amount: DF.Currency
exchange_rate: DF.Float
gain_loss_posting_date: DF.Date | None
invoice_number: DF.DynamicLink
invoice_type: DF.Link
is_advance: DF.Data | None

View File

@@ -236,17 +236,21 @@ def get_ar_filters(doc, entry):
def get_html(doc, filters, entry, col, res, ageing):
base_template_path = "frappe/www/printview.html"
template_path = (
"erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html"
if doc.report == "General Ledger"
else "erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html"
)
template_path = "erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html"
if doc.report == "General Ledger":
template_path = (
"erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html"
)
process_soa_html = frappe.get_hooks("process_soa_html")
# fetching custom print format for Process Statement of Accounts
if process_soa_html and process_soa_html.get(doc.report):
template_path = process_soa_html[doc.report][-1]
if doc.letter_head:
from frappe.www.printview import get_letter_head
letter_head = get_letter_head(doc, 0)
html = frappe.render_template(
template_path,
{
@@ -262,7 +266,6 @@ def get_html(doc, filters, entry, col, res, ageing):
else None,
},
)
html = frappe.render_template(
base_template_path,
{"body": html, "css": get_print_style(), "title": "Statement For " + entry.customer},
@@ -321,9 +324,12 @@ def get_recipients_and_cc(customer, doc):
recipients = []
for clist in doc.customers:
if clist.customer == customer:
recipients.append(clist.billing_email)
if clist.billing_email:
for email in clist.billing_email.split(","):
recipients.append(email.strip())
if doc.primary_mandatory and clist.primary_email:
recipients.append(clist.primary_email)
for email in clist.primary_email.split(","):
recipients.append(email.strip())
cc = []
if doc.cc_to != "":
try:

View File

@@ -68,6 +68,14 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
if (this.frm.doc.supplier && this.frm.doc.__islocal) {
this.frm.trigger("supplier");
}
this.frm.set_query("supplier", function () {
return {
filters: {
is_transporter: 0,
},
};
});
}
refresh(doc) {
@@ -336,6 +344,8 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
if (this.frm.doc.__onload && this.frm.doc.__onload.load_after_mapping) return;
let payment_terms_template = this.frm.doc.payment_terms_template;
erpnext.utils.get_party_details(
this.frm,
"erpnext.accounts.party.get_party_details",
@@ -356,6 +366,12 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
me.frm.doc.tax_withholding_category = me.frm.supplier_tds;
me.frm.set_df_property("apply_tds", "read_only", me.frm.supplier_tds ? 0 : 1);
me.frm.set_df_property("tax_withholding_category", "hidden", me.frm.supplier_tds ? 0 : 1);
// while duplicating, don't change payment terms
if (me.frm.doc.__run_link_triggers === false) {
me.frm.set_value("payment_terms_template", payment_terms_template);
me.frm.refresh_field("payment_terms_template");
}
}
);
}
@@ -372,6 +388,18 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
}
}
tax_withholding_category(frm) {
var me = this;
let filtered_taxes = (me.frm.doc.taxes || []).filter((row) => !row.is_tax_withholding_account);
me.frm.clear_table("taxes");
filtered_taxes.forEach((row) => {
me.frm.add_child("taxes", row);
});
me.frm.refresh_field("taxes");
}
credit_to() {
var me = this;
if (this.frm.doc.credit_to) {

View File

@@ -1625,7 +1625,7 @@
{
"default": "1",
"depends_on": "eval: doc.is_return && doc.return_against",
"description": "Debit Note will update it's own outstanding amount, even if \"Return Against\" is specified.",
"description": "Debit Note will update it's own outstanding amount, even if 'Return Against' is specified.",
"fieldname": "update_outstanding_for_self",
"fieldtype": "Check",
"label": "Update Outstanding for Self"
@@ -1641,7 +1641,7 @@
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2024-10-25 18:13:01.944477",
"modified": "2025-01-14 11:39:04.564610",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -10,7 +10,6 @@ from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate,
import erpnext
from erpnext.accounts.deferred_revenue import validate_service_stop_date
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
validate_docs_for_deferred_accounting,
validate_docs_for_voucher_types,
@@ -33,7 +32,7 @@ from erpnext.accounts.general_ledger import (
merge_similar_entries,
)
from erpnext.accounts.party import get_due_date, get_party_account
from erpnext.accounts.utils import get_account_currency, get_fiscal_year
from erpnext.accounts.utils import get_account_currency, get_fiscal_year, update_voucher_outstanding
from erpnext.assets.doctype.asset.asset import is_cwip_accounting_enabled
from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account
from erpnext.buying.utils import check_on_hold_or_closed_status
@@ -840,12 +839,12 @@ class PurchaseInvoice(BuyingController):
def update_supplier_outstanding(self, update_outstanding):
if update_outstanding == "No":
update_outstanding_amt(
self.credit_to,
"Supplier",
self.supplier,
self.doctype,
self.return_against if cint(self.is_return) and self.return_against else self.name,
update_voucher_outstanding(
voucher_type=self.doctype,
voucher_no=self.return_against if cint(self.is_return) and self.return_against else self.name,
account=self.credit_to,
party_type="Supplier",
party=self.supplier,
)
def get_gl_entries(self, warehouse_account=None):
@@ -874,6 +873,7 @@ class PurchaseInvoice(BuyingController):
self.make_payment_gl_entries(gl_entries)
self.make_write_off_gl_entry(gl_entries)
self.make_gle_for_rounding_adjustment(gl_entries)
self.set_transaction_currency_and_rate_in_gl_map(gl_entries)
return gl_entries
def check_asset_cwip_enabled(self):
@@ -919,6 +919,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": base_grand_total
if self.party_account_currency == self.company_currency
else grand_total,
"credit_in_transaction_currency": grand_total,
"against_voucher": against_voucher,
"against_voucher_type": self.doctype,
"project": self.project,
@@ -954,7 +955,7 @@ class PurchaseInvoice(BuyingController):
valuation_tax_accounts = [
d.account_head
for d in self.get("taxes")
if d.category in ("Valuation", "Total and Valuation")
if d.category in ("Valuation", "Valuation and Total")
and flt(d.base_tax_amount_after_discount_amount)
]
@@ -970,7 +971,6 @@ class PurchaseInvoice(BuyingController):
for item in self.get("items"):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.expense_account)
if item.item_code:
frappe.get_cached_value("Item", item.item_code, "asset_category")
@@ -979,6 +979,7 @@ class PurchaseInvoice(BuyingController):
and self.auto_accounting_for_stock
and (item.item_code in stock_items or item.is_fixed_asset)
):
account_currency = get_account_currency(item.expense_account)
# warehouse account
warehouse_debit_amount = self.make_stock_adjustment_entry(
gl_entries, item, voucher_wise_stock_value, account_currency
@@ -994,6 +995,7 @@ class PurchaseInvoice(BuyingController):
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": warehouse_debit_amount,
"debit_in_transaction_currency": item.net_amount,
},
warehouse_account[item.warehouse]["account_currency"],
item=item,
@@ -1014,6 +1016,7 @@ class PurchaseInvoice(BuyingController):
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": -1 * flt(credit_amount, item.precision("base_net_amount")),
"debit_in_transaction_currency": item.net_amount,
},
warehouse_account[item.from_warehouse]["account_currency"],
item=item,
@@ -1028,6 +1031,7 @@ class PurchaseInvoice(BuyingController):
"account": item.expense_account,
"against": self.supplier,
"debit": flt(item.base_net_amount, item.precision("base_net_amount")),
"debit_in_transaction_currency": item.net_amount,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"cost_center": item.cost_center,
"project": item.project,
@@ -1045,6 +1049,10 @@ class PurchaseInvoice(BuyingController):
"account": item.expense_account,
"against": self.supplier,
"debit": warehouse_debit_amount,
"debit_in_transaction_currency": flt(
warehouse_debit_amount / self.conversion_rate,
item.precision("net_amount"),
),
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"cost_center": item.cost_center,
"project": item.project or self.project,
@@ -1057,7 +1065,9 @@ class PurchaseInvoice(BuyingController):
# Amount added through landed-cost-voucher
if landed_cost_entries:
if (item.item_code, item.name) in landed_cost_entries:
for account, amount in landed_cost_entries[(item.item_code, item.name)].items():
for account, base_amount in landed_cost_entries[
(item.item_code, item.name)
].items():
gl_entries.append(
self.get_gl_dict(
{
@@ -1065,8 +1075,9 @@ class PurchaseInvoice(BuyingController):
"against": item.expense_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(amount["base_amount"]),
"credit_in_account_currency": flt(amount["amount"]),
"credit": flt(base_amount["base_amount"]),
"credit_in_account_currency": flt(base_amount["amount"]),
"credit_in_transaction_currency": item.net_amount,
"project": item.project or self.project,
},
item=item,
@@ -1089,6 +1100,7 @@ class PurchaseInvoice(BuyingController):
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(item.rm_supp_cost),
"credit_in_transaction_currency": item.net_amount,
},
warehouse_account[self.supplier_warehouse]["account_currency"],
item=item,
@@ -1102,7 +1114,8 @@ class PurchaseInvoice(BuyingController):
else item.deferred_expense_account
)
dummy, amount = self.get_amount_and_base_amount(item, None)
account_currency = get_account_currency(expense_account)
amount, base_amount = self.get_amount_and_base_amount(item, None)
if provisional_accounting_for_non_stock_items:
self.make_provisional_gl_entry(gl_entries, item)
@@ -1113,7 +1126,8 @@ class PurchaseInvoice(BuyingController):
{
"account": expense_account,
"against": self.supplier,
"debit": amount,
"debit": base_amount,
"debit_in_transaction_currency": amount,
"cost_center": item.cost_center,
"project": item.project or self.project,
},
@@ -1128,6 +1142,7 @@ class PurchaseInvoice(BuyingController):
exchange_rate_map[item.purchase_receipt]
and self.conversion_rate != exchange_rate_map[item.purchase_receipt]
and item.net_rate == net_rate_map[item.pr_detail]
and item.item_code in stock_items
):
discrepancy_caused_by_exchange_rate_difference = (
item.qty * item.net_rate
@@ -1186,6 +1201,10 @@ class PurchaseInvoice(BuyingController):
"account": self.stock_received_but_not_billed,
"against": self.supplier,
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
"debit_in_transaction_currency": flt(
item.item_tax_amount / self.conversion_rate,
item.precision("item_tax_amount"),
),
"remarks": self.remarks or _("Accounting Entry for Stock"),
"cost_center": self.cost_center,
"project": item.project or self.project,
@@ -1305,6 +1324,7 @@ class PurchaseInvoice(BuyingController):
"account": cost_of_goods_sold_account,
"against": item.expense_account,
"debit": stock_adjustment_amt,
"debit_in_transaction_currency": stock_adjustment_amt / self.conversion_rate,
"remarks": self.get("remarks") or _("Stock Adjustment"),
"cost_center": item.cost_center,
"project": item.project or self.project,
@@ -1316,6 +1336,38 @@ class PurchaseInvoice(BuyingController):
warehouse_debit_amount = stock_amount
elif self.is_return and self.update_stock and self.is_internal_supplier and warehouse_debit_amount:
net_rate = item.base_net_amount
if item.sales_incoming_rate: # for internal transfer
net_rate = item.qty * item.sales_incoming_rate
stock_amount = (
net_rate
+ item.item_tax_amount
+ flt(item.landed_cost_voucher_amount)
+ flt(item.get("amount_difference_with_purchase_invoice"))
)
if flt(stock_amount, net_amt_precision) != flt(warehouse_debit_amount, net_amt_precision):
cost_of_goods_sold_account = self.get_company_default("default_expense_account")
stock_adjustment_amt = stock_amount - warehouse_debit_amount
gl_entries.append(
self.get_gl_dict(
{
"account": cost_of_goods_sold_account,
"against": item.expense_account,
"debit": stock_adjustment_amt,
"debit_in_transaction_currency": stock_adjustment_amt / self.conversion_rate,
"remarks": self.get("remarks") or _("Stock Adjustment"),
"cost_center": item.cost_center,
"project": item.project or self.project,
},
account_currency,
item=item,
)
)
return warehouse_debit_amount
def make_tax_gl_entries(self, gl_entries):
@@ -1338,6 +1390,7 @@ class PurchaseInvoice(BuyingController):
dr_or_cr + "_in_account_currency": base_amount
if account_currency == self.company_currency
else amount,
dr_or_cr + "_in_transaction_currency": amount,
"cost_center": tax.cost_center,
},
account_currency,
@@ -1384,6 +1437,10 @@ class PurchaseInvoice(BuyingController):
"cost_center": tax.cost_center,
"against": self.supplier,
"credit": applicable_amount,
"credit_in_transaction_currency": flt(
applicable_amount / self.conversion_rate,
frappe.get_precision("Purchase Invoice Item", "item_tax_amount"),
),
"remarks": self.remarks or _("Accounting Entry for Stock"),
},
item=tax,
@@ -1402,6 +1459,10 @@ class PurchaseInvoice(BuyingController):
"cost_center": tax.cost_center,
"against": self.supplier,
"credit": valuation_tax[tax.name],
"credit_in_transaction_currency": flt(
valuation_tax[tax.name] / self.conversion_rate,
frappe.get_precision("Purchase Invoice Item", "item_tax_amount"),
),
"remarks": self.remarks or _("Accounting Entry for Stock"),
},
item=tax,
@@ -1417,6 +1478,7 @@ class PurchaseInvoice(BuyingController):
"account": self.unrealized_profit_loss_account,
"against": self.supplier,
"credit": flt(self.total_taxes_and_charges),
"credit_in_transaction_currency": flt(self.total_taxes_and_charges),
"credit_in_account_currency": flt(self.base_total_taxes_and_charges),
"cost_center": self.cost_center,
},
@@ -1466,6 +1528,7 @@ class PurchaseInvoice(BuyingController):
"debit_in_account_currency": self.base_paid_amount
if self.party_account_currency == self.company_currency
else self.paid_amount,
"debit_in_transaction_currency": self.paid_amount,
"against_voucher": self.return_against
if cint(self.is_return) and self.return_against
else self.name,
@@ -1487,6 +1550,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": self.base_paid_amount
if bank_account_currency == self.company_currency
else self.paid_amount,
"credit_in_transaction_currency": self.paid_amount,
"cost_center": self.cost_center,
},
bank_account_currency,
@@ -1511,6 +1575,7 @@ class PurchaseInvoice(BuyingController):
"debit_in_account_currency": self.base_write_off_amount
if self.party_account_currency == self.company_currency
else self.write_off_amount,
"debit_in_transaction_currency": self.write_off_amount,
"against_voucher": self.return_against
if cint(self.is_return) and self.return_against
else self.name,
@@ -1531,6 +1596,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": self.base_write_off_amount
if write_off_account_currency == self.company_currency
else self.write_off_amount,
"credit_in_transaction_currency": self.write_off_amount,
"cost_center": self.cost_center or self.write_off_cost_center,
},
item=self,
@@ -1802,13 +1868,13 @@ class PurchaseInvoice(BuyingController):
self.remove(d)
## Add pending vouchers on which tax was withheld
for voucher_no, voucher_details in voucher_wise_amount.items():
for row in voucher_wise_amount:
self.append(
"tax_withheld_vouchers",
{
"voucher_name": voucher_no,
"voucher_type": voucher_details.get("voucher_type"),
"taxable_amount": voucher_details.get("amount"),
"voucher_name": row.voucher_name,
"voucher_type": row.voucher_type,
"taxable_amount": row.taxable_amount,
},
)

View File

@@ -45,12 +45,16 @@ frappe.listview_settings["Purchase Invoice"] = {
},
onload: function (listview) {
listview.page.add_action_item(__("Purchase Receipt"), () => {
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Purchase Receipt");
});
if (frappe.model.can_create("Purchase Receipt")) {
listview.page.add_action_item(__("Purchase Receipt"), () => {
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Purchase Receipt");
});
}
listview.page.add_action_item(__("Payment"), () => {
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment Entry");
});
if (frappe.model.can_create("Payment Entry")) {
listview.page.add_action_item(__("Payment"), () => {
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment Entry");
});
}
},
};

View File

@@ -383,6 +383,53 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
self.assertEqual(discrepancy_caused_by_exchange_rate_diff, amount)
def test_purchase_invoice_with_exchange_rate_difference_for_non_stock_item(self):
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import (
make_purchase_invoice as create_purchase_invoice,
)
# Creating Purchase Invoice with USD currency
pr = frappe.new_doc("Purchase Receipt")
pr.currency = "USD"
pr.company = "_Test Company with perpetual inventory"
pr.conversion_rate = (70,)
pr.supplier = "_Test Supplier USD"
pr.append(
"items",
{
"item_code": "_Test Non Stock Item",
"qty": 1,
"rate": 100,
},
)
pr.append(
"items",
{"item_code": "_Test Item", "qty": 1, "rate": 5, "warehouse": "Stores - TCP1"},
)
pr.insert()
pr.submit()
# Createing purchase invoice against Purchase Receipt
pi = create_purchase_invoice(pr.name)
pi.conversion_rate = 80
pi.credit_to = "_Test Payable USD - TCP1"
pi.insert()
pi.submit()
# Get exchnage gain and loss account
exchange_gain_loss_account = frappe.db.get_value("Company", pi.company, "exchange_gain_loss_account")
# fetching the latest GL Entry with exchange gain and loss account account
amount = frappe.db.get_value(
"GL Entry", {"account": exchange_gain_loss_account, "voucher_no": pi.name}, "debit"
)
discrepancy_caused_by_exchange_rate_diff = abs(
pi.items[1].base_net_amount - pr.items[1].base_net_amount
)
self.assertEqual(discrepancy_caused_by_exchange_rate_diff, amount)
def test_purchase_invoice_change_naming_series(self):
pi = frappe.copy_doc(self.globalTestRecords["Purchase Invoice"][1])
pi.insert()
@@ -2054,7 +2101,7 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
1,
)
pi = make_pi_from_pr(pr.name)
self.assertEqual(pi.payment_schedule[0].payment_amount, 2500)
self.assertEqual(pi.payment_schedule[0].payment_amount, 1000)
automatically_fetch_payment_terms(enable=0)
frappe.db.set_value(
@@ -2434,6 +2481,76 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 1)
def test_adjust_incoming_rate_from_pi_with_multi_currency_and_partial_billing(self):
frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 0)
frappe.db.set_single_value("Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", 1)
pr = make_purchase_receipt(
qty=10, rate=10, currency="USD", do_not_save=1, supplier="_Test Supplier USD"
)
pr.conversion_rate = 5300
pr.save()
pr.submit()
incoming_rate = frappe.db.get_value(
"Stock Ledger Entry",
{"voucher_type": "Purchase Receipt", "voucher_no": pr.name},
"incoming_rate",
)
self.assertEqual(incoming_rate, 53000) # Asserting to confirm if the default calculation is correct
pi = create_purchase_invoice_from_receipt(pr.name)
for row in pi.items:
row.qty = 1
pi.save()
pi.submit()
incoming_rate = frappe.db.get_value(
"Stock Ledger Entry",
{"voucher_type": "Purchase Receipt", "voucher_no": pr.name},
"incoming_rate",
)
# Test 1 : Incoming rate should not change as only the qty has changed and not the rate (this was not the case before)
self.assertEqual(incoming_rate, 53000)
pi = create_purchase_invoice_from_receipt(pr.name)
for row in pi.items:
row.qty = 1
row.rate = 9
pi.save()
pi.submit()
incoming_rate = frappe.db.get_value(
"Stock Ledger Entry",
{"voucher_type": "Purchase Receipt", "voucher_no": pr.name},
"incoming_rate",
)
# Test 2 : Rate in new PI is lower than PR, so incoming rate should also be lower
self.assertEqual(incoming_rate, 50350)
pi = create_purchase_invoice_from_receipt(pr.name)
for row in pi.items:
row.qty = 1
row.rate = 12
pi.save()
pi.submit()
incoming_rate = frappe.db.get_value(
"Stock Ledger Entry",
{"voucher_type": "Purchase Receipt", "voucher_no": pr.name},
"incoming_rate",
)
# Test 3 : Rate in new PI is higher than PR, so incoming rate should also be higher
self.assertEqual(incoming_rate, 54766.667)
frappe.db.set_single_value("Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", 0)
frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 1)
def test_opening_invoice_rounding_adjustment_validation(self):
pi = make_purchase_invoice(do_not_save=1)
pi.items[0].rate = 99.98
@@ -2539,6 +2656,122 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
"Buying Settings", "bill_for_rejected_quantity_in_purchase_invoice", original_value
)
def test_trx_currency_debit_credit_for_high_precision(self):
exc_rate = 0.737517516
pi = make_purchase_invoice(
currency="USD", conversion_rate=exc_rate, qty=1, rate=2000, do_not_save=True
)
pi.supplier = "_Test Supplier USD"
pi.save().submit()
expected = (
("_Test Account Cost for Goods Sold - _TC", 1475.04, 0.0, 2000.0, 0.0, "USD", exc_rate),
("_Test Payable USD - _TC", 0.0, 1475.04, 0.0, 2000.0, "USD", exc_rate),
)
actual = frappe.db.get_all(
"GL Entry",
filters={"voucher_no": pi.name},
fields=[
"account",
"debit",
"credit",
"debit_in_transaction_currency",
"credit_in_transaction_currency",
"transaction_currency",
"transaction_exchange_rate",
],
order_by="account",
as_list=1,
)
self.assertEqual(actual, expected)
def test_prevents_fully_returned_invoice_with_zero_quantity(self):
from erpnext.controllers.sales_and_purchase_return import StockOverReturnError, make_return_doc
invoice = make_purchase_invoice(qty=10)
return_doc = make_return_doc(invoice.doctype, invoice.name)
return_doc.items[0].qty = -10
return_doc.save().submit()
return_doc = make_return_doc(invoice.doctype, invoice.name)
return_doc.items[0].qty = 0
self.assertRaises(StockOverReturnError, return_doc.save)
def test_apply_discount_on_grand_total(self):
"""
To test if after applying discount on grand total,
the grand total is calculated correctly without any rounding errors
"""
invoice = make_purchase_invoice(qty=2, rate=100, do_not_save=True, do_not_submit=True)
invoice.append(
"items",
{
"item_code": "_Test Item",
"qty": 1,
"rate": 21.39,
},
)
invoice.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"rate": 15.5,
},
)
# the grand total here will be 255.71
invoice.disable_rounded_total = 1
# apply discount on grand total to adjust the grand total to 255
invoice.discount_amount = 0.71
invoice.save()
# check if grand total is 496 and not something like 254.99 due to rounding errors
self.assertEqual(invoice.grand_total, 255)
def test_apply_discount_on_grand_total_with_previous_row_total_tax(self):
"""
To test if after applying discount on grand total,
where the tax is calculated on previous row total, the grand total is calculated correctly
"""
invoice = make_purchase_invoice(qty=2, rate=100, do_not_save=True, do_not_submit=True)
invoice.extend(
"taxes",
[
{
"charge_type": "Actual",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"tax_amount": 100,
},
{
"charge_type": "On Previous Row Amount",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"row_id": 1,
"rate": 10,
},
{
"charge_type": "On Previous Row Total",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"row_id": 1,
"rate": 10,
},
],
)
# the total here will be 340, so applying 40 discount
invoice.discount_amount = 40
invoice.save()
self.assertEqual(invoice.grand_total, 300)
def set_advance_flag(company, flag, default_account):
frappe.db.set_value(

View File

@@ -0,0 +1,209 @@
[
{
"bill_no": "NA",
"buying_price_list": "_Test Price List",
"company": "_Test Company",
"conversion_rate": 1,
"credit_to": "_Test Payable - _TC",
"currency": "INR",
"doctype": "Purchase Invoice",
"items": [
{
"amount": 500,
"base_amount": 500,
"base_rate": 50,
"conversion_factor": 1.0,
"cost_center": "_Test Cost Center - _TC",
"doctype": "Purchase Invoice Item",
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"item_code": "_Test Item Home Desktop 100",
"item_name": "_Test Item Home Desktop 100",
"item_tax_template": "_Test Account Excise Duty @ 10 - _TC",
"parentfield": "items",
"qty": 10,
"rate": 50,
"uom": "_Test UOM",
"warehouse": "_Test Warehouse - _TC"
},
{
"amount": 750,
"base_amount": 750,
"base_rate": 150,
"conversion_factor": 1.0,
"cost_center": "_Test Cost Center - _TC",
"doctype": "Purchase Invoice Item",
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"item_code": "_Test Item Home Desktop 200",
"item_name": "_Test Item Home Desktop 200",
"parentfield": "items",
"qty": 5,
"rate": 150,
"uom": "_Test UOM",
"warehouse": "_Test Warehouse - _TC"
}
],
"grand_total": 0,
"naming_series": "T-PINV-",
"taxes": [
{
"account_head": "_Test Account Shipping Charges - _TC",
"add_deduct_tax": "Add",
"category": "Valuation and Total",
"charge_type": "Actual",
"cost_center": "_Test Cost Center - _TC",
"description": "Shipping Charges",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"tax_amount": 100
},
{
"account_head": "_Test Account Customs Duty - _TC",
"add_deduct_tax": "Add",
"category": "Valuation",
"charge_type": "On Net Total",
"cost_center": "_Test Cost Center - _TC",
"description": "Customs Duty",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"rate": 10
},
{
"account_head": "_Test Account Excise Duty - _TC",
"add_deduct_tax": "Add",
"category": "Total",
"charge_type": "On Net Total",
"cost_center": "_Test Cost Center - _TC",
"description": "Excise Duty",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"rate": 12
},
{
"account_head": "_Test Account Education Cess - _TC",
"add_deduct_tax": "Add",
"category": "Total",
"charge_type": "On Previous Row Amount",
"cost_center": "_Test Cost Center - _TC",
"description": "Education Cess",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"rate": 2,
"row_id": 3
},
{
"account_head": "_Test Account S&H Education Cess - _TC",
"add_deduct_tax": "Add",
"category": "Total",
"charge_type": "On Previous Row Amount",
"cost_center": "_Test Cost Center - _TC",
"description": "S&H Education Cess",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"rate": 1,
"row_id": 3
},
{
"account_head": "_Test Account CST - _TC",
"add_deduct_tax": "Add",
"category": "Total",
"charge_type": "On Previous Row Total",
"cost_center": "_Test Cost Center - _TC",
"description": "CST",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"rate": 2,
"row_id": 5
},
{
"account_head": "_Test Account VAT - _TC",
"add_deduct_tax": "Add",
"category": "Total",
"charge_type": "On Net Total",
"cost_center": "_Test Cost Center - _TC",
"description": "VAT",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"rate": 12.5
},
{
"account_head": "_Test Account Discount - _TC",
"add_deduct_tax": "Deduct",
"category": "Total",
"charge_type": "On Previous Row Total",
"cost_center": "_Test Cost Center - _TC",
"description": "Discount",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"rate": 10,
"row_id": 7
}
],
"supplier": "_Test Supplier",
"supplier_name": "_Test Supplier"
},
{
"bill_no": "NA",
"buying_price_list": "_Test Price List",
"company": "_Test Company",
"conversion_rate": 1.0,
"credit_to": "_Test Payable - _TC",
"currency": "INR",
"doctype": "Purchase Invoice",
"items": [
{
"conversion_factor": 1.0,
"cost_center": "_Test Cost Center - _TC",
"doctype": "Purchase Invoice Item",
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"item_code": "_Test Item",
"item_name": "_Test Item",
"parentfield": "items",
"qty": 10.0,
"rate": 50.0,
"uom": "_Test UOM"
}
],
"grand_total": 0,
"naming_series": "T-PINV-",
"taxes": [
{
"account_head": "_Test Account Shipping Charges - _TC",
"add_deduct_tax": "Add",
"category": "Valuation and Total",
"charge_type": "Actual",
"cost_center": "_Test Cost Center - _TC",
"description": "Shipping Charges",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"tax_amount": 100.0
},
{
"account_head": "_Test Account VAT - _TC",
"add_deduct_tax": "Add",
"category": "Total",
"charge_type": "Actual",
"cost_center": "_Test Cost Center - _TC",
"description": "VAT",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"tax_amount": 120.0
},
{
"account_head": "_Test Account Customs Duty - _TC",
"add_deduct_tax": "Add",
"category": "Valuation",
"charge_type": "Actual",
"cost_center": "_Test Cost Center - _TC",
"description": "Customs Duty",
"doctype": "Purchase Taxes and Charges",
"parentfield": "taxes",
"tax_amount": 150.0
}
],
"supplier": "_Test Supplier",
"supplier_name": "_Test Supplier"
}
]

View File

@@ -1,194 +0,0 @@
[["Purchase Invoice"]]
bill_no = "NA"
buying_price_list = "_Test Price List"
company = "_Test Company"
conversion_rate = 1
credit_to = "_Test Payable - _TC"
currency = "INR"
grand_total = 0
naming_series = "T-PINV-"
supplier = "_Test Supplier"
supplier_name = "_Test Supplier"
[["Purchase Invoice".items]]
amount = 500
base_amount = 500
base_rate = 50
conversion_factor = 1.0
cost_center = "_Test Cost Center - _TC"
doctype = "Purchase Invoice Item"
expense_account = "_Test Account Cost for Goods Sold - _TC"
item_code = "_Test Item Home Desktop 100"
item_name = "_Test Item Home Desktop 100"
item_tax_template = "_Test Account Excise Duty @ 10 - _TC"
parentfield = "items"
qty = 10
rate = 50
uom = "_Test UOM"
warehouse = "_Test Warehouse - _TC"
[["Purchase Invoice".items]]
amount = 750
base_amount = 750
base_rate = 150
conversion_factor = 1.0
cost_center = "_Test Cost Center - _TC"
doctype = "Purchase Invoice Item"
expense_account = "_Test Account Cost for Goods Sold - _TC"
item_code = "_Test Item Home Desktop 200"
item_name = "_Test Item Home Desktop 200"
parentfield = "items"
qty = 5
rate = 150
uom = "_Test UOM"
warehouse = "_Test Warehouse - _TC"
[["Purchase Invoice".taxes]]
account_head = "_Test Account Shipping Charges - _TC"
add_deduct_tax = "Add"
category = "Valuation and Total"
charge_type = "Actual"
cost_center = "_Test Cost Center - _TC"
description = "Shipping Charges"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
tax_amount = 100
[["Purchase Invoice".taxes]]
account_head = "_Test Account Customs Duty - _TC"
add_deduct_tax = "Add"
category = "Valuation"
charge_type = "On Net Total"
cost_center = "_Test Cost Center - _TC"
description = "Customs Duty"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
rate = 10
[["Purchase Invoice".taxes]]
account_head = "_Test Account Excise Duty - _TC"
add_deduct_tax = "Add"
category = "Total"
charge_type = "On Net Total"
cost_center = "_Test Cost Center - _TC"
description = "Excise Duty"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
rate = 12
[["Purchase Invoice".taxes]]
account_head = "_Test Account Education Cess - _TC"
add_deduct_tax = "Add"
category = "Total"
charge_type = "On Previous Row Amount"
cost_center = "_Test Cost Center - _TC"
description = "Education Cess"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
rate = 2
row_id = 3
[["Purchase Invoice".taxes]]
account_head = "_Test Account S&H Education Cess - _TC"
add_deduct_tax = "Add"
category = "Total"
charge_type = "On Previous Row Amount"
cost_center = "_Test Cost Center - _TC"
description = "S&H Education Cess"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
rate = 1
row_id = 3
[["Purchase Invoice".taxes]]
account_head = "_Test Account CST - _TC"
add_deduct_tax = "Add"
category = "Total"
charge_type = "On Previous Row Total"
cost_center = "_Test Cost Center - _TC"
description = "CST"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
rate = 2
row_id = 5
[["Purchase Invoice".taxes]]
account_head = "_Test Account VAT - _TC"
add_deduct_tax = "Add"
category = "Total"
charge_type = "On Net Total"
cost_center = "_Test Cost Center - _TC"
description = "VAT"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
rate = 12.5
[["Purchase Invoice".taxes]]
account_head = "_Test Account Discount - _TC"
add_deduct_tax = "Deduct"
category = "Total"
charge_type = "On Previous Row Total"
cost_center = "_Test Cost Center - _TC"
description = "Discount"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
rate = 10
row_id = 7
[["Purchase Invoice"]]
bill_no = "NA"
buying_price_list = "_Test Price List"
company = "_Test Company"
conversion_rate = 1.0
credit_to = "_Test Payable - _TC"
currency = "INR"
grand_total = 0
naming_series = "T-PINV-"
supplier = "_Test Supplier"
supplier_name = "_Test Supplier"
[["Purchase Invoice".items]]
conversion_factor = 1.0
cost_center = "_Test Cost Center - _TC"
doctype = "Purchase Invoice Item"
expense_account = "_Test Account Cost for Goods Sold - _TC"
item_code = "_Test Item"
item_name = "_Test Item"
parentfield = "items"
qty = 10.0
rate = 50.0
uom = "_Test UOM"
[["Purchase Invoice".taxes]]
account_head = "_Test Account Shipping Charges - _TC"
add_deduct_tax = "Add"
category = "Valuation and Total"
charge_type = "Actual"
cost_center = "_Test Cost Center - _TC"
description = "Shipping Charges"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
tax_amount = 100.0
[["Purchase Invoice".taxes]]
account_head = "_Test Account VAT - _TC"
add_deduct_tax = "Add"
category = "Total"
charge_type = "Actual"
cost_center = "_Test Cost Center - _TC"
description = "VAT"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
tax_amount = 120.0
[["Purchase Invoice".taxes]]
account_head = "_Test Account Customs Duty - _TC"
add_deduct_tax = "Add"
category = "Valuation"
charge_type = "Actual"
cost_center = "_Test Cost Center - _TC"
description = "Customs Duty"
doctype = "Purchase Taxes and Charges"
parentfield = "taxes"
tax_amount = 150.0

View File

@@ -462,7 +462,8 @@
"depends_on": "eval:!doc.is_fixed_asset && doc.use_serial_batch_fields === 1 && parent.update_stock === 1",
"fieldname": "serial_no",
"fieldtype": "Text",
"label": "Serial No"
"label": "Serial No",
"no_copy": 1
},
{
"depends_on": "eval:!doc.is_fixed_asset && doc.use_serial_batch_fields === 1 && parent.update_stock === 1",
@@ -979,16 +980,18 @@
"options": "currency"
}
],
"grid_page_length": 50,
"idx": 1,
"istable": 1,
"links": [],
"modified": "2024-10-28 15:06:19.246141",
"modified": "2025-03-07 10:21:59.960021",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []

View File

@@ -199,7 +199,7 @@
"fieldname": "item_wise_tax_detail",
"fieldtype": "Code",
"hidden": 1,
"label": "Item Wise Tax Detail ",
"label": "Item Wise Tax Detail",
"oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text",
"print_hide": 1,
@@ -267,18 +267,20 @@
"report_hide": 1
}
],
"grid_page_length": 50,
"idx": 1,
"istable": 1,
"links": [],
"modified": "2024-11-22 19:17:02.377473",
"modified": "2025-04-15 13:14:48.936047",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -8,6 +8,8 @@ from frappe import _, qb
from frappe.model.document import Document
from frappe.utils.data import comma_and
from erpnext.stock import get_warehouse_account_map
class RepostAccountingLedger(Document):
# begin: auto-generated types
@@ -97,6 +99,9 @@ class RepostAccountingLedger(Document):
doc = frappe.get_doc(x.voucher_type, x.voucher_no)
if doc.doctype in ["Payment Entry", "Journal Entry"]:
gle_map = doc.build_gl_map()
elif doc.doctype == "Purchase Receipt":
warehouse_account_map = get_warehouse_account_map(doc.company)
gle_map = doc.get_gl_entries(warehouse_account_map)
else:
gle_map = doc.get_gl_entries()
@@ -177,6 +182,14 @@ def start_repost(account_repost_doc=str) -> None:
doc.force_set_against_expense_account()
doc.make_gl_entries()
elif doc.doctype == "Purchase Receipt":
if not repost_doc.delete_cancelled_entries:
doc.docstatus = 2
doc.make_gl_entries_on_cancel()
doc.docstatus = 1
doc.make_gl_entries(from_repost=True)
elif doc.doctype in ["Payment Entry", "Journal Entry", "Expense Claim"]:
if not repost_doc.delete_cancelled_entries:
doc.make_gl_entries(1)

View File

@@ -12,6 +12,8 @@ from erpnext.accounts.doctype.payment_request.payment_request import make_paymen
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.accounts.utils import get_fiscal_year
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries, make_purchase_receipt
class TestRepostAccountingLedger(AccountsTestMixin, IntegrationTestCase):
@@ -209,9 +211,81 @@ class TestRepostAccountingLedger(AccountsTestMixin, IntegrationTestCase):
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": si.name, "is_cancelled": 1}))
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": pe.name, "is_cancelled": 1}))
def test_06_repost_purchase_receipt(self):
from erpnext.accounts.doctype.account.test_account import create_account
provisional_account = create_account(
account_name="Provision Account",
parent_account="Current Liabilities - _TC",
company=self.company,
)
another_provisional_account = create_account(
account_name="Another Provision Account",
parent_account="Current Liabilities - _TC",
company=self.company,
)
company = frappe.get_doc("Company", self.company)
company.enable_provisional_accounting_for_non_stock_items = 1
company.default_provisional_account = provisional_account
company.save()
test_cc = company.cost_center
default_expense_account = company.default_expense_account
item = make_item(properties={"is_stock_item": 0})
pr = make_purchase_receipt(company=self.company, item_code=item.name, rate=1000.0, qty=1.0)
pr_gl_entries = get_gl_entries(pr.doctype, pr.name, skip_cancelled=True)
expected_pr_gles = [
{"account": provisional_account, "debit": 0.0, "credit": 1000.0, "cost_center": test_cc},
{"account": default_expense_account, "debit": 1000.0, "credit": 0.0, "cost_center": test_cc},
]
self.assertEqual(expected_pr_gles, pr_gl_entries)
# change the provisional account
frappe.db.set_value(
"Purchase Receipt Item",
pr.items[0].name,
"provisional_expense_account",
another_provisional_account,
)
repost_doc = frappe.new_doc("Repost Accounting Ledger")
repost_doc.company = self.company
repost_doc.delete_cancelled_entries = True
repost_doc.append("vouchers", {"voucher_type": pr.doctype, "voucher_no": pr.name})
repost_doc.save().submit()
pr_gles_after_repost = get_gl_entries(pr.doctype, pr.name, skip_cancelled=True)
expected_pr_gles_after_repost = [
{"account": default_expense_account, "debit": 1000.0, "credit": 0.0, "cost_center": test_cc},
{"account": another_provisional_account, "debit": 0.0, "credit": 1000.0, "cost_center": test_cc},
]
self.assertEqual(len(pr_gles_after_repost), len(expected_pr_gles_after_repost))
self.assertEqual(expected_pr_gles_after_repost, pr_gles_after_repost)
# teardown
repost_doc.cancel()
repost_doc.delete()
pr.reload()
pr.cancel()
company.enable_provisional_accounting_for_non_stock_items = 0
company.default_provisional_account = None
company.save()
def update_repost_settings():
allowed_types = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]
allowed_types = [
"Sales Invoice",
"Purchase Invoice",
"Payment Entry",
"Journal Entry",
"Purchase Receipt",
]
repost_settings = frappe.get_doc("Repost Accounting Ledger Settings")
for x in allowed_types:
repost_settings.append("allowed_types", {"document_type": x, "allowed": True})

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