Compare commits

...

825 Commits

Author SHA1 Message Date
Frappe PR Bot
df743aec29 chore(release): Bumped to Version 14.8.0
# [14.8.0](https://github.com/frappe/erpnext/compare/v14.7.0...v14.8.0) (2022-11-22)

### Bug Fixes

* Accounting Dimension filtering for Sales and Purchase Report ([b782209](b78220957b))
* add missing commas and brackets ([ecd4eab](ecd4eab2da))
* always send account currency in response ([f2fde83](f2fde8327d))
* Bulk payment generation against invoices ([57b00e3](57b00e3b16))
* cast POS query inputs to integers  (backport [#32975](https://github.com/frappe/erpnext/issues/32975)) ([#32977](https://github.com/frappe/erpnext/issues/32977)) ([55e1592](55e1592b70))
* don't set `rejected-qty` in return SCR ([4de02dc](4de02dc258))
* Don't show payment button for invoices on hold ([7487acd](7487acdeb6))
* hide reject-fields in return SCR ([71d6f2a](71d6f2a490))
* incorrect currency in Exchange rate revaluation ([a26470a](a26470a65f))
* Internal Transfer Material Request cycle and tracking fixed till purchase receipt ([eaf0950](eaf09503a9))
* link to brand doctype. ([b428307](b428307e9f))
* linters failing ([24aafb3](24aafb3866))
* make `is_internal_supplier` read-only ([caef140](caef140a9b))
* minor change ([ac3120b](ac3120b6f9))
* minor issue fixed ([c356d2c](c356d2cabd))
* naming ([a198a55](a198a55d2d))
* Opening journal entry templates ([6aada76](6aada76297))
* **pos:** item selector image border radius ([aaed4ab](aaed4ab958))
* precision in asset tests ([444f241](444f241263))
* **realtime:** Restrict updates to only last modified or current user ([#33034](https://github.com/frappe/erpnext/issues/33034)) ([9e8a835](9e8a8356e9))
* Remove unnecessary filters from Journal Entry ([387665d](387665d221))
* test case added for MR internal Transfer ([2a892f5](2a892f5c52))
* test case updated for mr ([6ddf273](6ddf27380f))
* Timesheet timer button ([53cf6b8](53cf6b8c89))
* update advace paid in SO/PO in account currency ([14235f2](14235f24b2))
* use `list()` on self mutating iteration ([eb968d7](eb968d7f02))
* Viewing account ledger from party master ([da2dfcc](da2dfcc10b))

### Features

* Workstation Type for BOM ([8323775](8323775282))
2022-11-22 16:00:31 +00:00
Deepesh Garg
9bb079d238 Merge pull request #33076 from frappe/version-14-hotfix
chore: release v14
2022-11-22 21:28:58 +05:30
Deepesh Garg
084d81025c Merge pull request #33078 from frappe/mergify/bp/version-14-hotfix/pr-33072
chore: Rearrange supplier invoice section in Purchase Invoice (backport #33072)
2022-11-22 20:41:10 +05:30
Deepesh Garg
995ad90b5a Merge pull request #33079 from frappe/mergify/bp/version-14-hotfix/pr-33068
fix: Don't show payment button for invoices on hold (backport #33068)
2022-11-22 20:40:53 +05:30
Deepesh Garg
f71f907b31 Merge pull request #33080 from frappe/mergify/bp/version-14-hotfix/pr-33069
fix: Remove unnecessary filters from Journal Entry (backport #33069)
2022-11-22 20:40:34 +05:30
Deepesh Garg
387665d221 fix: Remove unnecessary filters from Journal Entry
(cherry picked from commit cd88a53533)
2022-11-22 14:46:02 +00:00
Deepesh Garg
7487acdeb6 fix: Don't show payment button for invoices on hold
(cherry picked from commit 1b9e83251f)
2022-11-22 14:45:39 +00:00
Deepesh Garg
54317b56ea chore: Rearrange supplier invoice section in Purchase Invoice
(cherry picked from commit e96be712b8)
2022-11-22 14:45:05 +00:00
ruthra kumar
a2012cb710 Merge pull request #33073 from frappe/mergify/bp/version-14-hotfix/pr-33071
fix: advance paid updated in account currency for SO/PO (backport #33071)
2022-11-22 14:27:06 +05:30
ruthra kumar
48a3b3f6f3 test: fix test case for SO/PO advance amount
(cherry picked from commit 541cf153f7)
2022-11-22 08:15:57 +00:00
ruthra kumar
14235f24b2 fix: update advace paid in SO/PO in account currency
(cherry picked from commit bf76b85dfd)
2022-11-22 08:15:56 +00:00
Deepesh Garg
622c5837cf Merge pull request #33056 from frappe/mergify/bp/version-14-hotfix/pr-33051
fix: Timesheet timer button (backport #33051)
2022-11-21 14:04:47 +05:30
Deepesh Garg
db0b4d5966 Merge pull request #33055 from frappe/mergify/bp/version-14-hotfix/pr-33052
fix: Viewing account ledger from party master (backport #33052)
2022-11-21 12:49:28 +05:30
Deepesh Garg
53cf6b8c89 fix: Timesheet timer button
(cherry picked from commit 64802d1220)
2022-11-21 05:45:35 +00:00
Deepesh Garg
da2dfcc10b fix: Viewing account ledger from party master
(cherry picked from commit 15e74c5d7b)
2022-11-21 05:45:08 +00:00
Deepesh Garg
8215469b5e Merge pull request #33044 from frappe/mergify/bp/version-14-hotfix/pr-32958
fix: link `Item Price` brand to `Brand` doctype. (backport #32958)
2022-11-20 18:52:26 +05:30
Devin Slauenwhite
a198a55d2d fix: naming
(cherry picked from commit 3a35651441)
2022-11-19 13:45:19 +00:00
Devin Slauenwhite
b428307e9f fix: link to brand doctype.
(cherry picked from commit cee069d426)
2022-11-19 13:45:19 +00:00
Deepesh Garg
5456fec4d5 Merge pull request #33042 from frappe/mergify/bp/version-14-hotfix/pr-33032
fix: Accounting Dimension filtering for Sales and Purchase Report (backport #33032)
2022-11-19 18:52:45 +05:30
Deepesh Garg
3ee3f8e38e Merge pull request #33043 from frappe/mergify/bp/version-14-hotfix/pr-32999
fix: incorrect currency in Exchange rate revaluation (backport #32999)
2022-11-19 18:52:27 +05:30
Deepesh Garg
7bad53104b Merge pull request #33001 from frappe/mergify/bp/version-14-hotfix/pr-32994
chore(patch): remove reload_doc from post model sync update_exchange_rate_settings patch (backport #32994)
2022-11-19 18:46:27 +05:30
ruthra kumar
f2fde8327d fix: always send account currency in response
(cherry picked from commit 5caaccc94b)
2022-11-19 13:00:42 +00:00
ruthra kumar
a26470a65f fix: incorrect currency in Exchange rate revaluation
(cherry picked from commit 68b04e2577)
2022-11-19 13:00:42 +00:00
Deepesh Garg
44dbdba6a0 Merge pull request #33035 from frappe/mergify/bp/version-14-hotfix/pr-33034
fix(realtime): Restrict updates to only last modified or current user (backport #33034)
2022-11-19 18:22:07 +05:30
Deepesh Garg
b78220957b fix: Accounting Dimension filtering for Sales and Purchase Report
(cherry picked from commit 8b394afaa9)
2022-11-19 12:50:39 +00:00
gavin
9e8a8356e9 fix(realtime): Restrict updates to only last modified or current user (#33034)
(cherry picked from commit dd2493a541)
2022-11-18 11:48:47 +00:00
Deepesh Garg
f2283546b5 Merge pull request #33031 from frappe/mergify/bp/version-14-hotfix/pr-33014
fix: Bulk payment generation against invoices (backport #33014)
2022-11-18 16:51:54 +05:30
Faris Ansari
b1215f8ccf Merge pull request #33030 from frappe/mergify/bp/version-14-hotfix/pr-32986 2022-11-18 16:32:45 +05:30
Sagar Sharma
b403c7fdca Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32986 2022-11-18 16:11:51 +05:30
Sagar Sharma
59c35d9f88 Merge pull request #33029 from frappe/mergify/bp/version-14-hotfix/pr-32905
fix: Internal Transfer Material Request cycle and tracking fixed till purchase receipt (backport #32905)
2022-11-18 15:12:28 +05:30
Deepesh Garg
57b00e3b16 fix: Bulk payment generation against invoices
(cherry picked from commit 2dfe849c7d)
2022-11-18 09:41:01 +00:00
Deepesh Garg
a30747b723 Merge pull request #33017 from frappe/mergify/bp/version-14-hotfix/pr-33009
fix(pos): item selector image border radius (backport #33009)
2022-11-18 15:09:47 +05:30
Deepesh Garg
6d22305b9f Merge pull request #33018 from frappe/mergify/bp/version-14-hotfix/pr-33003
fix: precision in asset tests (backport #33003)
2022-11-18 15:09:04 +05:30
s-aga-r
71d6f2a490 fix: hide reject-fields in return SCR
(cherry picked from commit 7dd7617ec7)
2022-11-18 09:31:11 +00:00
s-aga-r
4de02dc258 fix: don't set rejected-qty in return SCR
(cherry picked from commit 8a73e963ce)
2022-11-18 09:31:11 +00:00
s-aga-r
0c73280a9b chore: linters
(cherry picked from commit 12d7b7e9c2)
2022-11-18 07:46:49 +00:00
Vishal
660e3fa081 chore: minor fix
(cherry picked from commit e5dfd53e6f)
2022-11-18 07:46:49 +00:00
Vishal
ac3120b6f9 fix: minor change
(cherry picked from commit ba6189d054)
2022-11-18 07:46:49 +00:00
Vishal
6ddf27380f fix: test case updated for mr
(cherry picked from commit 343b414b40)
2022-11-18 07:46:48 +00:00
Vishal
2a892f5c52 fix: test case added for MR internal Transfer
(cherry picked from commit 89aabdaaaa)
2022-11-18 07:46:48 +00:00
Vishal
c356d2cabd fix: minor issue fixed
(cherry picked from commit d86afddb60)
2022-11-18 07:46:48 +00:00
Vishal
eaf09503a9 fix: Internal Transfer Material Request cycle and tracking fixed till purchase receipt
(cherry picked from commit 71412f6877)
2022-11-18 07:46:47 +00:00
Anand Baburajan
d0ccc858ad Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33003 2022-11-18 12:05:22 +05:30
Sagar Sharma
f10d6105c5 Merge pull request #33023 from frappe/mergify/bp/version-14-hotfix/pr-33019
fix: use `list()` on self mutating iteration (backport #33019)
2022-11-18 10:59:58 +05:30
Sabu Siyad
eb968d7f02 fix: use list() on self mutating iteration
https://github.com/frappe/erpnext/issues/30325

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 546c809cbe)
2022-11-18 04:55:43 +00:00
anandbaburajan
ecd4eab2da fix: add missing commas and brackets
(cherry picked from commit 218da1217a)
2022-11-17 12:22:41 +00:00
anandbaburajan
444f241263 fix: precision in asset tests
(cherry picked from commit b5e5d3b3af)
2022-11-17 12:22:41 +00:00
Sabu Siyad
aaed4ab958 fix(pos): item selector image border radius
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 2f4940cc26)
2022-11-17 12:03:22 +00:00
Ankush Menat
00558af873 chore: typo 2022-11-17 14:24:59 +05:30
Sagar Sharma
0378bb9702 Merge pull request #33010 from frappe/mergify/bp/version-14-hotfix/pr-33006
fix: make `is_internal_supplier` read-only in PO (backport #33006)
2022-11-17 14:23:17 +05:30
s-aga-r
caef140a9b fix: make is_internal_supplier read-only
(cherry picked from commit 5efbc2cbf8)
2022-11-17 08:40:41 +00:00
mergify[bot]
4c0b5ceb9e refactor: search queries (backport #33004) (#33007)
refactor: search queries (#33004)

- guard clauses for readability
- use values or format

(cherry picked from commit 34e4903ed7)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-17 13:06:46 +05:30
Ankush Menat
1db83247ce chore: hardcode doctype 2022-11-17 12:01:11 +05:30
Ritwik Puri
9a737afb77 chore(patch): remove reload_doc from post model sync update_exchange_rate_settings patch (#32994)
[skip ci]

(cherry picked from commit b03b568e6c)
2022-11-17 06:30:33 +00:00
Deepesh Garg
4a86b20e62 Merge pull request #32996 from frappe/mergify/bp/version-14-hotfix/pr-32983
fix: Opening journal entry templates (backport #32983)
2022-11-17 11:16:34 +05:30
Sagar Sharma
f70a028970 Merge pull request #32997 from frappe/mergify/bp/version-14-hotfix/pr-32911
feat: Workstation Type for BOM (backport #32911)
2022-11-17 10:59:45 +05:30
Rohit Waghchaure
24aafb3866 fix: linters failing
(cherry picked from commit ffa30127e7)
2022-11-16 18:31:29 +00:00
Rohit Waghchaure
bb337455b9 test: test case to check workstation type
(cherry picked from commit 7bd06e6fbc)
2022-11-16 18:31:28 +00:00
Rohit Waghchaure
8323775282 feat: Workstation Type for BOM
(cherry picked from commit 105c272816)
2022-11-16 18:31:25 +00:00
Deepesh Garg
6aada76297 fix: Opening journal entry templates
(cherry picked from commit 33b61aef5a)
2022-11-16 15:13:08 +00:00
Deepesh Garg
2d8332e004 Merge pull request #32990 from frappe/mergify/bp/version-14-hotfix/pr-32989
ci: fix flake8 URL (backport #32989)
2022-11-16 17:05:11 +05:30
Deepesh Garg
b473da8f66 ci: fix flake8 URL
(cherry picked from commit e81bec5fc9)
2022-11-16 10:56:22 +00:00
mergify[bot]
55e1592b70 fix: cast POS query inputs to integers (backport #32975) (#32977)
fix: cast POS query inputs to integers  (#32975)

fix: cast POS query inputs to integers
(cherry picked from commit c013db6ea1)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-15 18:50:51 +05:30
Frappe PR Bot
964abce057 chore(release): Bumped to Version 14.7.0
# [14.7.0](https://github.com/frappe/erpnext/compare/v14.6.0...v14.7.0) (2022-11-15)

### Bug Fixes

* add translate function to valitate company msg in chart of accounts importer ([8de4430](8de4430662))
* check type for reference name ([a305793](a30579393e))
* don't set WIP Warehouse if  is checked in WO ([f923183](f923183b64))
* GP incorrect buying amount if no upd on SI and Delivery Note ([2d8f00a](2d8f00afad))
* incorrect fix of conversion factor in PP ([c48d00a](c48d00ad77))
* Label for applicable dimension table ([eb4f8e4](eb4f8e4bd8))
* Maintain same rate between Quotation and Sales Order ([6c155d2](6c155d2825))
* Project filter in timesheet ([37bed12](37bed12df4))
* Purchase Receipt timeout error ([0d5b726](0d5b7269d4))
* repayment schedule regeneration ([2f5033b](2f5033b70f))
* set `WIP Warehouse` in Job Card ([c294652](c294652dab))
* set stock UOM in args to ensure item price is fetched ([a4187b9](a4187b9d8f))
* test cases ([071ee5d](071ee5d81c))
* **ux:** Tab break in Customer and Supplier form ([eeaa932](eeaa9329f6))
* Write Off section visibility for non POS Invoices ([07badbc](07badbc0f2))

### Features

* Repost Payment Ledger entries for vouchers ([de59b50](de59b50407))

### Reverts

* Revert "fix: get `consumed_qty` based on `received_qty` in SCR" ([7fd6c43](7fd6c43752))
* Revert "fix: set `received_qty` before_validate SCR" ([0ecb44d](0ecb44d40c))
2022-11-15 12:59:04 +00:00
Deepesh Garg
c310c8a4b0 Merge pull request #32972 from frappe/version-14-hotfix
chore: release v14
2022-11-15 18:17:10 +05:30
Deepesh Garg
d7340f54cf Merge pull request #32969 from frappe/mergify/bp/version-14-hotfix/pr-32953
chore(payment_entry): Remove dead validations (backport #32953)
2022-11-15 16:32:54 +05:30
Deepesh Garg
19f3d86a12 Merge pull request #32966 from frappe/mergify/bp/version-14-hotfix/pr-32962
fix: Write Off section visibility for non POS Invoices (backport #32962)
2022-11-15 16:31:49 +05:30
Sagar Sharma
48dbf47e76 Merge pull request #32974 from frappe/mergify/bp/version-14-hotfix/pr-32971
Revert "fix: get `consumed_qty` based on `received_qty` in SCR" (backport #32971)
2022-11-15 15:59:45 +05:30
s-aga-r
f10cceb261 test: fix test cases for supplied-items consumed_qty
(cherry picked from commit 369db4eacc)
2022-11-15 09:48:02 +00:00
s-aga-r
7fd6c43752 Revert "fix: get consumed_qty based on received_qty in SCR"
This reverts commit 70c9b8dc50.

(cherry picked from commit 01f56c621c)
2022-11-15 09:48:02 +00:00
s-aga-r
0ecb44d40c Revert "fix: set received_qty before_validate SCR"
This reverts commit c447dfaa9c.

(cherry picked from commit 3706a9b4dc)
2022-11-15 09:48:02 +00:00
Gavin D'souza
30d1491257 chore(payment_entry): Remove dead validations
(cherry picked from commit e1ecc9a819)
2022-11-15 08:34:35 +00:00
Deepesh Garg
ca96c24c8d chore: Resolve conflicts 2022-11-15 13:57:44 +05:30
Deepesh Garg
07badbc0f2 fix: Write Off section visibility for non POS Invoices
(cherry picked from commit 9f5d613c78)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json
2022-11-15 07:31:58 +00:00
Deepesh Garg
51b3fda2b6 Merge pull request #32960 from frappe/mergify/bp/version-14-hotfix/pr-32956
fix: Label for applicable dimension table (backport #32956)
2022-11-15 13:01:23 +05:30
rohitwaghchaure
d9820af4f0 Merge pull request #32963 from frappe/mergify/bp/version-14-hotfix/pr-32947
fix: incorrect fix of conversion factor in PP (backport #32947)
2022-11-15 11:38:07 +05:30
Rohit Waghchaure
c48d00ad77 fix: incorrect fix of conversion factor in PP
(cherry picked from commit 490b0e3cdf)
2022-11-15 05:01:36 +00:00
Deepesh Garg
eb4f8e4bd8 fix: Label for applicable dimension table
(cherry picked from commit 8c13f70fc5)
2022-11-15 03:55:20 +00:00
Sagar Sharma
5c5cd7bff5 Merge pull request #32948 from frappe/mergify/bp/version-14-hotfix/pr-32937
refactor: rewrite `job_card.py` queries in QB (backport #32937)
2022-11-14 12:22:56 +05:30
s-aga-r
f886577abb refactor: rewrite job_card.py queries in QB
(cherry picked from commit 7df2921d38)
2022-11-14 05:56:38 +00:00
Deepesh Garg
bad4dccf88 Merge pull request #32944 from frappe/mergify/bp/version-14-hotfix/pr-32938
chore: Remove raw SQL query (backport #32938)
2022-11-14 10:43:50 +05:30
Sagar Vora
a30579393e fix: check type for reference name
(cherry picked from commit b06345af46)
2022-11-13 15:12:10 +00:00
Deepesh Garg
3614584a2f chore: Remove qb doc reference
(cherry picked from commit 4b9921782b)
2022-11-13 15:12:10 +00:00
Deepesh Garg
8a01da3b9e chore: Remove raw SQL query
(cherry picked from commit 42a59d5c17)
2022-11-13 15:12:10 +00:00
Deepesh Garg
94087e4e3a Merge pull request #32941 from frappe/mergify/bp/version-14-hotfix/pr-32866
fix: incorrect buying amount on Gross Profit (backport #32866)
2022-11-13 19:47:57 +05:30
ruthra kumar
a24f6a5ac7 test: buying amount of invoices
1. Invoice with unset `update_stock`, with and without Delivery Notes

(cherry picked from commit 2c8b0b17a7)
2022-11-13 13:46:08 +00:00
ruthra kumar
2d8f00afad fix: GP incorrect buying amount if no upd on SI and Delivery Note
(cherry picked from commit e4d16c31da)
2022-11-13 13:46:08 +00:00
Sagar Sharma
9e47371801 Merge pull request #32935 from frappe/mergify/bp/version-14-hotfix/pr-32913
fix: set stock UOM in args to ensure item price is fetched (backport #32913)
2022-11-12 12:04:26 +05:30
Sagar Vora
a4187b9d8f fix: set stock UOM in args to ensure item price is fetched
(cherry picked from commit 57038c3969)
2022-11-12 04:39:25 +00:00
Deepesh Garg
3dde050c15 Merge pull request #32932 from frappe/mergify/bp/version-14-hotfix/pr-32878
fix: repayment schedule regeneration (backport #32878)
2022-11-11 15:15:52 +05:30
Abhinav Raut
2f5033b70f fix: repayment schedule regeneration
(cherry picked from commit d6ab2b3b87)
2022-11-11 08:53:59 +00:00
Deepesh Garg
de68674933 Merge pull request #32927 from frappe/mergify/bp/version-14-hotfix/pr-32880
fix: add translate function to valitate company msg in chart of accounts importer (backport #32880)
2022-11-11 14:21:53 +05:30
Deepesh Garg
04cf3d1c5d Merge pull request #32926 from frappe/mergify/bp/version-14-hotfix/pr-32923
fix: Maintain same rate between Quotation and Sales Order (backport #32923)
2022-11-11 14:21:38 +05:30
rohitwaghchaure
eac1f47b6f Merge pull request #32928 from frappe/mergify/bp/version-14-hotfix/pr-32895
fix: Purchase Receipt timeout error (backport #32895)
2022-11-11 10:52:52 +05:30
Rohit Waghchaure
071ee5d81c fix: test cases
(cherry picked from commit 7278387879)
2022-11-10 17:13:36 +00:00
Rohit Waghchaure
0d5b7269d4 fix: Purchase Receipt timeout error
(cherry picked from commit 4082149f0e)
2022-11-10 17:13:35 +00:00
Ernesto Ruiz
8de4430662 fix: add translate function to valitate company msg in chart of accounts importer
(cherry picked from commit 637c08d189)
2022-11-10 14:38:22 +00:00
Deepesh Garg
6c155d2825 fix: Maintain same rate between Quotation and Sales Order
(cherry picked from commit 362ec7b673)
2022-11-10 14:23:54 +00:00
Deepesh Garg
6f61685510 Merge pull request #32924 from frappe/mergify/bp/version-14-hotfix/pr-32912
fix(ux): Tab break in Customer and Supplier form (backport #32912)
2022-11-10 19:51:27 +05:30
Sagar Sharma
883355adc4 Merge pull request #32919 from frappe/mergify/bp/version-14-hotfix/pr-32918
fix: WO Skip Material Transfer to WIP Warehouse (backport #32918)
2022-11-10 18:42:36 +05:30
Nabin Hait
eeaa9329f6 fix(ux): Tab break in Customer and Supplier form
(cherry picked from commit fb7ee301b5)
2022-11-10 13:01:14 +00:00
Sagar Sharma
c294652dab fix: set WIP Warehouse in Job Card
(cherry picked from commit e7fa2e08ad)
2022-11-10 11:42:53 +00:00
Sagar Sharma
f923183b64 fix: don't set WIP Warehouse if is checked in WO
(cherry picked from commit 9730cd0aec)
2022-11-10 11:42:53 +00:00
Deepesh Garg
f2a1596369 Merge pull request #32909 from frappe/mergify/bp/version-14-hotfix/pr-32742
feat: Tool to repost PLE manually (backport #32742)
2022-11-10 15:41:22 +05:30
ruthra kumar
7a3e3af0b5 chore: CI fix 2022-11-10 14:17:00 +05:30
mergify[bot]
f8b7cfa6dd refactor: Remove usage of deprecated methods (backport #32914) (#32915)
* refactor: Remove usage of deprecated methods (#32914)

Warn: Just used regex to replace all usage.
```regex
s/frappe.db.set(\(.*\),\(.*\),\(.*\))/\1.db_set(\2, \3)/g
```

Required after: https://github.com/frappe/frappe/pull/18815

(cherry picked from commit 7e1742956c)

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

* chore: conflicts

* style: black


Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-10 11:09:13 +05:30
ruthra kumar
de59b50407 feat: Repost Payment Ledger entries for vouchers
primarily intended to manually correct PLE entries for vouchers
affected by Item Value repost-https://github.com/frappe/erpnext/pull/32567

(cherry picked from commit 0448c0fa36)
2022-11-09 08:57:23 +00:00
ruthra kumar
a399e2d765 refactor: split delete gl utility function into two
(cherry picked from commit 9209ec59c2)
2022-11-09 08:57:23 +00:00
Deepesh Garg
17ccc0e56c Merge pull request #32891 from frappe/mergify/bp/version-14-hotfix/pr-32883
fix: Project filter in timesheet (backport #32883)
2022-11-08 21:44:59 +05:30
Sagar Sharma
5e6a9833c5 Merge pull request #32898 from frappe/mergify/bp/version-14-hotfix/pr-32888
chore: link SCR Return in SCR Dashboard (backport #32888)
2022-11-08 21:38:27 +05:30
Sagar Sharma
02bb523210 chore: link SCR Return in SCR Dashboard
(cherry picked from commit 47248251e2)
2022-11-08 16:07:34 +00:00
Frappe PR Bot
e917212849 chore(release): Bumped to Version 14.6.0
# [14.6.0](https://github.com/frappe/erpnext/compare/v14.5.1...v14.6.0) (2022-11-08)

### Bug Fixes

* `Material Consumption` option in case of `Skip Transfer to WIP` in WO ([8c856cd](8c856cd5fc))
* add translate function to name of chart labels in budget_variance_report.py ([16f364d](16f364da37))
* add translate function to name of chart labels in deferred_revenue_and_expense.py ([b8caa58](b8caa587d2))
* add translate function to period in  stock_analytics.py ([b0c06d5](b0c06d5a04))
* add translate function to period in sales_analytics.py ([e681f06](e681f06883))
* add translate function to string on budget_variance_report.js to match the variance  word translated ([595aaad](595aaad99d))
* Auto advance allocation against partial invoices ([b7763d9](b7763d953a))
* auto increment qty if item table has no items ([d8e403b](d8e403bf5d))
* conflicts ([ab87a95](ab87a950e5))
* correct linters ([8f6f9a4](8f6f9a429a))
* correct linters ([440e208](440e20859f))
* correct linters ([5acc9be](5acc9be5c9))
* Create POS Opening Entry POS Profile filter. ([60af9c0](60af9c0516))
* Disable tax included prices for internal transfers ([#32794](https://github.com/frappe/erpnext/issues/32794)) ([6838e5e](6838e5ea3b))
* for asset's purchase_date, if bill_date is set, use that instead of posting_date ([01a1c96](01a1c96314))
* get `consumed_qty` based on `received_qty` in SCR ([ea9a502](ea9a50278d))
* Increase columns width in Warehouse wise Item Balance Age and Value ([0b09c31](0b09c31cb0))
* linter ([af60c8f](af60c8f759))
* make `BOM` required in SCR Item ([3f79a05](3f79a057e4))
* make `consumed_qty` editable when backflush based on Material Transfer ([2c5a8c4](2c5a8c43f6))
* make `consumed_qty` read-only in SCR Supplied Items ([68229f0](68229f06d1))
* map `BOM` while mapping the return SCR ([e629cba](e629cba2b7))
* mysql syntax issue ([4d9bbd4](4d9bbd4c9c))
* not able to select customer / supplier ([6989cdf](6989cdf4f2))
* refactor code for better translatable string ([2dc24f2](2dc24f22ea))
* refactor code for better translatable string in stock_ageing.py ([0ead516](0ead51642f))
* rename test method ([97445d9](97445d9516))
* Scan Barcode UX ([1944f4d](1944f4df4d))
* set `received_qty` before_validate SCR ([e316558](e316558286))
* test cases ([0feec4c](0feec4ca8a))
* trailing whitespace ([31bada9](31bada9205))
* update advance paid in SO/PO from Payment Ledger ([a561432](a561432908))
* use `flt` instead of `cint` in `get_batch_no` ([6510464](6510464482))

### Features

* Item Wise TDS Calculation ([b9fb104](b9fb1045d7))

### Performance Improvements

* use `get_cached_value` instead of `db.get_value` in controllers ([#32776](https://github.com/frappe/erpnext/issues/32776)) ([34ca17a](34ca17ab11))
2022-11-08 12:15:30 +00:00
Deepesh Garg
4657f8e9ed Merge pull request #32893 from frappe/version-14-hotfix
chore: release v14
2022-11-08 17:43:43 +05:30
Deepesh Garg
19b3152e32 chore: Resolve conflicts 2022-11-08 17:42:29 +05:30
Deepesh Garg
6163a052c8 chore: Linting Issues
(cherry picked from commit 7b5cf6978e)

# Conflicts:
#	erpnext/manufacturing/doctype/workstation/workstation.py
2022-11-08 09:26:03 +00:00
Deepesh Garg
37bed12df4 fix: Project filter in timesheet
(cherry picked from commit 2b65b22aa2)
2022-11-08 09:26:02 +00:00
Sagar Sharma
1426de0530 Merge pull request #32887 from frappe/mergify/bp/version-14-hotfix/pr-32886
chore: remove `debugger` from `stock_entry_list.js` (backport #32886)
2022-11-08 12:14:22 +05:30
Sagar Sharma
beef0510ee chore: remove debugger from stock_entry_list.js
(cherry picked from commit 84ab100d86)
2022-11-08 06:40:55 +00:00
Sagar Sharma
bacd7ecb1d Merge pull request #32884 from frappe/mergify/bp/version-14-hotfix/pr-32877
fix: make `consumed_qty` read-only in SCR Supplied Items (backport #32877)
2022-11-08 09:51:16 +05:30
Sagar Sharma
af60c8f759 fix: linter
(cherry picked from commit 5e8a22be24)
2022-11-07 23:05:58 +05:30
Sagar Sharma
2c5a8c43f6 fix: make consumed_qty editable when backflush based on Material Transfer
(cherry picked from commit bf4b012cec)
2022-11-07 17:29:45 +00:00
Sagar Sharma
68229f06d1 fix: make consumed_qty read-only in SCR Supplied Items
(cherry picked from commit f8d2e276a5)
2022-11-07 17:29:45 +00:00
Deepesh Garg
cc92e6965a Merge pull request #32864 from frappe/mergify/bp/version-14-hotfix/pr-32846
fix: add german translations (backport #32846)
2022-11-07 18:43:06 +05:30
Raffael Meyer
85f98bb51a Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32846 2022-11-07 13:34:28 +01:00
barredterra
8e00e62616 chore: resolve merge conflicts 2022-11-07 13:31:54 +01:00
Deepesh Garg
401979bbe5 Merge pull request #32875 from frappe/mergify/bp/version-14-hotfix/pr-32874
fix: Increase columns width in Warehouse wise Item Balance Age and Value (backport #32874)
2022-11-07 15:41:05 +05:30
Nihantra C. Patel
0b09c31cb0 fix: Increase columns width in Warehouse wise Item Balance Age and Value
(cherry picked from commit 8355c1092c)
2022-11-07 08:05:38 +00:00
Deepesh Garg
c2da8cf7cd Merge pull request #32870 from frappe/mergify/bp/version-14-hotfix/pr-32776
perf: use `get_cached_value` instead of `db.get_value` in controllers (backport #32776)
2022-11-07 13:30:15 +05:30
Deepesh Garg
d36c135103 Merge pull request #32872 from frappe/mergify/bp/version-14-hotfix/pr-32802
fix: `Material Consumption` option in case of `Skip Transfer to WIP` in WO (backport #32802)
2022-11-07 10:16:10 +05:30
Sagar Sharma
8c856cd5fc fix: Material Consumption option in case of Skip Transfer to WIP in WO
(cherry picked from commit 8ea6983734)
2022-11-07 04:06:34 +00:00
Daizy Modi
34ca17ab11 perf: use get_cached_value instead of db.get_value in controllers (#32776)
(cherry picked from commit 4efc947f14)
2022-11-07 03:52:39 +00:00
Sagar Sharma
3d2e8c7fb3 Merge pull request #32868 from frappe/mergify/bp/version-14-hotfix/pr-32867
fix: get `consumed_qty` based on `received_qty` in SCR (backport #32867)
2022-11-06 17:04:34 +05:30
Sagar Sharma
8f78be8525 test: add test case for consumed-qty
(cherry picked from commit 4d8da4420e)
2022-11-06 10:48:35 +00:00
Sagar Sharma
ea9a50278d fix: get consumed_qty based on received_qty in SCR
(cherry picked from commit 70c9b8dc50)
2022-11-06 10:48:34 +00:00
Sagar Sharma
e316558286 fix: set received_qty before_validate SCR
(cherry picked from commit c447dfaa9c)
2022-11-06 10:48:34 +00:00
Deepesh Garg
b9fb1045d7 feat: Item Wise TDS Calculation 2022-11-06 11:50:20 +05:30
Raffael Meyer
e276a5ba83 chore: add german translations (#32846)
Mostly for balance sheet

(cherry picked from commit d2b6490bca)

# Conflicts:
#	erpnext/translations/de.csv
2022-11-06 04:53:21 +00:00
Deepesh Garg
1a0f123c8c Merge pull request #32859 from frappe/mergify/bp/version-14-hotfix/pr-32794
fix: Disable tax included prices for internal transfers (backport #32794)
2022-11-05 21:16:44 +05:30
Deepesh Garg
6838e5ea3b fix: Disable tax included prices for internal transfers (#32794)
* fix: Disable tax-included prices for internal transfers

(cherry picked from commit 8d30ebb12b)
2022-11-05 15:22:07 +00:00
Deepesh Garg
41a5905a75 Merge pull request #32856 from frappe/mergify/bp/version-14-hotfix/pr-32847
fix: Create POS Opening Entry POS Profile filter. (backport #32847)
2022-11-05 20:51:49 +05:30
Sagar Sharma
eb6b267001 Merge pull request #32858 from frappe/mergify/bp/version-14-hotfix/pr-32850
fix: wrong consumed items in SCR return (backport #32850)
2022-11-05 20:12:54 +05:30
Sagar Sharma
0856e65700 test: fix test case
(cherry picked from commit 324bfa9fde)
2022-11-05 11:53:50 +00:00
Sagar Sharma
3f79a057e4 fix: make BOM required in SCR Item
(cherry picked from commit 760c26e9c0)
2022-11-05 11:53:50 +00:00
Sagar Sharma
bd7435ce1e test: add test case
(cherry picked from commit 761e9df1bf)
2022-11-05 11:53:50 +00:00
Sagar Sharma
97445d9516 fix: rename test method
(cherry picked from commit 611d827e0b)
2022-11-05 11:53:49 +00:00
Sagar Sharma
e629cba2b7 fix: map BOM while mapping the return SCR
(cherry picked from commit 54072ec9cd)
2022-11-05 11:53:49 +00:00
Deepesh Garg
cc8a184666 Merge pull request #32855 from frappe/mergify/bp/version-14-hotfix/pr-32844
fix: Auto advance allocation against partial invoices (backport #32844)
2022-11-05 16:59:03 +05:30
Maharshi Patel
60af9c0516 fix: Create POS Opening Entry POS Profile filter.
pos_profile_query was variable instead of function.

(cherry picked from commit 1328a45f2a)
2022-11-05 11:15:32 +00:00
Deepesh Garg
c3b2629412 test: Check parital payment allocation
(cherry picked from commit 428971f127)
2022-11-05 10:58:42 +00:00
Deepesh Garg
b7763d953a fix: Auto advance allocation against partial invoices
(cherry picked from commit 181df2fe63)
2022-11-05 10:58:42 +00:00
Sagar Sharma
3bd024ca8f Merge pull request #32831 from bhavesh95863/patch-2
fix: mysql syntax issue
2022-11-05 11:30:14 +05:30
Sagar Sharma
d443925b1e Merge branch 'version-14-hotfix' into patch-2 2022-11-05 10:29:11 +05:30
Sagar Sharma
2f145f9912 refactor: rewrite query in QB 2022-11-05 10:28:06 +05:30
rohitwaghchaure
d9147c1975 Merge pull request #32841 from frappe/mergify/bp/version-14-hotfix/pr-32799
fix: Scan Barcode UX (backport #32799)
2022-11-04 12:09:36 +05:30
rohitwaghchaure
31bada9205 fix: trailing whitespace 2022-11-04 11:28:41 +05:30
rohitwaghchaure
ab87a950e5 fix: conflicts 2022-11-04 11:21:39 +05:30
Rohit Waghchaure
d8e403bf5d fix: auto increment qty if item table has no items
(cherry picked from commit e5b19e3f70)
2022-11-04 05:36:09 +00:00
Rohit Waghchaure
1944f4df4d fix: Scan Barcode UX
(cherry picked from commit e1f9ba78e5)

# Conflicts:
#	erpnext/public/js/utils/barcode_scanner.js
2022-11-04 05:36:09 +00:00
Deepesh Garg
7e15c4789d Merge pull request #32840 from frappe/mergify/bp/version-14-hotfix/pr-32712
chore: add translation  function to Bank Reconciliation Tool-related files (backport #32712)
2022-11-04 08:33:44 +05:30
Ernesto Ruiz
e334b7dfee chore: add translation function to Bank Reconciliation Tool related files
chore: add translation  function to Bank Reconciliation Tool related files
(cherry picked from commit ad0dd693ac)
2022-11-03 19:36:56 +00:00
Frappe PR Bot
3967773fbe chore(release): Bumped to Version 14.5.1
## [14.5.1](https://github.com/frappe/erpnext/compare/v14.5.0...v14.5.1) (2022-11-03)

### Bug Fixes

* not able to select customer / supplier ([dd4dbd4](dd4dbd4b00))
2022-11-03 08:07:36 +00:00
Deepesh Garg
074c75252a Merge pull request #32835 from frappe/mergify/bp/version-14/pr-32833
fix: not able to select customer / supplier (backport #32832) (backport #32833)
2022-11-03 13:35:52 +05:30
Rohit Waghchaure
dd4dbd4b00 fix: not able to select customer / supplier
(cherry picked from commit b0fc568c80)
(cherry picked from commit 6989cdf4f2)
2022-11-03 06:53:41 +00:00
rohitwaghchaure
2d2a126510 Merge pull request #32833 from frappe/mergify/bp/version-14-hotfix/pr-32832
fix: not able to select customer / supplier (backport #32832)
2022-11-03 12:22:41 +05:30
Deepesh Garg
a10ea5efc9 Merge pull request #32830 from frappe/mergify/bp/version-14-hotfix/pr-32773
fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date (backport #32773)
2022-11-03 12:07:35 +05:30
Rohit Waghchaure
6989cdf4f2 fix: not able to select customer / supplier
(cherry picked from commit b0fc568c80)
2022-11-03 06:25:53 +00:00
Anand Baburajan
f5534d7db3 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32773 2022-11-03 11:53:55 +05:30
Bhavesh Maheshwari
4d9bbd4c9c fix: mysql syntax issue 2022-11-03 10:59:20 +05:30
Deepesh Garg
7a7b1d33c3 Merge pull request #32829 from frappe/mergify/bp/version-14-hotfix/pr-32713
fix: add missing translation function on report related documents (backport #32713)
2022-11-03 10:29:00 +05:30
anandbaburajan
01a1c96314 fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date
(cherry picked from commit f322c608cf)
2022-11-03 04:22:14 +00:00
Ernesto Ruiz
8f6f9a429a fix: correct linters
(cherry picked from commit 4c7fa9482d)
2022-11-03 04:17:23 +00:00
Ernesto Ruiz
440e20859f fix: correct linters
(cherry picked from commit 9c529c61bb)
2022-11-03 04:17:22 +00:00
Ernesto Ruiz
5acc9be5c9 fix: correct linters
(cherry picked from commit b7b53b5857)
2022-11-03 04:17:22 +00:00
Ernesto Ruiz
595aaad99d fix: add translate function to string on budget_variance_report.js to match the variance word translated
(cherry picked from commit 2012bdf4bd)
2022-11-03 04:17:22 +00:00
Ernesto Ruiz
16f364da37 fix: add translate function to name of chart labels in budget_variance_report.py
(cherry picked from commit 48ed6381b3)
2022-11-03 04:17:21 +00:00
Ernesto Ruiz
e681f06883 fix: add translate function to period in sales_analytics.py
(cherry picked from commit 083a78135c)
2022-11-03 04:17:21 +00:00
Ernesto Ruiz
b0c06d5a04 fix: add translate function to period in stock_analytics.py
(cherry picked from commit c1e608d9ef)
2022-11-03 04:17:20 +00:00
Ernesto Ruiz
0ead51642f fix: refactor code for better translatable string in stock_ageing.py
(cherry picked from commit 71a0ae2e59)
2022-11-03 04:17:20 +00:00
Ernesto Ruiz
2dc24f22ea fix: refactor code for better translatable string
(cherry picked from commit a671652ab2)
2022-11-03 04:17:20 +00:00
Ernesto Ruiz
b8caa587d2 fix: add translate function to name of chart labels in deferred_revenue_and_expense.py
(cherry picked from commit a963618b08)
2022-11-03 04:17:19 +00:00
ruthra kumar
b17761c276 Merge pull request #32822 from frappe/mergify/bp/version-14-hotfix/pr-32816
fix: update advance paid in SO/PO from Payment Ledger (backport #32816)
2022-11-02 19:31:33 +05:30
Sagar Sharma
d8c0a147db Merge pull request #32820 from frappe/mergify/bp/version-14-hotfix/pr-32788
fix: use `flt` instead of `cint` in `get_batch_no` (backport #32788)
2022-11-02 19:11:08 +05:30
Sagar Sharma
611dcc11d2 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32788 2022-11-02 17:49:26 +05:30
Sagar Sharma
75d347d757 Merge pull request #32823 from frappe/mergify/bp/version-14-hotfix/pr-32800
fix: test cases (backport #32800)
2022-11-02 17:49:01 +05:30
Rohit Waghchaure
d3fbe3074d test: run tmate
(cherry picked from commit 3f2728e3f7)
2022-11-02 11:44:05 +00:00
Rohit Waghchaure
0feec4ca8a fix: test cases
(cherry picked from commit ddd1b4be3f)
2022-11-02 11:44:05 +00:00
ruthra kumar
cf32e1905c test: SO advance paid on Payment submission and cancellation
(cherry picked from commit 721ac6b847)
2022-11-02 10:59:47 +00:00
ruthra kumar
87dc812a4b test: PO advance paid on payment submission and cancellation
(cherry picked from commit 1a0a8ac7e2)
2022-11-02 10:59:46 +00:00
ruthra kumar
388cf5113b test: refactor use @change_settings decorator when possible
(cherry picked from commit 81d791eea0)
2022-11-02 10:59:46 +00:00
ruthra kumar
a561432908 fix: update advance paid in SO/PO from Payment Ledger
(cherry picked from commit 4487065b67)
2022-11-02 10:59:45 +00:00
Sagar Sharma
6510464482 fix: use flt instead of cint in get_batch_no
(cherry picked from commit 9fb3fb4c83)
2022-11-02 10:25:26 +00:00
Frappe PR Bot
ce5dbf891a chore(release): Bumped to Version 14.5.0
# [14.5.0](https://github.com/frappe/erpnext/compare/v14.4.0...v14.5.0) (2022-11-01)

### Bug Fixes

* add `Sales Order` reference in Material Request Dashboard ([fc63892](fc6389280c))
* Add condition for discount section collapse ([953f78d](953f78d6a9))
* Budget validation for main cost center ([89a1c83](89a1c83431))
* Clear invoice table post importing invoices ([6eafff8](6eafff8694))
* Company bank account filter in Bank Clearance ([797512c](797512ca13))
* Curreny in SOA print for multi-currency party ([195500c](195500cb32))
* duplicate custom fields for inventory dimension ([1152ac3](1152ac3ff1))
* Filter fixes in Accounts Payable report ([29197dc](29197dcd7f))
* Issues while cancel/amending Purchase Invoice with TDS enabled ([74a6479](74a6479f70))
* key error in filter access ([6114241](6114241ff2))
* Mode of payment for returns in POS Sales Invoice ([a260426](a260426dd4))
* Pass project to stock entry items ([4035873](4035873295))
* pro_rata_amount calculation in assets tests ([d1b2786](d1b2786f24))
* Reference due date field type in Journal Entry Accounts table ([faf25c0](faf25c0b95))
* Reset advance paid amount on Oreder cancel and amend ([34bd783](34bd7837e2))
* Total Sales amount update in project via Sales Order ([d742e6d](d742e6d56b))

### Features

* additional filters on Payment terms report ([a03ec0a](a03ec0afb3))
* **pricing rule:** free qty rounding and recursion qty ([#32577](https://github.com/frappe/erpnext/issues/32577)) ([9b66020](9b66020fc7))
2022-11-01 17:19:41 +00:00
Deepesh Garg
fd36ee0fda Merge pull request #32793 from frappe/version-14-hotfix
chore: release v14
2022-11-01 22:48:17 +05:30
Deepesh Garg
d68fa0eff2 Merge pull request #32807 from frappe/mergify/bp/version-14-hotfix/pr-32779
fix: Mode of payment for returns in POS Sales Invoice (backport #32779)
2022-11-01 22:12:11 +05:30
Deepesh Garg
3f72156ea9 chore: Update tests
(cherry picked from commit 5b74161195)
2022-11-01 16:00:18 +00:00
Deepesh Garg
a260426dd4 fix: Mode of payment for returns in POS Sales Invoice
(cherry picked from commit 06e8e28531)
2022-11-01 16:00:18 +00:00
Deepesh Garg
148dc37d92 Merge pull request #32804 from frappe/mergify/bp/version-14-hotfix/pr-32801
fix: Issues while cancel/amending Purchase Invoice with TDS enabled (backport #32801)
2022-11-01 21:29:17 +05:30
Deepesh Garg
74a6479f70 fix: Issues while cancel/amending Purchase Invoice with TDS enabled
(cherry picked from commit f7c9258770)
2022-11-01 15:19:10 +00:00
ruthra kumar
f2f1c160f8 Merge pull request #32797 from frappe/mergify/bp/version-14-hotfix/pr-32577
feat(pricing rule): free qty rounding and recursion qty (backport #32577)
2022-11-01 17:09:46 +05:30
Dany Robert
9b66020fc7 feat(pricing rule): free qty rounding and recursion qty (#32577)
Option to specify recursion start qty and repeating qty

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 1d83fb20d6)
2022-11-01 11:12:44 +00:00
Deepesh Garg
6af43ba40d Merge pull request #32795 from frappe/mergify/bp/version-14-hotfix/pr-32790
fix: pro_rata_amount calculation in assets tests (backport #32790)
2022-11-01 16:19:49 +05:30
Anand Baburajan
bd531eb898 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32790 2022-11-01 15:21:29 +05:30
Deepesh Garg
15f4812108 Merge pull request #32782 from frappe/mergify/bp/version-14-hotfix/pr-32768
fix: Budget validation for main cost center (backport #32768)
2022-11-01 15:21:16 +05:30
anandbaburajan
4c5b688e0d chore: empty commit to try fixing stuck test
(cherry picked from commit 672fbd3849)
2022-11-01 09:48:04 +00:00
anandbaburajan
d1b2786f24 fix: pro_rata_amount calculation in assets tests
(cherry picked from commit 65e855bfff)
2022-11-01 09:48:04 +00:00
rohitwaghchaure
2eb01aae27 Merge pull request #32783 from frappe/mergify/bp/version-14-hotfix/pr-32730
fix: duplicate custom fields for inventory dimension (backport #32730)
2022-10-31 23:06:29 +05:30
Rohit Waghchaure
1152ac3ff1 fix: duplicate custom fields for inventory dimension
(cherry picked from commit 45ededbed5)
2022-10-31 16:56:17 +00:00
Deepesh Garg
89a1c83431 fix: Budget validation for main cost center
(cherry picked from commit 4e26d42d17)
2022-10-31 16:49:31 +00:00
Deepesh Garg
2a1a61238a Merge pull request #32780 from frappe/mergify/bp/version-14-hotfix/pr-32777
fix: Reset advance paid amount on Order cancel and amend (backport #32777)
2022-10-31 22:07:54 +05:30
Deepesh Garg
34bd7837e2 fix: Reset advance paid amount on Oreder cancel and amend
(cherry picked from commit 92f37ca111)
2022-10-31 16:09:27 +00:00
Deepesh Garg
f66a6693f4 Merge pull request #32761 from frappe/mergify/bp/version-14-hotfix/pr-32759
Pass project to stock entry items (backport #32759)
2022-10-30 09:29:03 +05:30
Hossein Yousefian
4035873295 fix: Pass project to stock entry items
fix: Pass project to stock entry items
(cherry picked from commit 54c2ffc36b)
2022-10-29 16:55:25 +00:00
Deepesh Garg
4a86efedfc Merge pull request #32752 from frappe/mergify/bp/version-14-hotfix/pr-32744
refactor: additional filters on Payment Terms status report (backport #32744)
2022-10-29 17:12:17 +05:30
Sagar Sharma
b7cbc804b2 Merge pull request #32756 from frappe/mergify/bp/version-14-hotfix/pr-32754
fix: add `Sales Order` reference in Material Request Dashboard (backport #32754)
2022-10-29 13:49:16 +05:30
Sagar Sharma
fc6389280c fix: add Sales Order reference in Material Request Dashboard
(cherry picked from commit 15ebf4a0cf)
2022-10-29 07:07:25 +00:00
ruthra kumar
6dbb4a3b0d test: due date filter on Payment Terms report
(cherry picked from commit fed39a53cb)
2022-10-29 05:40:16 +00:00
ruthra kumar
6114241ff2 fix: key error in filter access
(cherry picked from commit 4765f937ea)
2022-10-29 05:40:16 +00:00
ruthra kumar
a03ec0afb3 feat: additional filters on Payment terms report
Filter on Status and Due dates

(cherry picked from commit aadb6b1772)
2022-10-29 05:40:15 +00:00
Deepesh Garg
db5d74b7dc Merge pull request #32748 from frappe/mergify/bp/version-14-hotfix/pr-32722
fix: Reference due date field type in Journal Entry Accounts table (backport #32722)
2022-10-29 11:00:01 +05:30
Deepesh Garg
ad6e0f3af7 Merge pull request #32746 from frappe/mergify/bp/version-14-hotfix/pr-32699
fix: Curreny in SOA print for multi-currency party (backport #32699)
2022-10-29 10:59:49 +05:30
Deepesh Garg
abcf30aaa3 Merge pull request #32745 from frappe/mergify/bp/version-14-hotfix/pr-32692
fix: Clear invoice table post importing invoices (backport #32692)
2022-10-29 10:59:35 +05:30
Deepesh Garg
cc9c876007 Merge pull request #32747 from frappe/mergify/bp/version-14-hotfix/pr-32718
fix: Total Sales amount update in project via Sales Order (backport #32718)
2022-10-29 10:59:10 +05:30
Sagar Sharma
199e77faef Merge pull request #32750 from frappe/mergify/bp/version-14-hotfix/pr-32662
refactor: rewrite stock reports queries in qb (backport #32662)
2022-10-28 22:48:03 +05:30
Sagar Sharma
98428f0bce refactor: rewrite Itemwise Recommended Reorder Level Report queries in QB
(cherry picked from commit 40bd121593)
2022-10-28 15:36:01 +00:00
Sagar Sharma
a4b99a34cb refactor: rewrite Product Bundle Balance Report queries in QB
(cherry picked from commit cde785f1bb)
2022-10-28 15:36:01 +00:00
Sagar Sharma
c4587d8caa refactor: rewrite Stock Ledger Report queries in QB
(cherry picked from commit feaa2dbba8)
2022-10-28 15:36:01 +00:00
Deepesh Garg
faf25c0b95 fix: Reference due date field type in Journal Entry Accounts table
(cherry picked from commit e7caa48e2f)
2022-10-28 15:26:29 +00:00
Deepesh Garg
d742e6d56b fix: Total Sales amount update in project via Sales Order
(cherry picked from commit 6063c4e3c0)
2022-10-28 15:16:42 +00:00
Deepesh Garg
3f0b03c0a4 chore: Use account currency as fallback
(cherry picked from commit a18a715bb4)
2022-10-28 15:12:34 +00:00
Deepesh Garg
195500cb32 fix: Curreny in SOA print for multi-currency party
(cherry picked from commit 49ee873655)
2022-10-28 15:12:34 +00:00
Deepesh Garg
6eafff8694 fix: Clear invoice table post importing invoices
(cherry picked from commit 267e7c3a90)
2022-10-28 15:11:41 +00:00
Deepesh Garg
36f2b65401 Merge pull request #32739 from frappe/mergify/bp/version-14-hotfix/pr-32716
fix: Company bank account filter in Bank Clearance (backport #32716)
2022-10-28 17:19:49 +05:30
Sagar Sharma
f082c9e797 Merge pull request #32740 from frappe/mergify/bp/version-14-hotfix/pr-32738
fix: Added Material Request Reference in Purchase Recipt Dashboard for Tracking (backport #32738)
2022-10-28 16:06:44 +05:30
Vishal
0ab69c0e32 chore: minor linting issue fixed
(cherry picked from commit e8c0157017)
2022-10-28 08:54:44 +00:00
Vishal
de3996e411 chore: Added Material Request Reference in Purchase Recipt Dashboard for Tracking
(cherry picked from commit a04c44fe34)
2022-10-28 08:54:44 +00:00
Deepesh Garg
797512ca13 fix: Company bank account filter in Bank Clearance
(cherry picked from commit f9f78c1086)
2022-10-28 07:24:35 +00:00
Deepesh Garg
d39ec5ef5f Merge pull request #32737 from frappe/mergify/bp/version-14-hotfix/pr-32717
fix: Add condition for discount section collapse (backport #32717)
2022-10-28 11:55:37 +05:30
Deepesh Garg
2dae93c0a1 Merge pull request #32736 from frappe/mergify/bp/version-14-hotfix/pr-32724
fix: Filter fixes in Accounts Payable report (backport #32724)
2022-10-28 11:55:24 +05:30
Deepesh Garg
953f78d6a9 fix: Add condition for discount section collapse
(cherry picked from commit 4cd65027c4)
2022-10-28 05:55:06 +00:00
Deepesh Garg
29197dcd7f fix: Filter fixes in Accounts Payable report
(cherry picked from commit a5a73ba857)
2022-10-28 05:54:25 +00:00
Frappe PR Bot
123d720616 chore(release): Bumped to Version 14.4.0
# [14.4.0](https://github.com/frappe/erpnext/compare/v14.3.1...v14.4.0) (2022-10-26)

### Bug Fixes

* Advance paid amount in orders (backport [#32642](https://github.com/frappe/erpnext/issues/32642)) ([#32648](https://github.com/frappe/erpnext/issues/32648)) ([8a88105](8a88105aed))
* allow to create Sales Order from expired Quotation ([#32641](https://github.com/frappe/erpnext/issues/32641)) ([ccc58f4](ccc58f48e3))
* Billing Address for inter-company purchase docs ([f8934fa](f8934faa73))
* BOM cost update message ([e539579](e539579fb4))
* dont update item info twice ([8876904](887690449d))
* incorrect qty in material request ([da538a3](da538a37ad))
* number of months subscription plan ([fff9e76](fff9e76718))
* overlap error not raised for job card in case of workstation with production capacity ([ed2a093](ed2a093e49))
* party type and party mandatory on updating outstanding ([9a5e238](9a5e238702))
* searchfield not working for cuctsomer, supplier as per customize form ([fb1c307](fb1c30718b))
* unset contact details ([d7a65b1](d7a65b1d41))

### Features

* Basic Payment Ledger report ([5cb9f7b](5cb9f7b3a4))
* Repayment schedule types for term loans ([6ce32fd](6ce32fd5a9))

### Performance Improvements

* cache barcode scan result (backport [#32629](https://github.com/frappe/erpnext/issues/32629)) ([#32672](https://github.com/frappe/erpnext/issues/32672)) ([3300856](3300856fb4))
2022-10-26 05:09:19 +00:00
Deepesh Garg
1c95c67f58 Merge pull request #32707 from frappe/version-14-hotfix
chore: release v14
2022-10-26 10:37:46 +05:30
rohitwaghchaure
753b2edebf Merge pull request #32698 from frappe/mergify/bp/version-14-hotfix/pr-32693
fix: Search field not working for customer, supplier (backport #32693)
2022-10-24 23:14:37 +05:30
Rohit Waghchaure
f50b485225 test: added test case to validate seachfields for customer, supplier
(cherry picked from commit 5f84993bae)
2022-10-24 11:42:16 +00:00
Rohit Waghchaure
fb1c30718b fix: searchfield not working for cuctsomer, supplier as per customize form
(cherry picked from commit 46d148defd)
2022-10-24 11:42:15 +00:00
Deepesh Garg
2705de084f Merge pull request #32689 from frappe/mergify/bp/version-14-hotfix/pr-32424
feat: Repayment schedule types for term loans (backport #32424)
2022-10-23 23:06:58 +05:30
Deepesh Garg
a0ace27f56 chore: resolve conflicts 2022-10-23 19:43:02 +05:30
Deepesh Garg
2348c42c79 chore: Update tests
(cherry picked from commit e59b147a62)
2022-10-23 14:08:36 +00:00
Deepesh Garg
1b3a0be0f1 chore: Add repayment date on option
(cherry picked from commit ef0cb17faf)
2022-10-23 14:08:35 +00:00
Deepesh Garg
b9bf5666bc chore: label post save
(cherry picked from commit bf7a51791a)
2022-10-23 14:08:34 +00:00
Deepesh Garg
25e87641b6 chore: Add patch to update repayment schedule type in loan documents
(cherry picked from commit 679b5ed551)

# Conflicts:
#	erpnext/patches.txt
2022-10-23 14:08:34 +00:00
Deepesh Garg
8550bbde27 chore: Update labels as per repayment type
(cherry picked from commit 2ddee50f27)
2022-10-23 14:08:32 +00:00
Deepesh Garg
7398cbdf12 chore: Remove print statements
(cherry picked from commit 3466461eb3)
2022-10-23 14:08:32 +00:00
Deepesh Garg
6ce32fd5a9 feat: Repayment schedule types for term loans
(cherry picked from commit 76c6ccab5d)
2022-10-23 14:08:32 +00:00
Deepesh Garg
18904456f3 Merge pull request #32686 from frappe/mergify/bp/version-14-hotfix/pr-32650
fix: unset contact details (backport #32650)
2022-10-23 18:32:04 +05:30
barredterra
d7a65b1d41 fix: unset contact details
(cherry picked from commit 23f0bb45b0)
2022-10-23 12:51:49 +00:00
ruthra kumar
eb6db59adf Merge pull request #32679 from frappe/mergify/bp/version-14-hotfix/pr-32635
fix: Integrity Error on PLE while submitting sales invoice (backport #32635)
2022-10-21 12:05:46 +05:30
ruthra kumar
fb2b2edf7e Merge pull request #32678 from frappe/mergify/bp/version-14-hotfix/pr-32651
feat: Payment Ledger report (backport #32651)
2022-10-21 11:56:09 +05:30
ruthra kumar
c2f8f64d1e test: use payable account in tax and to trigger party validation
(cherry picked from commit 8f42e7f703)
2022-10-21 06:07:09 +00:00
ruthra kumar
9a5e238702 fix: party type and party mandatory on updating outstanding
(cherry picked from commit 43b80683eb)
2022-10-21 06:07:09 +00:00
ruthra kumar
77f4c666ee test: invoice outstandings and payments
(cherry picked from commit 6e55b419a6)
2022-10-21 05:56:17 +00:00
ruthra kumar
5cb9f7b3a4 feat: Basic Payment Ledger report
(cherry picked from commit 8f60f0a0cf)
2022-10-21 05:56:17 +00:00
Ankush Menat
e1fc67c730 chore: disable coverage reporting on stable branches 2022-10-20 19:15:50 +05:30
Deepesh Garg
99d410ab75 Merge pull request #32673 from frappe/mergify/bp/version-14-hotfix/pr-32551
fix: number of months subscription plan (backport #32551)
2022-10-20 19:06:54 +05:30
Deepesh Garg
54de569251 Merge pull request #32655 from frappe/mergify/bp/version-14-hotfix/pr-32641
fix: allow to create Sales Order from expired Quotation (backport #32641)
2022-10-20 17:34:04 +05:30
Deepesh Garg
cab3f39f95 chore: Linting issues
(cherry picked from commit 1ca472cc8a)
2022-10-20 11:55:04 +00:00
codezart
fff9e76718 fix: number of months subscription plan
(cherry picked from commit 2d30b36cca)
2022-10-20 11:55:04 +00:00
Deepesh Garg
dbbebd2a73 Merge pull request #32663 from frappe/mergify/bp/version-14-hotfix/pr-32659
fix: Billing Address for inter-company purchase docs (backport #32659)
2022-10-20 17:21:24 +05:30
rohitwaghchaure
9bf101a234 Merge pull request #32669 from frappe/mergify/bp/version-14-hotfix/pr-32667
fix: BOM cost update message (backport #32667)
2022-10-20 16:53:09 +05:30
Ankush Menat
887690449d fix: dont update item info twice
[skip ci]
2022-10-20 16:19:40 +05:30
mergify[bot]
3300856fb4 perf: cache barcode scan result (backport #32629) (#32672)
perf: cache barcode scan result (#32629)

* perf: cache barcode scan result

* feat: BarcodeScanResult type

* fix: use safe `get_value` `set_value`

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit b88e850d55)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2022-10-20 15:57:21 +05:30
Rohit Waghchaure
e539579fb4 fix: BOM cost update message
(cherry picked from commit 9cfe527492)
2022-10-20 09:08:31 +00:00
Deepesh Garg
f8934faa73 fix: Billing Address for inter-company purchase docs
(cherry picked from commit 796f2d3c09)
2022-10-20 06:29:32 +00:00
rohitwaghchaure
2c9845f8cb Merge pull request #32660 from frappe/mergify/bp/version-14-hotfix/pr-32654
fix: incorrect qty in material request created from PP (backport #32654)
2022-10-20 11:58:57 +05:30
Rohit Waghchaure
92b9d3dc6d test: validate qty and purchase uom in material request which is created from PP
(cherry picked from commit 4d5ef721f7)
2022-10-20 04:30:08 +00:00
Rohit Waghchaure
da538a37ad fix: incorrect qty in material request
(cherry picked from commit ad278b2007)
2022-10-20 04:30:08 +00:00
rohitwaghchaure
d6bf85f8bb Merge pull request #32652 from frappe/mergify/bp/version-14-hotfix/pr-32645
fix: overlap error not raised for job card in case of workstation with production capacity (backport #32645)
2022-10-20 09:58:25 +05:30
mergify[bot]
c3024af296 feat(report):added account wise redirection (backport #32529) (#32657)
feat(report): added account wise redirection

* feat(report):added account wise redirection

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit c52b41d311)

Co-authored-by: FinByz Tech Pvt. Ltd <info@finbyz.tech>
2022-10-20 09:39:11 +05:30
Raffael Meyer
ccc58f48e3 fix: allow to create Sales Order from expired Quotation (#32641)
(cherry picked from commit 4ad3002861)
2022-10-19 16:37:53 +00:00
Rohit Waghchaure
ed2a093e49 fix: overlap error not raised for job card in case of workstation with production capacity
(cherry picked from commit 8b2165e0d1)
2022-10-19 11:35:38 +00:00
mergify[bot]
8a88105aed fix: Advance paid amount in orders (backport #32642) (#32648)
fix: Advance paid amount in orders (#32642)

(cherry picked from commit 430492152f)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-10-19 15:41:57 +05:30
Frappe PR Bot
9703771b75 chore(release): Bumped to Version 14.3.1
## [14.3.1](https://github.com/frappe/erpnext/compare/v14.3.0...v14.3.1) (2022-10-18)

### Bug Fixes

* `Brand Defaults` filters ([cb0c4b5](cb0c4b5664))
* add project settings to projects workspace (backport [#32568](https://github.com/frappe/erpnext/issues/32568)) ([#32600](https://github.com/frappe/erpnext/issues/32600)) ([af4dafd](af4dafdc64))
* delete old ple's on item value repost ([62cabdf](62cabdf792))
* don't try to update youtube data if disabled in settings (backport [#32588](https://github.com/frappe/erpnext/issues/32588)) ([#32589](https://github.com/frappe/erpnext/issues/32589)) ([ed85683](ed85683fea))
* group warehouse filter not working for Batchwise Balance history report ([faedd85](faedd85b66))
* Ignore linked purchase invoice on cancel ([cc938fb](cc938fb028))
* linter ([831f60f](831f60f439))
* Party account for multi-order invoices ([eaea846](eaea8469fc))
* pricing rule item code UOM apply & conversions (backport [#32566](https://github.com/frappe/erpnext/issues/32566)) ([#32637](https://github.com/frappe/erpnext/issues/32637)) ([ffd82f3](ffd82f3302))
* Renamed Dashboard tab label to Connections ([dac5989](dac5989d72))
* Renamed Notes section to Comments ([9e94dd9](9e94dd9203))
* type-cast while saving an item (backport [#32549](https://github.com/frappe/erpnext/issues/32549)) ([#32578](https://github.com/frappe/erpnext/issues/32578)) ([829a0ff](829a0ff827))
2022-10-18 18:03:17 +00:00
Deepesh Garg
bd62a1d2d3 Merge pull request #32633 from frappe/version-14-hotfix
chore: release v14
2022-10-18 23:31:52 +05:30
mergify[bot]
ffd82f3302 fix: pricing rule item code UOM apply & conversions (backport #32566) (#32637)
fix: pricing rule for non stock UOM and conversions

* fix: pricing rule for non stock UOM and conversions

(cherry picked from commit 96b4211ea1)

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
2022-10-18 23:01:08 +05:30
Deepesh Garg
8c658638b4 Merge pull request #32621 from frappe/mergify/bp/version-14-hotfix/pr-32598
refactor: split ple creation function into two (backport #32598)
2022-10-18 15:11:51 +05:30
Sagar Sharma
064e364b4f Merge pull request #32632 from frappe/mergify/bp/version-14-hotfix/pr-32520
refactor: rewrite stock reports queries in qb (backport #32520)
2022-10-18 14:59:18 +05:30
Sagar Sharma
831f60f439 fix: linter 2022-10-18 14:27:56 +05:30
Sagar Sharma
469813d3e1 chore: conflicts 2022-10-18 14:18:44 +05:30
Sagar Sharma
656008dd66 refactor: rewrite Warehouse wise Item Balance Age and Value Report queries in QB
(cherry picked from commit 8103856a41)
2022-10-18 08:22:56 +00:00
Sagar Sharma
362bf5fc19 refactor: rewrite Total Stock Summary Report queries in QB
(cherry picked from commit 7c759b193c)
2022-10-18 08:22:56 +00:00
Sagar Sharma
8af90b2421 refactor: rewrite Supplier-Wise Sales Analytics Report queries in QB
(cherry picked from commit d3c073dc25)
2022-10-18 08:22:55 +00:00
Sagar Sharma
6903fb68d3 refactor: rewrite Stock Projected Qty Report queries in QB
(cherry picked from commit c18f13a45b)
2022-10-18 08:22:55 +00:00
Sagar Sharma
907a41a8da refactor: rewrite Item Prices Report queries in QB
(cherry picked from commit e312d17eae)
2022-10-18 08:22:55 +00:00
Sagar Sharma
e62fdf4af0 refactor: rewrite Delayed Item Report queries in QB
(cherry picked from commit bb59346651)
2022-10-18 08:22:55 +00:00
Sagar Sharma
720370537f refactor: rewrite Batch-Wise Balance History Report queries in QB
(cherry picked from commit 1c1f991d2f)

# Conflicts:
#	erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py
2022-10-18 08:22:54 +00:00
Sagar Sharma
5a85c2d661 refactor: rewrite Batch Item Expiry Status Report queries in QB
(cherry picked from commit 2c9d9577e3)
2022-10-18 08:22:54 +00:00
Sagar Sharma
64e9a25347 Merge pull request #32630 from frappe/mergify/bp/version-14-hotfix/pr-32527
refactor: rewrite buying reports queries in qb (backport #32527)
2022-10-18 10:47:47 +05:30
Sagar Sharma
2191f8a488 refactor: rewrite Procurement Tracker Report queries in QB
(cherry picked from commit e78a706994)
2022-10-18 04:37:03 +00:00
Sagar Sharma
1fbbaa8fcf refactor: rewrite Supplier Quotation Comparison Report queries in QB
(cherry picked from commit a14b9c7bac)
2022-10-18 04:37:02 +00:00
Sagar Sharma
fbb641936e refactor: rewrite Purchase Order Analysis Report queries in QB
(cherry picked from commit a5b3f8cae9)
2022-10-18 04:37:02 +00:00
Deepesh Garg
891a4afb5f Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32598 2022-10-18 10:00:46 +05:30
Deepesh Garg
01c5fbdbfb Merge pull request #32623 from frappe/mergify/bp/version-14-hotfix/pr-32622
fix: Ignore linked purchase invoice on cancel (backport #32622)
2022-10-18 09:12:48 +05:30
Deepesh Garg
cc938fb028 fix: Ignore linked purchase invoice on cancel
(cherry picked from commit faadf78332)
2022-10-17 14:08:50 +00:00
Deepesh Garg
9bcec15ca4 Merge pull request #32619 from frappe/mergify/bp/version-14-hotfix/pr-32618
test: lead creation and deletion restricted to dummy company (backport #32618)
2022-10-17 19:37:36 +05:30
ruthra kumar
a88ac4016a refactor: split ple creation function into two
refactor create_payment_ledger_entry function into 2.
one for generating ple map and one for DB entry creation

(cherry picked from commit 9b50221bf0)
2022-10-17 13:16:20 +00:00
rohitwaghchaure
0654f303bb Merge pull request #32615 from frappe/mergify/bp/version-14-hotfix/pr-32613
fix: group warehouse filter not working for Batch-wise Balance history report (backport #32613)
2022-10-17 18:04:09 +05:30
ruthra kumar
98e7b2dd25 test: lead creation and deletion restricted to dummy company
(cherry picked from commit ced8d2a537)
2022-10-17 11:42:33 +00:00
Rohit Waghchaure
1ee0d990e5 chore: seperate function to apply filter for warehouse in case of QB
(cherry picked from commit 2481574a28)
2022-10-17 09:43:30 +00:00
Rohit Waghchaure
faedd85b66 fix: group warehouse filter not working for Batchwise Balance history report
(cherry picked from commit 6381e75fa5)
2022-10-17 09:43:29 +00:00
Deepesh Garg
2db1da0c8a Merge pull request #32612 from frappe/mergify/bp/version-14-hotfix/pr-32607
chore: Remove HRMS related code (backport #32607)
2022-10-17 14:53:39 +05:30
Deepesh Garg
d9519f24aa chore: Remove HRMS related code (#32607)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
(cherry picked from commit dc3fe85921)
2022-10-17 06:09:25 +00:00
Deepesh Garg
a260c594c1 Merge pull request #32608 from frappe/mergify/bp/version-14-hotfix/pr-32591
fix: Renamed Notes section to Comments (backport #32591)
2022-10-15 18:26:00 +05:30
Nabin Hait
dac5989d72 fix: Renamed Dashboard tab label to Connections
(cherry picked from commit f561d8f689)
2022-10-15 12:13:35 +00:00
Nabin Hait
9e94dd9203 fix: Renamed Notes section to Comments
(cherry picked from commit 56a4a77398)
2022-10-15 12:13:35 +00:00
Deepesh Garg
794167aa36 Merge pull request #32606 from frappe/mergify/bp/version-14-hotfix/pr-32594
fix: Party account for multi-order invoices (backport #32594)
2022-10-15 17:41:14 +05:30
Deepesh Garg
eaea8469fc fix: Party account for multi-order invoices
(cherry picked from commit fd49503ba2)
2022-10-15 11:29:42 +00:00
mergify[bot]
af4dafdc64 fix: add project settings to projects workspace (backport #32568) (#32600)
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2022-10-14 18:01:43 +05:30
ruthra kumar
a012c55c81 Merge pull request #32592 from frappe/mergify/bp/version-14-hotfix/pr-32567
fix: deduplicate Payment Ledger on Item value repost (backport #32567)
2022-10-13 15:28:57 +05:30
mergify[bot]
6a89cb57b0 chore: drop dead code (backport #32595) (#32596)
chore: drop dead code (#32595)

[skip ci]

(cherry picked from commit 50e9698932)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-13 15:27:17 +05:30
ruthra kumar
3c457e2638 test: dedeplication on payment ledger upon repost
(cherry picked from commit eb819368aa)
2022-10-13 08:32:51 +00:00
ruthra kumar
62cabdf792 fix: delete old ple's on item value repost
(cherry picked from commit 65992304bc)
2022-10-13 08:32:51 +00:00
mergify[bot]
ed85683fea fix: don't try to update youtube data if disabled in settings (backport #32588) (#32589)
fix: don't try to update youtube data if disabled in settings (#32588)

fix: cast value from db

[skip ci]

(cherry picked from commit e543dca6a0)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2022-10-13 11:55:36 +05:30
mergify[bot]
829a0ff827 fix: type-cast while saving an item (backport #32549) (#32578)
fix: type-cast while saving an item (#32549)

(cherry picked from commit 43037d893d)

Co-authored-by: Rohan <Alchez@users.noreply.github.com>
2022-10-13 11:54:22 +05:30
Sagar Sharma
0674d42c96 Merge pull request #32586 from frappe/mergify/bp/version-14-hotfix/pr-32576
fix: `Brand Defaults` filters (backport #32576)
2022-10-12 19:25:32 +05:30
Sagar Sharma
cb0c4b5664 fix: Brand Defaults filters
(cherry picked from commit 7da32c7db3)
2022-10-12 13:53:35 +00:00
Frappe PR Bot
36b9926527 chore(release): Bumped to Version 14.3.0
# [14.3.0](https://github.com/frappe/erpnext/compare/v14.2.3...v14.3.0) (2022-10-12)

### Bug Fixes

* consider outgoingrate while valuation rate calculate ([423c019](423c0190e2))
* consider sales rate as incoming rate for transit warehouse in purchase flow ([948b231](948b231e92))
* Do not add tax withheld vouchers post tax withheding in one document ([bd8e61b](bd8e61b2dc))
* Explicitly update modified (backport [#32519](https://github.com/frappe/erpnext/issues/32519)) ([#32575](https://github.com/frappe/erpnext/issues/32575)) ([154904e](154904e960))
* Hanlde rounding loss for internal transfer ([8eda2db](8eda2dbdf8))
* Incoming rate precision fixes for intra company transfer ([b653f43](b653f43b70))
* make readings status mandatory in Quality Inspection ([50d790c](50d790c919))
* minor cleanup ([236a5f3](236a5f37c7))
* more fields reordering related to Tab Break ([db4fbc9](db4fbc9e58))
* PO cancel post advance payment cancel against PO ([bda25c4](bda25c4d5d))
* removed unnecessary imports ([31782d6](31782d6f71))
* set Quality Inspection status based on readings status ([e25db8b](e25db8b1b5))
* single column indexes (backport [#32425](https://github.com/frappe/erpnext/issues/32425)) ([#32513](https://github.com/frappe/erpnext/issues/32513)) ([2f1b8af](2f1b8af13c))
* Tax withholding related fixes ([d5f6938](d5f693806b))
* test case ([0b26131](0b26131b65))
* **test:** `test_rejected_qi_validation` ([943e619](943e6192cc))
* TooManyWritesError during reposting of stock ([73742ff](73742ff565))
* unlink payment on invoice cancellation ([8ba503b](8ba503bf0e))
* use naming_series in budget ([0a24859](0a24859c9c))
* value error on pos submit ([4b65dd7](4b65dd7f2a))

### Features

* **JE:** trigger account field when fetched from template ([17dd1ab](17dd1abb34)), closes [#32409](https://github.com/frappe/erpnext/issues/32409)
* provision to return non consumed components against the work order ([d0f3818](d0f3818060))
* Tab Break in Material Request ([79151be](79151be8ce))
* Tab Break in Purchase Invoice ([89314d4](89314d4171))
* Tab Break in Purchase Order ([5a8329a](5a8329add1))
* Tab Break in Purchase Receipt ([b092791](b092791ac8))
* Tab Break in Quotation ([b0a9f79](b0a9f79e18))
* Tab Break in Sales Order, Delivery Note, Sales Invoice and Purchase Order ([31cd96b](31cd96bc89))
* Tab Break in Supplier Quotation ([22ad3ad](22ad3ad6f3))
2022-10-12 12:21:48 +00:00
Deepesh Garg
d38071eb20 Merge pull request #32560 from frappe/version-14-hotfix
chore: release v14
2022-10-12 17:50:12 +05:30
Deepesh Garg
c4b39c7c1c Merge branch 'version-14' into version-14-hotfix 2022-10-12 17:19:33 +05:30
Deepesh Garg
c83c645ab0 Merge pull request #32579 from frappe/mergify/bp/version-14-hotfix/pr-32563
fix: consider sales rate as incoming rate for transit warehouse in purchase flow (backport #32563)
2022-10-12 17:16:36 +05:30
Deepesh Garg
eab24b8366 Merge pull request #32582 from frappe/mergify/bp/version-14-hotfix/pr-32272
fix: Incoming rate precision fixes for intra company transfer (backport #32272)
2022-10-12 17:05:18 +05:30
rohitwaghchaure
31782d6f71 fix: removed unnecessary imports 2022-10-12 16:34:48 +05:30
Deepesh Garg
2494ccc0a2 chore: check only for inter-company transfers
(cherry picked from commit 9aa5e20ef7)
2022-10-12 10:54:33 +00:00
Deepesh Garg
108720b9c3 chore: fix precision condition
(cherry picked from commit 49601558c6)
2022-10-12 10:54:33 +00:00
Deepesh Garg
4f3e209009 chore: Use proper accounts
(cherry picked from commit 1c05c004cd)
2022-10-12 10:54:33 +00:00
Deepesh Garg
23b18a5e38 chore: Increase precision for other doc fields
(cherry picked from commit c8d2181498)
2022-10-12 10:54:33 +00:00
Deepesh Garg
b386b8c634 chore: GL Entries for SLE diff
(cherry picked from commit df2a0e265b)
2022-10-12 10:54:32 +00:00
Deepesh Garg
49221d47c2 test: Internal tranfer precision loss test
(cherry picked from commit dc20b21fb5)
2022-10-12 10:54:32 +00:00
Deepesh Garg
09e9675653 chore: Increase incoming_rate field precision to 6
(cherry picked from commit b31c3bd35d)
2022-10-12 10:54:32 +00:00
Deepesh Garg
8eda2dbdf8 fix: Hanlde rounding loss for internal transfer
(cherry picked from commit 6e47fd54a0)
2022-10-12 10:54:32 +00:00
Deepesh Garg
b653f43b70 fix: Incoming rate precision fixes for intra company transfer
(cherry picked from commit 083309c056)
2022-10-12 10:54:31 +00:00
Rohit Waghchaure
0b26131b65 fix: test case
(cherry picked from commit 98bf8e1304)
2022-10-12 10:51:00 +00:00
Rohit Waghchaure
423c0190e2 fix: consider outgoingrate while valuation rate calculate
(cherry picked from commit 3266e54e33)
2022-10-12 10:51:00 +00:00
Rohit Waghchaure
948b231e92 fix: consider sales rate as incoming rate for transit warehouse in purchase flow
(cherry picked from commit 683a47f7a1)
2022-10-12 10:50:59 +00:00
Deepesh Garg
23aca6663f Merge pull request #32565 from frappe/mergify/bp/version-14-hotfix/pr-32408
feat: Tab Breaks in all Sales and Purchase cycle transactions (backport #32408)
2022-10-12 14:13:38 +05:30
Deepesh Garg
6c85bdd735 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32408 2022-10-12 13:04:01 +05:30
mergify[bot]
154904e960 fix: Explicitly update modified (backport #32519) (#32575)
fix: Explicitly update modified (#32519)

* fix: Explicitly update modified

required after https://github.com/frappe/frappe/pull/18301

* chore: fix broken translations

(cherry picked from commit 8376fbc982)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-12 12:59:06 +05:30
mergify[bot]
03db8b2f5f ci: disable orchestrator (backport #32571) (#32572)
* ci: disable orchestrator (#32571)

(cherry picked from commit 6ce3ce758c)

* chore: correct build count

* chore: no cov

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-12 12:14:48 +05:30
Nabin Hait
236a5f37c7 fix: minor cleanup
(cherry picked from commit e71c417f7e)
2022-10-11 10:33:30 +00:00
Nabin Hait
db4fbc9e58 fix: more fields reordering related to Tab Break
(cherry picked from commit 5389a35798)
2022-10-11 10:33:30 +00:00
Nabin Hait
89314d4171 feat: Tab Break in Purchase Invoice
(cherry picked from commit aaf3c2b329)
2022-10-11 10:33:30 +00:00
Nabin Hait
b092791ac8 feat: Tab Break in Purchase Receipt
(cherry picked from commit 35f836c4b7)
2022-10-11 10:33:30 +00:00
Nabin Hait
22ad3ad6f3 feat: Tab Break in Supplier Quotation
(cherry picked from commit 3d9263bf86)
2022-10-11 10:33:29 +00:00
Nabin Hait
79151be8ce feat: Tab Break in Material Request
(cherry picked from commit 2172c5034a)
2022-10-11 10:33:29 +00:00
Nabin Hait
5a8329add1 feat: Tab Break in Purchase Order
(cherry picked from commit 10a25603ac)
2022-10-11 10:33:29 +00:00
Nabin Hait
b0a9f79e18 feat: Tab Break in Quotation
(cherry picked from commit 7546562139)
2022-10-11 10:33:28 +00:00
Nabin Hait
31cd96bc89 feat: Tab Break in Sales Order, Delivery Note, Sales Invoice and Purchase Order
(cherry picked from commit f6613e1e4c)
2022-10-11 10:33:27 +00:00
ruthra kumar
db563483cb Merge pull request #32558 from frappe/mergify/bp/version-14-hotfix/pr-32557
fix: Value error on validation of POS invoices with Serial Nos (backport #32557)
2022-10-11 15:36:36 +05:30
ruthra kumar
6fa1b892f7 test: value error on serial no validation on pos
(cherry picked from commit 9e2bd10d03)
2022-10-11 09:13:36 +00:00
ruthra kumar
4b65dd7f2a fix: value error on pos submit
(cherry picked from commit 4b908ebcd6)
2022-10-11 09:13:35 +00:00
Deepesh Garg
62296c85cd Merge pull request #32543 from frappe/mergify/bp/version-14-hotfix/pr-32497
chore: set `Quality Inspection` status based on readings status (backport #32497)
2022-10-11 14:02:58 +05:30
ruthra kumar
a71be4e99a Merge pull request #32550 from frappe/mergify/bp/version-14-hotfix/pr-32548
fix: allow deletion of cancelled Invoices once payments are unlinked (backport #32548)
2022-10-11 13:47:57 +05:30
Ankush Menat
c9002526b9 chore: update codeowners 2022-10-11 12:33:51 +05:30
Deepesh Garg
b9b08e4d5e Merge pull request #32555 from frappe/mergify/bp/version-14-hotfix/pr-32554
fix: use naming_series in budget (backport #32554)
2022-10-11 11:51:51 +05:30
Sagar Sharma
3c0bca3d74 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32497 2022-10-11 11:45:19 +05:30
Anand Baburajan
27509e2141 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32554 2022-10-11 11:06:44 +05:30
rohitwaghchaure
52dd967b0d Merge pull request #32542 from frappe/mergify/bp/version-14-hotfix/pr-32393
feat: provision to return non consumed components against the work order (backport #32393)
2022-10-11 10:39:18 +05:30
Deepesh Garg
9601e47ae4 Merge pull request #32540 from frappe/mergify/bp/version-14-hotfix/pr-32536
fix: PO cancel post advance payment cancel against PO (backport #32536)
2022-10-11 10:17:10 +05:30
anandbaburajan
0a24859c9c fix: use naming_series in budget
(cherry picked from commit e4d7d8c42d)
2022-10-11 04:46:10 +00:00
ruthra kumar
998367cedc test: update ple on payment unlink for SI's and SO's
(cherry picked from commit 143f905838)
2022-10-10 11:12:38 +00:00
ruthra kumar
8ba503bf0e fix: unlink payment on invoice cancellation
(cherry picked from commit 537d953f4c)
2022-10-10 11:12:38 +00:00
Sagar Sharma
943e6192cc fix(test): test_rejected_qi_validation
(cherry picked from commit 4992e4a2b8)
2022-10-10 05:20:45 +00:00
Sagar Sharma
91b0e7ddbd test: add test cases for Quality Inspection status
(cherry picked from commit fcc1272d42)
2022-10-10 05:20:45 +00:00
Sagar Sharma
e25db8b1b5 fix: set Quality Inspection status based on readings status
(cherry picked from commit 2657ece2cd)
2022-10-10 05:20:44 +00:00
Sagar Sharma
50d790c919 fix: make readings status mandatory in Quality Inspection
(cherry picked from commit d7c3b7633a)
2022-10-10 05:20:44 +00:00
Sagar Sharma
8a4c07a7e8 chore: add Manual Inspection field in Quality Inspection DocType
(cherry picked from commit 39707757a6)
2022-10-10 05:20:44 +00:00
Rohit Waghchaure
d0f3818060 feat: provision to return non consumed components against the work order
(cherry picked from commit d59ed24e6c)
2022-10-10 03:39:25 +00:00
Deepesh Garg
bda25c4d5d fix: PO cancel post advance payment cancel against PO
(cherry picked from commit d806e32030)
2022-10-09 13:06:06 +00:00
Frappe PR Bot
f70103dac6 chore(release): Bumped to Version 14.2.3
## [14.2.3](https://github.com/frappe/erpnext/compare/v14.2.2...v14.2.3) (2022-10-07)

### Bug Fixes

* Do not add tax withheld vouchers post tax withheding in one document ([6060072](6060072d22))
* Tax withholding related fixes ([a226fcf](a226fcf898))
2022-10-07 12:40:22 +00:00
Deepesh Garg
a519d68826 Merge pull request #32525 from frappe/mergify/bp/version-14/pr-32522
fix: Tax withholding related fixes (backport #32522)
2022-10-07 18:08:51 +05:30
Deepesh Garg
49cedca8de Merge pull request #32524 from frappe/mergify/bp/version-14-hotfix/pr-32522
fix: Tax withholding related fixes (backport #32522)
2022-10-07 18:08:39 +05:30
Deepesh Garg
6060072d22 fix: Do not add tax withheld vouchers post tax withheding in one document
(cherry picked from commit 781d160c68)
2022-10-07 12:03:29 +00:00
Deepesh Garg
a226fcf898 fix: Tax withholding related fixes
(cherry picked from commit abf5b6be3e)
2022-10-07 12:03:29 +00:00
Deepesh Garg
bd8e61b2dc fix: Do not add tax withheld vouchers post tax withheding in one document
(cherry picked from commit 781d160c68)
2022-10-07 11:03:40 +00:00
Deepesh Garg
d5f693806b fix: Tax withholding related fixes
(cherry picked from commit abf5b6be3e)
2022-10-07 11:03:40 +00:00
mergify[bot]
5f6bbd4929 chore: drop stale demo page (backport #32515) (#32516)
chore: drop stale demo page (#32515)

(cherry picked from commit 07c4a74838)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-06 13:03:29 +05:30
mergify[bot]
2f1b8af13c fix: single column indexes (backport #32425) (#32513)
fix: single column indexes (#32425)

refactor: move single column indexes to doctypes
(cherry picked from commit 8d1db0ea3d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-06 11:37:43 +05:30
Deepesh Garg
3d6a37ea04 Merge pull request #32510 from frappe/mergify/bp/version-14-hotfix/pr-32385
chore: update fr translation (backport #32385)
2022-10-06 09:03:20 +05:30
HENRY Florian
3caf905019 chore: update fr translation (#32385)
(cherry picked from commit 0e4017cbe5)
2022-10-05 17:20:04 +00:00
Deepesh Garg
4941b6e280 Merge pull request #32501 from frappe/mergify/bp/version-14-hotfix/pr-32491
refactor: remove duplicate entries on remarks migration patch (backport #32491)
2022-10-05 18:16:51 +05:30
Deepesh Garg
a02ddc92ef Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32491 2022-10-05 17:30:25 +05:30
Deepesh Garg
6017f6790e Merge pull request #32503 from frappe/mergify/bp/version-14-hotfix/pr-32499
fix: TooManyWritesError during reposting of stock (backport #32499)
2022-10-05 17:29:56 +05:30
Deepesh Garg
3daff104c3 Merge pull request #32505 from frappe/mergify/bp/version-14-hotfix/pr-32478
feat(JE): trigger account field when fetched from template (backport #32478)
2022-10-05 17:28:49 +05:30
Dany Robert
17dd1abb34 feat(JE): trigger account field when fetched from template
Closes #32409

(cherry picked from commit c35adcf5a1)
2022-10-05 10:38:41 +00:00
Rohit Waghchaure
73742ff565 fix: TooManyWritesError during reposting of stock
(cherry picked from commit aaabba9b1e)
2022-10-05 10:36:18 +00:00
ruthra kumar
70e990c4f3 refactor: remove duplicate entries on remarks migration patch
(cherry picked from commit 518ab93e03)
2022-10-05 10:35:06 +00:00
Frappe PR Bot
217e407371 chore(release): Bumped to Version 14.2.2
## [14.2.2](https://github.com/frappe/erpnext/compare/v14.2.1...v14.2.2) (2022-10-04)

### Bug Fixes

* (bulk transaction) key error and better error logging (backport [#32445](https://github.com/frappe/erpnext/issues/32445)) ([#32463](https://github.com/frappe/erpnext/issues/32463)) ([7a80385](7a8038500d))
* add non-stock item filter for `fg_item` in PO ([11f9279](11f92797b9))
* add validation for non-stock item in SCR ([793fa18](793fa18225))
* asset requiring maintenance sold status and added test [v14-hotfix] ([c0a141b](c0a141bfcd))
* asset tests ([6710337](671033755f))
* calculate depreciation properly on asset sale entry and scrap entry ([f5f13c4](f5f13c4611))
* Create accounting dimension fields in asset capitalization ([9ec0d10](9ec0d104a5))
* Disbursement Account in patch to update old loans ([0973989](097398914e))
* don't allow to update `Maintain Stock` if the item has a `BOM` ([e5d1f59](e5d1f59d96))
* fetch swift_number in payment_request ([f09222a](f09222a9e5))
* fix restore asset value after depreciation ([8605245](86052450a5))
* fixes query builder order by issue in postgres (backport [#32441](https://github.com/frappe/erpnext/issues/32441)) ([#32465](https://github.com/frappe/erpnext/issues/32465)) ([8851826](8851826a57))
* Incorrect TCS amount deducted in Sales Invoice ([4d51d73](4d51d73797))
* Item details fetching on making transaction from item dashboard ([db60299](db60299cf3))
* not able to return sold expired batches ([9c56a5f](9c56a5ff7c))
* payment request make bank field Link instead of Read Only ([c8c0f34](c8c0f345d7))
* pick list picked-qty for batch item ([32107c4](32107c4a79))
* refactor asset capitilization ([bad3b33](bad3b330f4))
* searchfields as per customize form not working for Item ([f167abb](f167abbbfd))
* show `Make Purchase Invoice` button based on permission ([fd86876](fd86876a0e))
* supplied items added twice in Stock Entry ([d91ac5e](d91ac5e549))
* test_scrap_asset ([fd232d1](fd232d1db7))
* typo in sales_register's filter mode_of_payment (backport [#32371](https://github.com/frappe/erpnext/issues/32371)) ([#32446](https://github.com/frappe/erpnext/issues/32446)) ([1918b5c](1918b5c4b0))
* update with new Frappe color. fix [#32455](https://github.com/frappe/erpnext/issues/32455) ([#32456](https://github.com/frappe/erpnext/issues/32456)) ([3e7582f](3e7582f55b))

### Reverts

* Revert "fix: fetch swift_number in payment_request" ([d3c151f](d3c151f32b))
2022-10-04 12:13:08 +00:00
Deepesh Garg
90607becb8 Merge pull request #32493 from frappe/version-14-hotfix
chore: release v14
2022-10-04 17:41:32 +05:30
mergify[bot]
d6888bc8c8 refactor(UI): clean up portal pages (backport #29018) (#32489)
refactor(UI): clean up portal pages (#29018)

* refactor: list view for portal pages

* refactor: add align center class

* refactor: change footer btn class(primary)

* refactor: add order style page

* refactor: import order page in website

* refactor: remove table elements

* fix: preview image height

* fix: make string translatable

* refactor: change font variables

* refactor: order preview bg white

* refactor: center align items

* fix: breadcrumb padding

* refactor: make preview image rounded

* refactor: add condition for image container

* refactor: change alignment for mobile view

* fix: make footer button secondary

* refactor: clean code

* refactor: code indentantion

* refactor: remove space

* fix: Payment section cleanup

Co-authored-by: Summayya <frappe@Summayyas-MacBook-Air.local>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit da43a5e371)

Co-authored-by: Summayya Hashmani <58825865+sumaiya2908@users.noreply.github.com>
2022-10-04 10:21:50 +05:30
rohitwaghchaure
063f206b9b Merge pull request #32469 from frappe/mergify/bp/version-14-hotfix/pr-32466
fix: not able to return sold expired batches (backport #32466)
2022-10-04 07:34:09 +05:30
mergify[bot]
7a8038500d fix: (bulk transaction) key error and better error logging (backport #32445) (#32463)
fix: (bulk transaction) key error and better error logging (#32445)

* fix: (bulk transaction) key error and better error logging

* chore: pre-commit

* chore: linter - missing comma

(cherry picked from commit 91055151ce)

Co-authored-by: Dany Robert <danyrt@wahni.com>
2022-10-03 17:45:51 +05:30
mergify[bot]
8851826a57 fix: fixes query builder order by issue in postgres (backport #32441) (#32465)
fix: fixes query builder order by issue in postgres (#32441)

* fix: fixes query builder order by issue in postgres

* fix: linter

(cherry picked from commit 69efd2ee24)

Co-authored-by: Shridhar Patil <shridhar.p@zerodha.com>
2022-10-03 16:25:23 +05:30
Sagar Sharma
2a82f16680 Merge pull request #32473 from frappe/mergify/bp/version-14-hotfix/pr-32472
fix: pick list picked-qty for batch item (backport #32472)
2022-10-03 15:24:14 +05:30
Sagar Sharma
32107c4a79 fix: pick list picked-qty for batch item
(cherry picked from commit ba02209f1d)
2022-10-03 09:16:37 +00:00
Deepesh Garg
bbc7559380 Merge pull request #32468 from frappe/mergify/bp/version-14-hotfix/pr-32394
fix: fetch swift number in payment request from bank doctype (backport #32394)
2022-10-03 14:29:06 +05:30
Rohit Waghchaure
9c56a5ff7c fix: not able to return sold expired batches
(cherry picked from commit 0b1727cf79)
2022-10-03 07:45:46 +00:00
Maharshi Patel
c8c0f345d7 fix: payment request make bank field Link instead of Read Only
(cherry picked from commit dc8d49260c)
2022-10-03 07:26:38 +00:00
Maharshi Patel
d3c151f32b Revert "fix: fetch swift_number in payment_request"
This reverts commit f42a8e4e03.

(cherry picked from commit 9245d3b5cd)
2022-10-03 07:26:38 +00:00
Maharshi Patel
f09222a9e5 fix: fetch swift_number in payment_request
There isn't direct link between payment_request and bank so swift_number wasn't fetched using Fetch form. I fixed it by fetching swift_number on_change of bank_account.

(cherry picked from commit f42a8e4e03)
2022-10-03 07:26:38 +00:00
Deepesh Garg
ba80ba07f1 Merge pull request #32461 from frappe/mergify/bp/version-14-hotfix/pr-32456
fix: update with new Frappe color. fix #32455 (backport #32456)
2022-10-03 09:14:57 +05:30
Deepesh Garg
34845b7630 Merge pull request #32459 from frappe/mergify/bp/version-14-hotfix/pr-32454
fix: test_scrap_asset not working on end of month (backport #32454)
2022-10-03 09:04:01 +05:30
Deepesh Garg
ecfa64f22e Merge pull request #32460 from AnandBaburajan/fix_asset_sold_status_v14
fix: status of assets with maintenance_required changing back to 'Partially Depreciated' some time after being sold (backport #32405)
2022-10-03 08:58:40 +05:30
Muvuk
3e7582f55b fix: update with new Frappe color. fix #32455 (#32456)
* Update with new Frappe color.

* refactor: use css variables

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit 73e5a7d671)
2022-10-02 17:02:02 +00:00
Anand Baburajan
6f571218bf Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32454 2022-10-02 19:14:00 +05:30
Anand Baburajan
8ab2f2f925 Merge branch 'version-14-hotfix' into fix_asset_sold_status_v14 2022-10-02 18:31:04 +05:30
Deepesh Garg
2d34761057 Merge pull request #32429 from frappe/mergify/bp/version-14-hotfix/pr-32420
patch: Create accounting dimension fields in asset capitalization (backport #32420)
2022-10-02 18:28:06 +05:30
anandbaburajan
c0a141bfcd fix: asset requiring maintenance sold status and added test [v14-hotfix] 2022-10-02 18:27:37 +05:30
anandbaburajan
fd232d1db7 fix: test_scrap_asset
(cherry picked from commit 47bd4be71b)
2022-10-02 12:15:55 +00:00
Deepesh Garg
df9147f2e5 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32420 2022-10-02 17:45:30 +05:30
Sagar Sharma
8e68219c5b Merge pull request #32440 from frappe/mergify/bp/version-14-hotfix/pr-32428
fix: don't allow to update `Maintain Stock` if the item has a `BOM` (backport #32428)
2022-10-02 12:07:28 +05:30
Sagar Sharma
060ce45572 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32428 2022-10-01 14:32:18 +05:30
Sagar Sharma
432da7d1d1 Merge pull request #32444 from frappe/mergify/bp/version-14-hotfix/pr-32439
fix: add non-stock item filter for `fg_item` in PO (backport #32439)
2022-10-01 14:32:02 +05:30
Sagar Sharma
9318d9a7fc Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32439 2022-10-01 14:31:49 +05:30
Deepesh Garg
faca06d6c3 Merge pull request #32433 from frappe/mergify/bp/version-14-hotfix/pr-32368
chore: remove discount accounting logic from PI and PI Item (backport #32368)
2022-10-01 12:05:10 +05:30
mergify[bot]
1918b5c4b0 fix: typo in sales_register's filter mode_of_payment (backport #32371) (#32446)
fix: typo in sales_register's filter mode_of_payment (#32371)
2022-10-01 12:04:16 +05:30
Deepesh Garg
444f3b5397 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32368 2022-10-01 11:10:03 +05:30
Deepesh Garg
3736f4ecb8 Merge pull request #32430 from frappe/mergify/bp/version-14-hotfix/pr-32402
fix: Item details fetching on making transaction from item dashboard (backport #32402)
2022-10-01 11:03:08 +05:30
Deepesh Garg
5fe2079dcc Merge pull request #32434 from frappe/mergify/bp/version-14-hotfix/pr-32412
fix: Incorrect TCS amount deducted in Sales Invoice (backport #32412)
2022-10-01 11:01:28 +05:30
Sagar Sharma
11f92797b9 fix: add non-stock item filter for fg_item in PO
(cherry picked from commit f95ed7dca2)
2022-09-30 18:29:54 +00:00
Sagar Sharma
17996efbc7 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32428 2022-09-30 23:57:49 +05:30
Sagar Sharma
c2bed24c31 Merge pull request #32438 from frappe/mergify/bp/version-14-hotfix/pr-32436
fix: add validation for non-stock item in SCR (backport #32436)
2022-09-30 23:57:30 +05:30
Sagar Sharma
e5d1f59d96 fix: don't allow to update Maintain Stock if the item has a BOM
(cherry picked from commit 6d0842465b)
2022-09-30 13:39:11 +00:00
Sagar Sharma
793fa18225 fix: add validation for non-stock item in SCR
(cherry picked from commit fa2290657a)
2022-09-30 11:23:50 +00:00
Deepesh Garg
f7ec00ef49 chore: Remove print statements
(cherry picked from commit bff3cd9068)
2022-09-30 10:35:58 +00:00
Deepesh Garg
4d51d73797 fix: Incorrect TCS amount deducted in Sales Invoice
(cherry picked from commit 08443c6421)
2022-09-30 10:35:57 +00:00
ruthra kumar
7a096231fb chore: clean up purchase invoice and purchase invoice item
1. remove discount accounting related fields from purchase invoice and
purchase invoice item
2. clean buying settings doctype

(cherry picked from commit 21095502b9)
2022-09-30 10:29:17 +00:00
Deepesh Garg
db60299cf3 fix: Item details fetching on making transaction from item dashboard
(cherry picked from commit 0439e41a44)
2022-09-30 10:27:15 +00:00
Nabin Hait
9ec0d104a5 fix: Create accounting dimension fields in asset capitalization
(cherry picked from commit fe891aa488)
2022-09-30 10:26:33 +00:00
Sagar Sharma
7243089027 Merge pull request #32418 from frappe/mergify/bp/version-14-hotfix/pr-32404
fix(ux): show `Make Purchase Invoice` button based on permission (backport #32404)
2022-09-29 17:16:25 +05:30
rohitwaghchaure
5aa9c4fd07 Merge pull request #32417 from frappe/mergify/bp/version-14-hotfix/pr-32414
fix: searchfields as per customize form not working for Item (backport #32414)
2022-09-29 15:45:10 +05:30
Sagar Sharma
fd86876a0e fix: show Make Purchase Invoice button based on permission
(cherry picked from commit 80080a3d7b)
2022-09-29 09:26:36 +00:00
Rohit Waghchaure
3f0a3b702d test: added test case
(cherry picked from commit 3656f7d06f)
2022-09-29 09:22:44 +00:00
Rohit Waghchaure
f167abbbfd fix: searchfields as per customize form not working for Item
(cherry picked from commit fd889fd29a)
2022-09-29 09:22:44 +00:00
Nabin Hait
5015f38a8d Merge pull request #32398 from frappe/mergify/bp/version-14-hotfix/pr-32226
fix: calculate depreciation properly on asset sale entry and scrap entry (backport #32226)
2022-09-29 12:34:42 +05:30
anandbaburajan
381231257b chore: fix merge conflicts 2022-09-29 11:59:53 +05:30
Anand Baburajan
f4648ed610 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32226 2022-09-28 22:24:03 +05:30
Sagar Sharma
51fcb3c666 Merge pull request #32407 from frappe/mergify/bp/version-14-hotfix/pr-32406
fix: supplied items added twice in Stock Entry (backport #32406)
2022-09-28 21:44:59 +05:30
Sagar Sharma
7b11da2373 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32406 2022-09-28 21:44:50 +05:30
Deepesh Garg
5c0446d9fc Merge pull request #32411 from frappe/mergify/bp/version-14-hotfix/pr-32403
fix: Disbursement Account in patch to update old loans (backport #32403)
2022-09-28 20:14:01 +05:30
Deepesh Garg
097398914e fix: Disbursement Account in patch to update old loans
(cherry picked from commit be623ce8e8)
2022-09-28 14:07:00 +00:00
Sagar Sharma
d91ac5e549 fix: supplied items added twice in Stock Entry
(cherry picked from commit ac7409bbf3)
2022-09-28 12:20:55 +00:00
Frappe PR Bot
9c915ceeb2 chore(release): Bumped to Version 14.2.1
## [14.2.1](https://github.com/frappe/erpnext/compare/v14.2.0...v14.2.1) (2022-09-28)

### Bug Fixes

* `For Quantity` error msg in `Stock Entry` ([4b6e1f4](4b6e1f4892))
* Add return against indexes for POS Invoice ([3abe4a1](3abe4a16af))
* Add return against indexes for POS Invoice ([32ad36a](32ad36ad0f))
* Add strings to translate function ([2eeff8a](2eeff8a00b))
* add translate function to strings ([f5a3f8b](f5a3f8b486))
* add translate function to strings ([e464de3](e464de3c5d))
* allow to return expired batches using purchase return ([305eb02](305eb02bfc))
* consider overproduction percentage for WO finish button ([4a29c7f](4a29c7fafb))
* difference amount calculation on payment reconciliation ([b389740](b3897406b0))
* get amount in words for debit note ([7554ac9](7554ac9569))
* item_code key error in production plan ([4e31448](4e31448e3d))
* Move subscription process to hourly long quque ([b2f280d](b2f280dee6))
* opening entry causing discepancy between stock and trial balance ([2fd0291](2fd0291afb))
* POS only validate QTY if is_stock_item ([29c4a32](29c4a32c33))
* POS properly validate stock for bundle products ([6b55a01](6b55a01834))
* Reduce font size for Process Statement of accounts print/pdf ([bcfa9b8](bcfa9b8593))
* report chart field type ([931aa62](931aa62072))
* Scrap Asset Accounting Dimensions (backport [#31949](https://github.com/frappe/erpnext/issues/31949)) ([#32376](https://github.com/frappe/erpnext/issues/32376)) ([a28ae4d](a28ae4d653))
* total value in all keys ([24234d5](24234d584d))
* typo on opportunity summary by sales stage report ([a403e72](a403e729d6))
2022-09-28 09:49:04 +00:00
Deepesh Garg
4b8dd1fab6 Merge pull request #32375 from frappe/version-14-hotfix
chore: release v14
2022-09-28 15:17:26 +05:30
Deepesh Garg
fc581464b8 Merge pull request #32396 from frappe/mergify/bp/version-14-hotfix/pr-32379
fix: POS only validate QTY if is_stock_item (backport #32379)
2022-09-28 14:47:41 +05:30
anandbaburajan
b3b7650ac8 chore: add blank lines
(cherry picked from commit c6a7de0e54)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py
2022-09-28 08:59:43 +00:00
anandbaburajan
86052450a5 fix: fix restore asset value after depreciation
(cherry picked from commit 43a3400221)
2022-09-28 08:59:42 +00:00
anandbaburajan
bad3b330f4 fix: refactor asset capitilization
(cherry picked from commit 5a8b28c194)
2022-09-28 08:59:42 +00:00
anandbaburajan
671033755f fix: asset tests
(cherry picked from commit 11ac20e5ee)
2022-09-28 08:59:41 +00:00
anandbaburajan
f5f13c4611 fix: calculate depreciation properly on asset sale entry and scrap entry
(cherry picked from commit ff5cad1cd6)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py
2022-09-28 08:59:41 +00:00
Maharshi Patel
6b55a01834 fix: POS properly validate stock for bundle products
Stock availability was not calculated properly for Product Bundle with non stock item so i have added logic to properly calculate that as well.

(cherry picked from commit e392ea1104)
2022-09-28 08:16:23 +00:00
Maharshi Patel
29c4a32c33 fix: POS only validate QTY if is_stock_item
POS invoice raised " Item not available " validation error even though item is non_stock.

(cherry picked from commit e39e088f18)
2022-09-28 08:16:22 +00:00
Deepesh Garg
c9c203a5eb Merge pull request #32383 from frappe/mergify/bp/version-14-hotfix/pr-32378
fix: Add return against indexes for POS Invoice (backport #32378)
2022-09-28 10:54:44 +05:30
Deepesh Garg
261aac8e26 Merge pull request #32387 from frappe/mergify/bp/version-14-hotfix/pr-32382
fix: Move subscription process to hourly long queue (backport #32382)
2022-09-28 08:09:26 +05:30
Deepesh Garg
b2f280dee6 fix: Move subscription process to hourly long quque
(cherry picked from commit 82a2f31ada)
2022-09-27 18:09:50 +00:00
Deepesh Garg
3abe4a16af fix: Add return against indexes for POS Invoice
(cherry picked from commit cbfe28286a)
2022-09-27 16:52:39 +00:00
Deepesh Garg
32ad36ad0f fix: Add return against indexes for POS Invoice
(cherry picked from commit 1f6205e1ea)
2022-09-27 16:52:38 +00:00
Sagar Sharma
e98c0ab924 Merge pull request #32380 from frappe/mergify/bp/version-14-hotfix/pr-32377
fix: consider overproduction percentage for WO finish button (backport #32377)
2022-09-27 20:18:25 +05:30
Sagar Sharma
4a29c7fafb fix: consider overproduction percentage for WO finish button
(cherry picked from commit 05392e0918)
2022-09-27 12:15:20 +00:00
Sagar Sharma
4b6e1f4892 fix: For Quantity error msg in Stock Entry
(cherry picked from commit 9049db41ae)
2022-09-27 12:15:19 +00:00
mergify[bot]
a28ae4d653 fix: Scrap Asset Accounting Dimensions (backport #31949) (#32376)
fix: Scrap Asset Accounting Dimensions (#31949)

* fix: Scrap Asset Accounting Dimensions

(cherry picked from commit c760ca2323)

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
2022-09-27 17:07:38 +05:30
rohitwaghchaure
11be30d68e Merge pull request #32372 from frappe/mergify/bp/version-14-hotfix/pr-32370
fix: Not allowing to return expired batches using purchase return (backport #32370)
2022-09-27 14:58:51 +05:30
Rohit Waghchaure
305eb02bfc fix: allow to return expired batches using purchase return
(cherry picked from commit a4a86ee23f)
2022-09-27 08:51:01 +00:00
rohitwaghchaure
1184fa3313 Merge pull request #32365 from frappe/mergify/bp/version-14-hotfix/pr-32339
fix: opening entry causing discrepancy between stock and trial balance (backport #32339)
2022-09-27 10:56:04 +05:30
Rohit Waghchaure
2fd0291afb fix: opening entry causing discepancy between stock and trial balance
(cherry picked from commit bc3ab45af2)
2022-09-26 15:03:25 +00:00
rohitwaghchaure
959fdcd841 Merge pull request #32364 from frappe/mergify/bp/version-14-hotfix/pr-32049
Allow Item Templates in Work Order Items (backport #32049)
2022-09-26 20:33:21 +05:30
Dhananjay Palshikar
a83e36b801 Allow Item Templates in Work Order Items
Item Variants can be a part of the items tables, however, when BOM items are fetched to be a part of the Work Order items, item variants were being filtered out.
The filtering out does not serve a purpose. Having Item variants in BOMs allows for template like behaviour.

(cherry picked from commit 75396c02d2)
2022-09-26 14:58:05 +00:00
rohitwaghchaure
37d0721f36 Merge pull request #32359 from frappe/mergify/bp/version-14-hotfix/pr-32347
refactor: rewrite `Incorrect Stock Value Report` queries in `QB` (backport #32347)
2022-09-26 20:24:58 +05:30
Deepesh Garg
408f2bda82 Merge pull request #32361 from frappe/mergify/bp/version-14-hotfix/pr-32146
fix: report chart fieldtype (backport #32146)
2022-09-26 18:36:33 +05:30
Deepesh Garg
ddf4d02c7d Merge pull request #32356 from frappe/mergify/bp/version-14-hotfix/pr-32276
fix: add some strings to translate function (backport #32276)
2022-09-26 18:33:32 +05:30
Sagar Sharma
2f5276b794 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32347 2022-09-26 18:18:29 +05:30
Sagar Sharma
e708a33684 Merge pull request #32357 from frappe/mergify/bp/version-14-hotfix/pr-32346
refactor: rewrite `Item Price Stock Report` queries in `QB` (backport #32346)
2022-09-26 18:18:12 +05:30
hendrik
931aa62072 fix: report chart field type
* fix: report chart field type

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit f41d1500b0)
2022-09-26 12:18:17 +00:00
Sagar Sharma
8c6ddb6721 refactor: rewrite Incorrect Stock Value Report queries in QB
(cherry picked from commit b93331e844)
2022-09-26 11:40:00 +00:00
Sagar Sharma
f1d774034c refactor: rewrite Item Price Stock Report queries in QB
(cherry picked from commit 22299d2382)
2022-09-26 11:39:04 +00:00
Deepesh Garg
4a1de87822 Merge pull request #32354 from frappe/mergify/bp/version-14-hotfix/pr-32336
fix: typo on opportunity summary by sales stage report (backport #32336)
2022-09-26 16:58:58 +05:30
Ernesto Ruiz
f5a3f8b486 fix: add translate function to strings
(cherry picked from commit 94199b7867)
2022-09-26 11:09:49 +00:00
Ernesto Ruiz
e464de3c5d fix: add translate function to strings
(cherry picked from commit aa49ec815a)
2022-09-26 11:09:48 +00:00
Ernesto Ruiz
2eeff8a00b fix: Add strings to translate function
(cherry picked from commit 9decebe6e1)
2022-09-26 11:09:48 +00:00
Ernesto Ruiz
a403e729d6 fix: typo on opportunity summary by sales stage report
(cherry picked from commit c4919cf5ec)
2022-09-26 11:08:18 +00:00
ruthra kumar
1c32bf23d7 Merge pull request #32351 from frappe/mergify/bp/version-14-hotfix/pr-32310
fix: total value in all keys (backport #32310)
2022-09-26 12:05:20 +05:30
Ankush Menat
e599b61ac5 chore: drop 1 runner from stable branch 2022-09-26 11:37:14 +05:30
nishibakabeer
24234d584d fix: total value in all keys
Gross and net profit report showing wrong values in monthly quarterly and half yearly filters which is the total value
@ruthra-kumar added in develop branch as suggested ( https://github.com/frappe/erpnext/pull/32020)

(cherry picked from commit 6919f389aa)
2022-09-26 06:03:33 +00:00
ruthra kumar
a69881e8e5 Merge pull request #32349 from frappe/mergify/bp/version-14-hotfix/pr-32303
fix: difference amount calculation and popup on payment reconciliation (backport #32303)
2022-09-26 11:15:43 +05:30
ruthra kumar
b3897406b0 fix: difference amount calculation on payment reconciliation
(cherry picked from commit 122d5f2729)
2022-09-26 04:57:57 +00:00
Deepesh Garg
0136d58d59 Merge pull request #32334 from frappe/mergify/bp/version-14-hotfix/pr-32117
fix: Reduce font size for Process Statement of accounts print/pdf (backport #32117)
2022-09-25 17:21:10 +05:30
Sagar Sharma
3a74ac9194 Merge pull request #32337 from frappe/mergify/bp/version-14-hotfix/pr-32324
refactor: rewrite `Production Planning Report` queries in `QB` (backport #32324)
2022-09-23 10:37:54 +05:30
Sagar Sharma
21a4556f99 refactor: rewrite Production Planning Report queries in QB
(cherry picked from commit 8417b9b99c)
2022-09-23 04:20:22 +00:00
Deepesh Garg
bcfa9b8593 fix: Reduce font size for Process Statement of accounts print/pdf
(cherry picked from commit 6bfd193b0d)
2022-09-22 19:39:17 +00:00
Sagar Sharma
f2dd547451 Merge pull request #32327 from s-aga-r/backport/v14-h/32309
fix: item_code key error in production plan (backport #32309)
2022-09-22 18:32:21 +05:30
Rohit Waghchaure
4e31448e3d fix: item_code key error in production plan 2022-09-22 18:07:20 +05:30
Sagar Sharma
d5d31060c4 Merge pull request #32317 from s-aga-r/backport/v14-h/32304
refactor: rewrite `Exponential Smoothing Forecasting` queries in `QB` (backport #32304)
2022-09-22 01:32:10 +05:30
Sagar Sharma
f5c517d08d refactor: rewrite Exponential Smoothing Forecasting queries in QB 2022-09-21 21:31:37 +05:30
Deepesh Garg
8d5131ef8f Merge pull request #32300 from frappe/mergify/bp/version-14-hotfix/pr-32296
fix: get amount in words for debit note (backport #32296)
2022-09-21 13:07:25 +05:30
Sagar Sharma
0e7c0144cb Merge pull request #32306 from s-aga-r/backport/14/refactor/report/exponential-smoothing-forecasting
refactor: rewrite `BOM Variance Report` queries in `QB` (backport #32297)
2022-09-21 11:51:22 +05:30
Sagar Sharma
d54bf6d91c refactor: rewrite BOM Variance Report queries in QB 2022-09-21 11:16:45 +05:30
Frappe PR Bot
c50d6c5e74 chore(release): Bumped to Version 14.2.0
# [14.2.0](https://github.com/frappe/erpnext/compare/v14.1.2...v14.2.0) (2022-09-20)

### Bug Fixes

* `po_detail` or `sco_rm_detail` not getting set while while mapping SE ([ff210c7](ff210c73eb))
* `sco_rm_detail` in Stock Entry ([a15f0d4](a15f0d427c))
* abbreviation issue on renaming cost center ([f752822](f752822bb3))
* Add child table for tax withheld vouchers ([e807662](e8076629fa))
* always set default expense account in company ([3b79e24](3b79e24c7e))
* **Asset Capitalization:** Hide source items section if table is empty ([003cfe2](003cfe2717))
* **Asset Capitalization:** Reverse depreciation on cancel ([85d1a23](85d1a237ce))
* **Asset Capitalization:** update code for changes in depreciation logic ([dc3c27f](dc3c27fd1b))
* **Asset Capitalization:** validation edge cases ([c311b8e](c311b8ea4f))
* **Asset Captalization:** run_serially on posting_date changed ([132b517](132b517584))
* **Asset:** On Depreciation reversal, remove Journal Entry reference ([e832944](e832944dfe))
* consider posting time for internal transfer PO ([f370c7b](f370c7b50b))
* correct sql output format in CRM patch (backport [#32213](https://github.com/frappe/erpnext/issues/32213)) ([#32215](https://github.com/frappe/erpnext/issues/32215)) ([64aad88](64aad88684))
* create dunning from sales invoice ([17ea6cc](17ea6cc5a5))
* Depreciation posting date only when calculate depreciation is checked ([4939153](4939153f8c))
* disable cwip in asset repair tests ([5cab0aa](5cab0aa1d7))
* fetch description only if empty on the payment schedule ([8876631](887663129e))
* Fetch vouchers to show in Invoice ([f759c29](f759c29d55))
* incorrect gl if tax on multi currency payment entry ([dcfc11d](dcfc11df7a))
* make `po_detail` or `sco_rm_detail` mandatory for SE `Send to Subcontractor` ([908944b](908944b68b))
* merge conflict ([cd613c6](cd613c6033))
* No permission to read doctype ([442f54a](442f54a988))
* Parent Level project linkning on creating PO from project ([cbaffb4](cbaffb4858))
* pending accrual entries ([b9a2499](b9a249918a))
* production plan pending-qty ([5f3caf6](5f3caf6975))
* remove no_copy for ignore_pricing_rule ([c000319](c0003195b8))
* suggestion threshold label and rule was not working for other items with min and max amount ([436b7e3](436b7e3b70))
* TDS deduction via journal entry ([eba46da](eba46dae6c))
* test cases ([f126e88](f126e88e5e))
* test cases ([153ef5f](153ef5f164))
* unknown column error while updating value of maintain-stock in item master ([38488c1](38488c13e6))
* use default supplier currency if default supplier is enabled ([c98413c](c98413c981))
* warehouse filter in `BOM Stock Calculated Report` ([ed9a896](ed9a896f72))

### Features

* Asset Capitalization ([38c3107](38c31077c9))
* Asset Capitalization Form ([6c74896](6c748966e7))
* **Asset Capitalization:** Accounting Fields ([702b5c3](702b5c32c1))
* **Asset Capitalization:** Finance Book field in Asset Row ([3b9bc8e](3b9bc8e4ef))
* **Asset Capitalization:** Submission and Cancellation ([7a5d75b](7a5d75b68d))
2022-09-20 18:31:07 +00:00
Deepesh Garg
08daa237f2 Merge pull request #32292 from frappe/version-14-hotfix
chore: release v14
2022-09-20 23:59:35 +05:30
Sagar Sharma
85cda4a995 Merge pull request #32301 from frappe/mergify/bp/version-14-hotfix/pr-32295
refactor: rewrite `BOM Stock Report` queries in `QB` (backport #32295)
2022-09-20 23:09:25 +05:30
Sagar Sharma
ed9a896f72 fix: warehouse filter in BOM Stock Calculated Report
(cherry picked from commit 390ce5719d)
2022-09-20 17:37:19 +00:00
Sagar Sharma
181dccd8d8 refactor: rewrite BOM Stock Report queries in QB
(cherry picked from commit 8fd7c04920)
2022-09-20 17:37:18 +00:00
ruthra kumar
7554ac9569 fix: get amount in words for debit note
(cherry picked from commit 70f6484d9d)
2022-09-20 12:44:03 +00:00
Deepesh Garg
fcd46aa243 Merge pull request #32294 from frappe/mergify/bp/version-14-hotfix/pr-32284
fix: remove no_copy for ignore_pricing_rule (backport #32284)
2022-09-20 17:16:12 +05:30
Deepesh Garg
d62b983057 chore: Resolve conflicts 2022-09-20 16:45:23 +05:30
Deepesh Garg
b0131a8a80 Merge pull request #32288 from frappe/mergify/bp/version-14-hotfix/pr-32204
fix(UX): More predictable tax withholding application in invoices (backport #32204)
2022-09-20 16:38:44 +05:30
Maharshi Patel
c0003195b8 fix: remove no_copy for ignore_pricing_rule
(cherry picked from commit 8c5b420aea)
2022-09-20 10:50:22 +00:00
Deepesh Garg
957fc440fd Merge pull request #32290 from frappe/mergify/bp/version-14-hotfix/pr-32264
fix: Depreciation posting date only when calculate depreciation is checked (backport #32264)
2022-09-20 15:00:19 +05:30
Deepesh Garg
4939153f8c fix: Depreciation posting date only when calculate depreciation is checked
(cherry picked from commit fac82cf69b)
2022-09-20 09:18:22 +00:00
Deepesh Garg
302f2d10e2 chore: fix tests
(cherry picked from commit 9aa1f84d45)
2022-09-20 09:06:40 +00:00
Deepesh Garg
eba46dae6c fix: TDS deduction via journal entry
(cherry picked from commit 36d0906ea2)
2022-09-20 09:06:40 +00:00
Deepesh Garg
27fdd41a6e test: Add tests
(cherry picked from commit b6184ce471)
2022-09-20 09:06:40 +00:00
Deepesh Garg
f759c29d55 fix: Fetch vouchers to show in Invoice
(cherry picked from commit 3fb1595a4e)
2022-09-20 09:06:40 +00:00
Deepesh Garg
e8076629fa fix: Add child table for tax withheld vouchers
(cherry picked from commit 246c1a9380)
2022-09-20 09:06:39 +00:00
Sagar Sharma
77678ecfeb Merge pull request #32285 from frappe/mergify/bp/version-14-hotfix/pr-32280
refactor: rewrite `Item Shortage Report` queries in QB (backport #32280)
2022-09-20 11:43:55 +05:30
Sagar Sharma
273ed40cfb test: add test cases for Item Shortage Report
(cherry picked from commit 3dc754cac2)
2022-09-20 05:45:04 +00:00
Sagar Sharma
a56b5ed8e5 refactor: rewrite Item Shortage Report queries in QB
(cherry picked from commit f0a78aa559)
2022-09-20 05:45:03 +00:00
ruthra kumar
d7d75be0d7 Merge pull request #32283 from frappe/mergify/bp/version-14-hotfix/pr-32217
fix: incorrect gl if tax on multi currency payment entry (backport #32217)
2022-09-20 11:10:25 +05:30
ruthra kumar
5ba5b7bf51 test: gl entries of payments with advance tax
(cherry picked from commit 5bd5dd7262)
2022-09-20 04:31:10 +00:00
ruthra kumar
dcfc11df7a fix: incorrect gl if tax on multi currency payment entry
(cherry picked from commit f0ae77b23b)
2022-09-20 04:31:10 +00:00
Deepesh Garg
f14b577766 Merge pull request #32278 from frappe/mergify/bp/version-14-hotfix/pr-32235
fix: fetch description only if empty on the payment schedule (backport #32235)
2022-09-20 09:54:17 +05:30
Maharshi Patel
887663129e fix: fetch description only if empty on the payment schedule
added fetch_if_empty on description field of payment_schedule.

(cherry picked from commit f4b64686ae)
2022-09-20 03:44:29 +00:00
Sagar Sharma
327256a516 Merge pull request #32275 from frappe/mergify/bp/version-14-hotfix/pr-32274
fix: `po_detail` or `sco_rm_detail` not getting set while while mapping SE (backport #32274)
2022-09-19 19:46:43 +05:30
Sagar Sharma
ff210c73eb fix: po_detail or sco_rm_detail not getting set while while mapping SE
(cherry picked from commit 3a9c08e7c9)
2022-09-19 13:49:43 +00:00
ruthra kumar
a85dd86832 Merge pull request #32270 from frappe/mergify/bp/version-14-hotfix/pr-32251
fix: use default supplier currency if default supplier is enabled (backport #32251)
2022-09-19 14:04:16 +05:30
ruthra kumar
c98413c981 fix: use default supplier currency if default supplier is enabled
(cherry picked from commit 77fdc37cb7)
2022-09-19 07:33:18 +00:00
Deepesh Garg
198d19b920 Merge pull request #32246 from frappe/mergify/bp/version-14-hotfix/pr-32238
fix: suggestion threshold label and rule was not working for other item with min and max amount (backport #32238)
2022-09-19 10:10:55 +05:30
Deepesh Garg
5a2e286de6 Merge pull request #32255 from frappe/mergify/bp/version-14-hotfix/pr-32244
fix: Parent Level project linkning on creating PO from project (backport #32244)
2022-09-18 19:41:45 +05:30
Sagar Sharma
24ccebc633 Merge pull request #32260 from frappe/mergify/bp/version-14-hotfix/pr-32250
fix: make `po_detail` or `sco_rm_detail` mandatory for SE Send to Subcontractor (backport #32250)
2022-09-18 15:58:48 +05:30
Sagar Sharma
908944b68b fix: make po_detail or sco_rm_detail mandatory for SE Send to Subcontractor
(cherry picked from commit b90875575c)
2022-09-18 09:24:48 +00:00
Deepesh Garg
cbaffb4858 fix: Parent Level project linkning on creating PO from project
(cherry picked from commit 93e134aab0)
2022-09-17 15:00:33 +00:00
Sagar Sharma
7dcb8bb674 Merge pull request #32248 from frappe/mergify/bp/version-14-hotfix/pr-32247
fix: add SCO supplied item reference while mapping the Stock Entry (backport #32247)
2022-09-17 16:09:15 +05:30
Sagar Sharma
a15f0d427c fix: sco_rm_detail in Stock Entry
(cherry picked from commit 2f97370b8e)
2022-09-17 10:12:48 +00:00
Rohit Waghchaure
436b7e3b70 fix: suggestion threshold label and rule was not working for other items with min and max amount
(cherry picked from commit f5bd3fa952)
2022-09-17 06:42:22 +00:00
Sagar Sharma
075d456417 Merge pull request #32240 from frappe/mergify/bp/version-14-hotfix/pr-32236
fix: production plan pending-qty (backport #32236)
2022-09-16 21:31:57 +05:30
Sagar Sharma
ff78906361 test: update test case for production plan pending-qty
(cherry picked from commit bd6af7c613)
2022-09-16 13:00:32 +00:00
Sagar Sharma
5f3caf6975 fix: production plan pending-qty
(cherry picked from commit 5be7d42dfd)
2022-09-16 13:00:31 +00:00
Sagar Sharma
5c09b28d62 Merge pull request #32234 from frappe/mergify/bp/version-14-hotfix/pr-32233
refactor: rewrite Production Plan queries in QB (backport #32233)
2022-09-16 13:57:26 +05:30
Sagar Sharma
b700a0be1f refactor: rewrite Production Plan queries in QB
(cherry picked from commit b8cf3b4c77)
2022-09-16 08:00:08 +00:00
Nabin Hait
cceadcec33 Merge pull request #32231 from frappe/mergify/bp/version-14-hotfix/pr-32225
fix: create dunning from sales invoice (backport #32225)
2022-09-16 13:06:45 +05:30
Nabin Hait
22372e69eb Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32225 2022-09-16 12:17:14 +05:30
Nabin Hait
88c446b0bf Merge pull request #32232 from nabinhait/asset-repair-test-fix1
fix: disable cwip in asset repair tests
2022-09-16 12:17:01 +05:30
Nabin Hait
5cab0aa1d7 fix: disable cwip in asset repair tests 2022-09-16 11:44:25 +05:30
Nabin Hait
569b4c256a Merge pull request #32230 from frappe/mergify/bp/version-14-hotfix/pr-32219
fix: No permission to read doctype (backport #32219)
2022-09-16 11:37:09 +05:30
Nabin Hait
17ea6cc5a5 fix: create dunning from sales invoice
(cherry picked from commit 29db084dc3)
2022-09-16 05:35:51 +00:00
Nabin Hait
442f54a988 fix: No permission to read doctype
(cherry picked from commit c0da948a4e)
2022-09-16 05:35:29 +00:00
Deepesh Garg
c07e61953a Merge pull request #32228 from frappe/mergify/bp/version-14-hotfix/pr-32222
fix: abbreviation issue on renaming cost center (backport #32222)
2022-09-16 11:03:14 +05:30
Nabin Hait
2102b83bd9 Merge pull request #32229 from frappe/mergify/bp/version-14-hotfix/pr-32221
fix: consider posting time for internal transfer PO (backport #32221)
2022-09-16 09:39:33 +05:30
Rohit Waghchaure
f370c7b50b fix: consider posting time for internal transfer PO
(cherry picked from commit cb763938dc)
2022-09-16 04:08:04 +00:00
Nabin Hait
f752822bb3 fix: abbreviation issue on renaming cost center
(cherry picked from commit af21a11e1e)
2022-09-16 04:07:44 +00:00
Nabin Hait
af5fb78fe2 Merge pull request #32201 from nabinhait/SaiFi0102-asset-capitalization-v14
feat: Asset Capitalization
2022-09-16 09:34:52 +05:30
Sagar Sharma
85cf30cfa8 Merge branch 'version-14-hotfix' into SaiFi0102-asset-capitalization-v14 2022-09-15 08:17:37 +05:30
Frappe PR Bot
14e5f239ac chore(release): Bumped to Version 14.1.2
## [14.1.2](https://github.com/frappe/erpnext/compare/v14.1.1...v14.1.2) (2022-09-14)

### Bug Fixes

* correct sql output format in CRM patch (backport [#32213](https://github.com/frappe/erpnext/issues/32213)) ([#32214](https://github.com/frappe/erpnext/issues/32214)) ([fed2353](fed23536dc))
2022-09-14 13:52:36 +00:00
mergify[bot]
64aad88684 fix: correct sql output format in CRM patch (backport #32213) (#32215)
fix: correct sql output format in CRM patch (#32213)

(cherry picked from commit 97977cdb4b)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-14 19:21:40 +05:30
mergify[bot]
fed23536dc fix: correct sql output format in CRM patch (backport #32213) (#32214)
fix: correct sql output format in CRM patch (#32213)

(cherry picked from commit 97977cdb4b)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-14 19:21:04 +05:30
Nabin Hait
f126e88e5e fix: test cases 2022-09-14 18:31:15 +05:30
Nabin Hait
3f8c701083 Merge branch 'SaiFi0102-asset-capitalization-v14' of https://github.com/nabinhait/erpnext into SaiFi0102-asset-capitalization-v14 2022-09-14 17:21:57 +05:30
Nabin Hait
153ef5f164 fix: test cases 2022-09-14 17:20:19 +05:30
Deepesh Garg
cbdc46b89e Merge pull request #32210 from frappe/mergify/bp/version-14-hotfix/pr-32208
fix: Loans pending accrual entries (backport #32208)
2022-09-14 15:34:22 +05:30
Abhinav Raut
b9a249918a fix: pending accrual entries
(cherry picked from commit f2209045f8)
2022-09-14 08:45:47 +00:00
Nabin Hait
fb99d3f1b9 Merge branch 'version-14-hotfix' into SaiFi0102-asset-capitalization-v14 2022-09-14 12:56:47 +05:30
Nabin Hait
3b79e24c7e fix: always set default expense account in company 2022-09-14 12:55:49 +05:30
Sagar Sharma
97b462538a Merge pull request #32206 from frappe/mergify/bp/version-14-hotfix/pr-32205
fix: unknown column error while updating value of maintain-stock in item master (backport #32205)
2022-09-14 11:09:05 +05:30
Sagar Sharma
2fe72af359 test: add test case for item master maintain-stock
(cherry picked from commit bf1fa014f4)
2022-09-14 02:44:55 +00:00
Sagar Sharma
38488c13e6 fix: unknown column error while updating value of maintain-stock in item master
(cherry picked from commit 7b878ea3d8)
2022-09-14 02:44:54 +00:00
Frappe PR Bot
740c17c231 chore(release): Bumped to Version 14.1.1
## [14.1.1](https://github.com/frappe/erpnext/compare/v14.1.0...v14.1.1) (2022-09-13)

### Bug Fixes

* AD not getting copied from SCO while creating a Material Transfer ([#32109](https://github.com/frappe/erpnext/issues/32109)) ([09d8fa4](09d8fa4b5d)), closes [#32106](https://github.com/frappe/erpnext/issues/32106)
* add missing warehouse filter in BOM Stock Calculated report ([4e09203](4e09203ddc))
* conflict ([a408722](a408722983))
* consider Stock Entry purpose while getting total supplied qty ([5af0062](5af006278e))
* customer code max characters limit issue ([#32177](https://github.com/frappe/erpnext/issues/32177)) ([93e5100](93e510023a))
* delete linked payment ledger entries no source doc deletion ([ccd0449](ccd0449006))
* drop old notes column from lead and prospect ([ded6e7f](ded6e7f544))
* **Employee:** shorter tab titles (backport [#32192](https://github.com/frappe/erpnext/issues/32192)) ([#32193](https://github.com/frappe/erpnext/issues/32193)) ([027e66f](027e66f637))
* hide "Return of Components" button in closed SCO (backport [#32130](https://github.com/frappe/erpnext/issues/32130)) ([#32131](https://github.com/frappe/erpnext/issues/32131)) ([7840fed](7840fed7a5))
* import error on bank statement import ([467ee97](467ee97938))
* internal transfer flow ([4bac0da](4bac0daf9b))
* inventory dimension filter's label not showing in the reort ([2d2eef6](2d2eef6b29))
* item wise sales register taxes and charges ([53f235b](53f235b630))
* Migrate old lead notes as per the new format ([28b1d4e](28b1d4e2a3))
* option to start reposting from repost item valuation ([6483195](64831952d5))
* pick_list - picked qty getting set to 1 ([3c3ab89](3c3ab897d5))
* promotional scheme min and max amount configuration ([702c16e](702c16eac4))
* QR Code multi currency issue ([d14a9a1](d14a9a1e89))
* Rate for internal PI have non stock UOM items ([c06e241](c06e241fbc))
* remove EmployeeBoardingController (backport [#32139](https://github.com/frappe/erpnext/issues/32139)) ([#32191](https://github.com/frappe/erpnext/issues/32191)) ([944b8a0](944b8a0ed7))
* remove multiple call to ple creation ([a2285d5](a2285d5e5e))
* reposting not working for internal transferred purchase receipt ([7ce6729](7ce6729100))
* require barcode item barcode ([#32111](https://github.com/frappe/erpnext/issues/32111)) ([404668f](404668fcc9)), closes [#31957](https://github.com/frappe/erpnext/issues/31957)
* required_qty in BOM Stock Calculated report ([af883be](af883be065))
* SCO Supplied Items returned-qty ([4568648](4568648d8c))
* Set filter condition and spell in AR ([174c750](174c7503c9))
* status filter for Subcontracting Order in Stock Entry ([844f120](844f120a56))
* Subcontracting Receipt GL Entries (backport [#31918](https://github.com/frappe/erpnext/issues/31918)) ([#32124](https://github.com/frappe/erpnext/issues/32124)) ([f2ab220](f2ab220ce3))
* **UX:** make Item attachments public by default (backport [#32196](https://github.com/frappe/erpnext/issues/32196)) ([#32197](https://github.com/frappe/erpnext/issues/32197)) ([2c4867c](2c4867cc98))
* validate Subcontracting Order in Stock Entry ([d3cc9d4](d3cc9d4fa6))

### Performance Improvements

* lesser SQL queries and no validation ([7bb5f6e](7bb5f6eb23))
2022-09-13 12:13:00 +00:00
Deepesh Garg
5f4b214217 Merge pull request #32199 from frappe/version-14-hotfix
chore: release v14
2022-09-13 17:41:02 +05:30
Deepesh Garg
5b04bebc0a Merge pull request #32198 from frappe/mergify/bp/version-14-hotfix/pr-32190
fix: item wise sales register taxes and charges (backport #32190)
2022-09-13 16:30:59 +05:30
Nabin Hait
38c31077c9 feat: Asset Capitalization
- manual selection of entry type
- GLE cleanup with smaller functions
- GLE considering periodical inventory
- test cases
2022-09-13 16:21:06 +05:30
Nabin Hait
cd613c6033 fix: merge conflict 2022-09-13 16:20:42 +05:30
Deepesh Garg
2e1fb5255e Merge pull request #32195 from frappe/mergify/bp/version-14-hotfix/pr-32091
fix: Migrate old lead notes as per the new format (backport #32091)
2022-09-13 14:41:35 +05:30
Deepesh Garg
9fd8fffb28 Merge pull request #32166 from frappe/mergify/bp/version-14-hotfix/pr-32144
fix: Rate for internal PI have non stock UOM items (backport #32144)
2022-09-13 14:40:31 +05:30
Maharshi Patel
53f235b630 fix: item wise sales register taxes and charges
i have added separate column for other charges. Instead of adding all values to tax_total, it checks if account_type is tax, and then only it adds to total_tax otherwise it adds to the total_other_charges.

(cherry picked from commit 62163ab3d3)
2022-09-13 08:26:13 +00:00
mergify[bot]
2c4867cc98 fix(UX): make Item attachments public by default (backport #32196) (#32197)
fix(UX): make Item attachments public by default (#32196)

(cherry picked from commit fffc245922)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-13 13:41:58 +05:30
Deepesh Garg
dda057d257 chore: Resolve conflicts 2022-09-13 13:40:36 +05:30
Nabin Hait
ded6e7f544 fix: drop old notes column from lead and prospect
(cherry picked from commit 4b13452022)
2022-09-13 06:51:27 +00:00
Nabin Hait
7bb5f6eb23 perf: lesser SQL queries and no validation
Co-authored-by: Sagar Vora <sagar@resilient.tech>
(cherry picked from commit 2a100abef1)
2022-09-13 06:51:27 +00:00
Nabin Hait
28b1d4e2a3 fix: Migrate old lead notes as per the new format
(cherry picked from commit 3abd00f3bb)
2022-09-13 06:51:26 +00:00
mergify[bot]
027e66f637 fix(Employee): shorter tab titles (backport #32192) (#32193)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-09-13 10:36:12 +05:30
mergify[bot]
944b8a0ed7 fix: remove EmployeeBoardingController (backport #32139) (#32191)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2022-09-13 09:50:36 +05:30
rohitwaghchaure
95da66a201 Merge pull request #32183 from frappe/mergify/bp/version-14-hotfix/pr-32181
fix: promotional scheme min and max amount configuration (backport #32181)
2022-09-13 08:36:54 +05:30
Sagar Sharma
9fbf507877 Merge pull request #32189 from frappe/mergify/bp/version-14-hotfix/pr-32179
fix: pick_list - picked qty getting set to 1 (backport #32179)
2022-09-12 22:42:58 +05:30
Ahmad
3c3ab897d5 fix: pick_list - picked qty getting set to 1
(cherry picked from commit 3256e2b8b7)
2022-09-12 16:50:28 +00:00
Sagar Sharma
60b914b2a6 Merge pull request #32185 from frappe/mergify/bp/version-14-hotfix/pr-32150
refactor: BOM Stock Calculated report, fix required-qty (backport #32150)
2022-09-12 19:49:01 +05:30
Sagar Sharma
581c5cbc38 test: add test cases for BOM Stock Calculated report
(cherry picked from commit e1a98c1ff7)
2022-09-12 13:52:05 +00:00
Sagar Sharma
4e09203ddc fix: add missing warehouse filter in BOM Stock Calculated report
(cherry picked from commit 7a968a5f0d)
2022-09-12 13:52:05 +00:00
Sagar Sharma
af883be065 fix: required_qty in BOM Stock Calculated report
(cherry picked from commit 56192daabf)
2022-09-12 13:52:05 +00:00
Sagar Sharma
08f5f81fa8 refactor: BOM Stock Calculated report
(cherry picked from commit 723fa9eebc)
2022-09-12 13:52:05 +00:00
Rohit Waghchaure
702c16eac4 fix: promotional scheme min and max amount configuration
(cherry picked from commit a8fd92ddc1)
2022-09-12 13:01:02 +00:00
rohitwaghchaure
82440e3124 Merge pull request #32180 from frappe/mergify/bp/version-14-hotfix/pr-32177
fix: customer code max characters limit issue (backport #32177)
2022-09-12 18:28:39 +05:30
rohitwaghchaure
93e510023a fix: customer code max characters limit issue (#32177)
(cherry picked from commit 8f787c08a2)
2022-09-12 11:19:42 +00:00
ruthra kumar
0bc61b3b16 Merge pull request #32176 from frappe/mergify/bp/version-14-hotfix/pr-32175
fix: Set filter condition and spell in AR (backport #32175)
2022-09-12 16:01:41 +05:30
Nihantra C. Patel
174c7503c9 fix: Set filter condition and spell in AR
(cherry picked from commit e2b4ae13fa)
2022-09-12 09:31:27 +00:00
mergify[bot]
3083b4c218 chore: correct license text for GPLv3 (backport #32170) (#32171)
chore: correct license text for GPLv3 (#32170)

[skip ci]

(cherry picked from commit a30f38481d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-12 13:57:49 +05:30
Deepesh Garg
c06e241fbc fix: Rate for internal PI have non stock UOM items
(cherry picked from commit 0f655e4430)

# Conflicts:
#	erpnext/controllers/buying_controller.py
2022-09-12 03:40:43 +00:00
Sagar Sharma
a9e9dad66a Merge pull request #32162 from frappe/mergify/bp/version-14-hotfix/pr-32161
refactor: rewrite Process Loss Report queries in QB (backport #32161)
2022-09-11 20:06:52 +05:30
Sagar Sharma
86e5f362e3 refactor: rewrite Process Loss Report queries in QB
(cherry picked from commit 5245928648)
2022-09-11 14:18:22 +00:00
ruthra kumar
7cc98181ec Merge pull request #32157 from frappe/mergify/bp/version-14-hotfix/pr-32137
refactor(minor): delete linked payment ledger entries on source doc deletion (backport #32137)
2022-09-11 13:41:12 +05:30
ruthra kumar
1ea778a77b Merge pull request #32158 from frappe/mergify/bp/version-14-hotfix/pr-32156
fix: remove duplicate call to ple creation (backport #32156)
2022-09-11 12:43:45 +05:30
ruthra kumar
a2285d5e5e fix: remove multiple call to ple creation
(cherry picked from commit 4adc372f9a)
2022-09-11 06:51:50 +00:00
ruthra kumar
ccd0449006 fix: delete linked payment ledger entries no source doc deletion
(cherry picked from commit 70313df531)
2022-09-11 06:37:22 +00:00
Sagar Sharma
793ee83f39 Merge pull request #32154 from frappe/mergify/bp/version-14-hotfix/pr-32153
refactor: rewrite Work Order Stock Report queries in QB (backport #32153)
2022-09-10 17:16:44 +05:30
Sagar Sharma
9203217678 refactor: rewrite Work Order Stock Report queries in QB
(cherry picked from commit d4c4dddfc3)
2022-09-10 11:21:27 +00:00
rohitwaghchaure
3c1c50f171 Merge pull request #32141 from frappe/mergify/bp/version-14-hotfix/pr-32135
fix: reposting not working for internal transferred purchase receipt (backport #32135)
2022-09-10 16:40:51 +05:30
rohitwaghchaure
a408722983 fix: conflict 2022-09-09 22:44:10 +05:30
Deepesh Garg
16502b30a0 Merge pull request #32148 from frappe/mergify/bp/version-14-hotfix/pr-32110
fix: error on bank statement import (backport #32110)
2022-09-09 17:16:58 +05:30
Sagar Sharma
61a1b2b42b Merge pull request #32147 from frappe/mergify/bp/version-14-hotfix/pr-32145
fix: validate Subcontracting Order Status in Stock Entry (backport #32145)
2022-09-09 17:06:28 +05:30
ruthra kumar
467ee97938 fix: import error on bank statement import
Name collision between frameworks file importer's internal log and
doctype fieldname - import_log.

Frameworks internal log overrode, doctypes field which caused failure
in basic fieldtype validation.

(cherry picked from commit a6fbb80b94)
2022-09-09 09:31:25 +00:00
Sagar Sharma
d3cc9d4fa6 fix: validate Subcontracting Order in Stock Entry
(cherry picked from commit 9a3dcb9ad1)
2022-09-09 09:26:08 +00:00
Sagar Sharma
844f120a56 fix: status filter for Subcontracting Order in Stock Entry
(cherry picked from commit 30909a9b79)
2022-09-09 09:26:08 +00:00
Sagar Sharma
8be12f0858 Merge pull request #32143 from frappe/mergify/bp/version-14-hotfix/pr-32102
fix: consider Stock Entry purpose while getting total supplied qty (backport #32102)
2022-09-09 12:35:47 +05:30
Sagar Sharma
5af006278e fix: consider Stock Entry purpose while getting total supplied qty
(cherry picked from commit 2f00413864)
2022-09-09 06:44:26 +00:00
Rohit Waghchaure
7ce6729100 fix: reposting not working for internal transferred purchase receipt
(cherry picked from commit a03b4ce213)

# Conflicts:
#	erpnext/stock/stock_ledger.py
2022-09-09 04:01:23 +00:00
Sagar Sharma
c4c43bc550 Merge pull request #32134 from frappe/mergify/bp/version-14-hotfix/pr-32128
fix: SCO Supplied Items returned-qty (backport #32128)
2022-09-08 19:59:23 +05:30
Sagar Sharma
62741bf744 test: add test case for returned-qty
(cherry picked from commit aea7188304)
2022-09-08 13:31:38 +00:00
Sagar Sharma
4568648d8c fix: SCO Supplied Items returned-qty
(cherry picked from commit ccb2889cac)
2022-09-08 13:31:38 +00:00
mergify[bot]
7840fed7a5 fix: hide "Return of Components" button in closed SCO (backport #32130) (#32131)
fix: hide "Return of Components" button in closed SCO (#32130)

(cherry picked from commit 3585daab95)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-09-08 18:25:27 +05:30
Sagar Sharma
f2ab220ce3 fix: Subcontracting Receipt GL Entries (backport #31918) (#32124)
fix: Subcontracting Receipt GL Entries
2022-09-08 11:18:00 +05:30
rohitwaghchaure
9b6dd7e71f Merge pull request #32120 from rohitwaghchaure/backport-provision-to-manual-reposting
fix: option to start reposting from repost item valuation
2022-09-07 18:05:38 +05:30
Rohit Waghchaure
64831952d5 fix: option to start reposting from repost item valuation 2022-09-07 18:04:43 +05:30
rohitwaghchaure
d53fd8c592 Merge pull request #32119 from rohitwaghchaure/backport-fixed-label-not-showing-for-filter
fix: inventory dimension filter's label not showing in the reort
2022-09-07 18:03:51 +05:30
Rohit Waghchaure
2d2eef6b29 fix: inventory dimension filter's label not showing in the reort 2022-09-07 18:02:41 +05:30
rohitwaghchaure
c313c37006 Merge pull request #32114 from rohitwaghchaure/backport-fixed-internal-transfer-flow
fix: backport fixed internal transfer flow
2022-09-07 15:44:01 +05:30
Rohit Waghchaure
a00bc2967e test: added test case for internal transfer 2022-09-07 14:29:21 +05:30
Rohit Waghchaure
4bac0daf9b fix: internal transfer flow 2022-09-07 14:29:15 +05:30
Sagar Sharma
404668fcc9 fix: require barcode item barcode (#32111)
fix: require barcode item barcode. (#31957)

* fix: require barcode item barcode.

* fix: make supplier mandatory in Item Supplier DocType

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2022-09-07 14:24:12 +05:30
Sagar Sharma
09d8fa4b5d fix: AD not getting copied from SCO while creating a Material Transfer (#32109)
fix: AD not getting copied from SCO while creating a Material Transfer (#32106)
2022-09-07 12:42:12 +05:30
Deepesh Garg
354aaae587 Merge pull request #32088 from frappe/mergify/bp/version-14-hotfix/pr-32086
fix: QR Code multi currency issue (backport #32086)
2022-09-07 07:46:41 +05:30
Frappe PR Bot
7235c3f88f chore(release): Bumped to Version 14.1.0
# [14.1.0](https://github.com/frappe/erpnext/compare/v14.0.3...v14.1.0) (2022-09-06)

### Bug Fixes

* **Appointment:** create lead notes as child table ([00a73c7](00a73c7a57))
* fetch from parent not working for custom field ([76ae4d8](76ae4d87ca))
* force delete old report docs (backport [#32026](https://github.com/frappe/erpnext/issues/32026)) ([#32027](https://github.com/frappe/erpnext/issues/32027)) ([0e9a1fb](0e9a1fb40e))
* include payment against PO in AR/AP report ([4bbd0ec](4bbd0ec985))
* incorrect import parameter for cancel PDA ([f55881a](f55881aef8))
* key error on consolidated financial report ([4409f11](4409f11282))
* KSA VAT report multi currency amount issue ([b96526e](b96526eefd))
* Loan Interest accruals for 0 rated loans ([1b9082e](1b9082e07b))
* Naming series in Journal Entry Template ([5520c6b](5520c6b2f3))
* not able to make variant item ([f871dd4](f871dd4ef6))
* **pos:** error while consolidating pos invoices ([319ee41](319ee41403))
* remove spaces and order import ([055556b](055556b7f1))
* upgrade process to version-14 when currency opportunity wass not set ([4cb685a](4cb685a326))
* validate available qty for consumption in SCR ([26536da](26536da74b))

### Features

* better Item Price list view ([#31954](https://github.com/frappe/erpnext/issues/31954)) ([784fb47](784fb47197))
* tabbed view for Employee form ([#31940](https://github.com/frappe/erpnext/issues/31940)) ([#32095](https://github.com/frappe/erpnext/issues/32095)) ([3c688df](3c688dfa6d))
* two new filters for gross profit ([60fa421](60fa421409))
2022-09-06 16:04:45 +00:00
Deepesh Garg
15733c14e8 Merge pull request #32101 from frappe/version-14-hotfix
chore: version-14 weekly release
2022-09-06 21:31:39 +05:30
rohitwaghchaure
22b2386aa1 Merge pull request #32097 from rohitwaghchaure/backport-fixed-fetch-from-parent
fix: fetch from parent
2022-09-06 12:59:37 +05:30
Rohit Waghchaure
6ab0637b0b test: test cases for PI and DN 2022-09-06 11:54:56 +05:30
Rohit Waghchaure
76ae4d87ca fix: fetch from parent not working for custom field 2022-09-06 11:54:48 +05:30
Rucha Mahabal
3c688dfa6d feat: tabbed view for Employee form (#31940) (#32095) 2022-09-06 11:04:13 +05:30
Sagar Sharma
8b8d054ded Merge pull request #32090 from frappe/mergify/bp/version-14-hotfix/pr-32082
fix: validate available qty for consumption in SCR (backport #32082)
2022-09-05 14:49:35 +05:30
Sagar Sharma
121ec83562 refactor(test): test_update_reserved_qty_for_subcontracting
(cherry picked from commit a349b58306)
2022-09-05 08:50:29 +00:00
Sagar Sharma
26536da74b fix: validate available qty for consumption in SCR
(cherry picked from commit 4a7add2169)
2022-09-05 08:50:28 +00:00
Nabin Hait
f605564094 Merge pull request #32087 from frappe/mergify/bp/version-14-hotfix/pr-32061
fix(Appointment): create lead notes as child table (backport #32061)
2022-09-05 12:56:00 +05:30
hamzaali15
d14a9a1e89 fix: QR Code multi currency issue
When try to scan qr code on app it is showing correct values for multi currencies because it is not getting base amount

(cherry picked from commit b10a2b87b6)
2022-09-05 07:13:08 +00:00
Sagar Vora
b7e8fbe43f test: dont create lead manually, add coverage for notes
(cherry picked from commit 875ff15109)
2022-09-05 06:56:48 +00:00
Sagar Vora
00a73c7a57 fix(Appointment): create lead notes as child table
(cherry picked from commit 58e553151e)
2022-09-05 06:56:47 +00:00
Deepesh Garg
edb100274b Merge pull request #32080 from frappe/mergify/bp/version-14-hotfix/pr-31982
fix: upgrade process to version-14 when currency opportunity was not set (backport #31982)
2022-09-04 22:39:01 +05:30
Deepesh Garg
6976316ada chore: fix message
(cherry picked from commit 118b0c0f86)
2022-09-04 13:34:32 +00:00
Florian HENRY
357f74a580 chore: better text
(cherry picked from commit d19b664ba9)
2022-09-04 13:34:32 +00:00
Florian HENRY
aedd0397b8 chore: remove debug
(cherry picked from commit ac66538651)
2022-09-04 13:34:32 +00:00
Florian HENRY
4cb685a326 fix: upgrade process to version-14 when currency opportunity wass not set
(cherry picked from commit 9d02fbadb4)
2022-09-04 13:34:31 +00:00
Deepesh Garg
afcc0cbccd Merge pull request #32079 from frappe/mergify/bp/version-14-hotfix/pr-31954
feat: better Item Price list view (backport #31954)
2022-09-04 18:15:25 +05:30
Deepesh Garg
29bca45b1e Merge pull request #32077 from frappe/mergify/bp/version-14-hotfix/pr-32045
fix: Naming series in Journal Entry Template (backport #32045)
2022-09-04 18:14:56 +05:30
HENRY Florian
784fb47197 feat: better Item Price list view (#31954)
* feat: better Item Price list view

(cherry picked from commit 86395c6adb)
2022-09-04 12:39:04 +00:00
Solufyin
5520c6b2f3 fix: Naming series in Journal Entry Template
(cherry picked from commit 2085626390)
2022-09-04 11:05:07 +00:00
Deepesh Garg
f873547447 Merge pull request #32074 from frappe/mergify/bp/version-14-hotfix/pr-31850
feat: two new filters for gross profit (backport #31850)
2022-09-04 16:21:54 +05:30
Deepesh Garg
d65d2f617d Merge pull request #32071 from frappe/mergify/bp/version-14-hotfix/pr-32053
fix: KSA VAT report multi currency amount issue (backport #32053)
2022-09-04 15:58:50 +05:30
Deepesh Garg
0438433a4f chore: Linting Issues
(cherry picked from commit ad8d0efa29)
2022-09-04 10:27:23 +00:00
hrzzz
055556b7f1 fix: remove spaces and order import
(cherry picked from commit 3ef551872a)
2022-09-04 10:27:23 +00:00
hrzzz
60fa421409 feat: two new filters for gross profit
(cherry picked from commit 27891ecb77)
2022-09-04 10:27:23 +00:00
Deepesh Garg
dd2fd12d5f Merge pull request #32073 from frappe/mergify/bp/version-14-hotfix/pr-31822
fix(pos): error while consolidating pos invoices (backport #31822)
2022-09-04 15:57:09 +05:30
Saqib Ansari
319ee41403 fix(pos): error while consolidating pos invoices
(cherry picked from commit 33762dbbac)
2022-09-04 07:56:31 +00:00
hamzaali15
b96526eefd fix: KSA VAT report multi currency amount issue
In KSA VAT report amount is not showing correctly for multi currencies because net_amount field is fetched instead of base_net_amount

(cherry picked from commit 56d8962e40)
2022-09-04 07:43:32 +00:00
rohitwaghchaure
78a992c086 Merge pull request #32066 from frappe/mergify/bp/version-14-hotfix/pr-32065
fix: not able to make variant item (backport #32065)
2022-09-03 11:53:48 +05:30
Rohit Waghchaure
f871dd4ef6 fix: not able to make variant item
(cherry picked from commit 92b0f9cd7e)
2022-09-03 06:23:27 +00:00
ruthra kumar
79ecf7751f Merge pull request #32060 from frappe/mergify/bp/version-14-hotfix/pr-32054
fix: type error on cancellation of Process Deferred Accounting (backport #32054)
2022-09-02 17:10:34 +05:30
ruthra kumar
4698dba402 test: pda document submission and cancellation
(cherry picked from commit 1c385541fa)
2022-09-02 11:15:32 +00:00
ruthra kumar
f55881aef8 fix: incorrect import parameter for cancel PDA
(cherry picked from commit 08f2e4edc3)
2022-09-02 11:15:31 +00:00
ruthra kumar
f1b2ba5a84 Merge pull request #32058 from frappe/mergify/bp/version-14-hotfix/pr-32052
fix: key error on consolidated financial report (backport #32052)
2022-09-02 16:41:08 +05:30
ruthra kumar
4409f11282 fix: key error on consolidated financial report
accounts with same name but different account number will throw key
error on consolidated report

(cherry picked from commit 6e8395cccd)
2022-09-02 10:46:42 +00:00
ruthra kumar
84865a8421 Merge pull request #32055 from frappe/mergify/bp/version-14-hotfix/pr-31942
fix: include payment against PO in AR/AP report (backport #31942)
2022-09-02 14:58:25 +05:30
ruthra kumar
d9632e8138 test: payments against so/po will show up as outstanding amount
1. Class will use FrappeTestCase fixture
2. setup and teardown methods are introduced
3. test for payments against SO

(cherry picked from commit 36f5883dda)
2022-09-02 08:15:36 +00:00
ruthra kumar
4bbd0ec985 fix: include payment against PO in AR/AP report
(cherry picked from commit fdd167cac1)
2022-09-02 08:15:36 +00:00
mergify[bot]
92f8f0ec74 chore: set BOM as default value for Backflush Raw Materials of Subcontract Based On (backport #32048) (#32050)
chore: set BOM as default value for Backflush Raw Materials of Subcontract Based On (#32048)

chore: set BOM as default value for Backflush Raw Materials of Subcontract Based On in Buying Settings
(cherry picked from commit 68907ca783)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-09-02 09:10:17 +05:30
Deepesh Garg
aea484be1f Merge pull request #32032 from frappe/mergify/bp/version-14-hotfix/pr-32030
fix: Loan Interest accruals for 0 rated loans (backport #32030)
2022-08-31 21:04:38 +05:30
Deepesh Garg
52fc10d00c chore: Add check for principal amount
(cherry picked from commit a76d3827ec)
2022-08-30 15:47:11 +00:00
Deepesh Garg
1b9082e07b fix: Loan Interest accruals for 0 rated loans
(cherry picked from commit eefc9b7172)
2022-08-30 15:47:11 +00:00
mergify[bot]
0e9a1fb40e fix: force delete old report docs (backport #32026) (#32027)
fix: force delete old report docs (#32026)

(cherry picked from commit ffa3071d36)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-30 15:46:08 +05:30
Frappe PR Bot
32abf67c80 chore(release): Bumped to Version 14.0.3
## [14.0.3](https://github.com/frappe/erpnext/compare/v14.0.2...v14.0.3) (2022-08-30)

### Bug Fixes

* AD not getting copied from SCO while creating a SE (backport [#32004](https://github.com/frappe/erpnext/issues/32004)) ([#32007](https://github.com/frappe/erpnext/issues/32007)) ([cee867f](cee867f941))
* Add docstatus filter for voucher_no in Repost Item Valuation ([309da96](309da96442))
* add validation for PO in Stock Entry (backport [#31974](https://github.com/frappe/erpnext/issues/31974)) ([#31975](https://github.com/frappe/erpnext/issues/31975)) ([4d8ced6](4d8ced6c87))
* default supplier not set in the PP ([4cf9fb0](4cf9fb08e1))
* display amount in account currency if party is supplied ([15915d7](15915d7053))
* Explicitly commit "log_error" since its getting called during GET request (backport [#31952](https://github.com/frappe/erpnext/issues/31952)) ([#31953](https://github.com/frappe/erpnext/issues/31953)) ([362976f](362976fa42))
* gl entries for asset repair ([f0f7afa](f0f7afa669))
* lost quotation not to expired ([8717235](8717235a34))
* material request connection on work order ([193502c](193502ce03))
* **patch:** update sla doctype directly (backport [#32014](https://github.com/frappe/erpnext/issues/32014)) ([#32015](https://github.com/frappe/erpnext/issues/32015)) ([1b5a1cb](1b5a1cbaad))
* permissions for Task Type ([#32016](https://github.com/frappe/erpnext/issues/32016)) ([7ca1beb](7ca1beb15d))
* Purchase Order creation from Sales Order ([39ff0cc](39ff0cc6d8))
* Purposes not set ([94ebfa7](94ebfa765c))
* restrict party types to Supplier/Customer for AR/AP report ([c407d1e](c407d1e51a))
* Rounded total for cash and non trade discount invoices ([6c4fcd8](6c4fcd80c6))
* Route condition set for stock ledger (backport [#31935](https://github.com/frappe/erpnext/issues/31935)) ([#31945](https://github.com/frappe/erpnext/issues/31945)) ([a7d23ab](a7d23abc2f))
2022-08-30 09:24:00 +00:00
Deepesh Garg
52b42e9492 Merge pull request #32025 from frappe/version-14-hotfix
chore: weekly version-14 release
2022-08-30 14:52:11 +05:30
Deepesh Garg
77ac7f06d4 Merge pull request #32021 from frappe/mergify/bp/version-14-hotfix/pr-32005
fix: lost quotation not to expired (backport #32005)
2022-08-30 11:08:40 +05:30
MOHAMMED NIYAS
8717235a34 fix: lost quotation not to expired
(cherry picked from commit 69ffef8c0e)
2022-08-30 05:03:44 +00:00
Deepesh Garg
670426f428 Merge pull request #32017 from frappe/mergify/bp/version-14-hotfix/pr-32016
fix: permissions for Task Type (backport #32016)
2022-08-30 08:38:14 +05:30
mergify[bot]
1b5a1cbaad fix(patch): update sla doctype directly (backport #32014) (#32015)
fix(patch): update sla doctype directly (#32014)

fix: update sla doctype directly
(cherry picked from commit 2d41704424)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-29 22:17:39 +05:30
Raffael Meyer
7ca1beb15d fix: permissions for Task Type (#32016)
(cherry picked from commit 73f4d5931d)
2022-08-29 16:27:00 +00:00
ruthra kumar
c660db145b Merge pull request #32013 from frappe/mergify/bp/version-14-hotfix/pr-32009
refactor: readd remarks field to payment ledger (backport #32009)
2022-08-29 20:21:43 +05:30
ruthra kumar
0aaf9c4f05 chore: add remarks migration to patches.txt
(cherry picked from commit d522f13d55)
2022-08-29 19:52:33 +05:30
ruthra kumar
b3b0272ec9 chore: patch for migrating remarks to payment ledger
(cherry picked from commit 3a6b095ed4)
2022-08-29 14:19:46 +00:00
ruthra kumar
f7898b4954 refactor: re-add remarks field to payment ledger and AR/AP report
(cherry picked from commit 5782c4469a)
2022-08-29 14:19:46 +00:00
Deepesh Garg
b067eae38c Merge pull request #32008 from frappe/mergify/bp/version-14-hotfix/pr-32006
fix: Rounded total for cash and non trade discount invoices (backport #32006)
2022-08-29 17:46:14 +05:30
mergify[bot]
cee867f941 fix: AD not getting copied from SCO while creating a SE (backport #32004) (#32007)
fix: AD not getting copied from SCO while creating a SE (#32004)

(cherry picked from commit 9dbaaa33f5)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-29 15:50:22 +05:30
Deepesh Garg
6c4fcd80c6 fix: Rounded total for cash and non trade discount invoices
(cherry picked from commit 318da16b99)
2022-08-29 10:06:08 +00:00
Deepesh Garg
11657effa5 Merge pull request #31970 from frappe/mergify/bp/version-14-hotfix/pr-31955
chore: update french translation (backport #31955)
2022-08-28 11:32:54 +05:30
Deepesh Garg
d3b7942f32 Merge pull request #31979 from frappe/mergify/bp/version-14-hotfix/pr-31977
fix: restrict party types to Supplier/Customer for AR/AP report (backport #31977)
2022-08-28 11:25:00 +05:30
mergify[bot]
f407c972d1 chore: allow return of components in SCO (backport #31994) (#31995)
chore: allow return of components in SCO (#31994)

chore: allow return of components in sco
(cherry picked from commit af5cbc881f)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-26 23:15:20 +05:30
Deepesh Garg
0b72295fa2 Merge pull request #31990 from frappe/mergify/bp/version-14-hotfix/pr-31988
chore: remove precision on discount_percentage of Sales Invoice Item (backport #31988)
2022-08-26 18:09:26 +05:30
Deepesh Garg
204b6c0272 Merge pull request #31973 from frappe/mergify/bp/version-14-hotfix/pr-31943
fix: gl entries for asset repair (backport #31943)
2022-08-26 17:34:57 +05:30
Deepesh Garg
1118e25b6d Merge pull request #31985 from frappe/mergify/bp/version-14-hotfix/pr-31984
fix: Purchase Order creation from Sales Order (backport #31984)
2022-08-26 16:05:01 +05:30
ruthra kumar
9b9df70632 chore: remove precision on discount_percentage of Sales Invoice Item
(cherry picked from commit c42fef541a)
2022-08-26 10:34:50 +00:00
Solufyin
39ff0cc6d8 fix: Purchase Order creation from Sales Order
(cherry picked from commit bd4b4ddd8b)
2022-08-26 06:31:51 +00:00
ruthra kumar
c407d1e51a fix: restrict party types to Supplier/Customer for AR/AP report
(cherry picked from commit 6aa8fd0f7b)
2022-08-25 10:50:46 +00:00
mergify[bot]
4d8ced6c87 fix: add validation for PO in Stock Entry (backport #31974) (#31975)
fix: add validation for PO in Stock Entry (#31974)

(cherry picked from commit 8566832dd5)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-25 15:29:48 +05:30
Deepesh Garg
4f832678cf chore: fix against account
(cherry picked from commit c1f6dd46d1)
2022-08-25 07:55:08 +00:00
Nabin Hait
f0f7afa669 fix: gl entries for asset repair
(cherry picked from commit b4a2eb2e65)
2022-08-25 07:55:08 +00:00
Florian HENRY
cb6cbf7818 chore: update fr translation
(cherry picked from commit 299da5d596)
2022-08-25 07:37:06 +00:00
Florian HENRY
3aec1175df chore: update fr translation
(cherry picked from commit 1f6f2747d4)
2022-08-25 07:37:06 +00:00
Florian HENRY
c645995ae3 chore: update french translation
(cherry picked from commit 264f98af14)
2022-08-25 07:37:05 +00:00
rohitwaghchaure
f772c17f3f Merge pull request #31969 from frappe/mergify/bp/version-14-hotfix/pr-31967
fix: material request connection on work order (backport #31967)
2022-08-25 12:30:25 +05:30
Rohit Waghchaure
193502ce03 fix: material request connection on work order
(cherry picked from commit 9ab10def49)
2022-08-25 06:59:56 +00:00
rohitwaghchaure
abd637a238 Merge pull request #31968 from frappe/mergify/bp/version-14-hotfix/pr-31966
fix: default supplier not set in the PP (backport #31966)
2022-08-25 12:26:47 +05:30
Rohit Waghchaure
4cf9fb08e1 fix: default supplier not set in the PP
(cherry picked from commit 5fd468d9ec)
2022-08-25 06:55:46 +00:00
Deepesh Garg
e4ca20654f Merge pull request #31964 from frappe/mergify/bp/version-14-hotfix/pr-31909
fix: Add docstatus filter for voucher_no in Repost Item Valuation (backport #31909)
2022-08-25 11:25:02 +05:30
Deepesh Garg
bc873939eb Merge pull request #31959 from frappe/mergify/bp/version-14-hotfix/pr-31934
refactor: disable discount accounting on Buying module(PI) (backport #31934)
2022-08-25 11:06:58 +05:30
Deepesh Garg
c6d3e9f432 Merge pull request #31958 from frappe/mergify/bp/version-14-hotfix/pr-31950
fix: display amount in account currency if party is supplied (backport #31950)
2022-08-25 11:06:42 +05:30
rohitwaghchaure
54f4504df6 Merge pull request #31963 from frappe/mergify/bp/version-14-hotfix/pr-31951
fix: Purposes not set in Maintenance Visit (backport #31951)
2022-08-25 10:50:50 +05:30
Sagar Sharma
309da96442 fix: Add docstatus filter for voucher_no in Repost Item Valuation
(cherry picked from commit 520306dc87)
2022-08-25 05:20:26 +00:00
Rohit Waghchaure
94ebfa765c fix: Purposes not set
(cherry picked from commit f9a7b31b5b)
2022-08-25 05:19:53 +00:00
ruthra kumar
2577747c5c test: remove discount accounting tests
(cherry picked from commit 277ef04b60)
2022-08-25 05:04:46 +00:00
ruthra kumar
fb387426d6 refactor: disable discount accounting on Buying module(PI)
(cherry picked from commit a956e20f29)
2022-08-25 05:04:46 +00:00
ruthra kumar
15915d7053 fix: display amount in account currency if party is supplied
(cherry picked from commit e5b04d54ff)
2022-08-25 05:04:27 +00:00
mergify[bot]
362976fa42 fix: Explicitly commit "log_error" since its getting called during GET request (backport #31952) (#31953)
fix: Explicitly commit "log_error" since its getting called during GET request (#31952)

(cherry picked from commit 122f1c0ced)

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2022-08-24 18:26:08 +05:30
mergify[bot]
a7d23abc2f fix: Route condition set for stock ledger (backport #31935) (#31945)
fix: Route condition set for stock ledger (#31935)

(cherry picked from commit 0e26df331c)

Co-authored-by: Solufyin <34390782+Solufyin@users.noreply.github.com>
2022-08-24 13:30:25 +05:30
mergify[bot]
4b609322ba chore: add Work Order test dependencies (backport #31936) (#31937)
chore: add Work Order test dependencies (#31936)

(cherry picked from commit fe73d55f70)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2022-08-23 16:09:26 +05:30
Frappe PR Bot
5778f227ee chore(release): Bumped to Version 14.0.2
## [14.0.2](https://github.com/frappe/erpnext/compare/v14.0.1...v14.0.2) (2022-08-23)

### Bug Fixes

* additional-cost in items table ([da69cc5](da69cc5477))
* base_amount and exchange_rate in additional-cost table ([d48487a](d48487ada2))
* Cash and non trade discount calculation ([b6d2de2](b6d2de2cc1))
* don't allow to create SCR directly (backport [#31924](https://github.com/frappe/erpnext/issues/31924)) ([#31926](https://github.com/frappe/erpnext/issues/31926)) ([0bfb774](0bfb774bdf))
* incorrect buying amount in Gross Profit rpt ([981add9](981add9b6f))
* incorrect tax amt due to different exchange rate in PR and PI ([a767326](a76732613e))
* limited options for no-of-employees in crm ([735a608](735a60807a))
* make rate field read-only in subcontracting receipt item (backport [#31905](https://github.com/frappe/erpnext/issues/31905)) ([#31906](https://github.com/frappe/erpnext/issues/31906)) ([6be77d5](6be77d5729))
* map old data as per new options of no-of-employees ([35e9bfc](35e9bfca38))
* **pos:** edge case while closing pos ([#31892](https://github.com/frappe/erpnext/issues/31892)) ([200a971](200a971743))
* process loan interest accrual ([66e5202](66e5202642))
* recalculate rate of items based on "Recalculate Rate" checkbox ([9e60dd3](9e60dd32e8))
* TDS calculation for advance payment ([78b39d6](78b39d6ca4))
* term loan interest calculation ([8fdbbf3](8fdbbf374d))
* test "test_pending_and_received_qty" ([e099e10](e099e10c8e))
* Test cases ([3afb625](3afb625ff8))
* Unable to make payment entry against Fees using education app ([1aa96de](1aa96defda))

### Performance Improvements

* use `create_custom_fields` ([#31853](https://github.com/frappe/erpnext/issues/31853)) ([6656d23](6656d23e45))
2022-08-23 05:28:37 +00:00
Deepesh Garg
7ac75aab1a Merge pull request #31932 from frappe/version-14-hotfix
chore: weekly version 14 release
2022-08-23 10:57:10 +05:30
Deepesh Garg
e831b6e054 Merge pull request #31930 from frappe/mergify/bp/version-14-hotfix/pr-31910
fix: Cash and non trade discount calculation (backport #31910)
2022-08-23 10:36:15 +05:30
Deepesh Garg
856a64b77c chore: Linting issues
(cherry picked from commit 1cb7ae16ab)
2022-08-23 04:49:57 +00:00
Deepesh Garg
3afb625ff8 fix: Test cases
(cherry picked from commit ae3dce0cbd)
2022-08-23 04:49:57 +00:00
Deepesh Garg
b6d2de2cc1 fix: Cash and non trade discount calculation
(cherry picked from commit 3b15966cc9)
2022-08-23 04:49:57 +00:00
mergify[bot]
0bfb774bdf fix: don't allow to create SCR directly (backport #31924) (#31926)
fix: don't allow to create SCR directly (#31924)

(cherry picked from commit bf5c43322a)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-22 18:38:21 +05:30
Deepesh Garg
d7a8db04a1 Merge pull request #31916 from frappe/mergify/bp/version-14-hotfix/pr-31856
fix: incorrect tax amt due to different exchange rate in PR and PI (backport #31856)
2022-08-22 10:57:53 +05:30
Deepesh Garg
2d5ae811d2 Merge pull request #31917 from frappe/mergify/bp/version-14-hotfix/pr-31871
fix: incorrect buying amount in Gross Profit rpt (backport #31871)
2022-08-22 10:56:47 +05:30
Deepesh Garg
be9607e27b Merge pull request #31915 from frappe/mergify/bp/version-14-hotfix/pr-31894
fix: TDS calculation for advance payment (backport #31894)
2022-08-22 10:32:04 +05:30
Deepesh Garg
fd45a7afbe Merge pull request #31818 from frappe/mergify/bp/version-14-hotfix/pr-31816
fix: limited options for no-of-employees in the crm documents (backport #31816)
2022-08-22 10:31:06 +05:30
Deepesh Garg
0c73af6ee2 Merge pull request #31809 from frappe/mergify/bp/version-14-hotfix/pr-31801
Tds report (backport #31801)
2022-08-22 10:30:42 +05:30
ruthra kumar
981add9b6f fix: incorrect buying amount in Gross Profit rpt
(cherry picked from commit 967dd398e7)
2022-08-22 05:00:26 +00:00
Deepesh Garg
8f5736c500 Merge pull request #31832 from frappe/mergify/bp/version-14-hotfix/pr-31830
fix: Unable to make payment entry against Fees using education app (backport #31830)
2022-08-22 10:29:26 +05:30
Deepesh Garg
052f7c3345 Merge pull request #31827 from frappe/mergify/bp/version-14-hotfix/pr-31799
fix: process loan interest accrual (backport #31799)
2022-08-22 10:28:50 +05:30
Deepesh Garg
fa4a40812c Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-31816 2022-08-22 09:09:16 +05:30
ruthra kumar
a76732613e fix: incorrect tax amt due to different exchange rate in PR and PI
(cherry picked from commit 5fd0770372)
2022-08-22 03:38:43 +00:00
Deepesh Garg
dd602989a8 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-31801 2022-08-22 09:00:36 +05:30
Maharshi Patel
78b39d6ca4 fix: TDS calculation for advance payment
"against_voucher": ["is", "not set"] was used in query due to which if TDS was added on "advance" payment vouchers and then reconciled against purchase invoice. it will not find those vouchers and consider this as first-time threshold due to which it will calculate Tax for all transactions.

(cherry picked from commit a452143782)
2022-08-22 03:30:04 +00:00
Deepesh Garg
77fa64e100 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-31799 2022-08-22 08:59:57 +05:30
Deepesh Garg
ac04fc60ef Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-31830 2022-08-22 08:59:31 +05:30
mergify[bot]
6be77d5729 fix: make rate field read-only in subcontracting receipt item (backport #31905) (#31906)
fix: make rate field read-only in subcontracting receipt item (#31905)

(cherry picked from commit 588ca68171)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-20 19:28:21 +05:30
Sagar Sharma
37e5b93e2d Merge pull request #31900 from frappe/mergify/bp/version-14-hotfix/pr-31899
fix: repost item valuation for subcontracting receipt  (backport #31899)
2022-08-19 22:41:28 +05:30
Sagar Sharma
19d29d1861 chore: add option for "Subcontracting Receipt" in "Voucher Type"
(cherry picked from commit f92f3e0208)
2022-08-19 16:31:53 +00:00
Sagar Sharma
0db912998a chore: allow subcontracting receipt backdated entry
(cherry picked from commit f8c11847bb)
2022-08-19 16:31:53 +00:00
mergify[bot]
200a971743 fix(pos): edge case while closing pos (#31892) 2022-08-19 17:11:13 +05:30
Sagar Sharma
c0f0986539 Merge pull request #31897 from frappe/mergify/bp/version-14-hotfix/pr-31890
fix: additional-costs in SCO and SCR (backport #31890)
2022-08-19 15:58:06 +05:30
Sagar Sharma
376293326b chore: conflicts 2022-08-19 15:30:50 +05:30
Sagar Sharma
9a29e3c9f2 chore: add test for additional-cost
(cherry picked from commit c247cf728c)
2022-08-19 09:56:52 +00:00
Sagar Sharma
e099e10c8e fix: test "test_pending_and_received_qty"
(cherry picked from commit addd7347d8)
2022-08-19 09:56:52 +00:00
Sagar Sharma
3b222339b8 chore: add additional-cost table in SCR
(cherry picked from commit 256b4245d5)

# Conflicts:
#	erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json
2022-08-19 09:56:51 +00:00
Sagar Sharma
9e60dd32e8 fix: recalculate rate of items based on "Recalculate Rate" checkbox
(cherry picked from commit 2fc6833684)
2022-08-19 09:56:51 +00:00
Sagar Sharma
7ff5414571 chore: move "set_missing_values_in_additional_costs" from SCO to SC"
(cherry picked from commit ea82fe5bc2)
2022-08-19 09:56:50 +00:00
Sagar Sharma
d48487ada2 fix: base_amount and exchange_rate in additional-cost table
(cherry picked from commit eabd3135f0)
2022-08-19 09:56:50 +00:00
Sagar Sharma
da69cc5477 fix: additional-cost in items table
(cherry picked from commit d7ed4093d8)
2022-08-19 09:56:50 +00:00
Sagar Vora
b2a720d847 Merge pull request #31891 from frappe/mergify/bp/version-14-hotfix/pr-31853
perf: use `create_custom_fields` (backport #31853)
2022-08-18 15:57:59 +00:00
Sagar Vora
6656d23e45 perf: use create_custom_fields (#31853)
* perf: use `create_custom_fields`

* fix: default must be a string

(cherry picked from commit aafb735283)
2022-08-18 15:31:42 +00:00
mergify[bot]
ae5c05081d chore: remove unwanted field "provisional_expense_account" from SCR (backport #31847) (#31886)
chore: remove unwanted field "provisional_expense_account" from SCR (#31847)

(cherry picked from commit 7e88eb549f)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-18 17:41:01 +05:30
Frappe PR Bot
028e939cca chore(release): Bumped to Version 14.0.1
## [14.0.1](https://github.com/frappe/erpnext/compare/v14.0.0...v14.0.1) (2022-08-18)

### Bug Fixes

* add asset repair to accounting dimension list ([65bb1d8](65bb1d8cc2))
* Add dimension section in subcontracting doctypes (backport [#31849](https://github.com/frappe/erpnext/issues/31849)) ([#31877](https://github.com/frappe/erpnext/issues/31877)) ([50ad612](50ad612453))
* check item_code in all rows of po_items (backport [#31741](https://github.com/frappe/erpnext/issues/31741)) ([#31842](https://github.com/frappe/erpnext/issues/31842)) ([82f1dd2](82f1dd268d))
* contact search in request for quotation (backport [#31828](https://github.com/frappe/erpnext/issues/31828)) ([#31840](https://github.com/frappe/erpnext/issues/31840)) ([74664a3](74664a34c0))
* delete custom fields on deletion of inventory dimension ([354a9d6](354a9d6169))
* **ecommerce:** remove query to non-existing field (backport [#31771](https://github.com/frappe/erpnext/issues/31771)) ([#31773](https://github.com/frappe/erpnext/issues/31773)) ([8737c10](8737c10ce4))
* getting error to show sales invoice group or print rep… (backport [#31756](https://github.com/frappe/erpnext/issues/31756)) ([#31767](https://github.com/frappe/erpnext/issues/31767)) ([53b9d61](53b9d61c46))
* incorrect produced-qty in production-plan-item (backport [#31706](https://github.com/frappe/erpnext/issues/31706)) ([#31861](https://github.com/frappe/erpnext/issues/31861)) ([010a0ca](010a0ca0a9))
* incorrect rate in BOM exploded items (backport [#31513](https://github.com/frappe/erpnext/issues/31513)) ([#31864](https://github.com/frappe/erpnext/issues/31864)) ([abe1894](abe18945a6))
* intercompany SO throws exception ([1d1f12f](1d1f12f949))
* linter (backport [#31763](https://github.com/frappe/erpnext/issues/31763)) ([#31766](https://github.com/frappe/erpnext/issues/31766)) ([3092131](3092131913))
* Make expense account editable in Purchase Receipt Item (backport [#31730](https://github.com/frappe/erpnext/issues/31730)) ([#31878](https://github.com/frappe/erpnext/issues/31878)) ([b637d4d](b637d4d5f1))
* Make expense account editable in Subcontracting Receipt Item (backport [#31848](https://github.com/frappe/erpnext/issues/31848)) ([#31870](https://github.com/frappe/erpnext/issues/31870)) ([aa5aaa1](aa5aaa113e))
* not able to issue expired batches ([ce5fc5b](ce5fc5b457))
* posting_date of linked vouchers should not affect outstanding ([0faa7b0](0faa7b0432))
* **projects:** Add missing comma ([623f56a](623f56a95c))
* set `billing_address` for purchases in `get_party_details` ([5a28ba8](5a28ba8537))
* set `company_address` for purchases in `party.js` ([4c82533](4c82533239))
* specify allowed doctype in queries (backport [#31761](https://github.com/frappe/erpnext/issues/31761)) ([#31764](https://github.com/frappe/erpnext/issues/31764)) ([6dce122](6dce122825))
* Transit filter for Default Target Warehouse in SE (backport [#31839](https://github.com/frappe/erpnext/issues/31839)) ([#31873](https://github.com/frappe/erpnext/issues/31873)) ([04d3571](04d3571dd9))
2022-08-18 08:30:58 +00:00
Deepesh Garg
216cb9b07b Merge pull request #31881 from frappe/version-14-hotfix
chore: weekly version-14 release
2022-08-18 13:59:28 +05:30
mergify[bot]
50ad612453 fix: Add dimension section in subcontracting doctypes (backport #31849) (#31877)
* fix: Add dimension section in subcontracting doctypes (#31849)

(cherry picked from commit 8704ca783d)

# Conflicts:
#	erpnext/patches.txt

* chore: conflicts

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-18 12:04:07 +05:30
Deepesh Garg
6b71af9008 Merge pull request #31883 from frappe/mergify/bp/version-14-hotfix/pr-31875
fix(projects): Add missing comma (backport #31875)
2022-08-18 11:20:55 +05:30
Deepesh Garg
3c8412efdb Merge pull request #31796 from frappe/mergify/bp/version-14-hotfix/pr-31737
fix: incorrect invoice outstanding in reconciliation tool (backport #31737)
2022-08-18 11:20:26 +05:30
Aditya Hase
623f56a95c fix(projects): Add missing comma
Added with https://github.com/frappe/erpnext/pull/31360

(cherry picked from commit d38778e400)
2022-08-18 05:49:58 +00:00
mergify[bot]
b637d4d5f1 fix: Make expense account editable in Purchase Receipt Item (backport #31730) (#31878)
fix: Make expense account editable in Purchase Receipt Item (#31730)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit 1a6508972e)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-08-18 11:16:15 +05:30
rohitwaghchaure
601bc64618 Merge pull request #31869 from frappe/mergify/bp/version-14-hotfix/pr-31860
fix: delete custom fields on deletion of inventory dimension (backport #31860)
2022-08-17 21:45:57 +05:30
mergify[bot]
04d3571dd9 fix: Transit filter for Default Target Warehouse in SE (backport #31839) (#31873)
fix: Transit filter for Default Target Warehouse in SE (#31839)

(cherry picked from commit f1a612245c)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 17:26:15 +05:30
mergify[bot]
aa5aaa113e fix: Make expense account editable in Subcontracting Receipt Item (backport #31848) (#31870)
fix: Make expense account editable in Subcontracting Receipt Item (#31848)

(cherry picked from commit 2d04e71412)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 16:31:18 +05:30
Rohit Waghchaure
354a9d6169 fix: delete custom fields on deletion of inventory dimension
(cherry picked from commit 0b39a0123e)
2022-08-17 10:14:14 +00:00
rohitwaghchaure
c7e2217c92 Merge pull request #31867 from frappe/mergify/bp/version-14-hotfix/pr-31863
fix: not able to issue expired batches (backport #31863)
2022-08-17 15:43:32 +05:30
Rohit Waghchaure
ce5fc5b457 fix: not able to issue expired batches
(cherry picked from commit 795c94384a)
2022-08-17 09:16:57 +00:00
mergify[bot]
abe18945a6 fix: incorrect rate in BOM exploded items (backport #31513) (#31864)
fix: incorrect rate in BOM exploded items (#31513)

(cherry picked from commit 313625c349)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 14:37:40 +05:30
mergify[bot]
010a0ca0a9 fix: incorrect produced-qty in production-plan-item (backport #31706) (#31861)
fix: incorrect produced-qty in production-plan-item (#31706)

(cherry picked from commit 538cd6fdcf)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 13:46:33 +05:30
mergify[bot]
74664a34c0 fix: contact search in request for quotation (backport #31828) (#31840)
fix: contact search in request for quotation (#31828)

(cherry picked from commit e5e88bb9f1)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-15 12:19:59 +05:30
mergify[bot]
82f1dd268d fix: check item_code in all rows of po_items (backport #31741) (#31842)
fix: check item_code in all rows of po_items (#31741)

fix: check the item code in each row of PO items
(cherry picked from commit 0047e18a9b)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-14 16:00:54 +05:30
Deepesh Garg
1aa96defda fix: Unable to make payment entry against Fees using education app
(cherry picked from commit 79ac50d0f7)
2022-08-11 15:17:42 +00:00
Abhinav Raut
8fdbbf374d fix: term loan interest calculation
(cherry picked from commit 534d7ce64b)
2022-08-11 10:18:24 +00:00
Abhinav Raut
66e5202642 fix: process loan interest accrual
(cherry picked from commit 9ef8d5c5c3)
2022-08-11 10:18:24 +00:00
Nabin Hait
35e9bfca38 fix: map old data as per new options of no-of-employees
(cherry picked from commit 909945c0ac)
2022-08-09 15:18:25 +00:00
Nabin Hait
735a60807a fix: limited options for no-of-employees in crm
(cherry picked from commit 7ecd67605f)
2022-08-09 15:18:25 +00:00
mergify[bot]
c3fd802351 refactor: use browser native lazy loading (backport #31814) (#31815)
refactor: use browser native lazy loading (#31814)

(cherry picked from commit 08d7c48dc7)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-09 18:51:27 +05:30
Deepesh Garg
6046f8bc5e Merge pull request #31798 from frappe/mergify/bp/version-14-hotfix/pr-31779
Bug add accouting dimension in asset repair (backport #31779)
2022-08-09 17:58:35 +05:30
Akash Krishna
d7db8ed12e Tds report (#31801)
* fix: TDS Computation Summary Report not loading, too many values to unpack

(cherry picked from commit 32b30bc5de)
2022-08-09 12:12:33 +00:00
Sagar Vora
adcd21724b Merge pull request #31793 from frappe/mergify/bp/version-14-hotfix/pr-31733
fix: set `billing_address` for purchases in `get_party_details` (backport #31733)
2022-08-08 12:09:43 +00:00
ruthra kumar
04bdff736b chore: patch for creating existing dimensions in asset repair
(cherry picked from commit 80f508c4b1)
2022-08-08 11:10:25 +00:00
ruthra kumar
65bb1d8cc2 fix: add asset repair to accounting dimension list
(cherry picked from commit 452584c4bd)
2022-08-08 11:10:25 +00:00
Deepesh Garg
ebf766cf62 Merge pull request #31794 from frappe/mergify/bp/version-14-hotfix/pr-31777
fix: intercompany SO created from Purchase Order throws exception (backport #31777)
2022-08-08 16:36:46 +05:30
ruthra kumar
80bf47170f test: posting_date should not affect outstanding amount calculation
(cherry picked from commit ef312b8fc4)
2022-08-08 10:59:05 +00:00
ruthra kumar
0faa7b0432 fix: posting_date of linked vouchers should not affect outstanding
posting_date filter should not be applied for linked vouchers.

(cherry picked from commit 5f1562c5b2)
2022-08-08 10:59:05 +00:00
ruthra kumar
1d1f12f949 fix: intercompany SO throws exception
(cherry picked from commit af0a353b79)
2022-08-08 10:36:55 +00:00
Sagar Vora
4c82533239 fix: set company_address for purchases in party.js
(cherry picked from commit d05082987f)
2022-08-08 07:31:44 +00:00
Sagar Vora
5a28ba8537 fix: set billing_address for purchases in get_party_details
(cherry picked from commit a3625b3817)
2022-08-08 07:31:44 +00:00
mergify[bot]
8737c10ce4 fix(ecommerce): remove query to non-existing field (backport #31771) (#31773)
fix(ecommerce): remove query to non-existing field (#31771)

(cherry picked from commit 17b9bfd249)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-03 16:49:16 +05:30
Ankush Menat
2defb89962 ci: fix automated release regex (#31770)
[skip ci]
2022-08-03 16:15:32 +05:30
mergify[bot]
53b9d61c46 fix: getting error to show sales invoice group or print rep… (backport #31756) (#31767)
fix: getting error to show sales invoice group or print rep… (#31756)

fix: formatter getting error to show sales invoice group or print report.

1 - When I view the Gross Profit report in Sales Invoice mode, the table is all broken.
Error on browser console:
TypeError: Cannot read properties of undefined (reading 'indent')

2 - When I try to print, no matter the Group (Sales Invoice, Item Code, Item Group...) nothing happens. in browser log console I have the following error:
TypeError: Cannot read properties of undefined (reading 'content')

i fixed both errors and all working perfectly.

(cherry picked from commit ea88451875)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
2022-08-03 11:22:54 +05:30
mergify[bot]
3092131913 fix: linter (backport #31763) (#31766)
fix: linter (#31763)

(cherry picked from commit 9c580dde39)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2022-08-03 11:17:44 +05:30
mergify[bot]
6dce122825 fix: specify allowed doctype in queries (backport #31761) (#31764)
fix: specify allowed doctype in queries (#31761)

(cherry picked from commit 9baa222976)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-08-03 11:16:41 +05:30
Ankush Menat
248cc48842 ci: setup releases for v14 (#31759)
[skip ci]
2022-08-02 12:11:36 +05:30
Deepesh Garg
ebd8f2f45b chore: verison bump and change log 2022-08-01 22:29:34 +05:30
Ankush Menat
bb00d38dd7 Merge branch 'develop' into asset-capitalization 2021-11-30 19:32:11 +05:30
Saif Ur Rehman
06aead0470 chore: isort 2021-11-10 13:45:40 +05:00
Saif Ur Rehman
cdb1800087 chore: remove unused import 2021-11-09 12:35:01 +05:00
Saif Ur Rehman
13f8edd43f Merge remote-tracking branch 'upstream/develop' into asset-capitalization
# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2021-11-09 12:17:17 +05:00
Saif Ur Rehman
85d1a237ce fix(Asset Capitalization): Reverse depreciation on cancel 2021-11-04 14:15:47 +05:00
Saif Ur Rehman
dc3c27fd1b fix(Asset Capitalization): update code for changes in depreciation logic 2021-11-04 13:47:33 +05:00
Saif Ur Rehman
2d9da22721 Merge branch 'develop' of https://github.com/frappe/erpnext into asset-capitalization
# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
#	erpnext/assets/doctype/asset/test_asset.py
#	erpnext/assets/workspace/assets/assets.json
2021-11-04 12:48:33 +05:00
Saif Ur Rehman
86a6293e62 test(Asset Capitalization): unit tests 2021-09-16 23:24:46 +05:00
Saif Ur Rehman
c311b8ea4f fix(Asset Capitalization): validation edge cases 2021-09-16 23:23:22 +05:00
Saif Ur Rehman
e832944dfe fix(Asset): On Depreciation reversal, remove Journal Entry reference 2021-09-16 23:22:31 +05:00
Saif Ur Rehman
003cfe2717 fix(Asset Capitalization): Hide source items section if table is empty 2021-09-16 23:21:09 +05:00
Saif Ur Rehman
132b517584 fix(Asset Captalization): run_serially on posting_date changed 2021-09-16 23:20:36 +05:00
Saif Ur Rehman
d173e06e69 chore(Asset Capitalization): isort linting 2021-09-14 15:13:35 +05:00
Saif Ur Rehman
9ae0380a96 chore(Asset Capitalization): isort linting 2021-09-14 15:09:58 +05:00
Saif Ur Rehman
8873ef7b67 chore(Asset Capitalization): isort linting 2021-09-14 15:05:39 +05:00
Saif Ur Rehman
dc24a657fd chore(Asset Capitalization): linting 2021-09-14 12:40:17 +05:00
Saif Ur Rehman
8c54be7e99 chore(Asset Capitalization): linting 2021-09-14 12:30:40 +05:00
Saif Ur Rehman
7a5d75b68d feat(Asset Capitalization): Submission and Cancellation 2021-09-13 23:01:52 +05:00
Saif Ur Rehman
3b9bc8e4ef feat(Asset Capitalization): Finance Book field in Asset Row 2021-09-12 14:28:14 +05:00
Saif Ur Rehman
702b5c32c1 feat(Asset Capitalization): Accounting Fields 2021-09-08 16:36:07 +05:00
Saif Ur Rehman
6c748966e7 feat: Asset Capitalization Form 2021-09-06 17:27:47 +05:00
416 changed files with 18074 additions and 8592 deletions

View File

@@ -2,7 +2,7 @@ name: Generate Semantic Release
on:
push:
branches:
- version-13
- version-14
jobs:
release:
name: Release
@@ -13,10 +13,12 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js v14
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
- name: Setup dependencies
run: |
npm install @semantic-release/git @semantic-release/exec --no-save
@@ -28,4 +30,4 @@ jobs:
GIT_AUTHOR_EMAIL: "developers@frappe.io"
GIT_COMMITTER_NAME: "Frappe PR Bot"
GIT_COMMITTER_EMAIL: "developers@frappe.io"
run: npx semantic-release
run: npx semantic-release

View File

@@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
container: [1, 2, 3, 4]
container: [1, 2, 3]
name: Python Unit Tests
@@ -120,32 +120,7 @@ jobs:
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator --with-coverage
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds 3 --build-number ${{ matrix.container }}'
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.container }}
path: /home/runner/frappe-bench/sites/coverage.xml
coverage:
name: Coverage Wrap Up
needs: test
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Upload coverage data
uses: codecov/codecov-action@v2
with:
name: MariaDB
fail_ci_if_error: true
verbose: true

View File

@@ -16,8 +16,8 @@ repos:
- id: check-merge-conflict
- id: check-ast
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [

View File

@@ -1,5 +1,5 @@
{
"branches": ["version-13"],
"branches": ["version-14"],
"plugins": [
"@semantic-release/commit-analyzer", {
"preset": "angular",
@@ -10,7 +10,7 @@
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec", {
"prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" erpnext/__init__.py'
"prepareCmd": 'sed -ir -E "s/\"[0-9]+\.[0-9]+\.[0-9]+\"/\"${nextRelease.version}\"/" erpnext/__init__.py'
}
],
[
@@ -21,4 +21,4 @@
],
"@semantic-release/github"
]
}
}

View File

@@ -11,22 +11,18 @@ erpnext/selling @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/support/ @nextchamp-saqib @deepeshgarg007
pos* @nextchamp-saqib
erpnext/buying/ @marination @rohitwaghchaure @s-aga-r
erpnext/e_commerce/ @marination
erpnext/maintenance/ @marination @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @marination @rohitwaghchaure @s-aga-r
erpnext/portal/ @marination
erpnext/quality_management/ @marination @rohitwaghchaure @s-aga-r
erpnext/shopping_cart/ @marination
erpnext/stock/ @marination @rohitwaghchaure @s-aga-r
erpnext/buying/ @rohitwaghchaure @s-aga-r
erpnext/maintenance/ @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @rohitwaghchaure @s-aga-r
erpnext/quality_management/ @rohitwaghchaure @s-aga-r
erpnext/stock/ @rohitwaghchaure @s-aga-r
erpnext/crm/ @NagariaHussain
erpnext/education/ @rutwikhdev
erpnext/projects/ @ruchamahabal
erpnext/controllers/ @deepeshgarg007 @nextchamp-saqib @rohitwaghchaure @marination
erpnext/patches/ @deepeshgarg007 @nextchamp-saqib @marination
erpnext/public/ @nextchamp-saqib @marination
erpnext/controllers/ @deepeshgarg007 @nextchamp-saqib @rohitwaghchaure
erpnext/patches/ @deepeshgarg007 @nextchamp-saqib
.github/ @ankush
pyproject.toml @gavindsouza @ankush
pyproject.toml @ankush

View File

@@ -82,6 +82,8 @@ GNU/General Public License (see [license.txt](license.txt))
The ERPNext code is licensed as GNU General Public License (v3) and the Documentation is licensed as Creative Commons (CC-BY-SA-3.0) and the copyright is owned by Frappe Technologies Pvt Ltd (Frappe) and Contributors.
By contributing to ERPNext, you agree that your contributions will be licensed under its GNU General Public License (v3).
## Logo and Trademark Policy
Please read our [Logo and Trademark Policy](TRADEMARK_POLICY.md).

View File

@@ -2,7 +2,7 @@ import inspect
import frappe
__version__ = "14.0.0-dev"
__version__ = "14.8.0"
def get_default_company(user=None):

View File

@@ -37,7 +37,7 @@ class Account(NestedSet):
def autoname(self):
from erpnext.accounts.utils import get_autoname_with_number
self.name = get_autoname_with_number(self.account_number, self.account_name, None, self.company)
self.name = get_autoname_with_number(self.account_number, self.account_name, self.company)
def validate(self):
from erpnext.accounts.utils import validate_field_number

View File

@@ -3,10 +3,6 @@
frappe.ui.form.on('Accounting Dimension Filter', {
refresh: function(frm, cdt, cdn) {
if (frm.doc.accounting_dimension) {
frm.set_df_property('dimensions', 'label', frm.doc.accounting_dimension, cdn, 'dimension_value');
}
let help_content =
`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
<tr><td>
@@ -68,6 +64,7 @@ frappe.ui.form.on('Accounting Dimension Filter', {
frm.clear_table("dimensions");
let row = frm.add_child("dimensions");
row.accounting_dimension = frm.doc.accounting_dimension;
frm.fields_dict["dimensions"].grid.update_docfield_property("dimension_value", "label", frm.doc.accounting_dimension);
frm.refresh_field("dimensions");
frm.trigger('setup_filters');
},

View File

@@ -4,6 +4,23 @@
frappe.ui.form.on("Bank Clearance", {
setup: function(frm) {
frm.add_fetch("account", "account_currency", "account_currency");
frm.set_query("account", function() {
return {
"filters": {
"account_type": ["in",["Bank","Cash"]],
"is_group": 0,
}
};
});
frm.set_query("bank_account", function () {
return {
filters: {
'is_company_account': 1
},
};
});
},
onload: function(frm) {
@@ -12,14 +29,7 @@ frappe.ui.form.on("Bank Clearance", {
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
frm.set_value("account", default_bank_account);
frm.set_query("account", function() {
return {
"filters": {
"account_type": ["in",["Bank","Cash"]],
"is_group": 0
}
};
});
frm.set_value("from_date", frappe.datetime.month_start());
frm.set_value("to_date", frappe.datetime.month_end());

View File

@@ -99,7 +99,7 @@ class BankClearance(Document):
.where(loan_disbursement.clearance_date.isnull())
.where(loan_disbursement.disbursement_account.isin([self.bank_account, self.account]))
.orderby(loan_disbursement.disbursement_date)
.orderby(loan_disbursement.name, frappe.qb.desc)
.orderby(loan_disbursement.name, order=frappe.qb.desc)
).run(as_dict=1)
loan_repayment = frappe.qb.DocType("Loan Repayment")
@@ -126,7 +126,9 @@ class BankClearance(Document):
if frappe.db.has_column("Loan Repayment", "repay_from_salary"):
query = query.where((loan_repayment.repay_from_salary == 0))
query = query.orderby(loan_repayment.posting_date).orderby(loan_repayment.name, frappe.qb.desc)
query = query.orderby(loan_repayment.posting_date).orderby(
loan_repayment.name, order=frappe.qb.desc
)
loan_repayments = query.run(as_dict=True)

View File

@@ -43,20 +43,13 @@ frappe.ui.form.on('Bank Guarantee', {
reference_docname: function(frm) {
if (frm.doc.reference_docname && frm.doc.reference_doctype) {
let fields_to_fetch = ["grand_total"];
let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
if (frm.doc.reference_doctype == "Sales Order") {
fields_to_fetch.push("project");
}
fields_to_fetch.push(party_field);
frappe.call({
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_vouchar_detials",
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_voucher_details",
args: {
"column_list": fields_to_fetch,
"doctype": frm.doc.reference_doctype,
"docname": frm.doc.reference_docname
"bank_guarantee_type": frm.doc.bg_type,
"reference_name": frm.doc.reference_docname
},
callback: function(r) {
if (r.message) {

View File

@@ -2,11 +2,8 @@
# For license information, please see license.txt
import json
import frappe
from frappe import _
from frappe.desk.search import sanitize_searchfield
from frappe.model.document import Document
@@ -25,14 +22,18 @@ class BankGuarantee(Document):
@frappe.whitelist()
def get_vouchar_detials(column_list, doctype, docname):
column_list = json.loads(column_list)
for col in column_list:
sanitize_searchfield(col)
return frappe.db.sql(
""" select {columns} from `tab{doctype}` where name=%s""".format(
columns=", ".join(column_list), doctype=doctype
),
docname,
as_dict=1,
)[0]
def get_voucher_details(bank_guarantee_type: str, reference_name: str):
if not isinstance(reference_name, str):
raise TypeError("reference_name must be a string")
fields_to_fetch = ["grand_total"]
if bank_guarantee_type == "Receiving":
doctype = "Sales Order"
fields_to_fetch.append("customer")
fields_to_fetch.append("project")
else:
doctype = "Purchase Order"
fields_to_fetch.append("supplier")
return frappe.db.get_value(doctype, reference_name, fields_to_fetch, as_dict=True)

View File

@@ -12,6 +12,9 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
};
});
let no_bank_transactions_text =
`<div class="text-muted text-center">${__("No Matching Bank Transactions Found")}</div>`
set_field_options("no_bank_transactions", no_bank_transactions_text);
},
onload: function (frm) {

View File

@@ -81,8 +81,7 @@
},
{
"fieldname": "no_bank_transactions",
"fieldtype": "HTML",
"options": "<div class=\"text-muted text-center\">No Matching Bank Transactions Found</div>"
"fieldtype": "HTML"
}
],
"hide_toolbar": 1,
@@ -109,4 +108,4 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
}
}

View File

@@ -100,7 +100,7 @@ frappe.ui.form.on("Bank Statement Import", {
if (frm.doc.status.includes("Success")) {
frm.add_custom_button(
__("Go to {0} List", [frm.doc.reference_doctype]),
__("Go to {0} List", [__(frm.doc.reference_doctype)]),
() => frappe.set_route("List", frm.doc.reference_doctype)
);
}
@@ -141,7 +141,7 @@ frappe.ui.form.on("Bank Statement Import", {
},
show_import_status(frm) {
let import_log = JSON.parse(frm.doc.import_log || "[]");
let import_log = JSON.parse(frm.doc.statement_import_log || "[]");
let successful_records = import_log.filter((log) => log.success);
let failed_records = import_log.filter((log) => !log.success);
if (successful_records.length === 0) return;
@@ -309,7 +309,7 @@ frappe.ui.form.on("Bank Statement Import", {
// method: 'frappe.core.doctype.data_import.data_import.get_preview_from_template',
show_import_preview(frm, preview_data) {
let import_log = JSON.parse(frm.doc.import_log || "[]");
let import_log = JSON.parse(frm.doc.statement_import_log || "[]");
if (
frm.import_preview &&
@@ -439,7 +439,7 @@ frappe.ui.form.on("Bank Statement Import", {
},
show_import_log(frm) {
let import_log = JSON.parse(frm.doc.import_log || "[]");
let import_log = JSON.parse(frm.doc.statement_import_log || "[]");
let logs = import_log;
frm.toggle_display("import_log", false);
frm.toggle_display("import_log_section", logs.length > 0);

View File

@@ -24,7 +24,7 @@
"section_import_preview",
"import_preview",
"import_log_section",
"import_log",
"statement_import_log",
"show_failed_logs",
"import_log_preview",
"reference_doctype",
@@ -90,12 +90,6 @@
"options": "JSON",
"read_only": 1
},
{
"fieldname": "import_log",
"fieldtype": "Code",
"label": "Import Log",
"options": "JSON"
},
{
"fieldname": "import_log_section",
"fieldtype": "Section Break",
@@ -198,11 +192,17 @@
{
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"fieldname": "statement_import_log",
"fieldtype": "Code",
"label": "Statement Import Log",
"options": "JSON"
}
],
"hide_toolbar": 1,
"links": [],
"modified": "2021-05-12 14:17:37.777246",
"modified": "2022-09-07 11:11:40.293317",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Statement Import",

View File

@@ -1,6 +1,7 @@
{
"actions": [],
"allow_import": 1,
"autoname": "naming_series:",
"creation": "2016-05-16 11:42:29.632528",
"doctype": "DocType",
"editable_grid": 1,
@@ -9,6 +10,7 @@
"budget_against",
"company",
"cost_center",
"naming_series",
"project",
"fiscal_year",
"column_break_3",
@@ -190,15 +192,26 @@
"label": "Budget Accounts",
"options": "Budget Account",
"reqd": 1
},
{
"fieldname": "naming_series",
"fieldtype": "Data",
"hidden": 1,
"label": "Series",
"no_copy": 1,
"print_hide": 1,
"read_only": 1,
"set_only_once": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-10-06 15:13:54.055854",
"modified": "2022-10-10 22:14:36.361509",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -220,5 +233,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -5,7 +5,6 @@
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.naming import make_autoname
from frappe.utils import add_months, flt, fmt_money, get_last_day, getdate
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -23,11 +22,6 @@ class DuplicateBudgetError(frappe.ValidationError):
class Budget(Document):
def autoname(self):
self.name = make_autoname(
self.get(frappe.scrub(self.budget_against)) + "/" + self.fiscal_year + "/.###"
)
def validate(self):
if not self.get(frappe.scrub(self.budget_against)):
frappe.throw(_("{0} is mandatory").format(self.budget_against))
@@ -109,8 +103,11 @@ class Budget(Document):
):
self.applicable_on_booking_actual_expenses = 1
def before_naming(self):
self.naming_series = f"{{{frappe.scrub(self.budget_against)}}}./.{self.fiscal_year}/.###"
def validate_expense_against_budget(args):
def validate_expense_against_budget(args, expense_amount=0):
args = frappe._dict(args)
if args.get("company") and not args.fiscal_year:
@@ -178,13 +175,13 @@ def validate_expense_against_budget(args):
) # nosec
if budget_records:
validate_budget_records(args, budget_records)
validate_budget_records(args, budget_records, expense_amount)
def validate_budget_records(args, budget_records):
def validate_budget_records(args, budget_records, expense_amount):
for budget in budget_records:
if flt(budget.budget_amount):
amount = get_amount(args, budget)
amount = expense_amount or get_amount(args, budget)
yearly_action, monthly_action = get_actions(args, budget)
if monthly_action in ["Stop", "Warn"]:

View File

@@ -334,6 +334,39 @@ class TestBudget(unittest.TestCase):
budget.cancel()
jv.cancel()
def test_monthly_budget_against_main_cost_center(self):
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
from erpnext.accounts.doctype.cost_center_allocation.test_cost_center_allocation import (
create_cost_center_allocation,
)
cost_centers = [
"Main Budget Cost Center 1",
"Sub Budget Cost Center 1",
"Sub Budget Cost Center 2",
]
for cc in cost_centers:
create_cost_center(cost_center_name=cc, company="_Test Company")
create_cost_center_allocation(
"_Test Company",
"Main Budget Cost Center 1 - _TC",
{"Sub Budget Cost Center 1 - _TC": 60, "Sub Budget Cost Center 2 - _TC": 40},
)
make_budget(budget_against="Cost Center", cost_center="Main Budget Cost Center 1 - _TC")
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
400000,
"Main Budget Cost Center 1 - _TC",
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
def set_total_expense_zero(posting_date, budget_against_field=None, budget_against_CC=None):
if budget_against_field == "project":

View File

@@ -52,7 +52,7 @@ def validate_company(company):
if parent_company and (not allow_account_creation_against_child_company):
msg = _("{} is a child company.").format(frappe.bold(company)) + " "
msg += _("Please import accounts against parent company or enable {} in company master.").format(
frappe.bold("Allow Account Creation Against Child Company")
frappe.bold(_("Allow Account Creation Against Child Company"))
)
frappe.throw(msg, title=_("Wrong Company"))

View File

@@ -16,7 +16,7 @@ class CostCenter(NestedSet):
from erpnext.accounts.utils import get_autoname_with_number
self.name = get_autoname_with_number(
self.cost_center_number, self.cost_center_name, None, self.company
self.cost_center_number, self.cost_center_name, self.company
)
def validate(self):

View File

@@ -1,389 +1,138 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "ACC-ERR-.YYYY.-.#####",
"beta": 0,
"creation": "2018-04-13 18:25:55.943587",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"actions": [],
"allow_import": 1,
"autoname": "ACC-ERR-.YYYY.-.#####",
"creation": "2018-04-13 18:25:55.943587",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"posting_date",
"column_break_2",
"company",
"section_break_4",
"get_entries",
"accounts",
"section_break_6",
"total_gain_loss",
"amended_from"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Posting Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Posting Date",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "column_break_2",
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "section_break_4",
"fieldtype": "Section Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "get_entries",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Get Entries",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "get_entries",
"fieldtype": "Button",
"label": "Get Entries"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "accounts",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Exchange Rate Revaluation Account",
"length": 0,
"no_copy": 1,
"options": "Exchange Rate Revaluation Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "accounts",
"fieldtype": "Table",
"label": "Exchange Rate Revaluation Account",
"no_copy": 1,
"options": "Exchange Rate Revaluation Account",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "section_break_6",
"fieldtype": "Section Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_gain_loss",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Gain/Loss",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "total_gain_loss",
"fieldtype": "Currency",
"label": "Total Gain/Loss",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"options": "Exchange Rate Revaluation",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Exchange Rate Revaluation",
"print_hide": 1,
"read_only": 1
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:34.660715",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation",
"name_case": "",
"owner": "Administrator",
],
"is_submittable": 1,
"links": [],
"modified": "2022-11-17 10:28:03.911554",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"submit": 1,
"write": 1
},
},
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 1,
"write": 1
},
},
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"share": 1,
"submit": 1,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -233,6 +233,10 @@ def get_account_details(account, company, posting_date, party_type=None, party=N
balance = get_balance_on(
account, date=posting_date, party_type=party_type, party=party, in_account_currency=False
)
account_details = {
"account_currency": account_currency,
}
if balance:
balance_in_account_currency = get_balance_on(
account, date=posting_date, party_type=party_type, party=party
@@ -242,13 +246,14 @@ def get_account_details(account, company, posting_date, party_type=None, party=N
)
new_exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
new_balance_in_base_currency = balance_in_account_currency * new_exchange_rate
account_details = {
"account_currency": account_currency,
"balance_in_base_currency": balance,
"balance_in_account_currency": balance_in_account_currency,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
}
account_details = account_details.update(
{
"balance_in_base_currency": balance,
"balance_in_account_currency": balance_in_account_currency,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
}
)
return account_details

View File

@@ -1,475 +1,120 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"actions": [],
"creation": "2018-04-13 18:30:06.110433",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"account",
"party_type",
"party",
"column_break_2",
"account_currency",
"balance_in_account_currency",
"balances",
"current_exchange_rate",
"balance_in_base_currency",
"column_break_9",
"new_exchange_rate",
"new_balance_in_base_currency",
"gain_loss"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "party_type",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Party Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "DocType"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "party",
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Party",
"length": 0,
"no_copy": 0,
"options": "party_type",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "party_type"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "account_currency",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Account Currency",
"length": 0,
"no_copy": 0,
"options": "Currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "balance_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Balance In Account Currency",
"length": 0,
"no_copy": 0,
"options": "account_currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "balances",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldtype": "Section Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "current_exchange_rate",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Current Exchange Rate",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "balance_in_base_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Balance In Base Currency",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "Company:company:default_currency",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_9",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "new_exchange_rate",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "New Exchange Rate",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "new_balance_in_base_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "New Balance In Base Currency",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "Company:company:default_currency",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "gain_loss",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Gain/Loss",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "Company:company:default_currency",
"read_only": 1
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2019-06-26 18:57:51.762345",
"links": [],
"modified": "2022-11-17 10:26:18.302728",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation Account",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
"states": [],
"track_changes": 1
}

View File

@@ -366,7 +366,7 @@ def update_outstanding_amt(
if against_voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]:
ref_doc = frappe.get_doc(against_voucher_type, against_voucher)
# Didn't use db_set for optimisation purpose
# Didn't use db_set for optimization purpose
ref_doc.outstanding_amount = bal
frappe.db.set_value(against_voucher_type, against_voucher, "outstanding_amount", bal)

View File

@@ -173,8 +173,8 @@ frappe.ui.form.on("Journal Entry", {
var update_jv_details = function(doc, r) {
$.each(r, function(i, d) {
var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts");
row.account = d.account;
row.balance = d.balance;
frappe.model.set_value(row.doctype, row.name, "account", d.account)
frappe.model.set_value(row.doctype, row.name, "balance", d.balance)
});
refresh_field("accounts");
}
@@ -253,9 +253,6 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
out.filters.push([jvd.reference_type, party_account_field, "=", jvd.account]);
if (in_list(['Debit Note', 'Credit Note'], doc.voucher_type)) {
out.filters.push([jvd.reference_type, "is_return", "=", 1]);
}
}
if(in_list(["Sales Order", "Purchase Order"], jvd.reference_type)) {
@@ -312,8 +309,7 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
}
}
get_outstanding(doctype, docname, company, child, due_date) {
var me = this;
get_outstanding(doctype, docname, company, child) {
var args = {
"doctype": doctype,
"docname": docname,

View File

@@ -184,7 +184,9 @@ class JournalEntry(AccountsController):
}
)
tax_withholding_details = get_party_tax_withholding_details(inv, self.tax_withholding_category)
tax_withholding_details, advance_taxes, voucher_wise_amount = get_party_tax_withholding_details(
inv, self.tax_withholding_category
)
if not tax_withholding_details:
return
@@ -1208,6 +1210,7 @@ def get_outstanding(args):
args = json.loads(args)
company_currency = erpnext.get_company_currency(args.get("company"))
due_date = None
if args.get("doctype") == "Journal Entry":
condition = " and party=%(party)s" if args.get("party") else ""
@@ -1232,10 +1235,12 @@ def get_outstanding(args):
invoice = frappe.db.get_value(
args["doctype"],
args["docname"],
["outstanding_amount", "conversion_rate", scrub(party_type)],
["outstanding_amount", "conversion_rate", scrub(party_type), "due_date"],
as_dict=1,
)
due_date = invoice.get("due_date")
exchange_rate = (
invoice.conversion_rate if (args.get("account_currency") != company_currency) else 1
)
@@ -1258,6 +1263,7 @@ def get_outstanding(args):
"exchange_rate": exchange_rate,
"party_type": party_type,
"party": invoice.get(scrub(party_type)),
"reference_due_date": due_date,
}

View File

@@ -202,6 +202,7 @@
"fieldname": "reference_type",
"fieldtype": "Select",
"label": "Reference Type",
"no_copy": 1,
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance\nExchange Rate Revaluation\nInvoice Discounting\nFees\nFull and Final Statement"
},
{
@@ -209,13 +210,15 @@
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Reference Name",
"no_copy": 1,
"options": "reference_type"
},
{
"depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])",
"fieldname": "reference_due_date",
"fieldtype": "Select",
"label": "Reference Due Date"
"fieldtype": "Date",
"label": "Reference Due Date",
"no_copy": 1
},
{
"fieldname": "project",
@@ -274,19 +277,22 @@
"fieldname": "reference_detail_no",
"fieldtype": "Data",
"hidden": 1,
"label": "Reference Detail No"
"label": "Reference Detail No",
"no_copy": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2021-08-30 21:27:32.200299",
"modified": "2022-10-26 20:03:10.906259",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -2,7 +2,7 @@
// For license information, please see license.txt
frappe.ui.form.on("Journal Entry Template", {
setup: function(frm) {
refresh: function(frm) {
frappe.model.set_default_values(frm.doc);
frm.set_query("account" ,"accounts", function(){
@@ -45,21 +45,6 @@ frappe.ui.form.on("Journal Entry Template", {
frm.trigger("clear_child");
switch(frm.doc.voucher_type){
case "Opening Entry":
frm.set_value("is_opening", "Yes");
frappe.call({
type:"GET",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_opening_accounts",
args: {
"company": frm.doc.company
},
callback: function(r) {
if(r.message) {
add_accounts(frm.doc, r.message);
}
}
});
break;
case "Bank Entry":
case "Cash Entry":
frappe.call({

View File

@@ -20,15 +20,14 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
frm.dashboard.reset();
frm.doc.import_in_progress = true;
}
if (data.user != frappe.session.user) return;
if (data.count == data.total) {
setTimeout((title) => {
setTimeout(() => {
frm.doc.import_in_progress = false;
frm.clear_table("invoices");
frm.refresh_fields();
frm.page.clear_indicator();
frm.dashboard.hide_progress(title);
frappe.msgprint(__("Opening {0} Invoice created", [frm.doc.invoice_type]));
frm.dashboard.hide_progress();
frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
}, 1500, data.title);
return;
}
@@ -51,13 +50,6 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
method: "make_invoices",
freeze: 1,
freeze_message: __("Creating {0} Invoice", [frm.doc.invoice_type]),
callback: function(r) {
if (r.message.length == 1) {
frappe.msgprint(__("{0} Invoice created successfully.", [frm.doc.invoice_type]));
} else if (r.message.length < 50) {
frappe.msgprint(__("{0} Invoices created successfully.", [frm.doc.invoice_type]));
}
}
});
});

View File

@@ -257,17 +257,15 @@ def start_import(invoices):
def publish(index, total, doctype):
if total < 50:
return
frappe.publish_realtime(
"opening_invoice_creation_progress",
dict(
title=_("Opening Invoice Creation In Progress"),
message=_("Creating {} out of {} {}").format(index + 1, total, doctype),
user=frappe.session.user,
count=index + 1,
total=total,
),
user=frappe.session.user,
)

View File

@@ -1091,7 +1091,7 @@ frappe.ui.form.on('Payment Entry', {
$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; });
frm.doc.paid_amount_after_tax = frm.doc.paid_amount;
frm.doc.paid_amount_after_tax = frm.doc.base_paid_amount;
});
},
@@ -1182,7 +1182,7 @@ frappe.ui.form.on('Payment Entry', {
}
cumulated_tax_fraction += tax.tax_fraction_for_current_item;
frm.doc.paid_amount_after_tax = flt(frm.doc.paid_amount/(1+cumulated_tax_fraction))
frm.doc.paid_amount_after_tax = flt(frm.doc.base_paid_amount/(1+cumulated_tax_fraction))
});
},
@@ -1214,6 +1214,7 @@ frappe.ui.form.on('Payment Entry', {
frm.doc.total_taxes_and_charges = 0.0;
frm.doc.base_total_taxes_and_charges = 0.0;
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
let actual_tax_dict = {};
// maintain actual tax rate based on idx
@@ -1234,8 +1235,8 @@ frappe.ui.form.on('Payment Entry', {
}
}
tax.tax_amount = current_tax_amount;
tax.base_tax_amount = tax.tax_amount * frm.doc.source_exchange_rate;
// tax accounts are only in company currency
tax.base_tax_amount = current_tax_amount;
current_tax_amount *= (tax.add_deduct_tax == "Deduct") ? -1.0 : 1.0;
if(i==0) {
@@ -1244,9 +1245,29 @@ frappe.ui.form.on('Payment Entry', {
tax.total = flt(frm.doc["taxes"][i-1].total + current_tax_amount, precision("total", tax));
}
tax.base_total = tax.total * frm.doc.source_exchange_rate;
frm.doc.total_taxes_and_charges += current_tax_amount;
frm.doc.base_total_taxes_and_charges += current_tax_amount * frm.doc.source_exchange_rate;
// tac accounts are only in company currency
tax.base_total = tax.total
// calculate total taxes and base total taxes
if(frm.doc.payment_type == "Pay") {
// tax accounts only have company currency
if(tax.currency != frm.doc.paid_to_account_currency) {
//total_taxes_and_charges has the target currency. so using target conversion rate
frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.target_exchange_rate);
} else {
frm.doc.total_taxes_and_charges += current_tax_amount;
}
} else if(frm.doc.payment_type == "Receive") {
if(tax.currency != frm.doc.paid_from_account_currency) {
//total_taxes_and_charges has the target currency. so using source conversion rate
frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.source_exchange_rate);
} else {
frm.doc.total_taxes_and_charges += current_tax_amount;
}
}
frm.doc.base_total_taxes_and_charges += tax.base_tax_amount;
frm.refresh_field('taxes');
frm.refresh_field('total_taxes_and_charges');

View File

@@ -62,7 +62,6 @@ class PaymentEntry(AccountsController):
self.set_missing_values()
self.validate_payment_type()
self.validate_party_details()
self.validate_bank_accounts()
self.set_exchange_rate()
self.validate_mandatory()
self.validate_reference_documents()
@@ -181,7 +180,11 @@ class PaymentEntry(AccountsController):
frappe.throw(_("Party is mandatory"))
_party_name = "title" if self.party_type == "Shareholder" else self.party_type.lower() + "_name"
self.party_name = frappe.db.get_value(self.party_type, self.party, _party_name)
if frappe.db.has_column(self.party_type, _party_name):
self.party_name = frappe.db.get_value(self.party_type, self.party, _party_name)
else:
self.party_name = frappe.db.get_value(self.party_type, self.party, "name")
if self.party:
if not self.party_balance:
@@ -239,23 +242,6 @@ class PaymentEntry(AccountsController):
if not frappe.db.exists(self.party_type, self.party):
frappe.throw(_("Invalid {0}: {1}").format(self.party_type, self.party))
if self.party_account and self.party_type in ("Customer", "Supplier"):
self.validate_account_type(
self.party_account, [erpnext.get_party_account_type(self.party_type)]
)
def validate_bank_accounts(self):
if self.payment_type in ("Pay", "Internal Transfer"):
self.validate_account_type(self.paid_from, ["Bank", "Cash"])
if self.payment_type in ("Receive", "Internal Transfer"):
self.validate_account_type(self.paid_to, ["Bank", "Cash"])
def validate_account_type(self, account, account_types):
account_type = frappe.db.get_value("Account", account, "account_type")
# if account_type not in account_types:
# frappe.throw(_("Account Type for {0} must be {1}").format(account, comma_or(account_types)))
def set_exchange_rate(self, ref_doc=None):
self.set_source_exchange_rate(ref_doc)
self.set_target_exchange_rate(ref_doc)
@@ -295,6 +281,9 @@ class PaymentEntry(AccountsController):
def validate_reference_documents(self):
valid_reference_doctypes = self.get_valid_reference_doctypes()
if not valid_reference_doctypes:
return
for d in self.get("references"):
if not d.allocated_amount:
continue
@@ -362,7 +351,7 @@ class PaymentEntry(AccountsController):
if not d.allocated_amount:
continue
if d.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Fees"):
if d.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
outstanding_amount, is_return = frappe.get_cached_value(
d.reference_doctype, d.reference_name, ["outstanding_amount", "is_return"]
)
@@ -933,6 +922,13 @@ class PaymentEntry(AccountsController):
)
if not d.included_in_paid_amount:
if get_account_currency(payment_account) != self.company_currency:
if self.payment_type == "Receive":
exchange_rate = self.target_exchange_rate
elif self.payment_type in ["Pay", "Internal Transfer"]:
exchange_rate = self.source_exchange_rate
base_tax_amount = flt((tax_amount / exchange_rate), self.precision("paid_amount"))
gl_entries.append(
self.get_gl_dict(
{
@@ -981,7 +977,9 @@ class PaymentEntry(AccountsController):
if self.payment_type in ("Receive", "Pay") and self.party:
for d in self.get("references"):
if d.allocated_amount and d.reference_doctype in frappe.get_hooks("advance_payment_doctypes"):
frappe.get_doc(d.reference_doctype, d.reference_name).set_total_advance_paid()
frappe.get_doc(
d.reference_doctype, d.reference_name, for_update=True
).set_total_advance_paid()
def on_recurring(self, reference_doc, auto_repeat_doc):
self.reference_no = reference_doc.name
@@ -1026,7 +1024,7 @@ class PaymentEntry(AccountsController):
for fieldname in tax_fields:
tax.set(fieldname, 0.0)
self.paid_amount_after_tax = self.paid_amount
self.paid_amount_after_tax = self.base_paid_amount
def determine_exclusive_rate(self):
if not any(cint(tax.included_in_paid_amount) for tax in self.get("taxes")):
@@ -1045,7 +1043,7 @@ class PaymentEntry(AccountsController):
cumulated_tax_fraction += tax.tax_fraction_for_current_item
self.paid_amount_after_tax = flt(self.paid_amount / (1 + cumulated_tax_fraction))
self.paid_amount_after_tax = flt(self.base_paid_amount / (1 + cumulated_tax_fraction))
def calculate_taxes(self):
self.total_taxes_and_charges = 0.0
@@ -1068,7 +1066,7 @@ class PaymentEntry(AccountsController):
current_tax_amount += actual_tax_dict[tax.idx]
tax.tax_amount = current_tax_amount
tax.base_tax_amount = tax.tax_amount * self.source_exchange_rate
tax.base_tax_amount = current_tax_amount
if tax.add_deduct_tax == "Deduct":
current_tax_amount *= -1.0
@@ -1082,14 +1080,20 @@ class PaymentEntry(AccountsController):
self.get("taxes")[i - 1].total + current_tax_amount, self.precision("total", tax)
)
tax.base_total = tax.total * self.source_exchange_rate
tax.base_total = tax.total
if self.payment_type == "Pay":
self.base_total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
self.total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
else:
self.base_total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
self.total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
if tax.currency != self.paid_to_account_currency:
self.total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
else:
self.total_taxes_and_charges += current_tax_amount
elif self.payment_type == "Receive":
if tax.currency != self.paid_from_account_currency:
self.total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
else:
self.total_taxes_and_charges += current_tax_amount
self.base_total_taxes_and_charges += tax.base_tax_amount
if self.get("taxes"):
self.paid_amount_after_tax = self.get("taxes")[-1].base_total
@@ -1184,6 +1188,7 @@ def get_outstanding_reference_documents(args):
ple = qb.DocType("Payment Ledger Entry")
common_filter = []
posting_and_due_date = []
# confirm that Supplier is not blocked
if args.get("party_type") == "Supplier":
@@ -1200,7 +1205,7 @@ def get_outstanding_reference_documents(args):
party_account_currency = get_account_currency(args.get("party_account"))
company_currency = frappe.get_cached_value("Company", args.get("company"), "default_currency")
# Get positive outstanding sales /purchase invoices/ Fees
# Get positive outstanding sales /purchase invoices
condition = ""
if args.get("voucher_type") and args.get("voucher_no"):
condition = " and voucher_type={0} and voucher_no={1}".format(
@@ -1224,7 +1229,7 @@ def get_outstanding_reference_documents(args):
condition += " and {0} between '{1}' and '{2}'".format(
fieldname, args.get(date_fields[0]), args.get(date_fields[1])
)
common_filter.append(ple[fieldname][args.get(date_fields[0]) : args.get(date_fields[1])])
posting_and_due_date.append(ple[fieldname][args.get(date_fields[0]) : args.get(date_fields[1])])
if args.get("company"):
condition += " and company = {0}".format(frappe.db.escape(args.get("company")))
@@ -1235,6 +1240,7 @@ def get_outstanding_reference_documents(args):
args.get("party"),
args.get("party_account"),
common_filter=common_filter,
posting_date=posting_and_due_date,
min_outstanding=args.get("outstanding_amt_greater_than"),
max_outstanding=args.get("outstanding_amt_less_than"),
)
@@ -1595,10 +1601,11 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
elif reference_doctype != "Journal Entry":
if not total_amount:
if party_account_currency == company_currency:
total_amount = ref_doc.base_grand_total
# for handling cases that don't have multi-currency (base field)
total_amount = ref_doc.get("grand_total") or ref_doc.get("base_grand_total")
exchange_rate = 1
else:
total_amount = ref_doc.grand_total
total_amount = ref_doc.get("grand_total")
if not exchange_rate:
# Get the exchange rate from the original ref doc
# or get it based on the posting date of the ref doc.
@@ -1609,7 +1616,7 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
if reference_doctype in ("Sales Invoice", "Purchase Invoice"):
outstanding_amount = ref_doc.get("outstanding_amount")
else:
outstanding_amount = flt(total_amount) - flt(ref_doc.advance_paid)
outstanding_amount = flt(total_amount) - flt(ref_doc.get("advance_paid"))
else:
# Get the exchange rate based on the posting date of the ref doc.
@@ -1627,16 +1634,23 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
@frappe.whitelist()
def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=None):
def get_payment_entry(
dt, dn, party_amount=None, bank_account=None, bank_amount=None, party_type=None, payment_type=None
):
reference_doc = None
doc = frappe.get_doc(dt, dn)
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) > 0:
frappe.throw(_("Can only make payment against unbilled {0}").format(dt))
party_type = set_party_type(dt)
if not party_type:
party_type = set_party_type(dt)
party_account = set_party_account(dt, dn, doc, party_type)
party_account_currency = set_party_account_currency(dt, party_account, doc)
payment_type = set_payment_type(dt, doc)
if not payment_type:
payment_type = set_payment_type(dt, doc)
grand_total, outstanding_amount = set_grand_total_and_outstanding_amount(
party_amount, dt, party_account_currency, doc
)
@@ -1786,8 +1800,6 @@ def set_party_account(dt, dn, doc, party_type):
party_account = get_party_account_based_on_invoice_discounting(dn) or doc.debit_to
elif dt == "Purchase Invoice":
party_account = doc.credit_to
elif dt == "Fees":
party_account = doc.receivable_account
else:
party_account = get_party_account(party_type, doc.get(party_type.lower()), doc.company)
return party_account
@@ -1803,8 +1815,7 @@ def set_party_account_currency(dt, party_account, doc):
def set_payment_type(dt, doc):
if (
dt == "Sales Order"
or (dt in ("Sales Invoice", "Fees", "Dunning") and doc.outstanding_amount > 0)
dt == "Sales Order" or (dt in ("Sales Invoice", "Dunning") and doc.outstanding_amount > 0)
) or (dt == "Purchase Invoice" and doc.outstanding_amount < 0):
payment_type = "Receive"
else:
@@ -1822,18 +1833,15 @@ def set_grand_total_and_outstanding_amount(party_amount, dt, party_account_curre
else:
grand_total = doc.rounded_total or doc.grand_total
outstanding_amount = doc.outstanding_amount
elif dt == "Fees":
grand_total = doc.grand_total
outstanding_amount = doc.outstanding_amount
elif dt == "Dunning":
grand_total = doc.grand_total
outstanding_amount = doc.grand_total
else:
if party_account_currency == doc.company_currency:
grand_total = flt(doc.get("base_rounded_total") or doc.base_grand_total)
grand_total = flt(doc.get("base_rounded_total") or doc.get("base_grand_total"))
else:
grand_total = flt(doc.get("rounded_total") or doc.grand_total)
outstanding_amount = grand_total - flt(doc.advance_paid)
grand_total = flt(doc.get("rounded_total") or doc.get("grand_total"))
outstanding_amount = doc.get("outstanding_amount") or (grand_total - flt(doc.advance_paid))
return grand_total, outstanding_amount

View File

@@ -4,6 +4,7 @@
import unittest
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.utils import flt, nowdate
@@ -722,6 +723,46 @@ class TestPaymentEntry(FrappeTestCase):
flt(payment_entry.total_taxes_and_charges, 2), flt(10 / payment_entry.target_exchange_rate, 2)
)
def test_gl_of_multi_currency_payment_with_taxes(self):
payment_entry = create_payment_entry(
party="_Test Supplier USD", paid_to="_Test Payable USD - _TC", save=True
)
payment_entry.append(
"taxes",
{
"account_head": "_Test Account Service Tax - _TC",
"charge_type": "Actual",
"tax_amount": 100,
"add_deduct_tax": "Add",
"description": "Test",
},
)
payment_entry.target_exchange_rate = 80
payment_entry.received_amount = 12.5
payment_entry = payment_entry.submit()
gle = qb.DocType("GL Entry")
gl_entries = (
qb.from_(gle)
.select(
gle.account,
gle.debit,
gle.credit,
gle.debit_in_account_currency,
gle.credit_in_account_currency,
)
.orderby(gle.account)
.where(gle.voucher_no == payment_entry.name)
.run()
)
expected_gl_entries = (
("_Test Account Service Tax - _TC", 100.0, 0.0, 100.0, 0.0),
("_Test Bank - _TC", 0.0, 1100.0, 0.0, 1100.0),
("_Test Payable USD - _TC", 1000.0, 0.0, 12.5, 0),
)
self.assertEqual(gl_entries, expected_gl_entries)
def test_payment_entry_against_onhold_purchase_invoice(self):
pi = make_purchase_invoice()

View File

@@ -22,7 +22,8 @@
"amount",
"account_currency",
"amount_in_account_currency",
"delinked"
"delinked",
"remarks"
],
"fields": [
{
@@ -136,12 +137,17 @@
"fieldtype": "Link",
"label": "Finance Book",
"options": "Finance Book"
},
{
"fieldname": "remarks",
"fieldtype": "Text",
"label": "Remarks"
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-07-11 09:13:54.379168",
"modified": "2022-08-22 15:32:56.629430",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Ledger Entry",

View File

@@ -3,12 +3,13 @@
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.stock.doctype.item.test_item import create_item
@@ -127,6 +128,25 @@ class TestPaymentLedgerEntry(FrappeTestCase):
payment.posting_date = posting_date
return payment
def create_sales_order(
self, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
):
so = make_sales_order(
company=self.company,
transaction_date=posting_date,
customer=self.customer,
item_code=self.item,
cost_center=self.cost_center,
warehouse=self.warehouse,
debit_to=self.debit_to,
currency="INR",
qty=qty,
rate=100,
do_not_save=do_not_save,
do_not_submit=do_not_submit,
)
return so
def clear_old_entries(self):
doctype_list = [
"GL Entry",
@@ -406,3 +426,89 @@ class TestPaymentLedgerEntry(FrappeTestCase):
]
self.assertEqual(pl_entries_for_crnote[0], expected_values[0])
self.assertEqual(pl_entries_for_crnote[1], expected_values[1])
@change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
)
def test_multi_payment_unlink_on_invoice_cancellation(self):
transaction_date = nowdate()
amount = 100
si = self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
for amt in [40, 40, 20]:
# payment 1
pe = get_payment_entry(si.doctype, si.name)
pe.paid_amount = amt
pe.get("references")[0].allocated_amount = amt
pe = pe.save().submit()
si.reload()
si.cancel()
entries = frappe.db.get_list(
"Payment Ledger Entry",
filters={"against_voucher_type": si.doctype, "against_voucher_no": si.name, "delinked": 0},
)
self.assertEqual(entries, [])
# with references removed, deletion should be possible
si.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, si.doctype, si.name)
@change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
)
def test_multi_je_unlink_on_invoice_cancellation(self):
transaction_date = nowdate()
amount = 100
si = self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
# multiple JE's against invoice
for amt in [40, 40, 20]:
je1 = self.create_journal_entry(
self.income_account, self.debit_to, amt, posting_date=transaction_date
)
je1.get("accounts")[1].party_type = "Customer"
je1.get("accounts")[1].party = self.customer
je1.get("accounts")[1].reference_type = si.doctype
je1.get("accounts")[1].reference_name = si.name
je1 = je1.save().submit()
si.reload()
si.cancel()
entries = frappe.db.get_list(
"Payment Ledger Entry",
filters={"against_voucher_type": si.doctype, "against_voucher_no": si.name, "delinked": 0},
)
self.assertEqual(entries, [])
# with references removed, deletion should be possible
si.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, si.doctype, si.name)
@change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
)
def test_advance_payment_unlink_on_order_cancellation(self):
transaction_date = nowdate()
amount = 100
so = self.create_sales_order(qty=1, rate=amount, posting_date=transaction_date).save().submit()
pe = get_payment_entry(so.doctype, so.name).save().submit()
so.reload()
so.cancel()
entries = frappe.db.get_list(
"Payment Ledger Entry",
filters={"against_voucher_type": so.doctype, "against_voucher_no": so.name, "delinked": 0},
)
self.assertEqual(entries, [])
# with references removed, deletion should be possible
so.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, so.doctype, so.name)

View File

@@ -14,6 +14,7 @@ from erpnext.accounts.utils import (
QueryPaymentLedger,
get_outstanding_invoices,
reconcile_against_document,
update_reference_in_payment_entry,
)
from erpnext.controllers.accounts_controller import get_advance_payment_entries
@@ -22,6 +23,7 @@ class PaymentReconciliation(Document):
def __init__(self, *args, **kwargs):
super(PaymentReconciliation, self).__init__(*args, **kwargs)
self.common_filter_conditions = []
self.ple_posting_date_filter = []
@frappe.whitelist()
def get_unreconciled_entries(self):
@@ -150,6 +152,7 @@ class PaymentReconciliation(Document):
return_outstanding = ple_query.get_voucher_outstandings(
vouchers=return_invoices,
common_filter=self.common_filter_conditions,
posting_date=self.ple_posting_date_filter,
min_outstanding=-(self.minimum_payment_amount) if self.minimum_payment_amount else None,
max_outstanding=-(self.maximum_payment_amount) if self.maximum_payment_amount else None,
get_payments=True,
@@ -187,6 +190,7 @@ class PaymentReconciliation(Document):
self.party,
self.receivable_payable_account,
common_filter=self.common_filter_conditions,
posting_date=self.ple_posting_date_filter,
min_outstanding=self.minimum_invoice_amount if self.minimum_invoice_amount else None,
max_outstanding=self.maximum_invoice_amount if self.maximum_invoice_amount else None,
)
@@ -209,6 +213,23 @@ class PaymentReconciliation(Document):
inv.currency = entry.get("currency")
inv.outstanding_amount = flt(entry.get("outstanding_amount"))
def get_difference_amount(self, allocated_entry):
if allocated_entry.get("reference_type") != "Payment Entry":
return
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "debit_in_account_currency"
)
row = self.get_payment_details(allocated_entry, dr_or_cr)
doc = frappe.get_doc(allocated_entry.reference_type, allocated_entry.reference_name)
update_reference_in_payment_entry(row, doc, do_not_save=True)
return doc.difference_amount
@frappe.whitelist()
def allocate_entries(self, args):
self.validate_entries()
@@ -224,12 +245,16 @@ class PaymentReconciliation(Document):
res = self.get_allocated_entry(pay, inv, pay["amount"])
inv["outstanding_amount"] = flt(inv.get("outstanding_amount")) - flt(pay.get("amount"))
pay["amount"] = 0
res.difference_amount = self.get_difference_amount(res)
if pay.get("amount") == 0:
entries.append(res)
break
elif inv.get("outstanding_amount") == 0:
entries.append(res)
continue
else:
break
@@ -350,6 +375,7 @@ class PaymentReconciliation(Document):
def build_qb_filter_conditions(self, get_invoices=False, get_return_invoices=False):
self.common_filter_conditions.clear()
self.ple_posting_date_filter.clear()
ple = qb.DocType("Payment Ledger Entry")
self.common_filter_conditions.append(ple.company == self.company)
@@ -359,15 +385,15 @@ class PaymentReconciliation(Document):
if get_invoices:
if self.from_invoice_date:
self.common_filter_conditions.append(ple.posting_date.gte(self.from_invoice_date))
self.ple_posting_date_filter.append(ple.posting_date.gte(self.from_invoice_date))
if self.to_invoice_date:
self.common_filter_conditions.append(ple.posting_date.lte(self.to_invoice_date))
self.ple_posting_date_filter.append(ple.posting_date.lte(self.to_invoice_date))
elif get_return_invoices:
if self.from_payment_date:
self.common_filter_conditions.append(ple.posting_date.gte(self.from_payment_date))
self.ple_posting_date_filter.append(ple.posting_date.gte(self.from_payment_date))
if self.to_payment_date:
self.common_filter_conditions.append(ple.posting_date.lte(self.to_payment_date))
self.ple_posting_date_filter.append(ple.posting_date.lte(self.to_payment_date))
def get_conditions(self, get_payments=False):
condition = " and company = '{0}' ".format(self.company)

View File

@@ -283,6 +283,41 @@ class TestPaymentReconciliation(FrappeTestCase):
self.assertEqual(len(pr.get("invoices")), 2)
self.assertEqual(len(pr.get("payments")), 2)
def test_filter_posting_date_case2(self):
"""
Posting date should not affect outstanding amount calculation
"""
from_date = add_days(nowdate(), -30)
to_date = nowdate()
self.create_payment_entry(amount=25, posting_date=from_date).submit()
self.create_sales_invoice(rate=25, qty=1, posting_date=to_date)
pr = self.create_payment_reconciliation()
pr.from_invoice_date = pr.from_payment_date = from_date
pr.to_invoice_date = pr.to_payment_date = to_date
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 1)
self.assertEqual(len(pr.payments), 1)
invoices = [x.as_dict() for x in pr.invoices]
payments = [x.as_dict() for x in pr.payments]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.reconcile()
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 0)
self.assertEqual(len(pr.payments), 0)
pr.from_invoice_date = pr.from_payment_date = to_date
pr.to_invoice_date = pr.to_payment_date = to_date
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 0)
def test_filter_invoice_limit(self):
# check filter condition - invoice limit
transaction_date = nowdate()

View File

@@ -186,8 +186,10 @@
{
"fetch_from": "bank_account.bank",
"fieldname": "bank",
"fieldtype": "Read Only",
"label": "Bank"
"fieldtype": "Link",
"label": "Bank",
"options": "Bank",
"read_only": 1
},
{
"fetch_from": "bank_account.bank_account_no",
@@ -366,10 +368,11 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-09-18 12:24:14.178853",
"modified": "2022-09-30 16:19:43.680025",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -401,5 +404,6 @@
}
],
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -39,6 +39,7 @@
{
"columns": 2,
"fetch_from": "payment_term.description",
"fetch_if_empty": 1,
"fieldname": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
@@ -159,7 +160,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-04-28 05:41:35.084233",
"modified": "2022-09-16 13:57:06.382859",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
@@ -168,5 +169,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -25,7 +25,7 @@ frappe.ui.form.on('POS Closing Entry', {
frappe.realtime.on('closing_process_complete', async function(data) {
await frm.reload_doc();
if (frm.doc.status == 'Failed' && frm.doc.error_message && data.user == frappe.session.user) {
if (frm.doc.status == 'Failed' && frm.doc.error_message) {
frappe.msgprint({
title: __('POS Closing Failed'),
message: frm.doc.error_message,
@@ -36,6 +36,15 @@ frappe.ui.form.on('POS Closing Entry', {
});
set_html_data(frm);
if (frm.doc.docstatus == 1) {
if (!frm.doc.posting_date) {
frm.set_value("posting_date", frappe.datetime.nowdate());
}
if (!frm.doc.posting_time) {
frm.set_value("posting_time", frappe.datetime.now_time());
}
}
},
refresh: function(frm) {

View File

@@ -11,6 +11,7 @@
"period_end_date",
"column_break_3",
"posting_date",
"posting_time",
"pos_opening_entry",
"status",
"section_break_5",
@@ -51,7 +52,6 @@
"fieldtype": "Datetime",
"in_list_view": 1,
"label": "Period End Date",
"read_only": 1,
"reqd": 1
},
{
@@ -219,6 +219,13 @@
"fieldtype": "Small Text",
"label": "Error",
"read_only": 1
},
{
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
}
],
"is_submittable": 1,
@@ -228,10 +235,11 @@
"link_fieldname": "pos_closing_entry"
}
],
"modified": "2021-10-20 16:19:25.340565",
"modified": "2022-08-01 11:37:14.991228",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Closing Entry",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
@@ -278,5 +286,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -15,6 +15,9 @@ from erpnext.controllers.status_updater import StatusUpdater
class POSClosingEntry(StatusUpdater):
def validate(self):
self.posting_date = self.posting_date or frappe.utils.nowdate()
self.posting_time = self.posting_time or frappe.utils.nowtime()
if frappe.db.get_value("POS Opening Entry", self.pos_opening_entry, "status") != "Open":
frappe.throw(_("Selected POS Opening Entry should be open."), title=_("Invalid Opening Entry"))

View File

@@ -343,7 +343,8 @@
"no_copy": 1,
"options": "POS Invoice",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"default": "0",
@@ -1553,7 +1554,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2022-03-22 13:00:24.166684",
"modified": "2022-09-30 03:49:50.455199",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -239,14 +239,14 @@ class POSInvoice(SalesInvoice):
frappe.bold(d.warehouse),
frappe.bold(d.qty),
)
if flt(available_stock) <= 0:
if is_stock_item and flt(available_stock) <= 0:
frappe.throw(
_("Row #{}: Item Code: {} is not available under warehouse {}.").format(
d.idx, item_code, warehouse
),
title=_("Item Unavailable"),
)
elif flt(available_stock) < flt(d.qty):
elif is_stock_item and flt(available_stock) < flt(d.qty):
frappe.throw(
_(
"Row #{}: Stock quantity not enough for Item Code: {} under warehouse {}. Available quantity {}."
@@ -632,11 +632,12 @@ def get_stock_availability(item_code, warehouse):
pos_sales_qty = get_pos_reserved_qty(item_code, warehouse)
return bin_qty - pos_sales_qty, is_stock_item
else:
is_stock_item = False
is_stock_item = True
if frappe.db.exists("Product Bundle", item_code):
return get_bundle_availability(item_code, warehouse), is_stock_item
else:
# Is a service item
is_stock_item = False
# Is a service item or non_stock item
return 0, is_stock_item
@@ -650,7 +651,9 @@ def get_bundle_availability(bundle_item_code, warehouse):
available_qty = item_bin_qty - item_pos_reserved_qty
max_available_bundles = available_qty / item.qty
if bundle_bin_qty > max_available_bundles:
if bundle_bin_qty > max_available_bundles and frappe.get_value(
"Item", item.item_code, "is_stock_item"
):
bundle_bin_qty = max_available_bundles
pos_sales_qty = get_pos_reserved_qty(bundle_item_code, warehouse)

View File

@@ -495,6 +495,67 @@ class TestPOSInvoice(unittest.TestCase):
self.assertRaises(frappe.ValidationError, pos.submit)
def test_value_error_on_serial_no_validation(self):
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
se = make_serialized_item(
company="_Test Company",
target_warehouse="Stores - _TC",
cost_center="Main - _TC",
expense_account="Cost of Goods Sold - _TC",
)
serial_nos = se.get("items")[0].serial_no
# make a pos invoice
pos = create_pos_invoice(
company="_Test Company",
debit_to="Debtors - _TC",
account_for_change_amount="Cash - _TC",
warehouse="Stores - _TC",
income_account="Sales - _TC",
expense_account="Cost of Goods Sold - _TC",
cost_center="Main - _TC",
item=se.get("items")[0].item_code,
rate=1000,
qty=1,
do_not_save=1,
)
pos.get("items")[0].has_serial_no = 1
pos.get("items")[0].serial_no = serial_nos.split("\n")[0]
pos.set("payments", [])
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
)
pos = pos.save().submit()
# make a return
pos_return = make_sales_return(pos.name)
pos_return.paid_amount = pos_return.grand_total
pos_return.save()
pos_return.submit()
# set docstatus to 2 for pos to trigger this issue
frappe.db.set_value("POS Invoice", pos.name, "docstatus", 2)
pos2 = create_pos_invoice(
company="_Test Company",
debit_to="Debtors - _TC",
account_for_change_amount="Cash - _TC",
warehouse="Stores - _TC",
income_account="Sales - _TC",
expense_account="Cost of Goods Sold - _TC",
cost_center="Main - _TC",
item=se.get("items")[0].item_code,
rate=1000,
qty=1,
do_not_save=1,
)
pos2.get("items")[0].has_serial_no = 1
pos2.get("items")[0].serial_no = serial_nos.split("\n")[0]
# Value error should not be triggered on validation
pos2.save()
def test_loyalty_points(self):
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,

View File

@@ -8,6 +8,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
"has_item_scanned",
"item_code",
"col_break1",
"item_name",
@@ -808,11 +809,19 @@
"fieldtype": "Check",
"label": "Grant Commission",
"read_only": 1
},
{
"default": "0",
"depends_on": "barcode",
"fieldname": "has_item_scanned",
"fieldtype": "Check",
"label": "Has Item Scanned",
"read_only": 1
}
],
"istable": 1,
"links": [],
"modified": "2021-10-05 12:23:47.506290",
"modified": "2022-11-02 12:52:39.125295",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Item",
@@ -820,5 +829,6 @@
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -6,6 +6,7 @@
"engine": "InnoDB",
"field_order": [
"posting_date",
"posting_time",
"merge_invoices_based_on",
"column_break_3",
"pos_closing_entry",
@@ -105,12 +106,19 @@
"label": "Customer Group",
"mandatory_depends_on": "eval:doc.merge_invoices_based_on == 'Customer Group'",
"options": "Customer Group"
},
{
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-09-14 11:17:19.001142",
"modified": "2022-08-01 11:36:42.456429",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Merge Log",
@@ -173,5 +181,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -9,7 +9,7 @@ from frappe import _
from frappe.core.page.background_jobs.background_jobs import get_info
from frappe.model.document import Document
from frappe.model.mapper import map_child_doc, map_doc
from frappe.utils import cint, flt, getdate, nowdate
from frappe.utils import cint, flt, get_time, getdate, nowdate, nowtime
from frappe.utils.background_jobs import enqueue
from frappe.utils.scheduler import is_scheduler_inactive
@@ -99,6 +99,7 @@ class POSInvoiceMergeLog(Document):
sales_invoice.is_consolidated = 1
sales_invoice.set_posting_time = 1
sales_invoice.posting_date = getdate(self.posting_date)
sales_invoice.posting_time = get_time(self.posting_time)
sales_invoice.save()
sales_invoice.submit()
@@ -115,6 +116,7 @@ class POSInvoiceMergeLog(Document):
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()
@@ -402,6 +404,9 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
merge_log.posting_date = (
getdate(closing_entry.get("posting_date")) if closing_entry else nowdate()
)
merge_log.posting_time = (
get_time(closing_entry.get("posting_time")) if closing_entry else nowtime()
)
merge_log.customer = customer
merge_log.pos_closing_entry = closing_entry.get("name") if closing_entry else None
@@ -426,7 +431,7 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
finally:
frappe.db.commit()
frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def cancel_merge_logs(merge_logs, closing_entry=None):
@@ -453,7 +458,7 @@ def cancel_merge_logs(merge_logs, closing_entry=None):
finally:
frappe.db.commit()
frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def enqueue_job(job, **kwargs):

View File

@@ -43,6 +43,7 @@
"currency",
"write_off_account",
"write_off_cost_center",
"write_off_limit",
"account_for_change_amount",
"disable_rounded_total",
"column_break_23",
@@ -360,6 +361,14 @@
"fieldtype": "Check",
"label": "Validate Stock on Save"
},
{
"default": "1",
"description": "Auto write off precision loss while consolidation",
"fieldname": "write_off_limit",
"fieldtype": "Currency",
"label": "Write Off Limit",
"reqd": 1
},
{
"default": "0",
"description": "If enabled, the consolidated invoices will have rounded total disabled",
@@ -393,7 +402,7 @@
"link_fieldname": "pos_profile"
}
],
"modified": "2022-07-21 11:16:46.911173",
"modified": "2022-08-10 12:57:06.241439",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",

View File

@@ -52,7 +52,10 @@
"free_item_rate",
"column_break_42",
"free_item_uom",
"round_free_qty",
"is_recursive",
"recurse_for",
"apply_recursion_over",
"section_break_23",
"valid_from",
"valid_upto",
@@ -176,7 +179,7 @@
},
{
"collapsible": 1,
"depends_on": "eval:doc.apply_on != 'Transaction'",
"depends_on": "eval:doc.apply_on != 'Transaction' && !doc.mixed_conditions",
"fieldname": "section_break_18",
"fieldtype": "Section Break",
"label": "Discount on Other Item"
@@ -297,12 +300,12 @@
{
"fieldname": "min_qty",
"fieldtype": "Float",
"label": "Min Qty"
"label": "Min Qty (As Per Stock UOM)"
},
{
"fieldname": "max_qty",
"fieldtype": "Float",
"label": "Max Qty"
"label": "Max Qty (As Per Stock UOM)"
},
{
"fieldname": "column_break_21",
@@ -481,7 +484,7 @@
"description": "System will notify to increase or decrease quantity or amount ",
"fieldname": "threshold_percentage",
"fieldtype": "Percent",
"label": "Threshold for Suggestion"
"label": "Threshold for Suggestion (In Percentage)"
},
{
"description": "Higher the number, higher the priority",
@@ -578,15 +581,38 @@
"fieldtype": "Select",
"label": "Naming Series",
"options": "PRLE-.####"
},
{
"default": "0",
"fieldname": "round_free_qty",
"fieldtype": "Check",
"label": "Round Free Qty"
},
{
"depends_on": "is_recursive",
"description": "Give free item for every N quantity",
"fieldname": "recurse_for",
"fieldtype": "Float",
"label": "Recurse Every (As Per Transaction UOM)",
"mandatory_depends_on": "is_recursive"
},
{
"default": "0",
"depends_on": "is_recursive",
"description": "Qty for which recursion isn't applicable.",
"fieldname": "apply_recursion_over",
"fieldtype": "Float",
"label": "Apply Recursion Over (As Per Transaction UOM)"
}
],
"icon": "fa fa-gift",
"idx": 1,
"links": [],
"modified": "2021-08-06 15:10:04.219321",
"modified": "2022-10-13 19:05:35.056304",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -642,5 +668,6 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "title"
}
}

View File

@@ -24,6 +24,7 @@ class PricingRule(Document):
self.validate_applicable_for_selling_or_buying()
self.validate_min_max_amt()
self.validate_min_max_qty()
self.validate_recursion()
self.cleanup_fields_value()
self.validate_rate_or_discount()
self.validate_max_discount()
@@ -109,6 +110,18 @@ class PricingRule(Document):
if self.min_amt and self.max_amt and flt(self.min_amt) > flt(self.max_amt):
throw(_("Min Amt can not be greater than Max Amt"))
def validate_recursion(self):
if self.price_or_product_discount != "Product":
return
if self.free_item or self.same_item:
if flt(self.recurse_for) <= 0:
self.recurse_for = 1
if self.is_recursive:
if flt(self.apply_recursion_over) > flt(self.min_qty):
throw(_("Min Qty should be greater than Recurse Over Qty"))
if flt(self.apply_recursion_over) < 0:
throw(_("Recurse Over Qty cannot be less than 0"))
def cleanup_fields_value(self):
for logic_field in ["apply_on", "applicable_for", "rate_or_discount"]:
fieldname = frappe.scrub(self.get(logic_field) or "")
@@ -268,6 +281,18 @@ def get_serial_no_for_item(args):
return item_details
def update_pricing_rule_uom(pricing_rule, args):
child_doc = {"Item Code": "items", "Item Group": "item_groups", "Brand": "brands"}.get(
pricing_rule.apply_on
)
apply_on_field = frappe.scrub(pricing_rule.apply_on)
for row in pricing_rule.get(child_doc):
if row.get(apply_on_field) == args.get(apply_on_field):
pricing_rule.uom = row.uom
def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=False):
from erpnext.accounts.doctype.pricing_rule.utils import (
get_applied_pricing_rules,
@@ -324,7 +349,8 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
if isinstance(pricing_rule, str):
pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule)
update_pricing_rule_uom(pricing_rule, args)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule) or []
if pricing_rule.get("suggestion"):
continue
@@ -337,7 +363,6 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
if pricing_rule.mixed_conditions or pricing_rule.apply_rule_on_other:
item_details.update(
{
"apply_rule_on_other_items": json.dumps(pricing_rule.apply_rule_on_other_items),
"price_or_product_discount": pricing_rule.price_or_product_discount,
"apply_rule_on": (
frappe.scrub(pricing_rule.apply_rule_on_other)
@@ -347,6 +372,9 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
}
)
if pricing_rule.apply_rule_on_other_items:
item_details["apply_rule_on_other_items"] = json.dumps(pricing_rule.apply_rule_on_other_items)
if pricing_rule.coupon_code_based == 1 and args.coupon_code == None:
return item_details
@@ -438,12 +466,15 @@ def apply_price_discount_rule(pricing_rule, item_details, args):
if pricing_rule.currency == args.currency:
pricing_rule_rate = pricing_rule.rate
# TODO https://github.com/frappe/erpnext/pull/23636 solve this in some other way.
if pricing_rule_rate:
is_blank_uom = pricing_rule.get("uom") != args.get("uom")
# Override already set price list rate (from item price)
# if pricing_rule_rate > 0
item_details.update(
{
"price_list_rate": pricing_rule_rate * args.get("conversion_factor", 1),
"price_list_rate": pricing_rule_rate
* (args.get("conversion_factor", 1) if is_blank_uom else 1),
}
)
item_details.update({"discount_percentage": 0.0})
@@ -492,7 +523,7 @@ def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None, ra
)
if pricing_rule.get("mixed_conditions") or pricing_rule.get("apply_rule_on_other"):
items = get_pricing_rule_items(pricing_rule)
items = get_pricing_rule_items(pricing_rule, other_items=True)
item_details.apply_on = (
frappe.scrub(pricing_rule.apply_rule_on_other)
if pricing_rule.apply_rule_on_other

View File

@@ -595,6 +595,121 @@ class TestPricingRule(unittest.TestCase):
frappe.get_doc("Item Price", {"item_code": "Water Flask"}).delete()
item.delete()
def test_item_price_with_blank_uom_pricing_rule(self):
properties = {
"item_code": "Item Blank UOM",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item Blank UOM", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item Blank UOM Rule",
"apply_on": "Item Code",
"items": [
{
"item_code": "Item Blank UOM",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item Blank UOM", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# If UOM is blank consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Box that have conversion_factor of 10 so 101 * 10 = 1010
self.assertEqual(si.items[0].price_list_rate, 1010)
self.assertEqual(si.items[0].rate, 1010)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item Blank UOM", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is blank so consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Nos that have conversion_factor of 1 so 101 * 1 = 101
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item Blank UOM"}).delete()
item.delete()
def test_item_price_with_selling_uom_pricing_rule(self):
properties = {
"item_code": "Item UOM other than Stock",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item UOM other than Stock", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item UOM other than Stock Rule",
"apply_on": "Item Code",
"items": [
{
"item_code": "Item UOM other than Stock",
"uom": "Box",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item UOM other than Stock", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so apply pricing_rule only on Box UOM.
# Selling UOM is Box and as both UOM are same no need to multiply by conversion_factor.
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item UOM other than Stock", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so pricing_rule won't apply as selling_uom is Nos.
# As Pricing Rule is not applied price of 100 will be fetched from Item Price List.
self.assertEqual(si.items[0].price_list_rate, 100)
self.assertEqual(si.items[0].rate, 100)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item UOM other than Stock"}).delete()
item.delete()
def test_pricing_rule_for_different_currency(self):
make_item("Test Sanitizer Item")
@@ -766,6 +881,107 @@ class TestPricingRule(unittest.TestCase):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule with Min Qty - 1")
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule with Min Qty - 2")
def test_pricing_rule_for_other_items_cond_with_amount(self):
item = make_item("Water Flask New")
other_item = make_item("Other Water Flask New")
make_item_price(item.name, "_Test Price List", 100)
make_item_price(other_item.name, "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Water Flask Rule",
"apply_on": "Item Code",
"apply_rule_on_other": "Item Code",
"price_or_product_discount": "Price",
"rate_or_discount": "Discount Percentage",
"other_item_code": other_item.name,
"items": [
{
"item_code": item.name,
}
],
"selling": 1,
"currency": "INR",
"min_amt": 200,
"discount_percentage": 10,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(do_not_save=True, item_code=item.name)
si.append(
"items",
{
"item_code": other_item.name,
"item_name": other_item.item_name,
"description": other_item.description,
"stock_uom": other_item.stock_uom,
"uom": other_item.stock_uom,
"cost_center": si.items[0].cost_center,
"expense_account": si.items[0].expense_account,
"warehouse": si.items[0].warehouse,
"conversion_factor": 1,
"qty": 1,
},
)
si.selling_price_list = "_Test Price List"
si.save()
self.assertEqual(si.items[0].discount_percentage, 0)
self.assertEqual(si.items[1].discount_percentage, 0)
si.items[0].qty = 2
si.save()
self.assertEqual(si.items[0].discount_percentage, 0)
self.assertEqual(si.items[0].stock_qty, 2)
self.assertEqual(si.items[0].amount, 200)
self.assertEqual(si.items[0].price_list_rate, 100)
self.assertEqual(si.items[1].discount_percentage, 10)
si.delete()
rule.delete()
def test_pricing_rule_for_product_free_item_rounded_qty_and_recursion(self):
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": 0,
"min_qty": 3,
"max_qty": 7,
"price_or_product_discount": "Product",
"same_item": 1,
"free_qty": 1,
"round_free_qty": 1,
"is_recursive": 1,
"recurse_for": 2,
"company": "_Test Company",
}
frappe.get_doc(test_record.copy()).insert()
# With pricing rule
so = make_sales_order(item_code="_Test Item", qty=5)
so.load_from_db()
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item")
self.assertEqual(so.items[1].qty, 2)
so = make_sales_order(item_code="_Test Item", qty=7)
so.load_from_db()
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item")
self.assertEqual(so.items[1].qty, 4)
test_dependencies = ["Campaign"]

View File

@@ -111,6 +111,12 @@ def _get_pricing_rules(apply_on, args, values):
)
if apply_on_field == "item_code":
if args.get("uom", None):
item_conditions += (
" and ({child_doc}.uom='{item_uom}' or IFNULL({child_doc}.uom, '')='')".format(
child_doc=child_doc, item_uom=args.get("uom")
)
)
if "variant_of" not in args:
args.variant_of = frappe.get_cached_value("Item", args.item_code, "variant_of")
@@ -252,12 +258,6 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
stock_qty = flt(args.get("stock_qty"))
amount = flt(args.get("price_list_rate")) * flt(args.get("qty"))
if pricing_rules[0].apply_rule_on_other:
field = frappe.scrub(pricing_rules[0].apply_rule_on_other)
if field and pricing_rules[0].get("other_" + field) != args.get(field):
return
pr_doc = frappe.get_cached_doc("Pricing Rule", pricing_rules[0].name)
if pricing_rules[0].mixed_conditions and doc:
@@ -274,7 +274,7 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
amount += data[1]
if pricing_rules[0].apply_rule_on_other and not pricing_rules[0].mixed_conditions and doc:
pricing_rules = get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules) or []
pricing_rules = get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules, args) or []
else:
pricing_rules = filter_pricing_rules_for_qty_amount(stock_qty, amount, pricing_rules, args)
@@ -352,16 +352,14 @@ def validate_quantity_and_amount_for_suggestion(args, qty, amount, item_code, tr
if fieldname:
msg = _(
"If you {0} {1} quantities of the item {2}, the scheme {3} will be applied on the item."
).format(
type_of_transaction, args.get(fieldname), bold(item_code), bold(args.rule_description)
)
).format(type_of_transaction, args.get(fieldname), bold(item_code), bold(args.title))
if fieldname in ["min_amt", "max_amt"]:
msg = _("If you {0} {1} worth item {2}, the scheme {3} will be applied on the item.").format(
type_of_transaction,
fmt_money(args.get(fieldname), currency=args.get("currency")),
bold(item_code),
bold(args.rule_description),
bold(args.title),
)
frappe.msgprint(msg)
@@ -454,17 +452,29 @@ def get_qty_and_rate_for_mixed_conditions(doc, pr_doc, args):
return sum_qty, sum_amt, items
def get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules):
items = get_pricing_rule_items(pr_doc)
def get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules, row_item):
other_items = get_pricing_rule_items(pr_doc, other_items=True)
pricing_rule_apply_on = apply_on_table.get(pr_doc.get("apply_on"))
apply_on = frappe.scrub(pr_doc.get("apply_on"))
items = []
for d in pr_doc.get(pricing_rule_apply_on):
if apply_on == "item_group":
items.extend(get_child_item_groups(d.get(apply_on)))
else:
items.append(d.get(apply_on))
for row in doc.items:
if row.get(frappe.scrub(pr_doc.apply_rule_on_other)) in items:
pricing_rules = filter_pricing_rules_for_qty_amount(
row.get("stock_qty"), row.get("amount"), pricing_rules, row
)
if row.get(apply_on) in items:
if not row.get("qty"):
continue
stock_qty = row.get("qty") * (row.get("conversion_factor") or 1.0)
amount = stock_qty * (row.get("price_list_rate") or row.get("rate"))
pricing_rules = filter_pricing_rules_for_qty_amount(stock_qty, amount, pricing_rules, row)
if pricing_rules and pricing_rules[0]:
pricing_rules[0].apply_rule_on_other_items = items
pricing_rules[0].apply_rule_on_other_items = other_items
return pricing_rules
@@ -617,9 +627,13 @@ def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None):
qty = pricing_rule.free_qty or 1
if pricing_rule.is_recursive:
transaction_qty = args.get("qty") if args else doc.total_qty
transaction_qty = (
args.get("qty") if args else doc.total_qty
) - pricing_rule.apply_recursion_over
if transaction_qty:
qty = flt(transaction_qty) * qty
qty = flt(transaction_qty) * qty / pricing_rule.recurse_for
if pricing_rule.round_free_qty:
qty = round(qty)
free_item_data_args = {
"item_code": free_item,
@@ -658,21 +672,21 @@ def apply_pricing_rule_for_free_items(doc, pricing_rule_args, set_missing_values
doc.append("items", args)
def get_pricing_rule_items(pr_doc):
def get_pricing_rule_items(pr_doc, other_items=False) -> list:
apply_on_data = []
apply_on = frappe.scrub(pr_doc.get("apply_on"))
pricing_rule_apply_on = apply_on_table.get(pr_doc.get("apply_on"))
for d in pr_doc.get(pricing_rule_apply_on):
if apply_on == "item_group":
apply_on_data.extend(get_child_item_groups(d.get(apply_on)))
else:
apply_on_data.append(d.get(apply_on))
if pr_doc.apply_rule_on_other:
if pr_doc.apply_rule_on_other and other_items:
apply_on = frappe.scrub(pr_doc.apply_rule_on_other)
apply_on_data.append(pr_doc.get("other_" + apply_on))
else:
for d in pr_doc.get(pricing_rule_apply_on):
if apply_on == "item_group":
apply_on_data.extend(get_child_item_groups(d.get(apply_on)))
else:
apply_on_data.append(d.get(apply_on))
return list(set(apply_on_data))

View File

@@ -34,4 +34,4 @@ class ProcessDeferredAccounting(Document):
filters={"against_voucher_type": self.doctype, "against_voucher": self.name},
)
make_gl_entries(gl_entries=gl_entries, cancel=1)
make_gl_entries(gl_map=gl_entries, cancel=1)

View File

@@ -57,3 +57,16 @@ class TestProcessDeferredAccounting(unittest.TestCase):
]
check_gl_entries(self, si.name, expected_gle, "2019-01-10")
def test_pda_submission_and_cancellation(self):
pda = frappe.get_doc(
dict(
doctype="Process Deferred Accounting",
posting_date="2019-01-01",
start_date="2019-01-01",
end_date="2019-01-31",
type="Income",
)
)
pda.submit()
pda.cancel()

View File

@@ -25,7 +25,7 @@
</div>
<br>
<table class="table table-bordered">
<table class="table table-bordered" style="font-size: 10px">
<thead>
<tr>
<th style="width: 12%">{{ _("Date") }}</th>

View File

@@ -34,8 +34,8 @@ pricing_rule_fields = [
other_fields = [
"min_qty",
"max_qty",
"min_amt",
"max_amt",
"min_amount",
"max_amount",
"priority",
"warehouse",
"threshold_percentage",
@@ -246,7 +246,11 @@ def prepare_pricing_rule(
def set_args(args, pr, doc, child_doc, discount_fields, child_doc_fields):
pr.update(args)
for field in other_fields + discount_fields:
pr.set(field, child_doc_fields.get(field))
target_field = field
if target_field in ["min_amount", "max_amount"]:
target_field = "min_amt" if field == "min_amount" else "max_amt"
pr.set(target_field, child_doc_fields.get(field))
pr.promotional_scheme_id = child_doc_fields.name
pr.promotional_scheme = doc.name

View File

@@ -90,6 +90,23 @@ class TestPromotionalScheme(unittest.TestCase):
price_rules = frappe.get_all("Pricing Rule", filters={"promotional_scheme": ps.name})
self.assertEqual(price_rules, [])
def test_min_max_amount_configuration(self):
ps = make_promotional_scheme()
ps.price_discount_slabs[0].min_amount = 10
ps.price_discount_slabs[0].max_amount = 1000
ps.save()
price_rules_data = frappe.db.get_value(
"Pricing Rule", {"promotional_scheme": ps.name}, ["min_amt", "max_amt"], as_dict=1
)
self.assertEqual(price_rules_data.min_amt, 10)
self.assertEqual(price_rules_data.max_amt, 1000)
frappe.delete_doc("Promotional Scheme", ps.name)
price_rules = frappe.get_all("Pricing Rule", filters={"promotional_scheme": ps.name})
self.assertEqual(price_rules, [])
def make_promotional_scheme(**args):
args = frappe._dict(args)

View File

@@ -31,7 +31,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
super.onload();
// Ignore linked advances
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry'];
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice'];
if(!this.frm.doc.__islocal) {
// show credit_to in print format
@@ -81,7 +81,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
}
if(doc.docstatus == 1 && doc.outstanding_amount != 0
&& !(doc.is_return && doc.return_against)) {
&& !(doc.is_return && doc.return_against) && !doc.on_hold) {
this.frm.add_custom_button(__('Payment'), this.make_payment_entry, __('Create'));
cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
}
@@ -99,7 +99,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
}
}
if (doc.outstanding_amount > 0 && !cint(doc.is_return)) {
if (doc.outstanding_amount > 0 && !cint(doc.is_return) && !doc.on_hold) {
cur_frm.add_custom_button(__('Payment Request'), function() {
me.make_payment_request()
}, __('Create'));
@@ -569,6 +569,10 @@ frappe.ui.form.on("Purchase Invoice", {
erpnext.queries.setup_queries(frm, "Warehouse", function() {
return erpnext.queries.warehouse(frm.doc);
});
if (frm.is_new()) {
frm.clear_table("tax_withheld_vouchers");
}
},
is_subcontracted: function(frm) {

View File

@@ -12,39 +12,27 @@
"supplier",
"supplier_name",
"tax_id",
"due_date",
"tax_withholding_category",
"column_break1",
"company",
"column_break_6",
"posting_date",
"posting_time",
"set_posting_time",
"due_date",
"column_break1",
"is_paid",
"is_return",
"return_against",
"apply_tds",
"tax_withholding_category",
"amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"supplier_invoice_details",
"bill_no",
"column_break_15",
"bill_date",
"returns",
"return_against",
"section_addresses",
"supplier_address",
"address_display",
"contact_person",
"contact_display",
"contact_mobile",
"contact_email",
"col_break_address",
"shipping_address",
"shipping_address_display",
"billing_address",
"billing_address_display",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -54,37 +42,35 @@
"plc_conversion_rate",
"ignore_pricing_rule",
"sec_warehouse",
"set_warehouse",
"rejected_warehouse",
"col_break_warehouse",
"set_from_warehouse",
"supplier_warehouse",
"is_subcontracted",
"items_section",
"update_stock",
"scan_barcode",
"col_break_warehouse",
"update_stock",
"set_warehouse",
"set_from_warehouse",
"is_subcontracted",
"rejected_warehouse",
"supplier_warehouse",
"items_section",
"items",
"pricing_rule_details",
"pricing_rules",
"raw_materials_supplied",
"supplied_items",
"section_break_26",
"total_qty",
"total_net_weight",
"column_break_50",
"base_total",
"base_net_total",
"column_break_28",
"total_net_weight",
"total",
"net_total",
"tax_withholding_net_total",
"base_tax_withholding_net_total",
"taxes_section",
"taxes_and_charges",
"column_break_58",
"tax_category",
"column_break_49",
"shipping_rule",
"section_break_51",
"taxes_and_charges",
"taxes",
"sec_tax_breakup",
"other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -93,13 +79,6 @@
"taxes_and_charges_added",
"taxes_and_charges_deducted",
"total_taxes_and_charges",
"section_break_44",
"apply_discount_on",
"base_discount_amount",
"additional_discount_account",
"column_break_46",
"additional_discount_percentage",
"discount_amount",
"section_break_49",
"base_grand_total",
"base_rounding_adjustment",
@@ -113,24 +92,57 @@
"total_advance",
"outstanding_amount",
"disable_rounded_total",
"section_break_44",
"apply_discount_on",
"base_discount_amount",
"column_break_46",
"additional_discount_percentage",
"discount_amount",
"tax_withheld_vouchers_section",
"tax_withheld_vouchers",
"sec_tax_breakup",
"other_charges_calculation",
"pricing_rule_details",
"pricing_rules",
"raw_materials_supplied",
"supplied_items",
"payments_tab",
"payments_section",
"mode_of_payment",
"cash_bank_account",
"base_paid_amount",
"clearance_date",
"col_br_payments",
"cash_bank_account",
"paid_amount",
"base_paid_amount",
"advances_section",
"allocate_advances_automatically",
"get_advances",
"advances",
"advance_tax",
"write_off",
"write_off_amount",
"base_write_off_amount",
"column_break_61",
"write_off_account",
"write_off_cost_center",
"advances_section",
"allocate_advances_automatically",
"get_advances",
"advances",
"advance_tax",
"address_and_contact_tab",
"section_addresses",
"supplier_address",
"address_display",
"col_break_address",
"contact_person",
"contact_display",
"contact_mobile",
"contact_email",
"company_shipping_address_section",
"shipping_address",
"column_break_126",
"shipping_address_display",
"company_billing_address_section",
"billing_address",
"column_break_130",
"billing_address_display",
"terms_tab",
"payment_schedule_section",
"payment_terms_template",
"ignore_default_payment_terms_template",
@@ -138,23 +150,11 @@
"terms_section_break",
"tc_name",
"terms",
"printing_settings",
"letter_head",
"select_print_heading",
"column_break_112",
"group_same_items",
"language",
"sb_14",
"on_hold",
"release_date",
"cb_17",
"hold_comment",
"more_info",
"more_info_tab",
"status_section",
"status",
"inter_company_invoice_reference",
"represents_company",
"column_break_147",
"is_internal_supplier",
"column_break_177",
"per_received",
"accounting_details_section",
"credit_to",
"party_account_currency",
@@ -162,15 +162,32 @@
"against_expense_account",
"column_break_63",
"unrealized_profit_loss_account",
"remarks",
"subscription_section",
"from_date",
"to_date",
"column_break_114",
"auto_repeat",
"update_auto_repeat_reference",
"per_received",
"is_old_subcontracting_flow"
"column_break_114",
"from_date",
"to_date",
"printing_settings",
"letter_head",
"group_same_items",
"column_break_112",
"select_print_heading",
"language",
"sb_14",
"on_hold",
"release_date",
"cb_17",
"hold_comment",
"additional_info_section",
"is_internal_supplier",
"represents_company",
"column_break_147",
"inter_company_invoice_reference",
"is_old_subcontracting_flow",
"remarks",
"connections_tab",
"column_break_38"
],
"fields": [
{
@@ -353,7 +370,7 @@
"collapsible_depends_on": "bill_no",
"fieldname": "supplier_invoice_details",
"fieldtype": "Section Break",
"label": "Supplier Invoice Details"
"label": "Supplier Invoice"
},
{
"fieldname": "bill_no",
@@ -376,12 +393,6 @@
"oldfieldtype": "Date",
"print_hide": 1
},
{
"depends_on": "return_against",
"fieldname": "returns",
"fieldtype": "Section Break",
"label": "Returns"
},
{
"depends_on": "return_against",
"fieldname": "return_against",
@@ -393,10 +404,9 @@
"read_only": 1
},
{
"collapsible": 1,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
"label": "Address and Contact"
"label": "Supplier Address"
},
{
"fieldname": "supplier_address",
@@ -512,17 +522,17 @@
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"label": "Ignore Pricing Rule",
"no_copy": 1,
"permlevel": 1,
"print_hide": 1
},
{
"fieldname": "sec_warehouse",
"fieldtype": "Section Break"
"fieldtype": "Section Break",
"hide_border": 1,
"label": "Items"
},
{
"depends_on": "update_stock",
"description": "Sets 'Accepted Warehouse' in each row of the items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Set Accepted Warehouse",
@@ -531,7 +541,6 @@
},
{
"depends_on": "update_stock",
"description": "Warehouse where you are maintaining stock of rejected items",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"label": "Rejected Warehouse",
@@ -554,6 +563,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
"hide_border": 1,
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -581,6 +591,7 @@
"reqd": 1
},
{
"collapsible": 1,
"fieldname": "pricing_rule_details",
"fieldtype": "Section Break",
"label": "Pricing Rules"
@@ -593,6 +604,7 @@
"read_only": 1
},
{
"collapsible": 1,
"collapsible_depends_on": "supplied_items",
"fieldname": "raw_materials_supplied",
"fieldtype": "Section Break",
@@ -656,6 +668,7 @@
"read_only": 1
},
{
"depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -665,6 +678,8 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
"hide_border": 1,
"label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -688,7 +703,8 @@
},
{
"fieldname": "section_break_51",
"fieldtype": "Section Break"
"fieldtype": "Section Break",
"hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -792,7 +808,6 @@
},
{
"collapsible": 1,
"collapsible_depends_on": "discount_amount",
"fieldname": "section_break_44",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -832,7 +847,8 @@
},
{
"fieldname": "section_break_49",
"fieldtype": "Section Break"
"fieldtype": "Section Break",
"label": "Totals"
},
{
"fieldname": "base_grand_total",
@@ -1003,8 +1019,6 @@
},
{
"collapsible": 1,
"collapsible_depends_on": "write_off_amount",
"depends_on": "grand_total",
"fieldname": "write_off",
"fieldtype": "Section Break",
"label": "Write Off"
@@ -1081,7 +1095,6 @@
"print_hide": 1
},
{
"collapsible": 1,
"collapsible_depends_on": "eval:(!doc.is_return)",
"fieldname": "payment_schedule_section",
"fieldtype": "Section Break",
@@ -1102,8 +1115,6 @@
"print_hide": 1
},
{
"collapsible": 1,
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"label": "Terms and Conditions",
@@ -1119,13 +1130,13 @@
{
"fieldname": "terms",
"fieldtype": "Text Editor",
"label": "Terms and Conditions1"
"label": "Terms and Conditions"
},
{
"collapsible": 1,
"fieldname": "printing_settings",
"fieldtype": "Section Break",
"label": "Printing Settings"
"label": "Print Settings"
},
{
"allow_on_submit": 1,
@@ -1166,15 +1177,6 @@
"print_hide": 1,
"read_only": 1
},
{
"collapsible": 1,
"fieldname": "more_info",
"fieldtype": "Section Break",
"label": "More Information",
"oldfieldtype": "Section Break",
"options": "fa fa-file-text",
"print_hide": 1
},
{
"default": "0",
"fetch_from": "supplier.is_internal_supplier",
@@ -1260,7 +1262,7 @@
"collapsible": 1,
"fieldname": "subscription_section",
"fieldtype": "Section Break",
"label": "Subscription Section",
"label": "Subscription",
"print_hide": 1
},
{
@@ -1339,7 +1341,7 @@
},
{
"depends_on": "eval:doc.is_internal_supplier",
"description": "Unrealized Profit / Loss account for intra-company transfers",
"description": "Unrealized Profit/Loss account for intra-company transfers",
"fieldname": "unrealized_profit_loss_account",
"fieldtype": "Link",
"label": "Unrealized Profit / Loss Account",
@@ -1356,7 +1358,6 @@
},
{
"depends_on": "eval:doc.update_stock && doc.is_internal_supplier",
"description": "Sets 'From Warehouse' in each row of the items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set From Warehouse",
@@ -1367,7 +1368,7 @@
"width": "50px"
},
{
"depends_on": "eval:doc.is_subcontracted",
"depends_on": "eval:doc.is_subcontracted",
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"label": "Supplier Warehouse",
@@ -1386,12 +1387,6 @@
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "additional_discount_account",
"fieldtype": "Link",
"label": "Additional Discount Account",
"options": "Account"
},
{
"default": "0",
"fieldname": "ignore_default_payment_terms_template",
@@ -1426,13 +1421,126 @@
"hidden": 1,
"label": "Is Old Subcontracting Flow",
"read_only": 1
}
},
{
"default": "0",
"fieldname": "tax_withholding_net_total",
"fieldtype": "Currency",
"hidden": 1,
"label": "Tax Withholding Net Total",
"no_copy": 1,
"options": "currency",
"read_only": 1
},
{
"fieldname": "base_tax_withholding_net_total",
"fieldtype": "Currency",
"hidden": 1,
"label": "Base Tax Withholding Net Total",
"no_copy": 1,
"options": "currency",
"print_hide": 1,
"read_only": 1
},
{
"collapsible_depends_on": "tax_withheld_vouchers",
"fieldname": "tax_withheld_vouchers_section",
"fieldtype": "Section Break",
"label": "Tax Withheld Vouchers"
},
{
"fieldname": "tax_withheld_vouchers",
"fieldtype": "Table",
"label": "Tax Withheld Vouchers",
"no_copy": 1,
"options": "Tax Withheld Vouchers",
"read_only": 1
},
{
"fieldname": "payments_tab",
"fieldtype": "Tab Break",
"label": "Payments"
},
{
"fieldname": "address_and_contact_tab",
"fieldtype": "Tab Break",
"label": "Address & Contact"
},
{
"fieldname": "terms_tab",
"fieldtype": "Tab Break",
"label": "Terms"
},
{
"fieldname": "more_info_tab",
"fieldtype": "Tab Break",
"label": "More Info"
},
{
"fieldname": "connections_tab",
"fieldtype": "Tab Break",
"label": "Connections",
"show_dashboard": 1
},
{
"fieldname": "column_break_6",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_38",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_50",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_58",
"fieldtype": "Column Break"
},
{
"fieldname": "company_shipping_address_section",
"fieldtype": "Section Break",
"label": "Company Shipping Address"
},
{
"fieldname": "column_break_126",
"fieldtype": "Column Break"
},
{
"fieldname": "company_billing_address_section",
"fieldtype": "Section Break",
"label": "Company Billing Address"
},
{
"fieldname": "column_break_130",
"fieldtype": "Column Break"
},
{
"collapsible": 1,
"fieldname": "status_section",
"fieldtype": "Section Break",
"label": "Status"
},
{
"fieldname": "column_break_177",
"fieldtype": "Column Break"
},
{
"collapsible": 1,
"fieldname": "additional_info_section",
"fieldtype": "Section Break",
"label": "Additional Info",
"oldfieldtype": "Section Break",
"options": "fa fa-file-text",
"print_hide": 1
}
],
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2022-06-15 15:40:58.527065",
"modified": "2022-11-22 12:44:29.935567",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
@@ -1492,6 +1600,7 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"timeline_field": "supplier",
"title_field": "title",
"track_changes": 1

View File

@@ -71,6 +71,9 @@ class PurchaseInvoice(BuyingController):
supplier_tds = frappe.db.get_value("Supplier", self.supplier, "tax_withholding_category")
self.set_onload("supplier_tds", supplier_tds)
if self.is_new():
self.set("tax_withheld_vouchers", [])
def before_save(self):
if not self.on_hold:
self.release_date = ""
@@ -575,7 +578,6 @@ class PurchaseInvoice(BuyingController):
self.make_supplier_gl_entry(gl_entries)
self.make_item_gl_entries(gl_entries)
self.make_discount_gl_entries(gl_entries)
if self.check_asset_cwip_enabled():
self.get_asset_gl_entry(gl_entries)
@@ -670,9 +672,6 @@ class PurchaseInvoice(BuyingController):
exchange_rate_map, net_rate_map = get_purchase_document_details(self)
enable_discount_accounting = cint(
frappe.db.get_single_value("Buying Settings", "enable_discount_accounting")
)
provisional_accounting_for_non_stock_items = cint(
frappe.db.get_value(
"Company", self.company, "enable_provisional_accounting_for_non_stock_items"
@@ -709,6 +708,10 @@ class PurchaseInvoice(BuyingController):
)
)
credit_amount = item.base_net_amount
if self.is_internal_supplier and item.valuation_rate:
credit_amount = flt(item.valuation_rate * item.stock_qty)
# Intentionally passed negative debit amount to avoid incorrect GL Entry validation
gl_entries.append(
self.get_gl_dict(
@@ -718,7 +721,7 @@ class PurchaseInvoice(BuyingController):
"cost_center": item.cost_center,
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": -1 * flt(item.base_net_amount, item.precision("base_net_amount")),
"debit": -1 * flt(credit_amount, item.precision("base_net_amount")),
},
warehouse_account[item.from_warehouse]["account_currency"],
item=item,
@@ -807,7 +810,7 @@ class PurchaseInvoice(BuyingController):
)
if not item.is_fixed_asset:
dummy, amount = self.get_amount_and_base_amount(item, enable_discount_accounting)
dummy, amount = self.get_amount_and_base_amount(item, None)
else:
amount = flt(item.base_net_amount + item.item_tax_amount, item.precision("base_net_amount"))
@@ -1160,12 +1163,9 @@ class PurchaseInvoice(BuyingController):
def make_tax_gl_entries(self, gl_entries):
# tax table gl entries
valuation_tax = {}
enable_discount_accounting = cint(
frappe.db.get_single_value("Buying Settings", "enable_discount_accounting")
)
for tax in self.get("taxes"):
amount, base_amount = self.get_tax_amounts(tax, enable_discount_accounting)
amount, base_amount = self.get_tax_amounts(tax, None)
if tax.category in ("Total", "Valuation and Total") and flt(base_amount):
account_currency = get_account_currency(tax.account_head)
@@ -1250,15 +1250,6 @@ class PurchaseInvoice(BuyingController):
)
)
@property
def enable_discount_accounting(self):
if not hasattr(self, "_enable_discount_accounting"):
self._enable_discount_accounting = cint(
frappe.db.get_single_value("Buying Settings", "enable_discount_accounting")
)
return self._enable_discount_accounting
def make_internal_transfer_gl_entries(self, gl_entries):
if self.is_internal_transfer() and flt(self.base_total_taxes_and_charges):
account_currency = get_account_currency(self.unrealized_profit_loss_account)
@@ -1419,7 +1410,7 @@ class PurchaseInvoice(BuyingController):
self.repost_future_sle_and_gle()
self.update_project()
frappe.db.set(self, "status", "Cancelled")
self.db_set("status", "Cancelled")
unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference)
self.ignore_linked_doctypes = (
@@ -1427,6 +1418,7 @@ class PurchaseInvoice(BuyingController):
"Stock Ledger Entry",
"Repost Item Valuation",
"Payment Ledger Entry",
"Tax Withheld Vouchers",
)
self.update_advance_tax_references(cancel=1)
@@ -1471,6 +1463,7 @@ class PurchaseInvoice(BuyingController):
def update_billing_status_in_pr(self, update_modified=True):
updated_pr = []
po_details = []
for d in self.get("items"):
if d.pr_detail:
billed_amt = frappe.db.sql(
@@ -1488,7 +1481,10 @@ class PurchaseInvoice(BuyingController):
)
updated_pr.append(d.purchase_receipt)
elif d.po_detail:
updated_pr += update_billed_amount_based_on_po(d.po_detail, update_modified)
po_details.append(d.po_detail)
if po_details:
updated_pr += update_billed_amount_based_on_po(po_details, update_modified)
for pr in set(updated_pr):
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import update_billing_percentage
@@ -1520,7 +1516,7 @@ class PurchaseInvoice(BuyingController):
if not self.tax_withholding_category:
return
tax_withholding_details, advance_taxes = get_party_tax_withholding_details(
tax_withholding_details, advance_taxes, voucher_wise_amount = get_party_tax_withholding_details(
self, self.tax_withholding_category
)
@@ -1549,6 +1545,19 @@ class PurchaseInvoice(BuyingController):
for d in to_remove:
self.remove(d)
## Add pending vouchers on which tax was withheld
self.set("tax_withheld_vouchers", [])
for voucher_no, voucher_details in voucher_wise_amount.items():
self.append(
"tax_withheld_vouchers",
{
"voucher_name": voucher_no,
"voucher_type": voucher_details.get("voucher_type"),
"taxable_amount": voucher_details.get("amount"),
},
)
# calculate totals again after applying TDS
self.calculate_taxes_and_totals()
@@ -1791,4 +1800,6 @@ def make_purchase_receipt(source_name, target_doc=None):
target_doc,
)
doc.set_onload("ignore_price_list", True)
return doc

View File

@@ -63,7 +63,7 @@ frappe.listview_settings["Purchase Invoice"] = {
});
listview.page.add_action_item(__("Payment"), ()=>{
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment");
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment Entry");
});
}
};

View File

@@ -338,59 +338,6 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
self.assertEqual(discrepancy_caused_by_exchange_rate_diff, amount)
@change_settings("Buying Settings", {"enable_discount_accounting": 1})
def test_purchase_invoice_with_discount_accounting_enabled(self):
discount_account = create_account(
account_name="Discount Account",
parent_account="Indirect Expenses - _TC",
company="_Test Company",
)
pi = make_purchase_invoice(discount_account=discount_account, rate=45)
expected_gle = [
["_Test Account Cost for Goods Sold - _TC", 250.0, 0.0, nowdate()],
["Creditors - _TC", 0.0, 225.0, nowdate()],
["Discount Account - _TC", 0.0, 25.0, nowdate()],
]
check_gl_entries(self, pi.name, expected_gle, nowdate())
@change_settings("Buying Settings", {"enable_discount_accounting": 1})
def test_additional_discount_for_purchase_invoice_with_discount_accounting_enabled(self):
additional_discount_account = create_account(
account_name="Discount Account",
parent_account="Indirect Expenses - _TC",
company="_Test Company",
)
pi = make_purchase_invoice(do_not_save=1, parent_cost_center="Main - _TC")
pi.apply_discount_on = "Grand Total"
pi.additional_discount_account = additional_discount_account
pi.additional_discount_percentage = 10
pi.disable_rounded_total = 1
pi.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account VAT - _TC",
"cost_center": "Main - _TC",
"description": "Test",
"rate": 10,
},
)
pi.submit()
expected_gle = [
["_Test Account Cost for Goods Sold - _TC", 250.0, 0.0, nowdate()],
["_Test Account VAT - _TC", 25.0, 0.0, nowdate()],
["Creditors - _TC", 0.0, 247.5, nowdate()],
["Discount Account - _TC", 0.0, 27.5, nowdate()],
]
check_gl_entries(self, pi.name, expected_gle, nowdate())
def test_purchase_invoice_change_naming_series(self):
pi = frappe.copy_doc(test_records[1])
pi.insert()
@@ -1596,6 +1543,37 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
pi.save()
self.assertEqual(pi.items[0].conversion_factor, 1000)
def test_batch_expiry_for_purchase_invoice(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
item = self.make_item(
"_Test Batch Item For Return Check",
{
"is_purchase_item": 1,
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": "TBIRC.#####",
},
)
pi = make_purchase_invoice(
qty=1,
item_code=item.name,
update_stock=True,
)
pi.load_from_db()
batch_no = pi.items[0].batch_no
self.assertTrue(batch_no)
frappe.db.set_value("Batch", batch_no, "expiry_date", add_days(nowdate(), -1))
return_pi = make_return_doc(pi.doctype, pi.name)
return_pi.save().submit()
self.assertTrue(return_pi.docstatus == 1)
def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
gl_entries = frappe.db.sql(

View File

@@ -40,6 +40,7 @@
"discount_amount",
"base_rate_with_margin",
"sec_break2",
"apply_tds",
"rate",
"amount",
"item_tax_template",
@@ -74,7 +75,6 @@
"manufacturer_part_no",
"accounting",
"expense_account",
"discount_account",
"col_break5",
"is_fixed_asset",
"asset_location",
@@ -215,6 +215,7 @@
"reqd": 1
},
{
"default": "1",
"depends_on": "eval:doc.uom != doc.stock_uom",
"fieldname": "conversion_factor",
"fieldtype": "Float",
@@ -712,6 +713,7 @@
"label": "Valuation Rate",
"no_copy": 1,
"options": "Company:company:default_currency",
"precision": "6",
"print_hide": 1,
"read_only": 1
},
@@ -820,6 +822,7 @@
},
{
"collapsible": 1,
"collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"fieldname": "section_break_26",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -860,24 +863,24 @@
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "discount_account",
"fieldtype": "Link",
"label": "Discount Account",
"options": "Account"
},
{
"fieldname": "product_bundle",
"fieldtype": "Link",
"label": "Product Bundle",
"options": "Product Bundle",
"read_only": 1
},
{
"default": "1",
"fieldname": "apply_tds",
"fieldtype": "Check",
"label": "Apply TDS"
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2022-06-17 05:31:10.520171",
"modified": "2022-10-26 16:05:37.304788",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -0,0 +1,53 @@
// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Repost Payment Ledger', {
setup: function(frm) {
frm.set_query("voucher_type", () => {
return {
filters: {
name: ['in', ['Purchase Invoice', 'Sales Invoice', 'Payment Entry', 'Journal Entry']]
}
};
});
frm.fields_dict['repost_vouchers'].grid.get_field('voucher_type').get_query = function(doc) {
return {
filters: {
name: ['in', ['Purchase Invoice', 'Sales Invoice', 'Payment Entry', 'Journal Entry']]
}
}
}
frm.fields_dict['repost_vouchers'].grid.get_field('voucher_no').get_query = function(doc) {
if (doc.company) {
return {
filters: {
company: doc.company,
docstatus: 1
}
}
}
}
},
refresh: function(frm) {
if (frm.doc.docstatus==1 && ['Queued', 'Failed'].find(x => x == frm.doc.repost_status)) {
frm.set_intro(__("Use 'Repost in background' button to trigger background job. Job can only be triggered when document is in Queued or Failed status."));
var btn_label = __("Repost in background")
frm.add_custom_button(btn_label, () => {
frappe.call({
method: 'erpnext.accounts.doctype.repost_payment_ledger.repost_payment_ledger.execute_repost_payment_ledger',
args: {
docname: frm.doc.name,
}
});
frappe.msgprint(__('Reposting in the background.'));
});
}
}
});

View File

@@ -0,0 +1,159 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2022-10-19 21:59:33.553852",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"filters_section",
"company",
"posting_date",
"column_break_4",
"voucher_type",
"add_manually",
"status_section",
"repost_status",
"repost_error_log",
"selected_vouchers_section",
"repost_vouchers",
"amended_from"
],
"fields": [
{
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
"label": "Posting Date",
"reqd": 1
},
{
"fieldname": "voucher_type",
"fieldtype": "Link",
"label": "Voucher Type",
"options": "DocType"
},
{
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Repost Payment Ledger",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"reqd": 1
},
{
"fieldname": "selected_vouchers_section",
"fieldtype": "Section Break",
"label": "Vouchers"
},
{
"fieldname": "filters_section",
"fieldtype": "Section Break",
"label": "Filters"
},
{
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"fieldname": "repost_vouchers",
"fieldtype": "Table",
"label": "Selected Vouchers",
"options": "Repost Payment Ledger Items"
},
{
"fieldname": "repost_status",
"fieldtype": "Select",
"label": "Repost Status",
"options": "\nQueued\nFailed\nCompleted",
"read_only": 1
},
{
"fieldname": "status_section",
"fieldtype": "Section Break",
"label": "Status"
},
{
"default": "0",
"description": "Ignore Voucher Type filter and Select Vouchers Manually",
"fieldname": "add_manually",
"fieldtype": "Check",
"label": "Add Manually"
},
{
"depends_on": "eval:doc.repost_error_log",
"fieldname": "repost_error_log",
"fieldtype": "Long Text",
"label": "Repost Error Log"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2022-11-08 07:38:40.079038",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Payment Ledger",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"share": 1,
"write": 1
},
{
"email": 1,
"export": 1,
"permlevel": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,110 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import copy
import frappe
from frappe import _, qb
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from erpnext.accounts.utils import _delete_pl_entries, create_payment_ledger_entry
VOUCHER_TYPES = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]
def repost_ple_for_voucher(voucher_type, voucher_no, gle_map=None):
if voucher_type and voucher_no and gle_map:
_delete_pl_entries(voucher_type, voucher_no)
create_payment_ledger_entry(gle_map, cancel=0)
@frappe.whitelist()
def start_payment_ledger_repost(docname=None):
"""
Repost Payment Ledger Entries for Vouchers through Background Job
"""
if docname:
repost_doc = frappe.get_doc("Repost Payment Ledger", docname)
if repost_doc.docstatus == 1 and repost_doc.repost_status in ["Queued", "Failed"]:
try:
for entry in repost_doc.repost_vouchers:
doc = frappe.get_doc(entry.voucher_type, entry.voucher_no)
if doc.doctype in ["Payment Entry", "Journal Entry"]:
gle_map = doc.build_gl_map()
else:
gle_map = doc.get_gl_entries()
repost_ple_for_voucher(entry.voucher_type, entry.voucher_no, gle_map)
frappe.db.set_value(repost_doc.doctype, repost_doc.name, "repost_error_log", "")
frappe.db.set_value(repost_doc.doctype, repost_doc.name, "repost_status", "Completed")
except Exception as e:
frappe.db.rollback()
traceback = frappe.get_traceback()
if traceback:
message = "Traceback: <br>" + traceback
frappe.db.set_value(repost_doc.doctype, repost_doc.name, "repost_error_log", message)
frappe.db.set_value(repost_doc.doctype, repost_doc.name, "repost_status", "Failed")
class RepostPaymentLedger(Document):
def __init__(self, *args, **kwargs):
super(RepostPaymentLedger, self).__init__(*args, **kwargs)
self.vouchers = []
def before_validate(self):
self.load_vouchers_based_on_filters()
self.set_status()
def load_vouchers_based_on_filters(self):
if not self.add_manually:
self.repost_vouchers.clear()
self.get_vouchers()
self.extend("repost_vouchers", copy.deepcopy(self.vouchers))
def get_vouchers(self):
self.vouchers.clear()
filter_on_voucher_types = [self.voucher_type] if self.voucher_type else VOUCHER_TYPES
for vtype in filter_on_voucher_types:
doc = qb.DocType(vtype)
doctype_name = ConstantColumn(vtype)
query = (
qb.from_(doc)
.select(doctype_name.as_("voucher_type"), doc.name.as_("voucher_no"))
.where(
(doc.docstatus == 1)
& (doc.company == self.company)
& (doc.posting_date.gte(self.posting_date))
)
)
entries = query.run(as_dict=True)
self.vouchers.extend(entries)
def set_status(self):
if self.docstatus == 0:
self.repost_status = "Queued"
def on_submit(self):
execute_repost_payment_ledger(self.name)
frappe.msgprint(_("Repost started in the background"))
@frappe.whitelist()
def execute_repost_payment_ledger(docname):
"""Repost Payment Ledger Entries by background job."""
job_name = "payment_ledger_repost_" + docname
if not frappe.utils.background_jobs.is_job_queued(job_name):
frappe.enqueue(
method="erpnext.accounts.doctype.repost_payment_ledger.repost_payment_ledger.start_payment_ledger_repost",
docname=docname,
is_async=True,
job_name=job_name,
)

View File

@@ -0,0 +1,12 @@
frappe.listview_settings["Repost Payment Ledger"] = {
add_fields: ["repost_status"],
get_indicator: function(doc) {
var colors = {
'Queued': 'orange',
'Completed': 'green',
'Failed': 'red',
};
let status = doc.repost_status;
return [__(status), colors[status], 'status,=,'+status];
},
};

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
class TestRepostPaymentLedger(FrappeTestCase):
pass

View File

@@ -0,0 +1,35 @@
{
"actions": [],
"creation": "2022-10-20 10:44:18.796489",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"voucher_type",
"voucher_no"
],
"fields": [
{
"fieldname": "voucher_type",
"fieldtype": "Link",
"label": "Voucher Type",
"options": "DocType"
},
{
"fieldname": "voucher_no",
"fieldtype": "Dynamic Link",
"label": "Voucher No",
"options": "voucher_type"
}
],
"istable": 1,
"links": [],
"modified": "2022-10-28 14:47:11.838109",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Payment Ledger Items",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class RepostPaymentLedgerItems(Document):
pass

View File

@@ -479,9 +479,13 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
is_cash_or_non_trade_discount() {
this.frm.set_df_property("additional_discount_account", "hidden", 1 - this.frm.doc.is_cash_or_non_trade_discount);
this.frm.set_df_property("additional_discount_account", "reqd", this.frm.doc.is_cash_or_non_trade_discount);
if (!this.frm.doc.is_cash_or_non_trade_discount) {
this.frm.set_value("additional_discount_account", "");
}
this.calculate_taxes_and_totals();
}
};

View File

@@ -12,44 +12,29 @@
"customer",
"customer_name",
"tax_id",
"pos_profile",
"is_pos",
"is_consolidated",
"is_return",
"is_debit_note",
"update_billed_amount_in_sales_order",
"column_break1",
"company",
"company_tax_id",
"column_break1",
"posting_date",
"posting_time",
"set_posting_time",
"due_date",
"column_break_14",
"is_pos",
"pos_profile",
"is_consolidated",
"is_return",
"return_against",
"update_billed_amount_in_sales_order",
"is_debit_note",
"amended_from",
"accounting_dimensions_section",
"project",
"dimension_col_break",
"cost_center",
"customer_po_details",
"po_no",
"column_break_23",
"po_date",
"address_and_contact",
"customer_address",
"address_display",
"contact_person",
"contact_display",
"contact_mobile",
"contact_email",
"territory",
"col_break4",
"shipping_address_name",
"shipping_address",
"company_address",
"company_address_display",
"dispatch_address_name",
"dispatch_address",
"dimension_col_break",
"project",
"column_break_27",
"campaign",
"source",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -58,60 +43,35 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
"sec_warehouse",
"set_warehouse",
"column_break_55",
"set_target_warehouse",
"items_section",
"update_stock",
"scan_barcode",
"update_stock",
"column_break_39",
"set_warehouse",
"set_target_warehouse",
"section_break_42",
"items",
"pricing_rule_details",
"pricing_rules",
"packing_list",
"packed_items",
"product_bundle_help",
"time_sheet_list",
"timesheets",
"total_billing_amount",
"total_billing_hours",
"section_break_30",
"total_qty",
"total_net_weight",
"column_break_32",
"base_total",
"base_net_total",
"column_break_32",
"total_net_weight",
"column_break_52",
"total",
"net_total",
"taxes_section",
"taxes_and_charges",
"column_break_38",
"shipping_rule",
"column_break_55",
"tax_category",
"section_break_40",
"taxes",
"sec_tax_breakup",
"other_charges_calculation",
"section_break_43",
"base_total_taxes_and_charges",
"column_break_47",
"total_taxes_and_charges",
"loyalty_points_redemption",
"loyalty_points",
"loyalty_amount",
"redeem_loyalty_points",
"column_break_77",
"loyalty_program",
"loyalty_redemption_account",
"loyalty_redemption_cost_center",
"section_break_49",
"apply_discount_on",
"is_cash_or_non_trade_discount",
"base_discount_amount",
"additional_discount_account",
"column_break_51",
"additional_discount_percentage",
"discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
@@ -125,21 +85,28 @@
"total_advance",
"outstanding_amount",
"disable_rounded_total",
"column_break4",
"write_off_amount",
"base_write_off_amount",
"write_off_outstanding_amount_automatically",
"column_break_74",
"write_off_account",
"write_off_cost_center",
"advances_section",
"allocate_advances_automatically",
"get_advances",
"advances",
"payment_schedule_section",
"ignore_default_payment_terms_template",
"payment_terms_template",
"payment_schedule",
"section_break_49",
"apply_discount_on",
"base_discount_amount",
"is_cash_or_non_trade_discount",
"additional_discount_account",
"column_break_51",
"additional_discount_percentage",
"discount_amount",
"sec_tax_breakup",
"other_charges_calculation",
"pricing_rule_details",
"pricing_rules",
"packing_list",
"packed_items",
"product_bundle_help",
"time_sheet_list",
"timesheets",
"section_break_104",
"total_billing_hours",
"column_break_106",
"total_billing_amount",
"payments_tab",
"payments_section",
"cash_bank_account",
"payments",
@@ -152,47 +119,95 @@
"column_break_90",
"change_amount",
"account_for_change_amount",
"advances_section",
"allocate_advances_automatically",
"get_advances",
"advances",
"write_off_section",
"write_off_amount",
"base_write_off_amount",
"write_off_outstanding_amount_automatically",
"column_break_74",
"write_off_account",
"write_off_cost_center",
"loyalty_points_redemption",
"redeem_loyalty_points",
"loyalty_points",
"loyalty_amount",
"column_break_77",
"loyalty_program",
"loyalty_redemption_account",
"loyalty_redemption_cost_center",
"contact_and_address_tab",
"address_and_contact",
"customer_address",
"address_display",
"col_break4",
"contact_person",
"contact_display",
"contact_mobile",
"contact_email",
"territory",
"shipping_address_section",
"shipping_address_name",
"shipping_address",
"shipping_addr_col_break",
"dispatch_address_name",
"dispatch_address",
"company_address_section",
"company_address",
"company_addr_col_break",
"company_address_display",
"terms_tab",
"payment_schedule_section",
"ignore_default_payment_terms_template",
"payment_terms_template",
"payment_schedule",
"terms_section_break",
"tc_name",
"terms",
"edit_printing_settings",
"letter_head",
"group_same_items",
"select_print_heading",
"column_break_84",
"language",
"more_information",
"status",
"inter_company_invoice_reference",
"represents_company",
"customer_group",
"campaign",
"col_break23",
"is_internal_customer",
"is_discounted",
"source",
"more_info_tab",
"customer_po_details",
"po_no",
"column_break_23",
"po_date",
"more_info",
"debit_to",
"party_account_currency",
"is_opening",
"column_break8",
"unrealized_profit_loss_account",
"remarks",
"against_income_account",
"sales_team_section_break",
"sales_partner",
"column_break10",
"amount_eligible_for_commission",
"column_break10",
"commission_rate",
"total_commission",
"section_break2",
"sales_team",
"edit_printing_settings",
"letter_head",
"group_same_items",
"column_break_84",
"select_print_heading",
"language",
"subscription_section",
"from_date",
"to_date",
"column_break_140",
"auto_repeat",
"column_break_140",
"to_date",
"update_auto_repeat_reference",
"against_income_account"
"more_information",
"status",
"inter_company_invoice_reference",
"represents_company",
"customer_group",
"col_break23",
"is_internal_customer",
"is_discounted",
"remarks",
"connections_tab"
],
"fields": [
{
@@ -453,12 +468,11 @@
"label": "Customer's Purchase Order Date"
},
{
"collapsible": 1,
"fieldname": "address_and_contact",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
"label": "Address and Contact"
"label": "Billing Address"
},
{
"fieldname": "customer_address",
@@ -560,7 +574,6 @@
{
"fieldname": "company_address_display",
"fieldtype": "Small Text",
"hidden": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Company Address",
@@ -649,16 +662,8 @@
"hide_days": 1,
"hide_seconds": 1,
"label": "Ignore Pricing Rule",
"no_copy": 1,
"print_hide": 1
},
{
"fieldname": "sec_warehouse",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
"label": "Warehouse"
},
{
"depends_on": "update_stock",
"fieldname": "set_warehouse",
@@ -672,6 +677,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
"hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Items",
@@ -703,7 +709,6 @@
"fieldtype": "Table",
"hide_days": 1,
"hide_seconds": 1,
"label": "Items",
"oldfieldname": "entries",
"oldfieldtype": "Table",
"options": "Sales Invoice Item",
@@ -756,9 +761,10 @@
{
"collapsible": 1,
"collapsible_depends_on": "eval:doc.total_billing_amount > 0",
"depends_on": "eval: !doc.is_return",
"depends_on": "eval:!doc.is_return",
"fieldname": "time_sheet_list",
"fieldtype": "Section Break",
"hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Time Sheet List"
@@ -846,6 +852,7 @@
"read_only": 1
},
{
"depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"hide_days": 1,
@@ -857,8 +864,10 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
"hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -901,6 +910,7 @@
{
"fieldname": "section_break_40",
"fieldtype": "Section Break",
"hide_border": 1,
"hide_days": 1,
"hide_seconds": 1
},
@@ -909,7 +919,6 @@
"fieldtype": "Table",
"hide_days": 1,
"hide_seconds": 1,
"label": "Sales Taxes and Charges",
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges"
@@ -1047,7 +1056,6 @@
},
{
"collapsible": 1,
"collapsible_depends_on": "discount_amount",
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1103,6 +1111,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
"label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money",
"print_hide": 1
@@ -1284,8 +1293,6 @@
"print_hide": 1
},
{
"collapsible": 1,
"collapsible_depends_on": "eval:(!doc.is_pos && !doc.is_return)",
"fieldname": "payment_schedule_section",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1315,7 +1322,9 @@
"print_hide": 1
},
{
"depends_on": "eval:doc.is_pos===1||(doc.advances && doc.advances.length>0)",
"collapsible": 1,
"collapsible_depends_on": "eval:!doc.is_pos",
"depends_on": "eval:doc.is_pos===1",
"fieldname": "payments_section",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1353,6 +1362,7 @@
"hide_seconds": 1
},
{
"depends_on": "eval: doc.is_pos || doc.redeem_loyalty_points",
"fieldname": "base_paid_amount",
"fieldtype": "Currency",
"hide_days": 1,
@@ -1384,10 +1394,13 @@
"read_only": 1
},
{
"collapsible": 1,
"depends_on": "is_pos",
"fieldname": "section_break_88",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1
"hide_seconds": 1,
"label": "Changes"
},
{
"depends_on": "is_pos",
@@ -1428,17 +1441,6 @@
"options": "Account",
"print_hide": 1
},
{
"collapsible": 1,
"collapsible_depends_on": "write_off_amount",
"depends_on": "grand_total",
"fieldname": "column_break4",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
"label": "Write Off",
"width": "50%"
},
{
"fieldname": "write_off_amount",
"fieldtype": "Currency",
@@ -1496,8 +1498,6 @@
"print_hide": 1
},
{
"collapsible": 1,
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1531,7 +1531,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
"label": "Printing Settings"
"label": "Print Settings"
},
{
"allow_on_submit": 1,
@@ -1592,7 +1592,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
"label": "More Information"
"label": "Additional Info"
},
{
"fieldname": "inter_company_invoice_reference",
@@ -1815,7 +1815,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
"label": "Subscription Section"
"label": "Subscription"
},
{
"allow_on_submit": 1,
@@ -1936,10 +1936,6 @@
"options": "Company",
"read_only": 1
},
{
"fieldname": "column_break_55",
"fieldtype": "Column Break"
},
{
"depends_on": "eval: doc.is_internal_customer && doc.update_stock",
"fieldname": "set_target_warehouse",
@@ -2010,6 +2006,97 @@
"fieldname": "is_cash_or_non_trade_discount",
"fieldtype": "Check",
"label": "Is Cash or Non Trade Discount"
},
{
"fieldname": "contact_and_address_tab",
"fieldtype": "Tab Break",
"label": "Contact & Address"
},
{
"fieldname": "payments_tab",
"fieldtype": "Tab Break",
"label": "Payments"
},
{
"fieldname": "terms_tab",
"fieldtype": "Tab Break",
"label": "Terms"
},
{
"fieldname": "more_info_tab",
"fieldtype": "Tab Break",
"label": "More Info"
},
{
"fieldname": "connections_tab",
"fieldtype": "Tab Break",
"label": "Connections",
"show_dashboard": 1
},
{
"fieldname": "column_break_14",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_39",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_42",
"fieldtype": "Section Break",
"hide_border": 1,
"hide_days": 1,
"hide_seconds": 1
},
{
"fieldname": "column_break_55",
"fieldtype": "Column Break"
},
{
"fieldname": "shipping_address_section",
"fieldtype": "Section Break",
"label": "Shipping Address"
},
{
"fieldname": "company_address_section",
"fieldtype": "Section Break",
"label": "Company Address"
},
{
"fieldname": "shipping_addr_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "company_addr_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_27",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_52",
"fieldtype": "Column Break"
},
{
"depends_on": "eval:(!doc.is_return && doc.total_billing_amount > 0)",
"fieldname": "section_break_104",
"fieldtype": "Section Break"
},
{
"fieldname": "column_break_106",
"fieldtype": "Column Break"
},
{
"collapsible": 1,
"collapsible_depends_on": "write_off_amount",
"depends_on": "is_pos",
"fieldname": "write_off_section",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
"label": "Write Off",
"width": "50%"
}
],
"icon": "fa fa-file-text",
@@ -2022,7 +2109,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2022-07-11 17:43:56.435382",
"modified": "2022-11-15 09:33:47.870616",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@@ -2078,4 +2165,4 @@
"title_field": "title",
"track_changes": 1,
"track_seen": 1
}
}

View File

@@ -7,17 +7,7 @@ from frappe import _, msgprint, throw
from frappe.contacts.doctype.address.address import get_address_display
from frappe.model.mapper import get_mapped_doc
from frappe.model.utils import get_fetch_values
from frappe.utils import (
add_days,
add_months,
cint,
cstr,
flt,
formatdate,
get_link_to_form,
getdate,
nowdate,
)
from frappe.utils import add_days, cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate
import erpnext
from erpnext.accounts.deferred_revenue import validate_service_stop_date
@@ -32,10 +22,12 @@ from erpnext.accounts.general_ledger import get_round_off_account_and_cost_cente
from erpnext.accounts.party import get_due_date, get_party_account, get_party_details
from erpnext.accounts.utils import get_account_currency
from erpnext.assets.doctype.asset.depreciation import (
depreciate_asset,
get_disposal_account_and_cost_center,
get_gl_entries_on_asset_disposal,
get_gl_entries_on_asset_regain,
make_depreciation_entry,
reset_depreciation_schedule,
reverse_depreciation_entry_made_after_disposal,
)
from erpnext.controllers.accounts_controller import validate_account_head
from erpnext.controllers.selling_controller import SellingController
@@ -186,7 +178,7 @@ class SalesInvoice(SellingController):
if self.update_stock:
frappe.throw(_("'Update Stock' cannot be checked for fixed asset sale"))
elif asset.status in ("Scrapped", "Cancelled") or (
elif asset.status in ("Scrapped", "Cancelled", "Capitalized", "Decapitalized") or (
asset.status == "Sold" and not self.is_return
):
frappe.throw(
@@ -375,7 +367,7 @@ class SalesInvoice(SellingController):
if self.update_stock == 1:
self.repost_future_sle_and_gle()
frappe.db.set(self, "status", "Cancelled")
self.db_set("status", "Cancelled")
if (
frappe.db.get_single_value("Selling Settings", "sales_update_frequency") == "Each Transaction"
@@ -710,6 +702,7 @@ class SalesInvoice(SellingController):
if (
cint(frappe.db.get_single_value("Selling Settings", "maintain_same_sales_rate"))
and not self.is_return
and not self.is_internal_customer
):
self.validate_rate_with_reference_doc(
[["Sales Order", "sales_order", "so_detail"], ["Delivery Note", "delivery_note", "dn_detail"]]
@@ -1033,22 +1026,6 @@ class SalesInvoice(SellingController):
)
)
if self.apply_discount_on == "Grand Total" and self.get("is_cash_or_discount_account"):
gl_entries.append(
self.get_gl_dict(
{
"account": self.additional_discount_account,
"against": self.debit_to,
"debit": self.base_discount_amount,
"debit_in_account_currency": self.discount_amount,
"cost_center": self.cost_center,
"project": self.project,
},
self.currency,
item=self,
)
)
def make_tax_gl_entries(self, gl_entries):
enable_discount_accounting = cint(
frappe.db.get_single_value("Selling Settings", "enable_discount_accounting")
@@ -1107,23 +1084,25 @@ class SalesInvoice(SellingController):
if self.is_return:
fixed_asset_gl_entries = get_gl_entries_on_asset_regain(
asset, item.base_net_amount, item.finance_book
asset, item.base_net_amount, item.finance_book, self.get("doctype"), self.get("name")
)
asset.db_set("disposal_date", None)
if asset.calculate_depreciation:
self.reverse_depreciation_entry_made_after_sale(asset)
self.reset_depreciation_schedule(asset)
posting_date = frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
reverse_depreciation_entry_made_after_disposal(asset, posting_date)
reset_depreciation_schedule(asset, self.posting_date)
else:
if asset.calculate_depreciation:
depreciate_asset(asset, self.posting_date)
asset.reload()
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(
asset, item.base_net_amount, item.finance_book
asset, item.base_net_amount, item.finance_book, self.get("doctype"), self.get("name")
)
asset.db_set("disposal_date", self.posting_date)
if asset.calculate_depreciation:
self.depreciate_asset(asset)
for gle in fixed_asset_gl_entries:
gle["against"] = self.customer
gl_entries.append(self.get_gl_dict(gle, item=item))
@@ -1177,101 +1156,6 @@ class SalesInvoice(SellingController):
self.check_finance_books(item, asset)
return asset
def check_finance_books(self, item, asset):
if (
len(asset.finance_books) > 1 and not item.finance_book and asset.finance_books[0].finance_book
):
frappe.throw(
_("Select finance book for the item {0} at row {1}").format(item.item_code, item.idx)
)
def depreciate_asset(self, asset):
asset.flags.ignore_validate_update_after_submit = True
asset.prepare_depreciation_data(date_of_sale=self.posting_date)
asset.save()
make_depreciation_entry(asset.name, self.posting_date)
def reset_depreciation_schedule(self, asset):
asset.flags.ignore_validate_update_after_submit = True
# recreate original depreciation schedule of the asset
asset.prepare_depreciation_data(date_of_return=self.posting_date)
self.modify_depreciation_schedule_for_asset_repairs(asset)
asset.save()
def modify_depreciation_schedule_for_asset_repairs(self, asset):
asset_repairs = frappe.get_all(
"Asset Repair", filters={"asset": asset.name}, fields=["name", "increase_in_asset_life"]
)
for repair in asset_repairs:
if repair.increase_in_asset_life:
asset_repair = frappe.get_doc("Asset Repair", repair.name)
asset_repair.modify_depreciation_schedule()
asset.prepare_depreciation_data()
def reverse_depreciation_entry_made_after_sale(self, asset):
from erpnext.accounts.doctype.journal_entry.journal_entry import make_reverse_journal_entry
posting_date_of_original_invoice = self.get_posting_date_of_sales_invoice()
row = -1
finance_book = asset.get("schedules")[0].get("finance_book")
for schedule in asset.get("schedules"):
if schedule.finance_book != finance_book:
row = 0
finance_book = schedule.finance_book
else:
row += 1
if schedule.schedule_date == posting_date_of_original_invoice:
if not self.sale_was_made_on_original_schedule_date(
asset, schedule, row, posting_date_of_original_invoice
) or self.sale_happens_in_the_future(posting_date_of_original_invoice):
reverse_journal_entry = make_reverse_journal_entry(schedule.journal_entry)
reverse_journal_entry.posting_date = nowdate()
frappe.flags.is_reverse_depr_entry = True
reverse_journal_entry.submit()
frappe.flags.is_reverse_depr_entry = False
asset.flags.ignore_validate_update_after_submit = True
schedule.journal_entry = None
depreciation_amount = self.get_depreciation_amount_in_je(reverse_journal_entry)
asset.finance_books[0].value_after_depreciation += depreciation_amount
asset.save()
def get_posting_date_of_sales_invoice(self):
return frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
# if the invoice had been posted on the date the depreciation was initially supposed to happen, the depreciation shouldn't be undone
def sale_was_made_on_original_schedule_date(
self, asset, schedule, row, posting_date_of_original_invoice
):
for finance_book in asset.get("finance_books"):
if schedule.finance_book == finance_book.finance_book:
orginal_schedule_date = add_months(
finance_book.depreciation_start_date, row * cint(finance_book.frequency_of_depreciation)
)
if orginal_schedule_date == posting_date_of_original_invoice:
return True
return False
def sale_happens_in_the_future(self, posting_date_of_original_invoice):
if posting_date_of_original_invoice > getdate():
return True
return False
def get_depreciation_amount_in_je(self, journal_entry):
if journal_entry.accounts[0].debit_in_account_currency:
return journal_entry.accounts[0].debit_in_account_currency
else:
return journal_entry.accounts[0].credit_in_account_currency
@property
def enable_discount_accounting(self):
if not hasattr(self, "_enable_discount_accounting"):
@@ -1416,7 +1300,11 @@ class SalesInvoice(SellingController):
def make_write_off_gl_entry(self, gl_entries):
# write off entries, applicable if only pos
if self.write_off_account and flt(self.write_off_amount, self.precision("write_off_amount")):
if (
self.is_pos
and self.write_off_account
and flt(self.write_off_amount, self.precision("write_off_amount"))
):
write_off_account_currency = get_account_currency(self.write_off_account)
default_cost_center = frappe.get_cached_value("Company", self.company, "cost_center")
@@ -2103,13 +1991,13 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
target_detail_field = "sales_invoice_item" if doctype == "Sales Invoice" else "sales_order_item"
source_document_warehouse_field = "target_warehouse"
target_document_warehouse_field = "from_warehouse"
received_items = get_received_items(source_name, target_doctype, target_detail_field)
else:
source_doc = frappe.get_doc(doctype, source_name)
target_doctype = "Sales Invoice" if doctype == "Purchase Invoice" else "Sales Order"
source_document_warehouse_field = "from_warehouse"
target_document_warehouse_field = "target_warehouse"
received_items = get_received_items(source_name, target_doctype, target_detail_field)
received_items = {}
validate_inter_company_transaction(source_doc, doctype)
details = get_inter_company_details(source_doc, doctype)
@@ -2133,6 +2021,9 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
update_address(
target_doc, "shipping_address", "shipping_address_display", source_doc.customer_address
)
update_address(
target_doc, "billing_address", "billing_address_display", source_doc.customer_address
)
if currency:
target_doc.currency = currency
@@ -2177,6 +2068,19 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
def update_item(source, target, source_parent):
target.qty = flt(source.qty) - received_items.get(source.name, 0.0)
if source.doctype == "Purchase Order Item" and target.doctype == "Sales Order Item":
target.purchase_order = source.parent
target.purchase_order_item = source.name
target.material_request = source.material_request
target.material_request_item = source.material_request_item
if (
source.get("purchase_order")
and source.get("purchase_order_item")
and target.doctype == "Purchase Invoice Item"
):
target.purchase_order = source.purchase_order
target.po_detail = source.purchase_order_item
item_field_map = {
"doctype": target_doctype + " Item",
@@ -2203,6 +2107,12 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
"serial_no": "serial_no",
}
)
elif target_doctype == "Sales Order":
item_field_map["field_map"].update(
{
source_document_warehouse_field: "warehouse",
}
)
doclist = get_mapped_doc(
doctype,
@@ -2247,6 +2157,7 @@ def get_received_items(reference_name, doctype, reference_fieldname):
def set_purchase_references(doc):
# add internal PO or PR links if any
if doc.is_internal_transfer():
if doc.doctype == "Purchase Receipt":
so_item_map = get_delivery_note_details(doc.inter_company_invoice_reference)
@@ -2276,15 +2187,6 @@ def set_purchase_references(doc):
warehouse_map,
)
if list(so_item_map.values()):
pd_item_map, parent_child_map, warehouse_map = get_pd_details(
"Purchase Order Item", so_item_map, "sales_order_item"
)
update_pi_items(
doc, "po_detail", "purchase_order", so_item_map, pd_item_map, parent_child_map, warehouse_map
)
def update_pi_items(
doc,
@@ -2300,13 +2202,19 @@ def update_pi_items(
item.set(parent_field, parent_child_map.get(sales_item_map.get(item.sales_invoice_item)))
if doc.update_stock:
item.warehouse = warehouse_map.get(sales_item_map.get(item.sales_invoice_item))
if not item.warehouse and item.get("purchase_order") and item.get("purchase_order_item"):
item.warehouse = frappe.db.get_value(
"Purchase Order Item", item.purchase_order_item, "warehouse"
)
def update_pr_items(doc, sales_item_map, purchase_item_map, parent_child_map, warehouse_map):
for item in doc.get("items"):
item.purchase_order_item = purchase_item_map.get(sales_item_map.get(item.delivery_note_item))
item.warehouse = warehouse_map.get(sales_item_map.get(item.delivery_note_item))
item.purchase_order = parent_child_map.get(sales_item_map.get(item.delivery_note_item))
if not item.warehouse and item.get("purchase_order") and item.get("purchase_order_item"):
item.warehouse = frappe.db.get_value(
"Purchase Order Item", item.purchase_order_item, "warehouse"
)
def get_delivery_note_details(internal_reference):
@@ -2404,7 +2312,7 @@ def get_loyalty_programs(customer):
lp_details = get_loyalty_programs(customer)
if len(lp_details) == 1:
frappe.db.set(customer, "loyalty_program", lp_details[0])
customer.db_set("loyalty_program", lp_details[0])
return lp_details
else:
return lp_details
@@ -2535,7 +2443,6 @@ def create_dunning(source_name, target_doc=None):
target.closing_text = letter_text.get("closing_text")
target.language = letter_text.get("language")
amounts = calculate_interest_and_amount(
target.posting_date,
target.outstanding_amount,
target.rate_of_interest,
target.dunning_fee,

View File

@@ -29,7 +29,7 @@ frappe.listview_settings['Sales Invoice'] = {
});
listview.page.add_action_item(__("Payment"), ()=>{
erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment");
erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment Entry");
});
}
};

View File

@@ -8,7 +8,7 @@ import frappe
from frappe.model.dynamic_links import get_dynamic_link_map
from frappe.model.naming import make_autoname
from frappe.tests.utils import change_settings
from frappe.utils import add_days, flt, getdate, nowdate
from frappe.utils import add_days, flt, getdate, nowdate, today
import erpnext
from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account
@@ -32,10 +32,20 @@ from erpnext.stock.doctype.stock_entry.test_stock_entry import (
get_qty_after_transaction,
make_stock_entry,
)
from erpnext.stock.utils import get_incoming_rate
from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import (
create_stock_reconciliation,
)
from erpnext.stock.utils import get_incoming_rate, get_stock_balance
class TestSalesInvoice(unittest.TestCase):
def setUp(self):
from erpnext.stock.doctype.stock_ledger_entry.test_stock_ledger_entry import create_items
create_items(["_Test Internal Transfer Item"], uoms=[{"uom": "Box", "conversion_factor": 10}])
create_internal_parties()
setup_accounts()
def make(self):
w = frappe.copy_doc(test_records[0])
w.is_pos = 0
@@ -955,7 +965,8 @@ class TestSalesInvoice(unittest.TestCase):
pos_return.insert()
pos_return.submit()
self.assertEqual(pos_return.get("payments")[0].amount, -1000)
self.assertEqual(pos_return.get("payments")[0].amount, -500)
self.assertEqual(pos_return.get("payments")[1].amount, -500)
def test_pos_change_amount(self):
make_pos_profile(
@@ -1705,7 +1716,7 @@ class TestSalesInvoice(unittest.TestCase):
si.save()
self.assertEqual(si.get("items")[0].rate, flt((price_list_rate * 25) / 100 + price_list_rate))
def test_outstanding_amount_after_advance_jv_cancelation(self):
def test_outstanding_amount_after_advance_jv_cancellation(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
)
@@ -1749,7 +1760,7 @@ class TestSalesInvoice(unittest.TestCase):
flt(si.rounded_total + si.total_advance, si.precision("outstanding_amount")),
)
def test_outstanding_amount_after_advance_payment_entry_cancelation(self):
def test_outstanding_amount_after_advance_payment_entry_cancellation(self):
pe = frappe.get_doc(
{
"doctype": "Payment Entry",
@@ -2367,29 +2378,6 @@ class TestSalesInvoice(unittest.TestCase):
acc_settings.save()
def test_inter_company_transaction(self):
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
create_internal_customer(
customer_name="_Test Internal Customer",
represents_company="_Test Company 1",
allowed_to_interact_with="Wind Power LLC",
)
if not frappe.db.exists("Supplier", "_Test Internal Supplier"):
supplier = frappe.get_doc(
{
"supplier_group": "_Test Supplier Group",
"supplier_name": "_Test Internal Supplier",
"doctype": "Supplier",
"is_internal_supplier": 1,
"represents_company": "Wind Power LLC",
}
)
supplier.append("companies", {"company": "_Test Company 1"})
supplier.insert()
si = create_sales_invoice(
company="Wind Power LLC",
customer="_Test Internal Customer",
@@ -2440,38 +2428,6 @@ class TestSalesInvoice(unittest.TestCase):
"Expenses Included In Valuation - _TC1",
)
if not frappe.db.exists("Customer", "_Test Internal Customer"):
customer = frappe.get_doc(
{
"customer_group": "_Test Customer Group",
"customer_name": "_Test Internal Customer",
"customer_type": "Individual",
"doctype": "Customer",
"territory": "_Test Territory",
"is_internal_customer": 1,
"represents_company": "_Test Company 1",
}
)
customer.append("companies", {"company": "Wind Power LLC"})
customer.insert()
if not frappe.db.exists("Supplier", "_Test Internal Supplier"):
supplier = frappe.get_doc(
{
"supplier_group": "_Test Supplier Group",
"supplier_name": "_Test Internal Supplier",
"doctype": "Supplier",
"is_internal_supplier": 1,
"represents_company": "Wind Power LLC",
}
)
supplier.append("companies", {"company": "_Test Company 1"})
supplier.insert()
# begin test
si = create_sales_invoice(
company="Wind Power LLC",
@@ -2541,34 +2497,9 @@ class TestSalesInvoice(unittest.TestCase):
se.cancel()
def test_internal_transfer_gl_entry(self):
## Create internal transfer account
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
account = create_account(
account_name="Unrealized Profit",
parent_account="Current Liabilities - TCP1",
company="_Test Company with perpetual inventory",
)
frappe.db.set_value(
"Company", "_Test Company with perpetual inventory", "unrealized_profit_loss_account", account
)
customer = create_internal_customer(
"_Test Internal Customer 2",
"_Test Company with perpetual inventory",
"_Test Company with perpetual inventory",
)
create_internal_supplier(
"_Test Internal Supplier 2",
"_Test Company with perpetual inventory",
"_Test Company with perpetual inventory",
)
si = create_sales_invoice(
company="_Test Company with perpetual inventory",
customer=customer,
customer="_Test Internal Customer 2",
debit_to="Debtors - TCP1",
warehouse="Stores - TCP1",
income_account="Sales - TCP1",
@@ -2582,7 +2513,7 @@ class TestSalesInvoice(unittest.TestCase):
si.update_stock = 1
si.items[0].target_warehouse = "Work In Progress - TCP1"
# Add stock to stores for succesful stock transfer
# Add stock to stores for successful stock transfer
make_stock_entry(
target="Stores - TCP1", company="_Test Company with perpetual inventory", qty=1, basic_rate=100
)
@@ -2638,6 +2569,77 @@ class TestSalesInvoice(unittest.TestCase):
check_gl_entries(self, target_doc.name, pi_gl_entries, add_days(nowdate(), -1))
def test_internal_transfer_gl_precision_issues(self):
# Make a stock queue of an item with two valuations
# Remove all existing stock for this
if get_stock_balance("_Test Internal Transfer Item", "Stores - TCP1", "2022-04-10"):
create_stock_reconciliation(
item_code="_Test Internal Transfer Item",
warehouse="Stores - TCP1",
qty=0,
rate=0,
company="_Test Company with perpetual inventory",
expense_account="Stock Adjustment - TCP1"
if frappe.get_all("Stock Ledger Entry")
else "Temporary Opening - TCP1",
posting_date="2020-04-10",
posting_time="14:00",
)
make_stock_entry(
item_code="_Test Internal Transfer Item",
target="Stores - TCP1",
qty=9000000,
basic_rate=52.0,
posting_date="2020-04-10",
posting_time="14:00",
)
make_stock_entry(
item_code="_Test Internal Transfer Item",
target="Stores - TCP1",
qty=60000000,
basic_rate=52.349777,
posting_date="2020-04-10",
posting_time="14:00",
)
# Make an internal transfer Sales Invoice Stock in non stock uom to check
# for rounding errors while converting to stock uom
si = create_sales_invoice(
company="_Test Company with perpetual inventory",
customer="_Test Internal Customer 2",
item_code="_Test Internal Transfer Item",
qty=5000000,
uom="Box",
debit_to="Debtors - TCP1",
warehouse="Stores - TCP1",
income_account="Sales - TCP1",
expense_account="Cost of Goods Sold - TCP1",
cost_center="Main - TCP1",
currency="INR",
do_not_save=1,
)
# Check GL Entries with precision
si.update_stock = 1
si.items[0].target_warehouse = "Work In Progress - TCP1"
si.items[0].conversion_factor = 10
si.save()
si.submit()
# Check if adjustment entry is created
self.assertTrue(
frappe.db.exists(
"GL Entry",
{
"voucher_type": "Sales Invoice",
"voucher_no": si.name,
"remarks": "Rounding gain/loss Entry for Stock Transfer",
},
)
)
def test_item_tax_net_range(self):
item = create_item("T Shirt")
@@ -3077,7 +3079,7 @@ class TestSalesInvoice(unittest.TestCase):
[deferred_account, 2022.47, 0.0, "2019-03-15"],
]
gl_entries = gl_entries = frappe.db.sql(
gl_entries = frappe.db.sql(
"""select account, debit, credit, posting_date
from `tabGL Entry`
where voucher_type='Journal Entry' and voucher_detail_no=%s and posting_date <= %s
@@ -3196,6 +3198,53 @@ class TestSalesInvoice(unittest.TestCase):
"Accounts Settings", "Accounts Settings", "unlink_payment_on_cancel_of_invoice", unlink_enabled
)
def test_batch_expiry_for_sales_invoice_return(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
from erpnext.stock.doctype.item.test_item import make_item
item = make_item(
"_Test Batch Item For Return Check",
{
"is_purchase_item": 1,
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": "TBIRC.#####",
},
)
pr = make_purchase_receipt(qty=1, item_code=item.name)
batch_no = pr.items[0].batch_no
si = create_sales_invoice(qty=1, item_code=item.name, update_stock=1, batch_no=batch_no)
si.load_from_db()
batch_no = si.items[0].batch_no
self.assertTrue(batch_no)
frappe.db.set_value("Batch", batch_no, "expiry_date", add_days(today(), -1))
return_si = make_return_doc(si.doctype, si.name)
return_si.save().submit()
self.assertTrue(return_si.docstatus == 1)
def test_sales_invoice_with_payable_tax_account(self):
si = create_sales_invoice(do_not_submit=True)
si.append(
"taxes",
{
"charge_type": "Actual",
"account_head": "Creditors - _TC",
"description": "Test",
"cost_center": "Main - _TC",
"tax_amount": 10,
"total": 10,
"dont_recompute_tax": 0,
},
)
self.assertRaises(frappe.ValidationError, si.submit)
def get_sales_invoice_for_e_invoice():
si = make_sales_invoice_for_ewaybill()
@@ -3275,6 +3324,7 @@ def create_sales_invoice(**args):
"item_name": args.item_name or "_Test Item",
"description": args.description or "_Test Item",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
"target_warehouse": args.target_warehouse,
"qty": args.qty or 1,
"uom": args.uom or "Nos",
"stock_uom": args.uom or "Nos",
@@ -3287,8 +3337,9 @@ def create_sales_invoice(**args):
"asset": args.asset or None,
"cost_center": args.cost_center or "_Test Cost Center - _TC",
"serial_no": args.serial_no,
"conversion_factor": 1,
"conversion_factor": args.get("conversion_factor", 1),
"incoming_rate": args.incoming_rate or 0,
"batch_no": args.batch_no or None,
},
)
@@ -3399,6 +3450,34 @@ def get_taxes_and_charges():
]
def create_internal_parties():
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
create_internal_customer(
customer_name="_Test Internal Customer",
represents_company="_Test Company 1",
allowed_to_interact_with="Wind Power LLC",
)
create_internal_customer(
customer_name="_Test Internal Customer 2",
represents_company="_Test Company with perpetual inventory",
allowed_to_interact_with="_Test Company with perpetual inventory",
)
create_internal_supplier(
supplier_name="_Test Internal Supplier",
represents_company="Wind Power LLC",
allowed_to_interact_with="_Test Company 1",
)
create_internal_supplier(
supplier_name="_Test Internal Supplier 2",
represents_company="_Test Company with perpetual inventory",
allowed_to_interact_with="_Test Company with perpetual inventory",
)
def create_internal_supplier(supplier_name, represents_company, allowed_to_interact_with):
if not frappe.db.exists("Supplier", supplier_name):
supplier = frappe.get_doc(
@@ -3421,6 +3500,19 @@ def create_internal_supplier(supplier_name, represents_company, allowed_to_inter
return supplier_name
def setup_accounts():
## Create internal transfer account
account = create_account(
account_name="Unrealized Profit",
parent_account="Current Liabilities - TCP1",
company="_Test Company with perpetual inventory",
)
frappe.db.set_value(
"Company", "_Test Company with perpetual inventory", "unrealized_profit_loss_account", account
)
def add_taxes(doc):
doc.append(
"taxes",

View File

@@ -8,6 +8,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
"has_item_scanned",
"item_code",
"col_break1",
"item_name",
@@ -96,6 +97,10 @@
"delivery_note",
"dn_detail",
"delivered_qty",
"internal_transfer_section",
"purchase_order",
"column_break_92",
"purchase_order_item",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
@@ -243,6 +248,7 @@
},
{
"collapsible": 1,
"collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"fieldname": "discount_and_margin",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -282,7 +288,6 @@
"label": "Discount (%) on Price List Rate with Margin",
"oldfieldname": "adj_rate",
"oldfieldtype": "Float",
"precision": "2",
"print_hide": 1
},
{
@@ -817,6 +822,7 @@
"label": "Incoming Rate (Costing)",
"no_copy": 1,
"options": "Company:company:default_currency",
"precision": "6",
"print_hide": 1
},
{
@@ -841,12 +847,46 @@
"fieldtype": "Check",
"label": "Grant Commission",
"read_only": 1
},
{
"collapsible": 1,
"depends_on": "eval:parent.is_internal_customer == 1",
"fieldname": "internal_transfer_section",
"fieldtype": "Section Break",
"label": "Internal Transfer"
},
{
"fieldname": "purchase_order",
"fieldtype": "Link",
"label": "Purchase Order",
"options": "Purchase Order",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "column_break_92",
"fieldtype": "Column Break"
},
{
"fieldname": "purchase_order_item",
"fieldtype": "Data",
"label": "Purchase Order Item",
"print_hide": 1,
"read_only": 1
},
{
"default": "0",
"depends_on": "barcode",
"fieldname": "has_item_scanned",
"fieldtype": "Check",
"label": "Has Item Scanned",
"read_only": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2022-06-17 05:33:15.335912",
"modified": "2022-11-02 12:53:12.693217",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -3,6 +3,7 @@
import frappe
from dateutil import relativedelta
from frappe import _
from frappe.model.document import Document
from frappe.utils import date_diff, flt, get_first_day, get_last_day, getdate
@@ -49,7 +50,7 @@ def get_plan_rate(
start_date = getdate(start_date)
end_date = getdate(end_date)
no_of_months = (end_date.year - start_date.year) * 12 + (end_date.month - start_date.month) + 1
no_of_months = relativedelta.relativedelta(end_date, start_date).months + 1
cost = plan.cost * no_of_months
# Adjust cost if start or end date is not month start or end

View File

@@ -0,0 +1,49 @@
{
"actions": [],
"autoname": "autoincrement",
"creation": "2022-09-13 16:18:59.404842",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"voucher_type",
"voucher_name",
"taxable_amount"
],
"fields": [
{
"fieldname": "voucher_type",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Voucher Type",
"options": "DocType"
},
{
"fieldname": "voucher_name",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Voucher Name",
"options": "voucher_type"
},
{
"fieldname": "taxable_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Taxable Amount",
"options": "Company:company:default_currency"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2022-09-13 23:40:41.479208",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Withheld Vouchers",
"naming_rule": "Autoincrement",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class TaxWithheldVouchers(Document):
pass

View File

@@ -61,6 +61,9 @@ def get_party_details(inv):
def get_party_tax_withholding_details(inv, tax_withholding_category=None):
if inv.doctype == "Payment Entry":
inv.tax_withholding_net_total = inv.net_total
pan_no = ""
parties = []
party_type, party = get_party_details(inv)
@@ -109,7 +112,7 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
).format(tax_withholding_category, inv.company, party)
)
tax_amount, tax_deducted, tax_deducted_on_advances = get_tax_amount(
tax_amount, tax_deducted, tax_deducted_on_advances, voucher_wise_amount = get_tax_amount(
party_type, parties, inv, tax_details, posting_date, pan_no
)
@@ -119,7 +122,7 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
tax_row = get_tax_row_for_tcs(inv, tax_details, tax_amount, tax_deducted)
if inv.doctype == "Purchase Invoice":
return tax_row, tax_deducted_on_advances
return tax_row, tax_deducted_on_advances, voucher_wise_amount
else:
return tax_row
@@ -217,7 +220,9 @@ def get_lower_deduction_certificate(tax_details, pan_no):
def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=None):
vouchers = get_invoice_vouchers(parties, tax_details, inv.company, party_type=party_type)
vouchers, voucher_wise_amount = get_invoice_vouchers(
parties, tax_details, inv.company, party_type=party_type
)
advance_vouchers = get_advance_vouchers(
parties,
company=inv.company,
@@ -236,16 +241,20 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
tax_deducted = get_deducted_tax(taxable_vouchers, tax_details)
tax_amount = 0
if party_type == "Supplier":
ldc = get_lower_deduction_certificate(tax_details, pan_no)
if tax_deducted:
net_total = inv.net_total
net_total = inv.tax_withholding_net_total
if ldc:
tax_amount = get_tds_amount_from_ldc(
ldc, parties, pan_no, tax_details, posting_date, net_total
)
else:
tax_amount = net_total * tax_details.rate / 100 if net_total > 0 else 0
# once tds is deducted, not need to add vouchers in the invoice
voucher_wise_amount = {}
else:
tax_amount = get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers)
@@ -261,12 +270,18 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
if cint(tax_details.round_off_tax_amount):
tax_amount = round(tax_amount)
return tax_amount, tax_deducted, tax_deducted_on_advances
return tax_amount, tax_deducted, tax_deducted_on_advances, voucher_wise_amount
def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
dr_or_cr = "credit" if party_type == "Supplier" else "debit"
doctype = "Purchase Invoice" if party_type == "Supplier" else "Sales Invoice"
field = (
"base_tax_withholding_net_total as base_net_total"
if party_type == "Supplier"
else "base_net_total"
)
voucher_wise_amount = {}
vouchers = []
filters = {
"company": company,
@@ -281,29 +296,40 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
{"apply_tds": 1, "tax_withholding_category": tax_details.get("tax_withholding_category")}
)
invoices = frappe.get_all(doctype, filters=filters, pluck="name") or [""]
invoices_details = frappe.get_all(doctype, filters=filters, fields=["name", field])
journal_entries = frappe.db.sql(
for d in invoices_details:
vouchers.append(d.name)
voucher_wise_amount.update({d.name: {"amount": d.base_net_total, "voucher_type": doctype}})
journal_entries_details = frappe.db.sql(
"""
SELECT j.name
SELECT j.name, ja.credit - ja.debit AS amount
FROM `tabJournal Entry` j, `tabJournal Entry Account` ja
WHERE
j.docstatus = 1
j.name = ja.parent
AND j.docstatus = 1
AND j.is_opening = 'No'
AND j.posting_date between %s and %s
AND ja.{dr_or_cr} > 0
AND ja.party in %s
""".format(
dr_or_cr=dr_or_cr
AND j.apply_tds = 1
AND j.tax_withholding_category = %s
""",
(
tax_details.from_date,
tax_details.to_date,
tuple(parties),
tax_details.get("tax_withholding_category"),
),
(tax_details.from_date, tax_details.to_date, tuple(parties)),
as_list=1,
as_dict=1,
)
if journal_entries:
journal_entries = journal_entries[0]
if journal_entries_details:
for d in journal_entries_details:
vouchers.append(d.name)
voucher_wise_amount.update({d.name: {"amount": d.amount, "voucher_type": "Journal Entry"}})
return invoices + journal_entries
return vouchers, voucher_wise_amount
def get_advance_vouchers(
@@ -318,9 +344,11 @@ def get_advance_vouchers(
"is_cancelled": 0,
"party_type": party_type,
"party": ["in", parties],
"against_voucher": ["is", "not set"],
}
if party_type == "Customer":
filters.update({"against_voucher": ["is", "not set"]})
if company:
filters["company"] = company
if from_date and to_date:
@@ -330,23 +358,25 @@ def get_advance_vouchers(
def get_taxes_deducted_on_advances_allocated(inv, tax_details):
advances = [d.reference_name for d in inv.get("advances")]
tax_info = []
if advances:
pe = frappe.qb.DocType("Payment Entry").as_("pe")
at = frappe.qb.DocType("Advance Taxes and Charges").as_("at")
if inv.get("advances"):
advances = [d.reference_name for d in inv.get("advances")]
tax_info = (
frappe.qb.from_(at)
.inner_join(pe)
.on(pe.name == at.parent)
.select(at.parent, at.name, at.tax_amount, at.allocated_amount)
.where(pe.tax_withholding_category == tax_details.get("tax_withholding_category"))
.where(at.parent.isin(advances))
.where(at.account_head == tax_details.account_head)
.run(as_dict=True)
)
if advances:
pe = frappe.qb.DocType("Payment Entry").as_("pe")
at = frappe.qb.DocType("Advance Taxes and Charges").as_("at")
tax_info = (
frappe.qb.from_(at)
.inner_join(pe)
.on(pe.name == at.parent)
.select(at.parent, at.name, at.tax_amount, at.allocated_amount)
.where(pe.tax_withholding_category == tax_details.get("tax_withholding_category"))
.where(at.parent.isin(advances))
.where(at.account_head == tax_details.account_head)
.run(as_dict=True)
)
return tax_info
@@ -370,7 +400,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
tds_amount = 0
invoice_filters = {"name": ("in", vouchers), "docstatus": 1, "apply_tds": 1}
field = "sum(net_total)"
field = "sum(tax_withholding_net_total)"
if cint(tax_details.consider_party_ledger_amount):
invoice_filters.pop("apply_tds", None)
@@ -393,17 +423,12 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
)
supp_credit_amt += supp_jv_credit_amt
supp_credit_amt += inv.net_total
debit_note_amount = get_debit_note_amount(
parties, tax_details.from_date, tax_details.to_date, inv.company
)
supp_credit_amt -= debit_note_amount
supp_credit_amt += inv.tax_withholding_net_total
threshold = tax_details.get("threshold", 0)
cumulative_threshold = tax_details.get("cumulative_threshold", 0)
if (threshold and inv.net_total >= threshold) or (
if (threshold and inv.tax_withholding_net_total >= threshold) or (
cumulative_threshold and supp_credit_amt >= cumulative_threshold
):
if (cumulative_threshold and supp_credit_amt >= cumulative_threshold) and cint(
@@ -411,8 +436,11 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
net_total = frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(net_total)") or 0.0
net_total += inv.net_total
net_total = (
frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(tax_withholding_net_total)")
or 0.0
)
net_total += inv.tax_withholding_net_total
supp_credit_amt = net_total - cumulative_threshold
if ldc and is_valid_certificate(
@@ -420,7 +448,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
ldc.valid_upto,
inv.get("posting_date") or inv.get("transaction_date"),
tax_deducted,
inv.net_total,
inv.tax_withholding_net_total,
ldc.certificate_limit,
):
tds_amount = get_ltds_amount(supp_credit_amt, 0, ldc.certificate_limit, ldc.rate, tax_details)
@@ -503,7 +531,7 @@ def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net
limit_consumed = frappe.db.get_value(
"Purchase Invoice",
{"supplier": ("in", parties), "apply_tds": 1, "docstatus": 1},
"sum(net_total)",
"sum(tax_withholding_net_total)",
)
if is_valid_certificate(
@@ -516,22 +544,6 @@ def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net
return tds_amount
def get_debit_note_amount(suppliers, from_date, to_date, company=None):
filters = {
"supplier": ["in", suppliers],
"is_return": 1,
"docstatus": 1,
"posting_date": ["between", (from_date, to_date)],
}
fields = ["abs(sum(net_total)) as net_total"]
if company:
filters["company"] = company
return frappe.get_all("Purchase Invoice", filters, fields)[0].get("net_total") or 0.0
def get_ltds_amount(current_amount, deducted_amount, certificate_limit, rate, tax_details):
if current_amount < (certificate_limit - deducted_amount):
return current_amount * rate / 100

View File

@@ -52,7 +52,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
invoices.append(pi)
# delete invoices to avoid clashing
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_single_threshold_tds(self):
@@ -88,7 +88,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi.taxes_and_charges_deducted, 1000)
# delete invoices to avoid clashing
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_tax_withholding_category_checks(self):
@@ -114,7 +114,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
# TDS should be applied only on 1000
self.assertEqual(pi1.taxes[0].tax_amount, 1000)
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_cumulative_threshold_tcs(self):
@@ -148,8 +148,8 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(tcs_charged, 500)
invoices.append(si)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_tds_calculation_on_net_total(self):
@@ -182,8 +182,48 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi1.taxes[0].tax_amount, 4000)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_tds_calculation_on_net_total_partial_tds(self):
frappe.db.set_value(
"Supplier", "Test TDS Supplier4", "tax_withholding_category", "Cumulative Threshold TDS"
)
invoices = []
pi = create_purchase_invoice(supplier="Test TDS Supplier4", rate=20000, do_not_save=True)
pi.extend(
"items",
[
{
"doctype": "Purchase Invoice Item",
"item_code": frappe.db.get_value("Item", {"item_name": "TDS Item"}, "name"),
"qty": 1,
"rate": 20000,
"cost_center": "Main - _TC",
"expense_account": "Stock Received But Not Billed - _TC",
"apply_tds": 0,
},
{
"doctype": "Purchase Invoice Item",
"item_code": frappe.db.get_value("Item", {"item_name": "TDS Item"}, "name"),
"qty": 1,
"rate": 35000,
"cost_center": "Main - _TC",
"expense_account": "Stock Received But Not Billed - _TC",
"apply_tds": 1,
},
],
)
pi.save()
pi.submit()
invoices.append(pi)
self.assertEqual(pi.taxes[0].tax_amount, 5500)
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_multi_category_single_supplier(self):
@@ -207,8 +247,50 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi1.taxes[0].tax_amount, 250)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_tax_withholding_category_voucher_display(self):
frappe.db.set_value(
"Supplier", "Test TDS Supplier6", "tax_withholding_category", "Test Multi Invoice Category"
)
invoices = []
pi = create_purchase_invoice(supplier="Test TDS Supplier6", rate=4000, do_not_save=True)
pi.apply_tds = 1
pi.tax_withholding_category = "Test Multi Invoice Category"
pi.save()
pi.submit()
invoices.append(pi)
pi1 = create_purchase_invoice(supplier="Test TDS Supplier6", rate=2000, do_not_save=True)
pi1.apply_tds = 1
pi1.is_return = 1
pi1.items[0].qty = -1
pi1.tax_withholding_category = "Test Multi Invoice Category"
pi1.save()
pi1.submit()
invoices.append(pi1)
pi2 = create_purchase_invoice(supplier="Test TDS Supplier6", rate=9000, do_not_save=True)
pi2.apply_tds = 1
pi2.tax_withholding_category = "Test Multi Invoice Category"
pi2.save()
pi2.submit()
invoices.append(pi2)
pi2.load_from_db()
self.assertTrue(pi2.taxes[0].tax_amount, 1100)
self.assertTrue(pi2.tax_withheld_vouchers[0].voucher_name == pi1.name)
self.assertTrue(pi2.tax_withheld_vouchers[0].taxable_amount == pi1.net_total)
self.assertTrue(pi2.tax_withheld_vouchers[1].voucher_name == pi.name)
self.assertTrue(pi2.tax_withheld_vouchers[1].taxable_amount == pi.net_total)
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
@@ -308,6 +390,7 @@ def create_records():
"Test TDS Supplier3",
"Test TDS Supplier4",
"Test TDS Supplier5",
"Test TDS Supplier6",
]:
if frappe.db.exists("Supplier", name):
continue
@@ -498,3 +581,22 @@ def create_tax_with_holding_category():
"accounts": [{"company": "_Test Company", "account": "TDS - _TC"}],
}
).insert()
if not frappe.db.exists("Tax Withholding Category", "Test Multi Invoice Category"):
frappe.get_doc(
{
"doctype": "Tax Withholding Category",
"name": "Test Multi Invoice Category",
"category_name": "Test Multi Invoice Category",
"rates": [
{
"from_date": fiscal_year[1],
"to_date": fiscal_year[2],
"tax_withholding_rate": 10,
"single_threshold": 5000,
"cumulative_threshold": 10000,
}
],
"accounts": [{"company": "_Test Company", "account": "TDS - _TC"}],
}
).insert()

View File

@@ -128,6 +128,12 @@ def distribute_gl_based_on_cost_center_allocation(gl_map, precision=None):
new_gl_map = []
for d in gl_map:
cost_center = d.get("cost_center")
# Validate budget against main cost center
validate_expense_against_budget(
d, expense_amount=flt(d.debit, precision) - flt(d.credit, precision)
)
if cost_center and cost_center_allocation.get(cost_center):
for sub_cost_center, percentage in cost_center_allocation.get(cost_center, {}).items():
gle = copy.deepcopy(d)
@@ -489,7 +495,6 @@ def make_reverse_gl_entries(
).run(as_dict=1)
if gl_entries:
create_payment_ledger_entry(gl_entries, cancel=1)
create_payment_ledger_entry(
gl_entries, cancel=1, adv_adj=adv_adj, update_outstanding=update_outstanding
)

View File

@@ -207,7 +207,7 @@ def set_address_details(
)
if company_address:
party_details.update({"company_address": company_address})
party_details.company_address = company_address
else:
party_details.update(get_company_address(company))
@@ -219,12 +219,31 @@ def set_address_details(
get_regional_address_details(party_details, doctype, company)
elif doctype and doctype in ["Purchase Invoice", "Purchase Order", "Purchase Receipt"]:
if party_details.company_address:
party_details["shipping_address"] = shipping_address or party_details["company_address"]
party_details.shipping_address_display = get_address_display(party_details["shipping_address"])
if shipping_address:
party_details.update(
get_fetch_values(doctype, "shipping_address", party_details.shipping_address)
shipping_address=shipping_address,
shipping_address_display=get_address_display(shipping_address),
**get_fetch_values(doctype, "shipping_address", shipping_address)
)
if party_details.company_address:
# billing address
party_details.update(
billing_address=party_details.company_address,
billing_address_display=(
party_details.company_address_display or get_address_display(party_details.company_address)
),
**get_fetch_values(doctype, "billing_address", party_details.company_address)
)
# shipping address - if not already set
if not party_details.shipping_address:
party_details.update(
shipping_address=party_details.billing_address,
shipping_address_display=party_details.billing_address_display,
**get_fetch_values(doctype, "shipping_address", party_details.billing_address)
)
get_regional_address_details(party_details, doctype, company)
return party_details.get(billing_address_field), party_details.shipping_address_name

View File

@@ -51,6 +51,8 @@ frappe.query_reports["Accounts Payable"] = {
} else {
frappe.query_report.set_filter_value('tax_id', "");
}
frappe.query_report.refresh();
}
},
{

View File

@@ -178,6 +178,11 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldtype": "Data",
"hidden": 1
},
{
"fieldname": "show_remarks",
"label": __("Show Remarks"),
"fieldtype": "Check",
},
{
"fieldname": "customer_name",
"label": __("Customer Name"),

View File

@@ -119,6 +119,7 @@ class ReceivablePayableReport(object):
party_account=ple.account,
posting_date=ple.posting_date,
account_currency=ple.account_currency,
remarks=ple.remarks,
invoiced=0.0,
paid=0.0,
credit_note=0.0,
@@ -165,7 +166,7 @@ class ReceivablePayableReport(object):
"range4",
"range5",
"future_amount",
"remaining_balance"
"remaining_balance",
]
def get_voucher_balance(self, ple):
@@ -178,6 +179,11 @@ class ReceivablePayableReport(object):
key = (ple.against_voucher_type, ple.against_voucher_no, ple.party)
row = self.voucher_balance.get(key)
if not row:
# no invoice, this is an invoice / stand-alone payment / credit note
row = self.voucher_balance.get((ple.voucher_type, ple.voucher_no, ple.party))
return row
def update_voucher_balance(self, ple):
@@ -187,7 +193,11 @@ class ReceivablePayableReport(object):
if not row:
return
amount = ple.amount
# amount in "Party Currency", if its supplied. If not, amount in company currency
if self.filters.get(scrub(self.party_type)):
amount = ple.amount_in_account_currency
else:
amount = ple.amount
amount_in_account_currency = ple.amount_in_account_currency
# update voucher
@@ -685,9 +695,10 @@ class ReceivablePayableReport(object):
ple.party,
ple.posting_date,
ple.due_date,
ple.account_currency.as_("currency"),
ple.account_currency,
ple.amount,
ple.amount_in_account_currency,
ple.remarks,
)
.where(ple.delinked == 0)
.where(Criterion.all(self.qb_selection_filter))
@@ -722,6 +733,7 @@ class ReceivablePayableReport(object):
def prepare_conditions(self):
self.qb_selection_filter = []
party_type_field = scrub(self.party_type)
self.qb_selection_filter.append(self.ple.party_type == self.party_type)
self.add_common_filters(party_type_field=party_type_field)
@@ -736,7 +748,7 @@ class ReceivablePayableReport(object):
self.add_accounting_dimensions_filters()
def get_cost_center_conditions(self, conditions):
def get_cost_center_conditions(self):
lft, rgt = frappe.db.get_value("Cost Center", self.filters.cost_center, ["lft", "rgt"])
cost_center_list = [
center.name
@@ -772,7 +784,7 @@ class ReceivablePayableReport(object):
def add_customer_filters(
self,
):
self.customter = qb.DocType("Customer")
self.customer = qb.DocType("Customer")
if self.filters.get("customer_group"):
self.get_hierarchical_filters("Customer Group", "customer_group")
@@ -826,7 +838,7 @@ class ReceivablePayableReport(object):
customer = self.customer
groups = qb.from_(doc).select(doc.name).where((doc.lft >= lft) & (doc.rgt <= rgt))
customers = qb.from_(customer).select(customer.name).where(customer[key].isin(groups))
self.qb_selection_filter.append(ple.isin(ple.party.isin(customers)))
self.qb_selection_filter.append(ple.party.isin(customers))
def add_accounting_dimensions_filters(self):
accounting_dimensions = get_accounting_dimensions(as_list=False)
@@ -965,6 +977,9 @@ class ReceivablePayableReport(object):
options="Supplier Group",
)
if self.filters.show_remarks:
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200),
def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120):
if not fieldname:
fieldname = scrub(label)
@@ -994,7 +1009,7 @@ class ReceivablePayableReport(object):
"{range3}-{range4}".format(
range3=cint(self.filters["range3"]) + 1, range4=self.filters["range4"]
),
"{range4}-{above}".format(range4=cint(self.filters["range4"]) + 1, above=_("Above")),
_("{range4}-Above").format(range4=cint(self.filters["range4"]) + 1),
]
):
self.add_column(label=label, fieldname="range" + str(i + 1))

View File

@@ -1,19 +1,27 @@
import unittest
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.utils import add_days, getdate, today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.accounts_receivable.accounts_receivable import execute
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
class TestAccountsReceivable(unittest.TestCase):
def test_accounts_receivable(self):
class TestAccountsReceivable(FrappeTestCase):
def setUp(self):
frappe.db.sql("delete from `tabSales Invoice` where company='_Test Company 2'")
frappe.db.sql("delete from `tabSales Order` where company='_Test Company 2'")
frappe.db.sql("delete from `tabPayment Entry` where company='_Test Company 2'")
frappe.db.sql("delete from `tabGL Entry` where company='_Test Company 2'")
frappe.db.sql("delete from `tabPayment Ledger Entry` where company='_Test Company 2'")
def tearDown(self):
frappe.db.rollback()
def test_accounts_receivable(self):
filters = {
"company": "_Test Company 2",
"based_on_payment_terms": 1,
@@ -66,6 +74,50 @@ class TestAccountsReceivable(unittest.TestCase):
],
)
def test_payment_againt_po_in_receivable_report(self):
"""
Payments made against Purchase Order will show up as outstanding amount
"""
so = make_sales_order(
company="_Test Company 2",
customer="_Test Customer 2",
warehouse="Finished Goods - _TC2",
currency="EUR",
debit_to="Debtors - _TC2",
income_account="Sales - _TC2",
expense_account="Cost of Goods Sold - _TC2",
cost_center="Main - _TC2",
)
pe = get_payment_entry(so.doctype, so.name)
pe = pe.save().submit()
filters = {
"company": "_Test Company 2",
"based_on_payment_terms": 0,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
}
report = execute(filters)
expected_data_after_payment = [0, 1000, 0, -1000]
row = report[1][0]
self.assertEqual(
expected_data_after_payment,
[
row.invoiced,
row.paid,
row.credit_note,
row.outstanding,
],
)
def make_sales_invoice():
frappe.set_user("Administrator")

View File

@@ -22,8 +22,7 @@ def get_columns():
{
"label": _("Payment Document Type"),
"fieldname": "payment_document_type",
"fieldtype": "Link",
"options": "Doctype",
"fieldtype": "Data",
"width": 130,
},
{
@@ -33,15 +32,15 @@ def get_columns():
"options": "payment_document_type",
"width": 140,
},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 100},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 120},
{"label": _("Cheque/Reference No"), "fieldname": "cheque_no", "width": 120},
{"label": _("Clearance Date"), "fieldname": "clearance_date", "fieldtype": "Date", "width": 100},
{"label": _("Clearance Date"), "fieldname": "clearance_date", "fieldtype": "Date", "width": 120},
{
"label": _("Against Account"),
"fieldname": "against",
"fieldtype": "Link",
"options": "Account",
"width": 170,
"width": 200,
},
{"label": _("Amount"), "fieldname": "amount", "fieldtype": "Currency", "width": 120},
]

View File

@@ -75,7 +75,7 @@ frappe.query_reports["Budget Variance Report"] = {
"formatter": function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (column.fieldname.includes('variance')) {
if (column.fieldname.includes(__("variance"))) {
if (data[column.fieldname] < 0) {
value = "<span style='color:red'>" + value + "</span>";

View File

@@ -383,8 +383,8 @@ def get_chart_data(filters, columns, data):
"data": {
"labels": labels,
"datasets": [
{"name": "Budget", "chartType": "bar", "values": budget_values},
{"name": "Actual Expense", "chartType": "bar", "values": actual_values},
{"name": _("Budget"), "chartType": "bar", "values": budget_values},
{"name": _("Actual Expense"), "chartType": "bar", "values": actual_values},
],
},
"type": "bar",

View File

@@ -535,7 +535,11 @@ def get_accounts(root_type, companies):
):
if account.account_name not in added_accounts:
accounts.append(account)
added_accounts.append(account.account_name)
if account.account_number:
account_key = account.account_number + "-" + account.account_name
else:
account_key = account.account_name
added_accounts.append(account_key)
return accounts

View File

@@ -396,7 +396,7 @@ class Deferred_Revenue_and_Expense_Report(object):
"labels": [period.label for period in self.period_list],
"datasets": [
{
"name": "Actual Posting",
"name": _("Actual Posting"),
"chartType": "bar",
"values": [x.actual for x in self.period_total],
}
@@ -410,7 +410,7 @@ class Deferred_Revenue_and_Expense_Report(object):
if self.filters.with_upcoming_postings:
chart["data"]["datasets"].append(
{"name": "Expected", "chartType": "line", "values": [x.total for x in self.period_total]}
{"name": _("Expected"), "chartType": "line", "values": [x.total for x in self.period_total]}
)
return chart

View File

@@ -52,22 +52,22 @@
{% } %}
</td>
<td style="text-align: right">
{%= format_currency(data[i].debit, filters.presentation_currency) %}</td>
{%= format_currency(data[i].debit, filters.presentation_currency || data[i].account_currency) %}</td>
<td style="text-align: right">
{%= format_currency(data[i].credit, filters.presentation_currency) %}</td>
{%= format_currency(data[i].credit, filters.presentation_currency || data[i].account_currency) %}</td>
{% } else { %}
<td></td>
<td></td>
<td><b>{%= frappe.format(data[i].account, {fieldtype: "Link"}) || "&nbsp;" %}</b></td>
<td style="text-align: right">
{%= data[i].account && format_currency(data[i].debit, filters.presentation_currency) %}
{%= data[i].account && format_currency(data[i].debit, filters.presentation_currency || data[i].account_currency) %}
</td>
<td style="text-align: right">
{%= data[i].account && format_currency(data[i].credit, filters.presentation_currency) %}
{%= data[i].account && format_currency(data[i].credit, filters.presentation_currency || data[i].account_currency) %}
</td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i].balance, filters.presentation_currency) %}
{%= format_currency(data[i].balance, filters.presentation_currency || data[i].account_currency) %}
</td>
</tr>
{% } %}

View File

@@ -121,7 +121,7 @@ def set_account_currency(filters):
if is_same_account_currency:
account_currency = currency
elif filters.get("party"):
elif filters.get("party") and filters.get("party_type"):
gle_currency = frappe.db.get_value(
"GL Entry",
{"party_type": filters.party_type, "party": filters.party[0], "company": filters.company},
@@ -134,7 +134,7 @@ def set_account_currency(filters):
account_currency = (
None
if filters.party_type in ["Employee", "Shareholder", "Member"]
else frappe.db.get_value(filters.party_type, filters.party[0], "default_currency")
else frappe.get_cached_value(filters.party_type, filters.party[0], "default_currency")
)
filters["account_currency"] = account_currency or filters.company_currency
@@ -237,9 +237,9 @@ def get_conditions(filters):
or filters.get("party")
or filters.get("group_by") in ["Group by Account", "Group by Party"]
):
conditions.append("posting_date >=%(from_date)s")
conditions.append("(posting_date >=%(from_date)s or is_opening = 'Yes')")
conditions.append("(posting_date <=%(to_date)s or is_opening = 'Yes')")
conditions.append("(posting_date <=%(to_date)s)")
if filters.get("project"):
conditions.append("project in %(project)s")

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