Compare commits

...

2831 Commits

Author SHA1 Message Date
Frappe PR Bot
7d63bcbeb6 chore(release): Bumped to Version 14.9.0
# [14.9.0](https://github.com/frappe/erpnext/compare/v14.8.0...v14.9.0) (2022-11-29)

### Bug Fixes

* `production_item` filter in `Job Card Summary Report` ([c9f4f60](c9f4f60425))
* `Work Order` filter typo in `Job Card Summary Report` ([b157193](b1571932d0))
* Auto repeat date validations ([2aada1a](2aada1a0d9))
* check for session user rather than owner ([c9c7222](c9c7222ded))
* company name with `,` in `Job Card Summary Report` ([9c6d020](9c6d020e49))
* company name with `,` in `Work Order Summary Report` ([bc649b3](bc649b371f))
* create rounding gl entry for PCV during gle post processing ([fd4bcd9](fd4bcd9f7f))
* Debit and Credit not equal while submitting PI containing asset item ([c11a31b](c11a31b390))
* disbursable amount on currrent security price ([5edaf83](5edaf83733))
* Dispatch address display ([ef687e2](ef687e22b8))
* incorrect balance qty ([f92b501](f92b5011da))
* job card for quantity UX ([59e2ab7](59e2ab702f))
* MR Item `description` and `item_name` gets reset on `qty` change ([85d108b](85d108b810))
* only show serial no batch selector only once ([8d0f715](8d0f715087))
* opportunity list doesn't show assigned user (backport [#33110](https://github.com/frappe/erpnext/issues/33110)) ([#33131](https://github.com/frappe/erpnext/issues/33131)) ([0ba2a4d](0ba2a4d084))
* **pos:** filter on customer groups ([c1ae5b0](c1ae5b0af5))
* **pos:** warehouse should be in company ([c03ec80](c03ec80d1a))
* precision in asset test_scrap_asset ([0fe5e9a](0fe5e9a9d1))
* production plan UX ([4607590](46075901ba))
* remove duplicate schema ([cdd13cd](cdd13cd95f))
* remove obsolete comment ([978924a](978924a7e4))
* reposting error `AttributeError: 'datetime.timedelta' object has no attribute 'replace'` ([4b0c9b6](4b0c9b6115))
* reset `voucher_type` and `voucher_no` if `based_on` is set to `Item and Warehouse` ([e530f0b](e530f0b2fb))
* UX for inventory dimension ([f1dd4d0](f1dd4d0449))
* **ux:** Action buttons in Bank Reconciliation ([93b8cc3](93b8cc3042))
* validation msg in stock entry ([65ac84e](65ac84e020))
* Valuation Rate column UX in stock ledger report ([5c065e8](5c065e8a64))

### Features

* add connections to Incoterm doctype ([89b9a06](89b9a06204))
* add doctype Incoterm ([b711931](b7119318a6))
* add german translations for incoterm titles ([f7988de](f7988dea1b))
* add incoterm to purchasing transactions ([88346b1](88346b17e9))
* add incoterm to sales transactions ([fcfe0cb](fcfe0cb9e9))
* create Incoterm records after install ([93e029d](93e029df91))
* create incoterms and migrate shipments ([014896a](014896a595))
* german tax templates ([5652af0](5652af04ba))
* item wise tds calculation for purchase order ([5f8f574](5f8f574e20))
* item wise tds calculation for purchase order. ([2bd8bd2](2bd8bd224b))
* item wise tds in purchase order ([ba36435](ba3643514e))
* make Material Request for sub-assembly items ([5fc4dfa](5fc4dfaad6))
* **pos:** invoice: fitler warehouse by company ([c379baf](c379baf7a2))
* validate repost item valuation against accounts freeze date ([04f50ea](04f50ea76a))
2022-11-29 13:19:34 +00:00
Deepesh Garg
9fc8acf707 Merge pull request #33163 from frappe/version-14-hotfix
chore: release v14
2022-11-29 18:48:14 +05:30
Sagar Sharma
f2f06aaa56 Merge pull request #33159 from frappe/mergify/bp/version-14-hotfix/pr-33136
fix: reset `voucher_type` and `voucher_no` if `based_on` is set to `Transaction` (backport #33136)
2022-11-29 13:24:53 +05:30
s-aga-r
5728300f03 chore: make posting_date and posting_time read-only if based_on is set to Transaction
(cherry picked from commit 4e10352b48)
2022-11-29 06:44:35 +00:00
s-aga-r
e530f0b2fb fix: reset voucher_type and voucher_no if based_on is set to Item and Warehouse
(cherry picked from commit eeec008547)
2022-11-29 06:44:35 +00:00
rohitwaghchaure
8ebf34629d Merge pull request #33158 from frappe/mergify/bp/version-14-hotfix/pr-33013
fix: validate repost item valuation against accounts freeze date (backport #33013)
2022-11-29 12:06:29 +05:30
Sagar Sharma
72351e38f2 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33013 2022-11-29 11:16:53 +05:30
Deepesh Garg
6fa81089d6 Merge pull request #33152 from frappe/mergify/bp/version-14-hotfix/pr-33143
fix: Auto repeat date validations (backport #33143)
2022-11-29 11:07:46 +05:30
Deepesh Garg
fb6791abe3 Merge pull request #33153 from frappe/mergify/bp/version-14-hotfix/pr-33115
fix: remove product schema block from additional info section on item template (backport #33115)
2022-11-29 11:07:23 +05:30
Deepesh Garg
bf833c4f09 Merge pull request #33151 from frappe/mergify/bp/version-14-hotfix/pr-33138
fix(ux): Action buttons in Bank Reconciliation (backport #33138)
2022-11-29 11:06:48 +05:30
Deepesh Garg
5848147a92 Merge pull request #33155 from frappe/mergify/bp/version-14-hotfix/pr-33098
fix(pos): warehouse selection (backport #33098)
2022-11-29 11:06:21 +05:30
Deepesh Garg
150319d0cb Merge pull request #33156 from frappe/mergify/bp/version-14-hotfix/pr-33116
fix: only show serial no batch selector only once (backport #33116)
2022-11-29 11:06:08 +05:30
Deepesh Garg
b9ff172e13 Merge pull request #33154 from frappe/mergify/bp/version-14-hotfix/pr-33112
fix(pos): filter on customer groups (backport #33112)
2022-11-29 11:05:54 +05:30
Dany Robert
5854f1791c chore: pre-commit
(cherry picked from commit 88a0aa4077)
2022-11-29 05:11:39 +00:00
Dany Robert
c9c7222ded fix: check for session user rather than owner
(cherry picked from commit b482e3876d)
2022-11-29 05:11:39 +00:00
Dany Robert
68d9161a66 chore: pre-commit
(cherry picked from commit be15419bd5)
2022-11-29 05:11:38 +00:00
Dany Robert
04f50ea76a feat: validate repost item valuation against accounts freeze date
(cherry picked from commit 61f05132db)
2022-11-29 05:11:38 +00:00
rohitwaghchaure
4928058ed8 Merge pull request #33149 from frappe/mergify/bp/version-14-hotfix/pr-33144
fix: incorrect balance qty (backport #33144)
2022-11-29 10:41:36 +05:30
Shariq Ansari
8d0f715087 fix: only show serial no batch selector only once
(cherry picked from commit 0f87d329d6)
2022-11-29 04:51:19 +00:00
Sabu Siyad
c379baf7a2 feat(pos): invoice: fitler warehouse by company
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 4ad0e2ed7e)
2022-11-29 04:46:19 +00:00
Sabu Siyad
c03ec80d1a fix(pos): warehouse should be in company
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 95a620a30d)
2022-11-29 04:46:19 +00:00
Sabu Siyad
c1ae5b0af5 fix(pos): filter on customer groups
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit cc63415887)
2022-11-29 04:26:25 +00:00
ruthra kumar
cdd13cd95f fix: remove duplicate schema
(cherry picked from commit 2c18a95115)
2022-11-29 04:06:25 +00:00
Deepesh Garg
5abcb478d0 chore: Update condition
(cherry picked from commit 6a47fb6c9e)
2022-11-29 03:59:09 +00:00
Deepesh Garg
2aada1a0d9 fix: Auto repeat date validations
(cherry picked from commit fa15221455)
2022-11-29 03:59:09 +00:00
Deepesh Garg
e093c32d06 Merge pull request #33128 from frappe/mergify/bp/version-14-hotfix/pr-33022
feat: Incoterms in buying and selling (backport #33022)
2022-11-29 09:28:59 +05:30
Deepesh Garg
93b8cc3042 fix(ux): Action buttons in Bank Reconciliation
(cherry picked from commit 6ebe8ad60d)
2022-11-29 03:54:02 +00:00
Rohit Waghchaure
93ec57dd44 test: test case for serialized batched item
(cherry picked from commit b606a9684b)
2022-11-29 03:18:53 +00:00
Rohit Waghchaure
f92b5011da fix: incorrect balance qty
(cherry picked from commit b2105a8be7)
2022-11-29 03:18:53 +00:00
Raffael Meyer
7477bb96c8 chore: resolve merge conflict 2022-11-28 18:51:40 +01:00
Deepesh Garg
6c3fbf03f9 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33022 2022-11-28 23:06:23 +05:30
Deepesh Garg
0d8112af76 Merge pull request #33133 from frappe/mergify/bp/version-14-hotfix/pr-33129
chore: Supplier invoice no field description (backport #33129)
2022-11-28 22:48:45 +05:30
Deepesh Garg
088c168f96 Merge pull request #33142 from frappe/mergify/bp/version-14-hotfix/pr-33107
feat: german tax templates (backport #33107)
2022-11-28 22:48:20 +05:30
Sagar Sharma
ae26e550d0 Merge pull request #33140 from frappe/mergify/bp/version-14-hotfix/pr-33139
fix: reposting error `AttributeError: 'datetime.timedelta' object has no attribute 'replace'` (backport #33139)
2022-11-28 22:06:21 +05:30
barredterra
5652af04ba feat: german tax templates
(cherry picked from commit 7fd2639e68)
2022-11-28 16:25:02 +00:00
s-aga-r
4b0c9b6115 fix: reposting error AttributeError: 'datetime.timedelta' object has no attribute 'replace'
(cherry picked from commit eeda264eb6)
2022-11-28 16:01:39 +00:00
s-aga-r
65ac84e020 fix: validation msg in stock entry
(cherry picked from commit ba77da0874)
2022-11-28 16:01:39 +00:00
rohitwaghchaure
648a017eda Merge pull request #33137 from frappe/mergify/bp/version-14-hotfix/pr-33135
feat: make Material Request for sub-assembly items (backport #33135)
2022-11-28 18:32:54 +05:30
Rohit Waghchaure
5fc4dfaad6 feat: make Material Request for sub-assembly items
(cherry picked from commit e02f35c8ff)
2022-11-28 11:24:31 +00:00
Deepesh Garg
6e3ad109d2 chore: Supplier invoice no field description
(cherry picked from commit 4f2ece34df)
2022-11-28 07:36:10 +00:00
mergify[bot]
0ba2a4d084 fix: opportunity list doesn't show assigned user (backport #33110) (#33131)
fix: opportunity list doesn't show assigned user (#33110)

Because `db_update` is performed `_assign` property is not updated and
hence lead -> opportunity conversion makes it disappear from list view.

Steps to reproduce:

1. Create lead
2. Assign anyone
3. Create opportunity from lead.
4. Form view shows assigned user, list view wont.

(cherry picked from commit 63b9795d41)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-28 11:19:32 +05:30
barredterra
21deb02d81 chore: resolve merge conflicts 2022-11-27 16:30:19 +01:00
Raffael Meyer
978924a7e4 fix: remove obsolete comment
(cherry picked from commit 491857b3c8)
2022-11-27 15:24:20 +00:00
barredterra
89b9a06204 feat: add connections to Incoterm doctype
(cherry picked from commit a5966b6f84)
2022-11-27 15:24:19 +00:00
barredterra
f7988dea1b feat: add german translations for incoterm titles
(cherry picked from commit ffd287d5a6)
2022-11-27 15:24:19 +00:00
barredterra
88346b17e9 feat: add incoterm to purchasing transactions
(cherry picked from commit 77105306f2)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-11-27 15:24:18 +00:00
barredterra
fcfe0cb9e9 feat: add incoterm to sales transactions
(cherry picked from commit 029f22c549)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json
2022-11-27 15:24:17 +00:00
barredterra
93e029df91 feat: create Incoterm records after install
(cherry picked from commit ce83f02f24)
2022-11-27 15:24:16 +00:00
barredterra
014896a595 feat: create incoterms and migrate shipments
(cherry picked from commit d2563ee973)

# Conflicts:
#	erpnext/patches.txt
2022-11-27 15:24:16 +00:00
barredterra
b7119318a6 feat: add doctype Incoterm
(cherry picked from commit 1a1bfc8db9)
2022-11-27 15:24:15 +00:00
Deepesh Garg
956b0520d7 Merge pull request #33113 from frappe/mergify/bp/version-14-hotfix/pr-33111
fix: Loan disbursable amount on current security price (backport #33111)
2022-11-27 20:50:09 +05:30
rohitwaghchaure
f365e6b4a2 Merge pull request #33127 from frappe/mergify/bp/version-14-hotfix/pr-33118
fix: production plan UX (backport #33118)
2022-11-27 18:47:39 +05:30
Sagar Sharma
9533a64f6a Merge pull request #33123 from frappe/mergify/bp/version-14-hotfix/pr-33120
fix: `Work Order Summary` and `Job Card Summary` Report (backport #33120)
2022-11-27 10:27:37 +05:30
Rohit Waghchaure
46075901ba fix: production plan UX
(cherry picked from commit 8cb7112e72)
2022-11-27 03:17:28 +00:00
s-aga-r
c9f4f60425 fix: production_item filter in Job Card Summary Report
(cherry picked from commit ef7fd670fc)
2022-11-26 16:24:52 +00:00
s-aga-r
9c6d020e49 fix: company name with , in Job Card Summary Report
(cherry picked from commit 481149814e)
2022-11-26 16:24:52 +00:00
s-aga-r
b1571932d0 fix: Work Order filter typo in Job Card Summary Report
(cherry picked from commit 2e4f3e9317)
2022-11-26 16:24:51 +00:00
s-aga-r
bc649b371f fix: company name with , in Work Order Summary Report
(cherry picked from commit 87b39f045c)
2022-11-26 16:24:50 +00:00
Sagar Sharma
6e5fd55ed4 Merge pull request #33108 from frappe/mergify/bp/version-14-hotfix/pr-33090
fix: MR Item `item_name` and `description` gets reset on `qty` change (backport #33090)
2022-11-26 10:07:50 +05:30
Abhinav Raut
5edaf83733 fix: disbursable amount on currrent security price
(cherry picked from commit fe87c27acd)
2022-11-25 09:48:42 +00:00
s-aga-r
85d108b810 fix: MR Item description and item_name gets reset on qty change
(cherry picked from commit df0fee2312)
2022-11-25 05:49:50 +00:00
Deepesh Garg
ae6ad1e47d Merge pull request #33096 from frappe/mergify/bp/version-14-hotfix/pr-33092
fix: Debit and Credit not equal while submitting PI containing asset item (backport #33092)
2022-11-24 21:22:44 +05:30
Deepesh Garg
98d5cb30d1 Merge pull request #33106 from frappe/mergify/bp/version-14-hotfix/pr-33103
fix: job card "Qty to Manufacture" UX (backport #33103)
2022-11-24 21:22:28 +05:30
Deepesh Garg
8cd2539755 Merge pull request #33104 from frappe/mergify/bp/version-14-hotfix/pr-33100
fix: Dispatch address display (backport #33100)
2022-11-24 21:22:02 +05:30
Rohit Waghchaure
59e2ab702f fix: job card for quantity UX
(cherry picked from commit 87d37e90a2)
2022-11-24 13:54:59 +00:00
Deepesh Garg
ef687e22b8 fix: Dispatch address display
(cherry picked from commit 104fdcb9f9)
2022-11-24 12:31:13 +00:00
Deepesh Garg
517e40e1b8 Merge pull request #33099 from frappe/mergify/bp/version-14-hotfix/pr-33097
fix: precision in asset test_scrap_asset (backport #33097)
2022-11-24 16:58:04 +05:30
anandbaburajan
0fe5e9a9d1 fix: precision in asset test_scrap_asset
(cherry picked from commit 0e726609f1)
2022-11-24 10:44:31 +00:00
Deepesh Garg
c11a31b390 fix: Debit and Credit not equal while submitting PI containing asset item
(cherry picked from commit dc8d635120)
2022-11-24 09:14:06 +00:00
Deepesh Garg
82e41a2721 Merge pull request #33089 from frappe/mergify/bp/version-14-hotfix/pr-33088
fix: Valuation Rate column UX in stock ledger report (backport #33088)
2022-11-23 18:22:15 +05:30
Rohit Waghchaure
5c065e8a64 fix: Valuation Rate column UX in stock ledger report
(cherry picked from commit be19e4f621)
2022-11-23 12:00:49 +00:00
rohitwaghchaure
188b18dc5b Merge pull request #33083 from frappe/mergify/bp/version-14-hotfix/pr-33077
fix: UX for inventory dimension (backport #33077)
2022-11-23 12:33:44 +05:30
Deepesh Garg
5d7c4c182a Merge pull request #33085 from frappe/mergify/bp/version-14-hotfix/pr-33062
fix: create rounding gl entry for PCV during gle post processing (backport #33062)
2022-11-23 11:50:26 +05:30
Deepesh Garg
798717b12b Merge pull request #33082 from frappe/mergify/bp/version-14-hotfix/pr-33063
feat: item wise tds in purchase order (backport #33063)
2022-11-23 11:47:54 +05:30
Deepesh Garg
7a9f384b18 chore: resolve conflicts 2022-11-23 10:58:47 +05:30
Nabin Hait
fd4bcd9f7f fix: create rounding gl entry for PCV during gle post processing
(cherry picked from commit 022d8d5d79)
2022-11-23 05:07:29 +00:00
Rohit Waghchaure
f1dd4d0449 fix: UX for inventory dimension
(cherry picked from commit 0a69523940)
2022-11-23 04:24:36 +00:00
niralisatapara
5f8f574e20 feat: item wise tds calculation for purchase order
(cherry picked from commit 0fdde2e5c0)

# Conflicts:
#	erpnext/patches.txt
2022-11-23 04:22:46 +00:00
niralisatapara
2bd8bd224b feat: item wise tds calculation for purchase order.
(cherry picked from commit 46e8cdf31a)
2022-11-23 04:22:45 +00:00
niralisatapara
ba3643514e feat: item wise tds in purchase order
(cherry picked from commit b9d0b4e2d3)
2022-11-23 04:22:45 +00:00
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
rohitwaghchaure
590e91bb80 Merge pull request #31750 from rohitwaghchaure/minor-fix-change-link
fix: minor URL link
2022-08-01 14:31:09 +05:30
Rohit Waghchaure
0e7c4314b4 fix: minor changed link 2022-08-01 14:03:12 +05:30
Marica
1a2ffc7c6e Merge pull request #31601 from pps190/pref-wh-wise-stock-value
perf: reduce db calls for warehouse wise stock value chart
2022-07-27 17:47:43 +05:30
HENRY Florian
cc1f837685 fix: update fr translations (#31687)
* fix: update fr translations

* fix: update fr translation

* fix: update fr translation

* chore: Replace apostrophe encoding by symbol

Co-authored-by: marination <maricadsouza221197@gmail.com>
2022-07-27 17:21:01 +05:30
Nabin Hait
67fefa37ce Merge pull request #31678 from nabinhait/crm-fixes-5
fix: mentions in notes, workspace links, no-of-employees field type and report fixes
2022-07-27 16:50:18 +05:30
Marica
53b6cea610 Merge pull request #31469 from marination/make-image-field-obsolete-in-web-item
chore: Make `image` field obsolete in Website Item (redundant)
2022-07-27 15:43:01 +05:30
Marica
4fa58d7931 Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-07-27 14:53:03 +05:30
Suraj Shetty
273c6ff598 Merge pull request #31690 from phot0n/fix-payments-stuff 2022-07-27 14:37:15 +05:30
Marica
56db91b322 Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-07-27 14:12:09 +05:30
marination
af38baeb3b fix: Map Item image to Website Item website_image only if published via UI (v13)
- For v12 Items, `website_image` should be mapped from `Item` to `Website Item`
2022-07-27 14:09:49 +05:30
phot0n
0048bcb067 chore: fix linter 2022-07-27 12:34:52 +05:30
phot0n
76493e928f ci: update install script and patch workflow to accomodate payments app 2022-07-27 12:21:48 +05:30
Nabin Hait
02dd174bc7 Merge branch 'develop' into crm-fixes-5 2022-07-27 11:56:36 +05:30
Deepesh Garg
1e3918d637 Merge pull request #31286 from SolufyPrivateLimited/solufy_rec_pay_report
fix: Added total of future amount, Remaining Balance in Payable and Receivable reports
2022-07-27 08:26:16 +05:30
rohitwaghchaure
cdec6f60de Merge pull request #31681 from rohitwaghchaure/dont-show-zero-qty-data-in-report
fix: dont show zero qty available items in stock ageing report
2022-07-27 00:44:11 +05:30
mergify[bot]
5b7b58322f fix: hero image not loading in portal homepage (backport #31699) (#31700)
fix: hero image not loading in portal homepage (#31699)

(cherry picked from commit 8a6432ec3f)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-07-26 13:46:03 +05:30
Sagar Vora
c6fbb7b27d Revert "docs: improve README"
This reverts commit 38e71b0639.
2022-07-26 13:09:46 +05:30
Sagar Vora
38e71b0639 docs: improve README 2022-07-26 13:08:39 +05:30
Deepesh Garg
98b42ce786 Merge pull request #31676 from ruthra-kumar/fix_tax_withholding_checkbox_on_PI
fix: enable tax withholding checkbox in PI with supplier_tds
2022-07-25 12:56:29 +05:30
Marica
d2d651a0c3 Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-07-25 12:43:08 +05:30
gavin
7b90986eb0 Merge pull request #31454 from gavindsouza/mariadb-client-refactor
fix: Misc enhancements
2022-07-25 12:22:42 +05:30
Gavin D'souza
3c26415b6f fix(gd): Scan FY only if current_fiscal_year set 2022-07-25 11:54:49 +05:30
Gavin D'souza
cb73528c9c test: Use assertSequenceEqual for comparision between Tuple / Lists
Use AssertSequence for type agnostic checks
2022-07-25 11:54:49 +05:30
Gavin D'souza
b07dd1083a ci: Check for conflicts & valid python in early separate step 2022-07-25 11:54:49 +05:30
ruthra kumar
9439a7fd30 Merge pull request #31576 from ruthra-kumar/return_not_updating_so_billed_percentage
fix: credite note for returned delivery note updates SO's billed percentage
2022-07-25 11:24:00 +05:30
phot0n
8004550444 fix: add payments as a required app for erpnext 2022-07-25 10:46:46 +05:30
phot0n
ef14da21bc fix: payment utils import paths
Since we're splitting payments app from frappe, updating
ERPnext paths as well
2022-07-25 10:38:09 +05:30
Rohit Waghchaure
5da7e01db2 fix: dont show zero qty available items in stock ageing report 2022-07-22 17:54:46 +05:30
Nabin Hait
29b8715205 fix: mentions in notes, workspace links, no-of-employees field type and report fixes 2022-07-22 15:33:39 +05:30
ruthra kumar
b461724416 fix: enable tax withholding checkbox in PI with supplier_tds 2022-07-22 14:32:14 +05:30
Deepesh Garg
538f5a9964 Merge pull request #31497 from HarryPaulo/develop
fix: translated message for credit limit blocking
2022-07-22 14:22:58 +05:30
Deepesh Garg
80b354f1c7 Merge pull request #31656 from ruthra-kumar/use_current_profile_in_pos_return
fix: use current pos profile on sales return
2022-07-22 13:10:53 +05:30
Rucha Mahabal
7b0e5661c6 fix(patch): ignore links while deleting hr payroll doctypes (#31674) 2022-07-22 12:46:59 +05:30
Marica
6883fc95ae Merge pull request #31579 from pps190/fix-pl-customer-name
fix: display customer name on picking list
2022-07-21 18:38:08 +05:30
billy995
8629d01dd5 Update de.csv (#31596)
IN,IM to IN,EIN

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-07-21 14:49:11 +05:30
HENRY Florian
3ba0d6cc5c fix: update fr translations (#31526)
* fix: update fr translations

* fix: update fr translations

* fix: update fr translations

* fix: update fr translations

* chore: Update french translation

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-07-21 14:48:42 +05:30
mergify[bot]
89f516c32b fix: assign duplicate_items_msg outside conditional (backport #31639) (#31650)
fix: assign duplicate_items_msg outside conditional (#31639)

duplicate_items_msg was defined inside if the statement  of stock_item so when duplicate was found in non_stock_item it raised referenced before assignment

(cherry picked from commit 8e23c6ad69)

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
2022-07-21 13:57:03 +05:30
Marc de Lima Lucio
048c037842 FIX: quality inspection quick creation from purchase receipt: pre-fill sample size if available (#31544)
FIX: quality inspection quick creation from transaction documents: pre-fill sample size if available

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-07-21 13:46:59 +05:30
Sagar Vora
bf2833b8ee fix: ensure defaults removed in bad frappe patch get set again (#31659) 2022-07-21 13:32:03 +05:30
ruthra kumar
243f66fcd3 test: SO percentage billed when cr_note made against delivery return 2022-07-21 13:05:34 +05:30
ruthra kumar
04c1019242 fix: update SO's percentage billed on credit note
Credit Note created from Sales Return will update precentage billed in
Sales Order accordingly
2022-07-21 13:05:34 +05:30
Marco Fonseca
d30f8387d9 fix: correct Brazilian portuguese translations (#31498)
* fix brazilian portuguese translations

* minor adjustments

* fix minor adjustments

* fix: remove legacy pt_br.csv

* chore: Fix translation quotation marks

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-07-21 12:59:04 +05:30
ruthra kumar
739d328412 Merge pull request #31537 from ruthra-kumar/add_index_to_payment_ledger
refactor: create index for payment ledger
2022-07-21 12:50:39 +05:30
Saqib Ansari
d578afab55 fix: rounding errors while closing pos (#31654) 2022-07-21 12:18:28 +05:30
Saqib Ansari
2eaa8b17bd fix(pos): validate product bundles while submitting pos invoice (#31615) 2022-07-21 12:17:58 +05:30
ruthra kumar
5b85af5f1a fix: use current pos profile on sales return 2022-07-21 12:16:16 +05:30
rohitwaghchaure
5a3999e236 Merge pull request #31424 from rohitwaghchaure/feat-inventory-dimension
feat: Inventory Dimension
2022-07-20 19:47:14 +05:30
Deepesh Garg
6d61525ae4 Merge pull request #31648 from deepeshgarg007/dimension-patch-fix
fix: Patch to make accounting dimension in orders
2022-07-20 19:02:00 +05:30
Deepesh Garg
cad2035e07 chore: do not re run patch 2022-07-20 19:01:14 +05:30
Deepesh Garg
d46e406db7 fix: Patch to make accounting dimension in orders 2022-07-20 18:59:36 +05:30
Rucha Mahabal
8b67d627d8 fix(patch): Remove missed records for HR & Payroll separation (#31646)
* fix(patch): delete HR Payroll custom fields from core

* fix: delete HR Payroll dashboard chart, number card, web forms
2022-07-20 18:56:37 +05:30
Rucha Mahabal
2b0b53f587 Merge pull request #31467 from ruchamahabal/hr-separation 2022-07-20 16:54:44 +05:30
Rohit Waghchaure
289e6cd4ce fix: change frappe.db.sql to frappe.qb 2022-07-20 16:02:13 +05:30
Rohit Waghchaure
e576f7f07e test: test cases for inventory dimension 2022-07-20 16:02:13 +05:30
Rohit Waghchaure
dbec5cff00 feat: Inventory Dimension 2022-07-20 16:02:13 +05:30
Rucha Mahabal
f222284c33 Merge branch 'develop' into hr-separation 2022-07-20 15:47:40 +05:30
Nabin Hait
409c2e98a9 Merge pull request #31628 from nabinhait/pcv-perf-enhancements-dev
perf: Optimization of gl entry processing logic in period closing voucher
2022-07-20 15:38:34 +05:30
Nabin Hait
4951a1f0e9 Merge pull request #31637 from nabinhait/asset-monthly-depreciation
fix: Removed 'Allow Monthly Depreciation' checkbox
2022-07-20 15:38:17 +05:30
Nabin Hait
e1fa723eef fix: set args to empty list if None to avoid enumerate error 2022-07-20 15:19:09 +05:30
Nabin Hait
b26438ccf7 test: Fixed test for WDV method depreciation schedule 2022-07-20 14:27:06 +05:30
Nabin Hait
6c29146c91 fix: Removed 'Allow Monthly Depreciation' checkbox 2022-07-20 14:27:06 +05:30
Rucha Mahabal
f2532a6aaa Merge branch 'develop' into hr-separation 2022-07-20 14:22:27 +05:30
Nabin Hait
516be870df fix: Renamed status field to gle_processing_status 2022-07-20 11:07:02 +05:30
Devin Slauenwhite
7083b3148b fix: make customer_name field read only. 2022-07-19 11:02:43 -04:00
Devin Slauenwhite
d3f0897420 Merge branch 'develop' into fix-pl-customer-name 2022-07-19 11:01:28 -04:00
rohitwaghchaure
60dbd6a246 Merge pull request #31631 from rohitwaghchaure/slow-stock-reposting-issue
fix: slow stock reposting
2022-07-19 18:47:23 +05:30
Rucha Mahabal
b30f66c029 chore: use get_single_value in place of get_value 2022-07-19 17:51:03 +05:30
Vladislav
756a7bcc5c fix: update ru translate (#31594)
* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* chore: Missing comma

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-07-19 17:35:08 +05:30
Rohit Waghchaure
1d80d37ccf fix: slow stock reposting 2022-07-19 16:36:22 +05:30
Nabin Hait
69b906438d fix: set status on submit/cancel 2022-07-19 15:05:56 +05:30
Ankush Menat
7788bc287c ci: stripped down semantic commit check 2022-07-19 14:59:42 +05:30
Nabin Hait
914a388ee3 test: Added test for PCV cancellation 2022-07-19 14:34:01 +05:30
Nabin Hait
4caaab32d1 perf: Optimization of gl entry processing logic in period closing voucher 2022-07-19 14:33:49 +05:30
Marica
a8179220be Merge pull request #31515 from marination/lcv-future-stock-update
fix: LCV updates wrong future qty/Bin qty
2022-07-19 13:39:39 +05:30
Rucha Mahabal
8ce526115d patch: Add HR & Payroll deprecation warning 2022-07-19 13:19:34 +05:30
Rucha Mahabal
eae39964e8 chore: Remove unused files 2022-07-19 13:04:07 +05:30
Marica
2a2db8c64a Merge branch 'develop' into lcv-future-stock-update 2022-07-19 12:53:51 +05:30
Ankush Menat
885e731872 ci: lint commit messages (#31625) 2022-07-19 12:00:53 +05:30
Deepesh Garg
a6ff4db2ec fix: Supplier details in TDS monthly report (#31599) 2022-07-19 10:14:44 +05:30
Rucha Mahabal
bc2c2aedad fix(minor): Remove extra space from translated string (#31617) 2022-07-18 13:48:14 +05:30
Wolfram Schmidt
340bf905ec fix: added Section translation in German for Salary Slip (#31608) 2022-07-18 13:33:51 +05:30
Ankush Menat
755a060ba7 refactor: dont force issue list options (#31613)
Setting route option forces the filters, only default filters should be
set and not forced for each visit.
2022-07-18 11:12:07 +05:30
Rucha Mahabal
2ae48fbdd4 Merge branch 'develop' into hr-separation 2022-07-18 10:58:22 +05:30
Deepesh Garg
b62028722e Merge pull request #31549 from resilient-tech/ic-lingering-code
chore: remove missed code for India localisation
2022-07-15 15:20:06 +05:30
Ankush Menat
67a74a4d14 fix: dont check first row on report load
- This doesn't actually load the chart but leaves UI and data in
  inconsistent state
- On refresh it randomly keeps toggling the first row - confusing
  behaviour.
2022-07-15 14:09:58 +05:30
Ankush Menat
ceeea6180e fix: dont override default report options in charts
Sales analytics and purchase analytics reports are clearing the default
options which includes number shortening, axis options etc. This makes
report unreadable when dealing with large numbers.
2022-07-15 14:09:58 +05:30
Devin Slauenwhite
1e20358c28 fix: sum stock_value and group by warehouse 2022-07-14 18:53:50 -04:00
Devin Slauenwhite
bc3023318e chore: remove unused import 2022-07-14 18:09:52 -04:00
Devin Slauenwhite
73ade04dcf pref: reduce count of db calls from n to 2 2022-07-14 18:09:08 -04:00
Sagar Vora
70c4117c22 fix: unlink custom fields in patch 2022-07-14 15:02:37 +05:30
Sagar Vora
be4a44fccd Merge remote-tracking branch 'upstream/develop' into ic-lingering-code 2022-07-14 14:36:14 +05:30
Rucha Mahabal
f765428757 chore: Remove HRMS templates 2022-07-14 11:59:06 +05:30
Rucha Mahabal
db586afc7b chore: Remove Salary Component Accounts doctype from Accounts module 2022-07-13 13:38:58 +05:30
Devin Slauenwhite
0a633a212d fix: display customer name on picking list 2022-07-12 13:05:40 -04:00
Rucha Mahabal
d8aa1c59f1 Merge branch 'develop' into hr-separation 2022-07-12 19:27:19 +05:30
Deepesh Garg
d7446fd3ae Merge pull request #31543 from lebmatter/loan_balance_adjustments
feat: Loan balance adjustment doctypes
2022-07-12 18:25:45 +05:30
marination
de9ea70ce3 test: LCV impact on future stock balancees 2022-07-12 13:00:00 +05:30
Ankush Menat
2224b6503b chore: typo
[skip ci]
2022-07-12 12:39:22 +05:30
Deepesh Garg
0bac030ca7 chore: Linting Issues 2022-07-11 22:04:52 +05:30
Deepesh Garg
d933ff5cf6 chore: Linting Issues 2022-07-11 21:50:01 +05:30
Deepesh Garg
9b40f70ac2 Merge branch 'develop' into add_index_to_payment_ledger 2022-07-11 21:18:10 +05:30
Deepesh Garg
0b822dade0 Merge pull request #31566 from deepeshgarg007/ignore_account_currency
fix: Allow multi currency invoice against single party account
2022-07-11 21:14:02 +05:30
Deepesh Garg
e04e67c6bf chore: fix query 2022-07-11 19:25:18 +05:30
Rucha Mahabal
5a51951224 test: Basic Payment Entry for Employee 2022-07-11 14:36:33 +05:30
Deepesh Garg
3cf609fab1 chore: Ignore validation 2022-07-11 13:46:59 +05:30
Deepesh Garg
c83fbd5c50 fix: Allow multi currency invoice against single party account 2022-07-11 13:43:01 +05:30
Rucha Mahabal
cd9a01be5f test: Loan entries in Bank Reco Statement report 2022-07-11 11:57:25 +05:30
Ankush Menat
3031592368 chore: form tour location
closes https://github.com/frappe/frappe/issues/17247

[skip ci]
2022-07-11 11:50:57 +05:30
Marica
681b334236 Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-07-11 11:22:51 +05:30
Marica
18a8e3fd60 Merge pull request #31550 from marination/rfq-email-addressing
fix: Use Contact Name instead of Supplier in RFQ Email
2022-07-11 11:21:17 +05:30
ruthra kumar
74d9fc2155 refactor: create index for payment ledger 2022-07-11 11:17:27 +05:30
Rucha Mahabal
f6fb00b59d test: Matching Loan Repayment query in Bank Reco 2022-07-08 19:28:38 +05:30
Ankush Menat
4ec85cb2f0 test: don't silently fail reposts in tests (#31559) 2022-07-08 19:28:03 +05:30
Abhinav Raut
13b7ed1e2c fix: on cancel for loan refund 2022-07-08 17:58:36 +05:30
Labeeb Mattra
35f2717ad2 Consider refund_amount in pending principal amount 2022-07-08 17:53:29 +05:30
Labeeb Mattra
9df1413adb fix excess amount calculation in loan refund 2022-07-08 17:52:36 +05:30
Labeeb Mattra
245b0c7818 Update adjustment_type field options 2022-07-08 16:49:19 +05:30
Labeeb Mattra
6cc09ef3a2 fix adjustment amount field name 2022-07-08 16:38:41 +05:30
Marica
dc3d492c83 Merge branch 'develop' into rfq-email-addressing 2022-07-08 15:39:20 +05:30
marination
300e812a1f chore: Instantiate variable unconditionally 2022-07-08 15:38:44 +05:30
Nabin Hait
8b69a3ec7a Merge pull request #30955 from s-aga-r/subcontracting
feat: subcontracting module
2022-07-08 15:21:46 +05:30
Nabin Hait
a768b4cec3 Merge branch 'develop' into subcontracting 2022-07-08 15:21:03 +05:30
rohitwaghchaure
0c2e0693eb Merge pull request #31553 from s-aga-r/fix/job-card/report/status
fix: status filter in Job Card Summary
2022-07-08 11:56:18 +05:30
Sagar Sharma
57b6dab1da fix: status filter in Job Card Summary 2022-07-07 23:19:17 +05:30
Deepesh Garg
832a863d1e Merge pull request #31451 from Altizo/develop
fix: update ru translate
2022-07-07 21:15:22 +05:30
Deepesh Garg
5eb2e71f0f Merge branch 'develop' into develop 2022-07-07 21:15:03 +05:30
Rucha Mahabal
108cce2785 refactor: rewrite raw sql queries with frappe.qb and database API 2022-07-07 19:00:19 +05:30
Labeeb Mattra
0ed6382ab6 fix indent and imports 2022-07-07 17:40:50 +05:30
Rucha Mahabal
64075cbebc Merge branch 'develop' into hr-separation 2022-07-07 17:36:01 +05:30
Labeeb Mattra
8434ec09c3 fix lint 2022-07-07 17:20:21 +05:30
marination
88ac519b24 fix: Use Contact Name instead of Supplier in RFQ Email 2022-07-07 16:59:23 +05:30
Sagar Vora
93f87cb6e2 chore: remove missed code for India localisation 2022-07-07 16:41:41 +05:30
Ankush Menat
bc3f99321a refactor: department creation (#31548)
- all department creation always fails after first company, this is
handled in exception handling code but better to not attempt this in
first place.
- move department creation to company.py this has nothing to do with
  setup and previous function signature made no sense.
2022-07-07 16:05:18 +05:30
marination
7a6ee8cf2d chore: Remove image use in website item list 2022-07-07 14:25:02 +05:30
Rucha Mahabal
2248276fe9 chore: Remove gratuity rule patch 2022-07-07 13:48:59 +05:30
Rucha Mahabal
ef02e58859 Merge branch 'develop' into hr-separation 2022-07-07 13:46:54 +05:30
Deepesh Garg
0b5101d9c7 Merge pull request #31546 from deepeshgarg007/regional_quotation
fix: Unable to open quotation
2022-07-07 11:53:34 +05:30
Deepesh Garg
f73408bfd6 fix: Unable to open quotation 2022-07-07 10:47:48 +05:30
Sagar Sharma
f9885746a8 Merge branch 'develop' into subcontracting 2022-07-07 09:56:23 +05:30
Suraj Shetty
891fd70882 Merge pull request #31541 from surajshetty3416/update-library-usage 2022-07-07 09:41:05 +05:30
Suraj Shetty
c9dc902dee Merge branch 'develop' into update-library-usage 2022-07-07 09:40:21 +05:30
Labeeb Mattra
1b5b2138ee Use adjustment amounts in pending principal amnt 2022-07-06 18:52:04 +05:30
Labeeb Mattra
a1a51ce1a6 Add ref no to balance adjustment remarks 2022-07-06 18:52:04 +05:30
Labeeb Mattra
74dbf8c5d9 Add reference number to repayment remarks 2022-07-06 18:52:04 +05:30
Labeeb Mattra
27a8e16b28 Add NPA checkbox in Loan 2022-07-06 18:52:04 +05:30
Labeeb Mattra
7d6e4898c4 Update list view for Accrual and Shortfall 2022-07-06 18:52:04 +05:30
Labeeb Mattra
6febcd529b Remove loan account field from doctype 2022-07-06 18:52:04 +05:30
Labeeb Mattra
7d468a8778 Use new adjustment amount fields 2022-07-06 18:52:04 +05:30
Labeeb Mattra
d6f632a770 Seperate credit and debit adjust amount fields in Loan 2022-07-06 18:52:04 +05:30
Abhinav Raut
5c0a25012c feat: add adjustment amount to loan
- fix: bugs in loan balance adjustment
2022-07-06 18:52:04 +05:30
Labeeb Mattra
2e8f056514 Add Loan Balance Adjustment doctype 2022-07-06 18:52:04 +05:30
Labeeb Mattra
e1682965c5 Add Loan Refund doctype 2022-07-06 18:52:04 +05:30
Labeeb Mattra
88cd780ca1 Add refund amount to loan 2022-07-06 18:52:04 +05:30
Labeeb Mattra
a81da2ea85 Add more loan interest accrual types 2022-07-06 18:52:04 +05:30
Labeeb Mattra
900c878e03 update loan interest accrual types 2022-07-06 18:52:04 +05:30
Aditya Hase
7053bb9bb8 fix: Maintain backward compatibility with older bench versions (#31542)
Older versions of bench depend on `name` in setup.py

Setting it to `frappe` causes some weird behavior like moving `apps/erpnext` to `apps/frappe`
2022-07-06 17:32:21 +05:30
Suraj Shetty
f0e8a518cd fix: Update font awesome path 2022-07-06 15:10:39 +05:30
Suraj Shetty
32fd753a14 fix: Update html2text import path 2022-07-06 15:09:44 +05:30
Marica
b58d7d1c89 Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-07-06 14:43:23 +05:30
rohitwaghchaure
8eb676eb5a Merge pull request #31519 from rohitwaghchaure/fixed-time-out-error-reposting
fix: timeout error while reposting
2022-07-06 11:45:02 +05:30
Marica
9b6bb1b3fc Merge pull request #31529 from marination/petty-purchase
fix: Use fallback conversion factor while setting incoming rate for petty purchase
2022-07-06 00:38:37 +05:30
Deepesh Garg
b785d7b904 Merge pull request #31531 from nihantra/pur_inv_docstatus
fix: Set the condition to create a purchase receipt
2022-07-05 22:47:17 +05:30
Nihantra C. Patel
3e670eda68 fix: Set the condition to create a purchase receipt 2022-07-05 21:19:50 +05:30
marination
eec07833f4 chore: Remove image from ProductQuery fields 2022-07-05 20:31:04 +05:30
marination
aa043fe961 fix: Use fallback conversion factor while setting incoming rate for petty purchase
- PIs for petty items (that do not need an Item record) are allowed using Item Name field
- If a different UOM is used in this case, conversion factor stays 0 and causes an error
- Fallback to 1 in `set_incoming_rate` for buying
- Selling will need a proper item, so this change is not needed there
2022-07-05 19:43:02 +05:30
rohitwaghchaure
96f46b220b Merge branch 'develop' into fixed-time-out-error-reposting 2022-07-05 19:23:46 +05:30
Deepesh Garg
37f7801cfb Merge pull request #29884 from resilient-tech/remove-india
refactor: remove India specific code
2022-07-05 18:50:41 +05:30
Rohit Waghchaure
78c8bb251e fix: timeout error while reposting 2022-07-05 18:45:13 +05:30
rohitwaghchaure
8835d16b60 Merge pull request #31514 from ruthra-kumar/fix_test_for_pr_tool
fix: test pr output for amount and currency
2022-07-05 18:35:01 +05:30
rohitwaghchaure
c2432778ef Merge branch 'develop' into fix_test_for_pr_tool 2022-07-05 17:18:50 +05:30
rohitwaghchaure
d5b0b5e798 Merge pull request #31523 from rohitwaghchaure/fixed-test-case-backflushed_batch-raw-materials
fix: test case
2022-07-05 15:10:59 +05:30
Rohit Waghchaure
7282c8e65b fix: test case 2022-07-05 15:10:28 +05:30
Sagar Sharma
f75d35ed60 Merge branch 'develop' into subcontracting 2022-07-05 11:25:08 +05:30
Ankush Menat
90942d2ba5 chore: remove currency info from boot (#31520)
refactor: remove currency info from boot

Framework loads this info by default now, so no need to add it here.
2022-07-05 11:22:32 +05:30
Sagar Sharma
a7161d3875 fix: SCO status on SCR cancel 2022-07-05 09:27:56 +05:30
Sagar Sharma
6f7e67db9d chore: hide "Duplicate" button in PO 2022-07-05 08:44:35 +05:30
Sagar Sharma
687329f571 chore: update fg_item_qty based on qty in PO Item 2022-07-05 08:31:31 +05:30
Deepesh Garg
d5da8c7403 Merge pull request #31516 from deepeshgarg007/previsional_accounting_report
fix: Incorrect provisional expense booking while reposting
2022-07-04 20:28:10 +05:30
Deepesh Garg
60aad31162 fix: Incorrect provisional expense booking while reposting 2022-07-04 18:38:26 +05:30
ruthra kumar
104c45ecc4 fix: test pr output for amount and currency 2022-07-04 18:04:29 +05:30
marination
7a5fd71a6c fix: LCV updates wrong future qty/Bin qty
- As -ve LCV SLE case is returned from `repost_current_voucher`, future qty is not updated
- This just doubly shifts all future qty which is then fixed by a repost
- Until the repost balance values are wrong
- Bin continues to show wrong projected qty even after repost, this is fixed by next SLE that recalculates Bin
2022-07-04 17:46:54 +05:30
hrzzz
8cd3eb5286 fix: translation / linters 2022-07-04 08:02:02 -03:00
Rucha Mahabal
694d35e1c4 fix: Add Designation fixtures 2022-07-04 16:17:26 +05:30
Rucha Mahabal
2da427c023 patch: do not run deletion patch if HRMS is already installed 2022-07-04 14:54:23 +05:30
Ankush Menat
42761a315a chore: ignore late binding warnings
Most are false positives

[skip ci]
2022-07-04 13:19:18 +05:30
Marica
75fc4ee938 Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-07-04 13:14:12 +05:30
Deepesh Garg
ac9d38aa1c Merge pull request #31499 from ruthra-kumar/bug_use_account_currency_on_reconciliation_tool
fix: Use account currency on Payment Reconciliation tool
2022-07-03 19:20:29 +05:30
Sagar Vora
05351bee8b Merge remote-tracking branch 'upstream/develop' into remove-india 2022-07-03 18:07:44 +05:30
Deepesh Garg
4038c42922 Merge pull request #31405 from deepeshgarg007/e_invoice_discounts
feat: Cash and Non trade discounts in Sales Invoice
2022-07-03 13:34:38 +05:30
Deepesh Garg
b168d2fc25 Merge branch 'develop' of https://github.com/frappe/erpnext into e_invoice_discounts 2022-07-03 11:02:32 +05:30
Deepesh Garg
e54ec4b9b6 chore: use get instead of . operator 2022-07-03 11:02:21 +05:30
Deepesh Garg
6bb203d1f5 Merge pull request #31410 from alyf-de/apply-price-list
fix: apply price list rate
2022-07-02 22:47:55 +05:30
Deepesh Garg
a4edcfe33b Merge pull request #31493 from deepeshgarg007/internal_invoicing_references
fix: Internal PI link in Sales Invoice
2022-07-02 22:47:10 +05:30
Deepesh Garg
38352b3e46 test: Add test for einvoice discounts 2022-07-02 22:27:20 +05:30
Deepesh Garg
b4f6429e32 Merge branch 'develop' of https://github.com/frappe/erpnext into e_invoice_discounts 2022-07-02 18:42:31 +05:30
Sagar Sharma
caeaa3f940 fix: multiple SCO against a PO 2022-07-02 06:20:09 +05:30
Ankush Menat
7e40c86c56 fix(UX): dont apply price list when changing batch on mapped docs (#31503)
fix(UX): dont apply price list batch change on mapped docs
2022-07-01 20:08:16 +05:30
Rucha Mahabal
466bf99835 fix: Remove Expense Claim from Bank Reconciliation
- add hooks `get_matching_queries` and `bank_reconciliation_doctypes` to extend the functionality in other apps
2022-07-01 19:01:17 +05:30
Sagar Sharma
fd162f9b14 fix: supplier warehouse in PR 2022-07-01 16:51:19 +05:30
ruthra kumar
c9d67defd8 test: PR output should have account currency 2022-07-01 13:02:14 +05:30
ruthra kumar
219855311d fix: wrong amount fetched in payment reconciliation tool
- fetch amount on account currency for outstanding invoices and
- unreconcilied dr/cr notes
- fix currency field name in payment ledger entry creation
2022-07-01 12:47:07 +05:30
Rucha Mahabal
ef7299470b Merge branch 'develop' into hr-separation 2022-07-01 11:30:25 +05:30
Rucha Mahabal
a1a6810b58 fix: Remove HR & Payroll from Authorization Control and Rules 2022-07-01 11:28:34 +05:30
mergify[bot]
7b093e5803 fix(Salary Slip): Components not updated when amount evaluates to 0 due to payment days (backport #31425) (#31432)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-07-01 10:35:59 +05:30
Rucha Mahabal
7442a886a6 test: fix Employee and Activation test 2022-07-01 10:34:32 +05:30
hrzzz
fbb71a2611 fix: translated message for credit limit blocking 2022-06-30 16:14:51 -03:00
Rucha Mahabal
3051f6e7f2 fix: Update triggers on Payment Reconciliation 2022-06-30 21:37:55 +05:30
Deepesh Garg
536e768ba9 fix: Internal PI link in Sales Invoice 2022-06-30 21:29:54 +05:30
Rucha Mahabal
9f7511d6bf fix: Remove HR & Payroll Settings from Company master
- moved setup to HRMS app
2022-06-30 18:12:12 +05:30
Ankush Menat
7a02dfe09a Merge pull request #31491 from ankush/update_310
build!: bump min python required to 3.10
2022-06-30 17:41:43 +05:30
Sagar Sharma
b86710bb9a fix(ui): hide "Update Items" button based on subcontracting conditions 2022-06-30 17:28:42 +05:30
Ankush Menat
b9f394a794 ci: patch test w/ diff python versions
Co-Authored-By: Gavin D'souza <gavin18d@gmail.com>
2022-06-30 17:10:08 +05:30
Sagar Sharma
8e4458e0e6 fix: failing test
Removed this test case as the new POs will not have the Supplied Items table.
2022-06-30 16:47:43 +05:30
Deepesh Garg
7ea29d870e Merge pull request #31487 from dj12djdjs/fix-company-default-root-type
fix: gain/loss can be income or expense
2022-06-30 16:45:08 +05:30
Ankush Menat
57d08b7cdf build!: bump min python required to 3.10 2022-06-30 15:49:43 +05:30
Ankush Menat
a51513194e Merge pull request #31475 from ankush/meta_update
build!: declarative builds
2022-06-30 12:02:04 +05:30
Sagar Sharma
e4b1d6f0cb Merge branch 'develop' into subcontracting 2022-06-30 11:55:17 +05:30
Ankush Menat
cd0450b102 refactor: move dev-dependencies to pyproject 2022-06-30 11:43:00 +05:30
Ankush Menat
0e3872aceb chore(meta): update CODEOWNERS
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2022-06-30 11:43:00 +05:30
Ankush Menat
20f85195f4 build!: declarative builds 2022-06-30 11:42:59 +05:30
Ankush Menat
56c6a709cd ci: bump container count for unittests (#31490)
[skip ci]
2022-06-30 11:35:45 +05:30
Devin Slauenwhite
8a13ddc2f2 fix: gain/loss can be income or expense 2022-06-29 12:28:24 -04:00
Marica
3c1002f9be Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-06-29 18:43:00 +05:30
Rucha Mahabal
1497e26f82 fix: patches 2022-06-29 18:38:39 +05:30
Rucha Mahabal
211b46b7e6 fix: Loan Application test 2022-06-29 18:00:48 +05:30
Sagar Sharma
6589c5f5e9 Merge branch 'develop' into subcontracting 2022-06-29 17:29:24 +05:30
gn306029
2a619fd789 fix: Modify opts parameter misspell (#31476)
Modify opts parameter misspell 

closes #31474
2022-06-29 14:45:21 +05:30
Rucha Mahabal
f0e2bdf1dc fix(Projects): Remove total_expense_claim calculation from gross margin 2022-06-29 13:07:06 +05:30
Rucha Mahabal
ef63c61ebd Merge branch 'develop' into hr-separation 2022-06-29 12:35:51 +05:30
Marica
942aadf436 Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-06-29 12:23:41 +05:30
Devin Slauenwhite
cdf631b9de fix: validate item dashboard material transfer entry (#31473) 2022-06-29 12:06:47 +05:30
Marica
1a749e2589 Merge branch 'develop' into make-image-field-obsolete-in-web-item 2022-06-29 10:25:30 +05:30
Deepesh Garg
3bbbf02ca8 Merge pull request #31460 from ruthra-kumar/bug_ar/ap_rpt_delivery_note
fix: 'attribute error' on AR/AP report with delivery note filter
2022-06-29 08:06:34 +05:30
Sagar Sharma
78ff1783b1 Merge branch 'develop' into subcontracting 2022-06-28 22:20:32 +05:30
Rucha Mahabal
a24cc982e2 fix: Remove HR validations from Employee master 2022-06-28 18:47:14 +05:30
Rucha Mahabal
26a8de69c9 fix: Remove Designation Skill child table
- moved to HRMS app, since it isn't used anywhere in ERPNext
2022-06-28 17:18:02 +05:30
Ankush Menat
080fcb91f2 ci: pin semgrep to old version
current version has problem with PRs originating from fork
2022-06-28 13:46:12 +05:30
Rucha Mahabal
6bee20c5e3 chore: Add Fleet Management masters in Setup module for Delivery Trip
- Driver, Vehicle, Driving License Category (child table)

- Removed Email Account setup for Job Applicant from setup wizard
2022-06-28 13:29:35 +05:30
Rucha Mahabal
3c059de122 chore: Remove links for Employee Hours Utilization Based On Timesheet and Project Profitability from Projects workspace 2022-06-28 12:34:01 +05:30
Rucha Mahabal
6f407d3c62 chore: fix code formatting 2022-06-28 12:29:22 +05:30
Ankush Menat
5d73697c64 fix: offset some scheduled jobs to avoid locks (#31466)
If your site has multiple background workers then there's possibility
that two jobs will execute in parallal, this creates problem when both
are on operating on same data.

This PR adds a separate section for hourly and daily jobs which have
frequency offset from default frequency to avoid such conflicts.
2022-06-28 12:22:17 +05:30
Rucha Mahabal
6a65c8aff4 Merge branch 'develop' into hr-separation 2022-06-28 11:51:59 +05:30
Ankush Menat
bedb11ee67 fix: youtube stats background sync failures 2022-06-28 10:50:44 +05:30
Nabin Hait
925b9d985e fix: open lead and opportunities based on today's event 2022-06-27 22:13:09 +05:30
Nabin Hait
7921a1a605 fix: Restored city, state and country fields 2022-06-27 22:13:09 +05:30
Rucha Mahabal
930e557fc6 fix: remove HR/Payroll patches 2022-06-27 20:25:16 +05:30
Rucha Mahabal
c8712b02f9 patch: Delete HR/Payroll doctypes 2022-06-27 19:59:04 +05:30
Rucha Mahabal
2b255bdddb fix: Bank Statement loan amount query 2022-06-27 19:18:13 +05:30
ruthra kumar
3cd34ebab6 fix: 'attribute error' on AR/AP report with delivery note filter 2022-06-27 17:29:25 +05:30
Rucha Mahabal
ba8ea0f4fb chore: Remove HR templates and references from other workspaces
- Removed template `employees_to_mark_attendance.html`

- Removed HR references from ERPNext Settings and Home workspaces
2022-06-27 16:56:24 +05:30
Ankush Menat
dd11f26eba fix: dont update RM items table if not required (#31408)
Currently on PO update RM item table is auto computed again and again,
if there was any transfer/consumption against that then it will be lost.

This change:
1. Disables updating RM table if no change in qty of FG was made. Since
   RM table can't possibly be different with same FG qty.
2. Blocks update completely if qty is changed and RM items are already
   transferred.
2022-06-27 15:55:08 +05:30
Ankush Menat
20dac08f5f refactor: clean up product bundle client side code (#31455)
refactor: clean up product bundle cient side code

- Remove deprecated CUR_FRM scripts
- Remove client side fetches and move it to doctype schema
2022-06-27 15:54:54 +05:30
Rucha Mahabal
1d5c8660bb chore: Remove regional HR reports, custom field setups
- Removed reports Provident Fund Deductions, Professional Tax Deductions, helper js file `salary_slip_deductions_report_filters.js`

- Removed Gratuity rules setup for India and UAE

- Removed custom field setup for India

- Moved all setups to the HRMS app
2022-06-27 15:12:05 +05:30
marination
9541354ec7 chore: Make image field obsolete in Website Item (redundant)
- Delete Image field and set `website_image` as form's image field for uploads
- Remove instances of `image` field access via Website Item
- Item -> Web Item via Desk: Map Item's `image` to Web Item's `website_image`
- Item -> Web Item via patch: `website_image` will be mapped with thumbnail
- Remove magic that auto-sets `website_image` from `image` in Website Item
2022-06-27 13:00:00 +05:30
Deepesh Garg
173588e169 Merge pull request #31446 from deepeshgarg007/quotation_order_item_syn
fix: Quotation and Sales Order item sync
2022-06-27 11:17:48 +05:30
Sagar Vora
0aafc75c90 fix: add missing print format 2022-06-26 18:36:00 +05:30
Sagar Vora
85c4c342d8 fix: improve patches 2022-06-26 18:30:54 +05:30
Sagar Vora
7f390fb755 Merge branch 'develop' into remove-india 2022-06-26 18:10:44 +05:30
Smit Vora
64de0d06ad patch: remove custom field creation patch 2022-06-26 11:56:06 +05:30
Vladislav
7c682c55fa Update ru.csv 2022-06-26 01:36:11 +03:00
Vladislav
99504ebe52 Update ru.csv 2022-06-26 00:15:30 +03:00
Deepesh Garg
904e69e541 Merge branch 'develop' into quotation_order_item_syn 2022-06-25 19:46:20 +05:30
Deepesh Garg
9c1eb770ba Merge pull request #31442 from ruthra-kumar/incorrect_outstanding_on_multiple_cost_centers
fix: incorrect outstanding for invoice
2022-06-25 19:42:14 +05:30
Nabin Hait
f72d5506de fix: get_all replace by sql 2022-06-25 15:08:45 +05:30
Nabin Hait
2d226be3c4 fix: Made no of employees a select field 2022-06-25 11:40:23 +05:30
Nabin Hait
483fc420a1 test: invoice from timesheet 2022-06-25 11:40:23 +05:30
Nabin Hait
6a0d0a338d fix: Test cases removed related to copying comments from opportunity to quotation 2022-06-25 11:40:23 +05:30
Nabin Hait
82bf59e2a3 fix: test case 2022-06-25 11:40:23 +05:30
Nabin Hait
d8163f3e47 fix: set exchange rate 2022-06-25 11:40:23 +05:30
Nabin Hait
f904ac599e fix: merge conflicts and sider issues 2022-06-25 11:40:23 +05:30
Vladislav
49aa7634a3 Update ru.csv 2022-06-25 01:32:24 +03:00
Smit Vora
8fb0997cf1 patch: remove related docs and warn 2022-06-24 21:59:28 +05:30
Deepesh Garg
6acd0325be fix: General Ledger and TB opening entries mismatch issues 2022-06-24 21:45:05 +05:30
Deepesh Garg
58fe220479 fix: Quotation and Sales Order item sync 2022-06-24 19:43:50 +05:30
ruthra kumar
321fea322c test: invoice outstanding when gl's are split on cost center allocat 2022-06-24 17:47:11 +05:30
Sagar Vora
b6133c300e test: create TDS payable account 2022-06-24 16:46:52 +05:30
Sagar Vora
4a2a02286a test: create tax withholding category instead of updating 2022-06-24 15:49:19 +05:30
Sagar Vora
69ff61c838 fix: add Lower Deduction Certificate to the Accounting workspace for now 2022-06-24 15:12:43 +05:30
Sagar Vora
9b057d15b2 fix: move hooks to reduce diff 2022-06-24 15:04:28 +05:30
Rucha Mahabal
c619b58ba9 fix: remove HR/Payroll references from form dashboards
- Employee, Holiday List, Project, Task, Timesheet
2022-06-24 15:03:16 +05:30
Vladislav
913b393969 Update ru.csv 2022-06-24 11:16:39 +03:00
Vladislav
2826056d41 Update ru.csv 2022-06-24 11:14:57 +03:00
Smit Vora
3c9eea54a5 fix: remove student naming series 2022-06-24 13:42:07 +05:30
Sagar Vora
593147d337 test: move code to ensure fixtures get created 2022-06-24 14:37:11 +05:30
Sagar Vora
2e6919b7be fix: remove more India patches 2022-06-24 14:14:12 +05:30
Sagar Vora
ff10f557c0 test: use Sales Expenses instead of VAT to test disabled account 2022-06-24 13:49:20 +05:30
Sagar Vora
12b7e14fde chore: keep back code to be a part of other apps / to be ported later 2022-06-24 13:38:13 +05:30
ruthra kumar
71f6f78d94 fix: incorrect outstanding for invoice 2022-06-24 13:36:15 +05:30
Rucha Mahabal
39e0d22044 chore: Remove HR related field references from Employee, Department form scripts
- removed approver fields and payroll cost center from Employee master

- removed query filter code for HR related fields from employee and department form scripts

- removed `update_approver_role`
2022-06-24 13:14:26 +05:30
Sagar Vora
0810674c8a Merge remote-tracking branch 'upstream/develop' into remove-india 2022-06-24 13:08:40 +05:30
Marica
1d683ca9f2 Merge pull request #31421 from s-aga-r/fix/production-plan/test/planned-qty
fix: add UOM validation for planned-qty
2022-06-24 12:40:03 +05:30
Vladislav
f59a6248bc Update ru.csv
- fix logic
- add translate
2022-06-24 01:02:41 +03:00
Rucha Mahabal
eac58abcc5 chore: Remove HR related reports from other modules
- Project Profitability report: Projects

- Employee Hours Utilization Based on Timesheet: Projects

- Unpaid Expense Claims: Accounts
2022-06-23 20:50:55 +05:30
Rucha Mahabal
edb528ce41 chore: Remove code for Expense Claim from Project, Task, Delivery Trip
- Remove `total_expense_claim` field from Project and Task, will be installed with hrms setup

- Remove Expense Claim calculation from `update_costing` in project

- Remove `update_total_expense_claim` from task

- Remove Expense Claim references from employee form tour

- Remove 'Make Expense Claim' button from Delivery Trip, will only be available if hrms is installed

- Update delivery trip tests
2022-06-23 19:48:42 +05:30
Rucha Mahabal
1ff0e4519f chore: Extract Expense Claim, FnF, Gratuity, Employee Advance related code from accounting
- Added hooks `advance_payment_doctypes`, `invoice_doctypes`, `period_closing_doctypes` for other apps to extend accounting functionality

- Removed `set_query` code from `journal_entry.js` and `payment_entry.js`

- removed `update_status_for_full_and_final_statement` trigger on JE submission/cancellation

- refactored `payment_entry.py`: split functions for validating reference doctypes for easy overriding, removed hrms references from `get_reference_details` and `get_payment_entry`

- removed dead code: functions `get_bill_no_and_update_amounts`, `get_total_amount_exchange_rate_base_on_currency`, `get_total_amount_exchange_rate_for_employee_advance`, `get_amounts_based_on_ref_doc`, `get_amounts_based_on_reference_doctype`
2022-06-23 16:17:34 +05:30
GangaManoj
416d578290 fix: Add missing comma 2022-06-23 15:14:31 +05:30
GangaManoj
1b1786532a test: Test monthly depreciation by Written Down Value method 2022-06-23 15:14:31 +05:30
GangaManoj
2b7ab72a72 fix: Convert string to datetime object 2022-06-23 15:14:31 +05:30
GangaManoj
e62beaefc1 test: Test if final day of the month is taken if depr_start_date is the last day of its month 2022-06-23 15:14:31 +05:30
GangaManoj
154e258ad0 fix: Get last day of the monthif depr posting date is the last day of its month 2022-06-23 15:14:31 +05:30
GangaManoj
b07aae4da5 fix: Correct pro-rata amount calculation 2022-06-23 15:14:31 +05:30
GangaManoj
2d9153ea30 fix: Remove misleading comment 2022-06-23 15:14:31 +05:30
GangaManoj
ab13a178b5 fix: Replace asset life with total no of depreciations 2022-06-23 15:14:31 +05:30
Sagar Sharma
73a15adc67 Merge branch 'develop' into fix/production-plan/test/planned-qty 2022-06-23 11:20:22 +05:30
Deepesh Garg
79d5d35df9 Merge pull request #31395 from nihantra/bank_clear_summ
fix: filter set in Bank Clearance Summary
2022-06-23 10:54:56 +05:30
Sagar Sharma
70bc51a8fc Merge branch 'develop' into fix/production-plan/test/planned-qty 2022-06-22 15:33:08 +05:30
s-aga-r
00807abe31 fix: add UOM validation for planned-qty 2022-06-22 14:28:17 +05:30
Deepesh Garg
db2484b6b2 Merge pull request #31418 from ruthra-kumar/payment_ledger_migration_logic_bug
fix: handle empty values("") in against_voucher columns on gl migration
2022-06-22 12:51:21 +05:30
Marica
4c0749e04a Merge pull request #31406 from marination/bom-update-log-cleanup-perf
chore: Clear Progress section for completed logs & `on_submit` UX
2022-06-22 12:16:06 +05:30
Marica
46d02ec4b2 Merge branch 'develop' into bom-update-log-cleanup-perf 2022-06-22 11:50:06 +05:30
Marica
55d67a0d09 Merge pull request #31420 from HarryPaulo/translate-status-filter-orders
fix: translation for filter status on report
2022-06-22 11:45:59 +05:30
rohitwaghchaure
2ed06d7ceb Merge pull request #31248 from rohitwaghchaure/fixed-transferred-materials-are-not-consumed
fix: transferred batches are not fetched while making Manufacture stock entry
2022-06-22 11:37:15 +05:30
hrzzz
8b1ff96e30 fix: translation for filter status on report 2022-06-21 15:10:19 -03:00
rohitwaghchaure
186224a12a Merge branch 'develop' into fixed-transferred-materials-are-not-consumed 2022-06-21 22:45:05 +05:30
ruthra kumar
5826b7b071 fix: identify empty values "" in against_voucher columns 2022-06-21 19:50:50 +05:30
Vladislav
ce1b4e40a1 fix: update ru translate (#31404)
* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

fix logic

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv
2022-06-21 19:25:05 +05:30
Rucha Mahabal
f6fbcc99a3 chore: Removed payroll dependencies from Loan Management, moved to hrms app
- Salary Slip Loan dt moved to hrms, removed from erpnext app

- Repay from Salary field removed from Loan and Loan Repayment, installed on hrms app setup

- fixed references to salary slip loan fields
2022-06-21 18:13:01 +05:30
Ankush Menat
e866ec6e28 Merge pull request #31412 from s-aga-r/fix/bom/default
fix: set default_bom for item
2022-06-21 16:42:38 +05:30
s-aga-r
dc2830da4d fix: set default_bom for item 2022-06-21 15:13:01 +05:30
Deepesh Garg
b16ab818c5 Merge pull request #31264 from ankush/internal_trasfer_precision_loss
fix: internal transfer GLE validation
2022-06-21 14:31:18 +05:30
marination
4cf2225a29 chore: Implement Log clearing interface in BOM Update Log
- Implement Log clearing interface in BOM Update Log
- Add additional info in sidebar: Log clearing only happens for 'Update Cost' type logs
- 'Replace BOM' logs have important info and is used in BOM timeline, so we'll let users decide if they wanna keep or discard it
2022-06-21 14:10:59 +05:30
Sagar Sharma
912d26361d Merge branch 'develop' into fixed-transferred-materials-are-not-consumed 2022-06-21 13:23:37 +05:30
Marica
5ae8f5d4b8 Merge branch 'develop' into bom-update-log-cleanup-perf 2022-06-21 11:01:03 +05:30
Deepesh Garg
f572c20009 Merge branch 'develop' into internal_trasfer_precision_loss 2022-06-21 10:45:02 +05:30
Deepesh Garg
e0e2616054 Merge pull request #31350 from deepeshgarg007/sales_exchange_rate_validation
fix: Conversion rate validation for multi-currency invoices
2022-06-21 09:09:38 +05:30
s-aga-r
f6ef3068d7 Merge branch 'develop' into subcontracting 2022-06-20 23:10:31 +05:30
s-aga-r
6d89b2fa28 refactor: backport old subcontracting code 2022-06-20 23:10:02 +05:30
barredterra
e2295b4e2f fix: apply price list rate 2022-06-20 18:52:40 +02:00
Deepesh Garg
46e6c2cd0f Merge branch 'develop' of https://github.com/frappe/erpnext into sales_exchange_rate_validation 2022-06-20 22:00:49 +05:30
Deepesh Garg
8f37393044 test: Add test case 2022-06-20 22:00:32 +05:30
marination
0320b59ea6 chore: Clear Progress section for completed logs & on_submit UX
- Delete `BOM Update Batch` table on 'Completed' log, to save space
- Hide Progress section on 'Completed' log
- Enqueue `on_submit` for 'Update Cost' job, getting leaf boms could take time for huge DBs. Users have to wait for screen to unfreeze.
- Add error handling to `process_boms_cost_level_wise` (Called via cron job and on submit, both in background)
2022-06-20 16:25:34 +05:30
Vladislav
b5e22c8e16 Update ru.csv 2022-06-19 21:54:06 +03:00
Sagar Vora
e48a8cd1e8 fix: remove india hook 2022-06-19 23:20:28 +05:30
Sagar Vora
33b54c50ea chore: remove ITC patch 2022-06-19 23:18:04 +05:30
Sagar Vora
ec9861266e Merge remote-tracking branch 'upstream/develop' into remove-india 2022-06-19 22:57:22 +05:30
Deepesh Garg
f337213f33 fix(India): Discounts in E-Invoicing 2022-06-19 21:19:02 +05:30
Deepesh Garg
169ff5a0dd feat: Cash and Non trade discounts in Sales Invoice 2022-06-19 21:18:12 +05:30
Deepesh Garg
9aea017990 Merge pull request #31136 from ruthra-kumar/refactor_payment_reconciliation_tool
refactor: Payment Reconciliation tool will use Payment Ledger
2022-06-17 21:40:47 +05:30
Conor
ea28ed1bb3 refactor: if() to CASE WHEN (#31360)
* refactor: if() to CASE WHEN

* fix: remove duplicate order by

* fix: remove extraneous table

* style: reformat to black spec

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-17 21:17:48 +05:30
Deepesh Garg
4a90cd6d54 Merge branch 'develop' into refactor_payment_reconciliation_tool 2022-06-17 21:10:48 +05:30
Deepesh Garg
a0cab761b8 Merge pull request #31396 from deepeshgarg007/quotation_lost_update
fix: Quotation lost update
2022-06-17 21:09:03 +05:30
Deepesh Garg
e457288dba chore: fix condition 2022-06-17 18:56:53 +05:30
Deepesh Garg
02f9441e1a fix: Quotation lost update 2022-06-17 18:54:42 +05:30
Nihantra C. Patel
0097a2b60c Update bank_clearance_summary.py 2022-06-17 18:35:11 +05:30
ruthra kumar
3a238b4daa docs: specification of payment ledger 2022-06-17 17:57:07 +05:30
ruthra kumar
7312f22f35 refactor: update voucher outstanding from payment ledger
Outstanding amount is updated from payment ledger, only for
receivable/payable accounts. For remaining account types, update happens
from GL Entry.
2022-06-17 17:57:07 +05:30
ruthra kumar
524c175cf0 refactor: delink gl entry from reconciliation 2022-06-17 17:57:07 +05:30
ruthra kumar
ae8aa8f3e7 refactor: 'get outstanding invoices' popup in payment entry
Payment entry has option to select outstanding invoices using a popup
form. This change refactors the pop to use payment ledger to fetch +ve
outstanding invoices.
2022-06-17 17:57:07 +05:30
ruthra kumar
8c87674c62 refactor: outstanding_invoice function and helper class
outstanding invoice function has been refactored to use payment ledger
2022-06-17 17:57:07 +05:30
ruthra kumar
9cdc388c97 test: payment reconciliation tool
unit test cases for partial reconciliation, return invoice against
invoice, invoice against journals and journal against journal have
been added
2022-06-17 17:57:07 +05:30
ruthra kumar
65f47bca31 refactor: payment reconciliation tool
PR uses payment ledger for outstanding invoice and unreconcilied
cr/dr notes.
2022-06-17 17:57:07 +05:30
ruthra kumar
7b383880c6 feat: helper class for quering Payment Ledger 2022-06-17 17:57:07 +05:30
ruthra kumar
05467ffce2 test: use fixture for payment entry test cases (#31390)
refactor: use fixture for payment entry test cases
2022-06-17 17:23:29 +05:30
Conor
74a782d81d refactor: DB independent quoting and truthy/falsy values (#31358)
* refactor: DB independent quoting and truthy/falsy values

* style: reformat to black spec

* fix: ifnull -> coalesce

* fix: coalesce -> Coalesce

* fix: revert pypika comparison

* refactor: convert queries to QB

* fix: incorrect value types for query

`=` query makes no sense with list of values

* fix: remove warehouse docstatus condition

* fix: keep using base rate as rate

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-17 17:01:27 +05:30
s-aga-r
ca24b5287e chore: make "is_subcontracted" field read-only in PR and PI 2022-06-17 16:47:49 +05:30
s-aga-r
5002f1f1e5 feat: Add hidden field "is_old_subcontracting_flow" in PO, PR and PI 2022-06-17 16:47:41 +05:30
Rucha Mahabal
fbc1330ab0 chore: Remove HR/Payroll related setups and fixtures
- Fixtures moved to HRMS app

- 'HR' field in Terms and Conditions removed, added via HRMS setup
2022-06-17 16:34:13 +05:30
Marica
d6078aa911 fix: Respect system precision for user facing balance qty values (#30837)
* fix: Respect system precision for user facing balance qty values

- `get_precision` -> `set_precision`
- Use system wide currency precision for `stock_value`
- Round of qty defiiciency as per user defined precision (system flt precision), so that it is WYSIWYG for users

* fix: Consider system precision when validating future negative qty

* test: Immediate Negative Qty precision test

- Test for Immediate Negative Qty precision
- Stock Entry Negative Qty message: Format available qty in system precision
- Pass `stock_uom` as confugrable option in `make_item`

* test: Future Negative Qty validation with precision

* fix: Use `get_field_precision` for currency precision as it used to

- `get_field_precision` defaults to number format for precision (maintain old behaviour)
- Don't pass `currency` to `get_field_precision` as its not used anymore
2022-06-17 15:13:13 +05:30
Ankush Menat
74007c8e91 fix(UX): hide irrelevant UOM fields (#31392)
fix(UX): hide UOM-related fields if they are inconsequential
2022-06-17 15:10:21 +05:30
rohitwaghchaure
2ec133df6d Merge branch 'develop' into fixed-transferred-materials-are-not-consumed 2022-06-17 15:02:07 +05:30
Ankush Menat
10583eb3ce fix: UOM handling for transaction without item (#31389)
If invoice is made without item code then UOM, Stock UOM and
conversion_factor all need to be manually added, this is confusing and
leads missing them out leads to errors.

Simplest solution:

- if either UOM exists then set both to same uom conversion factor to
- also set conversion factor based on UOM conversions
2022-06-17 12:13:27 +05:30
Vladislav
0e8aad9038 Update ru.csv 2022-06-17 00:28:48 +03:00
Sagar Vora
1a3997a566 fix: transaction date gets unset in material request (#31327)
* fix: set date correctly in material request

* fix: use only `transaction_date` in `get_item_details`
2022-06-16 22:33:47 +05:30
Ankush Menat
6f2086d770 test: verify that all patches exist in patches.txt (#31371)
* chore: delete orphaned patches

* test: orphan/missing entries in patches.txt


[skip ci]
2022-06-16 22:15:06 +05:30
Vladislav
75e1f01b9d Update ru.csv 2022-06-16 18:32:57 +03:00
Vladislav
c869077c92 Update ru.csv 2022-06-16 18:18:35 +03:00
Jingxuan He
b4a93da9f3 chore: Fix a potential variable misuse bug (#31372)
* Fix a potential variable misuse bug

* chore: Separate check (separate line) for empty table in Pricing Rule

* chore: Code readability & check for field in row (now row itself)

Co-authored-by: marination <maricadsouza221197@gmail.com>
2022-06-16 12:16:59 +05:30
Rucha Mahabal
4b3fb83850 fix: remove Salary Slip creation from Timesheet
- moved to HRMS app
2022-06-15 23:51:33 +05:30
Ankush Menat
86919d2a6d test: silent test failure in stock assertions (#31377)
If actual values are not present then test is silently passing, # of
actual values should be at least equal to expected values.
2022-06-15 21:19:09 +05:30
Ankush Menat
5c6f22f275 refactor: simpler batching for GLE reposting (#31374)
* refactor: simpler batching for GLE reposting

* test: add "actual" test for chunked GLE reposting
2022-06-15 19:30:26 +05:30
Marica
d9c6b7218a chore: Sponsor credit for BOM Update Tool perf 2022-06-15 18:57:39 +05:30
Vladislav
041a5e7d1f Merge branch 'frappe:develop' into develop 2022-06-15 15:03:19 +03:00
Rucha Mahabal
39c30f5b01 chore: remove test for employee
- Moved to the HRMS app
2022-06-15 17:26:19 +05:30
Rushabh Mehta
c0f9b34ede fix(minor): move variants to separate tab (#31354)
* fix(minor): move variants to separate tab

* fix(minor): variants tab

* fix(minor): add counts

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-15 16:08:05 +05:30
Ankush Menat
276267d5a6 fix: remove agriculture module from patch (#31369) 2022-06-15 15:26:05 +05:30
Marica
c83b4043b8 Merge pull request #31353 from marination/so-to-wo-bom
fix: Pick Template BOM if variant BOM absent in WO popup from SO
2022-06-15 14:37:15 +05:30
Rucha Mahabal
0f83e7af56 fix: removed expense claim, advance and salary slip updates from PE/JE events
- moved them to HRMS app hooks
2022-06-15 13:58:41 +05:30
Ankush Menat
94ad66e55b chore: revert naming to default (#31364) 2022-06-15 13:35:42 +05:30
Deepesh Garg
be14a7e657 Merge pull request #31365 from ruthra-kumar/add_gl_migration_to_patch
chore: add gl to payment ledger migarion to patches
2022-06-15 13:20:10 +05:30
ruthra kumar
538faf3639 chore: add gl to payment ledger migarion to patches 2022-06-15 13:17:06 +05:30
Marica
fafdaff4d4 Merge branch 'develop' into so-to-wo-bom 2022-06-15 12:58:13 +05:30
Rucha Mahabal
3fe2ef6790 chore: update import paths for HR 2022-06-15 12:43:45 +05:30
Rucha Mahabal
8b2d045b06 fix(Projects): add a function get_users_email instead of importing from HR 2022-06-15 12:26:15 +05:30
Conor
b8f728a40a refactor: use CURRENT_DATE instead of CURDATE() (#31356)
* refactor: use CURRENT_DATE instead of CURDATE()

* style: reformat to black spec

* refactor: use QB for auto_close queries

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-15 12:07:33 +05:30
Nihantra C. Patel
37e9622426 fix: Spelling mistake in quotation depend on (#31362)
Update quotation.json
2022-06-15 12:02:57 +05:30
Conor
2a9105f26f refactor: DB independent capitalization of test cases (#31359) 2022-06-15 11:24:24 +05:30
rohitwaghchaure
a4c2c3e02f Merge branch 'develop' into fixed-transferred-materials-are-not-consumed 2022-06-15 09:41:01 +05:30
Sagar Sharma
406114374b Merge branch 'develop' into subcontracting 2022-06-14 06:44:29 -07:00
s-aga-r
9a68af36ec Merge branch 'develop' into subcontracting 2022-06-14 19:13:10 +05:30
Marica
639e4c5714 Merge branch 'develop' into so-to-wo-bom 2022-06-14 18:22:11 +05:30
Ankush Menat
2535d5edd0 perf: GLE reposting with progress and chunking (#31343)
If stock voucher count goes >1000 then fetching all gles and reposting
them all at once requires much more memory and can cause crash.

- This PR ensures that GLE reposting is done in chunks of 100 vouchers.
- This PR also starts keeping track of how many such chunks were
  processed so in future progress is resumed in event of timeout.
2022-06-14 18:20:33 +05:30
marination
9f2d325e67 fix: Pick Template BOM if variant BOM absent in WO popup from SO
- Use `get_default_bom` in sales_order.py (reduce duplicate utility functions)
- Remove redundant if else in `get_work_order_items`
- `get_default_bom`: If no BOM and template exists try to fetch template BOM
- test: `get_work_order_items` via SO and if right BOM is picked
2022-06-14 17:20:44 +05:30
s-aga-r
ca9d55a2fd chore: update err msg for FG Item in PO 2022-06-14 13:16:22 +05:30
Deepesh Garg
d05d15346a fix: Conversion rate validation for multi-currency invoices 2022-06-14 12:50:49 +05:30
Deepesh Garg
f8011f30e0 Merge pull request #31322 from deepeshgarg007/quotation_issues
fix: Company address filter in quotation
2022-06-14 11:17:12 +05:30
Deepesh Garg
5b2ba087a3 Merge branch 'develop' of https://github.com/frappe/erpnext into quotation_issues 2022-06-14 10:50:47 +05:30
Deepesh Garg
fb3da124e5 chore: linting issues 2022-06-14 10:50:38 +05:30
Conor
00ef499739 refactor: use db independent offset syntax (#31345)
* chore: use db independent offset syntax

* fix: typo

* style: reformat code to black spec

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-14 10:49:07 +05:30
Marica
39338e70d5 Merge pull request #31341 from marination/subcontract-supplied-items
fix: Supplied Qty not updated on Stock Entry cancel
2022-06-13 20:43:01 +05:30
Rucha Mahabal
23b40ff13c fix: remove active employee validation from timesheets
- moved to hrms hooks, will only be triggered if app is installed
2022-06-13 20:08:48 +05:30
Marica
f5ebaed191 Merge branch 'develop' into subcontract-supplied-items 2022-06-13 18:32:43 +05:30
marination
b8f468cb4f test: PO Supplied Qty reset on cancel/submit 2022-06-13 18:31:35 +05:30
marination
fa1d9d548e fix: Supplied Qty not updated on Stock Entry cancel
- Loop over PO supplied items and update them as data from SE will exclude a row if supplied qty becomes 0 on cancel
- Use DB API insteaf of raw SQL
2022-06-13 17:59:03 +05:30
Ankush Menat
883598d59a chore: delete BOT
RIP
2022-06-13 16:24:48 +05:30
Sagar Sharma
f755430098 Merge branch 'develop' into subcontracting 2022-06-13 03:00:53 -07:00
Ankush Menat
697fbe946a Merge pull request #31337 from gavindsouza/get_fiscal_years-refactor
refactor: get_fiscal_years API
2022-06-13 14:56:33 +05:30
Gavin D'souza
e9af68e947 test: Remove deprecated as_tuple kwarg in FrappeTestAPI.post 2022-06-13 14:26:59 +05:30
Gavin D'souza
6c726a161c ci(patch): Setup python dependencies after switching to current branch 2022-06-13 13:22:04 +05:30
Solufyin
0410752fcf Merge branch 'frappe:develop' into solufy_rec_pay_report 2022-06-13 13:20:41 +05:30
Deepesh Garg
b12b7b51ec Merge pull request #31107 from ruthra-kumar/refactor_ar/ap_report
refactor: Accounts Receivable/Payable Report will use Payment Ledger
2022-06-13 12:57:25 +05:30
Gavin D'souza
5f8cd34da5 fix: Use newer PyPDF2 APIs
Depends on https://github.com/frappe/frappe/pull/17127
2022-06-13 12:43:08 +05:30
Gavin D'souza
0727d1d99b refactor: get_fiscal_years API
* Optimize fiscal year options generation
* Don't pass unrequired criterions / values to prepared query
* Use QB notation for raw query
2022-06-13 12:43:08 +05:30
Deepesh Garg
ea276a7b86 Merge branch 'develop' into refactor_ar/ap_report 2022-06-13 12:34:47 +05:30
Ankush Menat
3701cdbaf1 ci(Mergify): configuration update (#31336)
Signed-off-by: Ankush Menat <ankushmenat@gmail.com>
2022-06-13 12:14:31 +05:30
Marica
d3d0ade89f chore: Accidental '=' instead of comma in French translation (#31335) 2022-06-13 11:54:12 +05:30
HENRY Florian
83367bfe5e fix: update fr translation (#31232)
* update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* Update fr.csv

update typo

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* fix: Use elision instead of HTML code equivalent

* fix: Use elision instead of HTML code equivalent (pt 2)

* fix: Use elision/single quote instead of HTML code equivalent (pt 3)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-06-13 11:15:47 +05:30
ruthra kumar
3018756482 refactor: remove 'show remarks' 2022-06-13 10:56:33 +05:30
ruthra kumar
71521b6550 refactor: unit test for AR/AP report 2022-06-13 10:56:33 +05:30
ruthra kumar
cd9d70d6ee refactor: show advance payments in AR/AP report 2022-06-13 10:56:33 +05:30
ruthra kumar
dfe3082596 refactor: AR/AP will use payment ledger 2022-06-13 10:56:30 +05:30
Deepesh Garg
eb93564db6 Merge branch 'develop' of https://github.com/frappe/erpnext into quotation_issues 2022-06-11 21:56:24 +05:30
Deepesh Garg
118c786e63 fix: Partially Ordered status for quotation 2022-06-11 21:55:59 +05:30
Vladislav
7bdeac49f4 Update ru.csv 2022-06-11 15:59:49 +03:00
Sagar Vora
d87dcb756b Merge pull request #31323 from alyf-de/remove-datev-from-accounting-workspace
fix: remove DATEV from accounting workspace
2022-06-11 10:55:31 +00:00
Deepesh Garg
243625898e fix(India): Sales taxes and charges template fetching in quotation 2022-06-10 22:05:58 +05:30
Vladislav
89e720fdf4 Update ru.csv 2022-06-10 17:24:28 +03:00
Deepesh Garg
2fc04f661a fix: Company address filter in quotation 2022-06-10 19:23:17 +05:30
barredterra
f6695909c4 fix: remove DATEV from accounting workspace 2022-06-10 15:51:02 +02:00
Ankush Menat
39ec0aca95 fix(UX): use doc.status for Job Card status (#31320)
fix(UX): use doc.status for JC status

- Use doc.status directly for indicator - single source of truth
- Update status to cancelled when doc is cancelled
2022-06-10 18:43:46 +05:30
Rucha Mahabal
ab8df98cab chore: Remove regional code for India HR, moved to HRMS 2022-06-10 18:22:07 +05:30
Deepesh Garg
3d76b1a093 Merge pull request #31182 from ruthra-kumar/migrate_gl_to_payment_ledger_using_sql
refactor: migrating data from GL to payment ledger using raw SQL
2022-06-10 17:15:58 +05:30
Rucha Mahabal
85b18e23d7 fix: remove employee reminders, move to HRMS app
- change `erpnext.hr.EmployeeController` to `erpnext.setup.EmployeeController`
2022-06-10 16:26:07 +05:30
Vladislav
84620a775d Update ru.csv 2022-06-10 13:35:51 +03:00
Vladislav
3e66f4214d Update ru.csv 2022-06-10 13:12:09 +03:00
Vladislav
37f9692001 Merge branch 'frappe:develop' into develop 2022-06-10 13:03:07 +03:00
Rucha Mahabal
512c82f76d chore: Update imports/paths for doctypes moved to erpnext setup module 2022-06-10 15:06:54 +05:30
hendrik
74b274f555 fix: update Period Closing Voucher per Company
Validate period closing voucher company-wise
2022-06-10 14:52:53 +05:30
Ankush Menat
450bef8443 Merge pull request #31240 from ankush/repost_match_gle
fix: unnecessary GLE reposts
2022-06-10 14:51:45 +05:30
Ankush Menat
3a3d13622d refactor!: drop github connector from ERPNext (#31316) 2022-06-10 14:01:41 +05:30
Ankush Menat
1646fbe478 refactor: remove add_fetch (#31315)
- Sales Team already had fetch from set up
- Set up fetch from on sales partner in sales transaction

Reason for removal: the JS code applies arbitrarily to any field called "sales_person"
2022-06-10 13:52:17 +05:30
ruthra kumar
e2c52436da refactor: migrate gl to payment ledger using sql 2022-06-10 13:17:43 +05:30
Deepesh Garg
9562c28408 Merge pull request #31198 from HarryPaulo/gross-profit-monthly-schedule
feat: two new groupby mode on gross profit: Monthly, Payment Term
2022-06-10 12:52:35 +05:30
Rucha Mahabal
0d34e589fd chore: Remove HR and Payroll modules from ERPNext 2022-06-10 12:51:29 +05:30
Rucha Mahabal
a117af253b fix: remove HR specific fields from depatment and employee
- these will be added to the masters as custom fields on HRMS app setup
2022-06-10 12:42:59 +05:30
Marica
2941a8ce73 Merge pull request #31303 from marination/update-employee-compatibility-fix
fix: locale Currency and Float setting in update_employee
2022-06-10 11:35:02 +05:30
Ankush Menat
6fc32b83c8 fix: revert show title field on Employee doctype (#31312) 2022-06-10 11:03:51 +05:30
Rucha Mahabal
f520f042af chore: move widely used doctypes from HR to Setup module
- Employee: used in Telephony, Stock, Quality, Projects, Manufacturing, Loans, Buying, Assets, Accounts, Dependent Apps: Healthcare

- Holiday List: CRM (Appointment Booking), Projects, Healthcare, Support (SLA), Education (Student's Holiday List)

- Branch: Selling (SMS Center), used widely as an accounting dimension

- Department: Assets, Projects, SMS Center, used widely as an accounting dimension

- Designation: Lead, Healthcare Practitioner, used in Employee master which will now be in core

- Employee Group: Telephony, Communication

- Child Tables for above dts: Employee Group Table (Employee Group), Employee Education (Employee), Employee External Work History (Employee), Employee Internal Work History (Employee), Designation Skill (Designation), Holiday (Holiday List)
2022-06-10 11:02:00 +05:30
Deepesh Garg
bbd930184c Merge pull request #31273 from ruthra-kumar/ignore_payment_ledger_on_loan_cancelation
fix: ignore payment ledger on cancellation of loan
2022-06-10 10:55:48 +05:30
Deepesh Garg
a2f34d74f3 Merge pull request #31225 from vishdha/fix_date_range_print
fix: Print/PDF for financial statement reports displays either wrong date range or wrong fiscal year
2022-06-10 10:52:53 +05:30
Deepesh Garg
8008653082 Merge pull request #31294 from deepeshgarg007/gstr_3b_taxable_value
fix(India): Incorrect taxable in GSTR-3B report
2022-06-10 10:49:14 +05:30
Deepesh Garg
43bf327f9b Merge pull request #31216 from sunhoww/patch-4
fix: Trial Balance failing to ignore Finance Book
2022-06-09 20:34:33 +05:30
Sun Howwrongbum
ee2949aa3f fix: typo in sql condition 2022-06-09 19:28:59 +05:30
Deepesh Garg
c13e5ad741 fix: Reset represents company on disabling internal customer and supplier (#31302) 2022-06-09 19:18:52 +05:30
Deepesh Garg
b9dbb36d0e chore: Linting Issues 2022-06-09 18:58:04 +05:30
Vladislav
2675751d6c fix: update ru translate (#31200)
* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

fix logic

* Update ru.csv

* Update ru.csv

* Update ru.csv
2022-06-09 18:46:08 +05:30
RJPvT
17887cde71 fix: locale Currency and Float setting in update_employee
In fieldtypes locale settings (example NL) . and , changes whereby the field is inproperly filled
2022-06-09 18:40:51 +05:30
Deepesh Garg
7c8bceca34 Merge pull request #31016 from HarryPaulo/fix-average-discount-auth
fix: correction of the calculation to the average value when there is…
2022-06-09 18:33:42 +05:30
mergify[bot]
e6f65e1697 chore: Asset Arabic translation Fix (backport #31221) (#31301)
chore: Asset Arabic translation Fix (#31221)

Update ar.csv

Fix Translation arabic translation that caused an error when submitting an asset if user language was arabic

(cherry picked from commit 9347cbbc9f)

Co-authored-by: meaziz <minaeaziz@gmail.com>
2022-06-09 17:47:15 +05:30
Marica
60968419e7 Merge pull request #31296 from ruthra-kumar/misalinged_columns_in_AR_report
fix: misaligned columns in print format of AR/AP report
2022-06-09 17:35:21 +05:30
Ankush Menat
16c8b7404d Merge pull request #31072 from marination/perf-bom-update-tool
perf: BOM Update Tool
2022-06-09 17:04:00 +05:30
Vladislav
be50d7dd1b Update ru.csv 2022-06-09 14:11:12 +03:00
marination
3fa0a46f39 chore: Less hacky tests, versioning (replace bom) and clearing log data (update cost)
- Remove `auto_commit_on_many_writes` in `update_cost_in_level()` as commits happen every N BOMs
- Auto commit every 50 BOMs
- test: Remove hacky `frappe.flags.in_test` returns
- test: Enqueue `now` if in tests (for update cost and replace bom)
- Replace BOM: Copy bom object to `_doc_before_save` so that version.py finds a difference between the two
- Replace BOM: Add reference to version
- Update Cost: Unset `processed_boms` if Log is completed (useless after completion)
- test: `update_cost_in_all_boms_in_test` works close to actual prod implementation (only call Cron job manually)
- Test: use `enqueue_replace_bom`  so that test works closest to production behaviour

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-06-09 16:27:51 +05:30
Ankush Menat
d9a5213952 fix(ux): hide new version btn on unsaved BOM (#31297) 2022-06-09 15:33:18 +05:30
ruthra kumar
bbaa14af16 fix: misaligned columns in print format of AR/AP report 2022-06-09 15:14:44 +05:30
Deepesh Garg
50aafdbe99 chore: cleanup 2022-06-09 11:52:46 +05:30
Deepesh Garg
20f568c159 fix(India): Incorrect taxable in GSTR-3B report 2022-06-09 11:50:37 +05:30
Ankush Menat
a6edce2397 Merge branch 'develop' into perf-bom-update-tool 2022-06-09 11:45:37 +05:30
Ankush Menat
eb53a9727d perf: commit GL reposting periodically
If you have a huge list of docs to repost then maintaining transaction
throughtout entire GL reposting is not only unnecessary but also creates
performance issues. Periodically commiting the changes prevents lost
progress and reduces memory usage.
2022-06-09 11:37:43 +05:30
Ankush Menat
67c26325ee fix: unnecessary GLE reposts
In Sales/Purchase invoices credit/debit are flipped and negated while making GLE,
this is unflipped while posting them but if we compare the flipped ones
it will always result in comparison failure and repost it.
2022-06-09 11:37:40 +05:30
Ankush Menat
65b21ee7d6 fix: internal transfer GLE validation 2022-06-08 19:26:40 +05:30
Nihantra C. Patel
43b0f2efe6 [DEV] Accounts: Added total of future amount, Remaining Balance in Payable and Receivable reports. 2022-06-08 17:36:42 +05:30
Rushabh Mehta
b29edb302c Merge pull request #31284 from rmehta/item-form-cleanup
fix(ux): Add tabs in Item
2022-06-08 17:01:57 +05:30
Sagar Sharma
f7a52f76d4 Merge branch 'develop' into subcontracting 2022-06-08 04:27:24 -07:00
Rushabh Mehta
5c6937865c fix(ux): Add tabs in Item 2022-06-08 16:30:44 +05:30
Marica
2832731601 fix: Use frappe.as_unicode to decode output of redis module list (#31282)
- As of redis 7, a list is added to the result of fetching the module list
- This list cannot be "decoded",so use `frappe.as_unicode` that handles bytes as well as other types
2022-06-08 15:52:13 +05:30
marination
7e41d84a11 chore: get_valuation_rate sider fixes
- Use qb instead of db.sql
- Don't use `args` as argument for function
- Cleaner variable names
2022-06-08 14:01:04 +05:30
ruthra kumar
018bc2af43 fix: ignore payment ledger on cancellation of loan 2022-06-08 12:03:47 +05:30
marination
9f2793ccf1 test: Fix test_update_bom_cost_in_all_boms
- Use base_rate for assertions as rate is subject to change due to conversion factor (USD)
2022-06-08 11:18:53 +05:30
Saqib Ansari
fb4f8d870b fix(india): e-invoice eligibility if company gstin is not configured (#31247) 2022-06-08 09:36:33 +05:30
Ankush Menat
f830b57fd4 test: sales register report with conditions 2022-06-07 15:23:32 +05:30
Marica
ff0a6b7cbd Merge branch 'develop' into perf-bom-update-tool 2022-06-07 14:49:59 +05:30
marination
6bde1bb5d2 test: Util to update cost in all BOMs
- Utility to update cost in all BOMs without cron jobs or background jobs (run immediately)
- Re-use util wherever all bom costs are to be updated
- Skip explicit commits if in test
- Specify company in test records (dirty data sometimes, company wh mismatch)
- Skip background jobs queueing if in test
2022-06-07 14:44:00 +05:30
Ankush Menat
25f9d58c34 Merge pull request #31209 from ankush/purch_return_gle
fix: purchase invoice standalone return GLEs
2022-06-07 14:28:17 +05:30
Deepesh Garg
20c2ffa767 Merge pull request #31258 from deepeshgarg007/unsecured_term_loan_closure
fix: Close unsecured terms loans
2022-06-07 13:53:42 +05:30
Deepesh Garg
eae4f64dd8 Merge pull request #31233 from deepeshgarg007/pi_cancel_provisional_gl_entries
fix: Reverse provisional entries on Purchase Invoice cancel
2022-06-07 13:31:02 +05:30
Deepesh Garg
815141bf57 fix: Close unsecured terms loans 2022-06-07 13:16:06 +05:30
Ankush Menat
7726271e2a fix: purchase invoice return GLe
voucher_wise_stock_value contains tuples and the condition was looking
for string, so it's never triggered.

Caused by https://github.com/frappe/erpnext/pull/24200
2022-06-07 12:08:20 +05:30
Ankush Menat
293eb8d722 test: create stock test mixin for assertion/utils 2022-06-07 11:35:51 +05:30
Deepesh Garg
dc8e80ea81 test: Add test coverage for cancellation 2022-06-07 11:35:03 +05:30
Ankush Menat
c3f2201c45 chore(meta): apply stale rules to pull only 2022-06-07 10:04:35 +05:30
Rucha Mahabal
91f9f37d64 fix: leave balance for earned leaves in backdated Leave Application dashboard (#31253) 2022-06-07 09:51:30 +05:30
Vishal Dhayagude
934cb97d90 Merge branch 'develop' into fix_date_range_print 2022-06-06 21:34:14 +05:30
Rohit Waghchaure
d94ff3ede8 test: test cases to cover batch, serialized raw materials 2022-06-06 17:57:52 +05:30
marination
15101190a6 chore: get_valuation_rate in bom.py must always return float & goto Item master if no bins 2022-06-06 17:54:13 +05:30
Vladislav
6f4b91d94f Update ru.csv 2022-06-06 14:41:54 +03:00
marination
934db57fdd chore: Miscellanous fixes/enhancements
- `get_valuation_rate`: if no bins are found return 0, SLEs do not exist either
- `get_valuation_rate`: Compute average valuation rate via query
- `get_rm_rate_map`: set order_by as None to avoid creating sort index (modified) each time query runs (seen in process list)
- BOM Update Batch: add status field and hide `boms_updated` so that  users can see progress without loading all updated boms (too much data)
- BOM Update Batch: set batch row status to completed after job runs
- BOM Update Log: remove `parent_boms` field (just pass parent boms to processing function) & remove Paused state (not used)
- Move job to long queue to avoid choking default queue
- `update_cost_in_boms`: use `get_doc` as each BOM is accessed only once. Use `for_update` to lock BOM row
- Commit after every 100 BOMs
2022-06-06 17:01:51 +05:30
Deepesh Garg
fe5b9e8bbb Merge branch 'develop' into patch-4 2022-06-06 16:45:20 +05:30
Deepesh Garg
c57125a51a Merge pull request #31242 from ankush/sales_register
fix(Sales Register): incorrect query with dimensions
2022-06-06 16:45:00 +05:30
Deepesh Garg
2041738e04 Merge pull request #31194 from ruthra-kumar/bug_sales_order_analysis_report
fix: incorrect billed_qty in sales order analysis report when multiple delivery notes for item
2022-06-06 16:39:13 +05:30
Ankush Menat
ee5bc58e9b fix(job card): only hold during draft state (#31243) 2022-06-06 16:27:25 +05:30
vishdha
53774e0f52 chore: minor change in fetching start and end date 2022-06-06 16:00:56 +05:30
vishdha
3513d54c0a fix: Print/PDF for financial statement reports displays either wrong date range or wrong fiscal year 2022-06-06 16:00:56 +05:30
Ankush Menat
c66c1e2215 chore(meta): disable stale bot on issues 2022-06-06 15:27:29 +05:30
Rucha Mahabal
edb775c381 test: Employee Benefit Application
- make `get_no_of_days` a function for reusability
2022-06-06 14:34:45 +05:30
Rucha Mahabal
3b8bc7d8e1 fix: incorrect LWP calculation for half days in employee benefit application 2022-06-06 14:34:45 +05:30
Rucha Mahabal
cf04683ad3 fix(Leave Application): 'Cancelled' status shown as 'Open' in list view 2022-06-06 14:34:45 +05:30
Rucha Mahabal
59de303b13 refactor: rewrite lwp queries using query builder 2022-06-06 14:34:45 +05:30
Rucha Mahabal
4decb7a02b fix: Consider only Approved leave applications in LWP, Employee Benefit calculations
- do not allow submitting leave applications with 'Cancelled' status
2022-06-06 14:34:45 +05:30
Vladislav
37d3c5121f Update ru.csv 2022-06-06 11:23:44 +03:00
Ankush Menat
c3219ebad1 fix(Sales Register): incorrect query with dimensions
If accounting dimension is also part of the default filters then same
query is repeated with incorrect syntax.

e.g. `item_group = (child1, child2)` instead of `in` query.

fix: don't add default filter if they are part of dimensions to be
added.
2022-06-06 12:39:12 +05:30
Deepesh Garg
a8c1b01437 Merge pull request #31230 from deepeshgarg007/item_wise_report_perf
fix: Remove redundant query
2022-06-06 12:23:56 +05:30
Deepesh Garg
c6d83c56d0 Merge branch 'develop' into item_wise_report_perf 2022-06-06 11:50:46 +05:30
Sagar Sharma
74fae72939 Merge branch 'develop' into subcontracting 2022-06-06 10:27:25 +05:30
Deepesh Garg
aad887bab9 Merge branch 'develop' into patch-4 2022-06-06 09:16:22 +05:30
Deepesh Garg
c21826e07d Merge pull request #31223 from dj12djdjs/fix-validation-message
fix: display currencies in validation message.
2022-06-06 09:06:52 +05:30
Deepesh Garg
8b56f0559e Merge branch 'develop' into item_wise_report_perf 2022-06-06 09:01:37 +05:30
Deepesh Garg
95a4602a23 Merge pull request #31231 from deepeshgarg007/gstr_3b_composite_supplies
fix(India): Supplies from composite dealer not showing up
2022-06-06 09:00:40 +05:30
Deepesh Garg
21de550549 Merge pull request #31219 from deepeshgarg007/group_filter_cost_center
fix: Parent dimension filters in orders
2022-06-06 08:58:40 +05:30
Deepesh Garg
9500aa8c94 Merge pull request #31218 from deepeshgarg007/distinct_gstin
fix(India): GSTIN filter in GSTR-1 report
2022-06-06 08:57:55 +05:30
Rohit Waghchaure
333c62de72 fix: transferred batches are not fetched while making Manufacture stock entry 2022-06-06 01:19:58 +05:30
Deepesh Garg
86a24f3d22 fix: Simply cancel reverse entries 2022-06-05 19:12:24 +05:30
Deepesh Garg
61fa4eb6c9 fix: Reverse provisional entries on Purchase Invoice cancel 2022-06-05 18:23:24 +05:30
Deepesh Garg
db07831db7 fix(India): Supplies from composite dealer not showing up 2022-06-05 12:13:02 +05:30
Deepesh Garg
a200e7e1fb fix: Remove redundant query 2022-06-05 11:16:12 +05:30
s-aga-r
992ba974e2 Merge branch 'develop' into subcontracting 2022-06-03 13:25:49 +05:30
Devin Slauenwhite
b061ea4cd2 chore: linter 2022-06-02 14:23:54 -04:00
Devin Slauenwhite
3a1c923e76 fix: display currencies in validation message. 2022-06-02 14:15:50 -04:00
Rucha Mahabal
12edddbfd4 Merge pull request #31074 from ruchamahabal/fix-salary-slip-bg-job
refactor(UX): Salary Slip creation and submission via background job in Payroll Entry
2022-06-02 18:41:46 +05:30
Rucha Mahabal
956a803be7 Merge branch 'develop' into fix-salary-slip-bg-job 2022-06-02 17:30:34 +05:30
Rucha Mahabal
1db4e623ab fix: payroll operations button visibility 2022-06-02 17:26:08 +05:30
Rucha Mahabal
d641f26035 fix: error handling and messages
- remove savepoints since submission should stop if any error occurs

- refactor variable naming and msgprints

- test Salary Slip creation failure

- fix(test): explicitly commit after payroll entry creation so that the first salary slip creation failure does not rollback the Payroll Entry insert
2022-06-02 15:08:49 +05:30
Deepesh Garg
3f376cc3a5 fix: Parent dimension filters in orders 2022-06-02 13:57:54 +05:30
marination
62857e3e08 feat: Track progress in Log Batch/Job wise
- This was done due to stale reads while the background jobs tried updating status of the log
- Added a table where all bom jobs within log will be tracked with what level they are processing
- Cron job will check if table jobs are all processed every 5 mins
- If yes, it will prepare parents and call `process_boms_cost_level_wise` to start next level
- If pending jobs, do nothing
- Current BOM Level is being tracked that helps adding rows to the table
- Individual bom cost jobs (that are queued) will process and update boms > will update BOM Update Batch table row with list of updated BOMs
2022-06-02 13:35:30 +05:30
Deepesh Garg
f0ac394d6e fix(India): GSTIN filter in GSTR-1 report 2022-06-02 12:59:55 +05:30
Ankush Menat
c7efa3b44d ci: stale apt cache (#31217) 2022-06-02 12:27:11 +05:30
Ankush Menat
849a2dc349 Merge branch 'develop' into patch-4 2022-06-02 10:25:20 +05:30
Ankush Menat
77dcdff0db fix: unusable SO after clearing taxes (#31215) 2022-06-01 22:01:07 +05:30
Sun Howwrongbum
48bde2de2a fix: Trial Balance failing to ignore Finance Book 2022-06-01 20:20:16 +05:30
Rucha Mahabal
661e05e693 fix(tests): account and company setups 2022-06-01 17:28:42 +05:30
Ankush Menat
3974fbbb6e feat: UOM specific barcodes (#30988) 2022-06-01 16:43:56 +05:30
Mohammad Hussain Nagaria
37433aad48 fix: Pluralize year text instead of optional bracket (#31210)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-06-01 16:29:20 +05:30
Rucha Mahabal
536f1dfc4b test: fix attendance tests for unmarked days (#31205)
* test: fix attendance tests for unmarked days

* chore: remove unused import
2022-06-01 13:56:55 +05:30
Ankush Menat
c84e11ac82 fix: re-validate warehouse after 'update items' (#31203) 2022-06-01 12:55:10 +05:30
Ankush Menat
03a24ce774 chore: delete dead cypress code
Moved to separate repo
2022-06-01 12:33:23 +05:30
Rucha Mahabal
d4b9cc0242 fix: remove leave policy assignment creation patch (#31097) 2022-06-01 12:18:14 +05:30
Rucha Mahabal
1c91793634 Merge branch 'develop' into fix-salary-slip-bg-job 2022-06-01 12:15:42 +05:30
Rucha Mahabal
653d6341d4 refactor: clean-up and commonify payroll entry test setups 2022-06-01 12:14:42 +05:30
Deepesh Garg
82be717f10 Merge pull request #31201 from deepeshgarg007/manufacturing_workspace_fix
fix: Remove domain restriction from Manufacturing Workspace
2022-06-01 09:30:39 +05:30
Deepesh Garg
167cf7b49d fix: Remove domain restrcition from Manufacturing Workspace 2022-06-01 09:04:53 +05:30
Deepesh Garg
753eb3ec3a Merge branch 'develop' into bug_sales_order_analysis_report 2022-05-31 21:41:35 +05:30
Deepesh Garg
5fd31c6433 Merge pull request #31199 from deepeshgarg007/settings_perm_fix
fix: Permission for selling and buying settings
2022-05-31 21:40:55 +05:30
maharshivpatel
b3ccc4bfb9 fix: Auto Insert Item Price If Missing when discount & blank UOM (#31168)
* fix: Auto Insert Item Price If Missing when discount and blank UOM

fixes wrong item price insert when discount is used and adds uom=stock_uom instead of blank as price is converted to stock uom

* unit tests added for item with discount

I have added test  for auto_insert_price where discount is used.

* unit test issue fixed

fixed make_sales_order as some of the test that depended on it were failing due to passing of incorrect parameters.

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-31 19:48:30 +05:30
Deepesh Garg
a6beafbc3c fix: Permission for selling and buying settings 2022-05-31 19:41:46 +05:30
Vladislav
e523fd6bad Update ru.csv
fix logic
2022-05-31 17:04:24 +03:00
hrzzz
c4af63ad98 feat: two new groupby mode: Monthly, Payment Term 2022-05-31 10:46:56 -03:00
ruthra kumar
4f1bfbb93d test: multiple delivery notes and billed quantity 2022-05-31 17:24:36 +05:30
ruthra kumar
0331e37982 fix: incorrect billed_qty when item has multiple Delivery note
sales order analysis report returns incorrect billed_qty value for
an SO item has multiple delivery notes
2022-05-31 17:15:31 +05:30
Vladislav
a4c2eccd56 Update ru.csv 2022-05-31 13:48:32 +03:00
marination
a62bc9b6c9 chore: Limit Update Cost jobs & db_update only if changed values
- If `Update Cost` job is ongoing, then block creation of new ones since all BOMs are updated
- `db_update` in `calculate_rm_cost` only if changed values to reduce redundant row updates
- Misc: Use variable for batch size
2022-05-31 16:00:29 +05:30
Ankush Menat
a1b7a7983a refactor!: drop naming series tool (#31183) 2022-05-31 15:35:40 +05:30
Ankush Menat
691b34a8ed chore: unnessary args 2022-05-31 14:15:13 +05:30
Ankush Menat
ddb46c5711 fix: batch selector flag (#31191)
This is broken again after serializing scan actions, which causes
selector to trigger before batch_no is set.

Solution: for duration of scan disable the selector
2022-05-31 14:14:27 +05:30
maharshivpatel
a8f98f3f96 feat(india): Improve E-way Bill Cancellation. (#31088) 2022-05-31 12:14:39 +05:30
Rucha Mahabal
ed1ba677d6 test: HRA Exemption in Proof Submission 2022-05-31 11:54:43 +05:30
Rucha Mahabal
cfe2f8cac1 fix: amount precision for Tax Exemption Proof Submission 2022-05-31 11:54:43 +05:30
Rucha Mahabal
2e98e9e0b9 test: set country to India before running regional tests 2022-05-31 11:54:43 +05:30
Rucha Mahabal
00adda7c8d fix: Tax Declaration tests and amount precision 2022-05-31 11:54:43 +05:30
Rucha Mahabal
5e96a46c87 test: HRA Exemption in Employee Tax Exemption Declaration 2022-05-31 11:54:43 +05:30
Rucha Mahabal
2b65c9616f fix: component pay calculation 2022-05-31 11:54:43 +05:30
Rucha Mahabal
34925a3a8c fix: HRA Exemption calculation in case of multiple salary structure assignments 2022-05-31 11:54:43 +05:30
Deepesh Garg
f07246af82 Merge pull request #31127 from deepeshgarg007/loan_interest_accrual
feat: Auto accrue loan interest for backdated term loans
2022-05-31 09:55:26 +05:30
Deepesh Garg
25290bb5d5 Merge pull request #31184 from Mitchy25/patch-1
fix(accounts): Ignore Cancelled GL Entries
2022-05-31 09:48:44 +05:30
Mitchy25
a0c412a0dd Ignore Cancelled GL Entries
Profitability Analysis includes 'is_cancelled' GL Entries which means that the profit numbers are incorrect. This change will ensure that the profit figures ignore cancelled GL Entries.
2022-05-31 15:25:09 +12:00
Vladislav
105dbad47c Update ru.csv 2022-05-31 03:06:28 +03:00
ruthra kumar
4c74637c91 refactor: remove naming expression for payment ledger 2022-05-30 19:06:56 +05:30
Rucha Mahabal
78c39e947b test: Salary Slip operations queuing, failure, and payroll entry status
- fix multicurrency test, remove redundant doc creation
2022-05-30 16:07:19 +05:30
Rucha Mahabal
42f6bca935 fix: reset Error Message on successful operation and fix status update on submit/cancel 2022-05-30 16:04:07 +05:30
Vladislav
832bedc747 Update ru.csv 2022-05-30 12:56:27 +03:00
Saqib Ansari
08bf0baaae chore!: remove unused bill no & date from purchase receipt (#31163) 2022-05-30 14:50:50 +05:30
Vladislav
5b461bfa75 Merge branch 'frappe:develop' into develop 2022-05-30 12:11:20 +03:00
rohitwaghchaure
2cbc665d19 Merge pull request #31175 from ankush/recursive_non_explosive_bom
fix: allow recursive BOMs as long as they don't recursively explode
2022-05-30 13:27:16 +05:30
Rucha Mahabal
de55157997 chore: rename method get_salary_component_account method to set
- since it doesn't return any value
2022-05-30 12:47:26 +05:30
Ankush Menat
d7a7c47650 Merge branch 'develop' into recursive_non_explosive_bom 2022-05-30 11:12:57 +05:30
Ankush Menat
c02598a51b chore: remove framework tests from erpnext
Similar tests exist in FW and this is failing because someone updated
the translations
2022-05-30 11:12:17 +05:30
Ankush Menat
954dac88a8 fix: allow non-explosive recrusive BOMs
Recursion should be allowed as long as child item is not "exploded"
further by a BOM.
2022-05-30 10:40:13 +05:30
Ankush Menat
d224bf1d34 fix: only erase BOM when do_not_explode is set 2022-05-30 10:40:13 +05:30
Ankush Menat
b170cec2fe fix(ux): "New Version" button BOM
"duplicate" technically creates a new version but that's not intuitive
at all.
2022-05-30 10:40:12 +05:30
Devin Slauenwhite
85b48fcdb9 fix: barcode scan resolve after model is updated (#31058)
* fix: resolve row after model is updated.

* fix: wait for all fields in the model to be updated.

* fix: sider

* pref: clear scanned code after capturing value

* fix: use frappe.run_serially
2022-05-29 22:19:09 +05:30
Ankush Menat
933434c3ea chore: format 2022-05-29 22:09:32 +05:30
Vladislav
ac160d58bd Update ru.csv 2022-05-28 04:16:46 +03:00
Vladislav
1cff1df46b Merge branch 'frappe:develop' into develop 2022-05-28 04:11:33 +03:00
marination
978ba5238f fix: Safe cast row.rate (in case of faulty exploded items, edge case but oh well) 2022-05-27 21:59:59 +05:30
marination
2de2491e17 perf: get_next_higher_level_boms
- Separate getting dependants and checking if they are valid (loop within loop led to redundant processing that slowed down function)
- Adding to above, the same dependant(parent) was repeatedly processed as many children shared it. Expensive.
- Use a parent-child map similar to child-parent map to check if all children are resolved
- `map.get()` reduced time: 10 mins -> 0.9s~1 second (as compared to `get_cached_doc` or query)
- Total time: 17 seconds to process 6599 leaf boms and 4.2L parent boms
- Previous Total time: >10 mins (I terminated it due to not wanting to waste time XD)
2022-05-27 20:33:14 +05:30
HENRY Florian
ce8e05146e chore: update translation fr for BOM (#31126)
* fix: update translation

* fix: fr translation for BOM
2022-05-27 17:27:43 +05:30
MOHAMMED NIYAS
7ff8acac51 fix: date filter on quality inspection report (#31148)
* fix: date filter

fix from date to to date filter btw those days

* fix: remove unnecessary conditions

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-05-27 17:13:14 +05:30
marination
5949946265 chore: Change BOM Progress field types to Long Text 2022-05-27 17:04:21 +05:30
Rucha Mahabal
4df76f3956 Merge pull request #31160 from ruchamahabal/fix-gratuity-status-update 2022-05-27 15:05:31 +05:30
Rucha Mahabal
c9e070393d test: make holiday list before running gratuity tests 2022-05-27 14:42:11 +05:30
marination
eabd8290d4 feat: Only update exploded items rate and amount
- Generate RM-Rate map from Items table (will include subassembly items with rate)
- Function to reset exploded item rate from above map
- `db_update` exploded item rate only if rate is changed
- Via Update Cost, only update exploded items rate, do not regenerate table again
- Exploded Items are regenerated on Save and Replace BOM job
- `calculate_exploded_cost` is run only via non doc events (Update Cost button, Update BOMs Cost Job)
2022-05-27 14:32:58 +05:30
Rucha Mahabal
79b0aede00 fix: add list view settings for Gratuity 2022-05-27 13:57:09 +05:30
Rucha Mahabal
6c66bbbbfe refactor: clean-up gratuity tests 2022-05-27 13:39:25 +05:30
Rucha Mahabal
b81d7519c1 test: Gratuity status for payment via salary slip 2022-05-27 12:58:10 +05:30
Rucha Mahabal
385e22a067 fix: Gratuity status not updated on salary slip submission 2022-05-27 12:57:07 +05:30
Deepesh Garg
7adcac4e66 Merge pull request #31155 from deepeshgarg007/exchnage_rate_reset
fix: Exchange rate reste to 1 on making mapped doc
2022-05-27 12:17:17 +05:30
HarryPaulo
4b04694c2c fix(pos): freeze screen while processing pos invoices (#30850) 2022-05-27 12:16:07 +05:30
Deepesh Garg
2a10f09d8d fix: Exchange rate reste to 1 on making mapped doc 2022-05-27 12:12:34 +05:30
maharshivpatel
935e5b1dcd fix(india): duplicate qrcode and hide button (#31100) 2022-05-27 11:48:55 +05:30
Deepesh Garg
d0a9eb4fd0 Merge branch 'develop' into fix-average-discount-auth 2022-05-26 18:22:34 +05:30
Ankush Menat
e3c0d0134e Merge pull request #31101 from alyf-de/fix-warehouse-js
fix: Improve button labels in Warehouse
2022-05-26 18:14:49 +05:30
Ankush Menat
ff798dc5c0 Merge pull request #31141 from ankush/naming_series_live_preview
feat: live preview of naming series on naming series tool
2022-05-26 16:49:59 +05:30
Ankush Menat
47b539e638 fix: skip existing batch number during autogen (#31140) 2022-05-26 16:20:56 +05:30
Ankush Menat
964b4184a6 test: add basic tests for naming series tool 2022-05-26 16:17:56 +05:30
Ankush Menat
4d0e2aa33a docs: update help information on naming series 2022-05-26 15:36:48 +05:30
Ankush Menat
24d1bf5328 feat: preview next numbers on naming series tool 2022-05-26 15:15:59 +05:30
Ankush Menat
82cd54b40b chore: resave naming series doctype schema
separate commit to avoid mixing actual changes
2022-05-26 15:15:59 +05:30
Sagar Sharma
61296a0658 fix: Subcontracting through Production Plan 2022-05-26 15:08:16 +05:30
Sagar Sharma
bcaac8f90f Merge branch 'develop' into subcontracting 2022-05-26 15:01:23 +05:30
Rucha Mahabal
5c7451438f Merge pull request #31130 from ruchamahabal/fix-job-opening 2022-05-26 13:23:44 +05:30
Rucha Mahabal
2bc6d46070 fix: validation message 2022-05-26 13:00:34 +05:30
Deepesh Garg
f49d8cd3b1 Merge pull request #31102 from alyf-de/german-translations-2022-05-23
feat: Add german translations
2022-05-26 11:49:56 +05:30
Vladislav
8d2502b5ba chore: update ru translate 2022-05-26 11:48:38 +05:30
Rucha Mahabal
3f13b0ec97 Merge branch 'develop' into fix-job-opening 2022-05-26 11:38:35 +05:30
Rucha Mahabal
ab0ef60918 test: Job Opening against a Staffing Plan 2022-05-26 11:32:46 +05:30
sersaber
e5d2c1b1f3 fix: change project's actual_start_date fieldtype from Data to Date (#31085)
* Update project.json

* Update project.json
2022-05-26 10:04:58 +05:30
Deepesh Garg
a5677d963f Merge pull request #31133 from frappe/mergify/bp/develop/pr-31124
fix: timesheet fetching in sales invoice (backport #31124)
2022-05-25 22:57:54 +05:30
Saqib Ansari
ca75d814a3 fix: timesheet fetching in sales invoice
(cherry picked from commit 216c32f4bc)
2022-05-25 14:45:41 +00:00
xdlumertz
c5e922c76b fix: Chart data for monthly periodicity in Cash Flow report (#31039)
fix: Chart data for monthly periodicity in Cash Flow report
2022-05-25 19:39:59 +05:30
Deepesh Garg
efa5b5b3db Merge pull request #31038 from alyf-de/taxes-title-field
feat: show title when linking Taxes and Charges Template
2022-05-25 19:28:59 +05:30
Deepesh Garg
e73a0a89b0 Merge pull request #31129 from deepeshgarg007/loan_doc_reco_queries
fix: Loan Doc query in Bank Reconciliation Statement
2022-05-25 19:21:30 +05:30
Deepesh Garg
d68187caae Merge branch 'develop' into loan_doc_reco_queries 2022-05-25 18:50:54 +05:30
Rucha Mahabal
29228575fa fix: Job Opening linked to Staffing Plan cannot be created/updated if there are existing employees 2022-05-25 18:33:37 +05:30
Deepesh Garg
9e4a36089e chore: Linting Issues 2022-05-25 18:10:42 +05:30
Deepesh Garg
a1f53f8d31 chore: Linting Issues 2022-05-25 17:59:40 +05:30
Deepesh Garg
147fc8fde7 fix: Loan Doc query in Bank Reconciliation Statement 2022-05-25 17:58:30 +05:30
Deepesh Garg
b562168509 Merge pull request #26916 from deepeshgarg007/party_account_currency_check
fix: Account currency validation for first transaction
2022-05-25 17:02:58 +05:30
Deepesh Garg
ac17ecb84b Merge branch 'develop' into party_account_currency_check 2022-05-25 16:21:06 +05:30
Deepesh Garg
bc34737709 chore: Update test case 2022-05-25 15:42:47 +05:30
Deepesh Garg
96d8b1ef3c feat: Auto accrue loan interest for backdated term loans 2022-05-25 14:19:10 +05:30
Deepesh Garg
e8f44445fd Merge pull request #31125 from frappe/mergify/bp/develop/pr-31123
fix: Handle missing HSN Codes (backport #31123)
2022-05-25 13:32:41 +05:30
Deepesh Garg
6edbc58873 fix: Handle missing HSN Codes
(cherry picked from commit ce3a21eb03)
2022-05-25 07:04:44 +00:00
Sagar Sharma
4ff734c25a Merge branch 'develop' into subcontracting 2022-05-25 12:32:33 +05:30
Saqib Ansari
268f413f56 fix(pos): paid amount calculation for multicurrency invoice (#31112) 2022-05-25 11:40:49 +05:30
Rucha Mahabal
273b21c0cb chore: move patch for updating Employee Advance status to v13 (#31118) 2022-05-25 11:34:25 +05:30
Deepesh Garg
e75c843dc1 Merge pull request #31077 from deepeshgarg007/payroll_payable_party_type
fix: Loan repayment entries for payroll payable account
2022-05-25 11:23:43 +05:30
Deepesh Garg
d81fad09ea Merge pull request #31080 from deepeshgarg007/company_address_trigger
fix(India): Async issue in company address trigger
2022-05-25 11:22:56 +05:30
marination
9f5f18e94d style: Update docstrings and fix/add type hints + Collapsible progress section in Log 2022-05-25 11:22:13 +05:30
marination
ab2d95a74d feat: Level-wise BOM cost updation
- Process BOMs level wise and Pause after level is complete
- Cron job will resume Paused jobs, which will again process the new level and pause at the end
- This will go on until all BOMs are updated
- Added Progress section with fields to track updated BOMs in Log
- Cleanup: Add BOM Updation utils file to contain helper functions/sub-functions
- Cleanup: BOM Update Log file will only contain functions that are in direct context of the Log

Co-authored-by: Gavin D'souza <gavin18d@gmail.com>
2022-05-25 11:21:01 +05:30
Devin Slauenwhite
55276f11f8 fix: don't fetch item_code if already exists. (#31113)
fix: check if item_code exists before fetching
2022-05-25 09:35:22 +05:30
barredterra
1e9f9c452f style: format 2022-05-24 13:31:29 +02:00
barredterra
1b16eb7667 refactor: set queries during setup 2022-05-24 13:30:59 +02:00
Raffael Meyer
e77c379cbb fix: remove unsupported arguments
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-05-24 11:52:23 +02:00
Raffael Meyer
e3bc3bf0f0 Merge branch 'develop' into german-translations-2022-05-23 2022-05-24 11:41:46 +02:00
Ankush Menat
1ecb8f4a67 chore: disable feed for material request 2022-05-24 14:32:56 +05:30
Ankush Menat
ecb39d81e0 chore: error logging for auto material requests (#31103) 2022-05-23 20:06:24 +05:30
barredterra
2388d86623 feat: Add german translations 2022-05-23 16:01:36 +02:00
barredterra
9356eb11de fix: german translations 2022-05-23 15:35:15 +02:00
barredterra
a6ddd86d31 fix: improve labels, simplify logic 2022-05-23 15:25:00 +02:00
barredterra
c704ad889d style: format warehouse js 2022-05-23 15:18:24 +02:00
Ankush Menat
a36174afdf test: search test failing because of stale data (#31098) 2022-05-23 15:12:11 +05:30
Ankush Menat
fa039b223e Merge pull request #31054 from marination/jc-excess-transfer-config
fix: Job Card excess transfer behaviour
2022-05-23 14:43:36 +05:30
Suraj Shetty
f2b6475626 Merge pull request #31092 from surajshetty3416/fix-rfq-template
fix(rfq): Use `<a>` directly and style it as button instead of using `<button>`
2022-05-23 11:56:17 +05:30
Sagar Sharma
6e5effc1b0 Merge branch 'develop' into subcontracting 2022-05-23 11:35:50 +05:30
Wolfram Schmidt
348a674df9 fix translation German "Designation" (#31082)
changed "Bezeichnung" to "Position" as the is more precice in the field of employment which erpnext refers to here
2022-05-23 11:23:12 +05:30
marination
9f6e10663b chore: Run _validate_over_transfer only if excess transfer is blocked in settings 2022-05-23 11:05:55 +05:30
Suraj Shetty
9e306bd250 Merge branch 'develop' into fix-rfq-template 2022-05-23 10:48:22 +05:30
Rucha Mahabal
34e238ce4f fix: Leave Encashment calculations (#31062) 2022-05-23 10:13:49 +05:30
Suraj Shetty
a29b92febc fix: Use directly <a> and style it as button instead of using button
Since few email servers (like outlook) strips out link in the button making them unclickable.
2022-05-23 10:08:20 +05:30
Vladislav
30c56bfe80 Update ru.csv 2022-05-22 14:04:24 +03:00
Ankush Menat
1a58b788e5 Merge branch 'develop' into jc-excess-transfer-config 2022-05-21 14:32:44 +05:30
Ankush Menat
3019f93915 Merge pull request #31083 from ankush/jc_corrective_creation
fix: corrective job card creation
2022-05-21 14:28:08 +05:30
Ankush Menat
66cf9aa344 fix: creation of corrective job card fails
This used to fail because sub_operations is a child table that's not
initalized by default till v13, in develop branch we init tables with
empty list.
2022-05-21 14:01:30 +05:30
Ankush Menat
e625394488 test: simplify job card tests 2022-05-21 14:01:28 +05:30
Sagar Sharma
07dc5f180d Merge branch 'develop' into subcontracting 2022-05-21 10:02:47 +05:30
ruthra kumar
dac678e3fc test: payment ledger entry 2022-05-20 18:21:47 +05:30
ruthra kumar
e888975007 refactor: link payment ledger with gl entry creation 2022-05-20 18:21:47 +05:30
ruthra kumar
59ed7c854d refactor: ignore linked Payment Ledger Entry in basic transactions 2022-05-20 18:21:47 +05:30
ruthra kumar
451cf3a937 refactor: helper class for ple creation and delinking
Helper functions for delinking ple and for creating payment ledger
entry for transactions on receivable/payable account types
2022-05-20 18:21:47 +05:30
ruthra kumar
7b1cb6711d refactor: include Payment ledger in accounting dimensions list 2022-05-20 18:21:47 +05:30
ruthra kumar
8e72f19bfb feat: patch to migrate gl entries to payment ledger 2022-05-20 18:21:47 +05:30
ruthra kumar
163085f201 feat: payment ledger doctype created 2022-05-20 18:21:47 +05:30
Deepesh Garg
8fd0b3b9f5 chore: Linting issues 2022-05-20 15:34:03 +05:30
Deepesh Garg
c41f9f046f fix(India): Async issue in company address trigger 2022-05-20 15:33:03 +05:30
Sagar Sharma
213113bc00 Merge branch 'develop' into subcontracting 2022-05-20 12:13:13 +05:30
Sagar Sharma
e9b28452e4 feat: SCR return 2022-05-20 10:45:34 +05:30
Sagar Sharma
323bdf85ce feat: SL and GL reposting 2022-05-20 10:45:34 +05:30
Sagar Sharma
fcc09592b9 refactor!: Stock Ledger Entry 2022-05-20 10:45:34 +05:30
Sagar Sharma
6c794afbe7 refactor!: Item Alternative 2022-05-20 10:45:34 +05:30
Sagar Sharma
92625902ad refactor!: BOM 2022-05-20 10:45:34 +05:30
Sagar Sharma
05f05ab75b refactor!: Subcontracted Item To Be Transferred 2022-05-20 10:45:33 +05:30
Sagar Sharma
3be663b121 refactor!: Subcontracted Item To Be Received 2022-05-20 10:45:33 +05:30
Sagar Sharma
8486bbf31a refactor!: Subcontract Order Summary 2022-05-20 10:45:33 +05:30
Sagar Sharma
3469560105 refactor!: Accounts Controller 2022-05-20 10:45:33 +05:30
Sagar Sharma
5fa3f58c06 refactor!: Purchase Invoice 2022-05-20 10:45:33 +05:30
Sagar Sharma
f09fc46059 refactor!: Purchase Receipt 2022-05-20 10:45:33 +05:30
Sagar Sharma
73484448f2 refactor!: Stock Entry 2022-05-20 10:45:33 +05:30
Sagar Sharma
34bda14b5b refactor!: Buying Controller 2022-05-20 10:45:33 +05:30
Sagar Sharma
dafaed3cbd refactor!: Purchase Order 2022-05-20 10:45:33 +05:30
Sagar Sharma
785d598762 test: SubcontractingReceipt 2022-05-20 10:45:33 +05:30
Sagar Sharma
8bc653b633 test: SubcontractingOrder 2022-05-20 10:45:33 +05:30
Sagar Sharma
574181f3d7 test: SubcontractingController 2022-05-20 10:45:33 +05:30
Sagar Sharma
70a1f40624 feat: New DocType "Subcontracting Receipt" 2022-05-20 10:45:33 +05:30
Sagar Sharma
3b17584bee feat: New DocType "Subcontracting Receipt Supplied Item" 2022-05-20 10:45:33 +05:30
Sagar Sharma
3daf62dce8 feat: New DocType "Subcontracting Receipt Item" 2022-05-20 10:45:33 +05:30
Sagar Sharma
409df263e8 refactor!: change "is_subcontracted" field type from "Select" to "Check" 2022-05-20 10:45:33 +05:30
Sagar Sharma
249726b845 feat: New DocType "Subcontracting Order" 2022-05-20 10:45:33 +05:30
Sagar Sharma
f49c51ab74 feat: New DocType "Subcontracting Order Supplied Item" 2022-05-20 10:45:33 +05:30
Sagar Sharma
f8b7594292 feat: New DocType "Subcontracting Order Item" 2022-05-20 10:45:33 +05:30
Sagar Sharma
dcac7eb67c feat: New DocType "Subcontracting Order Service Item" 2022-05-20 10:45:33 +05:30
Sagar Sharma
29a1cb89c2 feat: SubcontractingController 2022-05-20 10:45:33 +05:30
Sagar Sharma
68c21d9895 feat: Add fields "subcontracting_order" and "sco_rm_detail" in SE and SE Detail 2022-05-20 10:45:33 +05:30
Sagar Sharma
77db843692 refactor!: Make required changes to create SCO from PO 2022-05-20 10:45:30 +05:30
Deepesh Garg
3128f9603e fix: Loan repayment entries for payroll payable account 2022-05-20 08:31:37 +05:30
Deepesh Garg
5edd1dbb35 Merge pull request #31004 from ruthra-kumar/bug_payment_terms_status_rpt
fix: duplicate entries in payment terms report output
2022-05-20 07:53:40 +05:30
marination
90d4dc0cd6 fix: test_work_order_with_non_stock_item
- Use the right price list and currency to avoid rate conversion (1000/62.9), since rates are reset correctly now
- Use RM rate based on Price List in BOM. Non stock item has no valuation
2022-05-20 03:12:42 +05:30
marination
dd99c00eb6 fix: Get fresh RM rate in calculate_rm_cost 2022-05-19 21:48:24 +05:30
marination
9a7e9d902d perf: Use cached doc instead of get_doc
- Doc is only used to iterate over items(which wont change) and change rate/amount of rows
- These changes are inserted in db via `db_update`, so no harm
- Tested locally: refetching cached doc after db update, reflects fresh data.
2022-05-19 21:24:31 +05:30
Rucha Mahabal
7d4872aedd patch: set payroll entry status 2022-05-19 20:35:56 +05:30
Rucha Mahabal
ef8164f188 refactor: UX for Salary Slip creation and submission via Payroll Entry
- Add status for Queued/Failed

- log errors and show corrective actions in payroll entry
2022-05-19 20:33:55 +05:30
marination
9dc3083088 fix: Call calculate_cost for Draft BOM and typo in argument 2022-05-19 20:33:48 +05:30
marination
5932e9d78a fix: DB update child items, remove redundancy, fix perf
- Move `get_boms_in_bottom_up_order` in bom update tool’s file
- Remove repeated rm cost update from `update_cost`. `calculate_cost` handles RM cost update
- db_update children in `calculate_cost` optionally
- Don’t call `update_exploded_items` and regenerate exploded items in `update_cost`. They will stay the same (except cost)
2022-05-19 20:22:13 +05:30
Ankush Menat
6d6616dbcd fix: always update item_name for stock entry (#31068)
If item_name is already set and for some reason becomes outdated then
it's not updated in backend.

Fix: always set item_name and stock_uom when fetching item details
2022-05-19 14:25:47 +05:30
Ankush Menat
1de6b14d15 fix: remove "scrap %" field (#31069)
This does nothing, there's scrap items table below that's actually used
for specifying scrap.
2022-05-19 14:25:16 +05:30
Rucha Mahabal
81c82c8d53 fix(ux): inform the user about salary slip creation/submission happening in the background 2022-05-19 13:41:11 +05:30
marination
b6e46eea80 perf: get_boms_in_bottom_up_order
- Create child-parent map once and fetch value from child key to get parents
- Get parents recursively for a leaf node (get all ancestors)
- Approx. 44 secs for 4lakh 70k boms
2022-05-18 13:00:00 +05:30
Saqib Ansari
9fb7b49b43 fix(india): error while parsing e-invoice (#31053) 2022-05-18 11:53:00 +05:30
maharshivpatel
65d55ea8fa fix(india): eway bill cancel api is disabled (#31055) 2022-05-18 11:52:31 +05:30
Vladislav
fb586eb7c0 Update ru.csv 2022-05-18 00:02:25 +03:00
Vladislav
0843344119 Update ru.csv 2022-05-17 16:21:42 +03:00
marination
e07ce6efe0 fix: Job Card excess transfer behaviour
- Block excess transfer of items if not allowed in settings
- Behaviour made consistent with js behaviour (button disappears if not pending and not allowed in settings)
- Test for same case
2022-05-17 17:39:45 +05:30
Rucha Mahabal
28fe4f3d54 fix: unlink Attendance from Employee Checkins on cancellation (#31045) 2022-05-17 12:07:58 +05:30
Deepak
867f2c6282 fix: TypeError in add_indicator_for_multicompany (#31042)
Minor fix in add_indicator_for_multicompany

In case of multi-company transactions add (+) buttons in connection dashboard pf customer aren't being loaded due to TypeError (TypeError: e.dashboard.stats_area.removeClass is not a function) created by "frm.dashboard.stats_area.removeClass('hidden');" during the stats section creation.
2022-05-17 11:52:52 +05:30
Saqib Ansari
f915a9cef7 fix: discount ledger entry in case of multicurrency invoice (#31024) 2022-05-17 11:22:01 +05:30
barredterra
cad64f19b7 feat: show title field for Sales Taxes and Charges 2022-05-16 16:19:53 +02:00
barredterra
9553319d87 feat: show title field for Purchase Taxes and Charges 2022-05-16 16:19:32 +02:00
Ankush Menat
3714e36b44 fix: disable pricing rules for internal transfers (#31034)
* fix: disable pricing rules for internal transfers

* fix: only apply validation on internal transfers

Co-authored-by: Marica <maricadsouza221197@gmail.com>

* fix: internal_party_field undefined

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-05-16 18:09:14 +05:30
Marica
06c036f49f Merge pull request #30834 from ankush/transfer_precision
fix: precision loss when transferring
2022-05-16 16:00:06 +05:30
Ankush Menat
c3bfc395b7 chore: disable flaky test 2022-05-16 15:50:04 +05:30
Rucha Mahabal
1b7ce9649b fix: IN time not captured in Attendance through Employee Checkin (#31029) 2022-05-16 15:45:00 +05:30
Vladislav
af1eab5d54 fix(translations): Update ru translations (#30992)
* fix incorrect translation

* Update ru.csv

* Update ru.csv

* Update erpnext/translations/ru.csv

Co-authored-by: Marica <maricadsouza221197@gmail.com>

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-05-16 15:18:33 +05:30
Marica
eba1c89ba9 Merge pull request #31026 from ankush/item_attr_limit
fix: remove item attribute limit from variant selector
2022-05-16 14:10:11 +05:30
Marica
e3d53413d1 Merge pull request #31025 from ankush/hide_variants_order
fix: hide template items from sales/purchase order
2022-05-16 13:59:57 +05:30
Devin Slauenwhite
d76e1b7576 feat: barcode scanner promise to return scanned row. (#31018)
* feat: barcode scanner promise to return scanned row.

* fix: missing reject at alternate code path
2022-05-16 13:14:26 +05:30
Ankush Menat
6bd1cb9235 fix: remove item attribute limit from variant selector 2022-05-16 12:28:52 +05:30
Ankush Menat
0e875f5049 fix: hide template items from sales/purchase order 2022-05-16 12:14:07 +05:30
Deepesh Garg
a412d2f7e8 Merge pull request #31019 from frappe/mergify/bp/develop/pr-30978
fix: Multiple fixes in GST reporting (backport #30978)
2022-05-16 11:54:17 +05:30
Ankush Menat
80d959c579 fix: dont fail repost for recoverable errors (#30979)
recoverable erros:
1. timeout
2. lock/deadlocks
2022-05-16 11:23:35 +05:30
Deepesh Garg
65232edfd5 test: Update test cases 2022-05-16 10:52:58 +05:30
Deepesh Garg
b2d24e2f93 chore: Linting issues 2022-05-16 10:40:55 +05:30
Deepesh Garg
5b8726405d fix: Remove validation from Journal Entry 2022-05-15 21:10:52 +05:30
Deepesh Garg
8221852c38 Merge pull request #31010 from abhinavxd/fix-miniscule-penalty
fix: GL entry validation for minuscule loan penalty
2022-05-15 20:50:50 +05:30
Deepesh Garg
34de20f6ee Merge pull request #30987 from ankush/internal_transfer_with_margin
fix: prevent bypassing forced valuation rate
2022-05-15 20:49:55 +05:30
Deepesh Garg
f83e32ab64 chore: resolve conflicts 2022-05-15 20:43:47 +05:30
Deepesh Garg
9b6197ec4a chore: resolve conflicts 2022-05-15 20:42:34 +05:30
Deepesh Garg
03b133520b chore: Remove unintended changes
(cherry picked from commit 5b02b5b3cd)

# Conflicts:
#	erpnext/__init__.py
2022-05-15 15:04:23 +00:00
Deepesh Garg
4ca7a3de4e fix: Just add one rate in GST HSN Code
(cherry picked from commit ed76687dac)
2022-05-15 15:04:22 +00:00
Deepesh Garg
481752134f fix: Add validation for SEZ and Export invoices without payment of taxes
(cherry picked from commit cb8453dac8)
2022-05-15 15:04:21 +00:00
Deepesh Garg
5ac4bf9750 chore: Linting Issues
(cherry picked from commit 8af30bcc16)
2022-05-15 15:04:20 +00:00
Deepesh Garg
edb3ef7222 fix: UOM in HSN-wise summary of outward supply
(cherry picked from commit cd7d5cdb22)
2022-05-15 15:04:19 +00:00
Frappe PR Bot
c1f47d36cf chore(release): Bumped to Version 13.29.0
# [13.29.0](https://github.com/frappe/erpnext/compare/v13.28.0...v13.29.0) (2022-05-10)

### Bug Fixes

* Consider paryt and party type as well in group by consolidated view ([189fc89](189fc89e2d))
* disable form save on naming series tool ([#30909](https://github.com/frappe/erpnext/issues/30909)) ([#30910](https://github.com/frappe/erpnext/issues/30910)) ([d60a6cb](d60a6cb2f8))
* double future qty updates ([0db3013](0db3013c9b))
* HSN-wise-summary of outward supplies Updated Report ([3637525](363752510e))
* Ignore loan repayments made from salary slip ([b7e1d40](b7e1d40e43))
* **india:** invoice type for a debit note e-invoice ([#30948](https://github.com/frappe/erpnext/issues/30948)) ([c46add3](c46add3760))
* **india:** keyerror while generating e-way bill from an e-invoice ([#30879](https://github.com/frappe/erpnext/issues/30879)) ([98d799e](98d799e7cc))
* **india:** re-arrange e-way bill dialog fields ([#30941](https://github.com/frappe/erpnext/issues/30941)) ([7ce5c93](7ce5c93f44))
* Item Alternative Test ([964de1f](964de1fc69))
* patch for renaming membership settings ([#30929](https://github.com/frappe/erpnext/issues/30929)) ([9189653](9189653f2e))
* **pos:** creating pos returns resets pricing rules & discounts ([#30936](https://github.com/frappe/erpnext/issues/30936)) ([a0e39db](a0e39db200))
* remove check for already allocated earned leaves ([#30931](https://github.com/frappe/erpnext/issues/30931)) ([#30932](https://github.com/frappe/erpnext/issues/30932)) ([80f7d66](80f7d66255))
* Remove commit from stock entry test. The assertion is not important ([c449b35](c449b35cc1))
* Set available-for-use date if missing ([#30838](https://github.com/frappe/erpnext/issues/30838)) ([bf2eaec](bf2eaecb1d))
* show group warehouse in Sales Order ([#30891](https://github.com/frappe/erpnext/issues/30891)) ([#30893](https://github.com/frappe/erpnext/issues/30893)) ([c458e14](c458e14e68))
* Show linked time sheets in sales invoice dashboard ([4f4af52](4f4af523e0))
* sort before picking next stock reco ([e27fb58](e27fb58130))
* subtract change_amount from paid_amount field on POS Register ([#30937](https://github.com/frappe/erpnext/issues/30937)) ([b7e873b](b7e873b55d))
* Unlink and delete batch created from stock reco on cancel ([fc35323](fc35323106))
* Wrap SLE actual_qty in `flt` to avoid NoneType operation ([d53228b](d53228b153))

### Features

* **HR:** Leave Type configuration to allow over allocation (backport [#30940](https://github.com/frappe/erpnext/issues/30940)) ([#30944](https://github.com/frappe/erpnext/issues/30944)) ([64440fc](64440fc4fb))
* **india:** cancel e-way bill is enabled with e-invoicing APIs. ([#30924](https://github.com/frappe/erpnext/issues/30924)) ([4ef2ffd](4ef2ffd14c))
* **india:** generate qrcode button for e-invoice ([#30946](https://github.com/frappe/erpnext/issues/30946)) ([7bd5b2b](7bd5b2ba29))
* **india:** store e-way bill auto calculated distance in sales invoice ([#30923](https://github.com/frappe/erpnext/issues/30923)) ([b96f156](b96f1565c5))

(cherry picked from commit 7369db59aa)

# Conflicts:
#	erpnext/__init__.py
2022-05-15 15:04:18 +00:00
Frappe PR Bot
b3964ee35b chore(release): Bumped to Version 13.28.0
# [13.28.0](https://github.com/frappe/erpnext/compare/v13.27.1...v13.28.0) (2022-05-03)

### Bug Fixes

* Consistent accounting dimensions across Sales and Purchase docs ([5df5058](5df50588cf))
* convert default_item_manufacturer to link field ([#30835](https://github.com/frappe/erpnext/issues/30835)) ([#30866](https://github.com/frappe/erpnext/issues/30866)) ([37fad7e](37fad7e04c))
* Cost center filter on payment reconciliation ([22e7f03](22e7f03a03))
* filters not working in Shift Assignment Calendar view ([#30822](https://github.com/frappe/erpnext/issues/30822)) ([3cdbb65](3cdbb65b5a))
* Ignore custom field validation while setup ([ee54bf7](ee54bf7fe2))
* **india:** e-invoice generation for registered composition gst category type ([#30814](https://github.com/frappe/erpnext/issues/30814)) ([#30877](https://github.com/frappe/erpnext/issues/30877)) ([246869d](246869dd28))
* Multi currency opening invoices ([2e62d51](2e62d518e8))
* payment days calculation for employees joining/leaving mid-month ([#30863](https://github.com/frappe/erpnext/issues/30863)) ([#30883](https://github.com/frappe/erpnext/issues/30883)) ([a1b0813](a1b0813966))
* Period Closing Voucher is considering GL entries with is_cancelled=1 ([#30865](https://github.com/frappe/erpnext/issues/30865)) ([5a5b49b](5a5b49b61a))
* **pos:** number pad translations ([b01f855](b01f8555e5))
* **pos:** search field doesn't reset on checkout ([edbf551](edbf5513da))
* Supply type for overseas invoices with payment of tax ([fdcc591](fdcc591a5e))
* supply type for sez invoices with payment of tax ([cf08710](cf087103cb))
* Use `account_type == 'Stock'` to filter stock accounts ([93482f3](93482f3302))
* **UX:** misleading stock entry lables ([#30870](https://github.com/frappe/erpnext/issues/30870)) ([#30871](https://github.com/frappe/erpnext/issues/30871)) ([57b03f0](57b03f0bf2))
* **UX:** record reason for skipping attendance or marking absent for auto attendance ([#30846](https://github.com/frappe/erpnext/issues/30846)) ([f7bf4a3](f7bf4a3e62))
* Vat Audit report fixes ([d5319a4](d5319a4826))

### Features

* Copy task color from project template (backport [#30857](https://github.com/frappe/erpnext/issues/30857)) ([#30859](https://github.com/frappe/erpnext/issues/30859)) ([7ee18e8](7ee18e86a2))
* support product bundles in picklist (backport [#30762](https://github.com/frappe/erpnext/issues/30762)) ([#30826](https://github.com/frappe/erpnext/issues/30826)) ([645ee2d](645ee2d822))

(cherry picked from commit 8cc2ea0ddb)

# Conflicts:
#	erpnext/__init__.py
2022-05-15 15:04:17 +00:00
Frappe PR Bot
e66aab77cb chore(release): Bumped to Version 13.27.1
## [13.27.1](https://github.com/frappe/erpnext/compare/v13.27.0...v13.27.1) (2022-04-26)

### Bug Fixes

* Add accounting dimensions for round off GL Entry ([dedb90e](dedb90ea72))
* batch_no filtering not working when batch no is also a number in scientific notation ([#30770](https://github.com/frappe/erpnext/issues/30770)) ([#30771](https://github.com/frappe/erpnext/issues/30771)) ([c339305](c339305e9c))
* Check if accounting dimension exists ([1834671](1834671d59))
* dependent gle reposting (backport [#30726](https://github.com/frappe/erpnext/issues/30726)) ([#30772](https://github.com/frappe/erpnext/issues/30772)) ([a6d0938](a6d0938591))
* Do not validate while creating accounting dimension ([153b41a](153b41a269))
* e_commerce_settings.js ([3a5f5d5](3a5f5d5cd0))
* e_commerce_settings.py ([86c5f4d](86c5f4db85))
* First preference to parent cost center rather than round off cost center ([a2d95fc](a2d95fc62b))
* Handle Multiselect field mapping separately ([dc2f694](dc2f694547))
* **india:** 401 & 403 client error while generating IRN ([198bdcf](198bdcfdc6))
* **india:** cess value not considered while validating e-invoice totals ([#30800](https://github.com/frappe/erpnext/issues/30800)) ([f70fca1](f70fca1c9e))
* **india:** transporter name is null while generating e-way bill ([#30736](https://github.com/frappe/erpnext/issues/30736)) ([6291b28](6291b28c37))
* linter ([6dddbb9](6dddbb9f27))
* Loan doctypes in bank reconciliation ([e69c715](e69c71576d))
* Mistyped variable name in patch ([e76220e](e76220e819))
* monthly attendance sheet ([#30748](https://github.com/frappe/erpnext/issues/30748)) ([0b4e3f1](0b4e3f1467))
* Must not be able to start Job Card if it is related to Work Order that is not started yet ([#29072](https://github.com/frappe/erpnext/issues/29072)) ([#30755](https://github.com/frappe/erpnext/issues/30755)) ([b656ffa](b656ffa45e))
* Query filter fields from Website Item instead of Item master ([bed9e09](bed9e09153))
* select doctype as payment_document ([44f0b69](44f0b69152))
* **Selling,E-Commerce:** Shopping cart quotation without website item. ([#29085](https://github.com/frappe/erpnext/issues/29085)) ([ea0fe5e](ea0fe5e10c))
* SO analysis rpt will fetch SO's without Delivery note as well ([f9d89c7](f9d89c7ce6))
* translation ([#30781](https://github.com/frappe/erpnext/issues/30781)) ([#30783](https://github.com/frappe/erpnext/issues/30783)) ([8335ca6](8335ca6331))
* Update token to allow updates on protected branch ([baab379](baab3797ca))
* update translation ([#30725](https://github.com/frappe/erpnext/issues/30725)) ([#30776](https://github.com/frappe/erpnext/issues/30776)) ([b585262](b585262842))
* Use parent cost center for Sales and Purchase Invoice ([fe9f329](fe9f32946c))
* Use right precision for asset value after full schedule ([#30745](https://github.com/frappe/erpnext/issues/30745)) ([269e192](269e1923c9))
* Validate field filter wrt to Website Item & re-use validation in Item Group ([34437a8](34437a83df))

(cherry picked from commit 096dcf0e54)

# Conflicts:
#	erpnext/__init__.py
2022-05-15 15:04:17 +00:00
Deepesh Garg
c6b98d8de9 fix: Multiple fixes in GSTR-1 report
(cherry picked from commit f2cbb70325)

# Conflicts:
#	erpnext/regional/report/gstr_1/gstr_1.py
2022-05-15 15:04:16 +00:00
Deepesh Garg
a8da657f81 Merge branch 'develop' into fix-miniscule-penalty 2022-05-14 21:36:27 +05:30
Deepesh Garg
1ff8b06da3 Merge pull request #31015 from rohitwaghchaure/multi-select-accounting-dimenssions
feat: select multiple values for accounting dimension
2022-05-14 21:13:40 +05:30
hrzzz
3c35c9b6ae fix: correction of the calculation to the average value when there is a discount on the document and not on the items 2022-05-14 10:45:26 -03:00
Rohit Waghchaure
69be22ba7c fix: select multiple values for accounting dimenssion 2022-05-14 17:19:34 +05:30
Rucha Mahabal
ead08aa192 Merge pull request #31013 from ruchamahabal/hr-reports-emp-status
feat: add Employee Status filter in leave balance reports
2022-05-13 22:07:08 +05:30
Rucha Mahabal
260cfa5d1e test: employee status filter in leave balance reports 2022-05-13 21:02:09 +05:30
Rucha Mahabal
08fb9a4318 fix: translation for status filter 2022-05-13 20:44:35 +05:30
Rucha Mahabal
ed8a49737a feat: add Employee Status filter in leave balance reports 2022-05-13 20:23:32 +05:30
Rucha Mahabal
3016ed958e fix(Employee Advance): Return/Deduction from Salary button visibility (#31011) 2022-05-13 20:01:14 +05:30
Ankush Menat
86df7f835a fix: move healthcare patch to post_model_sync (#31008)
[skip ci]
2022-05-13 18:15:34 +05:30
Abhinav Raut
589dd17e58 fix: precision of total penalty paid 2022-05-13 17:56:27 +05:30
Abhinav Raut
9a86885c0a fix: precision of total penalty paid 2022-05-13 17:55:16 +05:30
Abhinav Raut
aef65e7417 fix: gl entry validation for miniscule loan penalty 2022-05-13 17:22:26 +05:30
Ankush Menat
3263ecf54c test: check translation files (#31006) 2022-05-13 16:38:04 +05:30
HarryPaulo
328b1b54d9 fix: payments duplicate on pos closing entry (#30976) 2022-05-13 15:06:02 +05:30
Ankush Menat
b0c10102de chore: update FR template
[skip ci]
2022-05-13 14:35:51 +05:30
ruthra kumar
e826093150 fix: multiple entries for same payment term 2022-05-13 14:24:06 +05:30
Deepesh Garg
54d6cf18fc fix: Item rate reset on changing posting date (#30990)
* fix: Item rate reset on changing posting date

* chore: Remove debugger
2022-05-13 13:07:23 +05:30
Marica
9a2b11f05f Merge pull request #30911 from alyf-de/de-translate-employee
fix: German translations for Employee doctype
2022-05-13 12:23:13 +05:30
Marica
38e0105125 Merge pull request #30818 from Havenir/feat-request-for-quotation
feat: request_for_quotation - show supplier name
2022-05-13 12:16:23 +05:30
Wolfram Schmidt
c4a2778359 chore: added RFQ Link to Opportunity Dashboard (#30894)
added Link to Dashboard

added backlink to Request for Quotation in the Quotation dashboard for transparency and ease of navigation.
2022-05-13 12:01:52 +05:30
Wolfram Schmidt
0bbed414f8 feat: add Link to Opportunity (#30614)
Adding Link to Opportunity

Following the process of Opportunity to Quotation I added a section and link field to Opportunity for a backlink when using "create"-> Request for Quotation from Opportunity.
2022-05-13 11:59:45 +05:30
Ankush Menat
b08180092e fix(patch): avoid checking for return field if it doesnt exits (#30995)
fix(patch): avoid checking for qty field if it doesnt exits
2022-05-13 11:55:47 +05:30
Saqib Ansari
319c858d63 Merge pull request #30968 from nextchamp-saqib/validate-on-hold-invs
fix(accounts): minor fixes & validations
2022-05-12 22:06:35 +05:30
Ankush Menat
ee0a277540 fix: prevent bypassing forced valuation rate
if you edit "margin_rate_or_amount" after saving DN then based on
selected margin the rate gets updated which isn't valuation rate.
2022-05-12 19:01:26 +05:30
Deepesh Garg
33d9767382 Merge branch 'develop' of https://github.com/frappe/erpnext into party_account_currency_check 2022-05-12 16:40:29 +05:30
Ankush Menat
cb8cd7f5bc chore: stale bot - increase # of days for issues
[skip ci]
2022-05-12 15:45:19 +05:30
Deepesh Garg
39fad39540 Merge pull request #30983 from frappe/mergify/bp/develop/pr-30982
fix: Failing accounting dimension patch (backport #30982)
2022-05-12 15:28:15 +05:30
Deepesh Garg
b13698a1d5 fix: Failing accounting dimension patch
(cherry picked from commit b14a7b8a5d)
2022-05-12 09:27:40 +00:00
Marica
5b8c7438cc Merge pull request #30945 from ankush/stock_analytics_fix
fix: stock analytics report shows incorrect data there's no stock movement in a period
2022-05-12 12:26:54 +05:30
Saqib Ansari
6c16422beb test: sales_invoice_with_disabled_account 2022-05-12 12:05:53 +05:30
Saqib Ansari
92613777b9 test: payment_entry_against_onhold_purchase_invoice 2022-05-12 11:17:36 +05:30
Ankush Menat
b1c90e9949 fix: stock transfer value when precision differs 2022-05-12 11:09:30 +05:30
Marica
3d96ad2afa Merge pull request #30950 from marination/actual-qty-total-js-reactive
fix: Set actual qty and basic rate in SE on warehouse triggers (`get_warehouse_details`)
2022-05-11 20:13:54 +05:30
Ankush Menat
2d9b7a48ca Merge pull request #30832 from dj12djdjs/feat-picklist-scan
feat(stock): Proposed Pick List Scan
2022-05-11 19:38:37 +05:30
Ankush Menat
861d4b856c chore: bump ecma version
we transpile to es2017, so allow use of es2020
2022-05-11 19:32:51 +05:30
Ankush Menat
ab80783e3a refactor: single function to fetch related row
There was separate function for batch row which frequently didn't
receive all the love main function received like:
1. empty row reuse
2. max qty validation

Hence it makes sense to combine these in one fat function
2022-05-11 19:27:16 +05:30
Ankush Menat
2f1d118f36 fix: disable serial no scanning for picklist
Current design of picklist doc doesn't have "picked serial no" so it
doesn't make much sense to scan it. Instead it should increment qty
only. Might add this in future after fixing UX problems
2022-05-11 18:56:22 +05:30
Ankush Menat
d35a13ec7e refactor: change alert duration to 3 and modern js 2022-05-11 18:52:14 +05:30
Ankush Menat
7f14222700 docs: document barcode_scanner API 2022-05-11 18:45:31 +05:30
Ankush Menat
372d2d870e fix: better message for picked qty shortfall 2022-05-11 18:43:10 +05:30
Ankush Menat
d3121fd845 fix(UX): hide scan section for non-draft docs 2022-05-11 18:40:44 +05:30
Ankush Menat
a4f0be6c5e Merge branch 'develop' into feat-picklist-scan 2022-05-11 18:38:53 +05:30
Marica
d024f72ab8 Merge branch 'develop' into actual-qty-total-js-reactive 2022-05-11 18:02:20 +05:30
marination
4fa15b50ca test: Test for mapped SE and fix for failing tests
- Remove `set_missing_values` from mapper util function since a lot of item data is set after this function is run
- `split_batch` can skip `set_missing_values` since no warehouses are set on mapping and relies on user input
2022-05-11 17:58:48 +05:30
Sagar Sharma
1a70701eca fix: per_billed for return DN (#30868)
* fix: per_billed for return DN

* chore: move patch from v14 to v13
2022-05-11 16:49:28 +05:30
Vladislav
40d2f94abd chore: incorrect translation (#30966) 2022-05-11 16:26:48 +05:30
Ankush Menat
60eede0f68 Merge pull request #30969 from ankush/fifo_queue_report
chore: fifo queue vs qty after transaction comparison report
2022-05-11 15:12:13 +05:30
marination
90a8e924f5 fix: set_missing_values in SE and re-use the same on all SE mappings
- `set_missing_values` in SE will set actual qty, transfer qty and calculate rate/amount
- Re-use `set_missing_values` wherever SE is doc is being mapped
2022-05-11 14:54:22 +05:30
Ankush Menat
f6d6463a33 chore: fifo queue vs qty after transaction comparison report 2022-05-11 14:43:03 +05:30
Saqib Ansari
95b059a98c fix: validate disabled accounts before posting ledger entries 2022-05-11 13:26:15 +05:30
Saqib Ansari
a1e3ae8869 fix: user can select disabled accounts in taxes table 2022-05-11 13:01:06 +05:30
Saqib Ansari
b0f302e579 fix: validate on hold purchase invoices in payment entry 2022-05-11 12:42:35 +05:30
Ankush Menat
e2e0700499 Merge pull request #30962 from marination/update-items-zero-qty
fix: Block 0 Qty via Update Items to be consistent with form validation
2022-05-11 12:41:40 +05:30
Marica
061cd3220f Merge branch 'develop' into update-items-zero-qty 2022-05-11 11:42:39 +05:30
Raffael Meyer
195e8af985 Merge branch 'develop' into de-translate-employee 2022-05-10 15:57:40 +02:00
marination
0c9154389b fix: Block 0 Qty via Update Items to be consistent with form validation 2022-05-10 18:09:07 +05:30
Ankush Menat
15fdc1cf7f Merge pull request #30958 from gavindsouza/dashboard-chart-fixes
fix(charts): Pass fieldtype for chart data in selling reports
2022-05-10 17:40:01 +05:30
Gavin D'souza
7bf0e4f8e5 fix(charts): Pass fieldtype for chart data in selling reports 2022-05-10 15:58:31 +05:30
Ankush Menat
198b91f8d4 fix: only carry-forward balances till today's period
Showing data in future doesn't make sense. Only carry-forward till last
bucket that contains today's day.
2022-05-10 15:38:02 +05:30
Ankush Menat
287b255ad6 fix: batch_no doesn't maintain qty_after_transaction 2022-05-10 15:38:02 +05:30
Ankush Menat
6ab0046e9c fix: consider previous balance is missing
Also remove `total`, total of total is a meaningless value.
2022-05-10 15:38:02 +05:30
Ankush Menat
d81422fb58 test: basic test for stock analytics report 2022-05-10 15:38:02 +05:30
Ankush Menat
d25841369d Merge pull request #30913 from ankush/against_voucher_processing
fix: double future qty updates
2022-05-10 14:46:37 +05:30
marination
494ddd1eb4 fix: Calculate totals even though pricing rule is not applied on mapped doc
- `apply_pricing_rule` is triggered due to change in some data which most likely contributes to Total.
2022-05-10 14:02:43 +05:30
Saqib Ansari
8dd046cc51 fix(india): invoice type for a debit note e-invoice (#30948) 2022-05-10 13:39:41 +05:30
Ankush Menat
3b6752dc8b Merge pull request #30938 from rohitwaghchaure/formatting-for-to-discuss-field
fix: allow to use formatting for the field to_discuss in opportunity
2022-05-10 12:10:42 +05:30
Saqib Ansari
cf13a20438 feat(india): generate qrcode button for e-invoice (#30939) 2022-05-10 12:07:47 +05:30
Rohit Waghchaure
3f41cb762d fix: allow to use formatting for the field to_discuss in opportunity 2022-05-10 11:47:01 +05:30
Rucha Mahabal
51fcbe5826 feat(HR): Leave Type configuration to allow over allocation (#30940) 2022-05-09 21:29:58 +05:30
Ankush Menat
f047fa1aa8 Merge pull request #30942 from frappe/mergify/bp/develop/pr-30869
fix: Unlink and delete batch created from stock reco on cancel  (backport #30869)
2022-05-09 19:38:03 +05:30
Ankush Menat
05dd1d6d15 refactor: tax rule validity query (#30934) 2022-05-09 19:26:13 +05:30
marination
a65b20d976 style: Spaces to Tabs
(cherry picked from commit a2fff8741e)
2022-05-09 13:32:45 +00:00
marination
9fd673e498 fix: Remove commit from stock entry test. The assertion is not important
(cherry picked from commit c449b35cc1)
2022-05-09 13:32:44 +00:00
marination
64f3b4d68b fix: Wrap SLE actual_qty in flt to avoid NoneType operation
- Since Batch cancellation SLEs do not set qtys (will fix separately), `merge_similar_entries` gets `actual_qty` as None
- This causes NoneType operation error on tests that cancel batch-serial reco
- Modified tests to avoid using commit and rollback explicitly

(cherry picked from commit d53228b153)
2022-05-09 13:32:43 +00:00
marination
de3d90c5ab fix: Item Alternative Test
(cherry picked from commit 964de1fc69)
2022-05-09 13:32:42 +00:00
marination
14ea40d270 chore: Tests for Stock Reconciliation
(cherry picked from commit 5bc5af1066)
2022-05-09 13:32:41 +00:00
marination
3bc3cf34eb chore: Tests for Stock Entry
(cherry picked from commit a144548db9)
2022-05-09 13:32:40 +00:00
marination
577df1753e fix: Unlink and delete batch created from stock reco on cancel
(cherry picked from commit fc35323106)
2022-05-09 13:32:37 +00:00
maharshivpatel
e5ebbf4799 fix(india): re-arrange e-way bill dialog fields (#30920) 2022-05-09 18:20:20 +05:30
HarryPaulo
ebbe27c183 fix: subtract change_amount from paid_amount field on POS Register (#30922) 2022-05-09 15:14:57 +05:30
Saqib Ansari
867494edad fix(pos): creating pos returns resets pricing rules & discounts (#30935) 2022-05-09 15:05:05 +05:30
Deepesh Garg
dbb37aefae Merge pull request #30926 from frappe/mergify/bp/develop/pr-30065
fix: HSN-wise-summary of outward supplies Updated Report (backport #30065)
2022-05-09 13:21:58 +05:30
Ankush Menat
7e2fbc050a fix: sort before picking next stock reco 2022-05-09 13:16:02 +05:30
marination
1ce45f623e fix: Set actual qty and basic rate in SE on warehouse triggers (get_warehouse_details)
- set `actual_qty` on source and target warehouse change
2022-05-09 13:00:00 +05:30
Rucha Mahabal
f92bc4dd33 fix: remove check for already allocated earned leaves (#30931)
* fix: remove check for already allocated earned leaves

* fix: do not set New Leaves Allocated field as read-only for earned leaves

- removing this until there's a better way to update existing allocations
2022-05-09 12:15:02 +05:30
Ankush Menat
ae842d8145 chore: remove datettime formatting from debug report
This hides some information that would otherwise help during debugging
2022-05-09 11:29:00 +05:30
Ankush Menat
7c839c4503 fix: double future qty updates
update_qty_in_future_sle is reprocessing rows which are already
processed by process_sle_against_current_voucher
2022-05-09 11:28:21 +05:30
Deepesh Garg
c9f6405b2a chore: Resolve conflicts 2022-05-09 10:33:03 +05:30
Deepesh Garg
b3d5c74df5 Merge branch 'develop' of https://github.com/frappe/erpnext into mergify/bp/develop/pr-30065 2022-05-09 10:21:46 +05:30
Ankush Menat
95e41b0d48 chore: correct version in hooks
[skip ci]
2022-05-08 22:04:14 +05:30
Deepesh Garg
85c137b3aa chore: Remove print statement
(cherry picked from commit a8fbd2451b)
2022-05-08 14:07:00 +00:00
Deepesh Garg
3ae4b9033f chore: Remove extra columns
(cherry picked from commit b0e929b8ae)

# Conflicts:
#	erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
2022-05-08 14:07:00 +00:00
Govind S Menokee
d99b4e29b9 fix: HSN-wise-summary of outward supplies Updated Report
Report changes done in order to meet the specification as per govt guideline - [GUIDELINE](https://taxguru.in/goods-and-service-tax/12-points-note-filing-gstr-1-01st-2021-onwards.html)

(cherry picked from commit 363752510e)

# Conflicts:
#	erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
2022-05-08 14:06:58 +00:00
maharshivpatel
b8dc40b7a0 feat(india): cancel e-way bill is enabled with e-invoicing APIs. (#30888) 2022-05-07 18:59:27 +05:30
maharshivpatel
b825179286 feat(india): store e-way bill auto calculated distance in sales invoice (#30908) 2022-05-07 18:46:12 +05:30
Raffael Meyer
f3ad4f3c3b Merge branch 'develop' into de-translate-employee 2022-05-06 19:57:42 +02:00
Rucha Mahabal
7f1024f8aa feat(minor): fetch default salary structure and base from Employee Grade in Salary Structure Assignment (#30918) 2022-05-06 17:44:30 +05:30
Deepesh Garg
c05144fb60 Merge pull request #30897 from deepeshgarg007/general_ledger_consolidated
fix: Consider party and party type as well in group by consolidated view
2022-05-06 13:10:00 +05:30
Deepesh Garg
f255741b16 Merge pull request #30855 from Altizo/develop
fix: update translate
2022-05-06 13:04:24 +05:30
Deepesh Garg
d5dca69090 Merge pull request #30901 from alyf-de/translate-party
feat(German Translation)!: translate "Party" as "Partei"
2022-05-06 13:02:27 +05:30
Deepesh Garg
cf4128edba Merge pull request #30900 from alyf-de/bank-account-website
feat: remove website from bank account
2022-05-06 13:01:28 +05:30
Ahmad
458f2fcd62 Merge branch 'develop' into feat-request-for-quotation 2022-05-06 11:54:07 +05:00
maharshivpatel
ee7a7eb782 fix(india): keyerror while generating e-way bill from an e-invoice (#30879) 2022-05-06 11:23:16 +05:30
barredterra
02b38a439f fix: german translations for Employee 2022-05-05 20:37:51 +02:00
Devin Slauenwhite
e9cf5cb4b0 feat: add prompt qty flag to pick list 2022-05-05 10:47:06 -04:00
Devin Slauenwhite
0a77c28594 fix: cast value to Number type 2022-05-05 10:46:40 -04:00
Devin Slauenwhite
47b4251844 feat: prompt qty on scan 2022-05-05 09:39:19 -04:00
Ankush Menat
f31122cbc3 fix: disable form save on naming series tool (#30909) 2022-05-05 17:35:58 +05:30
Ankush Menat
ad7c113c0d test: activation 2022-05-05 11:02:23 +05:30
Aditya Hase
912c1d0a1b chore: Remove reference to Instructor doctype (#30903)
References:
https://github.com/frappe/erpnext/pull/30830
44c54f69f8
2022-05-05 10:40:42 +05:30
Ankush Menat
d48ab81622 fix: auto-fulfill picking list when not in scan mode 2022-05-04 12:43:31 -04:00
Devin Slauenwhite
7ae89dedd5 fix: cleanup dont_allow_new_row logic 2022-05-04 11:06:16 -04:00
Devin Slauenwhite
5560ceca62 fix: max qty message
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-05-04 10:32:21 -04:00
Devin Slauenwhite
4a19c1c19d Revert "fix(test): manually select picked_qty since before_submit validates qty instead of auto filling it"
This reverts commit c2335ec0
2022-05-04 10:29:52 -04:00
Deepesh Garg
826c3f5c63 Merge pull request #30899 from deepeshgarg007/timesheet_link
fix: Show linked time sheets in sales invoice dashboard
2022-05-04 19:54:06 +05:30
barredterra
5435da6d2b feat(German Translation): translate "Party" as "Partei" 2022-05-04 16:20:20 +02:00
barredterra
f1b8a969cf feat: remove website from bank account 2022-05-04 15:51:52 +02:00
Deepesh Garg
3e38dc7ea8 fix: Show linked time sheets in sales invoice dashboard 2022-05-04 17:30:52 +05:30
Deepesh Garg
c2d52a1ac0 fix: Consider paryt and party type as well in group by consolidated view 2022-05-04 15:59:24 +05:30
Deepesh Garg
8535ad46e9 Merge pull request #30882 from fproldan/issue_25414
fix: "Supplier Quotation Comparison" - Tools - Select Default Supplier
2022-05-04 14:23:17 +05:30
Ankush Menat
91cd5f5d4a fix: show group warehouse in Sales Order (#30891) 2022-05-04 13:07:58 +05:30
Deepesh Garg
564f5b2394 Merge pull request #30890 from frappe/mergify/bp/develop/pr-30884
fix: Ignore loan repayments made from salary slip (backport #30884)
2022-05-04 10:19:36 +05:30
Deepesh Garg
e8d6eb207d fix: Ignore loan repayments made from salary slip
(cherry picked from commit b7e1d40e43)
2022-05-04 04:15:07 +00:00
Devin Slauenwhite
5d8e3f264c Merge branch 'feat-picklist-scan' of /home/devin/repos/erpnext into feat-picklist-scan 2022-05-03 16:28:54 -04:00
Devin Slauenwhite
c2335ec0d8 fix(test): manually select picked_qty since before_submit validates qty instead of auto filling it 2022-05-03 16:28:28 -04:00
Francisco Roldán
5604dccdb6 Merge branch 'develop' into issue_25414 2022-05-03 13:27:10 -03:00
Devin Slauenwhite
afb841c771 Merge branch 'develop' into feat-picklist-scan 2022-05-03 11:15:42 -04:00
Deepesh Garg
1b285cf662 Merge pull request #30820 from deepeshgarg007/erpnext_setup_cleanup
chore: Remove domains from setup wizard
2022-05-03 20:05:52 +05:30
Deepesh Garg
322f0db1e9 chore: Resolve conflicts 2022-05-03 18:28:50 +05:30
Deepesh Garg
2e3e666784 Merge branch 'develop' of https://github.com/frappe/erpnext into erpnext_setup_cleanup 2022-05-03 18:17:36 +05:30
Francisco Roldán
288e2258f6 Merge branch 'develop' into issue_25414 2022-05-03 08:48:30 -03:00
Rucha Mahabal
924cf7763e fix: payment days calculation for employees joining/leaving mid-month (#30863) 2022-05-03 11:27:25 +05:30
Francisco Roldan
26654e5e29 fix: supplier quotation comparission report button 2022-05-02 21:07:54 -03:00
Francisco Roldán
62225e0956 Merge pull request #174 from frappe/develop
Fetch upstream
2022-05-02 20:44:38 -03:00
Devin Slauenwhite
6cc83d658b Merge branch 'feat-picklist-scan' of github.com:dj12djdjs/erpnext into feat-picklist-scan 2022-05-02 17:20:48 -04:00
maharshivpatel
80a13c38bc fix(india): e-invoice generation for registered composition gst category type (#30814) 2022-05-02 21:51:27 +05:30
Saqib Ansari
2b354270eb Merge pull request #30875 from deepeshgarg007/supply_type_einvoice
fix(India): Supply type for overseas invoices with payment of tax
2022-05-02 21:49:52 +05:30
Saqib Ansari
c8aa77285e fix: supply type for sez invoices with payment of tax 2022-05-02 21:15:54 +05:30
Deepesh Garg
d7cb269e0c fix: Supply type for overseas invoices with payment of tax 2022-05-02 19:23:43 +05:30
Ahmad
04c96b547e feat: request_for_quotation - refactor
- Set supplier as link in while selecting supplier to create quotation
2022-05-02 18:05:21 +05:00
Deepesh Garg
f8db6f0ac5 Merge pull request #30872 from frappe/mergify/bp/develop/pr-30852
fix: Vat Audit report fixes (backport #30852)
2022-05-02 17:59:10 +05:30
Deepesh Garg
e0fd980bcc Merge pull request #30848 from deepeshgarg007/cost_center_filter_p_r
fix: Cost center filter in payment reconciliation
2022-05-02 17:58:45 +05:30
Deepesh Garg
a31f577c9e fix: Vat Audit report fixes
(cherry picked from commit d5319a4826)
2022-05-02 10:44:37 +00:00
Deepesh Garg
b440dabe12 test: Add test for payment reconciliation 2022-05-02 16:09:48 +05:30
Ankush Menat
59a5090843 fix(UX): misleading stock entry lables (#30870)
* fix(UX): misleading stock entry lables

* chore: field labels

[skip ci]

Co-authored-by: Marica <maricadsouza221197@gmail.com>

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-05-02 15:11:14 +05:30
Rushabh Mehta
548afba8bb fix(minor): update frappe.error_log to new API (#30864)
* fix(minor): update frappe.error_log to new API

* refactor: changes for updated log_error api

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-05-02 15:04:26 +05:30
Ankush Menat
dcda55641b fix: convert default_item_manufacturer to link field (#30835) 2022-05-02 13:58:22 +05:30
Ankush Menat
bdd55f07f4 Merge pull request #30830 from deepeshgarg007/education_sepration
refactor!: Remove education domain from ERPNext
2022-05-02 13:20:01 +05:30
Ankush Menat
f0049da284 chore: correct link 2022-05-02 11:52:46 +05:30
Ankush Menat
bae8ab2fa9 Merge branch 'develop' into education_sepration 2022-05-02 11:47:37 +05:30
sersaber
b8a9f821a4 feat: Copy task color from project template (#30857)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-05-02 10:29:43 +05:30
Rushabh Mehta
04d56fbb8d Merge pull request #30858 from rmehta/fix-account-dim-patch-again
fix(minor): accounting dimension patch
2022-05-02 09:42:28 +05:30
Rushabh Mehta
be0f84a722 fix(minor): fix create_accounting_dimensions_in_orders.py 2022-05-02 09:41:12 +05:30
Deepesh Garg
6a953d9297 Merge pull request #30806 from deepeshgarg007/accounting_dimension_consistency
fix: Consistent accounting dimensions across Sales and Purchase docs
2022-05-01 22:02:41 +05:30
Deepesh Garg
fc09c90af7 Merge branch 'develop' into accounting_dimension_consistency 2022-05-01 22:02:10 +05:30
Deepesh Garg
15237fd747 Merge pull request #30854 from rmehta/fix-discount-accounting-patch
fix(minor): discount accounting patch
2022-05-01 15:22:45 +05:30
Rushabh Mehta
d746db5547 fix(minor): discount accounting patch 2022-05-01 12:25:21 +05:30
Vlad
5eddaddf74 fix: update translate 2022-04-30 21:47:34 +03:00
Deepesh Garg
19d66e5219 Merge branch 'develop' of https://github.com/frappe/erpnext into accounting_dimension_consistency 2022-04-30 22:15:27 +05:30
Deepesh Garg
c7edc29152 Merge branch 'develop' of https://github.com/frappe/erpnext into cost_center_filter_p_r 2022-04-30 22:11:43 +05:30
Deepesh Garg
54d16de849 Merge pull request #30815 from deepeshgarg007/uae_setup_cleaup
fix: Ignore custom field validation while setup
2022-04-30 22:03:21 +05:30
Deepesh Garg
bfd053ed23 Merge branch 'develop' into uae_setup_cleaup 2022-04-30 19:54:40 +05:30
Devin Slauenwhite
5ff471e22f fix: linter 2022-04-29 16:39:33 -04:00
Devin Slauenwhite
fa1378dd49 fix: prevent user from proceeding without all qty picked. 2022-04-29 16:38:52 -04:00
Devin Slauenwhite
5f8f83c6d8 fix: warn user pick list is not complete instead of auto fulfilling picked_qty. 2022-04-29 16:28:49 -04:00
Devin Slauenwhite
48128911be fix: syntax 2022-04-29 16:27:15 -04:00
Devin Slauenwhite
472e634625 Merge branch 'develop' into feat-picklist-scan 2022-04-29 14:11:42 -04:00
Devin Slauenwhite
2554cdceeb revert: scan_mode flag 2022-04-29 13:45:59 -04:00
Devin Slauenwhite
24d8f62b21 revert: barcode scan field from pick list item. 2022-04-29 13:40:48 -04:00
Deepesh Garg
ab94b73e93 fix: Cost center filter on payment reconciliation 2022-04-29 18:06:13 +05:30
Rucha Mahabal
65742947e7 fix(UX): record reason for skipping attendance or marking absent for auto attendance (#30844) 2022-04-29 15:46:00 +05:30
Deepesh Garg
dafdc9b68c Merge pull request #30843 from deepeshgarg007/opening_tool_multi_currency
fix: Multi currency opening invoices
2022-04-29 15:16:06 +05:30
Deepesh Garg
a8452c2ba2 fix: Multi currency opening invoices 2022-04-29 14:27:03 +05:30
Deepesh Garg
1622faad40 Merge pull request #30802 from deepeshgarg007/multi_currency_opening
fix: Allow multi-currency opening invoices
2022-04-29 13:34:54 +05:30
Deepesh Garg
f25251bb70 chore: Clean up patches 2022-04-29 12:42:29 +05:30
Deepesh Garg
55b2930b05 Merge pull request #30816 from ruthra-kumar/payment_term_rpt_on_selling
refactor: add payment terms status rpt to Selling homepage
2022-04-29 12:33:34 +05:30
Deepesh Garg
0cb36cc18c Merge branch 'develop' into payment_term_rpt_on_selling 2022-04-28 21:22:38 +05:30
Deepesh Garg
2ee20d35d9 Merge branch 'develop' of https://github.com/frappe/erpnext into education_sepration 2022-04-28 19:55:25 +05:30
Deepesh Garg
3c578a3b0b chore: Add patch to delete education doctypes 2022-04-28 19:54:28 +05:30
Deepesh Garg
44c54f69f8 chore: Remove references for Student doctype 2022-04-28 16:16:47 +05:30
Deepesh Garg
cc867fd949 chore: Remove Fees Doctype 2022-04-28 15:51:32 +05:30
Deepesh Garg
848827cf5c chore: Remove references for Assessment Group 2022-04-28 15:11:22 +05:30
gavin
389c2853eb docs: Trimmed whitespace from "Try on FCloud" button
ERPNext Port of b1effcab4b
2022-04-28 14:57:43 +05:30
Deepesh Garg
8dcbbf1b9e chore: Remove course links from training doctypes 2022-04-28 13:49:34 +05:30
Deepesh Garg
60b693f84f chore: clean up hooks 2022-04-28 12:02:54 +05:30
Aditya Hase
3c7176d690 fix: Update links to Frappe Cloud (#30833) 2022-04-28 11:07:02 +05:30
Deepesh Garg
41e2959389 chore: remove files related to LMS 2022-04-28 10:41:30 +05:30
Devin Slauenwhite
8053f2dbcd feat: increment picked_qty on scan_barcode 2022-04-27 22:10:15 -04:00
Devin Slauenwhite
ceffbf243e fix: show alert when maximum qty scanned is reached 2022-04-27 22:07:25 -04:00
Devin Slauenwhite
159cf2848e fix: get correct row to modify with duplicate item_codes and max_qty fields are present 2022-04-27 22:03:39 -04:00
Devin Slauenwhite
e04fbb6a99 feat: pick list scan fields 2022-04-27 22:02:04 -04:00
Deepesh Garg
69d369dd7f refactor: Remove education domain from ERPNext 2022-04-27 19:20:36 +05:30
Ankush Menat
777f0204dd test: create new item instead of using with _Test Item (#30827)
Unnecessary dependency causes flake in stock. The test was reposting all
entries for item just to test some behavior that is best tested on a
newly created item _anyway_.
2022-04-27 17:47:40 +05:30
Ankush Menat
0a07cd8f68 chore: "refactor" readme (#30825)
[skip ci]
2022-04-27 15:47:28 +05:30
Marica
2fffc68938 Merge pull request #30762 from ankush/bunle_pickng
feat: support product bundles in picklist
2022-04-27 15:23:16 +05:30
Ankush Menat
ebd5f0b1bb chore: make picked qty read only 2022-04-27 14:53:20 +05:30
Ankush Menat
9a8e3ef235 fix(UX): only show pick list when picking is pending
[skip ci]
2022-04-27 14:43:42 +05:30
Ankush Menat
3ae9fa98c4 ci: failfast when merge conflict exists (#30823)
[skip ci]
2022-04-27 14:33:26 +05:30
Ankush Menat
47e1a0104c fix: dont map picked qty and consider pick qty for new PL
Co-Authored-By: marination <maricadsouza221197@gmail.com>
2022-04-27 13:44:19 +05:30
Deepesh Garg
429361ce87 chore: Remove domains from Setup 2022-04-27 13:32:51 +05:30
Ankush Menat
8207697e43 fix: compare against stock qty while validating
Other changes:

- only allow whole number of bundles to get picked
2022-04-27 12:51:18 +05:30
Ahmad
b226e7d2ac feat: request_for_quotation
- Show supplier name if supplier ID is not equal to supplier name
2022-04-27 12:16:03 +05:00
gavin
85e8dd9a49 chore: Add "Try on PWD" button (#30817) 2022-04-27 12:41:16 +05:30
Ankush Menat
9e60acdf56 test: test bundle - picklist behaviour 2022-04-27 12:05:15 +05:30
Ankush Menat
ee54ece8fd test: product bundle fixture 2022-04-27 12:05:15 +05:30
Ankush Menat
1ac275ce61 feat: transfer picklist stock info to packing list 2022-04-27 12:05:15 +05:30
Ankush Menat
41aa4b3524 fix: round off bundle qty
This is to accomodate bundles that might allow floating point qty.
2022-04-27 12:05:15 +05:30
Ankush Menat
25485edfd9 refactor: remove unnecssary vars
also remove misleading docstring
2022-04-27 12:05:15 +05:30
Ankush Menat
23cb0d684d feat: create DN from pick list with bundle items 2022-04-27 12:05:15 +05:30
Ankush Menat
f574121741 refactor: simpler check for non-SO items 2022-04-27 12:05:15 +05:30
Ankush Menat
277b51b404 refactor: groupby using keys instead of int index 2022-04-27 12:05:15 +05:30
Ankush Menat
3ddad6891a refactor: simplify needlessly complicated code 2022-04-27 12:05:15 +05:30
Ankush Menat
60bc26fdbe feat: back-update min picked qty for a bundle 2022-04-27 12:05:15 +05:30
Ankush Menat
c3fc0a4f55 perf: single update per Sales Order.
For each SO item the sales order picking status was being updated, this
isn't required and wasteful.
2022-04-27 12:05:15 +05:30
Ankush Menat
e64cc66df7 refactor: sales order status update
- rename badly named variables
- support updated packed items
2022-04-27 12:05:15 +05:30
Ankush Menat
36c5e8a14f feat: Pick list from SO with Product Bundle 2022-04-27 12:05:15 +05:30
Ankush Menat
7d5682020a test: bundles in picklist 2022-04-27 12:05:15 +05:30
Ankush Menat
5c3f9019cc refactor: misc pick list refactors
- make tracking fields read only and no-copy 🤦
- collapse print settings section, most users configure it once and
  forget about it, not need to show this.
- call pick list grouping function directly
- use get_descendants_of instead of obscure db function
2022-04-27 12:05:15 +05:30
Deepesh Garg
67bb29026f fix: Ignore custom field validation while setup 2022-04-26 20:15:15 +05:30
Ankush Menat
24a7acaabc chore: incorrect translations 2022-04-26 19:22:26 +05:30
Ankush Menat
dcc2243fbb Merge pull request #30811 from marination/multiple-wh-acc
chore: Warn users about multiple warehouse accounts
2022-04-26 18:18:11 +05:30
marination
e2a163d4e9 fix: Use account_type == 'Stock' to filter stock accounts 2022-04-26 17:50:51 +05:30
marination
44331f4f1f chore: Warn users about multiple warehouse accounts
- Get distinct accounts that warehouse value has been booked against
- If same account as the one being set, ignore
- If not same account or multiple accounts: warn user that it makes it harder to track mismatches
2022-04-26 17:43:33 +05:30
Rucha Mahabal
1cc8c79807 test: fix flaky carry forwarded leave expiry test (#30810) 2022-04-26 17:43:08 +05:30
Saqib Ansari
078f26bef3 Merge pull request #30808 from nextchamp-saqib/pos-search-ux-fix
fix(pos): search field doesn't reset on checkout
2022-04-26 14:47:22 +05:30
Saqib Ansari
b1ac5ff9d2 fix(pos): number pad translations 2022-04-26 14:41:36 +05:30
Saqib Ansari
03a6103fe5 fix(pos): search field doesn't reset on checkout 2022-04-26 14:28:33 +05:30
Deepesh Garg
00ace8f62c Merge branch 'develop' into accounting_dimension_consistency 2022-04-26 14:26:08 +05:30
Deepesh Garg
82a0635c66 fix: Consistent accounting dimensions across Sales and Purchase docs 2022-04-26 14:01:13 +05:30
ruthra kumar
b0ead459a0 feat: add payment terms status rpr to Selling homepage 2022-04-26 13:30:13 +05:30
Ankush Menat
8d20da9b7a Merge pull request #30774 from ankush/postgres/stock
fix(postgres): minimum required changes for postgres builds
2022-04-26 12:11:34 +05:30
Ankush Menat
88e257ff6d fix: column name in party query 2022-04-26 11:47:05 +05:30
Ankush Menat
052171f51c fix: date condition in tax rule 2022-04-26 11:47:05 +05:30
Ankush Menat
a90e7e32a4 fix: proper quoting in sql queries 2022-04-26 11:47:05 +05:30
Ankush Menat
7e555d3d8c fix: item price query for postgres
postgres doesn't like bad type comparisons and doesn't have `isnull`
funciton
2022-04-26 11:47:02 +05:30
Ankush Menat
7d2587c0a9 fix: nullish check and table name 2022-04-26 11:03:32 +05:30
Ankush Menat
0fdfc1e76e fix: only query fields that exist 2022-04-26 11:03:32 +05:30
Ankush Menat
ce75fe0ec4 fix: out of range date value 2022-04-26 11:03:32 +05:30
Ankush Menat
cdac2b8c63 fix: ignore duplicate fixtures 2022-04-26 11:03:32 +05:30
Ankush Menat
e1c1687661 refactor: use db agnostic CombineDatetime 2022-04-26 11:03:32 +05:30
Deepesh Garg
d3582ea399 fix: Allow multi-currency opening invoices 2022-04-25 18:18:39 +05:30
Deepesh Garg
4ffea617ef Merge pull request #30754 from deepeshgarg007/round_off_account_cost_center
fix: First preference to parent cost center rather than round off cost center
2022-04-25 17:06:19 +05:30
Deepesh Garg
3fa1c63479 test: Unit test for round off entry dimensions 2022-04-25 16:29:26 +05:30
Deepesh Garg
b1158bcb7c Merge pull request #30799 from nextchamp-saqib/einv-cess-fix
fix(india): cess value not considered while validating e-invoice totals
2022-04-25 14:39:15 +05:30
Deepesh Garg
f064e0b15e Merge pull request #30642 from rahib-hassan/separate-discount-account
feat: separate discount accounting for buying and selling
2022-04-25 14:07:20 +05:30
Saqib Ansari
8e6c7a6bf7 fix(india): cess value not considered while validating e-invoice totals 2022-04-25 14:02:46 +05:30
Deepesh Garg
02aaa6546c chore: Remove dead code 2022-04-25 12:42:06 +05:30
Deepesh Garg
22bc107d70 Merge pull request #30778 from deepeshgarg007/accpunting_dimension_validate_ignore_new
fix: Do not validate while creating accounting dimension
2022-04-25 12:30:51 +05:30
rahib-hassan
6c86067d90 Merge branch 'develop' into separate-discount-account 2022-04-25 12:17:50 +05:30
Ankush Menat
d6a43a39ae test: tie breaking in SLEs (#30796)
[skip ci]
2022-04-25 11:46:01 +05:30
Deepesh Garg
618fa0e8ea Merge branch 'develop' into accpunting_dimension_validate_ignore_new 2022-04-24 20:55:50 +05:30
Deepesh Garg
afc6aa88f0 Merge pull request #30763 from deepeshgarg007/loan_reconciliation
fix: Add loan doctypes in bank clearance
2022-04-24 20:55:29 +05:30
Deepesh Garg
c515abc392 test: Remove teardown method 2022-04-24 19:20:29 +05:30
Deepesh Garg
c312cd3725 fix: Check if accounting dimension exists 2022-04-24 18:11:32 +05:30
Deepesh Garg
783793deac Merge branch 'develop' of https://github.com/frappe/erpnext into round_off_account_cost_center 2022-04-23 21:40:38 +05:30
Deepesh Garg
015812b0b8 fix: Add accounting dimensions for round off GL Entry 2022-04-23 21:40:08 +05:30
Deepesh Garg
d4d83f4bb6 test: Fixes in test case 2022-04-23 12:33:35 +05:30
Deepesh Garg
0eacc99ab7 test: Fixes in test case 2022-04-23 12:08:30 +05:30
Rucha Mahabal
deed9702cf Merge pull request #30780 from ruchamahabal/promotion-enhancements 2022-04-22 22:33:39 +05:30
Rucha Mahabal
8e5327a0e0 fix: clear property child table on changing employee 2022-04-22 21:33:24 +05:30
Rucha Mahabal
9d158088ee chore: remove unused Employee Transfer Property doctype 2022-04-22 20:20:12 +05:30
Rucha Mahabal
cfa4dfe7a8 fix: reset old CTC on promotion cancellation 2022-04-22 20:20:04 +05:30
Rucha Mahabal
9b93c63830 fix: tests 2022-04-22 17:54:32 +05:30
Wolfram Schmidt
43c1d63ab2 fix translation (#30781)
fixed the short word for March in german language
2022-04-22 17:32:34 +05:30
Rucha Mahabal
788e0a1c6c chore: format employee_property_update.js 2022-04-22 17:25:37 +05:30
Marica
f99ba8dba9 Merge pull request #30779 from marination/validate-shopping-cart-quote-items
fix: Shopping cart quotation without website item.
2022-04-22 17:21:09 +05:30
Rucha Mahabal
ed04241cf4 Merge branch 'develop' into promotion-enhancements 2022-04-22 16:38:01 +05:30
Rucha Mahabal
833a33a94b test: employee property update via Employee Promotion 2022-04-22 16:28:25 +05:30
Rucha Mahabal
a93867de19 feat: add CTC fields in Employee master and Promotion 2022-04-22 16:28:14 +05:30
marination
8d632e9b9c style: Re-run pre-commit 2022-04-22 16:27:29 +05:30
marination
b848e61954 fix: Skip unpublished Variants with published templates in shopping cart quote validation 2022-04-22 16:25:56 +05:30
Devin Slauenwhite
53d8168dea fix: linter format string after translation 2022-04-22 16:25:28 +05:30
Devin Slauenwhite
ea6d6e31b3 fix: linter trilaing whitespace 2022-04-22 16:25:21 +05:30
Devin Slauenwhite
48da3b4482 fix: sider issues 2022-04-22 16:23:18 +05:30
Devin Slauenwhite
b88d5d135e fix(test): validate exception without website item 2022-04-22 16:23:07 +05:30
Devin Slauenwhite
86832fb7fe test: assert error if quotation contains non website item 2022-04-22 16:22:58 +05:30
Devin Slauenwhite
678a1179d4 fix: shopping cart quotation without website item 2022-04-22 16:22:32 +05:30
Deepesh Garg
9bb132fdd3 fix: Do not validate while creating accounting dimension 2022-04-22 13:39:43 +05:30
Vladislav
e088e65871 fix: update translation (#30725)
* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv
2022-04-22 11:00:57 +05:30
Deepesh Garg
81b3342480 Merge pull request #30757 from nextchamp-saqib/einv-401-fix
fix(india): 401 & 403 client error while generating IRN
2022-04-21 18:55:26 +05:30
Deepesh Garg
8a8476bb5c test: Add test coverage for bank clearance 2022-04-21 18:53:18 +05:30
Ankush Menat
d5ab626a31 Merge pull request #30726 from ankush/dependent_gle_reposting
fix: dependent gle reposting
2022-04-21 18:06:40 +05:30
Ankush Menat
ee3036651a fix: batch_no filtering not working when batch no is also a number in scientific notation (#30770)
[skip ci]
2022-04-21 16:34:31 +05:30
rahib-hassan
78c8e46511 Merge branch 'develop' into separate-discount-account 2022-04-21 15:06:58 +05:30
Ankush Menat
4dced7dfeb Merge pull request #30733 from marination/field-filters-e-com
fix: Filter fields in E Commerce Settings (use Website Item)
2022-04-21 14:30:31 +05:30
Deepesh Garg
c42547d40f fix: Use parent cost center for Sales and Purchase Invoice 2022-04-21 13:26:44 +05:30
Marica
87f1617780 Merge branch 'develop' into field-filters-e-com 2022-04-21 12:32:33 +05:30
marination
c5d4bed932 test: setup e commerce settings before running invalid filtrs test 2022-04-21 12:29:30 +05:30
Rucha Mahabal
c3dc5d5ce7 fix: property addition not working for select fields 2022-04-21 08:17:00 +05:30
rahib-hassan
02e17dbded fix: removed manual enable-discount-account method 2022-04-21 02:42:42 +05:30
rahib-hassan
2c78cc2014 fix: removed manual rollback - enable discount account 2022-04-21 02:40:59 +05:30
Deepesh Garg
3d0e68acaa fix: select doctype as payment_document 2022-04-20 19:49:53 +05:30
Deepesh Garg
c3e27b5556 fix: Loan doctypes in bank reconciliation 2022-04-20 19:07:53 +05:30
marination
8981405a62 test: Field filter validation and Custom field as field filter
- Test to block Item fields (which aren’t in Website Item) in E Commerce Settings as filters
- Removed unnecessary function and setup in E Commerce Settings test
- Removed commented useless test
- Test to check custom field as filter
2022-04-20 18:50:47 +05:30
marination
6d750e185e fix: Handle Multiselect field mapping separately
- Map Multiselect child table to Website Item (copy rows)
2022-04-20 17:40:03 +05:30
rahib-hassan
13092bcc2d fix: enable discount roll_back 2022-04-20 16:46:29 +05:30
rahib-hassan
1e143e7479 fix: use @change_settings to enable_discount_account 2022-04-20 16:06:55 +05:30
rahib-hassan
f3fa6ac4c2 fix: account setting seperation gl discount account creation 2022-04-20 16:01:12 +05:30
Rucha Mahabal
5411e69553 fix: filters not working in Shift Assignment Calendar view (#30752) 2022-04-20 14:56:06 +05:30
Saqib Ansari
ee8047aba3 fix(india): 401 & 403 client error while generating IRN 2022-04-20 14:14:29 +05:30
rahib-hassan
f058755ad3 fix: test cases updated 2022-04-20 13:24:15 +05:30
HENRY Florian
143786aaa0 fix: Must not be able to start Job Card if it is related to Work Order that is not started yet (#29072)
* fix: Cannot start Job strat if related to Work Order not started yet

* fix: Cannot start Job strat if related to Work Order not started yet

* test

* test

* fix siders

* PR review

* chore: Code cleanup

- Better short circuit for if condition (make it such that both conditions dont always have to be computed)
- Remove `r.message` extraction by avoiding `then()`

* chore: Remove unnecessary json change

Co-authored-by: marination <maricadsouza221197@gmail.com>
2022-04-20 12:29:52 +05:30
marination
5660b335ba fix: Mistyped variable name in patch 2022-04-20 12:25:59 +05:30
Deepesh Garg
0ac11a5b30 fix: First preference to parent cost center rather than round off cost center 2022-04-20 12:18:11 +05:30
Deepesh Garg
5c45093d2d Merge pull request #30746 from frappe/mergify/bp/develop/pr-30736
fix(india): transporter name is null while generating e-way bill (backport #30736)
2022-04-20 11:25:27 +05:30
Ankush Menat
9734329094 test: discard local future SLE cache between tests 2022-04-19 17:40:28 +05:30
Ankush Menat
700e864d90 fix: sort stock vouchers before reposting GLE 2022-04-19 17:40:26 +05:30
Ankush Menat
b24920c0e9 fix: correct sorting while updating bin 2022-04-19 17:38:36 +05:30
Ankush Menat
d2882ea436 test: use disposable item codes in tests
dependency causes flake
2022-04-19 17:38:36 +05:30
Ankush Menat
8f519545b0 test: repost queue progress 2022-04-19 17:38:36 +05:30
Ankush Menat
ecdb49314f fix: dependent GLE reposting 2022-04-19 17:38:36 +05:30
Ankush Menat
a2af2daca7 test: dependent GL entry reposting 2022-04-19 17:38:36 +05:30
Ankush Menat
afc5a55a23 refactor: repost error handling 2022-04-19 17:38:36 +05:30
Deepesh Garg
e4265ce814 chore: Update creds to allow updates on protected branch (#30749) 2022-04-19 17:26:42 +05:30
FinByz Tech Pvt. Ltd
54a05075f3 fix(india): transporter name is null while generating e-way bill (#30736)
(cherry picked from commit 6291b28c37)
2022-04-19 10:57:59 +00:00
Deepesh Garg
5d0a6c1e64 Merge pull request #30742 from deepeshgarg007/bot_token
fix: Update token to allow updates on protected branch
2022-04-19 15:30:52 +05:30
Deepesh Garg
6f332f3669 fix: Update token to allow updates on protected branch 2022-04-19 15:28:56 +05:30
Rucha Mahabal
f39615bd80 Merge pull request #30701 from ejaazkhan/shift-type-null-in-employee-checkin 2022-04-19 14:34:36 +05:30
Rucha Mahabal
789fa31b82 Merge branch 'develop' into shift-type-null-in-employee-checkin 2022-04-19 13:39:32 +05:30
Rucha Mahabal
3cddc1e97e test: shift fetching when assignment has an end date 2022-04-19 13:39:03 +05:30
Rucha Mahabal
98cccf221e fix: shift fetching fails in Employee Checkin if shift assignment has an end date
Co-authored-by: Ejaaz Khan <ejaazrkhan@gmail.com>
2022-04-19 13:17:36 +05:30
Rucha Mahabal
7c547f152f fix(patch): check if column is present while fixing reverse linking (#30737) 2022-04-19 12:18:46 +05:30
marination
d0cd194398 chore: Patch to copy custom fields (field filters) from Item to Website Item 2022-04-18 21:40:19 +05:30
Deepesh Garg
d96bfe13a8 Merge pull request #30721 from ruthra-kumar/bug_so_analysis_report
fix: SO's without delivery note will also be fetched
2022-04-18 19:58:37 +05:30
marination
1e80b97915 refactor: Change Filter Fields table fieldtype to Autocomplete
- Remove dynamic js fieldtype change to `Select`
2022-04-18 19:01:43 +05:30
marination
d35b37881b fix: Validate field filter wrt to Website Item & re-use validation in Item Group 2022-04-18 18:51:48 +05:30
Marica
8a366309e1 Merge branch 'develop' into field-filters-e-com 2022-04-18 18:11:25 +05:30
marination
c993ac09df fix: Query filter fields from Website Item instead of Item master
- tweak `filters.py` to correctly query filter field values from Website Item
- Use Website Item for filter field options in Settings and Item Group Field Filter table
2022-04-18 18:01:48 +05:30
Ankush Menat
c4d20ce159 Merge pull request #30729 from deepeshgarg007/semantic_releases
chore: Add semantic releases
2022-04-18 17:13:16 +05:30
Deepesh Garg
e0a9a69d76 chore: do not publish any assets 2022-04-18 16:45:01 +05:30
Ankush Menat
6fc11cb4c5 ci: use latest ubuntu container 2022-04-18 16:17:36 +05:30
rahib-hassan
bcfbb3e9c8 fix: code formatting 2022-04-18 15:04:47 +05:30
rahib-hassan
ebb7bc201b fix: library import formatting 2022-04-18 14:53:45 +05:30
Deepesh Garg
264ec65255 Merge pull request #30728 from deepeshgarg007/pricing_rule_apply_mapped_doc
fix: Price changing on creating Sales return from Delivery Note
2022-04-18 14:34:28 +05:30
rahib-hassan
52fd804aed Merge branch 'develop' of github.com:rahib-hassan/erpnext into separate-discount-account 2022-04-18 14:13:46 +05:30
Deepesh Garg
c12a36aed9 chore: block major releases 2022-04-18 13:05:56 +05:30
Deepesh Garg
1c49e453ea Merge pull request #30724 from deepeshgarg007/erpnext_changes
fix: Consistent customer and supplier forms
2022-04-18 11:23:26 +05:30
Deepesh Garg
cc1bdd426b chore: Update branch name 2022-04-18 10:48:31 +05:30
Deepesh Garg
41249c57c4 chore: Add sematic releases 2022-04-18 10:38:22 +05:30
Deepesh Garg
9c081947ec fix: Price changing on creating Sales retrun from Delivery Note 2022-04-18 10:21:15 +05:30
Deepesh Garg
5cdd0d6719 fix: Move tax withholding category field 2022-04-16 20:34:56 +05:30
Deepesh Garg
0a67b0239e fix: Consistent customer and supplier forms 2022-04-16 19:43:59 +05:30
ruthra kumar
13487e2408 test: Sales order analysis report 2022-04-16 12:02:32 +05:30
Deepesh Garg
4b2521c9f3 Merge pull request #30719 from frappe/mergify/bp/develop/pr-30408
fix: process statement to_date override (backport #30408)
2022-04-14 20:22:46 +05:30
Bhavesh Maheshwari
72757994f8 fix: process statement to_date override
(cherry picked from commit 378d15d388)
2022-04-14 13:14:11 +00:00
ruthra kumar
e28e6726f1 fix: SO analysis rpt will fetch SO's without Delivery note as well 2022-04-14 18:37:46 +05:30
mergify[bot]
41ec5cadf6 Merge pull request #30677 from ankush/refactor/stock_balance
refactor: stock balance report
2022-04-14 13:02:46 +00:00
Ankush Menat
9af2d68945 refactor: convert queries to ORM/QB, add types 2022-04-14 18:05:38 +05:30
Ankush Menat
ba29323e11 test: increase assertions to cover all cases 2022-04-14 18:05:38 +05:30
Ankush Menat
e278ee359a test: item attribute columns 2022-04-14 18:05:38 +05:30
Ankush Menat
febc74a21b refactor: rewrite stock balance query to QB 2022-04-14 18:05:35 +05:30
Ankush Menat
8a499e95d3 test: uom conversion in stock balance report 2022-04-14 18:01:43 +05:30
Ankush Menat
af0ea7b532 test: assert balanaces against SLE 2022-04-14 18:01:42 +05:30
Ankush Menat
f4766ae4eb test: opening balance in stock balance report 2022-04-14 18:01:42 +05:30
Ankush Menat
8b2432dfa0 test: stock balance report tests 2022-04-14 18:01:42 +05:30
Ankush Menat
64ac22af82 refactor: add filter type info 2022-04-14 18:01:42 +05:30
HENRY Florian
e6aa28ea14 fix: update translation (#30716)
* fix: update translation

* fix: update translation

* fix: update translation

* fix: update translation
2022-04-14 17:46:47 +05:30
Ankush Menat
15576c1ce8 Merge pull request #30707 from marination/values-out-of-sync-jv
fix: Remove "Values Out of Sync" validation
2022-04-14 17:39:18 +05:30
Ankush Menat
0d64349142 Merge branch 'develop' into separate-discount-account 2022-04-14 17:29:28 +05:30
rahib-hassan
4130493b58 fix: Label typo 2022-04-14 16:03:08 +05:30
rahib-hassan
01fde15bd5 fix: dependent codes updated 2022-04-14 15:48:55 +05:30
rahib-hassan
0eff74c650 fix: tabspacing 2022-04-14 15:42:16 +05:30
Deepesh Garg
1659f1eb6d Merge pull request #29963 from nabinhait/income-tax-computation
feat: Income tax computation Report
2022-04-14 15:31:17 +05:30
Deepesh Garg
e2fa9f708e Merge pull request #30710 from deepeshgarg007/advance_jv_allocation
fix: Exchange gain and loss on advance Journal Entry allocation
2022-04-14 15:10:04 +05:30
Nabin Hait
cd2ab32242 fix: orginised code 2022-04-14 14:05:21 +05:30
Nabin Hait
bc7007d588 fix: get enabled deduction components
Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2022-04-14 14:02:01 +05:30
Nabin Hait
d06b7378f8 fix: get enabled and submitted income tax slab
Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2022-04-14 14:01:44 +05:30
Nabin Hait
67086e618d fix: get enabled earning components
Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2022-04-14 14:00:28 +05:30
Marica
87117313a1 Merge branch 'develop' into values-out-of-sync-jv 2022-04-14 13:41:27 +05:30
Deepesh Garg
c38be53ce8 test: Update customer in Sales Invoice 2022-04-14 13:26:47 +05:30
Suraj Shetty
11fa187263 Merge pull request #30715 from surajshetty3416/fix-exotel-call-log 2022-04-14 12:45:15 +05:30
Suraj Shetty
77599fe443 fix: Set correct options for link field
issue introduced via https://github.com/frappe/erpnext/pull/30711
2022-04-14 12:32:31 +05:30
Deepesh Garg
86cfa3a53f Merge pull request #30712 from frappe/mergify/bp/develop/pr-30700
fix: Payment reco query with max invoice and payment amount limit (backport #30700)
2022-04-14 12:32:11 +05:30
Deepesh Garg
7536da0b41 Merge pull request #30675 from deepeshgarg007/item_wise_provisional_accounting
feat: Item-wise provisional accounting for service items
2022-04-14 12:30:50 +05:30
marination
d75d5ebe8d chore: Remove Values Out of Sync from Repost hourly job
- It runs after repost (after commiting), so it has 0 impact on repost itself
- Just that scheduled job log shows up as failed, while actually repost is done and repost document is "Completed"
- The check is inaccurate also, so best to remove this
- Users cant do anything about it anyway. This just piles up phantom failed jobs unneccessarily
2022-04-14 12:30:06 +05:30
Deepesh Garg
065c38152a Merge branch 'develop' of https://github.com/frappe/erpnext into item_wise_provisional_accounting 2022-04-14 12:04:21 +05:30
Deepesh Garg
ad171c6225 test: Update test case 2022-04-14 12:03:12 +05:30
Deepesh Garg
e6cb948a96 fix: Payment reco query with max invocie and payment amount limit
(cherry picked from commit 4008c95ac6)
2022-04-14 05:42:17 +00:00
Deepesh Garg
972d9ec5b4 test: Update customer 2022-04-14 11:10:41 +05:30
Suraj Shetty
5ed9b9f42f Merge pull request #30711 from surajshetty3416/call-log-fixes 2022-04-14 10:05:52 +05:30
Suraj Shetty
6e837bcdfc style: Fix linter warning 2022-04-14 10:02:15 +05:30
Suraj Shetty
c272170b86 fix(call log): Convert Data to Link for type_of_call
Convert `Data` to `Link` for type_of_call,
employee_user_id and call_received_by fields
2022-04-14 09:51:54 +05:30
Deepesh Garg
31883b699d fix: Exchange gain and loss on advance jv allocation 2022-04-13 20:52:25 +05:30
Ankush Menat
79fbc2c504 test: flaky PR close test (#30709) 2022-04-13 20:42:25 +05:30
Suraj Shetty
d890ee9495 Merge pull request #29962 from nemesis189/exotel-fixes
fix: Exotel Call Log fixes
2022-04-13 20:36:03 +05:30
Suraj Shetty
ff41b8da4e fix: Update received_by if "to" is changed 2022-04-13 20:12:08 +05:30
Suraj Shetty
cef28df8db test: Do not overwrite frappe.form_dict to retain proxy reference
Set frappe.local.form_dict instead
2022-04-13 19:10:19 +05:30
marination
89fab78027 fix: Remove "Values Out of Sync" validation from Journal Entry
- Even if there is a difference there's not much a user can do
- Checking it at the JV level is senseless. Blindly making users post another JV will lead to more error.
- Users making JV are usually accountants who know what they are doing
- The validation computes incorrect values for an account that contributes partially to warehouse's value.
2022-04-13 18:44:50 +05:30
Ankush Menat
71de754368 ci: coverage not getting processed (#30704) 2022-04-13 18:23:22 +05:30
Ankush Menat
0f09042962 chore(deps)!: Drop pandas as dependency (#30598)
depends on https://github.com/frappe/erpnext/pull/30597
depends on https://github.com/frappe/erpnext/pull/30584 


Closes https://github.com/frappe/erpnext/issues/27047 (read for more details)
2022-04-13 09:55:47 +00:00
Raffael Meyer
6453fb4cea refactor!: remove DATEV integration (#30584)
The DATEV integration follows the trend and moves into a separate app.

- the DATEV Integration will be maintained at https://github.com/alyf-de/erpnext_datev (version-14 branch)
- the German Compliance and Localization will be maintained at https://github.com/alyf-de/erpnext_germany
2022-04-13 09:24:19 +00:00
Marica
143067f5a7 Merge pull request #30688 from marination/pp-wo-company
fix: Map Production Plan company in subassembly WO created from it
2022-04-13 12:43:15 +05:30
Marica
c5247a0767 Merge branch 'develop' into pp-wo-company 2022-04-13 11:52:15 +05:30
marination
6315acc450 fix: Map correct company to PO made via Prod Plan (subcontract) 2022-04-13 11:47:58 +05:30
Ankush Menat
bfaaebde0d Merge branch 'develop' into separate-discount-account 2022-04-12 18:38:23 +05:30
Deepesh Garg
228195ba74 Merge pull request #30689 from deepeshgarg007/disabled_gl_dimensions
fix: Do not show disabled dimensions in reports
2022-04-12 16:11:07 +05:30
Deepesh Garg
4f9b38a591 Merge pull request #30686 from nabinhait/ignore-permlevel-for-fields
feat: Ignore permlevel for specific fields
2022-04-12 15:55:28 +05:30
Noah Jacob
8261b2bb4f refactor: trigger generate schedule when any change made in items table (#29874)
* refactor: trigger generate schedule when any change made in items table

* chore: added serial validation on server side

* test: serials updated in schedules after save

* fix: schedule not generating after updating some fields

* feat: generate_schedule is triggered on_save when items table is changed

* test: updated tests to check other field changes on save

* chore: removed serial validation function for schedules table and added no_of_visits validation function

* test: updated for manually deleted schedele rows

* refactor: updated validate_items_table_change to return bool

* test: updated test_schedule_with_serials to cover validate_items_table_change

* fix: linting
2022-04-12 15:30:49 +05:30
Deepesh Garg
9a1c560c82 fix: Do not show disabled dimensions in reports 2022-04-12 15:27:08 +05:30
marination
2777c5c67c fix: Map Production Plan company in subassembly WO created from it 2022-04-12 14:30:01 +05:30
Nabin Hait
993c6c0de9 feat: Ignore permlevel for specific fields 2022-04-12 12:24:47 +05:30
Ankush Menat
60fb71bd2a fix: ignore item-less maintenance visit for sr no (#30684) 2022-04-12 11:14:02 +05:30
Deepesh Garg
7d263e9ecf Merge pull request #30651 from deepeshgarg007/gst_download_json_key_error
fix: Download JSON for GSTR-1 report
2022-04-12 00:06:25 +05:30
Marica
014298a867 Merge pull request #30674 from marination/work-order-partial-transfer
fix: Handle multiple item transfer in separate SEs against WO
2022-04-11 17:23:57 +05:30
Deepesh Garg
79b90118e1 Merge branch 'develop' into gst_download_json_key_error 2022-04-11 17:15:04 +05:30
Deepesh Garg
76d3c3d617 Merge pull request #30602 from deepeshgarg007/deferred_revenue_default_account_fixes
fix: Deferred Revenue/Expense Account validation
2022-04-11 17:03:01 +05:30
Marica
3f8be3ac10 Merge branch 'develop' into work-order-partial-transfer 2022-04-11 16:49:22 +05:30
marination
5aa60bb651 test: Multiple RM transfer in separate Stock Entries
- Added test and acceptance of 0 as For Quantity in test helper
2022-04-11 16:44:55 +05:30
Nabin Hait
e46898f5f5 fix: test cases 2022-04-11 16:37:34 +05:30
Nabin Hait
aad29ad572 fix: removed unused imports 2022-04-11 15:33:22 +05:30
marination
be2e5ce966 style: Missing Semicolon 2022-04-11 15:32:57 +05:30
Nabin Hait
c27e3ef03e fix: Show message is no employee found 2022-04-11 15:30:26 +05:30
Deepesh Garg
553178bfe7 test: Add test 2022-04-11 15:29:20 +05:30
Nabin Hait
7072dda31f fix: sider issues 2022-04-11 15:19:42 +05:30
Deepesh Garg
54eef3daad Merge branch 'develop' of https://github.com/frappe/erpnext into deferred_revenue_default_account_fixes 2022-04-11 15:09:30 +05:30
Saqib Ansari
0373347a97 Merge branch 'develop' into separate-discount-account 2022-04-11 14:55:42 +05:30
Nabin Hait
c7848089ab tests: Added unit tests for income tax computation report 2022-04-11 14:51:23 +05:30
Deepesh Garg
3ce64170db feat: Item-wise provisional accounting for service items 2022-04-11 14:35:22 +05:30
rahib-hassan
a7a5742375 fix: merge conflict(patch) 2022-04-11 14:28:36 +05:30
marination
dfff4beaf4 fix: Handle multiple item transfer in separate SEs against WO
- Check for pending qty in child items to show/hide "Start" button
- If no qty needed to transfer (FG qty is fulfilled), but RM qty pending: map pending in SE with For Quantity = 0
2022-04-11 14:10:57 +05:30
Ankush Menat
c3e1f0e369 refactor: ignore mandatory fields during setup 2022-04-11 13:19:17 +05:30
Ankush Menat
086d31b59f fix: dont validate currency exchange in setup
Redues ~4-5 seconds of time and chances of setup failure.
2022-04-11 13:19:17 +05:30
Nabin Hait
e3a53590de fix: Added filter to consider Tax Exemption Declaration if proof not submitted 2022-04-11 12:23:13 +05:30
Nabin Hait
535217a042 fix: Added income tax slab column 2022-04-11 12:23:13 +05:30
Nabin Hait
1f018a912b fix: Get exemptions from declaration only if proof not submitted 2022-04-11 12:23:13 +05:30
Nabin Hait
b4900ef220 fix: duplicate exemption amount and rounded tax 2022-04-11 12:23:13 +05:30
Nabin Hait
a74eec01ea fix: Added report link in the Payroll workspace 2022-04-11 12:23:13 +05:30
Nabin Hait
a9b5d990a4 fix: Removed designation filter 2022-04-11 12:23:13 +05:30
Nabin Hait
0480bb318e fix: Modified column width 2022-04-11 12:23:13 +05:30
Nabin Hait
f9633bbd48 feat: Income Tax Computation Report 2022-04-11 12:23:11 +05:30
HENRY Florian
03c631d723 fix: update translation (#30654) 2022-04-11 10:49:18 +05:30
Deepesh Garg
227a711d70 Merge pull request #30585 from frappe/mergify/bp/develop/pr-30575
fix: Do not apply shipping rule for POS transactions (backport #30575)
2022-04-10 20:12:53 +05:30
Deepesh Garg
0f414d51f4 Merge pull request #30443 from frappe/mergify/bp/develop/pr-30438
fix: Incorrect default amount to pay for POS invoices (backport #30438)
2022-04-10 18:56:02 +05:30
Deepesh Garg
ddbd82af95 Merge pull request #30459 from frappe/mergify/bp/develop/pr-30385
fix(India): Auto tax fetching based on GSTIN (backport #30385)
2022-04-10 18:55:26 +05:30
Deepesh Garg
809117229d Merge pull request #30626 from nextchamp-saqib/einv-utgst
feat(india): e-invoicing for intra-state union territory transactions
2022-04-10 18:54:17 +05:30
Ankush Menat
8138e53cf3 test: flaky picklist tests 2022-04-10 17:50:57 +05:30
Ankush Menat
c14c513214 ci: collate codecov reports before uploading
Currently due to flake partial reports are submitting which results in
constant fluctuation of coverage reports.
Change: First collect coverage and if all builds pass then submit it.
2022-04-10 17:50:57 +05:30
Deepesh Garg
5ac3e7e16e Merge pull request #30664 from frappe/mergify/bp/develop/pr-30662
fix: Implicit ignore pricing rule check on returns (backport #30662)
2022-04-10 17:07:03 +05:30
Deepesh Garg
a2937cffc7 fix: Implicit ignore pricing rule check on returns
(cherry picked from commit 1b25a7fe76)
2022-04-09 14:46:25 +00:00
Deepesh Garg
207bf85c74 Merge pull request #30488 from Havenir/fix-project-list-in-web-view
fix: web form filters for project
2022-04-09 20:06:49 +05:30
Deepesh Garg
cbd8998fc1 Merge branch 'develop' into mergify/bp/develop/pr-30438 2022-04-09 20:03:23 +05:30
Deepesh Garg
02c6b898a6 Merge branch 'develop' into mergify/bp/develop/pr-30385 2022-04-09 19:57:59 +05:30
Deepesh Garg
e30cc8422c fix: Resolve conflicts 2022-04-09 19:53:40 +05:30
Deepesh Garg
2e00678c76 Merge pull request #30542 from deepeshgarg007/disabled_tax_category
fix: Ignore disabled tax categories
2022-04-09 19:52:31 +05:30
mergify[bot]
51d77cd85e fix(pos): cannot change paid amount in pos payments (#30660) 2022-04-09 16:28:10 +05:30
Rucha Mahabal
cf2e6c6c08 fix: remove hardcoded employee fields that can be updated via Promotion 2022-04-09 13:15:37 +05:30
rahib-hassan
dc2944a041 fix[minor]: removed doc assignment 2022-04-09 03:55:25 +05:30
rahib-hassan
e19db77b73 Merge branch 'separate-discount-account' of github.com:rahib-hassan/erpnext into separate-discount-account 2022-04-09 03:53:51 +05:30
Suraj Shetty
199419db80 Merge branch 'develop' into exotel-fixes 2022-04-08 21:37:08 +05:30
Suraj Shetty
7ff5bc9e3d test: Clean up form_dict
To avoid failures like
https://github.com/frappe/erpnext/runs/5887687369?check_suite_focus=true#step:12:783
2022-04-08 21:33:29 +05:30
rahib-hassan
ac16f3b71f fix: lock timeout exceeded 2022-04-08 18:20:41 +05:30
Ankush Menat
af6b07f9b9 fix: block cancellation of SL/GL entries (#30652)
Individual GL/SLEs aren't supposed to be cancelled by users.
2022-04-08 18:05:04 +05:30
rahib-hassan
ac7f1cbd87 fix: minor fix 2022-04-08 17:46:49 +05:30
rahib-hassan
2173c8b114 fix(pathces): added to patches.txt 2022-04-08 17:29:08 +05:30
rahib-hassan
35e875c111 fix(patch): enable discount account in buying and selling if exist in accounts settings 2022-04-08 17:27:53 +05:30
Ankush Menat
fcbd25f27a chore: formatting 2022-04-08 17:24:10 +05:30
Deepesh Garg
b532ade383 fix: Download JSON for GSTR-1 report 2022-04-08 17:14:10 +05:30
rahib-hassan
171c60ff37 fix: removed discount account field from account settings 2022-04-08 16:50:56 +05:30
rahib-hassan
786887768e fix: removed discount-accounting code from account settings 2022-04-08 16:50:36 +05:30
Jannat Patel
59ad7e037c Merge pull request #30596 from pateljannat/remove-courses-template 2022-04-08 16:27:31 +05:30
rahib-hassan
b6ce497601 fix: removed discount account field from account settings 2022-04-08 15:08:21 +05:30
Ankush Menat
d74181630a test: prevent cancelling RIV of cancelled voucher 2022-04-08 14:57:55 +05:30
Ankush Menat
a281998bcb fix: prevent deleting repost queue for cancelled transactions 2022-04-08 14:57:55 +05:30
Deepesh Garg
617deda2ff Merge branch 'version-14-beta' into develop 2022-04-08 13:38:27 +05:30
Ankush Menat
49560d20bc fix: remove bad defaults from BOM operation (#30644)
[skip ci]
2022-04-08 11:23:02 +05:30
rahib-hassan
0fcdf1b613 removed discount-accounting from account settings 2022-04-08 08:10:27 +05:30
rahib-hassan
1babc5f367 feat: separated discount accounting settings for sales and purchase 2022-04-08 08:05:10 +05:30
Ankush Menat
8d57c853f3 feat: barcode scanning in quotation (#30637) 2022-04-07 21:40:03 +05:30
Ankush Menat
225deb949b fix: use empty row when batch is scanned (#30638) 2022-04-07 21:38:18 +05:30
Sam
8fbfba4f2f chore: class selectors for customizability (#30185)
* Update project_row.html

Really helpful those fields has own class when styling for mobile or desktop by using Website Settings --> HTML Header, Robots and Redirects

* chore: skewercase
2022-04-07 19:27:27 +05:30
Rucha Mahabal
0562eb5f56 Merge pull request #30588 from ruchamahabal/multiple-shifts 2022-04-07 18:44:16 +05:30
Ankush Menat
bc2c6018f7 ci: mergify auto merge on passing CI + approvals 2022-04-07 18:27:47 +05:30
Rucha Mahabal
7ba66b0320 Merge branch 'develop' into multiple-shifts 2022-04-07 18:07:39 +05:30
Ankush Menat
f1fd4e5c27 test: cant_change validations on item 2022-04-07 17:30:12 +05:30
Ankush Menat
fba68541d6 refactor(Item): linked doc checking 2022-04-07 17:30:12 +05:30
Ankush Menat
2f1e98d1e8 feat: show Stock Reconciliation links on item dashboard 2022-04-07 17:30:12 +05:30
Sagar Vora
26abfd4d7c Merge pull request #30634 from resilient-tech/fix-mutable-reassignment
fix: dont reassign mutable (list) to a different field
2022-04-07 17:24:52 +05:30
Sagar Vora
3b4754f3f6 fix: define tax_columns below consistency 2022-04-07 17:01:10 +05:30
Sagar Vora
fa4f57f470 fix: dont reassign mutable (list) to a different field 2022-04-07 16:51:27 +05:30
Deepesh Garg
18b1a93c7e Merge pull request #30606 from deepeshgarg007/exchange_gain_loss_button
fix: Exchange gain and loss button in Payment Entry
2022-04-07 16:49:05 +05:30
Deepesh Garg
c9d6618b9b Merge pull request #30628 from deepeshgarg007/pricng_rule_test
test: Pricing rule test for transactions
2022-04-07 16:37:02 +05:30
Ankush Menat
be04eaf723 fix: warehouse naming when suffix is present (#30621) 2022-04-07 13:21:08 +05:30
Deepesh Garg
22e8ae9dac test: Pricing rule test for transactions 2022-04-07 13:20:53 +05:30
Saqib Ansari
45fca6bed7 feat(india): e-invoicing for intra-state union territory transactions 2022-04-07 13:09:05 +05:30
Ankush Menat
a6e26cce87 chore: broken translations 2022-04-07 13:07:14 +05:30
Deepesh Garg
f3e6a26d34 Merge pull request #30499 from ruthra-kumar/payment_terms_status_filter
feat: 'customer' column and more filter to Payment terms status report
2022-04-07 13:01:16 +05:30
Rucha Mahabal
ec65af5f38 fix: show allocation history for earned leaves allocated via scheduler 2022-04-07 12:57:04 +05:30
Rucha Mahabal
6203ffc8fa fix: make New Leaves Allocated read-only if policy assignment is linked to the allocation and leave type is earned leave 2022-04-07 12:57:04 +05:30
Rucha Mahabal
f8f1c3d8b5 fix: enable Track Changes in Leave Allocation 2022-04-07 12:57:04 +05:30
Ankush Menat
e4c6d6a1a6 fix: strip html tags before checking for empty description (#30619) 2022-04-07 12:53:10 +05:30
Deepesh Garg
8feb4f08c5 fix: Exchange gain and loss button in Payment Entry 2022-04-06 20:51:51 +05:30
Ankush Menat
8e425252c4 chore: typo 2022-04-06 18:27:41 +05:30
Ankush Menat
9e2d54f9a4 chore: broken translation
[skip ci]
2022-04-06 18:21:28 +05:30
Ankush Menat
eebcf2a9f1 fix: only trigger onload checks on saved docs (#30603) 2022-04-06 18:13:55 +05:30
Deepesh Garg
9bf5f76ac8 fix: Deferred Revenue/Expense Account validation 2022-04-06 17:33:46 +05:30
Ankush Menat
8b090a9f7d fix: hide pending qty only if original item is assigned (#30599) 2022-04-06 16:35:36 +05:30
Ankush Menat
ba42c87687 refactor: don't use pandas for basic reports (#30597) 2022-04-06 15:40:41 +05:30
Jannat Patel
bce1c2a028 fix: removed unused courses template 2022-04-06 14:44:10 +05:30
Ankush Menat
bb875fe217 fix: check null values in is_cancelled patch (#30594) 2022-04-06 14:20:39 +05:30
HENRY Florian
4895761d89 fix: update translation (#30474)
* fix: update translation

* fix: update translation

* fix: update translation

* fix: update translation

* fix: update translation

* fix: update translation

* fix: update translation

* fix: update translation

* fix: update translation

* fix: update translation
2022-04-06 14:00:05 +05:30
Deepesh Garg
a818acf66d Merge pull request #30557 from deepeshgarg007/loan_repayment_issue
fix: Issues on loan repayment
2022-04-06 11:36:53 +05:30
Rucha Mahabal
00ddb4c42a Merge branch 'develop' into multiple-shifts 2022-04-06 11:22:46 +05:30
Rucha Mahabal
c5850e3923 Revert "feat: Scheduling Multiple shifts and Auto Attendance" (#30587) 2022-04-06 11:18:47 +05:30
Deepesh Garg
4c8dae40cd Merge branch 'develop' into loan_repayment_issue 2022-04-06 10:57:25 +05:30
Deepesh Garg
b8df82d23c Merge pull request #30555 from deepeshgarg007/party_account_user_perm
fix: Ignore user perm for party account company
2022-04-06 10:57:13 +05:30
Rucha Mahabal
f208903250 feat: Scheduling Multiple shifts and Auto Attendance (#29955)
* refactor: overlapping shifts validation

- convert raw query to frappe.qb

- check for overlapping timings if dates overlap

- translation friendly error messages with link to overlapping doc

* refactor: consider timeslots in `get_employee_shift`

* fix: handle shift grace overlap while finding current shift

* refactor: handle shifts spanning over 2 different days

* fix: fetching shift on timing boundaries

* refactor: rewrite docstrings and add type hints for functions

* refactor: Allow multiple attendance records creation for different shifts

* feat: auto attendance marking for multiple shifts on the same day

* refactor: mark absent for employees with no attendance

- break down into smaller functions

- make it work with multiple shifts

- this will mark employee as absent per shift, meaning employee can be present for one shift and absent for another on the same day

* chore: sort imports, remove unused imports

* refactor: Monthly Attendance Sheet

- split into smaller functions

- add type hints

- get rid of unnecessary db calls and loops

- add docstrings for functions

* feat: add colors for attendance status to lessen the cognitive load

- legend with colors and full form for status abbreviations

* feat: show shift-wise attendance in monthly attendance sheet

* test: monthly attendance sheet

* style: format code with black

* chore: ignore formatting changes in blame

* test: fetching shifts in Employee Checkins

* fix(test): make holiday list for shift and checkin tests

* fix: tests

* test: shift assignment creation

* fix: attendance fixes

- check half day attendance threshold before absent threshold to avoid half day getting marked as absent

- round working hours to 2 digits for better accuracy

- start and end dates for absent attendance marking

* test: Shift Type with Auto Attendance setup and working

fix test setups

* refactor: Overlapping validation for Shift Request

- commonify time overlap function between request and assignment

- add tests for shift request overlap

* chore: remove unused import

* fix: add validation for overlapping shift attendance

- skip auto attendance in case of overlapping shift attendance record

- this case won't occur in case of shift assignment, since it will not allow overlapping shifts to be assigned

- can happen if manual attendance records are created

* test: validations for duplicate and overlapping shift attendance records

* test: skip auto attendance

* fix: skip validation for overlapping shift attendance if no shift is linked

* test: add holiday related shift and attendance tests

* test: add attendance sheet tests for employee filter, half days

* fix: sider
2022-04-06 10:56:47 +05:30
Deepesh Garg
dec0c1b5bb test: Ignore parent company account creation 2022-04-06 10:21:27 +05:30
Deepesh Garg
41a979ef34 Merge branch 'develop' of https://github.com/frappe/erpnext into party_account_user_perm 2022-04-06 10:15:16 +05:30
Deepesh Garg
631545aa32 fix: Use get instead of dot
(cherry picked from commit 95298f0400)
2022-04-06 04:31:13 +00:00
Deepesh Garg
714fc08150 fix: Do not apply shipping rule for POS transactions
(cherry picked from commit c0ebcfb393)

# Conflicts:
#	erpnext/public/js/controllers/taxes_and_totals.js
2022-04-06 04:31:13 +00:00
Deepesh Garg
ec6f7040f4 Merge branch 'develop' into mergify/bp/develop/pr-30385 2022-04-06 10:00:51 +05:30
Deepesh Garg
4727e774c0 Merge branch 'develop' into loan_repayment_issue 2022-04-06 10:00:34 +05:30
Suraj Shetty
ce583c9a81 Merge branch 'develop' into exotel-fixes 2022-04-05 19:48:44 +05:30
Marica
ff7d81020c Merge pull request #30578 from marination/e-com-acessibility
chore: Accessibility for E-commerce Doctypes
2022-04-05 18:11:59 +05:30
Saqib Ansari
c4b5fa8ed1 Merge pull request #30573 from frappe/mergify/bp/develop/pr-30382
fix: Added validation for single_threshold in Tax With Holding Category (backport #30382)
2022-04-05 15:52:28 +05:30
Saqib Ansari
7757790572 Merge pull request #30579 from nextchamp-saqib/eway-bill-dialog-fix
fix: fetch from fields not working in eway bill dialog
2022-04-05 15:51:38 +05:30
Saqib Ansari
1bc0557a6c Merge pull request #30553 from nextchamp-saqib/e-inv-paid-invoice-fix
fix(india): minor e-invoicing fixes
2022-04-05 15:51:25 +05:30
Saqib Ansari
c8779aa446 fix: fetch from fields not working in eway bill dialog 2022-04-05 15:44:17 +05:30
Saqib Ansari
2451452434 Merge branch 'develop' into e-inv-paid-invoice-fix 2022-04-05 13:12:08 +05:30
marination
065623ce25 chore: Add Prices, Stock and E-com Settings access from Website Item 2022-04-05 12:30:02 +05:30
marination
d4301d6d2f chore: Accessibility for E-commerce Doctypes
- Add Website Item routing button and dashboard link in Item master
- Group Item variant buttons together
2022-04-05 12:07:50 +05:30
ruthra kumar
16bfb930f8 test: added test cases for group filters 2022-04-05 11:08:09 +05:30
Rucha Mahabal
0e1528365d fix: sider 2022-04-04 21:31:14 +05:30
Rucha Mahabal
bd077dbb3b test: add attendance sheet tests for employee filter, half days 2022-04-04 21:26:42 +05:30
Rucha Mahabal
fec47632bc test: add holiday related shift and attendance tests 2022-04-04 21:02:22 +05:30
Suraj Shetty
ca66224d57 Merge branch 'develop' into exotel-fixes 2022-04-04 20:22:06 +05:30
Suraj Shetty
01909d2e8c test: Fix used frappe._dict to avoid AttributeError down the line
ref: https://github.com/frappe/erpnext/runs/5816574721?check_suite_focus=true#step:12:880
2022-04-04 20:21:36 +05:30
Rucha Mahabal
7675542926 Merge pull request #30569 from ruchamahabal/fix-leave-alloc-update 2022-04-04 20:18:55 +05:30
Marica
3c3aca9568 Merge pull request #30522 from marination/redisearch-app-install
feat: Redisearch with consent
2022-04-04 19:24:06 +05:30
Sherin KR
e796267214 fix: Validation for single threshold in Tax With Holding Category (#30382)
(cherry picked from commit 0a2c72c594)
2022-04-04 13:38:43 +00:00
Rucha Mahabal
793164ac2e fix(test): set company for employee in leave allocation test setup 2022-04-04 19:08:27 +05:30
Rucha Mahabal
5499cecffd test: leave allocation validations and total value for updates done before and after submission 2022-04-04 18:32:17 +05:30
Ankush Menat
a9811c601c Merge pull request #30564 from rohitwaghchaure/fixed-rejected-warehouse-issue-for-pr
fix: if accepted warehouse not selected during rejection then stock ledger not created
2022-04-04 18:26:17 +05:30
Suraj Shetty
117e5d05a3 Merge branch 'develop' into exotel-fixes 2022-04-04 18:21:46 +05:30
Rucha Mahabal
7b406f422d Merge branch 'develop' into multiple-shifts 2022-04-04 18:14:49 +05:30
Marica
0a592e085c Merge branch 'develop' into redisearch-app-install 2022-04-04 18:00:56 +05:30
Rohit Waghchaure
ac5df1abbe test: test case to validate rejected qty without accepted warehouse 2022-04-04 17:57:57 +05:30
Rucha Mahabal
3538656a7d fix: total leaves allocated not validated and recalculated on updates post submission 2022-04-04 17:52:30 +05:30
Ankush Menat
de83511091 fix(ux): refresh update to zero val checkbox (#30567) 2022-04-04 17:29:51 +05:30
ruthra kumar
b2ed9fd3fe refactor: use group fields from Sales Order and Sales Order Items 2022-04-04 17:00:47 +05:30
Ankush Menat
74e9bc6d65 chore: loosen pandas dependency and bump redisearch (#30249) 2022-04-04 16:58:25 +05:30
Ankush Menat
0f2eaa2cf3 chore: add ui test badge 2022-04-04 16:24:09 +05:30
Marica
569eff4f27 Merge branch 'develop' into redisearch-app-install 2022-04-04 16:10:01 +05:30
Saqib Ansari
fed66038b5 fix(pos): do not reset search input on item selection (#30537) 2022-04-04 15:59:16 +05:30
Rohit Waghchaure
0a71cabab1 fix: if accepted warehouse not selected during rejection then stock ledger not created 2022-04-04 15:42:59 +05:30
Ankush Menat
12c01e2975 fix: maintain FIFO queue even if outgoing_rate is not found (#30560) 2022-04-04 15:22:15 +05:30
ruthra kumar
e324d668d3 refactor: item filters are linked with group filters 2022-04-04 14:52:19 +05:30
Saqib Ansari
b91bf40f1b fix: server error while viewing gst e-invoice 2022-04-04 14:40:07 +05:30
Ankush Menat
52eb0a93bb Merge pull request #30528 from s-aga-r/is-subcontracted-fieldtype
refactor!: change "is_subcontracted" field type from "Select" to "Check"
2022-04-04 14:01:20 +05:30
Ankush Menat
a896895a9e fix: bulk fix (~330) missing translations 2022-04-04 13:59:51 +05:30
Sagar Sharma
e80cd29d2e Merge branch 'develop' into is-subcontracted-fieldtype 2022-04-04 13:31:46 +05:30
Marica
bfb2fbea5f Merge branch 'develop' into redisearch-app-install 2022-04-04 13:27:50 +05:30
Deepesh Garg
194605823e fix: Issues on loan repayment 2022-04-04 13:25:35 +05:30
marination
397b46a08b chore: Add TODOs(perf) for Redisearch Query 2022-04-04 13:24:56 +05:30
Saqib Ansari
92f632c4b1 Merge branch 'develop' into e-inv-paid-invoice-fix 2022-04-04 13:10:25 +05:30
marination
3445682563 fix: Payload incorrect data (pass item_group.name) 2022-04-04 12:33:25 +05:30
Deepesh Garg
18a3c5d536 fix: Ignore user perm for party account company 2022-04-04 12:32:33 +05:30
Saqib Ansari
0c26f9a8c8 fix(india): cannot generate e-invoice for is_pos invoices
* If mode of payment > 18 characters, the e-invoice portal throws error
2022-04-04 12:28:09 +05:30
Ankush Menat
cf5f37e6d8 refactor: move schema change patch higher up 2022-04-04 12:15:26 +05:30
Ankush Menat
e8118fcdf1 fix: doctype layout based on expected tab-order 2022-04-04 12:06:35 +05:30
Ankush Menat
deca1aaf06 fix: dont fetch qty in reco if batch is required 2022-04-04 12:06:35 +05:30
Ankush Menat
f83a1c1989 fix: dont reset barcode in scan mode 2022-04-04 12:06:35 +05:30
Ankush Menat
1736ab57ac feat: Barcode scanning in Stock Reconciliation
[skip ci]
2022-04-04 12:06:35 +05:30
marination
7ef1ccbe84 fix: Add default score of 1 to Item Group Autocompleter
- If score 0 is inserted into suggestions, RS does not consider that suggestion
2022-04-04 12:04:35 +05:30
marination
97e3a855f7 fix: Convert payload to string before adding to autocompleter 2022-04-04 11:32:49 +05:30
Rucha Mahabal
d9f00409b9 Merge branch 'develop' into multiple-shifts 2022-04-04 11:19:03 +05:30
Suraj Shetty
40d33b5fec test: Use FrappeAPITestCase to track coverage 2022-04-04 11:15:29 +05:30
Rucha Mahabal
1d4b1c42f2 fix: skip validation for overlapping shift attendance if no shift is linked 2022-04-04 11:14:40 +05:30
marination
ea036e4958 fix: Better Exception Handling and vaeiabl naming
- Function to handle RS exceptions (create log and raise error)
- Handle `ResponseError` where it is anticipated
- Misc: Better variables
2022-04-04 11:07:53 +05:30
Rucha Mahabal
62cdde9a84 test: skip auto attendance 2022-04-04 11:05:03 +05:30
Rucha Mahabal
277bda11dd test: validations for duplicate and overlapping shift attendance records 2022-04-04 11:04:24 +05:30
Rucha Mahabal
83489be7d9 fix: add validation for overlapping shift attendance
- skip auto attendance in case of overlapping shift attendance record

- this case won't occur in case of shift assignment, since it will not allow overlapping shifts to be assigned

- can happen if manual attendance records are created
2022-04-04 11:00:26 +05:30
Suraj Shetty
f4b8573e64 test: Fix erroneous code 2022-04-04 09:31:15 +05:30
Suraj Shetty
cfee53eb55 fix: Handle exception where no employee is returned 2022-04-04 07:38:15 +05:30
Suraj Shetty
39abfae5fe chore: Remove unused code
- and simplify get_call_log
2022-04-04 07:28:41 +05:30
Suraj Shetty
0e9ebad9c6 test: Refactor exotel test setup
- Remove unnecessary code
- Move test data to separate file
- Make proper test assertions
2022-04-04 07:23:08 +05:30
Rucha Mahabal
7bd84f2696 chore: remove unused import 2022-04-03 23:58:04 +05:30
Rucha Mahabal
58fb2f7dde refactor: Overlapping validation for Shift Request
- commonify time overlap function between request and assignment

- add tests for shift request overlap
2022-04-03 23:54:03 +05:30
Rucha Mahabal
6fffdcf0c7 test: Shift Type with Auto Attendance setup and working
fix test setups
2022-04-03 22:37:10 +05:30
Rucha Mahabal
655c1dd6ab fix: attendance fixes
- check half day attendance threshold before absent threshold to avoid half day getting marked as absent

- round working hours to 2 digits for better accuracy

- start and end dates for absent attendance marking
2022-04-03 21:47:32 +05:30
Suraj Shetty
6644ebd52d Merge branch 'develop' into exotel-fixes 2022-04-03 21:17:29 +05:30
Deepesh Garg
a7e125a540 chore: format patch file 2022-04-02 20:36:36 +05:30
Deepesh Garg
c58fde2fb2 fix: Add competitor field back 2022-04-02 20:03:46 +05:30
Deepesh Garg
205c8c2bda Merge pull request #30191 from abhinavxd/patch-3
fix: incorrect payable amount for loan closure
2022-04-02 19:53:07 +05:30
Deepesh Garg
7e185fb0f2 Merge branch 'develop' of https://github.com/frappe/erpnext into patch-3 2022-04-02 17:42:09 +05:30
Deepesh Garg
485f5cfdfe fix: Resolve conflicts 2022-04-02 17:25:29 +05:30
Deepesh Garg
0f6d52c625 Merge branch 'develop' of https://github.com/frappe/erpnext into mergify/bp/develop/pr-30385 2022-04-02 17:24:19 +05:30
Subin Tom
e57e7bb02c fix: added tests(fixed) 2022-04-02 17:16:56 +05:30
Ankush Menat
c8ead0a7ab fix: dont send empty serial no in get_item_details
[skip ci]
2022-04-01 21:11:03 +05:30
Ankush Menat
6a069d6efa feat: dont trigger selector if all info is scanned 2022-04-01 21:11:03 +05:30
Ankush Menat
47f27a5171 refactor: move scan api to stock utils; add item_info 2022-04-01 21:11:03 +05:30
Ankush Menat
9bf427985f fix!: remove barcode field triggers
use "scan barcode" field instead for scanning

[skip ci]
2022-04-01 21:11:03 +05:30
Ankush Menat
530f767098 revert: "fix: ignore circular dependencies on barcode scan"
This reverts commit 98468fab18.
2022-04-01 21:11:03 +05:30
Ankush Menat
767b827b59 feat: return batch code while scanning serial no 2022-04-01 21:11:03 +05:30
marination
07f17453cd fix: Use Payload in AutoCompleter (categories in search) and misc
- Separate Item group and Item autocomplete dict definition
- Add payload along with Item group, containing namke and route
- Pass weightage while defining item group autocomplete dict (auto sort)
- Use payload while getting results for categories in search
- Remove check to show categories, always show
- Search fields mandatory if reidsearch enabled
- Code separation (rough)
2022-04-01 18:47:01 +05:30
gavin
1d2e9e8e1c Merge pull request #30521 from gavindsouza/misc-fixes-0
fix: Handle changes in frappe's get_monthly_goal_graph_data API
2022-04-01 17:28:59 +05:30
Gavin D'souza
f8c9fba52d fix: Handle changes in frappe's get_monthly_goal_graph_data API 2022-04-01 17:18:47 +05:30
Sagar Sharma
f94d607288 feat: New module "Subcontracting" 2022-04-01 16:28:34 +05:30
Sagar Sharma
01c64915c8 chore: remove unwanted validation 2022-04-01 15:51:48 +05:30
Ankush Menat
6c5b01c60d perf: index barcode for faster scans (#30543) 2022-04-01 15:27:46 +05:30
Alberto826
5d14e7860e Fix: Remove trailing slash "/" from route (#30532)
Routes with trailing slash "/" causes a redirect to port 8080 in docker host with reverse proxy.
The Student Admission Row template has this issue.
2022-04-01 14:48:00 +05:30
Deepesh Garg
9a6a181f14 fix: Ignore disabled tax categories 2022-04-01 14:46:26 +05:30
Rucha Mahabal
65763275ae fix: convert dates to datetime before comparing in leave days calculation and fix half day edge case (#30538) 2022-04-01 13:47:52 +05:30
Sagar Sharma
0a3cdc2623 chore: rename "is_subcontracted" field label to "Is Subcontracted" 2022-04-01 13:22:54 +05:30
Sagar Sharma
d074c93ac7 refactor!: change "is_subcontracted" field type from "Select" to "Check" 2022-04-01 13:22:44 +05:30
Ankush Menat
257623509d perf: use cached single docs (#30536)
frappe.local is request specific thread local, hence is almost as good
as no caching.
2022-04-01 11:55:19 +05:30
Saqib Ansari
bfc34e1084 fix: check for debit credit difference even after round-off adjustment (#30050) 2022-04-01 11:03:16 +05:30
Deepesh Garg
8598d64d2c Merge pull request #30502 from dj12djdjs/fix-pe-ex-rate-precision
fix(accounts): payment entry exchange rate precision
2022-04-01 09:48:15 +05:30
Deepesh Garg
df06d263ae Merge pull request #30510 from deepeshgarg007/tax_mapping
fix: Taxes getting overriden from mapped to target doc
2022-04-01 09:43:19 +05:30
rohitwaghchaure
8d16c7f44b Merge pull request #30527 from rohitwaghchaure/feat-pick-list-item-reference-in-delivery-note
feat: minor, pick list item reference on delivery note item table
2022-03-31 20:22:49 +05:30
Rohit Waghchaure
2f51011f91 test: test case to check pick list name has mapped or not 2022-03-31 18:47:09 +05:30
Rohit Waghchaure
2f63ae2ee9 feat: minor, pick list item reference on delivery note item table 2022-03-31 18:43:42 +05:30
Deepesh Garg
02dab021c6 Merge pull request #30500 from deepeshgarg007/auto_tax_gst
fix(India): Tax fetching based on tax category
2022-03-31 18:01:32 +05:30
marination
7e207c8901 fix: Call Redisearch index creation functions on enabling redisearch in settings 2022-03-31 16:29:18 +05:30
Marica
96fc6ad590 Merge pull request #30146 from marination/bom-update-tool
refactor: Add exception handling in background job within BOM Update Tool
2022-03-31 15:54:34 +05:30
Marica
cd9d07028d Merge branch 'develop' into bom-update-tool 2022-03-31 14:54:05 +05:30
Marica
901d8eac57 Merge pull request #30509 from marination/buying-validate-items
fix: Add non-existent Item check and cleanup in `validate_for_items`
2022-03-31 14:52:34 +05:30
Saqib Ansari
9af353ffa9 Merge pull request #30461 from nextchamp-saqib/fix-asset-warehouse-validation
fix(asset): do not validate warehouse on asset purchase
2022-03-31 14:15:16 +05:30
Deepesh Garg
e0631474c0 Merge branch 'develop' into auto_tax_gst 2022-03-31 13:52:10 +05:30
Deepesh Garg
544533ced2 Merge pull request #30486 from deepeshgarg007/account_currenct_change_test
fix: Account currency validation
2022-03-31 13:39:04 +05:30
marination
93f6346cea fix: (test) change expected exception due to https://github.com/frappe/frappe/pull/16454 2022-03-31 13:07:51 +05:30
marination
2fece523f6 chore: Added BOM std filters and update type in List View 2022-03-31 12:55:48 +05:30
Saqib Ansari
4623a1bc57 fix(test): Item MacBook does not exist 2022-03-31 12:48:00 +05:30
Marica
f482b184a0 Merge branch 'develop' into bom-update-tool 2022-03-31 12:42:56 +05:30
Rucha Mahabal
d45e286216 test: shift assignment creation 2022-03-31 12:15:38 +05:30
Deepesh Garg
4720969ce6 fix: Taxes getting overriden from mapped to target doc 2022-03-31 12:14:16 +05:30
marination
982a246eec fix: Add non-existent Item check and cleanup in validate_for_items
- Added a validation if invalid item code ia passed via data import/API, etc.
- Used DB APIs instead of raw sql
- Separated checks into separate functions
- Added return types to functions
- Better variable naming and removed redundant utils import in function
2022-03-31 11:47:20 +05:30
Saqib Ansari
199a6da960 perf: skip warehouse validation for non-stock items 2022-03-31 11:41:52 +05:30
Rucha Mahabal
e4cc0c1c87 fix: tests 2022-03-31 00:21:23 +05:30
Rucha Mahabal
97547da7ee fix(test): make holiday list for shift and checkin tests 2022-03-31 00:17:32 +05:30
Devin Slauenwhite
62266b29aa fix: exchange rate precision 2022-03-30 14:22:44 -04:00
Rucha Mahabal
af139193a5 test: fetching shifts in Employee Checkins 2022-03-30 23:27:49 +05:30
Ankush Menat
b981fae5a4 fix: remove naming series from bin, repost queue (#30497)
Removing naming series from:
1. Bin
2. Repost queue

These doctypes are not user facing and dont really need naming series.
Current implementation of naming makes stock transaction sequential if
these documents are to be created during submission.
2022-03-30 21:46:15 +05:30
Deepesh Garg
45f78977bf Merge pull request #30493 from nabinhait/party-account-in-ar-ap-report
feat: Receivable/Payable Account column and filter in AR/AP report
2022-03-30 21:16:32 +05:30
Deepesh Garg
d93edbc859 fix: make test record 2022-03-30 21:07:56 +05:30
Deepesh Garg
532961fad2 fix(India): Tax fetching based on tax category 2022-03-30 19:33:44 +05:30
ruthra kumar
7558f1b078 refactor: adding new filters and column to test cases 2022-03-30 18:50:18 +05:30
ruthra kumar
eaeadbc422 feat: additional filters in payment terms status report 2022-03-30 18:50:13 +05:30
marination
a945484af4 test: Added test for 2 more validations
- Covers full validate function
2022-03-30 18:20:54 +05:30
marination
620575a901 fix: Type Annotations, Redundancy, etc.
- Renamed public function`update_new_bom` to `update_new_bom_in_bom_items`
- Replaced `get_cached_doc` with `get_doc`
- Removed click progress bar (drive through update log)
- Removed `bom_obj.update_new_bom()`, was redundant. Did same job as `update_new_bom_in_bom_items`
- Removed `update_new_bom()` in `bom.py`, unused.
- Prettier query formatting
- `update_type` annotated as non optional Literal
- Removed redundant use of JobTimeoutException
- Corrected type annotations in `create_bom_update_log()`
2022-03-30 18:03:52 +05:30
mergify[bot]
89a9afab94 fix: cast array slice index integer while splitting serial_nos array (#30468) (#30496)
(cherry picked from commit 3f3717952c)

Co-authored-by: Anoop <anoop@earthianslive.com>
2022-03-30 17:00:28 +05:30
gavin
b9d37152ba Merge pull request #30494 from resilient-tech/fix-get-cached-value
fix: update `get_cached_value` usage based on changes in definition
2022-03-30 16:26:51 +05:30
Sagar Vora
7bece37918 fix: update get_cached_value usage based on changes in definition 2022-03-30 15:35:56 +05:30
Saqib Ansari
5408980223 Merge pull request #30453 from rahib-hassan/fix-paymentorder-row-delete
fix: enable row deletion in reference table
2022-03-30 15:31:54 +05:30
Rucha Mahabal
72501f2161 Merge branch 'develop' into multiple-shifts 2022-03-30 15:28:51 +05:30
Rucha Mahabal
0a3cf64037 chore: ignore formatting changes in blame 2022-03-30 15:24:55 +05:30
Rucha Mahabal
baec607ff5 style: format code with black 2022-03-30 15:23:13 +05:30
Rucha Mahabal
acb27430ac test: monthly attendance sheet 2022-03-30 15:14:31 +05:30
Saqib Ansari
291415d255 Merge pull request #30453 from rahib-hassan/fix-paymentorder-row-delete
fix: enable row deletion in reference table
2022-03-30 15:00:16 +05:30
Saqib Ansari
03e6a6c699 Merge branch 'develop' into fix-asset-warehouse-validation 2022-03-30 14:58:49 +05:30
Rucha Mahabal
9ff1904aec fix: explicitly check if additional salary is recurring while fetching components for payroll (#30489) 2022-03-30 14:47:11 +05:30
Ahmad
1fdc085d17 fix: web form filter for project 2022-03-30 13:23:30 +05:00
marination
ebf00946c9 fix: Semgrep
- Explain explicit commits and skip semgrep
- Format client side translated string correctly
2022-03-30 13:22:29 +05:30
Ankush Menat
8ab226a2fc test: add class to uniquely id item dashboard (#30487) 2022-03-30 13:20:54 +05:30
marination
79495679e2 fix: Auto format bom_update_log.py 2022-03-30 13:08:58 +05:30
marination
1d1e925bcf test: API hit via BOM Update Tool
- test creation of log and it's impact
2022-03-30 13:01:01 +05:30
Ankush Menat
62c57199f2 chore: remove ui test config
[skip ci]
2022-03-30 12:50:37 +05:30
Deepesh Garg
d4cc7c553e fix: Account currency validation 2022-03-30 12:43:18 +05:30
Ankush Menat
fe96254730 chore: skip style checks in sider
[skip ci]
2022-03-30 12:36:09 +05:30
Marica
7e719a12f1 Merge pull request #30377 from marination/stock-entry-items-idx
fix: Dont set `idx` while adding WO items to Stock Entry
2022-03-30 11:14:18 +05:30
Saqib Ansari
87dc9c6331 Merge pull request #30470 from nextchamp-saqib/fix-dn-credit-limit-validation
fix: credit limit validation in delivery note
2022-03-30 11:08:25 +05:30
Marica
a51ba4cedf Merge branch 'develop' into bom-update-tool 2022-03-30 10:36:15 +05:30
marination
b5ad626d23 fix: Linter 2022-03-30 10:22:05 +05:30
Saqib Ansari
6528218ac3 perf: skip warehouse validation for non-stock items 2022-03-29 18:43:33 +05:30
Ankush Menat
b80fac03af fix: validate 0 transfer qty in stock entry (#30476) 2022-03-29 17:19:22 +05:30
Rucha Mahabal
41cfcdba44 feat: show shift-wise attendance in monthly attendance sheet 2022-03-29 16:10:46 +05:30
Rucha Mahabal
865204a541 feat: add colors for attendance status to lessen the cognitive load
- legend with colors and full form for status abbreviations
2022-03-29 16:10:46 +05:30
Rucha Mahabal
e79d292233 refactor: Monthly Attendance Sheet
- split into smaller functions

- add type hints

- get rid of unnecessary db calls and loops

- add docstrings for functions
2022-03-29 16:10:41 +05:30
Rucha Mahabal
f2ee36579b chore: sort imports, remove unused imports 2022-03-29 16:09:47 +05:30
Rucha Mahabal
4ef2911953 refactor: mark absent for employees with no attendance
- break down into smaller functions

- make it work with multiple shifts

- this will mark employee as absent per shift, meaning employee can be present for one shift and absent for another on the same day
2022-03-29 16:09:39 +05:30
Rucha Mahabal
742c8f0790 feat: auto attendance marking for multiple shifts on the same day 2022-03-29 16:08:43 +05:30
Rucha Mahabal
cb3b330097 refactor: Allow multiple attendance records creation for different shifts 2022-03-29 16:05:36 +05:30
Rucha Mahabal
f6a12a902f refactor: rewrite docstrings and add type hints for functions 2022-03-29 16:05:01 +05:30
Rucha Mahabal
e7cbb5fe6b fix: fetching shift on timing boundaries 2022-03-29 16:02:42 +05:30
Rucha Mahabal
62e72752dc refactor: handle shifts spanning over 2 different days 2022-03-29 16:02:17 +05:30
Rucha Mahabal
ace3f8a023 fix: handle shift grace overlap while finding current shift 2022-03-29 16:01:25 +05:30
Rucha Mahabal
625a9f69f5 refactor: consider timeslots in get_employee_shift 2022-03-29 16:01:18 +05:30
Rucha Mahabal
3711119a66 refactor: overlapping shifts validation
- convert raw query to frappe.qb

- check for overlapping timings if dates overlap

- translation friendly error messages with link to overlapping doc
2022-03-29 15:59:56 +05:30
Ankush Menat
b12fe0f15b fix: dont check for failed repost while freezing (#30472)
[skip ci]
2022-03-29 13:54:26 +05:30
marination
fa3b953cf7 test: idx mapping correctness 2022-03-29 13:54:14 +05:30
Saqib Ansari
c122882884 fix: credit limit validation in delivery note 2022-03-29 13:36:00 +05:30
Marica
88a460b54e Merge branch 'develop' into stock-entry-items-idx 2022-03-29 13:18:08 +05:30
Ankush Menat
0cb9cdb414 Merge branch 'develop' into fix-asset-warehouse-validation 2022-03-29 11:48:35 +05:30
Ankush Menat
d29e314c81 ci: pin click for black (#30464)
[skip ci]
2022-03-29 11:47:28 +05:30
Ankush Menat
76dce2eddc fix: use name for links not item_code (#30462) 2022-03-29 11:21:03 +05:30
Saqib Ansari
b60fad6113 Merge branch 'develop' of https://github.com/frappe/erpnext into fix-asset-warehouse-validation 2022-03-29 10:50:21 +05:30
Saqib Ansari
136466d255 fix(asset): do not validate warehouse on asset purchase 2022-03-29 10:47:27 +05:30
Deepesh Garg
03952f8819 fix(India): Auto tax fetching based on GSTIN
(cherry picked from commit 7cae669e81)

# Conflicts:
#	erpnext/patches.txt
#	erpnext/regional/india/setup.py
#	erpnext/selling/doctype/quotation/quotation.json
2022-03-29 04:56:49 +00:00
Deepesh Garg
760e68b656 Merge pull request #30426 from frappe/mergify/bp/develop/pr-30395
fix: Write off amount wrongly calculated in POS Invoice (backport #30395)
2022-03-29 07:56:15 +05:30
marination
639d380c1f chore: Remove redundant idx query and value setting
- idx can be removed from `select_columns` as it is already in the main query
- setting idx to '' is not required as it is not used further
2022-03-28 21:00:00 +05:30
Ankush Menat
63d892454b Merge branch 'develop' into bom-update-tool 2022-03-28 20:28:21 +05:30
Ankush Menat
40d7418dca Merge branch 'develop' into stock-entry-items-idx 2022-03-28 20:21:21 +05:30
Ankush Menat
3821a97a75 Merge branch 'develop' into mergify/bp/develop/pr-30395 2022-03-28 20:14:19 +05:30
Ankush Menat
7ef54809be Merge branch 'develop' into exotel-fixes 2022-03-28 19:55:39 +05:30
Ankush Menat
7c0c31bc6a Merge pull request #29783 from ankush/format
style: force auto-formatted code
2022-03-28 19:19:02 +05:30
Ankush Menat
b0f7931b2b chore: ignore black formatting changes in blame 2022-03-28 18:54:12 +05:30
Ankush Menat
494bd9ef78 style: format code with black 2022-03-28 18:52:46 +05:30
Ankush Menat
21e00da3d6 ci: force black formatting (pre-commit) 2022-03-28 18:47:20 +05:30
Ankush Menat
8dff4d66a4 fix: bom valuation - handle lack of LPP (#30454) 2022-03-28 18:18:23 +05:30
Sagar Vora
77c36f6d22 fix: set options for Currency field Incoming Rate (#30384) 2022-03-28 17:55:23 +05:30
Raffael Meyer
c01fe74cf0 fix(patch): fix failing patches (#30427)
* patch: reload Opportunity

* patch: reload child tables before doctype
2022-03-28 17:53:54 +05:30
Saqib Ansari
eea183957a Merge pull request #30419 from nextchamp-saqib/fix-item-tax-template-patch
fix: move item tax to item tax template patch
2022-03-28 17:34:31 +05:30
rahib-hassan
500870b2b0 fix: enable row deletion in reference table 2022-03-28 15:25:01 +05:30
Ankush Menat
b58b1343bb refactor: dont harcode "serial_no" field 2022-03-28 12:07:00 +05:30
Ankush Menat
98468fab18 fix: ignore circular dependencies on barcode scan 2022-03-28 12:07:00 +05:30
Ankush Menat
806f420ddd fix: revert global flag added for erasing barcode
This looked like a hack and doesn't even work anyway! how can row level
barcode-item relation be maitnained on entire form?
2022-03-28 12:07:00 +05:30
Ankush Menat
17a2ceb5d1 style: prettier js 2022-03-28 12:07:00 +05:30
Ankush Menat
9f0e7949aa fix: clean up if item is not found 2022-03-28 12:07:00 +05:30
Ankush Menat
32e44f5121 fix: correctly capture first serial no 2022-03-28 12:07:00 +05:30
Ankush Menat
b3c604d679 refactor: dont hardcode child table name 2022-03-28 12:07:00 +05:30
Ankush Menat
3a8656b3c8 refactor: split data update responsibilty to multiple functions
Apply "single responsibilty principle"
2022-03-28 12:07:00 +05:30
Ankush Menat
c34847e801 refactor: dont hardcode child table "items" 2022-03-28 12:07:00 +05:30
Ankush Menat
893139f963 refactor: dont hardcode "scan_barcode" field 2022-03-28 12:07:00 +05:30
Ankush Menat
bd06ffab00 refactor: store scannned field as attr 2022-03-28 12:07:00 +05:30
Ankush Menat
2d15413c9e refactor: transaction.js -> barcode_scanner.js 2022-03-28 12:07:00 +05:30
Ankush Menat
18abb28744 fix(barcode_scan): dont add duplicate serial nos 2022-03-28 12:07:00 +05:30
Ankush Menat
b06123bc65 fix: trigger table_add on new row 2022-03-28 12:07:00 +05:30
Ankush Menat
a270f12855 fix(UX): reduce duration of barcode scan toasts
default is 7 which is bit too much when you're scanning lots of items,
switched to 5 sec delay
2022-03-28 12:07:00 +05:30
Ankush Menat
69ae2661d2 fix: update picked qty on cancellation 2022-03-28 10:43:32 +05:30
Deepesh Garg
33fa14b6cf fix: Resolve conflicts 2022-03-27 19:23:53 +05:30
Deepesh Garg
18c5b24ac1 fix: Update condition 2022-03-27 19:20:37 +05:30
Deepesh Garg
fc09377de2 fix: Resolve conflicts 2022-03-27 19:18:32 +05:30
Deepesh Garg
485e6b6a09 fix: Incorrect default amount to pay for POS invoices
(cherry picked from commit a044e92687)

# Conflicts:
#	erpnext/public/js/controllers/taxes_and_totals.js
2022-03-27 12:31:36 +00:00
Ankush Menat
e401ad3f90 refactor: replace dead duplicate code 2022-03-26 19:33:00 +05:30
Ankush Menat
9daea6fa6c perf: slimmer and faster before_tests 2022-03-26 19:33:00 +05:30
Saqib Ansari
c10e4977c3 Merge pull request #30420 from nextchamp-saqib/fix-minor-custom-cash-flow
fix: unsupported operand type(s) for +=: 'int' and 'NoneType'
2022-03-26 19:15:34 +05:30
Saqib Ansari
4766732b56 Merge branch 'develop' into fix-item-tax-template-patch 2022-03-26 11:48:41 +05:30
Saqib Ansari
8e7c214e9e Merge branch 'develop' into fix-minor-custom-cash-flow 2022-03-26 11:48:40 +05:30
Deepesh Garg
0312c502ac Merge pull request #30430 from frappe/mergify/bp/develop/pr-30429
fix: Check for onload property (backport #30429)
2022-03-25 21:54:59 +05:30
Deepesh Garg
2e9648538e fix: Check for onload property
(cherry picked from commit 71402b43a7)
2022-03-25 16:23:44 +00:00
Rucha Mahabal
ffec9516fa fix: do not update status to Paid if sanctioned amount is 0 2022-03-25 21:41:48 +05:30
Rucha Mahabal
2d915782cb chore: sort imports 2022-03-25 21:41:48 +05:30
Rucha Mahabal
edf0c0030e test: expense claim against fully and partially paid advances 2022-03-25 21:41:48 +05:30
Rucha Mahabal
0461223627 fix: Expense Claim conditions for Paid status
- status doesn't change to Paid if the entire required amount is already covered via linked advances

- status doesn't change to Paid if the claim is partially paid via advances

- patch to update such uncancelled claims to Paid
2022-03-25 21:41:48 +05:30
Deepesh Garg
19b1b1f4ba test: test for auto write-off amount
(cherry picked from commit 6a50f36b31)

# Conflicts:
#	erpnext/public/js/controllers/taxes_and_totals.js
2022-03-25 15:27:12 +00:00
Deepesh Garg
b2ac773cca fix: Ignore for Purchase Invoices
(cherry picked from commit d3fd2fd2c5)
2022-03-25 15:27:11 +00:00
Deepesh Garg
8cfa3a9ece fix: Ignore for Purchase Invoices
(cherry picked from commit ed38679d22)

# Conflicts:
#	erpnext/public/js/controllers/taxes_and_totals.js
2022-03-25 15:27:11 +00:00
Deepesh Garg
d04d3038f5 fix: Client side changes for POS Write off amount
(cherry picked from commit 2e33e748ea)

# Conflicts:
#	erpnext/public/js/controllers/taxes_and_totals.js
2022-03-25 15:27:10 +00:00
Deepesh Garg
f57f4af1d9 fix: Write off amount wrongly calculated in POS Invoice
(cherry picked from commit ee4258e42c)
2022-03-25 15:27:10 +00:00
Ankush Menat
0534cf6c9c fix: show subassembly table always (#30422)
[skip ci]
2022-03-25 19:03:33 +05:30
Saqib Ansari
80c7d7064b Merge branch 'develop' into fix-minor-custom-cash-flow 2022-03-25 17:16:42 +05:30
Saqib Ansari
5450542fdb fix: unsupported operand type(s) for +=: 'int' and 'NoneType' 2022-03-25 16:44:37 +05:30
Wolfram Schmidt
85b0d5fc77 fix: translations (#30387)
fixed and added translation
2022-03-25 16:22:23 +05:30
Ankush Menat
f06ef17b5d fix: copy has_batch_no and has_serial_no while duplicating 2022-03-25 16:18:58 +05:30
Ankush Menat
f4b39b87e3 fix(UX): use autocomplete for variant fields 2022-03-25 16:18:58 +05:30
Saqib Ansari
936267c934 fix: move item tax to item tax template patch 2022-03-25 15:45:13 +05:30
Saqib Ansari
33863cd6ab Merge pull request #30324 from nextchamp-saqib/fix-pos-issues-again
fix: multiple pos issues
2022-03-25 15:34:54 +05:30
Deepesh Garg
a9d992ac9f Merge pull request #30338 from deepeshgarg007/bank_transaction_currency_symbol_fixes
fix: Currency symbol in bank transactions
2022-03-25 14:39:01 +05:30
Saqib Ansari
e0c36d87e0 chore: ignore rules for QB formatting 2022-03-25 14:26:12 +05:30
Deepesh Garg
3a639f6329 Merge pull request #30413 from frappe/mergify/bp/develop/pr-30406
fix: Rate change issue on save and mapping from other doc (backport #30406)
2022-03-25 14:17:48 +05:30
Deepesh Garg
97e102ceef fix: Condition
(cherry picked from commit 2e0e6ca6b1)
2022-03-25 07:30:41 +00:00
Deepesh Garg
a83a0a03b1 fix: Revert rate calculation
(cherry picked from commit 6937a498e7)
2022-03-25 07:30:40 +00:00
Deepesh Garg
54cdff7947 fix: Add back calculation for discount
(cherry picked from commit 067564bd26)
2022-03-25 07:30:40 +00:00
Deepesh Garg
174a6ec398 fix: Rate change issue on save and mapping from other doc
(cherry picked from commit 13fcda5776)
2022-03-25 07:30:40 +00:00
Shadrak Gurupnor
c4854bb1b1 fix: failing broken patches (#30409)
* fix: failing broken patches

* refactor: simpler conditions

[skip ci]
2022-03-25 12:49:37 +05:30
Saqib Ansari
9a0f5bff65 Merge branch 'develop' into fix-pos-issues-again 2022-03-25 10:52:08 +05:30
Saqib Ansari
16253a2f72 fix: set is_return & return_against in POS Invoice Reference table 2022-03-25 10:51:30 +05:30
Ankush Menat
788d492757 test: basic item and wh capacity dashboard tests 2022-03-25 10:51:19 +05:30
Ankush Menat
10d5fb8cd1 test: check printviews for all docs 2022-03-25 10:51:19 +05:30
Saqib Ansari
1b556d1c53 fix: test cases 2022-03-24 17:59:34 +05:30
Ankush Menat
d4ee31dc8f fix: consider all existing PO items
When this is sent from API/client side doesn't send temporary_name it
can be flaky. Hence, use all available names for validation.
2022-03-24 17:58:22 +05:30
Saqib Ansari
cb4873c019 fix: sider issues 2022-03-24 17:56:27 +05:30
Marica
6ebb19d063 Merge pull request #30399 from ankush/wo_dead_links
fix: broken production item links on production plan
2022-03-24 16:49:38 +05:30
Saqib Ansari
cf51a0a1b8 fix(pos): cannot close the pos if sr. no. is sold & returned 2022-03-24 16:22:36 +05:30
Ankush Menat
5b1d6055e6 fix: subassembly items linked to temporary name
Production Plan tables for po_items and sub_assembly_items are prepared
client side so both dont exist at time of first save or modifying and
hence any "links" created are invalid. This change retains temporary
name so it can be relinked server side after naming is performed.

Co-Authored-By: Marica <maricadsouza221197@gmail.com>
2022-03-24 15:00:05 +05:30
Ankush Menat
3d43c437ad fix: only validate qty for main non-subassy items 2022-03-24 15:00:05 +05:30
Marica
d24458ab77 fix: (ux) Add is_group=0 filter on website warehouse (#30396)
- It does not support group warehouses right now and it is misleading
2022-03-24 12:56:57 +05:30
Saqib Ansari
4aabe97565 Merge branch 'develop' into fix-pos-issues-again 2022-03-24 11:18:13 +05:30
Deepesh Garg
4147f2134f Merge pull request #30334 from deepeshgarg007/gst_state_number_unsetting
fix: Reset GST State number
2022-03-23 23:30:20 +05:30
Deepesh Garg
07c7ebfd99 Merge branch 'develop' into gst_state_number_unsetting 2022-03-23 22:04:13 +05:30
Ankush Menat
c9dcf31cf7 test: ensure super()setUpClass is called 2022-03-23 19:46:50 +05:30
Deepesh Garg
9c607dd6c5 Merge pull request #30323 from deepeshgarg007/sales_person_dashboard
fix: Contribution amount against invoices in Sales Person Dashboard
2022-03-23 16:57:18 +05:30
Deepesh Garg
993cc287d5 Merge branch 'develop' into sales_person_dashboard 2022-03-23 16:11:22 +05:30
Ankush Menat
6418dc1606 fix: make auto created job cards "Open" 2022-03-23 15:50:46 +05:30
Ankush Menat
e1f5620654 fix: material transfer status should be before WIP 2022-03-23 15:50:46 +05:30
Ankush Menat
4aa74af90d fix: ignore items without info for pending qty computation 2022-03-23 15:46:40 +05:30
Ankush Menat
be16fb9dbb chore(DX): add sourceURL for debugging 2022-03-23 15:46:40 +05:30
marination
a787ebb732 fix: Dont set idx while adding WO items to Stock Entry
- `idx` must be computed by base document's `self.append()` function, so do not set it
2022-03-23 14:59:27 +05:30
Deepesh Garg
d180d09916 Merge pull request #30372 from deepeshgarg007/price_list_ignore_fix
fix: Check if onload property exists in the form object
2022-03-23 13:56:01 +05:30
Deepesh Garg
78ca88d227 fix: Check if onload property exists in the form object 2022-03-23 13:55:05 +05:30
Deepesh Garg
c3f1ad78aa Merge pull request #30361 from deepeshgarg007/tax_account_display
fix: GST account not showing up in tax templates
2022-03-23 13:17:11 +05:30
Deepesh Garg
83fc05ef7d Merge pull request #30365 from deepeshgarg007/ignore_price_list
fix: Changing item prices on converting orders/receipts to invoices
2022-03-23 10:09:33 +05:30
Deepesh Garg
3a1e31592e Merge branch 'develop' into ignore_price_list 2022-03-23 09:27:44 +05:30
Deepesh Garg
405dcb1d3c fix: Add ignore pricelist for missing flows 2022-03-23 09:04:03 +05:30
Deepesh Garg
66ca085e39 fix: Changing item prices on converting orders/receipts to invoices 2022-03-22 23:03:41 +05:30
Deepesh Garg
57924599da fix: GST account not showing up in tax templates 2022-03-22 18:26:58 +05:30
Saqib Ansari
f2ae63cbfd fix(pos): remove returned sr. nos. from pos reserved sr. nos. list 2022-03-22 17:41:49 +05:30
Ankush Menat
f606d2ecc6 fix: flaky salary slip email test (#30358) 2022-03-22 17:36:18 +05:30
Ankush Menat
41db43cdc5 fix: consider full integer batch nos 2022-03-22 16:40:17 +05:30
Ankush Menat
a18c687844 fix: ignore already fetched serial no
exclude_sr_nos is sent as JSON string of list, so load it before
operating on it.
2022-03-22 16:40:17 +05:30
Subin Tom
b19305aa83 fix: used get_employees_with_number, strip_number methods 2022-03-22 16:22:09 +05:30
Deepesh Garg
ec04242d72 Merge pull request #30340 from deepeshgarg007/opening_too_field_fixes
fix: Opening invoice tool field placement
2022-03-22 16:17:12 +05:30
Deepesh Garg
749ab9b799 Merge branch 'develop' into bank_transaction_currency_symbol_fixes 2022-03-22 16:16:03 +05:30
Marica
87a0b72c26 Merge pull request #30336 from marination/product-filter-lookup
fix: Product Filters Lookup
2022-03-22 15:31:28 +05:30
Rucha Mahabal
0ae6561620 test: get leave allocation records query (#30342)
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-03-22 15:14:05 +05:30
Ankush Menat
51873da4bc test: dynamic current FY creation in before_tests 2022-03-22 14:23:56 +05:30
Ankush Menat
6b638a196b chore: drop dead sample code 2022-03-22 14:23:56 +05:30
Ankush Menat
9a99f993bc refactor: merge print settings custom fields 2022-03-22 14:23:56 +05:30
Ankush Menat
457d616966 refactor: remove dead duplicate code 2022-03-22 14:23:56 +05:30
Ankush Menat
f37316a266 refactor: use get_value instead of exists 2022-03-22 13:07:45 +05:30
barredterra
5c4eabf075 fix: usage of frappe.db.exists 2022-03-22 13:07:45 +05:30
Marica
387fa61a83 Merge branch 'develop' into product-filter-lookup 2022-03-22 12:13:46 +05:30
Deepesh Garg
01cd9e7c2e Merge branch 'develop' into opening_too_field_fixes 2022-03-22 11:53:06 +05:30
Deepesh Garg
4e2f866a2a Merge branch 'develop' into gst_state_number_unsetting 2022-03-22 11:52:55 +05:30
Deepesh Garg
645ed7d0fd Merge branch 'develop' into sales_person_dashboard 2022-03-22 11:52:36 +05:30
Deepesh Garg
69a4b8c80b Merge branch 'develop' into bank_transaction_currency_symbol_fixes 2022-03-22 11:52:20 +05:30
HarryPaulo
3eb5440aa9 fix: linters erros on report sales payments summary (#30345)
* fix: wrong values for report and get change amout based on payment TYPE.

* charcase for select field.

* fix: linter check erros

* fix: linters errors

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-03-22 11:39:15 +05:30
Deepesh Garg
636e7f67eb fix: Opening invoice tool field placement 2022-03-21 19:34:57 +05:30
Deepesh Garg
e78a445c24 fix: Currency symbol in bank transactions 2022-03-21 19:06:04 +05:30
marination
f6e64c2cac fix: Product Filters Lookup
- bind the right classes to the filter lookup field
- make class names more descriptive
- make filter lookup field more visible with white bg and border
- bind lookup input field js in `views.js`
- make filter lookup field functioning for atribute filters too
- added placeholder to lookup field
2022-03-21 17:58:39 +05:30
Deepesh Garg
1b2c6a5b78 fix: Code cleanup 2022-03-21 17:06:23 +05:30
HarryPaulo
01fd3adedf fix: report sales payments summary (#30264) 2022-03-21 16:57:27 +05:30
Deepesh Garg
9376d8d308 Merge pull request #30312 from alyf-de/refactor-sales-analytics
refactor: sales analytics
2022-03-21 16:44:23 +05:30
Deepesh Garg
363e676a35 fix: Reset GST State number 2022-03-21 16:28:17 +05:30
Ankush Menat
d3be84bfe8 test: correct use of test decorator 2022-03-21 15:40:34 +05:30
Rucha Mahabal
95568210b2 fix(ux): warning for disabled carry forwarding in Policy Assignment (#30331) 2022-03-21 15:30:04 +05:30
mergify[bot]
08e598e2c4 fix: Future recurring period calculation for additional salary (#29581) (#30330)
* fix: Future recurring period calculation for addl salary

* fix: future recurring period calculation

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
(cherry picked from commit cedabd7242)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2022-03-21 15:00:55 +05:30
Saqib Ansari
aff7408775 fix(pos): allow validating stock on save 2022-03-21 14:08:56 +05:30
Saqib Ansari
4afb47e869 fix(pos): specific case when serialized item not removed 2022-03-21 13:24:11 +05:30
Saqib Ansari
2f82e237ef fix(pos): customer group filter in customer selector 2022-03-21 12:47:35 +05:30
Deepesh Garg
3a7776ea7f fix: Contribution amount against invoices in Sales Person Dashboard 2022-03-21 12:04:18 +05:30
Saqib Ansari
d5fd8e0ba6 fix: prevent multiple save on applying coupon code 2022-03-21 11:36:30 +05:30
Deepesh Garg
1daaf6be2a Merge pull request #30317 from deepeshgarg007/opening_gl_validation
fix: P&L account validation on cancellation
2022-03-21 10:45:07 +05:30
Saqib Ansari
6dc7d6b085 Merge pull request #30287 from nextchamp-saqib/fix-cash-flow-query
fix: custom cash flow mapper doesn't show any data
2022-03-21 10:32:42 +05:30
Deepesh Garg
28001ddf42 Merge pull request #30304 from deepeshgarg007/enable_ksa_vat_docs
fix: Add permission for KSA VAT documents
2022-03-21 10:18:40 +05:30
Deepesh Garg
2ff6790283 fix: P&L account validation on cancellation 2022-03-21 09:43:31 +05:30
Raffael Meyer
0a015b7f70 refactor: remove redundant if-statement (#30311) 2022-03-20 19:29:41 +05:30
Ankush Menat
c2aad115c1 fix: disable deferred naming on SLE/GLE if hash method is used. (#30286)
* fix: dont rename GLE/SLE that dont have naming series

* test: tests for deferred naming of ledgers
2022-03-20 19:26:34 +05:30
HENRY Florian
ca8d757691 fix: clear "Retain Sample" and "Max Sample Quantity" in Item card if Has Batch No is uncheck (#30307) 2022-03-20 15:27:00 +05:30
barredterra
36df21067c refactor: sales analytics 2022-03-20 03:58:24 +01:00
Ankush Menat
4859574233 perf: Single query to delete bins instead of N 2022-03-19 20:55:27 +05:30
Ankush Menat
684d9d66d1 test: warehouse conversion and treeview test 2022-03-19 20:55:27 +05:30
Ankush Menat
953afda01b refactor(warehouse): raw query to ORM 2022-03-19 20:55:27 +05:30
Ankush Menat
4b695915f4 refactor: Use QB for serial fetching query 2022-03-19 20:55:27 +05:30
Ankush Menat
a585dff6fd refactor: batch no filter handling 2022-03-19 20:55:27 +05:30
Ankush Menat
b9eec331e3 test: auto serial fetching 2022-03-19 20:55:27 +05:30
Ankush Menat
4f8bb91eae fix: sort serial nos before sending 2022-03-19 20:55:27 +05:30
Ankush Menat
0a533d6ccc fix: skip already selected serials in sr selector 2022-03-19 20:55:27 +05:30
Ankush Menat
5ec27c9055 fix: filter serial nos by selected batch number 2022-03-19 20:55:27 +05:30
Ankush Menat
f4c213379e fix: set current qty as default qty for stock entry 2022-03-19 20:55:27 +05:30
mergify[bot]
c2cbd407c1 fix: Allow on Submit for Material Request Item Required Date (#30174) (#30308)
* fix: Allow on Submit for Material Request Item Required Date

* chore: whitespace

(cherry picked from commit cca9668309)

Co-authored-by: Devarsh Bhatt <58166671+bhattdevarsh@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-03-19 20:31:06 +05:30
Deepesh Garg
01638a01cb Merge pull request #30292 from frappe/mergify/bp/develop/pr-30284
fix: Cleanup and fixes in Dimension-wise Accounts Balance Report (backport #30284)
2022-03-18 17:36:59 +05:30
Deepesh Garg
972d06555a fix: Add permission for KSA Vat documents 2022-03-18 17:32:46 +05:30
Ankush Menat
5a9bf9ffd6 fix: respect db multi_tenancy while fetching precision (#30301)
[skip ci]
2022-03-18 17:29:09 +05:30
Saqib Ansari
00bfee97c7 refactor: convert raw sql to frappe.qb 2022-03-18 14:31:30 +05:30
Deepesh Garg
8819ba07a9 Merge pull request #30266 from deepeshgarg007/expense_income_account_validation
fix: Validate income/expense account in sales and purchase invoice
2022-03-17 18:32:34 +05:30
Deepesh Garg
5390d5e65a Merge branch 'develop' into mergify/bp/develop/pr-30284 2022-03-17 18:02:57 +05:30
Deepesh Garg
4237e5d928 fix: Test case 2022-03-17 18:00:39 +05:30
marination
f3715ab382 fix: Test, Sider and Added button to access log from Tool 2022-03-17 17:43:12 +05:30
Deepesh Garg
a651a0ffc8 Merge pull request #30261 from deepeshgarg007/bank_reco_error
fix: Error in bank reconciliation statement
2022-03-17 17:29:15 +05:30
Deepesh Garg
5f89cb2cca fix: Remove comments
(cherry picked from commit cab69fe1f2)
2022-03-17 11:57:50 +00:00
Deepesh Garg
2dd0e20003 fix: Clean and fixes in Dimension-wise Accounts Balance Report
(cherry picked from commit 08a06ce5c6)
2022-03-17 11:57:50 +00:00
rohitwaghchaure
da16ee159a Merge pull request #30238 from KrithiRamani/bulk_create_PL_and_DN
feat: Create single PL/DN from several SO.
2022-03-17 15:39:45 +05:30
Rucha Mahabal
f090e63e54 test: fix holiday list creation causing flaky tests (#30260) 2022-03-17 15:21:56 +05:30
marination
3e3af95712 fix: Sider and Linter 2022-03-17 15:03:20 +05:30
Saqib Ansari
119273e633 fix: custom cash flow mapper doesn't show any data 2022-03-17 14:47:50 +05:30
Sagar Vora
ceccacac1f fix: restore inadvertently deleted patches 2022-03-17 13:43:13 +05:30
marination
8aff75f8e8 feat: List View indicators for Log and Error Log link in log 2022-03-17 12:58:09 +05:30
marination
cff91558d4 chore: Polish error handling and code sepration
- Added Typing
- Moved all job business logic to bom update log
- Added `run_bom_job` that handles errors and runs either of two methods
- UX: Replace button disabled until both inputs are filled
- Show log creation message on UI for correctness
- APIs return log document as result
- Converted raw sql to QB
2022-03-17 12:32:37 +05:30
Ankush Menat
76187d175f refactor: call repost directly during tests (#30277)
enqueue(now=frappe.flags.in_test) is always true in test, this change avoids
confusion.
2022-03-16 19:50:56 +05:30
marination
4283a13e5a feat: BOM Update Log
- Created BOM Update Log that will handle queued job status and failures
- Moved validation and BG job to thus new doctype
- BOM Update Tool only works as an endpoint
2022-03-16 19:47:25 +05:30
Noah Jacob
2a0ca7c91a refactor: removed unrequired code and test for standalone delivery note serial return (#30276) 2022-03-16 19:27:47 +05:30
Ankush Menat
b93ce78df1 chore: dont supress errors server side
not required after https://github.com/frappe/frappe/pull/16284
2022-03-16 17:50:34 +05:30
Krithi Ramani
a12895ec03 corrected spacing 2022-03-16 13:56:54 +05:30
Ankush Menat
b46d6e3c05 test: packed item return scenarios 2022-03-16 13:36:53 +05:30
Ankush Menat
b781e8b7d1 revert: "fix: updated packed_items getting fetched on Sales Return / Credit Note (#28607)"
This reverts commit 20216fa9f1.
2022-03-16 13:36:53 +05:30
Deepesh Garg
2958f60b46 Merge pull request #30269 from deepeshgarg007/implicit_pricing_rule_enable_v2
fix: Do not update ignore pricing rule check implicitly
2022-03-16 12:32:25 +05:30
Krithi Ramani
0211f27e83 as per review comments - changed for loop 2022-03-16 12:28:30 +05:30
Deepesh Garg
1f79b47a17 fix: Do not update ignore prcing rule check implicitly 2022-03-16 11:55:43 +05:30
Saqib Ansari
e9e2679dff Merge pull request #29984 from dj12djdjs/fix-rename-tool-msg
fix: rename tool show fail message
2022-03-16 10:57:17 +05:30
Saqib Ansari
e1edf50756 Merge pull request #30265 from scdanieli/patch-1
feat: add German translations
2022-03-16 10:54:24 +05:30
Saqib Ansari
597bb2c7e8 feat: safely parse exception 2022-03-16 10:53:39 +05:30
Deepesh Garg
06936cf1c0 fix: Validate income/expense account in sales and purchase invoice 2022-03-16 09:02:04 +05:30
Krithi Ramani
e970616b51 removed semicolon for break statement 2022-03-15 21:52:34 +05:30
Krithi Ramani
9f7fee7a4f Added new field in SO - % Picked 2022-03-15 21:40:51 +05:30
Samuel Danieli
bbe5739547 feat: add German translations 2022-03-15 17:03:30 +01:00
Krithi Ramani
a68213d82e added new field - Picked Qty, in Sales Order Item 2022-03-15 20:18:23 +05:30
Saqib Ansari
1797b6013e Merge pull request #30244 from nextchamp-saqib/fix-gl-representation
fix: incorrect debit credit amount in presentation currency
2022-03-15 18:39:37 +05:30
Deepesh Garg
fbcb413d96 fix: Error in bank reco statement 2022-03-15 18:20:11 +05:30
Saqib Ansari
12d99ed69a test: foreign_account_balance_after_exchange_rate_revaluation 2022-03-15 17:56:42 +05:30
Marica
b73948660a Merge pull request #30258 from marination/sub-category-routing
fix: Sub-Category Routing in Item Group Page Listing pills
2022-03-15 17:29:39 +05:30
marination
8264d6b0bc fix: Sub-Categpry Routing in Item Group Page Listing pills
- Use absolute route even 3-4 sub-category levels down
- Remove scroll from category pills due to accessibility issues
- Arrange sub-category pills alphabetically
2022-03-15 16:53:46 +05:30
Saqib Ansari
7b0a97d679 fix(pos): loyalty points in case of returned pos invoice (#30242) 2022-03-15 15:54:37 +05:30
mergify[bot]
e8310c6dec fix: Job Card sub operations status and list view (backport #30243) (#30256)
* fix: show status in job card list view in Draft mode

(cherry picked from commit fa32fc3c83)

* fix: job card - sub operations table status misbehaviour on pause / resume Job Card

(cherry picked from commit 7b8723445e)

Co-authored-by: Anoop Kurungadam <anoop@earthianslive.com>
2022-03-15 15:48:15 +05:30
Krithi Ramani
f33a725a9e fixed spacings 2022-03-15 15:35:51 +05:30
Rucha Mahabal
3218ccbb96 fix: Leave Policy Assignment creation patch (#30215) 2022-03-15 11:43:27 +05:30
Rucha Mahabal
b03b9ac99f fix: salary slip amount rounding errors (#30248) 2022-03-15 11:39:15 +05:30
Deepesh Garg
8add8eb058 Merge pull request #30230 from deepeshgarg007/vat_amount_in_ksa
fix: KSA E-Invoice QR Code showing wrong VAT amount
2022-03-14 21:47:22 +05:30
Deepesh Garg
07715118cf Merge pull request #30206 from deepeshgarg007/implicit_pricing_rule_enable
fix: Do not update ignore prcing rule check implicitly
2022-03-14 21:46:24 +05:30
Saqib Ansari
83a5fae591 fix: incorrect debit credit amount in presentation currency 2022-03-14 20:14:46 +05:30
Deepesh Garg
e33d4713cd Update erpnext/regional/saudi_arabia/utils.py
Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
2022-03-14 18:35:49 +05:30
Ankush Menat
8e559f01c8 test: refactor BOM quality template test 2022-03-14 18:28:08 +05:30
Ankush Menat
dc257665f1 ci: allow stable branch merge for release
[skip ci]
2022-03-14 18:25:13 +05:30
Florian HENRY
9415229e8d fix: BOM - clear Quality Inspection Template according to Inspection Quality Required
Squashed commit of the following:

commit b73fa210b234d2c8067db2c32f94f362b89afe5a
Author: Florian HENRY <florian.henry@open-concept.pro>
Date:   Mon Mar 14 08:30:24 2022 +0100

    add json tes

commit 984d015a7d9aceb6ea64be7ed9f1cc0caa356714
Author: Florian HENRY <florian.henry@open-concept.pro>
Date:   Mon Mar 14 08:30:06 2022 +0100

    better test

commit 42061146658598da02eda7cb781bd2cf44c8ca34
Author: Florian HENRY <florian.henry@open-concept.pro>
Date:   Fri Mar 11 16:12:57 2022 +0100

    update test

commit 6259c0957566600b044fcd4a5e14e69cdff71020
Author: Florian HENRY <florian.henry@open-concept.pro>
Date:   Fri Mar 11 13:59:13 2022 +0100

    update test

commit cbc4ad9566f6f7f01dd622651458fea309d80954
Merge: faa44b3fdd 94d0f8d4e7
Author: Florian HENRY <florian.henry@open-concept.pro>
Date:   Fri Mar 11 12:46:48 2022 +0100

    Merge branch 'develop' of https://github.com/frappe/erpnext into dev_fix_30190

commit faa44b3fdd983adfc04bbf04a7ebfef114501bb3
Author: Florian HENRY <florian.henry@open-concept.pro>
Date:   Fri Mar 11 12:03:35 2022 +0100

    fix: clear Quality Inspection Template according to Inspection Quality Required
2022-03-14 18:25:00 +05:30
Ankush Menat
f1a7e3b9ad ci: skip tests on CSV
[skip ci]
2022-03-14 18:22:07 +05:30
Wolfram Schmidt
7537dac2a4 fix: translation for accounting
"Aufwand" rather than "Auslage". This is commonly used in accounting.
2022-03-14 18:22:07 +05:30
Deepesh Garg
1faca0eb5a Merge branch 'develop' into vat_amount_in_ksa 2022-03-14 17:36:16 +05:30
Krithi Ramani
466df6bdb7 to enable selection of SO irrespective of customer,removed validation for customer 2022-03-14 17:29:02 +05:30
Ankush Menat
07712af357 Merge pull request #30233 from frappe/mergify/copy/develop/pr-30216
fix: max_qty validation condition in WO (copy #30216)
2022-03-14 17:22:30 +05:30
Krithi Ramani
61eb9b6c68 feat: Create single PL/DN from several SO. New PR from latest develop to avoid rebase 2022-03-14 17:20:49 +05:30
Deepesh Garg
25a128220a Merge pull request #30207 from deepeshgarg007/trail_balance_for_party
fix: Do not consider cancelled entries
2022-03-14 17:19:34 +05:30
Deepesh Garg
be56efad26 fix: Itemised tax rate updation 2022-03-14 17:17:01 +05:30
Ankush Menat
02d64a32c2 fix(ux): negative stock warning 2022-03-14 17:16:39 +05:30
Sagar Sharma
884cd814bc test: add test for planned_qty
(cherry picked from commit b22bdc5ff7)
2022-03-14 11:31:52 +00:00
Sagar Sharma
3b86d6c73c fix: max_qty validation condition
(cherry picked from commit d198c488a4)
2022-03-14 11:31:52 +00:00
Marica
fda60da07b Merge pull request #30229 from marination/sq-currency
fix: Add missing currency option in Supplier Quotation's `rounded_total` field
2022-03-14 17:00:31 +05:30
Deepesh Garg
3cc2e53b08 fix: Linting Issue 2022-03-14 16:27:04 +05:30
marination
a579a211fd chore: Re-arrange fields for consistency with base currency LHS 2022-03-14 16:15:12 +05:30
Deepesh Garg
b37559c535 fix: KSA E-Invoice QR Code showing wrong VAT amount 2022-03-14 16:13:35 +05:30
marination
dcd88ddc87 fix: Add missing currency option in Supplier Quotation's rounded_total field 2022-03-14 15:57:24 +05:30
Deepesh Garg
2b6e7963f6 Merge branch 'develop' into implicit_pricing_rule_enable 2022-03-14 15:49:21 +05:30
Noah Jacob
60c4593f7b chore: removed unrequired batch_no parameter while fetching stock_balance 2022-03-14 15:36:56 +05:30
Noah Jacob
00797fa02d test: checking balance serial nos in stock ledger report 2022-03-14 15:36:56 +05:30
Noah Jacob
e8ba1f4e74 fix: incorrect balance serial no in stock ledger report 2022-03-14 15:36:56 +05:30
Ankush Menat
6ee904d641 test: dont resubmit work order 2022-03-14 15:13:37 +05:30
mergify[bot]
12696ffeb4 fix: Search query of payroll entry reference in Journal Entry (#30225) (#30226)
(cherry picked from commit 98a67967a3)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2022-03-14 14:44:02 +05:30
Ankush Menat
d3e90ed8c8 fix(patch): remove dead links to ProdPlan Item 2022-03-14 14:15:43 +05:30
Ankush Menat
1af13ca4bf fix(ux): remove get item buttons from submitted production plan 2022-03-14 14:15:43 +05:30
Saqib Ansari
c1740ced97 fix: cannot create multicurrency sales order with product bundles (#30166) 2022-03-14 13:43:55 +05:30
Saqib Ansari
f5f6650779 Merge pull request #30217 from nextchamp-saqib/fix-so-to-po
fix: cannot create purchase order from sales order
2022-03-14 12:35:32 +05:30
Saqib Ansari
935218598a Merge pull request #30198 from nextchamp-saqib/pos-fixes-#12
fix(pos): do not reset mode of payments in case of consolidation
2022-03-14 12:34:40 +05:30
Saqib Ansari
58804b8436 fix: cannot create purchase order from sales order 2022-03-14 12:31:13 +05:30
Saqib Ansari
2e265d9bf6 test: mode of payments in case of consolidation 2022-03-14 11:02:33 +05:30
Ankush Menat
941ea1ec74 fix(ux): skip items without batch series 2022-03-14 10:25:18 +05:30
Ankush Menat
91fd9d917a test: negative fifo test 2022-03-14 10:25:18 +05:30
Rucha Mahabal
87d9863a71 Merge pull request #29439 from ruchamahabal/leave-opening-balance 2022-03-13 20:55:50 +05:30
Rucha Mahabal
211916bfce Merge branch 'develop' into leave-opening-balance 2022-03-13 20:30:36 +05:30
Rucha Mahabal
d61c437588 fix: flaky tests 2022-03-13 20:30:18 +05:30
Deepesh Garg
835c029e53 Merge pull request #29979 from deepeshgarg007/bank_reco_multicurrency_fix
fix: Multi-currency bank reconciliation fixes
2022-03-13 20:27:04 +05:30
Rucha Mahabal
558650bc3a fix: add more type hints 2022-03-13 20:02:51 +05:30
Deepesh Garg
5ae610bd32 Merge pull request #30039 from deepeshgarg007/gstr_3b_nil_exempt_fixed
fix: Nil and Exempted values in GSTR-3B Report
2022-03-13 20:00:48 +05:30
Ankush Menat
1a256c62c4 fix: attach sr no si standalone credit note 2022-03-13 19:00:34 +05:30
Ankush Menat
1c37d2711a test: standalone SI creates and attaches serial nos 2022-03-13 19:00:34 +05:30
Deepesh Garg
6308e1be91 fix: Do not consider cancelled entries 2022-03-13 18:13:12 +05:30
Deepesh Garg
96b5cedcf8 fix: Do not update ignore prcing rule check implicitly 2022-03-13 17:48:37 +05:30
Deepesh Garg
22dfd5a4b1 Merge pull request #30152 from deepeshgarg007/sales_purchase_retrun_optimization
fix: Sales and Purchase return optimization
2022-03-13 17:13:53 +05:30
Deepesh Garg
7b0d1a6d12 Merge pull request #30155 from deepeshgarg007/loan_cost_center
fix: Add cost center in loan document
2022-03-13 17:13:04 +05:30
Deepesh Garg
60ba0ba219 Merge branch 'develop' into loan_cost_center 2022-03-13 12:50:27 +05:30
Deepesh Garg
e4e38ad60b Merge branch 'develop' into sales_purchase_retrun_optimization 2022-03-13 12:45:10 +05:30
Saqib Ansari
e8a7a54d5a fix(pos): do not reset mode of payments in case of consolidation 2022-03-12 19:20:48 +05:30
mergify[bot]
b085e96a12 revert: "Merge pull request #29290 from s-aga-r/fix/delivery-note/billed-amount" (#29782) (#29807)
* Revert "Merge pull request #29290 from s-aga-r/fix/delivery-note/billed-amount"

This reverts commit 038f949550, reversing
changes made to c7b4918434.

* fix: linter

(cherry picked from commit 7fa46f77e0)

# Conflicts:
#	erpnext/patches.txt

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-03-11 18:28:50 +05:30
Ankush Menat
94d0f8d4e7 test: actual bom naming test 2022-03-11 17:11:22 +05:30
Rohan Bansal
67d8a7ba86 fix: cancelled document check 2022-03-11 17:11:22 +05:30
Ankush Menat
6b58d53403 refactor: split versioning code for testability 2022-03-11 17:11:22 +05:30
Rohan Bansal
7f2670941c fix: improve bom autoname logic 2022-03-11 17:11:22 +05:30
Ankush Menat
e2c99e02a9 test: bom for item_code that is >VARCHAR_LEN 2022-03-11 17:11:22 +05:30
Rohan Bansal
d9c91748f4 fix: if an item code is too long, truncate before setting BOM name 2022-03-11 17:11:22 +05:30
Abhinav Raut
8c76a76154 fix: incorrect payable amount for loan closure 2022-03-11 16:46:30 +05:30
Abhinav Raut
4e92926a52 fix: incorrect payable amount for loan closure
- Add penalty amount to payable amount for loan closure
2022-03-11 16:44:21 +05:30
Rucha Mahabal
8173e6a8ea fix: simplify insufficient leave balance message 2022-03-11 15:30:01 +05:30
Deepesh Garg
13dce71c21 Merge pull request #30181 from deepeshgarg007/shipping_rule_application
fix: Shipping rule application fixes
2022-03-11 12:04:12 +05:30
Deepesh Garg
d596e0e4df fix: Shipping rule application fixes 2022-03-10 20:56:36 +05:30
Ankush Menat
472fe8e319 test: submit PR directly 2022-03-10 18:08:29 +05:30
Ankush Menat
6c54be0dcd test: flaky MR report test
all test records are on same day so sorting was random in report rows.
2022-03-10 18:08:29 +05:30
Ankush Menat
7dd10367f4 fix: only update valuation rate if not None 2022-03-10 18:08:29 +05:30
Ankush Menat
362102e802 fix: dont hardcode hour rate precision 2022-03-10 17:23:50 +05:30
Ankush Menat
18e2a33a9b fix: fetch new fields in bom from routing 2022-03-10 17:23:50 +05:30
Ankush Menat
73901aad6f fix: handle duplicate bins during item merge renames 2022-03-10 17:01:22 +05:30
Ankush Menat
b4d4ae6aa3 test: refactor item merge test and disable commits 2022-03-10 17:01:22 +05:30
Ankush Menat
4126455975 fix: dont reset UOM in MR on every get_item_detail call (#30164) 2022-03-10 15:43:09 +05:30
Rucha Mahabal
b2c549a464 fix: conflicts 2022-03-10 15:41:14 +05:30
Raffael Meyer
6794148c04 fix(lead): reload contact before updating links (#29966)
* fix(lead): reload contact before updading links

Contact might have changed since it was created.

* refactor: reload contact after insert
2022-03-10 14:47:29 +05:30
Rucha Mahabal
79b0354efc Merge branch 'develop' into leave-opening-balance 2022-03-10 14:45:46 +05:30
Marica
93e9fe8327 Merge pull request #30160 from marination/cart-without-checkout
fix: 'save_quotations_as_draft' checkbox not honoured
2022-03-10 14:37:58 +05:30
Saqib Ansari
390feeaa73 Merge pull request #30103 from ChillarAnand/party
fix: Ignore missing customer group while fetching price list
2022-03-10 14:36:19 +05:30
Rucha Mahabal
9fae89ff61 fix: flaky tests (#30154) 2022-03-10 14:22:12 +05:30
Deepesh Garg
a5befb6bf8 fix: Update modified timestamp 2022-03-10 14:18:54 +05:30
Marica
8486f5f321 Merge branch 'develop' into bom-update-tool 2022-03-10 13:56:38 +05:30
Saqib Ansari
e5fb871ef4 fix: Ignore missing customer group while fetching price list 2022-03-10 13:54:43 +05:30
marination
a13e06156b fix: 'save_quotations_as_draft' checkbox not honoured
- Make sure `request_for_quotation` considers `save_quotations_as_draft`
- Added test for checkout disabled quote
2022-03-10 13:54:00 +05:30
Saqib Ansari
9dc9758522 Merge branch 'develop' of https://github.com/frappe/erpnext into party 2022-03-10 13:51:36 +05:30
Himanshu
5193a63781 fix: do not reset asset_category (#29696) 2022-03-10 13:43:35 +05:30
Saqib Ansari
2bcddab553 Merge pull request #30153 from nextchamp-saqib/fix-psoa-template
fix(psoa): no such element: dict object['account']
2022-03-10 13:12:23 +05:30
Deepesh Garg
e9d458b822 fix: Update party type 2022-03-10 12:29:17 +05:30
Deepesh Garg
5d66cc4c4a fix: Add cost center in loan document 2022-03-10 12:22:37 +05:30
Saqib Ansari
8021572432 Merge branch 'develop' into fix-psoa-template 2022-03-10 12:17:11 +05:30
Ankush Menat
84568ac341 chore: imports 2022-03-10 11:20:23 +05:30
Saqib Ansari
5d5ae16fe5 fix(psoa): no such element: dict object['account'] 2022-03-10 11:12:33 +05:30
Saqib Ansari
45c1d83ea1 Merge pull request #30145 from nextchamp-saqib/add-filter-to-psoa
fix(psoa): add company filter to account
2022-03-10 10:53:52 +05:30
Deepesh Garg
395b15058c fix: Sales and Purchase retrun optimization 2022-03-10 10:50:03 +05:30
Rucha Mahabal
f066427913 fix: program enrollment button labels (#30148) 2022-03-10 10:06:07 +05:30
marination
f57725f8fa refactor: Add exception handling in background job within BOM Update Tool 2022-03-09 19:03:07 +05:30
Saqib Ansari
fc42041f8f fix(psoa): add company filter to account 2022-03-09 18:04:35 +05:30
Chillar Anand
fe4b6771b5 refactor: Remove dead code (#30140) 2022-03-09 17:16:05 +05:30
Chillar Anand
b1c8a4543d test: Added test for monthly attendance report (#29989)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-03-09 17:05:00 +05:30
Rucha Mahabal
921d6b25d7 chore: linter issue 2022-03-09 16:58:15 +05:30
Deepesh Garg
45eed7167c Merge pull request #29654 from alyf-de/revert-bu-schluessel
revert: BU Schlüssel (a21f76f)
2022-03-09 16:48:54 +05:30
Marica
2661cb2c14 Merge pull request #30091 from marination/item-group-filters-listing
feat: Include child item group products in Item Group Page & cleanup
2022-03-09 16:46:01 +05:30
Saqib Ansari
4d8798b0ea fix: ignore non-unique swift numbers while migrating (#30132) 2022-03-09 16:41:54 +05:30
Saqib Ansari
17e16247b1 Merge pull request #30114 from nextchamp-saqib/fix-#23231
perf(asset): fetch only distinct depreciable assets
2022-03-09 16:41:08 +05:30
Rucha Mahabal
9b152e93cf Merge branch 'develop' into leave-opening-balance 2022-03-09 16:40:26 +05:30
Rucha Mahabal
97b7b5012e test: separate leave ledger entries for leave applications across allocations 2022-03-09 16:35:25 +05:30
Deepesh Garg
7643963ff4 Merge pull request #30136 from deepeshgarg007/remove_field
fix: Remove tax invoice no field
2022-03-09 16:19:59 +05:30
Rucha Mahabal
70239158b9 fix: boundary determination for separate ledger entries 2022-03-09 16:18:23 +05:30
marination
7b37a74023 fix: Linter 2022-03-09 16:04:12 +05:30
Rucha Mahabal
6755d6e6f5 test: leave application validations 2022-03-09 15:48:57 +05:30
Deepesh Garg
9b8258479c fix: Update timestamp 2022-03-09 15:43:26 +05:30
Deepesh Garg
8a2fe7a2e3 fix: Remove tax invoice no field 2022-03-09 15:42:06 +05:30
Ankush Menat
64905188c4 fix: dont fetch entire barcode table in get_item_details (#30131) 2022-03-09 15:37:14 +05:30
Deepesh Garg
e192956520 Merge pull request #30096 from deepeshgarg007/debit_note_ux
fix(ux): Improve label for better understanding
2022-03-09 15:34:11 +05:30
Marica
7555e1548b Merge branch 'develop' into item-group-filters-listing 2022-03-09 15:33:04 +05:30
Deepesh Garg
23ce6fb8de Merge pull request #30000 from HarryPaulo/asset-translates
fix(translation) - correction for assets translation
2022-03-09 14:44:13 +05:30
Deepesh Garg
5526f852e8 Merge branch 'develop' into asset-translates 2022-03-09 14:43:57 +05:30
marination
3507cf5985 test: Test include_descendants in Item Group Product Listing
- Also made include_descendants field's visibility dependant on show_in_website
2022-03-09 13:50:24 +05:30
Rucha Mahabal
a504ffcc4c fix: clearer validation/warning messages for insufficient balance in leave application 2022-03-09 13:49:07 +05:30
Saqib Ansari
a02e39e986 Merge branch 'develop' into fix-#23231 2022-03-09 12:31:23 +05:30
Mohammed Yusuf Shaikh
700e65959a fix: default log date needed to query records (#29951) 2022-03-09 11:42:50 +05:30
Saqib Ansari
8a52f59199 Merge branch 'develop' into fix-#23231 2022-03-09 11:42:46 +05:30
Saqib Ansari
baee5d109e Merge pull request #30110 from nextchamp-saqib/fix-customer-credit-limit-update
fix: customer credit limit validation on update
2022-03-09 11:42:14 +05:30
mergify[bot]
aadca02018 fix: add filters in default_discount_account (#30095) (#30125)
(cherry picked from commit 3d8eaa5392)

Co-authored-by: Mohamed-D-Ouf <65343412+Mohamed-D-Ouf@users.noreply.github.com>
2022-03-09 11:27:15 +05:30
Saqib Ansari
e6666609e3 Merge branch 'develop' into fix-#23231 2022-03-09 11:08:45 +05:30
Rucha Mahabal
c0f1e269e4 feat: split ledger entries for applications created across allocations
- fix: ledger entry for expiring cf leaves not considering holidays
2022-03-09 10:25:49 +05:30
Deepesh Garg
9be3bc1dbf Merge pull request #30080 from deepeshgarg007/item_wise_sales_history
fix: Item-wise sales history report
2022-03-09 10:18:14 +05:30
Deepesh Garg
e829f65fde Merge pull request #30102 from deepeshgarg007/pick_list_query
fix: Ambigous column in picklist query
2022-03-09 10:17:26 +05:30
Rucha Mahabal
096092f173 fix: leave allocation records query (#30118) 2022-03-08 23:16:40 +05:30
Chillar Anand
ce27cdb121 test: Fix flaky tests (#30107) 2022-03-08 23:07:23 +05:30
Deepesh Garg
edf043261e Merge pull request #29954 from frappe/mergify/bp/develop/pr-29714
fix: Fetch valuation rate for stock items consumed during asset repair (backport #29714)
2022-03-08 23:02:15 +05:30
Deepesh Garg
816e12dafc Merge branch 'develop' into mergify/bp/develop/pr-29714 2022-03-08 21:40:00 +05:30
Saqib Ansari
0840acc653 Merge branch 'develop' into fix-#23231 2022-03-08 17:29:26 +05:30
Saqib Ansari
1061256358 Merge branch 'develop' into fix-customer-credit-limit-update 2022-03-08 16:01:17 +05:30
Saqib Ansari
66f20209f6 perf(asset): fetch only distinct depreciable assets 2022-03-08 15:57:54 +05:30
Saqib Ansari
a0dc79332d fix: customer credit limit validation on update 2022-03-08 15:21:27 +05:30
Rucha Mahabal
430bf00458 fix: add type hints for employee leave balance report 2022-03-08 13:36:08 +05:30
Saqib Ansari
56eb485eec Merge pull request #30097 from nextchamp-saqib/fix-pos-round-off
fix(pos): multiple pos round off cases
2022-03-08 11:24:47 +05:30
mergify[bot]
7a3d30161f fix: translate error message titles (#30105)
(cherry picked from commit 456ebc32f0)

Co-authored-by: Türker Tunalı <turker.tunali@gmail.com>
2022-03-08 10:42:30 +05:30
Chillar Anand
282e9f83b9 Merge branch 'develop' into party 2022-03-08 09:53:03 +05:30
Deepesh Garg
83dd3bd7fc Merge pull request #29940 from deepeshgarg007/item_discounts_quotation
fix: Item discounts for quotation and other docs
2022-03-08 09:08:51 +05:30
ChillarAnand
9ace7d606c fix: Ignore missing customer group while fetching price list 2022-03-08 08:44:48 +05:30
Deepesh Garg
d9d4c2ce79 fix: Remove unintentional changes 2022-03-08 07:56:44 +05:30
Deepesh Garg
517fbf1d1f fix: Ambigous column in picklist query 2022-03-07 22:31:42 +05:30
Saqib Ansari
72fab9ba1e Merge branch 'develop' into fix-pos-round-off 2022-03-07 20:22:20 +05:30
Dany Robert
748d5c4873 fix: wrong payment days in salary slip for employees joining/leaving during mid payroll dates (#29082)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-03-07 19:57:57 +05:30
Saqib Ansari
a13624d78b Merge branch 'develop' into fix-pos-round-off 2022-03-07 18:24:13 +05:30
Saqib Ansari
17445c7e04 fix(pos): multiple pos round off cases 2022-03-07 18:01:07 +05:30
Deepesh Garg
f3a95d3c27 fix(ux): Improve label for better understanding 2022-03-07 16:10:26 +05:30
Marica
ee43f83ff8 Merge branch 'develop' into item-group-filters-listing 2022-03-07 13:18:38 +05:30
marination
b2755f6fdd feat: Include child item group products in Item Group Page & cleanup
- Added 'Include descendants' checkbox, which will pull child item group products too
- Build item group filters in query engine file
- Include logic in filter engine
- Clean up Website section of Item Group page (UX)
- Add util to fetch child item groups including self
2022-03-07 13:02:08 +05:30
Saqib Ansari
385830bb51 Merge pull request #30084 from nextchamp-saqib/remove-einv-batch
fix(e-invoicing): remove batch no from e-invoices
2022-03-07 11:53:09 +05:30
Saqib Ansari
031a0dd703 fix(e-invoicing): remove batch no from e-invoices 2022-03-07 11:40:01 +05:30
Marica
7579981fb5 Merge pull request #29987 from marination/mr-to-order-and-receive-report
fix: Get MRs that are yet to be received but fully ordered in Report `Requested Items to Order and Receive`
2022-03-07 10:18:28 +05:30
Deepesh Garg
e2c144e9e3 fix: Item-wise sales history report 2022-03-06 19:05:02 +05:30
Deepesh Garg
c6c51d7312 Merge branch 'develop' into gstr_3b_nil_exempt_fixed 2022-03-06 18:09:38 +05:30
Deepesh Garg
629a296fb6 Merge branch 'develop' into bank_reco_multicurrency_fix 2022-03-06 18:09:30 +05:30
Deepesh Garg
428415ed55 Merge pull request #30040 from frappe/mergify/bp/develop/pr-30025
fix: Exchange rate not getting set in payment entry (backport #30025)
2022-03-06 18:07:35 +05:30
Sagar Vora
3d45f3a6a8 Merge remote-tracking branch 'upstream/develop' into remove-india 2022-03-03 10:20:50 +05:30
Ankush Menat
9ef35ef773 fix: dont hardcode precision in routing
Co-Authored-By: Suraj Shetty <surajshetty3416@gmail.com>
2022-03-02 18:27:22 +05:30
Ankush Menat
f8ac4c082a fix: remove dead dashboard links 2022-03-02 18:27:22 +05:30
Saqib Ansari
cd2513ceec Merge pull request #29939 from nextchamp-saqib/ordered-qty-for-packed-items
feat: update ordered qty for packed items
2022-03-02 17:10:20 +05:30
Ankush Menat
55a966ec41 chore: get stock reco qty from SR instead of SLE (#30059)
[skip ci]
2022-03-02 14:49:45 +05:30
Rucha Mahabal
b988046082 fix(Timesheet): fetch exchange rate only if currency is set (#30057) 2022-03-02 14:15:22 +05:30
Ankush Menat
90af40ac3c Merge pull request #30055 from resilient-tech/fix-install-fixtures
fix: handle `ImportError` when installing country fixtures
2022-03-02 14:11:23 +05:30
Ankush Menat
3638fbf06b fix: repost items with repeating item-warehouses 2022-03-02 13:11:04 +05:30
Ankush Menat
701878f60b revert "fix: FIFO valuation in case of multi-item entries"
This reverts commit b8ee193d1a.

This is huge performance regression for large docs.
2022-03-02 13:11:04 +05:30
Ankush Menat
2f71c5bcca test: repack FIFO rates 2022-03-02 13:11:04 +05:30
Ankush Menat
ccd2ce56b1 fix: FIFO valuation in case of multi-item entries 2022-03-02 13:11:04 +05:30
Ankush Menat
b3b7cdfb49 test: FIFO transfer for multi-batch transaction 2022-03-02 13:11:04 +05:30
marination
54b3676f35 fix: linter (imports alphabetical) 2022-03-02 13:09:34 +05:30
Sagar Vora
89368ece41 style: use f-string 2022-03-02 12:40:25 +05:30
Sagar Vora
98f26e9cbb fix: handle ImportError when installing country fixtures 2022-03-02 12:39:00 +05:30
Ankush Menat
5d85b35f41 test: fix flaky bin value test 2022-03-02 12:32:54 +05:30
Ankush Menat
eb8495a401 docs: explain make_sl_entries arguments 2022-03-02 12:27:18 +05:30
Ankush Menat
efc4b943f8 fix: ignore serial no during landed cost voucher 2022-03-02 12:27:18 +05:30
Marica
e0d5c6118f Merge branch 'develop' into mr-to-order-and-receive-report 2022-03-02 12:14:50 +05:30
Saqib Ansari
89f87cee87 Merge branch 'develop' into ordered-qty-for-packed-items 2022-03-02 12:13:56 +05:30
Deepesh Garg
d95f8934aa fix: Test cases with discount 2022-03-01 23:09:59 +05:30
Rucha Mahabal
e874149b94 Merge pull request #29335 from ruchamahabal/emp-adv-status 2022-03-01 22:36:04 +05:30
Rucha Mahabal
9988ec697f test: test advance filters in expense claim and cancelled status 2022-03-01 21:40:39 +05:30
Rucha Mahabal
57f92df108 fix: flake8 issues 2022-03-01 20:50:36 +05:30
Rucha Mahabal
650099ee65 Merge branch 'develop' into emp-adv-status 2022-03-01 20:30:58 +05:30
Deepesh Garg
2eb7921bff fix: Exchange rate not getting set in payment entry
(cherry picked from commit 86e6bdf2c9)
2022-03-01 12:49:09 +00:00
Ankush Menat
65bb727030 fix: dont validate empty category 2022-03-01 17:47:47 +05:30
Deepesh Garg
abe580e8b0 fix: Nil and Exempted values in GSTR-3B Report 2022-03-01 17:37:38 +05:30
marination
ac425722e2 fix: Sider and Linter 2022-03-01 17:30:37 +05:30
marination
e6952cb7f9 refactor: Convert to QB, added test file, removed white space
- Converted mysql raw query to qb
- Test file for Report Requested Items to Order and Receive
- Removed white space and edited copyright year
2022-03-01 17:15:04 +05:30
Marica
adeca5a25c Merge pull request #28939 from marination/prod-plan-sub-items-aggregate
feat: Provision to aggregate subassembly items in production plan
2022-03-01 16:07:35 +05:30
marination
1d1d586d4d test: Included sub assembly non-merging in test case 2022-03-01 15:42:34 +05:30
Marica
d2f1c4f307 Merge branch 'develop' into prod-plan-sub-items-aggregate 2022-03-01 15:33:02 +05:30
Saqib Ansari
056a0ec421 Merge pull request #30034 from nextchamp-saqib/fix-pos-flaky-test
fix(test): flaky test_point_of_sale
2022-03-01 15:32:33 +05:30
Saqib Ansari
47fe87a72f fix(test): flaky test_point_of_sale 2022-03-01 14:56:24 +05:30
Saqib Ansari
6b494eed79 Merge pull request #30032 from nextchamp-saqib/fix-debit-credit-diff
fix: debit credit difference case with rounding adjustment
2022-03-01 14:12:31 +05:30
Saqib Ansari
ad2c64f3ff fix: debit credit difference case with rounding adjustment 2022-03-01 13:32:34 +05:30
Ankush Menat
d22a1d440c fix: track changes on warehouse 2022-03-01 13:08:25 +05:30
Marica
5a8c80b153 Merge branch 'develop' into mr-to-order-and-receive-report 2022-03-01 13:01:35 +05:30
Smit Vora
80c0d0db21 Merge branch 'remove-india' of github.com:resilient-tech/erpnext into remove-india 2022-03-01 12:59:28 +05:30
marination
ffbb2c8311 fix: Assert False for test that is anticipating an empty table and remove second arg to assertTrue 2022-03-01 12:57:09 +05:30
Deepesh Garg
0542416c47 Merge pull request #30026 from deepeshgarg007/deferred_revenue_post_accounts_freeze
fix: Deferred revenue booking
2022-03-01 12:41:41 +05:30
marination
25fa6344a6 test: Adjust test as per teardown
- make tests use multi level bom in WO, as BOM at setup is used
- earlier, an intermediate BOM made in a test would override the BOM at setup
2022-03-01 12:24:45 +05:30
Deepesh Garg
366120ffee fix: Deferred revenue booking 2022-03-01 11:57:34 +05:30
Ankush Menat
afb69b0b7f Merge branch 'develop' into item_discounts_quotation 2022-03-01 11:49:25 +05:30
Ankush Menat
bbc4710fa3 fix: apply margin on duplicated doc too 2022-03-01 11:48:28 +05:30
Rushabh Mehta
4e2c284be7 fix(minor): nix the ugly banner 2022-03-01 08:52:42 +05:30
Rohit Waghchaure
bda9d09125 bumped to version 14.0.0-beta.2 2022-02-28 21:57:03 +05:30
Marica
789e042f7d Merge branch 'develop' into prod-plan-sub-items-aggregate 2022-02-28 17:38:29 +05:30
Marica
5fe8c48ba8 Merge branch 'develop' into prod-plan-sub-items-aggregate 2022-02-28 17:38:14 +05:30
Rucha Mahabal
3f3b1766c2 test: get leave details for leave application dashboard 2022-02-28 17:30:09 +05:30
marination
292fe370db test: combine sub assembly items and make Production Plan tests atomic 2022-02-28 16:35:20 +05:30
Rucha Mahabal
a58dfecb23 test: fix test test_leave_balance_near_allocaton_expiry 2022-02-28 15:27:24 +05:30
Marica
b8593188f3 Merge branch 'develop' into prod-plan-sub-items-aggregate 2022-02-28 15:08:21 +05:30
Rucha Mahabal
aaa1ae94f2 fix: earned leave policy assignment test 2022-02-28 14:26:49 +05:30
Rucha Mahabal
942511cfff fix: leave application dashboard
- total leaves allocated considering cancelled leaves

- optional plural for leave category labels

- show dashboard only once from date is set, else it fetches all allocations till date and generates incorrect balance

- change pending leaves to 'Leaves Pending Approval' for better context

- update labels in Salary Slip Leave Details table
2022-02-28 14:10:23 +05:30
Subin Tom
1ab5b7a811 fix: linter, sider fixes 2022-02-28 12:47:05 +05:30
Rucha Mahabal
88141d6116 test: Employee Leave Balance Summary 2022-02-28 12:12:52 +05:30
Saqib Ansari
6ca508fd85 Merge pull request #30008 from frappe/mergify/bp/version-14-beta-pre-release/pr-29991
fix(pos): minor fixes (backport #29991)
2022-02-28 12:07:12 +05:30
Saqib Ansari
d4767b541b fix: merge conflict 2022-02-28 11:36:47 +05:30
Saqib Ansari
823979fbcc fix(pos): coupon code is applied even if ignore pricing rule is check
(cherry picked from commit 81514516f3)

# Conflicts:
#	erpnext/selling/page/point_of_sale/pos_payment.js
2022-02-28 06:05:49 +00:00
Saqib Ansari
c75283265b fix(pos): mode of payment disappears after save
(cherry picked from commit 69c34cd7ae)
2022-02-28 06:05:48 +00:00
Saqib Ansari
cde711151e Merge branch 'develop' into ordered-qty-for-packed-items 2022-02-28 11:35:42 +05:30
Rucha Mahabal
c7d594984a chore: remove unused imports, sort imports, fix sider 2022-02-28 10:19:16 +05:30
Rucha Mahabal
d14a5c0f64 Merge branch 'develop' into leave-opening-balance 2022-02-28 10:03:38 +05:30
Rucha Mahabal
c050ce49c2 test: employee leave balance report
- fix expired leaves calculation when filters span across 2 different allocation periods
2022-02-28 09:58:12 +05:30
hrzzz
16de29a3cb fix(translation) - correction for translation 2022-02-25 16:56:23 -03:00
Subin Tom
f1f3e035a6 Merge branch 'exotel-fixes' of https://github.com/nemesis189/erpnext into exotel-fixes 2022-02-25 16:59:35 +05:30
Subin Tom
5b79496f05 fix: call type doctype, fixes 2022-02-25 16:52:25 +05:30
Subin Tom
a91fb88929 fix: sider fixes 2022-02-25 13:45:26 +05:30
Subin Tom
00b0f10100 fix: added type of call select field, additional status for agent rejecting call 2022-02-25 13:38:57 +05:30
marination
d3b0ca30c6 fix: Get MRs that are yet to be received but fully ordered in Report
- Remove incorrect query clause that only check if ordered qty < 100
- MR should be visible in report until fully received (cycle complete)
2022-02-25 12:10:11 +05:30
Subin Tom
fd20713bd7 fix: added field to show called group, user_id 2022-02-25 12:01:53 +05:30
Sagar Vora
b90a134d91 fix: remove patches 2022-02-25 11:36:18 +05:30
Sagar Vora
5159e2e6c5 refactor: remove India specific code 2022-02-25 11:36:18 +05:30
Devin Slauenwhite
a1ae7fcbc8 fix: show fail message 2022-02-24 16:36:30 -05:00
Deepesh Garg
cbb5ffb6fe fix: Multi-currency bank reconciliation fixes 2022-02-24 15:58:12 +05:30
marination
6d72aa377f feat: Combine Sub-assembly items in Production Plan
- Combine subassembly rows if same Item, Warehouse, Inhouse/Outhouse Manu.g, BOM No.
2022-02-24 15:20:18 +05:30
Saqib Ansari
2f1709dfef chore: remove unintentional search index 2022-02-24 15:12:35 +05:30
Saqib Ansari
1e139cf9a1 chore: remove unintentional search index 2022-02-24 15:12:12 +05:30
Subin Tom
006606c437 fix: added employee name to call log 2022-02-23 18:45:50 +05:30
Subin Tom
8d3011832b fix: call status fix 2022-02-23 12:59:38 +05:30
Suraj Shetty
69777353bd Merge pull request #29957 from frappe/mergify/bp/version-14-beta-pre-release/pr-29956 2022-02-23 11:01:52 +05:30
Suraj Shetty
ed16bbfb1d fix: Email translations
(cherry picked from commit aaa84a21ba)
2022-02-23 05:30:55 +00:00
Saqib Ansari
8743e39469 fix: sider
(cherry picked from commit bc28755978)
2022-02-23 03:55:49 +00:00
Saqib Ansari
3dcc3a349e fix: cannot edit valutaion_rate in asset repair
(cherry picked from commit 2aba6c38b3)
2022-02-23 03:55:49 +00:00
Saqib Ansari
414c3b8dd2 fix: remove redundant method
(cherry picked from commit 57d5a027fb)
2022-02-23 03:55:48 +00:00
GangaManoj
5d3b65b944 fix: Pass value instead of array
(cherry picked from commit e1a9b61103)
2022-02-23 03:55:48 +00:00
GangaManoj
3d6ed4ebde fix: Fetch valuation rate
(cherry picked from commit df71907be4)
2022-02-23 03:55:48 +00:00
Saqib Ansari
3ee1383802 Merge branch 'develop' into ordered-qty-for-packed-items 2022-02-22 18:45:31 +05:30
Deepesh Garg
3a547cb0d9 fix: Item discounts for quotation 2022-02-22 16:25:32 +05:30
Saqib Ansari
8e3f1e306d test: po updates packed item's ordered_qty 2022-02-22 15:34:26 +05:30
Saqib Ansari
8005fee656 feat: update ordered qty for packed items 2022-02-22 15:06:19 +05:30
Sagar Vora
3936d8b70e refactor: remove India specific code 2022-02-20 11:48:04 +05:30
Raffael Meyer
9fde0f0a9c Merge branch 'develop' into revert-bu-schluessel 2022-02-07 17:18:33 +01:00
barredterra
363ed9ccba revert: BU Schlüssel (a21f76f) 2022-02-05 14:06:18 +01:00
Rucha Mahabal
dbfa463738 fix: show actual balance instead of consumption balance in opening balance
- not changing opening balance based on remaining days
2022-02-04 13:04:25 +05:30
Rucha Mahabal
b5c686ac40 fix: sort imports, sider issues 2022-02-04 12:39:58 +05:30
Rucha Mahabal
55ac8519bf refactor: balance in Balance Summary report near allocation expiry date
- Leave Balance shows minimum leaves remaining after comparing with remaining days for allocation expiry causing ambiguity

- refactor remaining leaves calculation to return both, actual leave balance and balance for consumption

- show actual balance in leave application, use balance for consumption only in validations
2022-02-04 12:29:00 +05:30
Rucha Mahabal
26b40e7cfd refactor: Leaves Taken calculation
- fix issue where Leaves Taken also adds leaves expiring on boundary date as leaves taken, causing ambiguity

- remove unnecessary `skip_expiry_leaves` function

- `get_allocation_expiry` considering cancelled entries too
2022-02-04 00:01:05 +05:30
Rucha Mahabal
1ea749cf1a fix: expired leaves not calculated properly because of newly created expiry ledger entries 2022-02-03 23:34:46 +05:30
Rucha Mahabal
538b64b1fa refactor: Employee Leave Balance Report
- incorrect opening balance on boundary allocation dates

- carry forwarded leaves accounted in leaves allocated column, should be part of opening balance

- leaves allocated column also adds expired leave allocations causing negative balances, should only consider non-expiry records
2022-01-31 21:50:42 +05:30
Rucha Mahabal
17b1f5f256 test: employee advance status 2022-01-18 18:35:25 +05:30
Rucha Mahabal
85be0d22d4 fix: employee advance status update on return via additional salary 2022-01-18 14:38:16 +05:30
Rucha Mahabal
0843d43885 fix(Expense Claim): validate advances after setting totals 2022-01-18 14:37:45 +05:30
Rucha Mahabal
bf30932de0 patch: Employee Advance return statuses 2022-01-18 14:36:38 +05:30
Rucha Mahabal
e04b3aaf7a feat(Employee Advance): add 'Returned' and 'Partly Claimed and Returned' status 2022-01-18 14:36:22 +05:30
Deepesh Garg
a7f15a0eea Merge branch 'develop' of https://github.com/frappe/erpnext into party_account_currency_check 2021-12-12 21:09:11 +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
Deepesh Garg
417d6abcf4 fix: Party account validation in JV 2021-08-26 17:13:36 +05:30
Deepesh Garg
27ca9866e3 Merge branch 'develop' of https://github.com/frappe/erpnext into party_account_currency_check 2021-08-25 20:47:16 +05:30
Deepesh Garg
30876a105c test: Set default currency for patient 2021-08-22 23:48:23 +05:30
Deepesh Garg
c10a22529c test: fix property name 2021-08-22 18:05:24 +05:30
Deepesh Garg
60915e874d test: Update test cases for currency change validation 2021-08-21 23:05:48 +05:30
Deepesh Garg
1435800249 Merge branch 'develop' of https://github.com/frappe/erpnext into party_account_currency_check 2021-08-21 20:14:17 +05:30
Deepesh Garg
0a618817dc Revert "fix: Add party account validation for journal entry"
This reverts commit f00620a3ca.
2021-08-16 10:40:26 +05:30
Deepesh Garg
bcaf475295 fix: Healthcare module accounting test cases 2021-08-15 21:19:18 +05:30
Deepesh Garg
f00620a3ca fix: Add party account validation for journal entry 2021-08-15 21:18:13 +05:30
Deepesh Garg
fa79e94b49 Merge branch 'develop' of https://github.com/frappe/erpnext into party_account_currency_check 2021-08-15 18:59:08 +05:30
Deepesh Garg
80c85dd17c fix: Account currency validation for first transaction 2021-08-12 15:39:07 +05:30
3110 changed files with 129518 additions and 234082 deletions

View File

@@ -5,7 +5,7 @@
"es6": true
},
"parserOptions": {
"ecmaVersion": 9,
"ecmaVersion": 11,
"sourceType": "module"
},
"extends": "eslint:recommended",

View File

@@ -29,6 +29,9 @@ ignore =
B950,
W191,
E124, # closing bracket, irritating while writing QB code
E131, # continuation line unaligned for hanging indent
E123, # closing bracket does not match indentation of opening bracket's line
E101, # ensured by use of black
max-line-length = 200
exclude=.github/helper/semgrep_rules

View File

@@ -23,3 +23,9 @@ b147b85e6ac19a9220cd1e2958a6ebd99373283a
# removing six compatibility layer
8fe5feb6a4372bf5f2dfaf65fca41bbcc25c8ce7
# bulk format python code with black
494bd9ef78313436f0424b918f200dab8fc7c20b
# bulk format python code with black
baec607ff5905b1c67531096a9cf50ec7ff00a5d

View File

@@ -12,10 +12,18 @@ Welcome to ERPNext issue tracker! Before creating an issue, please heed the foll
1. This tracker should only be used to report bugs and request features / enhancements to ERPNext
- For questions and general support, checkout the manual https://erpnext.com/docs/user/manual/en or use https://discuss.erpnext.com
- For documentation issues, refer to https://github.com/frappe/erpnext_com
2. Use the search function before creating a new issue. Duplicates will be closed and directed to
the original discussion.
3. When making a feature request, make sure to be as verbose as possible. The better you convey your message, the greater the drive to make it happen.
3. When making a feature request, make sure to be as verbose as possible. The better you convey your message, the greater the drive to make it happen.
Please keep in mind that we get many many requests and we can't possibly work on all of them, we prioritize development based on the goals of the product and organization. Feature requests are still welcome as it helps us in research when we do decide to work on the requested feature.
If you're in urgent need to a feature, please try the following channels to get paid developments done quickly:
1. Certified ERPNext partners: https://erpnext.com/partners
2. Developer community on ERPNext forums: https://discuss.erpnext.com/c/developers/5
3. Telegram group for ERPNext/Frappe development work: https://t.me/erpnext_opps
-->
**Is your feature request related to a problem? Please describe.**

View File

@@ -66,6 +66,7 @@ ignore =
F841,
E713,
E712,
B023
max-line-length = 200

View File

@@ -4,7 +4,7 @@ set -e
cd ~ || exit
sudo apt-get install redis-server libcups2-dev
sudo apt update && sudo apt install redis-server libcups2-dev
pip install frappe-bench
@@ -56,6 +56,7 @@ sed -i 's/schedule:/# schedule:/g' Procfile
sed -i 's/socketio:/# socketio:/g' Procfile
sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
bench get-app payments
bench get-app erpnext "${GITHUB_WORKSPACE}"
if [ "$TYPE" == "server" ]; then bench setup requirements --dev; fi

12
.github/stale.yml vendored
View File

@@ -24,14 +24,4 @@ pulls:
:) Also, even if it is closed, you can always reopen the PR when you're
ready. Thank you for contributing.
issues:
daysUntilStale: 60
daysUntilClose: 7
exemptLabels:
- valid
- to-validate
- QA
markComment: >
This issue has been automatically marked as inactive because it has not had
recent activity and it wasn't validated by maintainer team. It will be
closed within a week if no further activity occurs.
only: pulls

View File

@@ -1,4 +1,4 @@
<svg width="201" height="60" viewBox="0 0 201 60" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4 2 193 52">
<g filter="url(#filter0_dd)">
<rect x="4" y="2" width="193" height="52" rx="6" fill="#2490EF"/>
<path d="M28 22.2891H32.8786V35.5H36.2088V22.2891H41.0874V19.5H28V22.2891Z" fill="white"/>

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -12,7 +12,7 @@ jobs:
- name: 'Setup Environment'
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- name: 'Clone repo'
uses: actions/checkout@v2

View File

@@ -11,10 +11,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- name: Install and Run Pre-commit
uses: pre-commit/action@v2.0.3
@@ -22,10 +22,8 @@ jobs:
- name: Download Semgrep rules
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
- uses: returntocorp/semgrep-action@v1
env:
SEMGREP_TIMEOUT: 120
with:
config: >-
r/python.lang.correctness
./frappe-semgrep-rules/rules
- name: Download semgrep
run: pip install semgrep==0.97.0
- name: Run Semgrep rules
run: semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness

View File

@@ -4,7 +4,10 @@ on:
pull_request:
paths-ignore:
- '**.js'
- '**.css'
- '**.md'
- '**.html'
- '**.csv'
workflow_dispatch:
concurrency:
@@ -31,10 +34,18 @@ jobs:
- name: Clone
uses: actions/checkout@v2
- name: Check for valid Python & Merge Conflicts
run: |
python -m compileall -f "${GITHUB_WORKSPACE}"
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
- name: Setup Python
uses: actions/setup-python@v2
uses: "gabrielfalcao/pyenv-action@v9"
with:
python-version: 3.8
versions: 3.10:latest, 3.7:latest
- name: Setup Node
uses: actions/setup-node@v2
@@ -49,7 +60,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
@@ -79,7 +90,10 @@ jobs:
${{ runner.os }}-yarn-
- name: Install
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
run: |
pip install frappe-bench
pyenv global $(pyenv versions | grep '3.10')
bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
DB: mariadb
TYPE: server
@@ -93,6 +107,7 @@ jobs:
git -C "apps/frappe" remote set-url upstream https://github.com/frappe/frappe.git
git -C "apps/erpnext" remote set-url upstream https://github.com/frappe/erpnext.git
pyenv global $(pyenv versions | grep '3.7')
for version in $(seq 12 13)
do
echo "Updating to v$version"
@@ -104,7 +119,11 @@ jobs:
git -C "apps/frappe" checkout -q -f $branch_name
git -C "apps/erpnext" checkout -q -f $branch_name
bench setup requirements --python
rm -rf ~/frappe-bench/env
bench setup env
bench pip install -e ./apps/payments
bench pip install -e ./apps/erpnext
bench --site test_site migrate
done
@@ -112,4 +131,12 @@ jobs:
echo "Updating to latest version"
git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
pyenv global $(pyenv versions | grep '3.10')
rm -rf ~/frappe-bench/env
bench -v setup env
bench pip install -e ./apps/payments
bench pip install -e ./apps/erpnext
bench --site test_site migrate
bench --site test_site install-app payments

33
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Generate Semantic Release
on:
push:
branches:
- version-14
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Entire Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Setup dependencies
run: |
npm install @semantic-release/git @semantic-release/exec --no-save
- name: Create Release
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GIT_AUTHOR_NAME: "Frappe PR Bot"
GIT_AUTHOR_EMAIL: "developers@frappe.io"
GIT_COMMITTER_NAME: "Frappe PR Bot"
GIT_COMMITTER_EMAIL: "developers@frappe.io"
run: npx semantic-release

30
.github/workflows/semantic-commits.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Semantic Commits
on:
pull_request: {}
permissions:
contents: read
concurrency:
group: commitcheck-erpnext-${{ github.event.number }}
cancel-in-progress: true
jobs:
commitlint:
name: Check Commit Titles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 200
- uses: actions/setup-node@v3
with:
node-version: 14
check-latest: true
- name: Check commit titles
run: |
npm install @commitlint/cli @commitlint/config-conventional
npx commitlint --verbose --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}

View File

@@ -4,8 +4,10 @@ on:
pull_request:
paths-ignore:
- '**.js'
- '**.css'
- '**.md'
- '**.html'
- '**.csv'
push:
branches: [ develop ]
paths-ignore:
@@ -57,7 +59,15 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- name: Check for valid Python & Merge Conflicts
run: |
python -m compileall -f "${GITHUB_WORKSPACE}"
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v2
@@ -72,7 +82,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
@@ -110,16 +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: codecov/codecov-action@v2
with:
name: MariaDB
fail_ci_if_error: true
files: /home/runner/frappe-bench/sites/coverage.xml
verbose: true

View File

@@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
container: [1, 2, 3]
container: [1]
name: Python Unit Tests
@@ -46,7 +46,15 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- name: Check for valid Python & Merge Conflicts
run: |
python -m compileall -f "${GITHUB_WORKSPACE}"
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v2
@@ -61,7 +69,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
@@ -90,7 +98,6 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:

View File

@@ -1,117 +0,0 @@
name: UI
on:
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
concurrency:
group: ui-develop-${{ github.event.number }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
name: UI Tests (Cypress)
services:
mysql:
image: mariadb:10.3
env:
MYSQL_ALLOW_EMPTY_PASSWORD: YES
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Clone
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/setup-node@v2
with:
node-version: 14
check-latest: true
- name: Add to Hosts
run: |
echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache cypress binary
uses: actions/cache@v2
with:
path: ~/.cache
key: ${{ runner.os }}-cypress-
restore-keys: |
${{ runner.os }}-cypress-
${{ runner.os }}-
- name: Install
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
DB: mariadb
TYPE: ui
- name: Site Setup
run: cd ~/frappe-bench/ && bench --site test_site execute erpnext.setup.utils.before_tests
- name: cypress pre-requisites
run: cd ~/frappe-bench/apps/frappe && yarn add cypress-file-upload@^5 @testing-library/cypress@^8 --no-lockfile
- name: Build Assets
run: cd ~/frappe-bench/ && bench build
env:
CI: Yes
- name: UI Tests
run: cd ~/frappe-bench/ && bench --site test_site run-ui-tests erpnext --headless
env:
CYPRESS_RECORD_KEY: 60a8e3bf-08f5-45b1-9269-2b207d7d30cd
- name: Show bench console if tests failed
if: ${{ failure() }}
run: cat ~/frappe-bench/bench_run_logs.txt

View File

@@ -7,6 +7,10 @@ pull_request_rules:
- author!=gavindsouza
- author!=rohitwaghchaure
- author!=nabinhait
- author!=ankush
- author!=deepeshgarg007
- author!=mergify[bot]
- or:
- base=version-13
- base=version-12
@@ -17,6 +21,16 @@ pull_request_rules:
@{{author}}, thanks for the contribution, but we do not accept pull requests on a stable branch. Please raise PR on an appropriate hotfix branch.
https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist#which-branch
- name: Auto-close PRs on pre-release branch
conditions:
- base=version-13-pre-release
actions:
close:
comment:
message: |
@{{author}}, pre-release branch is not maintained anymore. Releases are directly done by merging hotfix branch to stable branches.
- name: backport to develop
conditions:
- label="backport develop"
@@ -86,3 +100,37 @@ pull_request_rules:
- version-12-pre-release
assignees:
- "{{ author }}"
- name: Automatic merge on CI success and review
conditions:
- status-success=linters
- status-success=Sider
- status-success=Semantic Pull Request
- status-success=Patch Test
- status-success=Python Unit Tests (1)
- status-success=Python Unit Tests (2)
- status-success=Python Unit Tests (3)
- label!=dont-merge
- label!=squash
- "#approved-reviews-by>=1"
actions:
merge:
method: merge
- name: Automatic squash on CI success and review
conditions:
- status-success=linters
- status-success=Sider
- status-success=Patch Test
- status-success=Python Unit Tests (1)
- status-success=Python Unit Tests (2)
- status-success=Python Unit Tests (3)
- label!=dont-merge
- label=squash
- "#approved-reviews-by>=1"
actions:
merge:
method: squash
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}

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: [
@@ -26,12 +26,19 @@ repos:
args: ['--config', '.github/helper/.flake8_strict']
exclude: ".*setup.py$"
- repo: https://github.com/adityahase/black
rev: 9cb0a69f4d0030cdf687eddf314468b39ed54119
hooks:
- id: black
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/timothycrosley/isort
rev: 5.9.1
hooks:
- id: isort
exclude: ".*setup.py$"
ci:
autoupdate_schedule: weekly
skip: []

24
.releaserc Normal file
View File

@@ -0,0 +1,24 @@
{
"branches": ["version-14"],
"plugins": [
"@semantic-release/commit-analyzer", {
"preset": "angular",
"releaseRules": [
{"breaking": true, "release": false}
]
},
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec", {
"prepareCmd": 'sed -ir -E "s/\"[0-9]+\.[0-9]+\.[0-9]+\"/\"${nextRelease.version}\"/" erpnext/__init__.py'
}
],
[
"@semantic-release/git", {
"assets": ["erpnext/__init__.py"],
"message": "chore(release): Bumped to Version ${nextRelease.version}\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}

View File

@@ -3,33 +3,26 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
erpnext/accounts/ @nextchamp-saqib @deepeshgarg007
erpnext/assets/ @nextchamp-saqib @deepeshgarg007
erpnext/erpnext_integrations/ @nextchamp-saqib
erpnext/accounts/ @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/assets/ @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/loan_management/ @nextchamp-saqib @deepeshgarg007
erpnext/regional @nextchamp-saqib @deepeshgarg007
erpnext/selling @nextchamp-saqib @deepeshgarg007
erpnext/regional @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/selling @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/support/ @nextchamp-saqib @deepeshgarg007
pos* @nextchamp-saqib
erpnext/buying/ @marination @rohitwaghchaure @ankush
erpnext/e_commerce/ @marination
erpnext/maintenance/ @marination @rohitwaghchaure
erpnext/manufacturing/ @marination @rohitwaghchaure @ankush
erpnext/portal/ @marination
erpnext/quality_management/ @marination @rohitwaghchaure
erpnext/shopping_cart/ @marination
erpnext/stock/ @marination @rohitwaghchaure @ankush
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/ @ruchamahabal @pateljannat
erpnext/education/ @ruchamahabal @pateljannat
erpnext/hr/ @ruchamahabal @pateljannat
erpnext/payroll @ruchamahabal @pateljannat
erpnext/projects/ @ruchamahabal @pateljannat
erpnext/crm/ @NagariaHussain
erpnext/education/ @rutwikhdev
erpnext/projects/ @ruchamahabal
erpnext/controllers/ @deepeshgarg007 @nextchamp-saqib @rohitwaghchaure @marination @ankush
erpnext/patches/ @deepeshgarg007 @nextchamp-saqib @marination @ankush
erpnext/public/ @nextchamp-saqib @marination
erpnext/controllers/ @deepeshgarg007 @nextchamp-saqib @rohitwaghchaure
erpnext/patches/ @deepeshgarg007 @nextchamp-saqib
.github/ @ankush
requirements.txt @gavindsouza
pyproject.toml @ankush

View File

@@ -1,11 +1,14 @@
<div align="center">
<img src="https://raw.githubusercontent.com/frappe/erpnext/develop/erpnext/public/images/erpnext-logo.png" height="128">
<a href="https://erpnext.com">
<img src="https://raw.githubusercontent.com/frappe/erpnext/develop/erpnext/public/images/erpnext-logo.png" height="128">
</a>
<h2>ERPNext</h2>
<p align="center">
<p>ERP made simple</p>
</p>
[![CI](https://github.com/frappe/erpnext/actions/workflows/server-tests.yml/badge.svg?branch=develop)](https://github.com/frappe/erpnext/actions/workflows/server-tests.yml)
[![UI](https://github.com/erpnext/erpnext_ui_tests/actions/workflows/ui-tests.yml/badge.svg?branch=develop&event=schedule)](https://github.com/erpnext/erpnext_ui_tests/actions/workflows/ui-tests.yml)
[![Open Source Helpers](https://www.codetriage.com/frappe/erpnext/badges/users.svg)](https://www.codetriage.com/frappe/erpnext)
[![codecov](https://codecov.io/gh/frappe/erpnext/branch/develop/graph/badge.svg?token=0TwvyUg3I5)](https://codecov.io/gh/frappe/erpnext)
[![docker pulls](https://img.shields.io/docker/pulls/frappe/erpnext-worker.svg)](https://hub.docker.com/r/frappe/erpnext-worker)
@@ -31,40 +34,39 @@ ERPNext as a monolith includes the following areas for managing businesses:
1. [Customize ERPNext](https://erpnext.com/docs/user/manual/en/customize-erpnext)
1. [And More](https://erpnext.com/docs/user/manual/en/)
ERPNext requires MariaDB.
ERPNext is built on the [Frappe Framework](https://github.com/frappe/frappe), a full-stack web app framework built with Python & JavaScript.
- [User Guide](https://erpnext.com/docs/user)
- [Discussion Forum](https://discuss.erpnext.com/)
## Installation
---
<div align="center">
<a href="https://frappecloud.com/deploy?apps=frappe,erpnext&source=erpnext_readme">
<div align="center" style="max-height: 40px;">
<a href="https://frappecloud.com/erpnext/signup">
<img src=".github/try-on-f-cloud-button.svg" height="40">
</a>
<a href="https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/frappe/frappe_docker/main/pwd.yml">
<img src="https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png" alt="Try in PWD" height="37"/>
</a>
</div>
> Login for the PWD site: (username: Administrator, password: admin)
### Containerized Installation
Use docker to deploy ERPNext in production or for development of [Frappe](https://github.com/frappe/frappe) apps. See https://github.com/frappe/frappe_docker for more details.
### Full Install
### Manual Install
The Easy Way: our install script for bench will install all dependencies (e.g. MariaDB). See https://github.com/frappe/bench for more details.
New passwords will be created for the ERPNext "Administrator" user, the MariaDB root user, and the frappe user (the script displays the passwords and saves them to ~/frappe_passwords.txt).
---
## License
## Learning and community
GNU/General Public License (see [license.txt](license.txt))
1. [Frappe School](https://frappe.school) - Learn Frappe Framework and ERPNext from the various courses by the maintainers or from the community.
2. [Official documentation](https://docs.erpnext.com/) - Extensive documentation for ERPNext.
3. [Discussion Forum](https://discuss.erpnext.com/) - Engage with community of ERPNext users and service providers.
4. [Telegram Group](https://t.me/erpnexthelp) - Get instant help from huge community of users.
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.
---
## Contributing
@@ -72,49 +74,16 @@ The ERPNext code is licensed as GNU General Public License (v3) and the Document
1. [Report Security Vulnerabilities](https://erpnext.com/security)
1. [Pull Request Requirements](https://github.com/frappe/erpnext/wiki/Contribution-Guidelines)
1. [Translations](https://translate.erpnext.com)
1. [Chart of Accounts](https://charts.erpnext.com)
---
## Learning
## License
1. [Frappe School](https://frappe.school) - Learn Frappe Framework and ERPNext from the various courses by the maintainers or from the community.
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.
## Logo and Trademark
By contributing to ERPNext, you agree that your contributions will be licensed under its GNU General Public License (v3).
The brand name ERPNext and the logo are trademarks of Frappe Technologies Pvt. Ltd.
## Logo and Trademark Policy
### Introduction
Frappe Technologies Pvt. Ltd. (Frappe) owns and oversees the trademarks for the ERPNext name and logos. We have developed this trademark usage policy with the following goals in mind:
- Wed like to make it easy for anyone to use the ERPNext name or logo for community-oriented efforts that help spread and improve ERPNext.
- Wed like to make it clear how ERPNext-related businesses and projects can (and cannot) use the ERPNext name and logo.
- Wed like to make it hard for anyone to use the ERPNext name and logo to unfairly profit from, trick or confuse people who are looking for official ERPNext resources.
### Frappe Trademark Usage Policy
Permission from Frappe is required to use the ERPNext name or logo as part of any project, product, service, domain or company name.
We will grant permission to use the ERPNext name and logo for projects that meet the following criteria:
- The primary purpose of your project is to promote the spread and improvement of the ERPNext software.
- Your project is non-commercial in nature (it can make money to cover its costs or contribute to non-profit entities, but it cannot be run as a for-profit project or business).
Your project neither promotes nor is associated with entities that currently fail to comply with the GPL license under which ERPNext is distributed.
- If your project meets these criteria, you will be permitted to use the ERPNext name and logo to promote your project in any way you see fit with one exception: Please do not use ERPNext as part of a domain name.
Use of the ERPNext name and logo is additionally allowed in the following situations:
All other ERPNext-related businesses or projects can use the ERPNext name and logo to refer to and explain their services, but they cannot use them as part of a product, project, service, domain, or company name and they cannot use them in any way that suggests an affiliation with or endorsement by ERPNext or Frappe Technologies or the ERPNext open source project. For example, a consulting company can describe its business as “123 Web Services, offering ERPNext consulting for small businesses,” but cannot call its business “The ERPNext Consulting Company.”
Similarly, its OK to use the ERPNext logo as part of a page that describes your products or services, but it is not OK to use it as part of your company or product logo or branding itself. Under no circumstances is it permitted to use ERPNext as part of a top-level domain name.
We do not allow the use of the trademark in advertising, including AdSense/AdWords.
Please note that it is not the goal of this policy to limit commercial activity around ERPNext. We encourage ERPNext-based businesses, and we would love to see hundreds of them.
When in doubt about your use of the ERPNext name or logo, please contact Frappe Technologies for clarification.
(inspired by WordPress)
Please read our [Logo and Trademark Policy](TRADEMARK_POLICY.md).

36
TRADEMARK_POLICY.md Normal file
View File

@@ -0,0 +1,36 @@
## Logo and Trademark Policy
The brand name ERPNext and the logo are trademarks of Frappe Technologies Pvt. Ltd.
### Introduction
Frappe Technologies Pvt. Ltd. (Frappe) owns and oversees the trademarks for the ERPNext name and logos. We have developed this trademark usage policy with the following goals in mind:
- Wed like to make it easy for anyone to use the ERPNext name or logo for community-oriented efforts that help spread and improve ERPNext.
- Wed like to make it clear how ERPNext-related businesses and projects can (and cannot) use the ERPNext name and logo.
- Wed like to make it hard for anyone to use the ERPNext name and logo to unfairly profit from, trick or confuse people who are looking for official ERPNext resources.
### Frappe Trademark Usage Policy
Permission from Frappe is required to use the ERPNext name or logo as part of any project, product, service, domain or company name.
We will grant permission to use the ERPNext name and logo for projects that meet the following criteria:
- The primary purpose of your project is to promote the spread and improvement of the ERPNext software.
- Your project is non-commercial in nature (it can make money to cover its costs or contribute to non-profit entities, but it cannot be run as a for-profit project or business).
Your project neither promotes nor is associated with entities that currently fail to comply with the GPL license under which ERPNext is distributed.
- If your project meets these criteria, you will be permitted to use the ERPNext name and logo to promote your project in any way you see fit with one exception: Please do not use ERPNext as part of a domain name.
Use of the ERPNext name and logo is additionally allowed in the following situations:
All other ERPNext-related businesses or projects can use the ERPNext name and logo to refer to and explain their services, but they cannot use them as part of a product, project, service, domain, or company name and they cannot use them in any way that suggests an affiliation with or endorsement by ERPNext or Frappe Technologies or the ERPNext open source project. For example, a consulting company can describe its business as “123 Web Services, offering ERPNext consulting for small businesses,” but cannot call its business “The ERPNext Consulting Company.”
Similarly, its OK to use the ERPNext logo as part of a page that describes your products or services, but it is not OK to use it as part of your company or product logo or branding itself. Under no circumstances is it permitted to use ERPNext as part of a top-level domain name.
We do not allow the use of the trademark in advertising, including AdSense/AdWords.
Please note that it is not the goal of this policy to limit commercial activity around ERPNext. We encourage ERPNext-based businesses, and we would love to see hundreds of them.
When in doubt about your use of the ERPNext name or logo, please contact Frappe Technologies for clarification.
(inspired by WordPress)

View File

@@ -21,7 +21,6 @@ coverage:
comment:
layout: "diff, files"
require_changes: true
after_n_builds: 3
ignore:
- "erpnext/demo"

25
commitlint.config.js Normal file
View File

@@ -0,0 +1,25 @@
module.exports = {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'subject-empty': [2, 'never'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
],
},
};

View File

@@ -1,11 +0,0 @@
{
"baseUrl": "http://test_site:8000/",
"projectId": "da59y9",
"adminPassword": "admin",
"defaultCommandTimeout": 20000,
"pageLoadTimeout": 15000,
"retries": {
"runMode": 2,
"openMode": 2
}
}

View File

@@ -1,5 +0,0 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View File

@@ -1,44 +0,0 @@
describe("Bulk Transaction Processing", () => {
before(() => {
cy.login();
cy.visit("/app/website");
});
it("Creates To Sales Order", () => {
cy.visit("/app/sales-order");
cy.url().should("include", "/sales-order");
cy.window()
.its("frappe.csrf_token")
.then((csrf_token) => {
return cy
.request({
url: "/api/method/erpnext.tests.ui_test_bulk_transaction_processing.create_records",
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
"X-Frappe-CSRF-Token": csrf_token,
},
timeout: 60000,
})
.then((res) => {
expect(res.status).eq(200);
});
});
cy.wait(5000);
cy.get(
".list-row-head > .list-header-subject > .list-row-col > .list-check-all"
).check({ force: true });
cy.wait(3000);
cy.get(".actions-btn-group > .btn-primary").click({ force: true });
cy.wait(3000);
cy.get(".dropdown-menu-right > .user-action > .dropdown-item")
.contains("Sales Invoice")
.click({ force: true });
cy.wait(3000);
cy.get(".modal-content > .modal-footer > .standard-actions")
.contains("Yes")
.click({ force: true });
cy.contains("Creation of Sales Invoice successful");
});
});

View File

@@ -1,13 +0,0 @@
context('Customer', () => {
before(() => {
cy.login();
});
it('Check Customer Group', () => {
cy.visit(`app/customer/`);
cy.get('.primary-action').click();
cy.wait(500);
cy.get('.custom-actions > .btn').click();
cy.get_field('customer_group', 'Link').should('have.value', 'All Customer Groups');
});
});

View File

@@ -1,44 +0,0 @@
describe("Test Item Dashboard", () => {
before(() => {
cy.login();
cy.visit("/app/item");
cy.insert_doc(
"Item",
{
item_code: "e2e_test_item",
item_group: "All Item Groups",
opening_stock: 42,
valuation_rate: 100,
},
true
);
cy.go_to_doc("item", "e2e_test_item");
});
it("should show dashboard with correct data on first load", () => {
cy.get(".stock-levels").contains("Stock Levels").should("be.visible");
cy.get(".stock-levels").contains("e2e_test_item").should("exist");
// reserved and available qty
cy.get(".stock-levels .inline-graph-count")
.eq(0)
.contains("0")
.should("exist");
cy.get(".stock-levels .inline-graph-count")
.eq(1)
.contains("42")
.should("exist");
});
it("should persist on field change", () => {
cy.get('input[data-fieldname="disabled"]').check();
cy.wait(500);
cy.get(".stock-levels").contains("Stock Levels").should("be.visible");
cy.get(".stock-levels").should("have.length", 1);
});
it("should persist on reload", () => {
cy.reload();
cy.get(".stock-levels").contains("Stock Levels").should("be.visible");
});
});

View File

@@ -1,116 +0,0 @@
context('Organizational Chart', () => {
before(() => {
cy.login();
cy.visit('/app/website');
});
it('navigates to org chart', () => {
cy.visit('/app');
cy.visit('/app/organizational-chart');
cy.url().should('include', '/organizational-chart');
cy.window().its('frappe.csrf_token').then(csrf_token => {
return cy.request({
url: `/api/method/erpnext.tests.ui_test_helpers.create_employee_records`,
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-Frappe-CSRF-Token': csrf_token
},
timeout: 60000
}).then(res => {
expect(res.status).eq(200);
cy.get('.frappe-control[data-fieldname=company] input').focus().as('input');
cy.get('@input')
.clear({ force: true })
.type('Test Org Chart{downarrow}{enter}', { force: true })
.blur({ force: true });
});
});
});
it('renders root nodes and loads children for the first expandable node', () => {
// check rendered root nodes and the node name, title, connections
cy.get('.hierarchy').find('.root-level ul.node-children').children()
.should('have.length', 2)
.first()
.as('first-child');
cy.get('@first-child').get('.node-name').contains('Test Employee 1');
cy.get('@first-child').get('.node-info').find('.node-title').contains('CEO');
cy.get('@first-child').get('.node-info').find('.node-connections').contains('· 2 Connections');
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
// children of 1st root visible
cy.get(`div[data-parent="${employee_records.message[0]}"]`).as('child-node');
cy.get('@child-node')
.should('have.length', 1)
.should('be.visible');
cy.get('@child-node').get('.node-name').contains('Test Employee 3');
// connectors between first root node and immediate child
cy.get(`path[data-parent="${employee_records.message[0]}"]`)
.should('be.visible')
.invoke('attr', 'data-child')
.should('equal', employee_records.message[2]);
});
});
it('hides active nodes children and connectors on expanding sibling node', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
// click sibling
cy.get(`#${employee_records.message[1]}`)
.click()
.should('have.class', 'active');
// child nodes and connectors hidden
cy.get(`[data-parent="${employee_records.message[0]}"]`).should('not.be.visible');
cy.get(`path[data-parent="${employee_records.message[0]}"]`).should('not.be.visible');
});
});
it('collapses previous level nodes and refreshes connectors on expanding child node', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
// click child node
cy.get(`#${employee_records.message[3]}`)
.click()
.should('have.class', 'active');
// previous level nodes: parent should be on active-path; other nodes should be collapsed
cy.get(`#${employee_records.message[0]}`).should('have.class', 'collapsed');
cy.get(`#${employee_records.message[1]}`).should('have.class', 'active-path');
// previous level connectors refreshed
cy.get(`path[data-parent="${employee_records.message[1]}"]`)
.should('have.class', 'collapsed-connector');
// child node's children and connectors rendered
cy.get(`[data-parent="${employee_records.message[3]}"]`).should('be.visible');
cy.get(`path[data-parent="${employee_records.message[3]}"]`).should('be.visible');
});
});
it('expands previous level nodes', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
cy.get(`#${employee_records.message[0]}`)
.click()
.should('have.class', 'active');
cy.get(`[data-parent="${employee_records.message[0]}"]`)
.should('be.visible');
cy.get('ul.hierarchy').children().should('have.length', 2);
cy.get(`#connectors`).children().should('have.length', 1);
});
});
it('edit node navigates to employee master', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
cy.get(`#${employee_records.message[0]}`).find('.btn-edit-node')
.click();
cy.url().should('include', `/employee/${employee_records.message[0]}`);
});
});
});

View File

@@ -1,195 +0,0 @@
context('Organizational Chart Mobile', () => {
before(() => {
cy.login();
cy.visit('/app/website');
});
it('navigates to org chart', () => {
cy.viewport(375, 667);
cy.visit('/app');
cy.visit('/app/organizational-chart');
cy.url().should('include', '/organizational-chart');
cy.window().its('frappe.csrf_token').then(csrf_token => {
return cy.request({
url: `/api/method/erpnext.tests.ui_test_helpers.create_employee_records`,
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-Frappe-CSRF-Token': csrf_token
},
timeout: 60000
}).then(res => {
expect(res.status).eq(200);
cy.get('.frappe-control[data-fieldname=company] input').focus().as('input');
cy.get('@input')
.clear({ force: true })
.type('Test Org Chart{downarrow}{enter}', { force: true })
.blur({ force: true });
});
});
});
it('renders root nodes', () => {
// check rendered root nodes and the node name, title, connections
cy.get('.hierarchy-mobile').find('.root-level').children()
.should('have.length', 2)
.first()
.as('first-child');
cy.get('@first-child').get('.node-name').contains('Test Employee 1');
cy.get('@first-child').get('.node-info').find('.node-title').contains('CEO');
cy.get('@first-child').get('.node-info').find('.node-connections').contains('· 2');
});
it('expands root node', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
cy.get(`#${employee_records.message[1]}`)
.click()
.should('have.class', 'active');
// other root node removed
cy.get(`#${employee_records.message[0]}`).should('not.exist');
// children of active root node
cy.get('.hierarchy-mobile').find('.level').first().find('ul.node-children').children()
.should('have.length', 2);
cy.get(`div[data-parent="${employee_records.message[1]}"]`).first().as('child-node');
cy.get('@child-node').should('be.visible');
cy.get('@child-node')
.get('.node-name')
.contains('Test Employee 4');
// connectors between root node and immediate children
cy.get(`path[data-parent="${employee_records.message[1]}"]`).as('connectors');
cy.get('@connectors')
.should('have.length', 2)
.should('be.visible');
cy.get('@connectors')
.first()
.invoke('attr', 'data-child')
.should('eq', employee_records.message[3]);
});
});
it('expands child node', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
cy.get(`#${employee_records.message[3]}`)
.click()
.should('have.class', 'active')
.as('expanded_node');
// 2 levels on screen; 1 on active path; 1 collapsed
cy.get('.hierarchy-mobile').children().should('have.length', 2);
cy.get(`#${employee_records.message[1]}`).should('have.class', 'active-path');
// children of expanded node visible
cy.get('@expanded_node')
.next()
.should('have.class', 'node-children')
.as('node-children');
cy.get('@node-children').children().should('have.length', 1);
cy.get('@node-children')
.first()
.get('.node-card')
.should('have.class', 'active-child')
.contains('Test Employee 7');
// orphan connectors removed
cy.get(`#connectors`).children().should('have.length', 2);
});
});
it('renders sibling group', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
// sibling group visible for parent
cy.get(`#${employee_records.message[1]}`)
.next()
.as('sibling_group');
cy.get('@sibling_group')
.should('have.attr', 'data-parent', 'undefined')
.should('have.class', 'node-group')
.and('have.class', 'collapsed');
cy.get('@sibling_group').get('.avatar-group').children().as('siblings');
cy.get('@siblings').should('have.length', 1);
cy.get('@siblings')
.first()
.should('have.attr', 'title', 'Test Employee 1');
});
});
it('expands previous level nodes', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
cy.get(`#${employee_records.message[6]}`)
.click()
.should('have.class', 'active');
// clicking on previous level node should remove all the nodes ahead
// and expand that node
cy.get(`#${employee_records.message[3]}`).click();
cy.get(`#${employee_records.message[3]}`)
.should('have.class', 'active')
.should('not.have.class', 'active-path');
cy.get(`#${employee_records.message[6]}`).should('have.class', 'active-child');
cy.get('.hierarchy-mobile').children().should('have.length', 2);
cy.get(`#connectors`).children().should('have.length', 2);
});
});
it('expands sibling group', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
// sibling group visible for parent
cy.get(`#${employee_records.message[6]}`).click();
cy.get(`#${employee_records.message[3]}`)
.next()
.click();
// siblings of parent should be visible
cy.get('.hierarchy-mobile').prev().as('sibling_group');
cy.get('@sibling_group')
.should('exist')
.should('have.class', 'sibling-group')
.should('not.have.class', 'collapsed');
cy.get(`#${employee_records.message[1]}`)
.should('be.visible')
.should('have.class', 'active');
cy.get(`[data-parent="${employee_records.message[1]}"]`)
.should('be.visible')
.should('have.length', 2)
.should('have.class', 'active-child');
});
});
it('goes to the respective level after clicking on non-collapsed sibling group', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(() => {
// click on non-collapsed sibling group
cy.get('.hierarchy-mobile')
.prev()
.click();
// should take you to that level
cy.get('.hierarchy-mobile').find('li.level .node-card').should('have.length', 2);
});
});
it('edit node navigates to employee master', () => {
cy.call('erpnext.tests.ui_test_helpers.get_employee_records').then(employee_records => {
cy.get(`#${employee_records.message[0]}`).find('.btn-edit-node')
.click();
cy.url().should('include', `/employee/${employee_records.message[0]}`);
});
});
});

View File

@@ -1,17 +0,0 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
module.exports = () => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};

View File

@@ -1,31 +0,0 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... });
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... });
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... });
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... });
const slug = (name) => name.toLowerCase().replace(" ", "-");
Cypress.Commands.add("go_to_doc", (doctype, name) => {
cy.visit(`/app/${slug(doctype)}/${encodeURIComponent(name)}`);
});

View File

@@ -1,26 +0,0 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands';
import '../../../frappe/cypress/support/commands' // eslint-disable-line
// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress.Cookies.defaults({
preserve: 'sid'
});

View File

@@ -1,12 +0,0 @@
{
"compilerOptions": {
"allowJs": true,
"baseUrl": "../node_modules",
"types": [
"cypress"
]
},
"include": [
"**/*.*"
]
}

View File

@@ -1 +0,0 @@
hypothesis~=6.31.0

View File

@@ -2,49 +2,57 @@ import inspect
import frappe
__version__ = '14.0.0-dev'
__version__ = "14.9.0"
def get_default_company(user=None):
'''Get default company for user'''
"""Get default company for user"""
from frappe.defaults import get_user_default_as_list
if not user:
user = frappe.session.user
companies = get_user_default_as_list(user, 'company')
companies = get_user_default_as_list(user, "company")
if companies:
default_company = companies[0]
else:
default_company = frappe.db.get_single_value('Global Defaults', 'default_company')
default_company = frappe.db.get_single_value("Global Defaults", "default_company")
return default_company
def get_default_currency():
'''Returns the currency of the default company'''
"""Returns the currency of the default company"""
company = get_default_company()
if company:
return frappe.get_cached_value('Company', company, 'default_currency')
return frappe.get_cached_value("Company", company, "default_currency")
def get_default_cost_center(company):
'''Returns the default cost center of the company'''
"""Returns the default cost center of the company"""
if not company:
return None
if not frappe.flags.company_cost_center:
frappe.flags.company_cost_center = {}
if not company in frappe.flags.company_cost_center:
frappe.flags.company_cost_center[company] = frappe.get_cached_value('Company', company, 'cost_center')
frappe.flags.company_cost_center[company] = frappe.get_cached_value(
"Company", company, "cost_center"
)
return frappe.flags.company_cost_center[company]
def get_company_currency(company):
'''Returns the default company currency'''
"""Returns the default company currency"""
if not frappe.flags.company_currency:
frappe.flags.company_currency = {}
if not company in frappe.flags.company_currency:
frappe.flags.company_currency[company] = frappe.db.get_value('Company', company, 'default_currency', cache=True)
frappe.flags.company_currency[company] = frappe.db.get_value(
"Company", company, "default_currency", cache=True
)
return frappe.flags.company_currency[company]
def set_perpetual_inventory(enable=1, company=None):
if not company:
company = "_Test Company" if frappe.flags.in_test else get_default_company()
@@ -53,9 +61,10 @@ def set_perpetual_inventory(enable=1, company=None):
company.enable_perpetual_inventory = enable
company.save()
def encode_company_abbr(name, company=None, abbr=None):
'''Returns name encoded with company abbreviation'''
company_abbr = abbr or frappe.get_cached_value('Company', company, "abbr")
"""Returns name encoded with company abbreviation"""
company_abbr = abbr or frappe.get_cached_value("Company", company, "abbr")
parts = name.rsplit(" - ", 1)
if parts[-1].lower() != company_abbr.lower():
@@ -63,62 +72,69 @@ def encode_company_abbr(name, company=None, abbr=None):
return " - ".join(parts)
def is_perpetual_inventory_enabled(company):
if not company:
company = "_Test Company" if frappe.flags.in_test else get_default_company()
if not hasattr(frappe.local, 'enable_perpetual_inventory'):
if not hasattr(frappe.local, "enable_perpetual_inventory"):
frappe.local.enable_perpetual_inventory = {}
if not company in frappe.local.enable_perpetual_inventory:
frappe.local.enable_perpetual_inventory[company] = frappe.get_cached_value('Company',
company, "enable_perpetual_inventory") or 0
frappe.local.enable_perpetual_inventory[company] = (
frappe.get_cached_value("Company", company, "enable_perpetual_inventory") or 0
)
return frappe.local.enable_perpetual_inventory[company]
def get_default_finance_book(company=None):
if not company:
company = get_default_company()
if not hasattr(frappe.local, 'default_finance_book'):
if not hasattr(frappe.local, "default_finance_book"):
frappe.local.default_finance_book = {}
if not company in frappe.local.default_finance_book:
frappe.local.default_finance_book[company] = frappe.get_cached_value('Company',
company, "default_finance_book")
frappe.local.default_finance_book[company] = frappe.get_cached_value(
"Company", company, "default_finance_book"
)
return frappe.local.default_finance_book[company]
def get_party_account_type(party_type):
if not hasattr(frappe.local, 'party_account_types'):
if not hasattr(frappe.local, "party_account_types"):
frappe.local.party_account_types = {}
if not party_type in frappe.local.party_account_types:
frappe.local.party_account_types[party_type] = frappe.db.get_value("Party Type",
party_type, "account_type") or ''
frappe.local.party_account_types[party_type] = (
frappe.db.get_value("Party Type", party_type, "account_type") or ""
)
return frappe.local.party_account_types[party_type]
def get_region(company=None):
'''Return the default country based on flag, company or global settings
"""Return the default country based on flag, company or global settings
You can also set global company flag in `frappe.flags.company`
'''
"""
if company or frappe.flags.company:
return frappe.get_cached_value('Company',
company or frappe.flags.company, 'country')
return frappe.get_cached_value("Company", company or frappe.flags.company, "country")
elif frappe.flags.country:
return frappe.flags.country
else:
return frappe.get_system_settings('country')
return frappe.get_system_settings("country")
def allow_regional(fn):
'''Decorator to make a function regionally overridable
"""Decorator to make a function regionally overridable
Example:
@erpnext.allow_regional
def myfunction():
pass'''
pass"""
def caller(*args, **kwargs):
overrides = frappe.get_hooks("regional_overrides", {}).get(get_region())

View File

@@ -10,4 +10,42 @@ Entries are:
- Sales Invoice (Itemised)
- Purchase Invoice (Itemised)
All accounting entries are stored in the `General Ledger`
All accounting entries are stored in the `General Ledger`
## Payment Ledger
Transactions on Receivable and Payable Account types will also be stored in `Payment Ledger`. This is so that payment reconciliation process only requires update on this ledger.
### Key Fields
| Field | Description |
|----------------------|----------------------------------|
| `account_type` | Receivable/Payable |
| `account` | Accounting head |
| `party` | Party Name |
| `voucher_no` | Voucher No |
| `against_voucher_no` | Linked voucher(secondary effect) |
| `amount` | can be +ve/-ve |
### Design
`debit` and `credit` have been replaced with `account_type` and `amount`. `against_voucher_no` is populated for all entries. So, outstanding amount can be calculated by summing up amount only using `against_voucher_no`.
Ex:
1. Consider an invoice for ₹100 and a partial payment of ₹80 against that invoice. Payment Ledger will have following entries.
| voucher_no | against_voucher_no | amount |
|------------|--------------------|--------|
| SINV-01 | SINV-01 | 100 |
| PAY-01 | SINV-01 | -80 |
2. Reconcile a Credit Note against an invoice using a Journal Entry
An invoice for ₹100 partially reconciled against a credit of ₹70 using a Journal Entry. Payment Ledger will have the following entries.
| voucher_no | against_voucher_no | amount |
|------------|--------------------|--------|
| SINV-01 | SINV-01 | 100 |
| | | |
| CR-NOTE-01 | CR-NOTE-01 | -70 |
| | | |
| JE-01 | CR-NOTE-01 | +70 |
| JE-01 | SINV-01 | -70 |

View File

@@ -21,37 +21,39 @@ class ERPNextAddress(Address):
return super(ERPNextAddress, self).link_address()
def update_compnay_address(self):
for link in self.get('links'):
if link.link_doctype == 'Company':
for link in self.get("links"):
if link.link_doctype == "Company":
self.is_your_company_address = 1
def validate_reference(self):
if self.is_your_company_address and not [
row for row in self.links if row.link_doctype == "Company"
]:
frappe.throw(_("Address needs to be linked to a Company. Please add a row for Company in the Links table."),
title=_("Company Not Linked"))
frappe.throw(
_("Address needs to be linked to a Company. Please add a row for Company in the Links table."),
title=_("Company Not Linked"),
)
def on_update(self):
"""
After Address is updated, update the related 'Primary Address' on Customer.
"""
address_display = get_address_display(self.as_dict())
filters = { "customer_primary_address": self.name }
filters = {"customer_primary_address": self.name}
customers = frappe.db.get_all("Customer", filters=filters, as_list=True)
for customer_name in customers:
frappe.db.set_value("Customer", customer_name[0], "primary_address", address_display)
@frappe.whitelist()
def get_shipping_address(company, address = None):
def get_shipping_address(company, address=None):
filters = [
["Dynamic Link", "link_doctype", "=", "Company"],
["Dynamic Link", "link_name", "=", company],
["Address", "is_your_company_address", "=", 1]
["Address", "is_your_company_address", "=", 1],
]
fields = ["*"]
if address and frappe.db.get_value('Dynamic Link',
{'parent': address, 'link_name': company}):
if address and frappe.db.get_value("Dynamic Link", {"parent": address, "link_name": company}):
filters.append(["Address", "name", "=", address])
if not address:
filters.append(["Address", "is_shipping_address", "=", 1])

View File

@@ -12,15 +12,24 @@ from frappe.utils.nestedset import get_descendants_of
@frappe.whitelist()
@cache_source
def get(chart_name = None, chart = None, no_cache = None, filters = None, from_date = None,
to_date = None, timespan = None, time_interval = None, heatmap_year = None):
def get(
chart_name=None,
chart=None,
no_cache=None,
filters=None,
from_date=None,
to_date=None,
timespan=None,
time_interval=None,
heatmap_year=None,
):
if chart_name:
chart = frappe.get_doc('Dashboard Chart', chart_name)
chart = frappe.get_doc("Dashboard Chart", chart_name)
else:
chart = frappe._dict(frappe.parse_json(chart))
timespan = chart.timespan
if chart.timespan == 'Select Date Range':
if chart.timespan == "Select Date Range":
from_date = chart.from_date
to_date = chart.to_date
@@ -31,17 +40,23 @@ def get(chart_name = None, chart = None, no_cache = None, filters = None, from_d
company = filters.get("company")
if not account and chart_name:
frappe.throw(_("Account is not set for the dashboard chart {0}")
.format(get_link_to_form("Dashboard Chart", chart_name)))
frappe.throw(
_("Account is not set for the dashboard chart {0}").format(
get_link_to_form("Dashboard Chart", chart_name)
)
)
if not frappe.db.exists("Account", account) and chart_name:
frappe.throw(_("Account {0} does not exists in the dashboard chart {1}")
.format(account, get_link_to_form("Dashboard Chart", chart_name)))
frappe.throw(
_("Account {0} does not exists in the dashboard chart {1}").format(
account, get_link_to_form("Dashboard Chart", chart_name)
)
)
if not to_date:
to_date = nowdate()
if not from_date:
if timegrain in ('Monthly', 'Quarterly'):
if timegrain in ("Monthly", "Quarterly"):
from_date = get_from_date_from_timespan(to_date, timespan)
# fetch dates to plot
@@ -54,16 +69,14 @@ def get(chart_name = None, chart = None, no_cache = None, filters = None, from_d
result = build_result(account, dates, gl_entries)
return {
"labels": [formatdate(r[0].strftime('%Y-%m-%d')) for r in result],
"datasets": [{
"name": account,
"values": [r[1] for r in result]
}]
"labels": [formatdate(r[0].strftime("%Y-%m-%d")) for r in result],
"datasets": [{"name": account, "values": [r[1] for r in result]}],
}
def build_result(account, dates, gl_entries):
result = [[getdate(date), 0.0] for date in dates]
root_type = frappe.db.get_value('Account', account, 'root_type')
root_type = frappe.db.get_value("Account", account, "root_type")
# start with the first date
date_index = 0
@@ -78,30 +91,34 @@ def build_result(account, dates, gl_entries):
result[date_index][1] += entry.debit - entry.credit
# if account type is credit, switch balances
if root_type not in ('Asset', 'Expense'):
if root_type not in ("Asset", "Expense"):
for r in result:
r[1] = -1 * r[1]
# for balance sheet accounts, the totals are cumulative
if root_type in ('Asset', 'Liability', 'Equity'):
if root_type in ("Asset", "Liability", "Equity"):
for i, r in enumerate(result):
if i > 0:
r[1] = r[1] + result[i-1][1]
r[1] = r[1] + result[i - 1][1]
return result
def get_gl_entries(account, to_date):
child_accounts = get_descendants_of('Account', account, ignore_permissions=True)
child_accounts = get_descendants_of("Account", account, ignore_permissions=True)
child_accounts.append(account)
return frappe.db.get_all('GL Entry',
fields = ['posting_date', 'debit', 'credit'],
filters = [
dict(posting_date = ('<', to_date)),
dict(account = ('in', child_accounts)),
dict(voucher_type = ('!=', 'Period Closing Voucher'))
return frappe.db.get_all(
"GL Entry",
fields=["posting_date", "debit", "credit"],
filters=[
dict(posting_date=("<", to_date)),
dict(account=("in", child_accounts)),
dict(voucher_type=("!=", "Period Closing Voucher")),
],
order_by = 'posting_date asc')
order_by="posting_date asc",
)
def get_dates_from_timegrain(from_date, to_date, timegrain):
days = months = years = 0
@@ -116,6 +133,8 @@ def get_dates_from_timegrain(from_date, to_date, timegrain):
dates = [get_period_ending(from_date, timegrain)]
while getdate(dates[-1]) < getdate(to_date):
date = get_period_ending(add_to_date(dates[-1], years=years, months=months, days=days), timegrain)
date = get_period_ending(
add_to_date(dates[-1], years=years, months=months, days=days), timegrain
)
dates.append(date)
return dates

View File

@@ -22,20 +22,23 @@ from erpnext.accounts.utils import get_account_currency
def validate_service_stop_date(doc):
''' Validates service_stop_date for Purchase Invoice and Sales Invoice '''
"""Validates service_stop_date for Purchase Invoice and Sales Invoice"""
enable_check = "enable_deferred_revenue" \
if doc.doctype=="Sales Invoice" else "enable_deferred_expense"
enable_check = (
"enable_deferred_revenue" if doc.doctype == "Sales Invoice" else "enable_deferred_expense"
)
old_stop_dates = {}
old_doc = frappe.db.get_all("{0} Item".format(doc.doctype),
{"parent": doc.name}, ["name", "service_stop_date"])
old_doc = frappe.db.get_all(
"{0} Item".format(doc.doctype), {"parent": doc.name}, ["name", "service_stop_date"]
)
for d in old_doc:
old_stop_dates[d.name] = d.service_stop_date or ""
for item in doc.items:
if not item.get(enable_check): continue
if not item.get(enable_check):
continue
if item.service_stop_date:
if date_diff(item.service_stop_date, item.service_start_date) < 0:
@@ -44,21 +47,31 @@ def validate_service_stop_date(doc):
if date_diff(item.service_stop_date, item.service_end_date) > 0:
frappe.throw(_("Service Stop Date cannot be after Service End Date"))
if old_stop_dates and old_stop_dates.get(item.name) and item.service_stop_date!=old_stop_dates.get(item.name):
if (
old_stop_dates
and old_stop_dates.get(item.name)
and item.service_stop_date != old_stop_dates.get(item.name)
):
frappe.throw(_("Cannot change Service Stop Date for item in row {0}").format(item.idx))
def build_conditions(process_type, account, company):
conditions=''
deferred_account = "item.deferred_revenue_account" if process_type=="Income" else "item.deferred_expense_account"
conditions = ""
deferred_account = (
"item.deferred_revenue_account" if process_type == "Income" else "item.deferred_expense_account"
)
if account:
conditions += "AND %s='%s'"%(deferred_account, account)
conditions += "AND %s='%s'" % (deferred_account, account)
elif company:
conditions += f"AND p.company = {frappe.db.escape(company)}"
return conditions
def convert_deferred_expense_to_expense(deferred_process, start_date=None, end_date=None, conditions=''):
def convert_deferred_expense_to_expense(
deferred_process, start_date=None, end_date=None, conditions=""
):
# book the expense/income on the last day, but it will be trigger on the 1st of month at 12:00 AM
if not start_date:
@@ -67,14 +80,19 @@ def convert_deferred_expense_to_expense(deferred_process, start_date=None, end_d
end_date = add_days(today(), -1)
# check for the purchase invoice for which GL entries has to be done
invoices = frappe.db.sql_list('''
invoices = frappe.db.sql_list(
"""
select distinct item.parent
from `tabPurchase Invoice Item` item, `tabPurchase Invoice` p
where item.service_start_date<=%s and item.service_end_date>=%s
and item.enable_deferred_expense = 1 and item.parent=p.name
and item.docstatus = 1 and ifnull(item.amount, 0) > 0
{0}
'''.format(conditions), (end_date, start_date)) #nosec
""".format(
conditions
),
(end_date, start_date),
) # nosec
# For each invoice, book deferred expense
for invoice in invoices:
@@ -84,7 +102,10 @@ def convert_deferred_expense_to_expense(deferred_process, start_date=None, end_d
if frappe.flags.deferred_accounting_error:
send_mail(deferred_process)
def convert_deferred_revenue_to_income(deferred_process, start_date=None, end_date=None, conditions=''):
def convert_deferred_revenue_to_income(
deferred_process, start_date=None, end_date=None, conditions=""
):
# book the expense/income on the last day, but it will be trigger on the 1st of month at 12:00 AM
if not start_date:
@@ -93,14 +114,19 @@ def convert_deferred_revenue_to_income(deferred_process, start_date=None, end_da
end_date = add_days(today(), -1)
# check for the sales invoice for which GL entries has to be done
invoices = frappe.db.sql_list('''
invoices = frappe.db.sql_list(
"""
select distinct item.parent
from `tabSales Invoice Item` item, `tabSales Invoice` p
where item.service_start_date<=%s and item.service_end_date>=%s
and item.enable_deferred_revenue = 1 and item.parent=p.name
and item.docstatus = 1 and ifnull(item.amount, 0) > 0
{0}
'''.format(conditions), (end_date, start_date)) #nosec
""".format(
conditions
),
(end_date, start_date),
) # nosec
for invoice in invoices:
doc = frappe.get_doc("Sales Invoice", invoice)
@@ -109,30 +135,43 @@ def convert_deferred_revenue_to_income(deferred_process, start_date=None, end_da
if frappe.flags.deferred_accounting_error:
send_mail(deferred_process)
def get_booking_dates(doc, item, posting_date=None):
if not posting_date:
posting_date = add_days(today(), -1)
last_gl_entry = False
deferred_account = "deferred_revenue_account" if doc.doctype=="Sales Invoice" else "deferred_expense_account"
deferred_account = (
"deferred_revenue_account" if doc.doctype == "Sales Invoice" else "deferred_expense_account"
)
prev_gl_entry = frappe.db.sql('''
prev_gl_entry = frappe.db.sql(
"""
select name, posting_date from `tabGL Entry` where company=%s and account=%s and
voucher_type=%s and voucher_no=%s and voucher_detail_no=%s
and is_cancelled = 0
order by posting_date desc limit 1
''', (doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name), as_dict=True)
""",
(doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name),
as_dict=True,
)
prev_gl_via_je = frappe.db.sql('''
prev_gl_via_je = frappe.db.sql(
"""
SELECT p.name, p.posting_date FROM `tabJournal Entry` p, `tabJournal Entry Account` c
WHERE p.name = c.parent and p.company=%s and c.account=%s
and c.reference_type=%s and c.reference_name=%s
and c.reference_detail_no=%s and c.docstatus < 2 order by posting_date desc limit 1
''', (doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name), as_dict=True)
""",
(doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name),
as_dict=True,
)
if prev_gl_via_je:
if (not prev_gl_entry) or (prev_gl_entry and
prev_gl_entry[0].posting_date < prev_gl_via_je[0].posting_date):
if (not prev_gl_entry) or (
prev_gl_entry and prev_gl_entry[0].posting_date < prev_gl_via_je[0].posting_date
):
prev_gl_entry = prev_gl_via_je
if prev_gl_entry:
@@ -156,66 +195,94 @@ def get_booking_dates(doc, item, posting_date=None):
else:
return None, None, None
def calculate_monthly_amount(doc, item, last_gl_entry, start_date, end_date, total_days, total_booking_days, account_currency):
def calculate_monthly_amount(
doc, item, last_gl_entry, start_date, end_date, total_days, total_booking_days, account_currency
):
amount, base_amount = 0, 0
if not last_gl_entry:
total_months = (item.service_end_date.year - item.service_start_date.year) * 12 + \
(item.service_end_date.month - item.service_start_date.month) + 1
total_months = (
(item.service_end_date.year - item.service_start_date.year) * 12
+ (item.service_end_date.month - item.service_start_date.month)
+ 1
)
prorate_factor = flt(date_diff(item.service_end_date, item.service_start_date)) \
/ flt(date_diff(get_last_day(item.service_end_date), get_first_day(item.service_start_date)))
prorate_factor = flt(date_diff(item.service_end_date, item.service_start_date)) / flt(
date_diff(get_last_day(item.service_end_date), get_first_day(item.service_start_date))
)
actual_months = rounded(total_months * prorate_factor, 1)
already_booked_amount, already_booked_amount_in_account_currency = get_already_booked_amount(doc, item)
already_booked_amount, already_booked_amount_in_account_currency = get_already_booked_amount(
doc, item
)
base_amount = flt(item.base_net_amount / actual_months, item.precision("base_net_amount"))
if base_amount + already_booked_amount > item.base_net_amount:
base_amount = item.base_net_amount - already_booked_amount
if account_currency==doc.company_currency:
if account_currency == doc.company_currency:
amount = base_amount
else:
amount = flt(item.net_amount/actual_months, item.precision("net_amount"))
amount = flt(item.net_amount / actual_months, item.precision("net_amount"))
if amount + already_booked_amount_in_account_currency > item.net_amount:
amount = item.net_amount - already_booked_amount_in_account_currency
if not (get_first_day(start_date) == start_date and get_last_day(end_date) == end_date):
partial_month = flt(date_diff(end_date, start_date)) \
/ flt(date_diff(get_last_day(end_date), get_first_day(start_date)))
partial_month = flt(date_diff(end_date, start_date)) / flt(
date_diff(get_last_day(end_date), get_first_day(start_date))
)
base_amount = rounded(partial_month, 1) * base_amount
amount = rounded(partial_month, 1) * amount
else:
already_booked_amount, already_booked_amount_in_account_currency = get_already_booked_amount(doc, item)
base_amount = flt(item.base_net_amount - already_booked_amount, item.precision("base_net_amount"))
if account_currency==doc.company_currency:
already_booked_amount, already_booked_amount_in_account_currency = get_already_booked_amount(
doc, item
)
base_amount = flt(
item.base_net_amount - already_booked_amount, item.precision("base_net_amount")
)
if account_currency == doc.company_currency:
amount = base_amount
else:
amount = flt(item.net_amount - already_booked_amount_in_account_currency, item.precision("net_amount"))
amount = flt(
item.net_amount - already_booked_amount_in_account_currency, item.precision("net_amount")
)
return amount, base_amount
def calculate_amount(doc, item, last_gl_entry, total_days, total_booking_days, account_currency):
amount, base_amount = 0, 0
if not last_gl_entry:
base_amount = flt(item.base_net_amount*total_booking_days/flt(total_days), item.precision("base_net_amount"))
if account_currency==doc.company_currency:
base_amount = flt(
item.base_net_amount * total_booking_days / flt(total_days), item.precision("base_net_amount")
)
if account_currency == doc.company_currency:
amount = base_amount
else:
amount = flt(item.net_amount*total_booking_days/flt(total_days), item.precision("net_amount"))
amount = flt(
item.net_amount * total_booking_days / flt(total_days), item.precision("net_amount")
)
else:
already_booked_amount, already_booked_amount_in_account_currency = get_already_booked_amount(doc, item)
already_booked_amount, already_booked_amount_in_account_currency = get_already_booked_amount(
doc, item
)
base_amount = flt(item.base_net_amount - already_booked_amount, item.precision("base_net_amount"))
if account_currency==doc.company_currency:
base_amount = flt(
item.base_net_amount - already_booked_amount, item.precision("base_net_amount")
)
if account_currency == doc.company_currency:
amount = base_amount
else:
amount = flt(item.net_amount - already_booked_amount_in_account_currency, item.precision("net_amount"))
amount = flt(
item.net_amount - already_booked_amount_in_account_currency, item.precision("net_amount")
)
return amount, base_amount
def get_already_booked_amount(doc, item):
if doc.doctype == "Sales Invoice":
total_credit_debit, total_credit_debit_currency = "debit", "debit_in_account_currency"
@@ -224,20 +291,31 @@ def get_already_booked_amount(doc, item):
total_credit_debit, total_credit_debit_currency = "credit", "credit_in_account_currency"
deferred_account = "deferred_expense_account"
gl_entries_details = frappe.db.sql('''
gl_entries_details = frappe.db.sql(
"""
select sum({0}) as total_credit, sum({1}) as total_credit_in_account_currency, voucher_detail_no
from `tabGL Entry` where company=%s and account=%s and voucher_type=%s and voucher_no=%s and voucher_detail_no=%s
and is_cancelled = 0
group by voucher_detail_no
'''.format(total_credit_debit, total_credit_debit_currency),
(doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name), as_dict=True)
""".format(
total_credit_debit, total_credit_debit_currency
),
(doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name),
as_dict=True,
)
journal_entry_details = frappe.db.sql('''
journal_entry_details = frappe.db.sql(
"""
SELECT sum(c.{0}) as total_credit, sum(c.{1}) as total_credit_in_account_currency, reference_detail_no
FROM `tabJournal Entry` p , `tabJournal Entry Account` c WHERE p.name = c.parent and
p.company = %s and c.account=%s and c.reference_type=%s and c.reference_name=%s and c.reference_detail_no=%s
and p.docstatus < 2 group by reference_detail_no
'''.format(total_credit_debit, total_credit_debit_currency),
(doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name), as_dict=True)
""".format(
total_credit_debit, total_credit_debit_currency
),
(doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name),
as_dict=True,
)
already_booked_amount = gl_entries_details[0].total_credit if gl_entries_details else 0
already_booked_amount += journal_entry_details[0].total_credit if journal_entry_details else 0
@@ -245,20 +323,29 @@ def get_already_booked_amount(doc, item):
if doc.currency == doc.company_currency:
already_booked_amount_in_account_currency = already_booked_amount
else:
already_booked_amount_in_account_currency = gl_entries_details[0].total_credit_in_account_currency if gl_entries_details else 0
already_booked_amount_in_account_currency += journal_entry_details[0].total_credit_in_account_currency if journal_entry_details else 0
already_booked_amount_in_account_currency = (
gl_entries_details[0].total_credit_in_account_currency if gl_entries_details else 0
)
already_booked_amount_in_account_currency += (
journal_entry_details[0].total_credit_in_account_currency if journal_entry_details else 0
)
return already_booked_amount, already_booked_amount_in_account_currency
def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
enable_check = "enable_deferred_revenue" \
if doc.doctype=="Sales Invoice" else "enable_deferred_expense"
enable_check = (
"enable_deferred_revenue" if doc.doctype == "Sales Invoice" else "enable_deferred_expense"
)
accounts_frozen_upto = frappe.get_cached_value('Accounts Settings', 'None', 'acc_frozen_upto')
accounts_frozen_upto = frappe.get_cached_value("Accounts Settings", "None", "acc_frozen_upto")
def _book_deferred_revenue_or_expense(item, via_journal_entry, submit_journal_entry, book_deferred_entries_based_on):
def _book_deferred_revenue_or_expense(
item, via_journal_entry, submit_journal_entry, book_deferred_entries_based_on
):
start_date, end_date, last_gl_entry = get_booking_dates(doc, item, posting_date=posting_date)
if not (start_date and end_date): return
if not (start_date and end_date):
return
account_currency = get_account_currency(item.expense_account or item.income_account)
if doc.doctype == "Sales Invoice":
@@ -271,107 +358,179 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
total_days = date_diff(item.service_end_date, item.service_start_date) + 1
total_booking_days = date_diff(end_date, start_date) + 1
if book_deferred_entries_based_on == 'Months':
amount, base_amount = calculate_monthly_amount(doc, item, last_gl_entry,
start_date, end_date, total_days, total_booking_days, account_currency)
if book_deferred_entries_based_on == "Months":
amount, base_amount = calculate_monthly_amount(
doc,
item,
last_gl_entry,
start_date,
end_date,
total_days,
total_booking_days,
account_currency,
)
else:
amount, base_amount = calculate_amount(doc, item, last_gl_entry,
total_days, total_booking_days, account_currency)
amount, base_amount = calculate_amount(
doc, item, last_gl_entry, total_days, total_booking_days, account_currency
)
if not amount:
return
# check if books nor frozen till endate:
if getdate(end_date) >= getdate(accounts_frozen_upto):
if accounts_frozen_upto and (end_date) <= getdate(accounts_frozen_upto):
end_date = get_last_day(add_days(accounts_frozen_upto, 1))
if via_journal_entry:
book_revenue_via_journal_entry(doc, credit_account, debit_account, against, amount,
base_amount, end_date, project, account_currency, item.cost_center, item, deferred_process, submit_journal_entry)
book_revenue_via_journal_entry(
doc,
credit_account,
debit_account,
amount,
base_amount,
end_date,
project,
account_currency,
item.cost_center,
item,
deferred_process,
submit_journal_entry,
)
else:
make_gl_entries(doc, credit_account, debit_account, against,
amount, base_amount, end_date, project, account_currency, item.cost_center, item, deferred_process)
make_gl_entries(
doc,
credit_account,
debit_account,
against,
amount,
base_amount,
end_date,
project,
account_currency,
item.cost_center,
item,
deferred_process,
)
# Returned in case of any errors because it tries to submit the same record again and again in case of errors
if frappe.flags.deferred_accounting_error:
return
if getdate(end_date) < getdate(posting_date) and not last_gl_entry:
_book_deferred_revenue_or_expense(item, via_journal_entry, submit_journal_entry, book_deferred_entries_based_on)
_book_deferred_revenue_or_expense(
item, via_journal_entry, submit_journal_entry, book_deferred_entries_based_on
)
via_journal_entry = cint(frappe.db.get_singles_value('Accounts Settings', 'book_deferred_entries_via_journal_entry'))
submit_journal_entry = cint(frappe.db.get_singles_value('Accounts Settings', 'submit_journal_entries'))
book_deferred_entries_based_on = frappe.db.get_singles_value('Accounts Settings', 'book_deferred_entries_based_on')
via_journal_entry = cint(
frappe.db.get_singles_value("Accounts Settings", "book_deferred_entries_via_journal_entry")
)
submit_journal_entry = cint(
frappe.db.get_singles_value("Accounts Settings", "submit_journal_entries")
)
book_deferred_entries_based_on = frappe.db.get_singles_value(
"Accounts Settings", "book_deferred_entries_based_on"
)
for item in doc.get('items'):
for item in doc.get("items"):
if item.get(enable_check):
_book_deferred_revenue_or_expense(item, via_journal_entry, submit_journal_entry, book_deferred_entries_based_on)
_book_deferred_revenue_or_expense(
item, via_journal_entry, submit_journal_entry, book_deferred_entries_based_on
)
def process_deferred_accounting(posting_date=None):
''' Converts deferred income/expense into income/expense
Executed via background jobs on every month end '''
"""Converts deferred income/expense into income/expense
Executed via background jobs on every month end"""
if not posting_date:
posting_date = today()
if not cint(frappe.db.get_singles_value('Accounts Settings', 'automatically_process_deferred_accounting_entry')):
if not cint(
frappe.db.get_singles_value(
"Accounts Settings", "automatically_process_deferred_accounting_entry"
)
):
return
start_date = add_months(today(), -1)
end_date = add_days(today(), -1)
companies = frappe.get_all('Company')
companies = frappe.get_all("Company")
for company in companies:
for record_type in ('Income', 'Expense'):
doc = frappe.get_doc(dict(
doctype='Process Deferred Accounting',
company=company.name,
posting_date=posting_date,
start_date=start_date,
end_date=end_date,
type=record_type
))
for record_type in ("Income", "Expense"):
doc = frappe.get_doc(
dict(
doctype="Process Deferred Accounting",
company=company.name,
posting_date=posting_date,
start_date=start_date,
end_date=end_date,
type=record_type,
)
)
doc.insert()
doc.submit()
def make_gl_entries(doc, credit_account, debit_account, against,
amount, base_amount, posting_date, project, account_currency, cost_center, item, deferred_process=None):
def make_gl_entries(
doc,
credit_account,
debit_account,
against,
amount,
base_amount,
posting_date,
project,
account_currency,
cost_center,
item,
deferred_process=None,
):
# GL Entry for crediting the amount in the deferred expense
from erpnext.accounts.general_ledger import make_gl_entries
if amount == 0: return
if amount == 0:
return
gl_entries = []
gl_entries.append(
doc.get_gl_dict({
"account": credit_account,
"against": against,
"credit": base_amount,
"credit_in_account_currency": amount,
"cost_center": cost_center,
"voucher_detail_no": item.name,
'posting_date': posting_date,
'project': project,
'against_voucher_type': 'Process Deferred Accounting',
'against_voucher': deferred_process
}, account_currency, item=item)
doc.get_gl_dict(
{
"account": credit_account,
"against": against,
"credit": base_amount,
"credit_in_account_currency": amount,
"cost_center": cost_center,
"voucher_detail_no": item.name,
"posting_date": posting_date,
"project": project,
"against_voucher_type": "Process Deferred Accounting",
"against_voucher": deferred_process,
},
account_currency,
item=item,
)
)
# GL Entry to debit the amount from the expense
gl_entries.append(
doc.get_gl_dict({
"account": debit_account,
"against": against,
"debit": base_amount,
"debit_in_account_currency": amount,
"cost_center": cost_center,
"voucher_detail_no": item.name,
'posting_date': posting_date,
'project': project,
'against_voucher_type': 'Process Deferred Accounting',
'against_voucher': deferred_process
}, account_currency, item=item)
doc.get_gl_dict(
{
"account": debit_account,
"against": against,
"debit": base_amount,
"debit_in_account_currency": amount,
"cost_center": cost_center,
"voucher_detail_no": item.name,
"posting_date": posting_date,
"project": project,
"against_voucher_type": "Process Deferred Accounting",
"against_voucher": deferred_process,
},
account_currency,
item=item,
)
)
if gl_entries:
@@ -380,69 +539,81 @@ def make_gl_entries(doc, credit_account, debit_account, against,
frappe.db.commit()
except Exception as e:
if frappe.flags.in_test:
traceback = frappe.get_traceback()
frappe.log_error(title=_('Error while processing deferred accounting for Invoice {0}').format(doc.name), message=traceback)
doc.log_error(f"Error while processing deferred accounting for Invoice {doc.name}")
raise e
else:
frappe.db.rollback()
traceback = frappe.get_traceback()
frappe.log_error(title=_('Error while processing deferred accounting for Invoice {0}').format(doc.name), message=traceback)
doc.log_error(f"Error while processing deferred accounting for Invoice {doc.name}")
frappe.flags.deferred_accounting_error = True
def send_mail(deferred_process):
title = _("Error while processing deferred accounting for {0}").format(deferred_process)
link = get_link_to_form('Process Deferred Accounting', deferred_process)
link = get_link_to_form("Process Deferred Accounting", deferred_process)
content = _("Deferred accounting failed for some invoices:") + "\n"
content += _("Please check Process Deferred Accounting {0} and submit manually after resolving errors.").format(link)
content += _(
"Please check Process Deferred Accounting {0} and submit manually after resolving errors."
).format(link)
sendmail_to_system_managers(title, content)
def book_revenue_via_journal_entry(doc, credit_account, debit_account, against,
amount, base_amount, posting_date, project, account_currency, cost_center, item,
deferred_process=None, submit='No'):
if amount == 0: return
def book_revenue_via_journal_entry(
doc,
credit_account,
debit_account,
amount,
base_amount,
posting_date,
project,
account_currency,
cost_center,
item,
deferred_process=None,
submit="No",
):
journal_entry = frappe.new_doc('Journal Entry')
if amount == 0:
return
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.posting_date = posting_date
journal_entry.company = doc.company
journal_entry.voucher_type = 'Deferred Revenue' if doc.doctype == 'Sales Invoice' \
else 'Deferred Expense'
journal_entry.voucher_type = (
"Deferred Revenue" if doc.doctype == "Sales Invoice" else "Deferred Expense"
)
journal_entry.process_deferred_accounting = deferred_process
debit_entry = {
'account': credit_account,
'credit': base_amount,
'credit_in_account_currency': amount,
'account_currency': account_currency,
'reference_name': doc.name,
'reference_type': doc.doctype,
'reference_detail_no': item.name,
'cost_center': cost_center,
'project': project,
"account": credit_account,
"credit": base_amount,
"credit_in_account_currency": amount,
"account_currency": account_currency,
"reference_name": doc.name,
"reference_type": doc.doctype,
"reference_detail_no": item.name,
"cost_center": cost_center,
"project": project,
}
credit_entry = {
'account': debit_account,
'debit': base_amount,
'debit_in_account_currency': amount,
'account_currency': account_currency,
'reference_name': doc.name,
'reference_type': doc.doctype,
'reference_detail_no': item.name,
'cost_center': cost_center,
'project': project,
"account": debit_account,
"debit": base_amount,
"debit_in_account_currency": amount,
"account_currency": account_currency,
"reference_name": doc.name,
"reference_type": doc.doctype,
"reference_detail_no": item.name,
"cost_center": cost_center,
"project": project,
}
for dimension in get_accounting_dimensions():
debit_entry.update({
dimension: item.get(dimension)
})
debit_entry.update({dimension: item.get(dimension)})
credit_entry.update({
dimension: item.get(dimension)
})
credit_entry.update({dimension: item.get(dimension)})
journal_entry.append('accounts', debit_entry)
journal_entry.append('accounts', credit_entry)
journal_entry.append("accounts", debit_entry)
journal_entry.append("accounts", credit_entry)
try:
journal_entry.save()
@@ -453,21 +624,26 @@ def book_revenue_via_journal_entry(doc, credit_account, debit_account, against,
frappe.db.commit()
except Exception:
frappe.db.rollback()
traceback = frappe.get_traceback()
frappe.log_error(title=_('Error while processing deferred accounting for Invoice {0}').format(doc.name), message=traceback)
doc.log_error(f"Error while processing deferred accounting for Invoice {doc.name}")
frappe.flags.deferred_accounting_error = True
def get_deferred_booking_accounts(doctype, voucher_detail_no, dr_or_cr):
if doctype == 'Sales Invoice':
credit_account, debit_account = frappe.db.get_value('Sales Invoice Item', {'name': voucher_detail_no},
['income_account', 'deferred_revenue_account'])
if doctype == "Sales Invoice":
credit_account, debit_account = frappe.db.get_value(
"Sales Invoice Item",
{"name": voucher_detail_no},
["income_account", "deferred_revenue_account"],
)
else:
credit_account, debit_account = frappe.db.get_value('Purchase Invoice Item', {'name': voucher_detail_no},
['deferred_expense_account', 'expense_account'])
credit_account, debit_account = frappe.db.get_value(
"Purchase Invoice Item",
{"name": voucher_detail_no},
["deferred_expense_account", "expense_account"],
)
if dr_or_cr == 'Debit':
if dr_or_cr == "Debit":
return debit_account
else:
return credit_account

View File

@@ -10,11 +10,17 @@ from frappe.utils.nestedset import NestedSet, get_ancestors_of, get_descendants_
import erpnext
class RootNotEditable(frappe.ValidationError): pass
class BalanceMismatchError(frappe.ValidationError): pass
class RootNotEditable(frappe.ValidationError):
pass
class BalanceMismatchError(frappe.ValidationError):
pass
class Account(NestedSet):
nsm_parent_field = 'parent_account'
nsm_parent_field = "parent_account"
def on_update(self):
if frappe.local.flags.ignore_update_nsm:
return
@@ -22,17 +28,20 @@ class Account(NestedSet):
super(Account, self).on_update()
def onload(self):
frozen_accounts_modifier = frappe.db.get_value("Accounts Settings", "Accounts Settings",
"frozen_accounts_modifier")
frozen_accounts_modifier = frappe.db.get_value(
"Accounts Settings", "Accounts Settings", "frozen_accounts_modifier"
)
if not frozen_accounts_modifier or frozen_accounts_modifier in frappe.get_roles():
self.set_onload("can_freeze_account", True)
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
if frappe.local.flags.allow_unverified_charts:
return
self.validate_parent()
@@ -49,22 +58,33 @@ class Account(NestedSet):
def validate_parent(self):
"""Fetch Parent Details and validate parent account"""
if self.parent_account:
par = frappe.db.get_value("Account", self.parent_account,
["name", "is_group", "company"], as_dict=1)
par = frappe.db.get_value(
"Account", self.parent_account, ["name", "is_group", "company"], as_dict=1
)
if not par:
throw(_("Account {0}: Parent account {1} does not exist").format(self.name, self.parent_account))
throw(
_("Account {0}: Parent account {1} does not exist").format(self.name, self.parent_account)
)
elif par.name == self.name:
throw(_("Account {0}: You can not assign itself as parent account").format(self.name))
elif not par.is_group:
throw(_("Account {0}: Parent account {1} can not be a ledger").format(self.name, self.parent_account))
throw(
_("Account {0}: Parent account {1} can not be a ledger").format(
self.name, self.parent_account
)
)
elif par.company != self.company:
throw(_("Account {0}: Parent account {1} does not belong to company: {2}")
.format(self.name, self.parent_account, self.company))
throw(
_("Account {0}: Parent account {1} does not belong to company: {2}").format(
self.name, self.parent_account, self.company
)
)
def set_root_and_report_type(self):
if self.parent_account:
par = frappe.db.get_value("Account", self.parent_account,
["report_type", "root_type"], as_dict=1)
par = frappe.db.get_value(
"Account", self.parent_account, ["report_type", "root_type"], as_dict=1
)
if par.report_type:
self.report_type = par.report_type
@@ -75,15 +95,20 @@ class Account(NestedSet):
db_value = frappe.db.get_value("Account", self.name, ["report_type", "root_type"], as_dict=1)
if db_value:
if self.report_type != db_value.report_type:
frappe.db.sql("update `tabAccount` set report_type=%s where lft > %s and rgt < %s",
(self.report_type, self.lft, self.rgt))
frappe.db.sql(
"update `tabAccount` set report_type=%s where lft > %s and rgt < %s",
(self.report_type, self.lft, self.rgt),
)
if self.root_type != db_value.root_type:
frappe.db.sql("update `tabAccount` set root_type=%s where lft > %s and rgt < %s",
(self.root_type, self.lft, self.rgt))
frappe.db.sql(
"update `tabAccount` set root_type=%s where lft > %s and rgt < %s",
(self.root_type, self.lft, self.rgt),
)
if self.root_type and not self.report_type:
self.report_type = "Balance Sheet" \
if self.root_type in ("Asset", "Liability", "Equity") else "Profit and Loss"
self.report_type = (
"Balance Sheet" if self.root_type in ("Asset", "Liability", "Equity") else "Profit and Loss"
)
def validate_root_details(self):
# does not exists parent
@@ -96,21 +121,26 @@ class Account(NestedSet):
def validate_root_company_and_sync_account_to_children(self):
# ignore validation while creating new compnay or while syncing to child companies
if frappe.local.flags.ignore_root_company_validation or self.flags.ignore_root_company_validation:
if (
frappe.local.flags.ignore_root_company_validation or self.flags.ignore_root_company_validation
):
return
ancestors = get_root_company(self.company)
if ancestors:
if frappe.get_value("Company", self.company, "allow_account_creation_against_child_company"):
return
if not frappe.db.get_value("Account",
{'account_name': self.account_name, 'company': ancestors[0]}, 'name'):
if not frappe.db.get_value(
"Account", {"account_name": self.account_name, "company": ancestors[0]}, "name"
):
frappe.throw(_("Please add the account to root level Company - {}").format(ancestors[0]))
elif self.parent_account:
descendants = get_descendants_of('Company', self.company)
if not descendants: return
descendants = get_descendants_of("Company", self.company)
if not descendants:
return
parent_acc_name_map = {}
parent_acc_name, parent_acc_number = frappe.db.get_value('Account', self.parent_account, \
["account_name", "account_number"])
parent_acc_name, parent_acc_number = frappe.db.get_value(
"Account", self.parent_account, ["account_name", "account_number"]
)
filters = {
"company": ["in", descendants],
"account_name": parent_acc_name,
@@ -118,10 +148,13 @@ class Account(NestedSet):
if parent_acc_number:
filters["account_number"] = parent_acc_number
for d in frappe.db.get_values('Account', filters=filters, fieldname=["company", "name"], as_dict=True):
for d in frappe.db.get_values(
"Account", filters=filters, fieldname=["company", "name"], as_dict=True
):
parent_acc_name_map[d["company"]] = d["name"]
if not parent_acc_name_map: return
if not parent_acc_name_map:
return
self.create_account_for_child_company(parent_acc_name_map, descendants, parent_acc_name)
@@ -142,26 +175,38 @@ class Account(NestedSet):
def validate_frozen_accounts_modifier(self):
old_value = frappe.db.get_value("Account", self.name, "freeze_account")
if old_value and old_value != self.freeze_account:
frozen_accounts_modifier = frappe.db.get_value('Accounts Settings', None, 'frozen_accounts_modifier')
if not frozen_accounts_modifier or \
frozen_accounts_modifier not in frappe.get_roles():
throw(_("You are not authorized to set Frozen value"))
frozen_accounts_modifier = frappe.db.get_value(
"Accounts Settings", None, "frozen_accounts_modifier"
)
if not frozen_accounts_modifier or frozen_accounts_modifier not in frappe.get_roles():
throw(_("You are not authorized to set Frozen value"))
def validate_balance_must_be_debit_or_credit(self):
from erpnext.accounts.utils import get_balance_on
if not self.get("__islocal") and self.balance_must_be:
account_balance = get_balance_on(self.name)
if account_balance > 0 and self.balance_must_be == "Credit":
frappe.throw(_("Account balance already in Debit, you are not allowed to set 'Balance Must Be' as 'Credit'"))
frappe.throw(
_(
"Account balance already in Debit, you are not allowed to set 'Balance Must Be' as 'Credit'"
)
)
elif account_balance < 0 and self.balance_must_be == "Debit":
frappe.throw(_("Account balance already in Credit, you are not allowed to set 'Balance Must Be' as 'Debit'"))
frappe.throw(
_(
"Account balance already in Credit, you are not allowed to set 'Balance Must Be' as 'Debit'"
)
)
def validate_account_currency(self):
if not self.account_currency:
self.account_currency = frappe.get_cached_value('Company', self.company, "default_currency")
self.account_currency = frappe.get_cached_value("Company", self.company, "default_currency")
elif self.account_currency != frappe.db.get_value("Account", self.name, "account_currency"):
gl_currency = frappe.db.get_value("GL Entry", {"account": self.name}, "account_currency")
if gl_currency and self.account_currency != gl_currency:
if frappe.db.get_value("GL Entry", {"account": self.name}):
frappe.throw(_("Currency can not be changed after making entries using some other currency"))
@@ -170,45 +215,52 @@ class Account(NestedSet):
company_bold = frappe.bold(company)
parent_acc_name_bold = frappe.bold(parent_acc_name)
if not parent_acc_name_map.get(company):
frappe.throw(_("While creating account for Child Company {0}, parent account {1} not found. Please create the parent account in corresponding COA")
.format(company_bold, parent_acc_name_bold), title=_("Account Not Found"))
frappe.throw(
_(
"While creating account for Child Company {0}, parent account {1} not found. Please create the parent account in corresponding COA"
).format(company_bold, parent_acc_name_bold),
title=_("Account Not Found"),
)
# validate if parent of child company account to be added is a group
if (frappe.db.get_value("Account", self.parent_account, "is_group")
and not frappe.db.get_value("Account", parent_acc_name_map[company], "is_group")):
msg = _("While creating account for Child Company {0}, parent account {1} found as a ledger account.").format(company_bold, parent_acc_name_bold)
if frappe.db.get_value("Account", self.parent_account, "is_group") and not frappe.db.get_value(
"Account", parent_acc_name_map[company], "is_group"
):
msg = _(
"While creating account for Child Company {0}, parent account {1} found as a ledger account."
).format(company_bold, parent_acc_name_bold)
msg += "<br><br>"
msg += _("Please convert the parent account in corresponding child company to a group account.")
msg += _(
"Please convert the parent account in corresponding child company to a group account."
)
frappe.throw(msg, title=_("Invalid Parent Account"))
filters = {
"account_name": self.account_name,
"company": company
}
filters = {"account_name": self.account_name, "company": company}
if self.account_number:
filters["account_number"] = self.account_number
child_account = frappe.db.get_value("Account", filters, 'name')
child_account = frappe.db.get_value("Account", filters, "name")
if not child_account:
doc = frappe.copy_doc(self)
doc.flags.ignore_root_company_validation = True
doc.update({
"company": company,
# parent account's currency should be passed down to child account's curreny
# if it is None, it picks it up from default company currency, which might be unintended
"account_currency": erpnext.get_company_currency(company),
"parent_account": parent_acc_name_map[company]
})
doc.update(
{
"company": company,
# parent account's currency should be passed down to child account's curreny
# if it is None, it picks it up from default company currency, which might be unintended
"account_currency": erpnext.get_company_currency(company),
"parent_account": parent_acc_name_map[company],
}
)
doc.save()
frappe.msgprint(_("Account {0} is added in the child company {1}")
.format(doc.name, company))
frappe.msgprint(_("Account {0} is added in the child company {1}").format(doc.name, company))
elif child_account:
# update the parent company's value in child companies
doc = frappe.get_doc("Account", child_account)
parent_value_changed = False
for field in ['account_type', 'freeze_account', 'balance_must_be']:
for field in ["account_type", "freeze_account", "balance_must_be"]:
if doc.get(field) != self.get(field):
parent_value_changed = True
doc.set(field, self.get(field))
@@ -243,8 +295,11 @@ class Account(NestedSet):
return frappe.db.get_value("GL Entry", {"account": self.name})
def check_if_child_exists(self):
return frappe.db.sql("""select name from `tabAccount` where parent_account = %s
and docstatus != 2""", self.name)
return frappe.db.sql(
"""select name from `tabAccount` where parent_account = %s
and docstatus != 2""",
self.name,
)
def validate_mandatory(self):
if not self.root_type:
@@ -260,73 +315,99 @@ class Account(NestedSet):
super(Account, self).on_trash(True)
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_parent_account(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql("""select name from tabAccount
return frappe.db.sql(
"""select name from tabAccount
where is_group = 1 and docstatus != 2 and company = %s
and %s like %s order by name limit %s, %s""" %
("%s", searchfield, "%s", "%s", "%s"),
(filters["company"], "%%%s%%" % txt, start, page_len), as_list=1)
and %s like %s order by name limit %s offset %s"""
% ("%s", searchfield, "%s", "%s", "%s"),
(filters["company"], "%%%s%%" % txt, page_len, start),
as_list=1,
)
def get_account_currency(account):
"""Helper function to get account currency"""
if not account:
return
def generator():
account_currency, company = frappe.get_cached_value("Account", account, ["account_currency", "company"])
account_currency, company = frappe.get_cached_value(
"Account", account, ["account_currency", "company"]
)
if not account_currency:
account_currency = frappe.get_cached_value('Company', company, "default_currency")
account_currency = frappe.get_cached_value("Company", company, "default_currency")
return account_currency
return frappe.local_cache("account_currency", account, generator)
def on_doctype_update():
frappe.db.add_index("Account", ["lft", "rgt"])
def get_account_autoname(account_number, account_name, company):
# first validate if company exists
company = frappe.get_cached_value('Company', company, ["abbr", "name"], as_dict=True)
company = frappe.get_cached_value("Company", company, ["abbr", "name"], as_dict=True)
if not company:
frappe.throw(_('Company {0} does not exist').format(company))
frappe.throw(_("Company {0} does not exist").format(company))
parts = [account_name.strip(), company.abbr]
if cstr(account_number).strip():
parts.insert(0, cstr(account_number).strip())
return ' - '.join(parts)
return " - ".join(parts)
def validate_account_number(name, account_number, company):
if account_number:
account_with_same_number = frappe.db.get_value("Account",
{"account_number": account_number, "company": company, "name": ["!=", name]})
account_with_same_number = frappe.db.get_value(
"Account", {"account_number": account_number, "company": company, "name": ["!=", name]}
)
if account_with_same_number:
frappe.throw(_("Account Number {0} already used in account {1}")
.format(account_number, account_with_same_number))
frappe.throw(
_("Account Number {0} already used in account {1}").format(
account_number, account_with_same_number
)
)
@frappe.whitelist()
def update_account_number(name, account_name, account_number=None, from_descendant=False):
account = frappe.db.get_value("Account", name, "company", as_dict=True)
if not account: return
if not account:
return
old_acc_name, old_acc_number = frappe.db.get_value('Account', name, \
["account_name", "account_number"])
old_acc_name, old_acc_number = frappe.db.get_value(
"Account", name, ["account_name", "account_number"]
)
# check if account exists in parent company
ancestors = get_ancestors_of("Company", account.company)
allow_independent_account_creation = frappe.get_value("Company", account.company, "allow_account_creation_against_child_company")
allow_independent_account_creation = frappe.get_value(
"Company", account.company, "allow_account_creation_against_child_company"
)
if ancestors and not allow_independent_account_creation:
for ancestor in ancestors:
if frappe.db.get_value("Account", {'account_name': old_acc_name, 'company': ancestor}, 'name'):
if frappe.db.get_value("Account", {"account_name": old_acc_name, "company": ancestor}, "name"):
# same account in parent company exists
allow_child_account_creation = _("Allow Account Creation Against Child Company")
message = _("Account {0} exists in parent company {1}.").format(frappe.bold(old_acc_name), frappe.bold(ancestor))
message = _("Account {0} exists in parent company {1}.").format(
frappe.bold(old_acc_name), frappe.bold(ancestor)
)
message += "<br>"
message += _("Renaming it is only allowed via parent company {0}, to avoid mismatch.").format(frappe.bold(ancestor))
message += _("Renaming it is only allowed via parent company {0}, to avoid mismatch.").format(
frappe.bold(ancestor)
)
message += "<br><br>"
message += _("To overrule this, enable '{0}' in company {1}").format(allow_child_account_creation, frappe.bold(account.company))
message += _("To overrule this, enable '{0}' in company {1}").format(
allow_child_account_creation, frappe.bold(account.company)
)
frappe.throw(message, title=_("Rename Not Allowed"))
@@ -339,42 +420,53 @@ def update_account_number(name, account_name, account_number=None, from_descenda
if not from_descendant:
# Update and rename in child company accounts as well
descendants = get_descendants_of('Company', account.company)
descendants = get_descendants_of("Company", account.company)
if descendants:
sync_update_account_number_in_child(descendants, old_acc_name, account_name, account_number, old_acc_number)
sync_update_account_number_in_child(
descendants, old_acc_name, account_name, account_number, old_acc_number
)
new_name = get_account_autoname(account_number, account_name, account.company)
if name != new_name:
frappe.rename_doc("Account", name, new_name, force=1)
return new_name
@frappe.whitelist()
def merge_account(old, new, is_group, root_type, company):
# Validate properties before merging
if not frappe.db.exists("Account", new):
throw(_("Account {0} does not exist").format(new))
val = list(frappe.db.get_value("Account", new,
["is_group", "root_type", "company"]))
val = list(frappe.db.get_value("Account", new, ["is_group", "root_type", "company"]))
if val != [cint(is_group), root_type, company]:
throw(_("""Merging is only possible if following properties are same in both records. Is Group, Root Type, Company"""))
throw(
_(
"""Merging is only possible if following properties are same in both records. Is Group, Root Type, Company"""
)
)
if is_group and frappe.db.get_value("Account", new, "parent_account") == old:
frappe.db.set_value("Account", new, "parent_account",
frappe.db.get_value("Account", old, "parent_account"))
frappe.db.set_value(
"Account", new, "parent_account", frappe.db.get_value("Account", old, "parent_account")
)
frappe.rename_doc("Account", old, new, merge=1, force=1)
return new
@frappe.whitelist()
def get_root_company(company):
# return the topmost company in the hierarchy
ancestors = get_ancestors_of('Company', company, "lft asc")
ancestors = get_ancestors_of("Company", company, "lft asc")
return [ancestors[0]] if ancestors else []
def sync_update_account_number_in_child(descendants, old_acc_name, account_name, account_number=None, old_acc_number=None):
def sync_update_account_number_in_child(
descendants, old_acc_name, account_name, account_number=None, old_acc_number=None
):
filters = {
"company": ["in", descendants],
"account_name": old_acc_name,
@@ -382,5 +474,7 @@ def sync_update_account_number_in_child(descendants, old_acc_name, account_name,
if old_acc_number:
filters["account_number"] = old_acc_number
for d in frappe.db.get_values('Account', filters=filters, fieldname=["company", "name"], as_dict=True):
update_account_number(d["name"], account_name, account_number, from_descendant=True)
for d in frappe.db.get_values(
"Account", filters=filters, fieldname=["company", "name"], as_dict=True
):
update_account_number(d["name"], account_name, account_number, from_descendant=True)

View File

@@ -160,7 +160,7 @@ frappe.treeview_settings["Account"] = {
let root_company = treeview.page.fields_dict.root_company.get_value();
if(root_company) {
frappe.throw(__("Please add the account to root level Company - ") + root_company);
frappe.throw(__("Please add the account to root level Company - {0}"), [root_company]);
} else {
treeview.new_node();
}

View File

@@ -10,7 +10,9 @@ from frappe.utils.nestedset import rebuild_tree
from unidecode import unidecode
def create_charts(company, chart_template=None, existing_company=None, custom_chart=None, from_coa_importer=None):
def create_charts(
company, chart_template=None, existing_company=None, custom_chart=None, from_coa_importer=None
):
chart = custom_chart or get_chart(chart_template, existing_company)
if chart:
accounts = []
@@ -20,30 +22,41 @@ def create_charts(company, chart_template=None, existing_company=None, custom_ch
if root_account:
root_type = child.get("root_type")
if account_name not in ["account_name", "account_number", "account_type",
"root_type", "is_group", "tax_rate"]:
if account_name not in [
"account_name",
"account_number",
"account_type",
"root_type",
"is_group",
"tax_rate",
]:
account_number = cstr(child.get("account_number")).strip()
account_name, account_name_in_db = add_suffix_if_duplicate(account_name,
account_number, accounts)
account_name, account_name_in_db = add_suffix_if_duplicate(
account_name, account_number, accounts
)
is_group = identify_is_group(child)
report_type = "Balance Sheet" if root_type in ["Asset", "Liability", "Equity"] \
else "Profit and Loss"
report_type = (
"Balance Sheet" if root_type in ["Asset", "Liability", "Equity"] else "Profit and Loss"
)
account = frappe.get_doc({
"doctype": "Account",
"account_name": child.get('account_name') if from_coa_importer else account_name,
"company": company,
"parent_account": parent,
"is_group": is_group,
"root_type": root_type,
"report_type": report_type,
"account_number": account_number,
"account_type": child.get("account_type"),
"account_currency": child.get('account_currency') or frappe.db.get_value('Company', company, "default_currency"),
"tax_rate": child.get("tax_rate")
})
account = frappe.get_doc(
{
"doctype": "Account",
"account_name": child.get("account_name") if from_coa_importer else account_name,
"company": company,
"parent_account": parent,
"is_group": is_group,
"root_type": root_type,
"report_type": report_type,
"account_number": account_number,
"account_type": child.get("account_type"),
"account_currency": child.get("account_currency")
or frappe.db.get_value("Company", company, "default_currency"),
"tax_rate": child.get("tax_rate"),
}
)
if root_account or frappe.local.flags.allow_unverified_charts:
account.flags.ignore_mandatory = True
@@ -63,10 +76,10 @@ def create_charts(company, chart_template=None, existing_company=None, custom_ch
rebuild_tree("Account", "parent_account")
frappe.local.flags.ignore_update_nsm = False
def add_suffix_if_duplicate(account_name, account_number, accounts):
if account_number:
account_name_in_db = unidecode(" - ".join([account_number,
account_name.strip().lower()]))
account_name_in_db = unidecode(" - ".join([account_number, account_name.strip().lower()]))
else:
account_name_in_db = unidecode(account_name.strip().lower())
@@ -76,16 +89,21 @@ def add_suffix_if_duplicate(account_name, account_number, accounts):
return account_name, account_name_in_db
def identify_is_group(child):
if child.get("is_group"):
is_group = child.get("is_group")
elif len(set(child.keys()) - set(["account_name", "account_type", "root_type", "is_group", "tax_rate", "account_number"])):
elif len(
set(child.keys())
- set(["account_name", "account_type", "root_type", "is_group", "tax_rate", "account_number"])
):
is_group = 1
else:
is_group = 0
return is_group
def get_chart(chart_template, existing_company=None):
chart = {}
if existing_company:
@@ -95,11 +113,13 @@ def get_chart(chart_template, existing_company=None):
from erpnext.accounts.doctype.account.chart_of_accounts.verified import (
standard_chart_of_accounts,
)
return standard_chart_of_accounts.get()
elif chart_template == "Standard with Numbers":
from erpnext.accounts.doctype.account.chart_of_accounts.verified import (
standard_chart_of_accounts_with_account_number,
)
return standard_chart_of_accounts_with_account_number.get()
else:
folders = ("verified",)
@@ -115,6 +135,7 @@ def get_chart(chart_template, existing_company=None):
if chart and json.loads(chart).get("name") == chart_template:
return json.loads(chart).get("tree")
@frappe.whitelist()
def get_charts_for_country(country, with_standard=False):
charts = []
@@ -122,9 +143,10 @@ def get_charts_for_country(country, with_standard=False):
def _get_chart_name(content):
if content:
content = json.loads(content)
if (content and content.get("disabled", "No") == "No") \
or frappe.local.flags.allow_unverified_charts:
charts.append(content["name"])
if (
content and content.get("disabled", "No") == "No"
) or frappe.local.flags.allow_unverified_charts:
charts.append(content["name"])
country_code = frappe.db.get_value("Country", country, "code")
if country_code:
@@ -151,11 +173,21 @@ def get_charts_for_country(country, with_standard=False):
def get_account_tree_from_existing_company(existing_company):
all_accounts = frappe.get_all('Account',
filters={'company': existing_company},
fields = ["name", "account_name", "parent_account", "account_type",
"is_group", "root_type", "tax_rate", "account_number"],
order_by="lft, rgt")
all_accounts = frappe.get_all(
"Account",
filters={"company": existing_company},
fields=[
"name",
"account_name",
"parent_account",
"account_type",
"is_group",
"root_type",
"tax_rate",
"account_number",
],
order_by="lft, rgt",
)
account_tree = {}
@@ -164,6 +196,7 @@ def get_account_tree_from_existing_company(existing_company):
build_account_tree(account_tree, None, all_accounts)
return account_tree
def build_account_tree(tree, parent, all_accounts):
# find children
parent_account = parent.name if parent else ""
@@ -192,27 +225,29 @@ def build_account_tree(tree, parent, all_accounts):
# call recursively to build a subtree for current account
build_account_tree(tree[child.account_name], child, all_accounts)
@frappe.whitelist()
def validate_bank_account(coa, bank_account):
accounts = []
chart = get_chart(coa)
if chart:
def _get_account_names(account_master):
for account_name, child in account_master.items():
if account_name not in ["account_number", "account_type",
"root_type", "is_group", "tax_rate"]:
if account_name not in ["account_number", "account_type", "root_type", "is_group", "tax_rate"]:
accounts.append(account_name)
_get_account_names(child)
_get_account_names(chart)
return (bank_account in accounts)
return bank_account in accounts
@frappe.whitelist()
def build_tree_from_json(chart_template, chart_data=None, from_coa_importer=False):
''' get chart template from its folder and parse the json to be rendered as tree '''
"""get chart template from its folder and parse the json to be rendered as tree"""
chart = chart_data or get_chart(chart_template)
# if no template selected, return as it is
@@ -220,22 +255,33 @@ def build_tree_from_json(chart_template, chart_data=None, from_coa_importer=Fals
return
accounts = []
def _import_accounts(children, parent):
''' recursively called to form a parent-child based list of dict from chart template '''
"""recursively called to form a parent-child based list of dict from chart template"""
for account_name, child in children.items():
account = {}
if account_name in ["account_name", "account_number", "account_type",\
"root_type", "is_group", "tax_rate"]: continue
if account_name in [
"account_name",
"account_number",
"account_type",
"root_type",
"is_group",
"tax_rate",
]:
continue
if from_coa_importer:
account_name = child['account_name']
account_name = child["account_name"]
account['parent_account'] = parent
account['expandable'] = True if identify_is_group(child) else False
account['value'] = (cstr(child.get('account_number')).strip() + ' - ' + account_name) \
if child.get('account_number') else account_name
account["parent_account"] = parent
account["expandable"] = True if identify_is_group(child) else False
account["value"] = (
(cstr(child.get("account_number")).strip() + " - " + account_name)
if child.get("account_number")
else account_name
)
accounts.append(account)
_import_accounts(child, account['value'])
_import_accounts(child, account["value"])
_import_accounts(chart, None)
return accounts

View File

@@ -20,6 +20,7 @@ charts = {}
all_account_types = []
all_roots = {}
def go():
global accounts, charts
default_account_types = get_default_account_types()
@@ -34,14 +35,16 @@ def go():
accounts, charts = {}, {}
country_path = os.path.join(path, country_dir)
manifest = ast.literal_eval(open(os.path.join(country_path, "__openerp__.py")).read())
data_files = manifest.get("data", []) + manifest.get("init_xml", []) + \
manifest.get("update_xml", [])
data_files = (
manifest.get("data", []) + manifest.get("init_xml", []) + manifest.get("update_xml", [])
)
files_path = [os.path.join(country_path, d) for d in data_files]
xml_roots = get_xml_roots(files_path)
csv_content = get_csv_contents(files_path)
prefix = country_dir if csv_content else None
account_types = get_account_types(xml_roots.get("account.account.type", []),
csv_content.get("account.account.type", []), prefix)
account_types = get_account_types(
xml_roots.get("account.account.type", []), csv_content.get("account.account.type", []), prefix
)
account_types.update(default_account_types)
if xml_roots:
@@ -54,12 +57,15 @@ def go():
create_all_roots_file()
def get_default_account_types():
default_types_root = []
default_types_root.append(ET.parse(os.path.join(path, "account", "data",
"data_account_type.xml")).getroot())
default_types_root.append(
ET.parse(os.path.join(path, "account", "data", "data_account_type.xml")).getroot()
)
return get_account_types(default_types_root, None, prefix="account")
def get_xml_roots(files_path):
xml_roots = frappe._dict()
for filepath in files_path:
@@ -68,64 +74,69 @@ def get_xml_roots(files_path):
tree = ET.parse(filepath)
root = tree.getroot()
for node in root[0].findall("record"):
if node.get("model") in ["account.account.template",
"account.chart.template", "account.account.type"]:
if node.get("model") in [
"account.account.template",
"account.chart.template",
"account.account.type",
]:
xml_roots.setdefault(node.get("model"), []).append(root)
break
return xml_roots
def get_csv_contents(files_path):
csv_content = {}
for filepath in files_path:
fname = os.path.basename(filepath)
for file_type in ["account.account.template", "account.account.type",
"account.chart.template"]:
for file_type in ["account.account.template", "account.account.type", "account.chart.template"]:
if fname.startswith(file_type) and fname.endswith(".csv"):
with open(filepath, "r") as csvfile:
try:
csv_content.setdefault(file_type, [])\
.append(read_csv_content(csvfile.read()))
csv_content.setdefault(file_type, []).append(read_csv_content(csvfile.read()))
except Exception as e:
continue
return csv_content
def get_account_types(root_list, csv_content, prefix=None):
types = {}
account_type_map = {
'cash': 'Cash',
'bank': 'Bank',
'tr_cash': 'Cash',
'tr_bank': 'Bank',
'receivable': 'Receivable',
'tr_receivable': 'Receivable',
'account rec': 'Receivable',
'payable': 'Payable',
'tr_payable': 'Payable',
'equity': 'Equity',
'stocks': 'Stock',
'stock': 'Stock',
'tax': 'Tax',
'tr_tax': 'Tax',
'tax-out': 'Tax',
'tax-in': 'Tax',
'charges_personnel': 'Chargeable',
'fixed asset': 'Fixed Asset',
'cogs': 'Cost of Goods Sold',
"cash": "Cash",
"bank": "Bank",
"tr_cash": "Cash",
"tr_bank": "Bank",
"receivable": "Receivable",
"tr_receivable": "Receivable",
"account rec": "Receivable",
"payable": "Payable",
"tr_payable": "Payable",
"equity": "Equity",
"stocks": "Stock",
"stock": "Stock",
"tax": "Tax",
"tr_tax": "Tax",
"tax-out": "Tax",
"tax-in": "Tax",
"charges_personnel": "Chargeable",
"fixed asset": "Fixed Asset",
"cogs": "Cost of Goods Sold",
}
for root in root_list:
for node in root[0].findall("record"):
if node.get("model")=="account.account.type":
if node.get("model") == "account.account.type":
data = {}
for field in node.findall("field"):
if field.get("name")=="code" and field.text.lower() != "none" \
and account_type_map.get(field.text):
data["account_type"] = account_type_map[field.text]
if (
field.get("name") == "code"
and field.text.lower() != "none"
and account_type_map.get(field.text)
):
data["account_type"] = account_type_map[field.text]
node_id = prefix + "." + node.get("id") if prefix else node.get("id")
types[node_id] = data
if csv_content and csv_content[0][0]=="id":
if csv_content and csv_content[0][0] == "id":
for row in csv_content[1:]:
row_dict = dict(zip(csv_content[0], row))
data = {}
@@ -136,21 +147,22 @@ def get_account_types(root_list, csv_content, prefix=None):
types[node_id] = data
return types
def make_maps_for_xml(xml_roots, account_types, country_dir):
"""make maps for `charts` and `accounts`"""
for model, root_list in xml_roots.items():
for root in root_list:
for node in root[0].findall("record"):
if node.get("model")=="account.account.template":
if node.get("model") == "account.account.template":
data = {}
for field in node.findall("field"):
if field.get("name")=="name":
if field.get("name") == "name":
data["name"] = field.text
if field.get("name")=="parent_id":
if field.get("name") == "parent_id":
parent_id = field.get("ref") or field.get("eval")
data["parent_id"] = parent_id
if field.get("name")=="user_type":
if field.get("name") == "user_type":
value = field.get("ref")
if account_types.get(value, {}).get("account_type"):
data["account_type"] = account_types[value]["account_type"]
@@ -160,16 +172,17 @@ def make_maps_for_xml(xml_roots, account_types, country_dir):
data["children"] = []
accounts[node.get("id")] = data
if node.get("model")=="account.chart.template":
if node.get("model") == "account.chart.template":
data = {}
for field in node.findall("field"):
if field.get("name")=="name":
if field.get("name") == "name":
data["name"] = field.text
if field.get("name")=="account_root_id":
if field.get("name") == "account_root_id":
data["account_root_id"] = field.get("ref")
data["id"] = country_dir
charts.setdefault(node.get("id"), {}).update(data)
def make_maps_for_csv(csv_content, account_types, country_dir):
for content in csv_content.get("account.account.template", []):
for row in content[1:]:
@@ -177,7 +190,7 @@ def make_maps_for_csv(csv_content, account_types, country_dir):
account = {
"name": data.get("name"),
"parent_id": data.get("parent_id:id") or data.get("parent_id/id"),
"children": []
"children": [],
}
user_type = data.get("user_type/id") or data.get("user_type:id")
if account_types.get(user_type, {}).get("account_type"):
@@ -194,12 +207,14 @@ def make_maps_for_csv(csv_content, account_types, country_dir):
for row in content[1:]:
if row:
data = dict(zip(content[0], row))
charts.setdefault(data.get("id"), {}).update({
"account_root_id": data.get("account_root_id:id") or \
data.get("account_root_id/id"),
"name": data.get("name"),
"id": country_dir
})
charts.setdefault(data.get("id"), {}).update(
{
"account_root_id": data.get("account_root_id:id") or data.get("account_root_id/id"),
"name": data.get("name"),
"id": country_dir,
}
)
def make_account_trees():
"""build tree hierarchy"""
@@ -218,6 +233,7 @@ def make_account_trees():
if "children" in accounts[id] and not accounts[id].get("children"):
del accounts[id]["children"]
def make_charts():
"""write chart files in app/setup/doctype/company/charts"""
for chart_id in charts:
@@ -236,34 +252,38 @@ def make_charts():
chart["country_code"] = src["id"][5:]
chart["tree"] = accounts[src["account_root_id"]]
for key, val in chart["tree"].items():
if key in ["name", "parent_id"]:
chart["tree"].pop(key)
if type(val) == dict:
val["root_type"] = ""
if chart:
fpath = os.path.join("erpnext", "erpnext", "accounts", "doctype", "account",
"chart_of_accounts", filename + ".json")
fpath = os.path.join(
"erpnext", "erpnext", "accounts", "doctype", "account", "chart_of_accounts", filename + ".json"
)
with open(fpath, "r") as chartfile:
old_content = chartfile.read()
if not old_content or (json.loads(old_content).get("is_active", "No") == "No" \
and json.loads(old_content).get("disabled", "No") == "No"):
if not old_content or (
json.loads(old_content).get("is_active", "No") == "No"
and json.loads(old_content).get("disabled", "No") == "No"
):
with open(fpath, "w") as chartfile:
chartfile.write(json.dumps(chart, indent=4, sort_keys=True))
all_roots.setdefault(filename, chart["tree"].keys())
def create_all_roots_file():
with open('all_roots.txt', 'w') as f:
with open("all_roots.txt", "w") as f:
for filename, roots in sorted(all_roots.items()):
f.write(filename)
f.write('\n----------------------\n')
f.write("\n----------------------\n")
for r in sorted(roots):
f.write(r.encode('utf-8'))
f.write('\n')
f.write('\n\n\n')
f.write(r.encode("utf-8"))
f.write("\n")
f.write("\n\n\n")
if __name__=="__main__":
if __name__ == "__main__":
go()

View File

@@ -7,182 +7,103 @@ from frappe import _
def get():
return {
_("Application of Funds (Assets)"): {
_("Current Assets"): {
_("Accounts Receivable"): {
_("Debtors"): {
"account_type": "Receivable"
}
},
_("Bank Accounts"): {
"account_type": "Bank",
"is_group": 1
},
_("Cash In Hand"): {
_("Cash"): {
"account_type": "Cash"
},
"account_type": "Cash"
},
_("Loans and Advances (Assets)"): {
_("Employee Advances"): {
},
},
_("Securities and Deposits"): {
_("Earnest Money"): {}
},
_("Stock Assets"): {
_("Stock In Hand"): {
"account_type": "Stock"
},
"account_type": "Stock",
},
_("Tax Assets"): {
"is_group": 1
}
},
_("Fixed Assets"): {
_("Capital Equipments"): {
"account_type": "Fixed Asset"
},
_("Electronic Equipments"): {
"account_type": "Fixed Asset"
},
_("Furnitures and Fixtures"): {
"account_type": "Fixed Asset"
},
_("Office Equipments"): {
"account_type": "Fixed Asset"
},
_("Plants and Machineries"): {
"account_type": "Fixed Asset"
},
_("Buildings"): {
"account_type": "Fixed Asset"
_("Application of Funds (Assets)"): {
_("Current Assets"): {
_("Accounts Receivable"): {_("Debtors"): {"account_type": "Receivable"}},
_("Bank Accounts"): {"account_type": "Bank", "is_group": 1},
_("Cash In Hand"): {_("Cash"): {"account_type": "Cash"}, "account_type": "Cash"},
_("Loans and Advances (Assets)"): {
_("Employee Advances"): {},
},
_("Softwares"): {
"account_type": "Fixed Asset"
_("Securities and Deposits"): {_("Earnest Money"): {}},
_("Stock Assets"): {
_("Stock In Hand"): {"account_type": "Stock"},
"account_type": "Stock",
},
_("Accumulated Depreciation"): {
"account_type": "Accumulated Depreciation"
},
_("CWIP Account"): {
"account_type": "Capital Work in Progress",
}
},
_("Investments"): {
"is_group": 1
},
_("Temporary Accounts"): {
_("Temporary Opening"): {
"account_type": "Temporary"
}
},
"root_type": "Asset"
},
_("Expenses"): {
_("Direct Expenses"): {
_("Stock Expenses"): {
_("Cost of Goods Sold"): {
"account_type": "Cost of Goods Sold"
},
_("Expenses Included In Asset Valuation"): {
"account_type": "Expenses Included In Asset Valuation"
},
_("Expenses Included In Valuation"): {
"account_type": "Expenses Included In Valuation"
},
_("Stock Adjustment"): {
"account_type": "Stock Adjustment"
}
},
},
_("Indirect Expenses"): {
_("Administrative Expenses"): {},
_("Commission on Sales"): {},
_("Depreciation"): {
"account_type": "Depreciation"
},
_("Entertainment Expenses"): {},
_("Freight and Forwarding Charges"): {
"account_type": "Chargeable"
},
_("Legal Expenses"): {},
_("Marketing Expenses"): {
"account_type": "Chargeable"
},
_("Miscellaneous Expenses"): {
"account_type": "Chargeable"
},
_("Office Maintenance Expenses"): {},
_("Office Rent"): {},
_("Postal Expenses"): {},
_("Print and Stationery"): {},
_("Round Off"): {
"account_type": "Round Off"
},
_("Salary"): {},
_("Sales Expenses"): {},
_("Telephone Expenses"): {},
_("Travel Expenses"): {},
_("Utility Expenses"): {},
_("Tax Assets"): {"is_group": 1},
},
_("Fixed Assets"): {
_("Capital Equipments"): {"account_type": "Fixed Asset"},
_("Electronic Equipments"): {"account_type": "Fixed Asset"},
_("Furnitures and Fixtures"): {"account_type": "Fixed Asset"},
_("Office Equipments"): {"account_type": "Fixed Asset"},
_("Plants and Machineries"): {"account_type": "Fixed Asset"},
_("Buildings"): {"account_type": "Fixed Asset"},
_("Softwares"): {"account_type": "Fixed Asset"},
_("Accumulated Depreciation"): {"account_type": "Accumulated Depreciation"},
_("CWIP Account"): {
"account_type": "Capital Work in Progress",
},
},
_("Investments"): {"is_group": 1},
_("Temporary Accounts"): {_("Temporary Opening"): {"account_type": "Temporary"}},
"root_type": "Asset",
},
_("Expenses"): {
_("Direct Expenses"): {
_("Stock Expenses"): {
_("Cost of Goods Sold"): {"account_type": "Cost of Goods Sold"},
_("Expenses Included In Asset Valuation"): {
"account_type": "Expenses Included In Asset Valuation"
},
_("Expenses Included In Valuation"): {"account_type": "Expenses Included In Valuation"},
_("Stock Adjustment"): {"account_type": "Stock Adjustment"},
},
},
_("Indirect Expenses"): {
_("Administrative Expenses"): {},
_("Commission on Sales"): {},
_("Depreciation"): {"account_type": "Depreciation"},
_("Entertainment Expenses"): {},
_("Freight and Forwarding Charges"): {"account_type": "Chargeable"},
_("Legal Expenses"): {},
_("Marketing Expenses"): {"account_type": "Chargeable"},
_("Miscellaneous Expenses"): {"account_type": "Chargeable"},
_("Office Maintenance Expenses"): {},
_("Office Rent"): {},
_("Postal Expenses"): {},
_("Print and Stationery"): {},
_("Round Off"): {"account_type": "Round Off"},
_("Salary"): {},
_("Sales Expenses"): {},
_("Telephone Expenses"): {},
_("Travel Expenses"): {},
_("Utility Expenses"): {},
_("Write Off"): {},
_("Exchange Gain/Loss"): {},
_("Gain/Loss on Asset Disposal"): {}
},
"root_type": "Expense"
},
_("Income"): {
_("Direct Income"): {
_("Sales"): {},
_("Service"): {}
},
_("Indirect Income"): {
"is_group": 1
},
"root_type": "Income"
},
_("Source of Funds (Liabilities)"): {
_("Current Liabilities"): {
_("Accounts Payable"): {
_("Creditors"): {
"account_type": "Payable"
},
_("Payroll Payable"): {},
},
_("Stock Liabilities"): {
_("Stock Received But Not Billed"): {
"account_type": "Stock Received But Not Billed"
},
_("Asset Received But Not Billed"): {
"account_type": "Asset Received But Not Billed"
}
},
_("Duties and Taxes"): {
"account_type": "Tax",
"is_group": 1
_("Gain/Loss on Asset Disposal"): {},
},
"root_type": "Expense",
},
_("Income"): {
_("Direct Income"): {_("Sales"): {}, _("Service"): {}},
_("Indirect Income"): {"is_group": 1},
"root_type": "Income",
},
_("Source of Funds (Liabilities)"): {
_("Current Liabilities"): {
_("Accounts Payable"): {
_("Creditors"): {"account_type": "Payable"},
_("Payroll Payable"): {},
},
_("Stock Liabilities"): {
_("Stock Received But Not Billed"): {"account_type": "Stock Received But Not Billed"},
_("Asset Received But Not Billed"): {"account_type": "Asset Received But Not Billed"},
},
_("Duties and Taxes"): {"account_type": "Tax", "is_group": 1},
_("Loans (Liabilities)"): {
_("Secured Loans"): {},
_("Unsecured Loans"): {},
_("Bank Overdraft Account"): {},
},
},
"root_type": "Liability"
},
},
"root_type": "Liability",
},
_("Equity"): {
_("Capital Stock"): {
"account_type": "Equity"
},
_("Dividends Paid"): {
"account_type": "Equity"
},
_("Opening Balance Equity"): {
"account_type": "Equity"
},
_("Retained Earnings"): {
"account_type": "Equity"
},
"root_type": "Equity"
}
_("Capital Stock"): {"account_type": "Equity"},
_("Dividends Paid"): {"account_type": "Equity"},
_("Opening Balance Equity"): {"account_type": "Equity"},
_("Retained Earnings"): {"account_type": "Equity"},
"root_type": "Equity",
},
}

View File

@@ -6,288 +6,153 @@ from frappe import _
def get():
return {
_("Application of Funds (Assets)"): {
_("Current Assets"): {
_("Accounts Receivable"): {
_("Debtors"): {
"account_type": "Receivable",
"account_number": "1310"
},
"account_number": "1300"
},
_("Bank Accounts"): {
"account_type": "Bank",
"is_group": 1,
"account_number": "1200"
},
_("Cash In Hand"): {
_("Cash"): {
"account_type": "Cash",
"account_number": "1110"
},
"account_type": "Cash",
"account_number": "1100"
},
_("Loans and Advances (Assets)"): {
_("Employee Advances"): {
"account_number": "1610"
},
"account_number": "1600"
},
_("Securities and Deposits"): {
_("Earnest Money"): {
"account_number": "1651"
},
"account_number": "1650"
},
_("Stock Assets"): {
_("Stock In Hand"): {
"account_type": "Stock",
"account_number": "1410"
},
"account_type": "Stock",
"account_number": "1400"
},
_("Tax Assets"): {
"is_group": 1,
"account_number": "1500"
},
"account_number": "1100-1600"
},
_("Fixed Assets"): {
_("Capital Equipments"): {
"account_type": "Fixed Asset",
"account_number": "1710"
},
_("Electronic Equipments"): {
"account_type": "Fixed Asset",
"account_number": "1720"
},
_("Furnitures and Fixtures"): {
"account_type": "Fixed Asset",
"account_number": "1730"
},
_("Office Equipments"): {
"account_type": "Fixed Asset",
"account_number": "1740"
},
_("Plants and Machineries"): {
"account_type": "Fixed Asset",
"account_number": "1750"
},
_("Buildings"): {
"account_type": "Fixed Asset",
"account_number": "1760"
},
_("Softwares"): {
"account_type": "Fixed Asset",
"account_number": "1770"
},
_("Accumulated Depreciation"): {
"account_type": "Accumulated Depreciation",
"account_number": "1780"
},
_("CWIP Account"): {
"account_type": "Capital Work in Progress",
"account_number": "1790"
},
"account_number": "1700"
},
_("Investments"): {
"is_group": 1,
"account_number": "1800"
},
_("Temporary Accounts"): {
_("Temporary Opening"): {
"account_type": "Temporary",
"account_number": "1910"
},
"account_number": "1900"
},
"root_type": "Asset",
"account_number": "1000"
},
_("Expenses"): {
_("Direct Expenses"): {
_("Stock Expenses"): {
_("Cost of Goods Sold"): {
"account_type": "Cost of Goods Sold",
"account_number": "5111"
},
_("Expenses Included In Asset Valuation"): {
"account_type": "Expenses Included In Asset Valuation",
"account_number": "5112"
},
_("Expenses Included In Valuation"): {
"account_type": "Expenses Included In Valuation",
"account_number": "5118"
},
_("Stock Adjustment"): {
"account_type": "Stock Adjustment",
"account_number": "5119"
},
"account_number": "5110"
},
"account_number": "5100"
},
_("Indirect Expenses"): {
_("Administrative Expenses"): {
"account_number": "5201"
},
_("Commission on Sales"): {
"account_number": "5202"
},
_("Depreciation"): {
"account_type": "Depreciation",
"account_number": "5203"
},
_("Entertainment Expenses"): {
"account_number": "5204"
},
_("Freight and Forwarding Charges"): {
"account_type": "Chargeable",
"account_number": "5205"
},
_("Legal Expenses"): {
"account_number": "5206"
},
_("Marketing Expenses"): {
"account_type": "Chargeable",
"account_number": "5207"
},
_("Office Maintenance Expenses"): {
"account_number": "5208"
},
_("Office Rent"): {
"account_number": "5209"
},
_("Postal Expenses"): {
"account_number": "5210"
},
_("Print and Stationery"): {
"account_number": "5211"
},
_("Round Off"): {
"account_type": "Round Off",
"account_number": "5212"
},
_("Salary"): {
"account_number": "5213"
},
_("Sales Expenses"): {
"account_number": "5214"
},
_("Telephone Expenses"): {
"account_number": "5215"
},
_("Travel Expenses"): {
"account_number": "5216"
},
_("Utility Expenses"): {
"account_number": "5217"
},
_("Write Off"): {
"account_number": "5218"
},
_("Exchange Gain/Loss"): {
"account_number": "5219"
},
_("Gain/Loss on Asset Disposal"): {
"account_number": "5220"
},
_("Miscellaneous Expenses"): {
"account_type": "Chargeable",
"account_number": "5221"
},
"account_number": "5200"
},
"root_type": "Expense",
"account_number": "5000"
},
_("Income"): {
_("Direct Income"): {
_("Sales"): {
"account_number": "4110"
},
_("Service"): {
"account_number": "4120"
},
"account_number": "4100"
},
_("Indirect Income"): {
"is_group": 1,
"account_number": "4200"
},
"root_type": "Income",
"account_number": "4000"
},
_("Source of Funds (Liabilities)"): {
_("Current Liabilities"): {
_("Accounts Payable"): {
_("Creditors"): {
"account_type": "Payable",
"account_number": "2110"
},
_("Payroll Payable"): {
"account_number": "2120"
},
"account_number": "2100"
},
_("Stock Liabilities"): {
_("Stock Received But Not Billed"): {
"account_type": "Stock Received But Not Billed",
"account_number": "2210"
},
_("Asset Received But Not Billed"): {
"account_type": "Asset Received But Not Billed",
"account_number": "2211"
},
"account_number": "2200"
},
_("Duties and Taxes"): {
_("TDS Payable"): {
"account_number": "2310"
},
"account_type": "Tax",
"is_group": 1,
"account_number": "2300"
},
_("Loans (Liabilities)"): {
_("Secured Loans"): {
"account_number": "2410"
},
_("Unsecured Loans"): {
"account_number": "2420"
},
_("Bank Overdraft Account"): {
"account_number": "2430"
},
"account_number": "2400"
},
"account_number": "2100-2400"
},
"root_type": "Liability",
"account_number": "2000"
},
_("Equity"): {
_("Capital Stock"): {
"account_type": "Equity",
"account_number": "3100"
},
_("Dividends Paid"): {
"account_type": "Equity",
"account_number": "3200"
},
_("Opening Balance Equity"): {
"account_type": "Equity",
"account_number": "3300"
},
_("Retained Earnings"): {
"account_type": "Equity",
"account_number": "3400"
},
"root_type": "Equity",
"account_number": "3000"
}
}
return {
_("Application of Funds (Assets)"): {
_("Current Assets"): {
_("Accounts Receivable"): {
_("Debtors"): {"account_type": "Receivable", "account_number": "1310"},
"account_number": "1300",
},
_("Bank Accounts"): {"account_type": "Bank", "is_group": 1, "account_number": "1200"},
_("Cash In Hand"): {
_("Cash"): {"account_type": "Cash", "account_number": "1110"},
"account_type": "Cash",
"account_number": "1100",
},
_("Loans and Advances (Assets)"): {
_("Employee Advances"): {"account_number": "1610"},
"account_number": "1600",
},
_("Securities and Deposits"): {
_("Earnest Money"): {"account_number": "1651"},
"account_number": "1650",
},
_("Stock Assets"): {
_("Stock In Hand"): {"account_type": "Stock", "account_number": "1410"},
"account_type": "Stock",
"account_number": "1400",
},
_("Tax Assets"): {"is_group": 1, "account_number": "1500"},
"account_number": "1100-1600",
},
_("Fixed Assets"): {
_("Capital Equipments"): {"account_type": "Fixed Asset", "account_number": "1710"},
_("Electronic Equipments"): {"account_type": "Fixed Asset", "account_number": "1720"},
_("Furnitures and Fixtures"): {"account_type": "Fixed Asset", "account_number": "1730"},
_("Office Equipments"): {"account_type": "Fixed Asset", "account_number": "1740"},
_("Plants and Machineries"): {"account_type": "Fixed Asset", "account_number": "1750"},
_("Buildings"): {"account_type": "Fixed Asset", "account_number": "1760"},
_("Softwares"): {"account_type": "Fixed Asset", "account_number": "1770"},
_("Accumulated Depreciation"): {
"account_type": "Accumulated Depreciation",
"account_number": "1780",
},
_("CWIP Account"): {"account_type": "Capital Work in Progress", "account_number": "1790"},
"account_number": "1700",
},
_("Investments"): {"is_group": 1, "account_number": "1800"},
_("Temporary Accounts"): {
_("Temporary Opening"): {"account_type": "Temporary", "account_number": "1910"},
"account_number": "1900",
},
"root_type": "Asset",
"account_number": "1000",
},
_("Expenses"): {
_("Direct Expenses"): {
_("Stock Expenses"): {
_("Cost of Goods Sold"): {"account_type": "Cost of Goods Sold", "account_number": "5111"},
_("Expenses Included In Asset Valuation"): {
"account_type": "Expenses Included In Asset Valuation",
"account_number": "5112",
},
_("Expenses Included In Valuation"): {
"account_type": "Expenses Included In Valuation",
"account_number": "5118",
},
_("Stock Adjustment"): {"account_type": "Stock Adjustment", "account_number": "5119"},
"account_number": "5110",
},
"account_number": "5100",
},
_("Indirect Expenses"): {
_("Administrative Expenses"): {"account_number": "5201"},
_("Commission on Sales"): {"account_number": "5202"},
_("Depreciation"): {"account_type": "Depreciation", "account_number": "5203"},
_("Entertainment Expenses"): {"account_number": "5204"},
_("Freight and Forwarding Charges"): {"account_type": "Chargeable", "account_number": "5205"},
_("Legal Expenses"): {"account_number": "5206"},
_("Marketing Expenses"): {"account_type": "Chargeable", "account_number": "5207"},
_("Office Maintenance Expenses"): {"account_number": "5208"},
_("Office Rent"): {"account_number": "5209"},
_("Postal Expenses"): {"account_number": "5210"},
_("Print and Stationery"): {"account_number": "5211"},
_("Round Off"): {"account_type": "Round Off", "account_number": "5212"},
_("Salary"): {"account_number": "5213"},
_("Sales Expenses"): {"account_number": "5214"},
_("Telephone Expenses"): {"account_number": "5215"},
_("Travel Expenses"): {"account_number": "5216"},
_("Utility Expenses"): {"account_number": "5217"},
_("Write Off"): {"account_number": "5218"},
_("Exchange Gain/Loss"): {"account_number": "5219"},
_("Gain/Loss on Asset Disposal"): {"account_number": "5220"},
_("Miscellaneous Expenses"): {"account_type": "Chargeable", "account_number": "5221"},
"account_number": "5200",
},
"root_type": "Expense",
"account_number": "5000",
},
_("Income"): {
_("Direct Income"): {
_("Sales"): {"account_number": "4110"},
_("Service"): {"account_number": "4120"},
"account_number": "4100",
},
_("Indirect Income"): {"is_group": 1, "account_number": "4200"},
"root_type": "Income",
"account_number": "4000",
},
_("Source of Funds (Liabilities)"): {
_("Current Liabilities"): {
_("Accounts Payable"): {
_("Creditors"): {"account_type": "Payable", "account_number": "2110"},
_("Payroll Payable"): {"account_number": "2120"},
"account_number": "2100",
},
_("Stock Liabilities"): {
_("Stock Received But Not Billed"): {
"account_type": "Stock Received But Not Billed",
"account_number": "2210",
},
_("Asset Received But Not Billed"): {
"account_type": "Asset Received But Not Billed",
"account_number": "2211",
},
"account_number": "2200",
},
_("Duties and Taxes"): {
_("TDS Payable"): {"account_number": "2310"},
"account_type": "Tax",
"is_group": 1,
"account_number": "2300",
},
_("Loans (Liabilities)"): {
_("Secured Loans"): {"account_number": "2410"},
_("Unsecured Loans"): {"account_number": "2420"},
_("Bank Overdraft Account"): {"account_number": "2430"},
"account_number": "2400",
},
"account_number": "2100-2400",
},
"root_type": "Liability",
"account_number": "2000",
},
_("Equity"): {
_("Capital Stock"): {"account_type": "Equity", "account_number": "3100"},
_("Dividends Paid"): {"account_type": "Equity", "account_number": "3200"},
_("Opening Balance Equity"): {"account_type": "Equity", "account_number": "3300"},
_("Retained Earnings"): {"account_type": "Equity", "account_number": "3400"},
"root_type": "Equity",
"account_number": "3000",
},
}

View File

@@ -20,8 +20,9 @@ class TestAccount(unittest.TestCase):
acc.company = "_Test Company"
acc.insert()
account_number, account_name = frappe.db.get_value("Account", "1210 - Debtors - _TC",
["account_number", "account_name"])
account_number, account_name = frappe.db.get_value(
"Account", "1210 - Debtors - _TC", ["account_number", "account_name"]
)
self.assertEqual(account_number, "1210")
self.assertEqual(account_name, "Debtors")
@@ -30,8 +31,12 @@ class TestAccount(unittest.TestCase):
update_account_number("1210 - Debtors - _TC", new_account_name, new_account_number)
new_acc = frappe.db.get_value("Account", "1211-11-4 - 6 - - Debtors 1 - Test - - _TC",
["account_name", "account_number"], as_dict=1)
new_acc = frappe.db.get_value(
"Account",
"1211-11-4 - 6 - - Debtors 1 - Test - - _TC",
["account_name", "account_number"],
as_dict=1,
)
self.assertEqual(new_acc.account_name, "Debtors 1 - Test -")
self.assertEqual(new_acc.account_number, "1211-11-4 - 6 -")
@@ -79,7 +84,9 @@ class TestAccount(unittest.TestCase):
self.assertEqual(parent, "Securities and Deposits - _TC")
merge_account("Securities and Deposits - _TC", "Cash In Hand - _TC", doc.is_group, doc.root_type, doc.company)
merge_account(
"Securities and Deposits - _TC", "Cash In Hand - _TC", doc.is_group, doc.root_type, doc.company
)
parent = frappe.db.get_value("Account", "Earnest Money - _TC", "parent_account")
# Parent account of the child account changes after merging
@@ -91,14 +98,28 @@ class TestAccount(unittest.TestCase):
doc = frappe.get_doc("Account", "Current Assets - _TC")
# Raise error as is_group property doesn't match
self.assertRaises(frappe.ValidationError, merge_account, "Current Assets - _TC",\
"Accumulated Depreciation - _TC", doc.is_group, doc.root_type, doc.company)
self.assertRaises(
frappe.ValidationError,
merge_account,
"Current Assets - _TC",
"Accumulated Depreciation - _TC",
doc.is_group,
doc.root_type,
doc.company,
)
doc = frappe.get_doc("Account", "Capital Stock - _TC")
# Raise error as root_type property doesn't match
self.assertRaises(frappe.ValidationError, merge_account, "Capital Stock - _TC",\
"Softwares - _TC", doc.is_group, doc.root_type, doc.company)
self.assertRaises(
frappe.ValidationError,
merge_account,
"Capital Stock - _TC",
"Softwares - _TC",
doc.is_group,
doc.root_type,
doc.company,
)
def test_account_sync(self):
frappe.local.flags.pop("ignore_root_company_validation", None)
@@ -109,8 +130,12 @@ class TestAccount(unittest.TestCase):
acc.company = "_Test Company 3"
acc.insert()
acc_tc_4 = frappe.db.get_value('Account', {'account_name': "Test Sync Account", "company": "_Test Company 4"})
acc_tc_5 = frappe.db.get_value('Account', {'account_name': "Test Sync Account", "company": "_Test Company 5"})
acc_tc_4 = frappe.db.get_value(
"Account", {"account_name": "Test Sync Account", "company": "_Test Company 4"}
)
acc_tc_5 = frappe.db.get_value(
"Account", {"account_name": "Test Sync Account", "company": "_Test Company 5"}
)
self.assertEqual(acc_tc_4, "Test Sync Account - _TC4")
self.assertEqual(acc_tc_5, "Test Sync Account - _TC5")
@@ -138,8 +163,26 @@ class TestAccount(unittest.TestCase):
update_account_number(acc.name, "Test Rename Sync Account", "1234")
# Check if renamed in children
self.assertTrue(frappe.db.exists("Account", {'account_name': "Test Rename Sync Account", "company": "_Test Company 4", "account_number": "1234"}))
self.assertTrue(frappe.db.exists("Account", {'account_name': "Test Rename Sync Account", "company": "_Test Company 5", "account_number": "1234"}))
self.assertTrue(
frappe.db.exists(
"Account",
{
"account_name": "Test Rename Sync Account",
"company": "_Test Company 4",
"account_number": "1234",
},
)
)
self.assertTrue(
frappe.db.exists(
"Account",
{
"account_name": "Test Rename Sync Account",
"company": "_Test Company 5",
"account_number": "1234",
},
)
)
frappe.delete_doc("Account", "1234 - Test Rename Sync Account - _TC3")
frappe.delete_doc("Account", "1234 - Test Rename Sync Account - _TC4")
@@ -155,25 +198,71 @@ class TestAccount(unittest.TestCase):
acc.company = "_Test Company 3"
acc.insert()
self.assertTrue(frappe.db.exists("Account", {'account_name': "Test Group Account", "company": "_Test Company 4"}))
self.assertTrue(frappe.db.exists("Account", {'account_name': "Test Group Account", "company": "_Test Company 5"}))
self.assertTrue(
frappe.db.exists(
"Account", {"account_name": "Test Group Account", "company": "_Test Company 4"}
)
)
self.assertTrue(
frappe.db.exists(
"Account", {"account_name": "Test Group Account", "company": "_Test Company 5"}
)
)
# Try renaming child company account
acc_tc_5 = frappe.db.get_value('Account', {'account_name': "Test Group Account", "company": "_Test Company 5"})
self.assertRaises(frappe.ValidationError, update_account_number, acc_tc_5, "Test Modified Account")
acc_tc_5 = frappe.db.get_value(
"Account", {"account_name": "Test Group Account", "company": "_Test Company 5"}
)
self.assertRaises(
frappe.ValidationError, update_account_number, acc_tc_5, "Test Modified Account"
)
# Rename child company account with allow_account_creation_against_child_company enabled
frappe.db.set_value("Company", "_Test Company 5", "allow_account_creation_against_child_company", 1)
frappe.db.set_value(
"Company", "_Test Company 5", "allow_account_creation_against_child_company", 1
)
update_account_number(acc_tc_5, "Test Modified Account")
self.assertTrue(frappe.db.exists("Account", {'name': "Test Modified Account - _TC5", "company": "_Test Company 5"}))
self.assertTrue(
frappe.db.exists(
"Account", {"name": "Test Modified Account - _TC5", "company": "_Test Company 5"}
)
)
frappe.db.set_value("Company", "_Test Company 5", "allow_account_creation_against_child_company", 0)
frappe.db.set_value(
"Company", "_Test Company 5", "allow_account_creation_against_child_company", 0
)
to_delete = ["Test Group Account - _TC3", "Test Group Account - _TC4", "Test Modified Account - _TC5"]
to_delete = [
"Test Group Account - _TC3",
"Test Group Account - _TC4",
"Test Modified Account - _TC5",
]
for doc in to_delete:
frappe.delete_doc("Account", doc)
def test_validate_account_currency(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
if not frappe.db.get_value("Account", "Test Currency Account - _TC"):
acc = frappe.new_doc("Account")
acc.account_name = "Test Currency Account"
acc.parent_account = "Tax Assets - _TC"
acc.company = "_Test Company"
acc.insert()
else:
acc = frappe.get_doc("Account", "Test Currency Account - _TC")
self.assertEqual(acc.account_currency, "INR")
# Make a JV against this account
make_journal_entry(
"Test Currency Account - _TC", "Miscellaneous Expenses - _TC", 100, submit=True
)
acc.account_currency = "USD"
self.assertRaises(frappe.ValidationError, acc.save)
def _make_test_records(verbose=None):
from frappe.test_runner import make_test_objects
@@ -184,20 +273,16 @@ def _make_test_records(verbose=None):
["_Test Bank USD", "Bank Accounts", 0, "Bank", "USD"],
["_Test Bank EUR", "Bank Accounts", 0, "Bank", "EUR"],
["_Test Cash", "Cash In Hand", 0, "Cash", None],
["_Test Account Stock Expenses", "Direct Expenses", 1, None, None],
["_Test Account Shipping Charges", "_Test Account Stock Expenses", 0, "Chargeable", None],
["_Test Account Customs Duty", "_Test Account Stock Expenses", 0, "Tax", None],
["_Test Account Insurance Charges", "_Test Account Stock Expenses", 0, "Chargeable", None],
["_Test Account Stock Adjustment", "_Test Account Stock Expenses", 0, "Stock Adjustment", None],
["_Test Employee Advance", "Current Liabilities", 0, None, None],
["_Test Account Tax Assets", "Current Assets", 1, None, None],
["_Test Account VAT", "_Test Account Tax Assets", 0, "Tax", None],
["_Test Account Service Tax", "_Test Account Tax Assets", 0, "Tax", None],
["_Test Account Reserves and Surplus", "Current Liabilities", 0, None, None],
["_Test Account Cost for Goods Sold", "Expenses", 0, None, None],
["_Test Account Excise Duty", "_Test Account Tax Assets", 0, "Tax", None],
["_Test Account Education Cess", "_Test Account Tax Assets", 0, "Tax", None],
@@ -206,38 +291,45 @@ def _make_test_records(verbose=None):
["_Test Account Discount", "Direct Expenses", 0, None, None],
["_Test Write Off", "Indirect Expenses", 0, None, None],
["_Test Exchange Gain/Loss", "Indirect Expenses", 0, None, None],
["_Test Account Sales", "Direct Income", 0, None, None],
# related to Account Inventory Integration
["_Test Account Stock In Hand", "Current Assets", 0, None, None],
# fixed asset depreciation
["_Test Fixed Asset", "Current Assets", 0, "Fixed Asset", None],
["_Test Accumulated Depreciations", "Current Assets", 0, "Accumulated Depreciation", None],
["_Test Depreciations", "Expenses", 0, None, None],
["_Test Gain/Loss on Asset Disposal", "Expenses", 0, None, None],
# Receivable / Payable Account
["_Test Receivable", "Current Assets", 0, "Receivable", None],
["_Test Payable", "Current Liabilities", 0, "Payable", None],
["_Test Receivable USD", "Current Assets", 0, "Receivable", "USD"],
["_Test Payable USD", "Current Liabilities", 0, "Payable", "USD"]
["_Test Payable USD", "Current Liabilities", 0, "Payable", "USD"],
]
for company, abbr in [["_Test Company", "_TC"], ["_Test Company 1", "_TC1"], ["_Test Company with perpetual inventory", "TCP1"]]:
test_objects = make_test_objects("Account", [{
"doctype": "Account",
"account_name": account_name,
"parent_account": parent_account + " - " + abbr,
"company": company,
"is_group": is_group,
"account_type": account_type,
"account_currency": currency
} for account_name, parent_account, is_group, account_type, currency in accounts])
for company, abbr in [
["_Test Company", "_TC"],
["_Test Company 1", "_TC1"],
["_Test Company with perpetual inventory", "TCP1"],
]:
test_objects = make_test_objects(
"Account",
[
{
"doctype": "Account",
"account_name": account_name,
"parent_account": parent_account + " - " + abbr,
"company": company,
"is_group": is_group,
"account_type": account_type,
"account_currency": currency,
}
for account_name, parent_account, is_group, account_type, currency in accounts
],
)
return test_objects
def get_inventory_account(company, warehouse=None):
account = None
if warehouse:
@@ -247,19 +339,24 @@ def get_inventory_account(company, warehouse=None):
return account
def create_account(**kwargs):
account = frappe.db.get_value("Account", filters={"account_name": kwargs.get("account_name"), "company": kwargs.get("company")})
account = frappe.db.get_value(
"Account", filters={"account_name": kwargs.get("account_name"), "company": kwargs.get("company")}
)
if account:
return account
else:
account = frappe.get_doc(dict(
doctype = "Account",
account_name = kwargs.get('account_name'),
account_type = kwargs.get('account_type'),
parent_account = kwargs.get('parent_account'),
company = kwargs.get('company'),
account_currency = kwargs.get('account_currency')
))
account = frappe.get_doc(
dict(
doctype="Account",
account_name=kwargs.get("account_name"),
account_type=kwargs.get("account_type"),
parent_account=kwargs.get("parent_account"),
company=kwargs.get("company"),
account_currency=kwargs.get("account_currency"),
)
)
account.save()
return account.name

View File

@@ -17,13 +17,21 @@ class AccountingDimension(Document):
self.set_fieldname_and_label()
def validate(self):
if self.document_type in core_doctypes_list + ('Accounting Dimension', 'Project',
'Cost Center', 'Accounting Dimension Detail', 'Company', 'Account') :
if self.document_type in core_doctypes_list + (
"Accounting Dimension",
"Project",
"Cost Center",
"Accounting Dimension Detail",
"Company",
"Account",
):
msg = _("Not allowed to create accounting dimension for {0}").format(self.document_type)
frappe.throw(msg)
exists = frappe.db.get_value("Accounting Dimension", {'document_type': self.document_type}, ['name'])
exists = frappe.db.get_value(
"Accounting Dimension", {"document_type": self.document_type}, ["name"]
)
if exists and self.is_new():
frappe.throw(_("Document Type already used as a dimension"))
@@ -42,13 +50,13 @@ class AccountingDimension(Document):
if frappe.flags.in_test:
make_dimension_in_accounting_doctypes(doc=self)
else:
frappe.enqueue(make_dimension_in_accounting_doctypes, doc=self, queue='long')
frappe.enqueue(make_dimension_in_accounting_doctypes, doc=self, queue="long")
def on_trash(self):
if frappe.flags.in_test:
delete_accounting_dimension(doc=self)
else:
frappe.enqueue(delete_accounting_dimension, doc=self, queue='long')
frappe.enqueue(delete_accounting_dimension, doc=self, queue="long")
def set_fieldname_and_label(self):
if not self.label:
@@ -60,6 +68,7 @@ class AccountingDimension(Document):
def on_update(self):
frappe.flags.accounting_dimensions = None
def make_dimension_in_accounting_doctypes(doc, doclist=None):
if not doclist:
doclist = get_doctypes_with_dimensions()
@@ -70,9 +79,9 @@ def make_dimension_in_accounting_doctypes(doc, doclist=None):
for doctype in doclist:
if (doc_count + 1) % 2 == 0:
insert_after_field = 'dimension_col_break'
insert_after_field = "dimension_col_break"
else:
insert_after_field = 'accounting_dimensions_section'
insert_after_field = "accounting_dimensions_section"
df = {
"fieldname": doc.fieldname,
@@ -80,30 +89,33 @@ def make_dimension_in_accounting_doctypes(doc, doclist=None):
"fieldtype": "Link",
"options": doc.document_type,
"insert_after": insert_after_field,
"owner": "Administrator"
"owner": "Administrator",
}
meta = frappe.get_meta(doctype, cached=False)
fieldnames = [d.fieldname for d in meta.get("fields")]
if df['fieldname'] not in fieldnames:
if df["fieldname"] not in fieldnames:
if doctype == "Budget":
add_dimension_to_budget_doctype(df.copy(), doc)
else:
create_custom_field(doctype, df)
create_custom_field(doctype, df, ignore_validate=True)
count += 1
frappe.publish_progress(count*100/len(doclist), title = _("Creating Dimensions..."))
frappe.publish_progress(count * 100 / len(doclist), title=_("Creating Dimensions..."))
frappe.clear_cache(doctype=doctype)
def add_dimension_to_budget_doctype(df, doc):
df.update({
"insert_after": "cost_center",
"depends_on": "eval:doc.budget_against == '{0}'".format(doc.document_type)
})
create_custom_field("Budget", df)
def add_dimension_to_budget_doctype(df, doc):
df.update(
{
"insert_after": "cost_center",
"depends_on": "eval:doc.budget_against == '{0}'".format(doc.document_type),
}
)
create_custom_field("Budget", df, ignore_validate=True)
property_setter = frappe.db.exists("Property Setter", "Budget-budget_against-options")
@@ -112,36 +124,44 @@ def add_dimension_to_budget_doctype(df, doc):
property_setter_doc.value = property_setter_doc.value + "\n" + doc.document_type
property_setter_doc.save()
frappe.clear_cache(doctype='Budget')
frappe.clear_cache(doctype="Budget")
else:
frappe.get_doc({
"doctype": "Property Setter",
"doctype_or_field": "DocField",
"doc_type": "Budget",
"field_name": "budget_against",
"property": "options",
"property_type": "Text",
"value": "\nCost Center\nProject\n" + doc.document_type
}).insert(ignore_permissions=True)
frappe.get_doc(
{
"doctype": "Property Setter",
"doctype_or_field": "DocField",
"doc_type": "Budget",
"field_name": "budget_against",
"property": "options",
"property_type": "Text",
"value": "\nCost Center\nProject\n" + doc.document_type,
}
).insert(ignore_permissions=True)
def delete_accounting_dimension(doc):
doclist = get_doctypes_with_dimensions()
frappe.db.sql("""
frappe.db.sql(
"""
DELETE FROM `tabCustom Field`
WHERE fieldname = %s
AND dt IN (%s)""" % #nosec
('%s', ', '.join(['%s']* len(doclist))), tuple([doc.fieldname] + doclist))
AND dt IN (%s)"""
% ("%s", ", ".join(["%s"] * len(doclist))), # nosec
tuple([doc.fieldname] + doclist),
)
frappe.db.sql("""
frappe.db.sql(
"""
DELETE FROM `tabProperty Setter`
WHERE field_name = %s
AND doc_type IN (%s)""" % #nosec
('%s', ', '.join(['%s']* len(doclist))), tuple([doc.fieldname] + doclist))
AND doc_type IN (%s)"""
% ("%s", ", ".join(["%s"] * len(doclist))), # nosec
tuple([doc.fieldname] + doclist),
)
budget_against_property = frappe.get_doc("Property Setter", "Budget-budget_against-options")
value_list = budget_against_property.value.split('\n')[3:]
value_list = budget_against_property.value.split("\n")[3:]
if doc.document_type in value_list:
value_list.remove(doc.document_type)
@@ -152,6 +172,7 @@ def delete_accounting_dimension(doc):
for doctype in doclist:
frappe.clear_cache(doctype=doctype)
@frappe.whitelist()
def disable_dimension(doc):
if frappe.flags.in_test:
@@ -159,10 +180,11 @@ def disable_dimension(doc):
else:
frappe.enqueue(toggle_disabling, doc=doc)
def toggle_disabling(doc):
doc = json.loads(doc)
if doc.get('disabled'):
if doc.get("disabled"):
df = {"read_only": 1}
else:
df = {"read_only": 0}
@@ -170,7 +192,7 @@ def toggle_disabling(doc):
doclist = get_doctypes_with_dimensions()
for doctype in doclist:
field = frappe.db.get_value("Custom Field", {"dt": doctype, "fieldname": doc.get('fieldname')})
field = frappe.db.get_value("Custom Field", {"dt": doctype, "fieldname": doc.get("fieldname")})
if field:
custom_field = frappe.get_doc("Custom Field", field)
custom_field.update(df)
@@ -178,61 +200,82 @@ def toggle_disabling(doc):
frappe.clear_cache(doctype=doctype)
def get_doctypes_with_dimensions():
return frappe.get_hooks("accounting_dimension_doctypes")
def get_accounting_dimensions(as_list=True):
def get_accounting_dimensions(as_list=True, filters=None):
if not filters:
filters = {"disabled": 0}
if frappe.flags.accounting_dimensions is None:
frappe.flags.accounting_dimensions = frappe.get_all("Accounting Dimension",
fields=["label", "fieldname", "disabled", "document_type"])
frappe.flags.accounting_dimensions = frappe.get_all(
"Accounting Dimension",
fields=["label", "fieldname", "disabled", "document_type"],
filters=filters,
)
if as_list:
return [d.fieldname for d in frappe.flags.accounting_dimensions]
else:
return frappe.flags.accounting_dimensions
def get_checks_for_pl_and_bs_accounts():
dimensions = frappe.db.sql("""SELECT p.label, p.disabled, p.fieldname, c.default_dimension, c.company, c.mandatory_for_pl, c.mandatory_for_bs
dimensions = frappe.db.sql(
"""SELECT p.label, p.disabled, p.fieldname, c.default_dimension, c.company, c.mandatory_for_pl, c.mandatory_for_bs
FROM `tabAccounting Dimension`p ,`tabAccounting Dimension Detail` c
WHERE p.name = c.parent""", as_dict=1)
WHERE p.name = c.parent""",
as_dict=1,
)
return dimensions
def get_dimension_with_children(doctype, dimension):
if isinstance(dimension, list):
dimension = dimension[0]
def get_dimension_with_children(doctype, dimensions):
if isinstance(dimensions, str):
dimensions = [dimensions]
all_dimensions = []
lft, rgt = frappe.db.get_value(doctype, dimension, ["lft", "rgt"])
children = frappe.get_all(doctype, filters={"lft": [">=", lft], "rgt": ["<=", rgt]}, order_by="lft")
all_dimensions += [c.name for c in children]
for dimension in dimensions:
lft, rgt = frappe.db.get_value(doctype, dimension, ["lft", "rgt"])
children = frappe.get_all(
doctype, filters={"lft": [">=", lft], "rgt": ["<=", rgt]}, order_by="lft"
)
all_dimensions += [c.name for c in children]
return all_dimensions
@frappe.whitelist()
def get_dimensions(with_cost_center_and_project=False):
dimension_filters = frappe.db.sql("""
dimension_filters = frappe.db.sql(
"""
SELECT label, fieldname, document_type
FROM `tabAccounting Dimension`
WHERE disabled = 0
""", as_dict=1)
""",
as_dict=1,
)
default_dimensions = frappe.db.sql("""SELECT p.fieldname, c.company, c.default_dimension
default_dimensions = frappe.db.sql(
"""SELECT p.fieldname, c.company, c.default_dimension
FROM `tabAccounting Dimension Detail` c, `tabAccounting Dimension` p
WHERE c.parent = p.name""", as_dict=1)
WHERE c.parent = p.name""",
as_dict=1,
)
if with_cost_center_and_project:
dimension_filters.extend([
{
'fieldname': 'cost_center',
'document_type': 'Cost Center'
},
{
'fieldname': 'project',
'document_type': 'Project'
}
])
dimension_filters.extend(
[
{"fieldname": "cost_center", "document_type": "Cost Center"},
{"fieldname": "project", "document_type": "Project"},
]
)
default_dimensions_map = {}
for dimension in default_dimensions:

View File

@@ -8,7 +8,8 @@ import frappe
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
test_dependencies = ['Cost Center', 'Location', 'Warehouse', 'Department']
test_dependencies = ["Cost Center", "Location", "Warehouse", "Department"]
class TestAccountingDimension(unittest.TestCase):
def setUp(self):
@@ -18,24 +19,27 @@ class TestAccountingDimension(unittest.TestCase):
si = create_sales_invoice(do_not_save=1)
si.location = "Block 1"
si.append("items", {
"item_code": "_Test Item",
"warehouse": "_Test Warehouse - _TC",
"qty": 1,
"rate": 100,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"department": "_Test Department - _TC",
"location": "Block 1"
})
si.append(
"items",
{
"item_code": "_Test Item",
"warehouse": "_Test Warehouse - _TC",
"qty": 1,
"rate": 100,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"department": "_Test Department - _TC",
"location": "Block 1",
},
)
si.save()
si.submit()
gle = frappe.get_doc("GL Entry", {"voucher_no": si.name, "account": "Sales - _TC"})
self.assertEqual(gle.get('department'), "_Test Department - _TC")
self.assertEqual(gle.get("department"), "_Test Department - _TC")
def test_dimension_against_journal_entry(self):
je = make_journal_entry("Sales - _TC", "Sales Expenses - _TC", 500, save=False)
@@ -50,21 +54,24 @@ class TestAccountingDimension(unittest.TestCase):
gle = frappe.get_doc("GL Entry", {"voucher_no": je.name, "account": "Sales - _TC"})
gle1 = frappe.get_doc("GL Entry", {"voucher_no": je.name, "account": "Sales Expenses - _TC"})
self.assertEqual(gle.get('department'), "_Test Department - _TC")
self.assertEqual(gle1.get('department'), "_Test Department - _TC")
self.assertEqual(gle.get("department"), "_Test Department - _TC")
self.assertEqual(gle1.get("department"), "_Test Department - _TC")
def test_mandatory(self):
si = create_sales_invoice(do_not_save=1)
si.append("items", {
"item_code": "_Test Item",
"warehouse": "_Test Warehouse - _TC",
"qty": 1,
"rate": 100,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"location": ""
})
si.append(
"items",
{
"item_code": "_Test Item",
"warehouse": "_Test Warehouse - _TC",
"qty": 1,
"rate": 100,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"location": "",
},
)
si.save()
self.assertRaises(frappe.ValidationError, si.submit)
@@ -72,31 +79,39 @@ class TestAccountingDimension(unittest.TestCase):
def tearDown(self):
disable_dimension()
def create_dimension():
frappe.set_user("Administrator")
if not frappe.db.exists("Accounting Dimension", {"document_type": "Department"}):
frappe.get_doc({
"doctype": "Accounting Dimension",
"document_type": "Department",
}).insert()
frappe.get_doc(
{
"doctype": "Accounting Dimension",
"document_type": "Department",
}
).insert()
else:
dimension = frappe.get_doc("Accounting Dimension", "Department")
dimension.disabled = 0
dimension.save()
if not frappe.db.exists("Accounting Dimension", {"document_type": "Location"}):
dimension1 = frappe.get_doc({
"doctype": "Accounting Dimension",
"document_type": "Location",
})
dimension1 = frappe.get_doc(
{
"doctype": "Accounting Dimension",
"document_type": "Location",
}
)
dimension1.append("dimension_defaults", {
"company": "_Test Company",
"reference_document": "Location",
"default_dimension": "Block 1",
"mandatory_for_bs": 1
})
dimension1.append(
"dimension_defaults",
{
"company": "_Test Company",
"reference_document": "Location",
"default_dimension": "Block 1",
"mandatory_for_bs": 1,
},
)
dimension1.insert()
dimension1.save()
@@ -105,6 +120,7 @@ def create_dimension():
dimension1.disabled = 0
dimension1.save()
def disable_dimension():
dimension1 = frappe.get_doc("Accounting Dimension", "Department")
dimension1.disabled = 1

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

@@ -19,17 +19,27 @@ class AccountingDimensionFilter(Document):
WHERE d.name = a.parent
and d.name != %s
and d.accounting_dimension = %s
""", (self.name, self.accounting_dimension), as_dict=1)
""",
(self.name, self.accounting_dimension),
as_dict=1,
)
account_list = [d.account for d in accounts]
for account in self.get('accounts'):
for account in self.get("accounts"):
if account.applicable_on_account in account_list:
frappe.throw(_("Row {0}: {1} account already applied for Accounting Dimension {2}").format(
account.idx, frappe.bold(account.applicable_on_account), frappe.bold(self.accounting_dimension)))
frappe.throw(
_("Row {0}: {1} account already applied for Accounting Dimension {2}").format(
account.idx,
frappe.bold(account.applicable_on_account),
frappe.bold(self.accounting_dimension),
)
)
def get_dimension_filter_map():
filters = frappe.db.sql("""
filters = frappe.db.sql(
"""
SELECT
a.applicable_on_account, d.dimension_value, p.accounting_dimension,
p.allow_or_restrict, a.is_mandatory
@@ -40,22 +50,30 @@ def get_dimension_filter_map():
p.name = a.parent
AND p.disabled = 0
AND p.name = d.parent
""", as_dict=1)
""",
as_dict=1,
)
dimension_filter_map = {}
for f in filters:
f.fieldname = scrub(f.accounting_dimension)
build_map(dimension_filter_map, f.fieldname, f.applicable_on_account, f.dimension_value,
f.allow_or_restrict, f.is_mandatory)
build_map(
dimension_filter_map,
f.fieldname,
f.applicable_on_account,
f.dimension_value,
f.allow_or_restrict,
f.is_mandatory,
)
return dimension_filter_map
def build_map(map_object, dimension, account, filter_value, allow_or_restrict, is_mandatory):
map_object.setdefault((dimension, account), {
'allowed_dimensions': [],
'is_mandatory': is_mandatory,
'allow_or_restrict': allow_or_restrict
})
map_object[(dimension, account)]['allowed_dimensions'].append(filter_value)
map_object.setdefault(
(dimension, account),
{"allowed_dimensions": [], "is_mandatory": is_mandatory, "allow_or_restrict": allow_or_restrict},
)
map_object[(dimension, account)]["allowed_dimensions"].append(filter_value)

View File

@@ -12,7 +12,8 @@ from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension imp
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.exceptions import InvalidAccountDimensionError, MandatoryAccountDimensionError
test_dependencies = ['Location', 'Cost Center', 'Department']
test_dependencies = ["Location", "Cost Center", "Department"]
class TestAccountingDimensionFilter(unittest.TestCase):
def setUp(self):
@@ -22,9 +23,9 @@ class TestAccountingDimensionFilter(unittest.TestCase):
def test_allowed_dimension_validation(self):
si = create_sales_invoice(do_not_save=1)
si.items[0].cost_center = 'Main - _TC'
si.department = 'Accounts - _TC'
si.location = 'Block 1'
si.items[0].cost_center = "Main - _TC"
si.department = "Accounts - _TC"
si.location = "Block 1"
si.save()
self.assertRaises(InvalidAccountDimensionError, si.submit)
@@ -32,12 +33,12 @@ class TestAccountingDimensionFilter(unittest.TestCase):
def test_mandatory_dimension_validation(self):
si = create_sales_invoice(do_not_save=1)
si.department = ''
si.location = 'Block 1'
si.department = ""
si.location = "Block 1"
# Test with no department for Sales Account
si.items[0].department = ''
si.items[0].cost_center = '_Test Cost Center 2 - _TC'
si.items[0].department = ""
si.items[0].cost_center = "_Test Cost Center 2 - _TC"
si.save()
self.assertRaises(MandatoryAccountDimensionError, si.submit)
@@ -52,53 +53,54 @@ class TestAccountingDimensionFilter(unittest.TestCase):
if si.docstatus == 1:
si.cancel()
def create_accounting_dimension_filter():
if not frappe.db.get_value('Accounting Dimension Filter',
{'accounting_dimension': 'Cost Center'}):
frappe.get_doc({
'doctype': 'Accounting Dimension Filter',
'accounting_dimension': 'Cost Center',
'allow_or_restrict': 'Allow',
'company': '_Test Company',
'accounts': [{
'applicable_on_account': 'Sales - _TC',
}],
'dimensions': [{
'accounting_dimension': 'Cost Center',
'dimension_value': '_Test Cost Center 2 - _TC'
}]
}).insert()
if not frappe.db.get_value(
"Accounting Dimension Filter", {"accounting_dimension": "Cost Center"}
):
frappe.get_doc(
{
"doctype": "Accounting Dimension Filter",
"accounting_dimension": "Cost Center",
"allow_or_restrict": "Allow",
"company": "_Test Company",
"accounts": [
{
"applicable_on_account": "Sales - _TC",
}
],
"dimensions": [
{"accounting_dimension": "Cost Center", "dimension_value": "_Test Cost Center 2 - _TC"}
],
}
).insert()
else:
doc = frappe.get_doc('Accounting Dimension Filter', {'accounting_dimension': 'Cost Center'})
doc = frappe.get_doc("Accounting Dimension Filter", {"accounting_dimension": "Cost Center"})
doc.disabled = 0
doc.save()
if not frappe.db.get_value('Accounting Dimension Filter',
{'accounting_dimension': 'Department'}):
frappe.get_doc({
'doctype': 'Accounting Dimension Filter',
'accounting_dimension': 'Department',
'allow_or_restrict': 'Allow',
'company': '_Test Company',
'accounts': [{
'applicable_on_account': 'Sales - _TC',
'is_mandatory': 1
}],
'dimensions': [{
'accounting_dimension': 'Department',
'dimension_value': 'Accounts - _TC'
}]
}).insert()
if not frappe.db.get_value("Accounting Dimension Filter", {"accounting_dimension": "Department"}):
frappe.get_doc(
{
"doctype": "Accounting Dimension Filter",
"accounting_dimension": "Department",
"allow_or_restrict": "Allow",
"company": "_Test Company",
"accounts": [{"applicable_on_account": "Sales - _TC", "is_mandatory": 1}],
"dimensions": [{"accounting_dimension": "Department", "dimension_value": "Accounts - _TC"}],
}
).insert()
else:
doc = frappe.get_doc('Accounting Dimension Filter', {'accounting_dimension': 'Department'})
doc = frappe.get_doc("Accounting Dimension Filter", {"accounting_dimension": "Department"})
doc.disabled = 0
doc.save()
def disable_dimension_filter():
doc = frappe.get_doc('Accounting Dimension Filter', {'accounting_dimension': 'Cost Center'})
doc = frappe.get_doc("Accounting Dimension Filter", {"accounting_dimension": "Cost Center"})
doc.disabled = 1
doc.save()
doc = frappe.get_doc('Accounting Dimension Filter', {'accounting_dimension': 'Department'})
doc = frappe.get_doc("Accounting Dimension Filter", {"accounting_dimension": "Department"})
doc.disabled = 1
doc.save()

View File

@@ -7,7 +7,9 @@ from frappe import _
from frappe.model.document import Document
class OverlapError(frappe.ValidationError): pass
class OverlapError(frappe.ValidationError):
pass
class AccountingPeriod(Document):
def validate(self):
@@ -17,11 +19,12 @@ class AccountingPeriod(Document):
self.bootstrap_doctypes_for_closing()
def autoname(self):
company_abbr = frappe.get_cached_value('Company', self.company, "abbr")
company_abbr = frappe.get_cached_value("Company", self.company, "abbr")
self.name = " - ".join([self.period_name, company_abbr])
def validate_overlap(self):
existing_accounting_period = frappe.db.sql("""select name from `tabAccounting Period`
existing_accounting_period = frappe.db.sql(
"""select name from `tabAccounting Period`
where (
(%(start_date)s between start_date and end_date)
or (%(end_date)s between start_date and end_date)
@@ -32,18 +35,23 @@ class AccountingPeriod(Document):
"start_date": self.start_date,
"end_date": self.end_date,
"name": self.name,
"company": self.company
}, as_dict=True)
"company": self.company,
},
as_dict=True,
)
if len(existing_accounting_period) > 0:
frappe.throw(_("Accounting Period overlaps with {0}")
.format(existing_accounting_period[0].get("name")), OverlapError)
frappe.throw(
_("Accounting Period overlaps with {0}").format(existing_accounting_period[0].get("name")),
OverlapError,
)
@frappe.whitelist()
def get_doctypes_for_closing(self):
docs_for_closing = []
doctypes = ["Sales Invoice", "Purchase Invoice", "Journal Entry", "Payroll Entry", \
"Bank Clearance", "Asset", "Stock Entry"]
# get period closing doctypes from all the apps
doctypes = frappe.get_hooks("period_closing_doctypes")
closed_doctypes = [{"document_type": doctype, "closed": 1} for doctype in doctypes]
for closed_doctype in closed_doctypes:
docs_for_closing.append(closed_doctype)
@@ -53,7 +61,7 @@ class AccountingPeriod(Document):
def bootstrap_doctypes_for_closing(self):
if len(self.closed_documents) == 0:
for doctype_for_closing in self.get_doctypes_for_closing():
self.append('closed_documents', {
"document_type": doctype_for_closing.document_type,
"closed": doctype_for_closing.closed
})
self.append(
"closed_documents",
{"document_type": doctype_for_closing.document_type, "closed": doctype_for_closing.closed},
)

View File

@@ -10,29 +10,38 @@ from erpnext.accounts.doctype.accounting_period.accounting_period import Overlap
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.general_ledger import ClosedAccountingPeriod
test_dependencies = ['Item']
test_dependencies = ["Item"]
class TestAccountingPeriod(unittest.TestCase):
def test_overlap(self):
ap1 = create_accounting_period(start_date = "2018-04-01",
end_date = "2018-06-30", company = "Wind Power LLC")
ap1 = create_accounting_period(
start_date="2018-04-01", end_date="2018-06-30", company="Wind Power LLC"
)
ap1.save()
ap2 = create_accounting_period(start_date = "2018-06-30",
end_date = "2018-07-10", company = "Wind Power LLC", period_name = "Test Accounting Period 1")
ap2 = create_accounting_period(
start_date="2018-06-30",
end_date="2018-07-10",
company="Wind Power LLC",
period_name="Test Accounting Period 1",
)
self.assertRaises(OverlapError, ap2.save)
def test_accounting_period(self):
ap1 = create_accounting_period(period_name = "Test Accounting Period 2")
ap1 = create_accounting_period(period_name="Test Accounting Period 2")
ap1.save()
doc = create_sales_invoice(do_not_submit=1, cost_center="_Test Company - _TC", warehouse="Stores - _TC")
doc = create_sales_invoice(
do_not_submit=1, cost_center="_Test Company - _TC", warehouse="Stores - _TC"
)
self.assertRaises(ClosedAccountingPeriod, doc.submit)
def tearDown(self):
for d in frappe.get_all("Accounting Period"):
frappe.delete_doc("Accounting Period", d.name)
def create_accounting_period(**args):
args = frappe._dict(args)
@@ -41,8 +50,6 @@ def create_accounting_period(**args):
accounting_period.end_date = args.end_date or add_months(nowdate(), 1)
accounting_period.company = args.company or "_Test Company"
accounting_period.period_name = args.period_name or "_Test_Period_Name_1"
accounting_period.append("closed_documents", {
"document_type": 'Sales Invoice', "closed": 1
})
accounting_period.append("closed_documents", {"document_type": "Sales Invoice", "closed": 1})
return accounting_period

View File

@@ -18,7 +18,7 @@
"automatically_fetch_payment_terms",
"column_break_17",
"enable_common_party_accounting",
"enable_discount_accounting",
"allow_multi_currency_invoices_against_single_party_account",
"report_setting_section",
"use_custom_cash_flow",
"deferred_accounting_settings_section",
@@ -91,7 +91,7 @@
},
{
"default": "0",
"description": "Enabling ensure each Sales Invoice has a unique value in Supplier Invoice No. field",
"description": "Enabling ensure each Purchase Invoice has a unique value in Supplier Invoice No. field",
"fieldname": "check_supplier_invoice_uniqueness",
"fieldtype": "Check",
"label": "Check Supplier Invoice Number Uniqueness"
@@ -272,13 +272,6 @@
"fieldtype": "Check",
"label": "Create Ledger Entries for Change Amount"
},
{
"default": "0",
"description": "If enabled, additional ledger entries will be made for discounts in a separate Discount Account",
"fieldname": "enable_discount_accounting",
"fieldtype": "Check",
"label": "Enable Discount Accounting"
},
{
"default": "0",
"description": "Learn about <a href=\"https://docs.erpnext.com/docs/v13/user/manual/en/accounts/articles/common_party_accounting#:~:text=Common%20Party%20Accounting%20in%20ERPNext,Invoice%20against%20a%20primary%20Supplier.\">Common Party</a>",
@@ -347,6 +340,13 @@
"fieldname": "report_setting_section",
"fieldtype": "Section Break",
"label": "Report Setting"
},
{
"default": "0",
"description": "Enabling this will allow creation of multi-currency invoices against single party account in company currency",
"fieldname": "allow_multi_currency_invoices_against_single_party_account",
"fieldtype": "Check",
"label": "Allow multi-currency invoices against single party account "
}
],
"icon": "icon-cog",
@@ -354,7 +354,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2022-02-04 12:32:36.805652",
"modified": "2022-11-27 21:49:52.538655",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -18,48 +18,38 @@ class AccountsSettings(Document):
frappe.clear_cache()
def validate(self):
frappe.db.set_default("add_taxes_from_item_tax_template",
self.get("add_taxes_from_item_tax_template", 0))
frappe.db.set_default(
"add_taxes_from_item_tax_template", self.get("add_taxes_from_item_tax_template", 0)
)
frappe.db.set_default("enable_common_party_accounting",
self.get("enable_common_party_accounting", 0))
frappe.db.set_default(
"enable_common_party_accounting", self.get("enable_common_party_accounting", 0)
)
self.validate_stale_days()
self.enable_payment_schedule_in_print()
self.toggle_discount_accounting_fields()
self.validate_pending_reposts()
def validate_stale_days(self):
if not self.allow_stale and cint(self.stale_days) <= 0:
frappe.msgprint(
_("Stale Days should start from 1."), title='Error', indicator='red',
raise_exception=1)
_("Stale Days should start from 1."), title="Error", indicator="red", raise_exception=1
)
def enable_payment_schedule_in_print(self):
show_in_print = cint(self.show_payment_schedule_in_print)
for doctype in ("Sales Order", "Sales Invoice", "Purchase Order", "Purchase Invoice"):
make_property_setter(doctype, "due_date", "print_hide", show_in_print, "Check", validate_fields_for_doctype=False)
make_property_setter(doctype, "payment_schedule", "print_hide", 0 if show_in_print else 1, "Check", validate_fields_for_doctype=False)
def toggle_discount_accounting_fields(self):
enable_discount_accounting = cint(self.enable_discount_accounting)
for doctype in ["Sales Invoice Item", "Purchase Invoice Item"]:
make_property_setter(doctype, "discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
if enable_discount_accounting:
make_property_setter(doctype, "discount_account", "mandatory_depends_on", "eval: doc.discount_amount", "Code", validate_fields_for_doctype=False)
else:
make_property_setter(doctype, "discount_account", "mandatory_depends_on", "", "Code", validate_fields_for_doctype=False)
for doctype in ["Sales Invoice", "Purchase Invoice"]:
make_property_setter(doctype, "additional_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
if enable_discount_accounting:
make_property_setter(doctype, "additional_discount_account", "mandatory_depends_on", "eval: doc.discount_amount", "Code", validate_fields_for_doctype=False)
else:
make_property_setter(doctype, "additional_discount_account", "mandatory_depends_on", "", "Code", validate_fields_for_doctype=False)
make_property_setter("Item", "default_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
make_property_setter(
doctype, "due_date", "print_hide", show_in_print, "Check", validate_fields_for_doctype=False
)
make_property_setter(
doctype,
"payment_schedule",
"print_hide",
0 if show_in_print else 1,
"Check",
validate_fields_for_doctype=False,
)
def validate_pending_reposts(self):
if self.acc_frozen_upto:

View File

@@ -7,12 +7,12 @@ class TestAccountsSettings(unittest.TestCase):
def tearDown(self):
# Just in case `save` method succeeds, we need to take things back to default so that other tests
# don't break
cur_settings = frappe.get_doc('Accounts Settings', 'Accounts Settings')
cur_settings = frappe.get_doc("Accounts Settings", "Accounts Settings")
cur_settings.allow_stale = 1
cur_settings.save()
def test_stale_days(self):
cur_settings = frappe.get_doc('Accounts Settings', 'Accounts Settings')
cur_settings = frappe.get_doc("Accounts Settings", "Accounts Settings")
cur_settings.allow_stale = 0
cur_settings.stale_days = 0

View File

@@ -15,4 +15,4 @@ class Bank(Document):
load_address_and_contact(self)
def on_trash(self):
delete_contact_and_address('Bank', self.name)
delete_contact_and_address("Bank", self.name)

View File

@@ -3,11 +3,6 @@ from frappe import _
def get_data():
return {
'fieldname': 'bank',
'transactions': [
{
'label': _('Bank Details'),
'items': ['Bank Account', 'Bank Guarantee']
}
]
"fieldname": "bank",
"transactions": [{"label": _("Bank Details"), "items": ["Bank Account", "Bank Guarantee"]}],
}

View File

@@ -27,7 +27,6 @@
"bank_account_no",
"address_and_contact",
"address_html",
"website",
"column_break_13",
"contact_html",
"integration_details_section",
@@ -156,11 +155,6 @@
"fieldtype": "HTML",
"label": "Address HTML"
},
{
"fieldname": "website",
"fieldtype": "Data",
"label": "Website"
},
{
"fieldname": "column_break_13",
"fieldtype": "Column Break"
@@ -208,7 +202,7 @@
}
],
"links": [],
"modified": "2020-10-23 16:48:06.303658",
"modified": "2022-05-04 15:49:42.620630",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Account",
@@ -243,5 +237,6 @@
"search_fields": "bank,account",
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -20,7 +20,7 @@ class BankAccount(Document):
self.name = self.account_name + " - " + self.bank
def on_trash(self):
delete_contact_and_address('BankAccount', self.name)
delete_contact_and_address("BankAccount", self.name)
def validate(self):
self.validate_company()
@@ -31,9 +31,9 @@ class BankAccount(Document):
frappe.throw(_("Company is manadatory for company account"))
def validate_iban(self):
'''
"""
Algorithm: https://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN
'''
"""
# IBAN field is optional
if not self.iban:
return
@@ -43,7 +43,7 @@ class BankAccount(Document):
return str(9 + ord(c) - 64)
# remove whitespaces, upper case to get the right number from ord()
iban = ''.join(self.iban.split(' ')).upper()
iban = "".join(self.iban.split(" ")).upper()
# Move country code and checksum from the start to the end
flipped = iban[4:] + iban[:4]
@@ -52,12 +52,12 @@ class BankAccount(Document):
encoded = [encode_char(c) if ord(c) >= 65 and ord(c) <= 90 else c for c in flipped]
try:
to_check = int(''.join(encoded))
to_check = int("".join(encoded))
except ValueError:
frappe.throw(_('IBAN is not valid'))
frappe.throw(_("IBAN is not valid"))
if to_check % 97 != 1:
frappe.throw(_('IBAN is not valid'))
frappe.throw(_("IBAN is not valid"))
@frappe.whitelist()
@@ -69,12 +69,14 @@ def make_bank_account(doctype, docname):
return doc
@frappe.whitelist()
def get_party_bank_account(party_type, party):
return frappe.db.get_value(party_type,
party, 'default_bank_account')
return frappe.db.get_value(party_type, party, "default_bank_account")
@frappe.whitelist()
def get_bank_account_details(bank_account):
return frappe.db.get_value("Bank Account",
bank_account, ['account', 'bank', 'bank_account_no'], as_dict=1)
return frappe.db.get_value(
"Bank Account", bank_account, ["account", "bank", "bank_account_no"], as_dict=1
)

View File

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

View File

@@ -8,28 +8,28 @@ from frappe import ValidationError
# test_records = frappe.get_test_records('Bank Account')
class TestBankAccount(unittest.TestCase):
class TestBankAccount(unittest.TestCase):
def test_validate_iban(self):
valid_ibans = [
'GB82 WEST 1234 5698 7654 32',
'DE91 1000 0000 0123 4567 89',
'FR76 3000 6000 0112 3456 7890 189'
"GB82 WEST 1234 5698 7654 32",
"DE91 1000 0000 0123 4567 89",
"FR76 3000 6000 0112 3456 7890 189",
]
invalid_ibans = [
# wrong checksum (3rd place)
'GB72 WEST 1234 5698 7654 32',
'DE81 1000 0000 0123 4567 89',
'FR66 3000 6000 0112 3456 7890 189'
"GB72 WEST 1234 5698 7654 32",
"DE81 1000 0000 0123 4567 89",
"FR66 3000 6000 0112 3456 7890 189",
]
bank_account = frappe.get_doc({'doctype':'Bank Account'})
bank_account = frappe.get_doc({"doctype": "Bank Account"})
try:
bank_account.validate_iban()
except AttributeError:
msg = 'BankAccount.validate_iban() failed for empty IBAN'
msg = "BankAccount.validate_iban() failed for empty IBAN"
self.fail(msg=msg)
for iban in valid_ibans:
@@ -37,11 +37,11 @@ class TestBankAccount(unittest.TestCase):
try:
bank_account.validate_iban()
except ValidationError:
msg = 'BankAccount.validate_iban() failed for valid IBAN {}'.format(iban)
msg = "BankAccount.validate_iban() failed for valid IBAN {}".format(iban)
self.fail(msg=msg)
for not_iban in invalid_ibans:
bank_account.iban = not_iban
msg = 'BankAccount.validate_iban() accepted invalid IBAN {}'.format(not_iban)
msg = "BankAccount.validate_iban() accepted invalid IBAN {}".format(not_iban)
with self.assertRaises(ValidationError, msg=msg):
bank_account.validate_iban()

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());
@@ -27,6 +37,14 @@ frappe.ui.form.on("Bank Clearance", {
refresh: function(frm) {
frm.disable_save();
if (frm.doc.account && frm.doc.from_date && frm.doc.to_date) {
frm.add_custom_button(__('Get Payment Entries'), () =>
frm.trigger("get_payment_entries")
);
frm.change_custom_button_type('Get Payment Entries', null, 'primary');
}
},
update_clearance_date: function(frm) {
@@ -36,22 +54,30 @@ frappe.ui.form.on("Bank Clearance", {
callback: function(r, rt) {
frm.refresh_field("payment_entries");
frm.refresh_fields();
if (!frm.doc.payment_entries.length) {
frm.change_custom_button_type('Get Payment Entries', null, 'primary');
frm.change_custom_button_type('Update Clearance Date', null, 'default');
}
}
});
},
get_payment_entries: function(frm) {
return frappe.call({
method: "get_payment_entries",
doc: frm.doc,
callback: function(r, rt) {
frm.refresh_field("payment_entries");
frm.refresh_fields();
$(frm.fields_dict.payment_entries.wrapper).find("[data-fieldname=amount]").each(function(i,v){
if (i !=0){
$(v).addClass("text-right")
}
})
if (frm.doc.payment_entries.length) {
frm.add_custom_button(__('Update Clearance Date'), () =>
frm.trigger("update_clearance_date")
);
frm.change_custom_button_type('Get Payment Entries', null, 'default');
frm.change_custom_button_type('Update Clearance Date', null, 'primary');
}
}
});
}

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"allow_copy": 1,
"creation": "2013-01-10 16:34:05",
"doctype": "DocType",
@@ -13,11 +14,8 @@
"bank_account",
"include_reconciled_entries",
"include_pos_transactions",
"get_payment_entries",
"section_break_10",
"payment_entries",
"update_clearance_date",
"total_amount"
"payment_entries"
],
"fields": [
{
@@ -76,11 +74,6 @@
"fieldtype": "Check",
"label": "Include POS Transactions"
},
{
"fieldname": "get_payment_entries",
"fieldtype": "Button",
"label": "Get Payment Entries"
},
{
"fieldname": "section_break_10",
"fieldtype": "Section Break"
@@ -91,25 +84,14 @@
"fieldtype": "Table",
"label": "Payment Entries",
"options": "Bank Clearance Detail"
},
{
"fieldname": "update_clearance_date",
"fieldtype": "Button",
"label": "Update Clearance Date"
},
{
"fieldname": "total_amount",
"fieldtype": "Currency",
"label": "Total Amount",
"options": "account_currency",
"read_only": 1
}
],
"hide_toolbar": 1,
"icon": "fa fa-check",
"idx": 1,
"issingle": 1,
"modified": "2020-04-06 16:12:06.628008",
"links": [],
"modified": "2022-11-28 17:24:13.008692",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Clearance",
@@ -126,5 +108,6 @@
"quick_entry": 1,
"read_only": 1,
"sort_field": "modified",
"sort_order": "ASC"
"sort_order": "ASC",
"states": []
}

View File

@@ -5,11 +5,13 @@
import frappe
from frappe import _, msgprint
from frappe.model.document import Document
from frappe.utils import flt, fmt_money, getdate, nowdate
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt, fmt_money, getdate
import erpnext
form_grid_templates = {"journal_entries": "templates/form_grid/bank_reconciliation_grid.html"}
form_grid_templates = {
"journal_entries": "templates/form_grid/bank_reconciliation_grid.html"
}
class BankClearance(Document):
@frappe.whitelist()
@@ -24,7 +26,8 @@ class BankClearance(Document):
if not self.include_reconciled_entries:
condition = "and (clearance_date IS NULL or clearance_date='0000-00-00')"
journal_entries = frappe.db.sql("""
journal_entries = frappe.db.sql(
"""
select
"Journal Entry" as payment_document, t1.name as payment_entry,
t1.cheque_no as cheque_number, t1.cheque_date,
@@ -38,12 +41,18 @@ class BankClearance(Document):
and ifnull(t1.is_opening, 'No') = 'No' {condition}
group by t2.account, t1.name
order by t1.posting_date ASC, t1.name DESC
""".format(condition=condition), {"account": self.account, "from": self.from_date, "to": self.to_date}, as_dict=1)
""".format(
condition=condition
),
{"account": self.account, "from": self.from_date, "to": self.to_date},
as_dict=1,
)
if self.bank_account:
condition += 'and bank_account = %(bank_account)s'
condition += "and bank_account = %(bank_account)s"
payment_entries = frappe.db.sql("""
payment_entries = frappe.db.sql(
"""
select
"Payment Entry" as payment_document, name as payment_entry,
reference_no as cheque_number, reference_date as cheque_date,
@@ -58,12 +67,75 @@ class BankClearance(Document):
{condition}
order by
posting_date ASC, name DESC
""".format(condition=condition), {"account": self.account, "from":self.from_date,
"to": self.to_date, "bank_account": self.bank_account}, as_dict=1)
""".format(
condition=condition
),
{
"account": self.account,
"from": self.from_date,
"to": self.to_date,
"bank_account": self.bank_account,
},
as_dict=1,
)
loan_disbursement = frappe.qb.DocType("Loan Disbursement")
loan_disbursements = (
frappe.qb.from_(loan_disbursement)
.select(
ConstantColumn("Loan Disbursement").as_("payment_document"),
loan_disbursement.name.as_("payment_entry"),
loan_disbursement.disbursed_amount.as_("credit"),
ConstantColumn(0).as_("debit"),
loan_disbursement.reference_number.as_("cheque_number"),
loan_disbursement.reference_date.as_("cheque_date"),
loan_disbursement.disbursement_date.as_("posting_date"),
loan_disbursement.applicant.as_("against_account"),
)
.where(loan_disbursement.docstatus == 1)
.where(loan_disbursement.disbursement_date >= self.from_date)
.where(loan_disbursement.disbursement_date <= self.to_date)
.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, order=frappe.qb.desc)
).run(as_dict=1)
loan_repayment = frappe.qb.DocType("Loan Repayment")
query = (
frappe.qb.from_(loan_repayment)
.select(
ConstantColumn("Loan Repayment").as_("payment_document"),
loan_repayment.name.as_("payment_entry"),
loan_repayment.amount_paid.as_("debit"),
ConstantColumn(0).as_("credit"),
loan_repayment.reference_number.as_("cheque_number"),
loan_repayment.reference_date.as_("cheque_date"),
loan_repayment.applicant.as_("against_account"),
loan_repayment.posting_date,
)
.where(loan_repayment.docstatus == 1)
.where(loan_repayment.clearance_date.isnull())
.where(loan_repayment.posting_date >= self.from_date)
.where(loan_repayment.posting_date <= self.to_date)
.where(loan_repayment.payment_account.isin([self.bank_account, self.account]))
)
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, order=frappe.qb.desc
)
loan_repayments = query.run(as_dict=True)
pos_sales_invoices, pos_purchase_invoices = [], []
if self.include_pos_transactions:
pos_sales_invoices = frappe.db.sql("""
pos_sales_invoices = frappe.db.sql(
"""
select
"Sales Invoice Payment" as payment_document, sip.name as payment_entry, sip.amount as debit,
si.posting_date, si.customer as against_account, sip.clearance_date,
@@ -74,9 +146,13 @@ class BankClearance(Document):
and account.name = sip.account and si.posting_date >= %(from)s and si.posting_date <= %(to)s
order by
si.posting_date ASC, si.name DESC
""", {"account":self.account, "from":self.from_date, "to":self.to_date}, as_dict=1)
""",
{"account": self.account, "from": self.from_date, "to": self.to_date},
as_dict=1,
)
pos_purchase_invoices = frappe.db.sql("""
pos_purchase_invoices = frappe.db.sql(
"""
select
"Purchase Invoice" as payment_document, pi.name as payment_entry, pi.paid_amount as credit,
pi.posting_date, pi.supplier as against_account, pi.clearance_date,
@@ -87,46 +163,62 @@ class BankClearance(Document):
and pi.posting_date >= %(from)s and pi.posting_date <= %(to)s
order by
pi.posting_date ASC, pi.name DESC
""", {"account": self.account, "from": self.from_date, "to": self.to_date}, as_dict=1)
""",
{"account": self.account, "from": self.from_date, "to": self.to_date},
as_dict=1,
)
entries = sorted(list(payment_entries) + list(journal_entries + list(pos_sales_invoices) + list(pos_purchase_invoices)),
key=lambda k: k['posting_date'] or getdate(nowdate()))
entries = sorted(
list(payment_entries)
+ list(journal_entries)
+ list(pos_sales_invoices)
+ list(pos_purchase_invoices)
+ list(loan_disbursements)
+ list(loan_repayments),
key=lambda k: getdate(k["posting_date"]),
)
self.set('payment_entries', [])
self.total_amount = 0.0
self.set("payment_entries", [])
default_currency = erpnext.get_default_currency()
for d in entries:
row = self.append('payment_entries', {})
row = self.append("payment_entries", {})
amount = flt(d.get('debit', 0)) - flt(d.get('credit', 0))
amount = flt(d.get("debit", 0)) - flt(d.get("credit", 0))
if not d.get("account_currency"):
d.account_currency = default_currency
formatted_amount = fmt_money(abs(amount), 2, d.account_currency)
d.amount = formatted_amount + " " + (_("Dr") if amount > 0 else _("Cr"))
d.posting_date = getdate(d.posting_date)
d.pop("credit")
d.pop("debit")
d.pop("account_currency")
row.update(d)
self.total_amount += flt(amount)
@frappe.whitelist()
def update_clearance_date(self):
clearance_date_updated = False
for d in self.get('payment_entries'):
for d in self.get("payment_entries"):
if d.clearance_date:
if not d.payment_document:
frappe.throw(_("Row #{0}: Payment document is required to complete the transaction"))
if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date):
frappe.throw(_("Row #{0}: Clearance date {1} cannot be before Cheque Date {2}")
.format(d.idx, d.clearance_date, d.cheque_date))
frappe.throw(
_("Row #{0}: Clearance date {1} cannot be before Cheque Date {2}").format(
d.idx, d.clearance_date, d.cheque_date
)
)
if d.clearance_date or self.include_reconciled_entries:
if not d.clearance_date:
d.clearance_date = None
payment_entry = frappe.get_doc(d.payment_document, d.payment_entry)
payment_entry.db_set('clearance_date', d.clearance_date)
payment_entry.db_set("clearance_date", d.clearance_date)
clearance_date_updated = True

View File

@@ -1,9 +1,96 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
import frappe
from frappe.utils import add_months, getdate
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.loan_management.doctype.loan.test_loan import (
create_loan,
create_loan_accounts,
create_loan_type,
create_repayment_entry,
make_loan_disbursement_entry,
)
class TestBankClearance(unittest.TestCase):
pass
@classmethod
def setUpClass(cls):
make_bank_account()
create_loan_accounts()
create_loan_masters()
add_transactions()
# Basic test case to test if bank clearance tool doesn't break
# Detailed test can be added later
def test_bank_clearance(self):
bank_clearance = frappe.get_doc("Bank Clearance")
bank_clearance.account = "_Test Bank Clearance - _TC"
bank_clearance.from_date = add_months(getdate(), -1)
bank_clearance.to_date = getdate()
bank_clearance.get_payment_entries()
self.assertEqual(len(bank_clearance.payment_entries), 3)
def make_bank_account():
if not frappe.db.get_value("Account", "_Test Bank Clearance - _TC"):
frappe.get_doc(
{
"doctype": "Account",
"account_type": "Bank",
"account_name": "_Test Bank Clearance",
"company": "_Test Company",
"parent_account": "Bank Accounts - _TC",
}
).insert()
def create_loan_masters():
create_loan_type(
"Clearance Loan",
2000000,
13.5,
25,
0,
5,
"Cash",
"_Test Bank Clearance - _TC",
"_Test Bank Clearance - _TC",
"Loan Account - _TC",
"Interest Income Account - _TC",
"Penalty Income Account - _TC",
)
def add_transactions():
make_payment_entry()
make_loan()
def make_loan():
loan = create_loan(
"_Test Customer",
"Clearance Loan",
280000,
"Repay Over Number of Periods",
20,
applicant_type="Customer",
)
loan.submit()
make_loan_disbursement_entry(loan.name, loan.loan_amount, disbursement_date=getdate())
repayment_entry = create_repayment_entry(loan.name, "_Test Customer", getdate(), loan.loan_amount)
repayment_entry.save()
repayment_entry.submit()
def make_payment_entry():
pi = make_purchase_invoice(supplier="_Test Supplier", qty=1, rate=690)
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank Clearance - _TC")
pe.reference_no = "Conrad Oct 18"
pe.reference_date = "2018-10-24"
pe.insert()
pe.submit()

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
@@ -23,10 +20,20 @@ class BankGuarantee(Document):
if not self.bank:
frappe.throw(_("Enter the name of the bank or lending institution before submittting."))
@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

@@ -10,7 +10,6 @@ from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt
from erpnext import get_company_currency
from erpnext.accounts.doctype.bank_transaction.bank_transaction import get_paid_amount
from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_statement import (
get_amounts_not_reflected_in_system,
@@ -22,48 +21,63 @@ from erpnext.accounts.utils import get_balance_on
class BankReconciliationTool(Document):
pass
@frappe.whitelist()
def get_bank_transactions(bank_account, from_date = None, to_date = None):
def get_bank_transactions(bank_account, from_date=None, to_date=None):
# returns bank transactions for a bank account
filters = []
filters.append(['bank_account', '=', bank_account])
filters.append(['docstatus', '=', 1])
filters.append(['unallocated_amount', '>', 0])
filters.append(["bank_account", "=", bank_account])
filters.append(["docstatus", "=", 1])
filters.append(["unallocated_amount", ">", 0])
if to_date:
filters.append(['date', '<=', to_date])
filters.append(["date", "<=", to_date])
if from_date:
filters.append(['date', '>=', from_date])
filters.append(["date", ">=", from_date])
transactions = frappe.get_all(
'Bank Transaction',
fields = ['date', 'deposit', 'withdrawal', 'currency',
'description', 'name', 'bank_account', 'company',
'unallocated_amount', 'reference_number', 'party_type', 'party'],
filters = filters
"Bank Transaction",
fields=[
"date",
"deposit",
"withdrawal",
"currency",
"description",
"name",
"bank_account",
"company",
"unallocated_amount",
"reference_number",
"party_type",
"party",
],
filters=filters,
)
return transactions
@frappe.whitelist()
def get_account_balance(bank_account, till_date):
# returns account balance till the specified date
account = frappe.db.get_value('Bank Account', bank_account, 'account')
filters = frappe._dict({
"account": account,
"report_date": till_date,
"include_pos_transactions": 1
})
account = frappe.db.get_value("Bank Account", bank_account, "account")
filters = frappe._dict(
{"account": account, "report_date": till_date, "include_pos_transactions": 1}
)
data = get_entries(filters)
balance_as_per_system = get_balance_on(filters["account"], filters["report_date"])
total_debit, total_credit = 0,0
total_debit, total_credit = 0, 0
for d in data:
total_debit += flt(d.debit)
total_credit += flt(d.credit)
amounts_not_reflected_in_system = get_amounts_not_reflected_in_system(filters)
bank_bal = flt(balance_as_per_system) - flt(total_debit) + flt(total_credit) \
bank_bal = (
flt(balance_as_per_system)
- flt(total_debit)
+ flt(total_credit)
+ amounts_not_reflected_in_system
)
return bank_bal
@@ -76,71 +90,94 @@ def update_bank_transaction(bank_transaction_name, reference_number, party_type=
bank_transaction.party_type = party_type
bank_transaction.party = party
bank_transaction.save()
return frappe.db.get_all('Bank Transaction',
filters={
'name': bank_transaction_name
},
fields=['date', 'deposit', 'withdrawal', 'currency',
'description', 'name', 'bank_account', 'company',
'unallocated_amount', 'reference_number',
'party_type', 'party'],
return frappe.db.get_all(
"Bank Transaction",
filters={"name": bank_transaction_name},
fields=[
"date",
"deposit",
"withdrawal",
"currency",
"description",
"name",
"bank_account",
"company",
"unallocated_amount",
"reference_number",
"party_type",
"party",
],
)[0]
@frappe.whitelist()
def create_journal_entry_bts( bank_transaction_name, reference_number=None, reference_date=None, posting_date=None, entry_type=None,
second_account=None, mode_of_payment=None, party_type=None, party=None, allow_edit=None):
def create_journal_entry_bts(
bank_transaction_name,
reference_number=None,
reference_date=None,
posting_date=None,
entry_type=None,
second_account=None,
mode_of_payment=None,
party_type=None,
party=None,
allow_edit=None,
):
# Create a new journal entry based on the bank transaction
bank_transaction = frappe.db.get_values(
"Bank Transaction", bank_transaction_name,
fieldname=["name", "deposit", "withdrawal", "bank_account"] ,
as_dict=True
"Bank Transaction",
bank_transaction_name,
fieldname=["name", "deposit", "withdrawal", "bank_account"],
as_dict=True,
)[0]
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
account_type = frappe.db.get_value("Account", second_account, "account_type")
if account_type in ["Receivable", "Payable"]:
if not (party_type and party):
frappe.throw(_("Party Type and Party is required for Receivable / Payable account {0}").format( second_account))
frappe.throw(
_("Party Type and Party is required for Receivable / Payable account {0}").format(
second_account
)
)
accounts = []
# Multi Currency?
accounts.append({
accounts.append(
{
"account": second_account,
"credit_in_account_currency": bank_transaction.deposit
if bank_transaction.deposit > 0
else 0,
"debit_in_account_currency":bank_transaction.withdrawal
if bank_transaction.withdrawal > 0
else 0,
"party_type":party_type,
"party":party,
})
"credit_in_account_currency": bank_transaction.deposit if bank_transaction.deposit > 0 else 0,
"debit_in_account_currency": bank_transaction.withdrawal
if bank_transaction.withdrawal > 0
else 0,
"party_type": party_type,
"party": party,
}
)
accounts.append({
accounts.append(
{
"account": company_account,
"bank_account": bank_transaction.bank_account,
"credit_in_account_currency": bank_transaction.withdrawal
if bank_transaction.withdrawal > 0
else 0,
"debit_in_account_currency":bank_transaction.deposit
if bank_transaction.deposit > 0
else 0,
})
if bank_transaction.withdrawal > 0
else 0,
"debit_in_account_currency": bank_transaction.deposit if bank_transaction.deposit > 0 else 0,
}
)
company = frappe.get_value("Account", company_account, "company")
journal_entry_dict = {
"voucher_type" : entry_type,
"company" : company,
"posting_date" : posting_date,
"cheque_date" : reference_date,
"cheque_no" : reference_number,
"mode_of_payment" : mode_of_payment
"voucher_type": entry_type,
"company": company,
"posting_date": posting_date,
"cheque_date": reference_date,
"cheque_no": reference_number,
"mode_of_payment": mode_of_payment,
}
journal_entry = frappe.new_doc('Journal Entry')
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.update(journal_entry_dict)
journal_entry.set("accounts", accounts)
if allow_edit:
return journal_entry
@@ -152,21 +189,32 @@ def create_journal_entry_bts( bank_transaction_name, reference_number=None, refe
else:
paid_amount = bank_transaction.withdrawal
vouchers = json.dumps([{
"payment_doctype":"Journal Entry",
"payment_name":journal_entry.name,
"amount":paid_amount}])
vouchers = json.dumps(
[{"payment_doctype": "Journal Entry", "payment_name": journal_entry.name, "amount": paid_amount}]
)
return reconcile_vouchers(bank_transaction.name, vouchers)
@frappe.whitelist()
def create_payment_entry_bts( bank_transaction_name, reference_number=None, reference_date=None, party_type=None, party=None, posting_date=None,
mode_of_payment=None, project=None, cost_center=None, allow_edit=None):
def create_payment_entry_bts(
bank_transaction_name,
reference_number=None,
reference_date=None,
party_type=None,
party=None,
posting_date=None,
mode_of_payment=None,
project=None,
cost_center=None,
allow_edit=None,
):
# Create a new payment entry based on the bank transaction
bank_transaction = frappe.db.get_values(
"Bank Transaction", bank_transaction_name,
fieldname=["name", "unallocated_amount", "deposit", "bank_account"] ,
as_dict=True
"Bank Transaction",
bank_transaction_name,
fieldname=["name", "unallocated_amount", "deposit", "bank_account"],
as_dict=True,
)[0]
paid_amount = bank_transaction.unallocated_amount
payment_type = "Receive" if bank_transaction.deposit > 0 else "Pay"
@@ -174,27 +222,26 @@ def create_payment_entry_bts( bank_transaction_name, reference_number=None, refe
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
company = frappe.get_value("Account", company_account, "company")
payment_entry_dict = {
"company" : company,
"payment_type" : payment_type,
"reference_no" : reference_number,
"reference_date" : reference_date,
"party_type" : party_type,
"party" : party,
"posting_date" : posting_date,
"company": company,
"payment_type": payment_type,
"reference_no": reference_number,
"reference_date": reference_date,
"party_type": party_type,
"party": party,
"posting_date": posting_date,
"paid_amount": paid_amount,
"received_amount": paid_amount
"received_amount": paid_amount,
}
payment_entry = frappe.new_doc("Payment Entry")
payment_entry.update(payment_entry_dict)
if mode_of_payment:
payment_entry.mode_of_payment = mode_of_payment
payment_entry.mode_of_payment = mode_of_payment
if project:
payment_entry.project = project
payment_entry.project = project
if cost_center:
payment_entry.cost_center = cost_center
payment_entry.cost_center = cost_center
if payment_type == "Receive":
payment_entry.paid_to = company_account
else:
@@ -208,84 +255,111 @@ def create_payment_entry_bts( bank_transaction_name, reference_number=None, refe
payment_entry.insert()
payment_entry.submit()
vouchers = json.dumps([{
"payment_doctype":"Payment Entry",
"payment_name":payment_entry.name,
"amount":paid_amount}])
vouchers = json.dumps(
[{"payment_doctype": "Payment Entry", "payment_name": payment_entry.name, "amount": paid_amount}]
)
return reconcile_vouchers(bank_transaction.name, vouchers)
@frappe.whitelist()
def reconcile_vouchers(bank_transaction_name, vouchers):
# updated clear date of all the vouchers based on the bank transaction
vouchers = json.loads(vouchers)
transaction = frappe.get_doc("Bank Transaction", bank_transaction_name)
company_account = frappe.db.get_value('Bank Account', transaction.bank_account, 'account')
company_account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
if transaction.unallocated_amount == 0:
frappe.throw(_("This bank transaction is already fully reconciled"))
total_amount = 0
for voucher in vouchers:
voucher['payment_entry'] = frappe.get_doc(voucher['payment_doctype'], voucher['payment_name'])
total_amount += get_paid_amount(frappe._dict({
'payment_document': voucher['payment_doctype'],
'payment_entry': voucher['payment_name'],
}), transaction.currency, company_account)
voucher["payment_entry"] = frappe.get_doc(voucher["payment_doctype"], voucher["payment_name"])
total_amount += get_paid_amount(
frappe._dict(
{
"payment_document": voucher["payment_doctype"],
"payment_entry": voucher["payment_name"],
}
),
transaction.currency,
company_account,
)
if total_amount > transaction.unallocated_amount:
frappe.throw(_("The Sum Total of Amounts of All Selected Vouchers Should be Less than the Unallocated Amount of the Bank Transaction"))
frappe.throw(
_(
"The sum total of amounts of all selected vouchers should be less than the unallocated amount of the bank transaction"
)
)
account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
for voucher in vouchers:
gl_entry = frappe.db.get_value("GL Entry", dict(account=account, voucher_type=voucher['payment_doctype'], voucher_no=voucher['payment_name']), ['credit', 'debit'], as_dict=1)
gl_amount, transaction_amount = (gl_entry.credit, transaction.deposit) if gl_entry.credit > 0 else (gl_entry.debit, transaction.withdrawal)
gl_entry = frappe.db.get_value(
"GL Entry",
dict(
account=account, voucher_type=voucher["payment_doctype"], voucher_no=voucher["payment_name"]
),
["credit", "debit"],
as_dict=1,
)
gl_amount, transaction_amount = (
(gl_entry.credit, transaction.deposit)
if gl_entry.credit > 0
else (gl_entry.debit, transaction.withdrawal)
)
allocated_amount = gl_amount if gl_amount >= transaction_amount else transaction_amount
transaction.append("payment_entries", {
"payment_document": voucher['payment_entry'].doctype,
"payment_entry": voucher['payment_entry'].name,
"allocated_amount": allocated_amount
})
transaction.append(
"payment_entries",
{
"payment_document": voucher["payment_entry"].doctype,
"payment_entry": voucher["payment_entry"].name,
"allocated_amount": allocated_amount,
},
)
transaction.save()
transaction.update_allocations()
return frappe.get_doc("Bank Transaction", bank_transaction_name)
@frappe.whitelist()
def get_linked_payments(bank_transaction_name, document_types = None):
def get_linked_payments(bank_transaction_name, document_types=None):
# get all matching payments for a bank transaction
transaction = frappe.get_doc("Bank Transaction", bank_transaction_name)
bank_account = frappe.db.get_values(
"Bank Account",
transaction.bank_account,
["account", "company"],
as_dict=True)[0]
"Bank Account", transaction.bank_account, ["account", "company"], as_dict=True
)[0]
(account, company) = (bank_account.account, bank_account.company)
matching = check_matching(account, company, transaction, document_types)
return matching
def check_matching(bank_account, company, transaction, document_types):
# combine all types of vouchers
subquery = get_queries(bank_account, company, transaction, document_types)
filters = {
"amount": transaction.unallocated_amount,
"payment_type" : "Receive" if transaction.deposit > 0 else "Pay",
"reference_no": transaction.reference_number,
"party_type": transaction.party_type,
"party": transaction.party,
"bank_account": bank_account
}
"amount": transaction.unallocated_amount,
"payment_type": "Receive" if transaction.deposit > 0 else "Pay",
"reference_no": transaction.reference_number,
"party_type": transaction.party_type,
"party": transaction.party,
"bank_account": bank_account,
}
matching_vouchers = []
matching_vouchers.extend(get_loan_vouchers(bank_account, transaction,
document_types, filters))
matching_vouchers.extend(get_loan_vouchers(bank_account, transaction, document_types, filters))
for query in subquery:
matching_vouchers.extend(
frappe.db.sql(query, filters,)
frappe.db.sql(
query,
filters,
)
)
return sorted(matching_vouchers, key = lambda x: x[0], reverse=True) if matching_vouchers else []
return sorted(matching_vouchers, key=lambda x: x[0], reverse=True) if matching_vouchers else []
def get_queries(bank_account, company, transaction, document_types):
# get queries to get matching vouchers
@@ -293,6 +367,27 @@ def get_queries(bank_account, company, transaction, document_types):
account_from_to = "paid_to" if transaction.deposit > 0 else "paid_from"
queries = []
# get matching queries from all the apps
for method_name in frappe.get_hooks("get_matching_queries"):
queries.extend(
frappe.get_attr(method_name)(
bank_account,
company,
transaction,
document_types,
amount_condition,
account_from_to,
)
or []
)
return queries
def get_matching_queries(
bank_account, company, transaction, document_types, amount_condition, account_from_to
):
queries = []
if "payment_entry" in document_types:
pe_amount_matching = get_pe_matching_query(amount_condition, account_from_to, transaction)
queries.extend([pe_amount_matching])
@@ -302,7 +397,7 @@ def get_queries(bank_account, company, transaction, document_types):
queries.extend([je_amount_matching])
if transaction.deposit > 0 and "sales_invoice" in document_types:
si_amount_matching = get_si_matching_query(amount_condition)
si_amount_matching = get_si_matching_query(amount_condition)
queries.extend([si_amount_matching])
if transaction.withdrawal > 0:
@@ -310,12 +405,9 @@ def get_queries(bank_account, company, transaction, document_types):
pi_amount_matching = get_pi_matching_query(amount_condition)
queries.extend([pi_amount_matching])
if "expense_claim" in document_types:
ec_amount_matching = get_ec_matching_query(bank_account, company, amount_condition)
queries.extend([ec_amount_matching])
return queries
def get_loan_vouchers(bank_account, transaction, document_types, filters):
vouchers = []
amount_condition = True if "exact_match" in document_types else False
@@ -328,109 +420,93 @@ def get_loan_vouchers(bank_account, transaction, document_types, filters):
return vouchers
def get_ld_matching_query(bank_account, amount_condition, filters):
loan_disbursement = frappe.qb.DocType("Loan Disbursement")
matching_reference = loan_disbursement.reference_number == filters.get("reference_number")
matching_party = loan_disbursement.applicant_type == filters.get("party_type") and \
loan_disbursement.applicant == filters.get("party")
matching_party = loan_disbursement.applicant_type == filters.get(
"party_type"
) and loan_disbursement.applicant == filters.get("party")
rank = (
frappe.qb.terms.Case()
.when(matching_reference, 1)
.else_(0)
rank = frappe.qb.terms.Case().when(matching_reference, 1).else_(0)
rank1 = frappe.qb.terms.Case().when(matching_party, 1).else_(0)
query = (
frappe.qb.from_(loan_disbursement)
.select(
rank + rank1 + 1,
ConstantColumn("Loan Disbursement").as_("doctype"),
loan_disbursement.name,
loan_disbursement.disbursed_amount,
loan_disbursement.reference_number,
loan_disbursement.reference_date,
loan_disbursement.applicant_type,
loan_disbursement.disbursement_date,
)
rank1 = (
frappe.qb.terms.Case()
.when(matching_party, 1)
.else_(0)
)
query = frappe.qb.from_(loan_disbursement).select(
rank + rank1 + 1,
ConstantColumn("Loan Disbursement").as_("doctype"),
loan_disbursement.name,
loan_disbursement.disbursed_amount,
loan_disbursement.reference_number,
loan_disbursement.reference_date,
loan_disbursement.applicant_type,
loan_disbursement.disbursement_date
).where(
loan_disbursement.docstatus == 1
).where(
loan_disbursement.clearance_date.isnull()
).where(
loan_disbursement.disbursement_account == bank_account
.where(loan_disbursement.docstatus == 1)
.where(loan_disbursement.clearance_date.isnull())
.where(loan_disbursement.disbursement_account == bank_account)
)
if amount_condition:
query.where(
loan_disbursement.disbursed_amount == filters.get('amount')
)
query.where(loan_disbursement.disbursed_amount == filters.get("amount"))
else:
query.where(
loan_disbursement.disbursed_amount <= filters.get('amount')
)
query.where(loan_disbursement.disbursed_amount <= filters.get("amount"))
vouchers = query.run(as_list=True)
return vouchers
def get_lr_matching_query(bank_account, amount_condition, filters):
loan_repayment = frappe.qb.DocType("Loan Repayment")
matching_reference = loan_repayment.reference_number == filters.get("reference_number")
matching_party = loan_repayment.applicant_type == filters.get("party_type") and \
loan_repayment.applicant == filters.get("party")
matching_party = loan_repayment.applicant_type == filters.get(
"party_type"
) and loan_repayment.applicant == filters.get("party")
rank = (
frappe.qb.terms.Case()
.when(matching_reference, 1)
.else_(0)
rank = frappe.qb.terms.Case().when(matching_reference, 1).else_(0)
rank1 = frappe.qb.terms.Case().when(matching_party, 1).else_(0)
query = (
frappe.qb.from_(loan_repayment)
.select(
rank + rank1 + 1,
ConstantColumn("Loan Repayment").as_("doctype"),
loan_repayment.name,
loan_repayment.amount_paid,
loan_repayment.reference_number,
loan_repayment.reference_date,
loan_repayment.applicant_type,
loan_repayment.posting_date,
)
rank1 = (
frappe.qb.terms.Case()
.when(matching_party, 1)
.else_(0)
)
query = frappe.qb.from_(loan_repayment).select(
rank + rank1 + 1,
ConstantColumn("Loan Repayment").as_("doctype"),
loan_repayment.name,
loan_repayment.amount_paid,
loan_repayment.reference_number,
loan_repayment.reference_date,
loan_repayment.applicant_type,
loan_repayment.posting_date
).where(
loan_repayment.docstatus == 1
).where(
loan_repayment.clearance_date.isnull()
).where(
loan_repayment.payment_account == bank_account
.where(loan_repayment.docstatus == 1)
.where(loan_repayment.clearance_date.isnull())
.where(loan_repayment.payment_account == bank_account)
)
if frappe.db.has_column("Loan Repayment", "repay_from_salary"):
query = query.where((loan_repayment.repay_from_salary == 0))
if amount_condition:
query.where(
loan_repayment.amount_paid == filters.get('amount')
)
query.where(loan_repayment.amount_paid == filters.get("amount"))
else:
query.where(
loan_repayment.amount_paid <= filters.get('amount')
)
query.where(loan_repayment.amount_paid <= filters.get("amount"))
vouchers = query.run()
return vouchers
def get_pe_matching_query(amount_condition, account_from_to, transaction):
# get matching payment entries query
if transaction.deposit > 0:
currency_field = "paid_to_account_currency as currency"
else:
currency_field = "paid_from_account_currency as currency"
return f"""
return f"""
SELECT
(CASE WHEN reference_no=%(reference_no)s THEN 1 ELSE 0 END
+ CASE WHEN (party_type = %(party_type)s AND party = %(party)s ) THEN 1 ELSE 0 END
@@ -519,6 +595,7 @@ def get_si_matching_query(amount_condition):
AND si.docstatus = 1
"""
def get_pi_matching_query(amount_condition):
# get matching purchase invoice query
return f"""
@@ -543,32 +620,3 @@ def get_pi_matching_query(amount_condition):
AND ifnull(clearance_date, '') = ""
AND cash_bank_account = %(bank_account)s
"""
def get_ec_matching_query(bank_account, company, amount_condition):
# get matching Expense Claim query
mode_of_payments = [x["parent"] for x in frappe.db.get_all("Mode of Payment Account",
filters={"default_account": bank_account}, fields=["parent"])]
mode_of_payments = '(\'' + '\', \''.join(mode_of_payments) + '\' )'
company_currency = get_company_currency(company)
return f"""
SELECT
( CASE WHEN employee = %(party)s THEN 1 ELSE 0 END
+ 1 ) AS rank,
'Expense Claim' as doctype,
name,
total_sanctioned_amount as paid_amount,
'' as reference_no,
'' as reference_date,
employee as party,
'Employee' as party_type,
posting_date,
'{company_currency}' as currency
FROM
`tabExpense Claim`
WHERE
total_sanctioned_amount {amount_condition} %(amount)s
AND docstatus = 1
AND is_paid = 1
AND ifnull(clearance_date, '') = ""
AND mode_of_payment in {mode_of_payments}
"""

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;
@@ -200,7 +200,7 @@ frappe.ui.form.on("Bank Statement Import", {
})
.then((result) => {
if (result.length > 0) {
frm.add_custom_button("Report Error", () => {
frm.add_custom_button(__("Report Error"), () => {
let fake_xhr = {
responseText: JSON.stringify({
exc: result[0].error,
@@ -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

@@ -18,6 +18,7 @@ from openpyxl.utils import get_column_letter
INVALID_VALUES = ("", None)
class BankStatementImport(DataImport):
def __init__(self, *args, **kwargs):
super(BankStatementImport, self).__init__(*args, **kwargs)
@@ -49,16 +50,14 @@ class BankStatementImport(DataImport):
self.import_file, self.google_sheets_url
)
if 'Bank Account' not in json.dumps(preview['columns']):
if "Bank Account" not in json.dumps(preview["columns"]):
frappe.throw(_("Please add the Bank Account column"))
from frappe.core.page.background_jobs.background_jobs import get_info
from frappe.utils.scheduler import is_scheduler_inactive
if is_scheduler_inactive() and not frappe.flags.in_test:
frappe.throw(
_("Scheduler is inactive. Cannot import data."), title=_("Scheduler Inactive")
)
frappe.throw(_("Scheduler is inactive. Cannot import data."), title=_("Scheduler Inactive"))
enqueued_jobs = [d.get("job_name") for d in get_info()]
@@ -81,21 +80,25 @@ class BankStatementImport(DataImport):
return False
@frappe.whitelist()
def get_preview_from_template(data_import, import_file=None, google_sheets_url=None):
return frappe.get_doc("Bank Statement Import", data_import).get_preview_from_template(
import_file, google_sheets_url
)
@frappe.whitelist()
def form_start_import(data_import):
return frappe.get_doc("Bank Statement Import", data_import).start_import()
@frappe.whitelist()
def download_errored_template(data_import_name):
data_import = frappe.get_doc("Bank Statement Import", data_import_name)
data_import.export_errored_rows()
def parse_data_from_template(raw_data):
data = []
@@ -108,7 +111,10 @@ def parse_data_from_template(raw_data):
return data
def start_import(data_import, bank_account, import_file_path, google_sheets_url, bank, template_options):
def start_import(
data_import, bank_account, import_file_path, google_sheets_url, bank, template_options
):
"""This method runs in background job"""
update_mapping_db(bank, template_options)
@@ -116,7 +122,7 @@ def start_import(data_import, bank_account, import_file_path, google_sheets_url,
data_import = frappe.get_doc("Bank Statement Import", data_import)
file = import_file_path if import_file_path else google_sheets_url
import_file = ImportFile("Bank Transaction", file = file, import_type="Insert New Records")
import_file = ImportFile("Bank Transaction", file=file, import_type="Insert New Records")
data = parse_data_from_template(import_file.raw_data)
@@ -130,22 +136,24 @@ def start_import(data_import, bank_account, import_file_path, google_sheets_url,
except Exception:
frappe.db.rollback()
data_import.db_set("status", "Error")
frappe.log_error(title=data_import.name)
data_import.log_error("Bank Statement Import failed")
finally:
frappe.flags.in_import = False
frappe.publish_realtime("data_import_refresh", {"data_import": data_import.name})
def update_mapping_db(bank, template_options):
bank = frappe.get_doc("Bank", bank)
for d in bank.bank_transaction_mapping:
d.delete()
for d in json.loads(template_options)["column_to_field_map"].items():
bank.append("bank_transaction_mapping", {"bank_transaction_field": d[1] ,"file_field": d[0]} )
bank.append("bank_transaction_mapping", {"bank_transaction_field": d[1], "file_field": d[0]})
bank.save()
def add_bank_account(data, bank_account):
bank_account_loc = None
if "Bank Account" not in data[0]:
@@ -161,6 +169,7 @@ def add_bank_account(data, bank_account):
else:
row.append(bank_account)
def write_files(import_file, data):
full_file_path = import_file.file_doc.get_full_path()
parts = import_file.file_doc.get_extension()
@@ -168,11 +177,12 @@ def write_files(import_file, data):
extension = extension.lstrip(".")
if extension == "csv":
with open(full_file_path, 'w', newline='') as file:
with open(full_file_path, "w", newline="") as file:
writer = csv.writer(file)
writer.writerows(data)
elif extension == "xlsx" or "xls":
write_xlsx(data, "trans", file_path = full_file_path)
write_xlsx(data, "trans", file_path=full_file_path)
def write_xlsx(data, sheet_name, wb=None, column_widths=None, file_path=None):
# from xlsx utils with changes
@@ -187,19 +197,19 @@ def write_xlsx(data, sheet_name, wb=None, column_widths=None, file_path=None):
ws.column_dimensions[get_column_letter(i + 1)].width = column_width
row1 = ws.row_dimensions[1]
row1.font = Font(name='Calibri', bold=True)
row1.font = Font(name="Calibri", bold=True)
for row in data:
clean_row = []
for item in row:
if isinstance(item, str) and (sheet_name not in ['Data Import Template', 'Data Export']):
if isinstance(item, str) and (sheet_name not in ["Data Import Template", "Data Export"]):
value = handle_html(item)
else:
value = item
if isinstance(item, str) and next(ILLEGAL_CHARACTERS_RE.finditer(value), None):
# Remove illegal characters from the string
value = re.sub(ILLEGAL_CHARACTERS_RE, '', value)
value = re.sub(ILLEGAL_CHARACTERS_RE, "", value)
clean_row.append(value)
@@ -208,19 +218,20 @@ def write_xlsx(data, sheet_name, wb=None, column_widths=None, file_path=None):
wb.save(file_path)
return True
@frappe.whitelist()
def upload_bank_statement(**args):
args = frappe._dict(args)
bsi = frappe.new_doc("Bank Statement Import")
if args.company:
bsi.update({
"company": args.company,
})
bsi.update(
{
"company": args.company,
}
)
if args.bank_account:
bsi.update({
"bank_account": args.bank_account
})
bsi.update({"bank_account": args.bank_account})
return bsi

View File

@@ -3,28 +3,21 @@
frappe.ui.form.on("Bank Transaction", {
onload(frm) {
frm.set_query("payment_document", "payment_entries", function () {
frm.set_query("payment_document", "payment_entries", function() {
const payment_doctypes = frm.events.get_payment_doctypes(frm);
return {
filters: {
name: [
"in",
[
"Payment Entry",
"Journal Entry",
"Sales Invoice",
"Purchase Invoice",
"Expense Claim",
],
],
name: ["in", payment_doctypes],
},
};
});
},
bank_account: function (frm) {
bank_account: function(frm) {
set_bank_statement_filter(frm);
},
setup: function (frm) {
setup: function(frm) {
frm.set_query("party_type", function () {
return {
filters: {
@@ -33,6 +26,16 @@ frappe.ui.form.on("Bank Transaction", {
};
});
},
get_payment_doctypes: function() {
// get payment doctypes from all the apps
return [
"Payment Entry",
"Journal Entry",
"Sales Invoice",
"Purchase Invoice",
];
}
});
frappe.ui.form.on("Bank Transaction Payments", {

View File

@@ -134,7 +134,8 @@
{
"fieldname": "allocated_amount",
"fieldtype": "Currency",
"label": "Allocated Amount"
"label": "Allocated Amount",
"options": "currency"
},
{
"fieldname": "amended_from",
@@ -152,7 +153,8 @@
{
"fieldname": "unallocated_amount",
"fieldtype": "Currency",
"label": "Unallocated Amount"
"label": "Unallocated Amount",
"options": "currency"
},
{
"fieldname": "party_section",
@@ -192,10 +194,11 @@
],
"is_submittable": 1,
"links": [],
"modified": "2021-04-14 17:31:58.963529",
"modified": "2022-03-21 19:05:04.208222",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Transaction",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -242,6 +245,7 @@
],
"sort_field": "date",
"sort_order": "DESC",
"states": [],
"title_field": "bank_account",
"track_changes": 1
}

View File

@@ -29,17 +29,26 @@ class BankTransaction(StatusUpdater):
def update_allocations(self):
if self.payment_entries:
allocated_amount = reduce(lambda x, y: flt(x) + flt(y), [x.allocated_amount for x in self.payment_entries])
allocated_amount = reduce(
lambda x, y: flt(x) + flt(y), [x.allocated_amount for x in self.payment_entries]
)
else:
allocated_amount = 0
if allocated_amount:
frappe.db.set_value(self.doctype, self.name, "allocated_amount", flt(allocated_amount))
frappe.db.set_value(self.doctype, self.name, "unallocated_amount", abs(flt(self.withdrawal) - flt(self.deposit)) - flt(allocated_amount))
frappe.db.set_value(
self.doctype,
self.name,
"unallocated_amount",
abs(flt(self.withdrawal) - flt(self.deposit)) - flt(allocated_amount),
)
else:
frappe.db.set_value(self.doctype, self.name, "allocated_amount", 0)
frappe.db.set_value(self.doctype, self.name, "unallocated_amount", abs(flt(self.withdrawal) - flt(self.deposit)))
frappe.db.set_value(
self.doctype, self.name, "unallocated_amount", abs(flt(self.withdrawal) - flt(self.deposit))
)
amount = self.deposit or self.withdrawal
if amount == self.allocated_amount:
@@ -49,47 +58,54 @@ class BankTransaction(StatusUpdater):
def clear_linked_payment_entries(self, for_cancel=False):
for payment_entry in self.payment_entries:
if payment_entry.payment_document in ["Payment Entry", "Journal Entry", "Purchase Invoice", "Expense Claim", "Loan Repayment",
"Loan Disbursement"]:
self.clear_simple_entry(payment_entry, for_cancel=for_cancel)
elif payment_entry.payment_document == "Sales Invoice":
if payment_entry.payment_document == "Sales Invoice":
self.clear_sales_invoice(payment_entry, for_cancel=for_cancel)
elif payment_entry.payment_document in get_doctypes_for_bank_reconciliation():
self.clear_simple_entry(payment_entry, for_cancel=for_cancel)
def clear_simple_entry(self, payment_entry, for_cancel=False):
if payment_entry.payment_document == "Payment Entry":
if frappe.db.get_value("Payment Entry", payment_entry.payment_entry, "payment_type") == "Internal Transfer":
if (
frappe.db.get_value("Payment Entry", payment_entry.payment_entry, "payment_type")
== "Internal Transfer"
):
if len(get_reconciled_bank_transactions(payment_entry)) < 2:
return
clearance_date = self.date if not for_cancel else None
frappe.db.set_value(
payment_entry.payment_document, payment_entry.payment_entry,
"clearance_date", clearance_date)
payment_entry.payment_document, payment_entry.payment_entry, "clearance_date", clearance_date
)
def clear_sales_invoice(self, payment_entry, for_cancel=False):
clearance_date = self.date if not for_cancel else None
frappe.db.set_value(
"Sales Invoice Payment",
dict(
parenttype=payment_entry.payment_document,
parent=payment_entry.payment_entry
),
"clearance_date", clearance_date)
dict(parenttype=payment_entry.payment_document, parent=payment_entry.payment_entry),
"clearance_date",
clearance_date,
)
@frappe.whitelist()
def get_doctypes_for_bank_reconciliation():
"""Get Bank Reconciliation doctypes from all the apps"""
return frappe.get_hooks("bank_reconciliation_doctypes")
def get_reconciled_bank_transactions(payment_entry):
reconciled_bank_transactions = frappe.get_all(
'Bank Transaction Payments',
filters = {
'payment_entry': payment_entry.payment_entry
},
fields = ['parent']
"Bank Transaction Payments",
filters={"payment_entry": payment_entry.payment_entry},
fields=["parent"],
)
return reconciled_bank_transactions
def get_total_allocated_amount(payment_entry):
return frappe.db.sql("""
return frappe.db.sql(
"""
SELECT
SUM(btp.allocated_amount) as allocated_amount,
bt.name
@@ -102,43 +118,73 @@ def get_total_allocated_amount(payment_entry):
AND
btp.payment_entry = %s
AND
bt.docstatus = 1""", (payment_entry.payment_document, payment_entry.payment_entry), as_dict=True)
bt.docstatus = 1""",
(payment_entry.payment_document, payment_entry.payment_entry),
as_dict=True,
)
def get_paid_amount(payment_entry, currency, bank_account):
if payment_entry.payment_document in ["Payment Entry", "Sales Invoice", "Purchase Invoice"]:
paid_amount_field = "paid_amount"
if payment_entry.payment_document == 'Payment Entry':
if payment_entry.payment_document == "Payment Entry":
doc = frappe.get_doc("Payment Entry", payment_entry.payment_entry)
paid_amount_field = ("base_paid_amount"
if doc.paid_to_account_currency == currency else "paid_amount")
return frappe.db.get_value(payment_entry.payment_document,
payment_entry.payment_entry, paid_amount_field)
if doc.payment_type == "Receive":
paid_amount_field = (
"received_amount" if doc.paid_to_account_currency == currency else "base_received_amount"
)
elif doc.payment_type == "Pay":
paid_amount_field = (
"paid_amount" if doc.paid_to_account_currency == currency else "base_paid_amount"
)
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, paid_amount_field
)
elif payment_entry.payment_document == "Journal Entry":
return frappe.db.get_value('Journal Entry Account', {'parent': payment_entry.payment_entry, 'account': bank_account},
"sum(credit_in_account_currency)")
return frappe.db.get_value(
"Journal Entry Account",
{"parent": payment_entry.payment_entry, "account": bank_account},
"sum(credit_in_account_currency)",
)
elif payment_entry.payment_document == "Expense Claim":
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "total_amount_reimbursed")
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, "total_amount_reimbursed"
)
elif payment_entry.payment_document == "Loan Disbursement":
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "disbursed_amount")
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, "disbursed_amount"
)
elif payment_entry.payment_document == "Loan Repayment":
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "amount_paid")
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, "amount_paid"
)
else:
frappe.throw("Please reconcile {0}: {1} manually".format(payment_entry.payment_document, payment_entry.payment_entry))
frappe.throw(
"Please reconcile {0}: {1} manually".format(
payment_entry.payment_document, payment_entry.payment_entry
)
)
@frappe.whitelist()
def unclear_reference_payment(doctype, docname):
if frappe.db.exists(doctype, docname):
doc = frappe.get_doc(doctype, docname)
if doctype == "Sales Invoice":
frappe.db.set_value("Sales Invoice Payment", dict(parenttype=doc.payment_document,
parent=doc.payment_entry), "clearance_date", None)
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doc.payment_document, parent=doc.payment_entry),
"clearance_date",
None,
)
else:
frappe.db.set_value(doc.payment_document, doc.payment_entry, "clearance_date", None)

View File

@@ -18,12 +18,14 @@ def upload_bank_statement():
fcontent = frappe.local.uploaded_file
fname = frappe.local.uploaded_filename
if frappe.safe_encode(fname).lower().endswith("csv".encode('utf-8')):
if frappe.safe_encode(fname).lower().endswith("csv".encode("utf-8")):
from frappe.utils.csvutils import read_csv_content
rows = read_csv_content(fcontent, False)
elif frappe.safe_encode(fname).lower().endswith("xlsx".encode('utf-8')):
elif frappe.safe_encode(fname).lower().endswith("xlsx".encode("utf-8")):
from frappe.utils.xlsxutils import read_xlsx_file_from_attached_file
rows = read_xlsx_file_from_attached_file(fcontent=fcontent)
columns = rows[0]
@@ -43,12 +45,10 @@ def create_bank_entries(columns, data, bank_account):
continue
fields = {}
for key, value in header_map.items():
fields.update({key: d[int(value)-1]})
fields.update({key: d[int(value) - 1]})
try:
bank_transaction = frappe.get_doc({
"doctype": "Bank Transaction"
})
bank_transaction = frappe.get_doc({"doctype": "Bank Transaction"})
bank_transaction.update(fields)
bank_transaction.date = getdate(parse_date(bank_transaction.date))
bank_transaction.bank_account = bank_account
@@ -56,11 +56,12 @@ def create_bank_entries(columns, data, bank_account):
bank_transaction.submit()
success += 1
except Exception:
frappe.log_error(frappe.get_traceback())
bank_transaction.log_error("Bank entry creation failed")
errors += 1
return {"success": success, "errors": errors}
def get_header_mapping(columns, bank_account):
mapping = get_bank_mapping(bank_account)
@@ -71,10 +72,11 @@ def get_header_mapping(columns, bank_account):
return header_map
def get_bank_mapping(bank_account):
bank_name = frappe.db.get_value("Bank Account", bank_account, "bank")
bank = frappe.get_doc("Bank", bank_name)
mapping = {row.file_field:row.bank_transaction_field for row in bank.bank_transaction_mapping}
mapping = {row.file_field: row.bank_transaction_field for row in bank.bank_transaction_mapping}
return mapping

View File

@@ -5,6 +5,7 @@ import json
import unittest
import frappe
from frappe.tests.utils import FrappeTestCase
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
get_linked_payments,
@@ -17,45 +18,52 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
test_dependencies = ["Item", "Cost Center"]
class TestBankTransaction(unittest.TestCase):
@classmethod
def setUpClass(cls):
class TestBankTransaction(FrappeTestCase):
def setUp(self):
for dt in [
"Loan Repayment",
"Bank Transaction",
"Payment Entry",
"Payment Entry Reference",
"POS Profile",
]:
frappe.db.delete(dt)
make_pos_profile()
add_transactions()
add_vouchers()
@classmethod
def tearDownClass(cls):
for bt in frappe.get_all("Bank Transaction"):
doc = frappe.get_doc("Bank Transaction", bt.name)
if doc.docstatus == 1:
doc.cancel()
doc.delete()
# Delete directly in DB to avoid validation errors for countries not allowing deletion
frappe.db.sql("""delete from `tabPayment Entry Reference`""")
frappe.db.sql("""delete from `tabPayment Entry`""")
# Delete POS Profile
frappe.db.sql("delete from `tabPOS Profile`")
# This test checks if ERPNext is able to provide a linked payment for a bank transaction based on the amount of the bank transaction.
def test_linked_payments(self):
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="Re 95282925234 FE/000002917 AT171513000281183046 Conrad Electronic"))
linked_payments = get_linked_payments(bank_transaction.name, ['payment_entry', 'exact_match'])
bank_transaction = frappe.get_doc(
"Bank Transaction",
dict(description="Re 95282925234 FE/000002917 AT171513000281183046 Conrad Electronic"),
)
linked_payments = get_linked_payments(bank_transaction.name, ["payment_entry", "exact_match"])
self.assertTrue(linked_payments[0][6] == "Conrad Electronic")
# This test validates a simple reconciliation leading to the clearance of the bank transaction and the payment
def test_reconcile(self):
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000003025 OPSKATTUZWXXX AT776000000098709849 Herr G"))
bank_transaction = frappe.get_doc(
"Bank Transaction",
dict(description="1512567 BG/000003025 OPSKATTUZWXXX AT776000000098709849 Herr G"),
)
payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1700))
vouchers = json.dumps([{
"payment_doctype":"Payment Entry",
"payment_name":payment.name,
"amount":bank_transaction.unallocated_amount}])
vouchers = json.dumps(
[
{
"payment_doctype": "Payment Entry",
"payment_name": payment.name,
"amount": bank_transaction.unallocated_amount,
}
]
)
reconcile_vouchers(bank_transaction.name, vouchers)
unallocated_amount = frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount")
unallocated_amount = frappe.db.get_value(
"Bank Transaction", bank_transaction.name, "unallocated_amount"
)
self.assertTrue(unallocated_amount == 0)
clearance_date = frappe.db.get_value("Payment Entry", payment.name, "clearance_date")
@@ -69,122 +77,206 @@ class TestBankTransaction(unittest.TestCase):
# Check if ERPNext can correctly filter a linked payments based on the debit/credit amount
def test_debit_credit_output(self):
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07"))
linked_payments = get_linked_payments(bank_transaction.name, ['payment_entry', 'exact_match'])
bank_transaction = frappe.get_doc(
"Bank Transaction",
dict(description="Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07"),
)
linked_payments = get_linked_payments(bank_transaction.name, ["payment_entry", "exact_match"])
self.assertTrue(linked_payments[0][3])
# Check error if already reconciled
def test_already_reconciled(self):
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
bank_transaction = frappe.get_doc(
"Bank Transaction",
dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"),
)
payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
vouchers = json.dumps([{
"payment_doctype":"Payment Entry",
"payment_name":payment.name,
"amount":bank_transaction.unallocated_amount}])
vouchers = json.dumps(
[
{
"payment_doctype": "Payment Entry",
"payment_name": payment.name,
"amount": bank_transaction.unallocated_amount,
}
]
)
reconcile_vouchers(bank_transaction.name, vouchers)
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
bank_transaction = frappe.get_doc(
"Bank Transaction",
dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"),
)
payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
vouchers = json.dumps([{
"payment_doctype":"Payment Entry",
"payment_name":payment.name,
"amount":bank_transaction.unallocated_amount}])
self.assertRaises(frappe.ValidationError, reconcile_vouchers, bank_transaction_name=bank_transaction.name, vouchers=vouchers)
vouchers = json.dumps(
[
{
"payment_doctype": "Payment Entry",
"payment_name": payment.name,
"amount": bank_transaction.unallocated_amount,
}
]
)
self.assertRaises(
frappe.ValidationError,
reconcile_vouchers,
bank_transaction_name=bank_transaction.name,
vouchers=vouchers,
)
# Raise an error if debitor transaction vs debitor payment
def test_clear_sales_invoice(self):
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio"))
bank_transaction = frappe.get_doc(
"Bank Transaction",
dict(description="I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio"),
)
payment = frappe.get_doc("Sales Invoice", dict(customer="Fayva", status=["=", "Paid"]))
vouchers = json.dumps([{
"payment_doctype":"Sales Invoice",
"payment_name":payment.name,
"amount":bank_transaction.unallocated_amount}])
vouchers = json.dumps(
[
{
"payment_doctype": "Sales Invoice",
"payment_name": payment.name,
"amount": bank_transaction.unallocated_amount,
}
]
)
reconcile_vouchers(bank_transaction.name, vouchers=vouchers)
self.assertEqual(frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount"), 0)
self.assertTrue(frappe.db.get_value("Sales Invoice Payment", dict(parent=payment.name), "clearance_date") is not None)
self.assertEqual(
frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount"), 0
)
self.assertTrue(
frappe.db.get_value("Sales Invoice Payment", dict(parent=payment.name), "clearance_date")
is not None
)
def test_matching_loan_repayment(self):
from erpnext.loan_management.doctype.loan.test_loan import create_loan_accounts
create_loan_accounts()
bank_account = frappe.get_doc(
{
"doctype": "Bank Account",
"account_name": "Payment Account",
"bank": "Citi Bank",
"account": "Payment Account - _TC",
}
).insert(ignore_if_duplicate=True)
bank_transaction = frappe.get_doc(
{
"doctype": "Bank Transaction",
"description": "Loan Repayment - OPSKATTUZWXXX AT776000000098709837 Herr G",
"date": "2018-10-27",
"deposit": 500,
"currency": "INR",
"bank_account": bank_account.name,
}
).submit()
repayment_entry = create_loan_and_repayment()
linked_payments = get_linked_payments(bank_transaction.name, ["loan_repayment", "exact_match"])
self.assertEqual(linked_payments[0][2], repayment_entry.name)
def create_bank_account(bank_name="Citi Bank", account_name="_Test Bank - _TC"):
try:
frappe.get_doc({
"doctype": "Bank",
"bank_name":bank_name,
}).insert(ignore_if_duplicate=True)
frappe.get_doc(
{
"doctype": "Bank",
"bank_name": bank_name,
}
).insert(ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
pass
try:
frappe.get_doc({
"doctype": "Bank Account",
"account_name":"Checking Account",
"bank": bank_name,
"account": account_name
}).insert(ignore_if_duplicate=True)
frappe.get_doc(
{
"doctype": "Bank Account",
"account_name": "Checking Account",
"bank": bank_name,
"account": account_name,
}
).insert(ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
pass
def add_transactions():
create_bank_account()
doc = frappe.get_doc({
"doctype": "Bank Transaction",
"description":"1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G",
"date": "2018-10-23",
"deposit": 1200,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank"
}).insert()
doc = frappe.get_doc(
{
"doctype": "Bank Transaction",
"description": "1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G",
"date": "2018-10-23",
"deposit": 1200,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
}
).insert()
doc.submit()
doc = frappe.get_doc({
"doctype": "Bank Transaction",
"description":"1512567 BG/000003025 OPSKATTUZWXXX AT776000000098709849 Herr G",
"date": "2018-10-23",
"deposit": 1700,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank"
}).insert()
doc = frappe.get_doc(
{
"doctype": "Bank Transaction",
"description": "1512567 BG/000003025 OPSKATTUZWXXX AT776000000098709849 Herr G",
"date": "2018-10-23",
"deposit": 1700,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
}
).insert()
doc.submit()
doc = frappe.get_doc({
"doctype": "Bank Transaction",
"description":"Re 95282925234 FE/000002917 AT171513000281183046 Conrad Electronic",
"date": "2018-10-26",
"withdrawal": 690,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank"
}).insert()
doc = frappe.get_doc(
{
"doctype": "Bank Transaction",
"description": "Re 95282925234 FE/000002917 AT171513000281183046 Conrad Electronic",
"date": "2018-10-26",
"withdrawal": 690,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
}
).insert()
doc.submit()
doc = frappe.get_doc({
"doctype": "Bank Transaction",
"description":"Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07",
"date": "2018-10-27",
"deposit": 3900,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank"
}).insert()
doc = frappe.get_doc(
{
"doctype": "Bank Transaction",
"description": "Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07",
"date": "2018-10-27",
"deposit": 3900,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
}
).insert()
doc.submit()
doc = frappe.get_doc({
"doctype": "Bank Transaction",
"description":"I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio",
"date": "2018-10-27",
"withdrawal": 109080,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank"
}).insert()
doc = frappe.get_doc(
{
"doctype": "Bank Transaction",
"description": "I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio",
"date": "2018-10-27",
"withdrawal": 109080,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
}
).insert()
doc.submit()
def add_vouchers():
try:
frappe.get_doc({
"doctype": "Supplier",
"supplier_group":"All Supplier Groups",
"supplier_type": "Company",
"supplier_name": "Conrad Electronic"
}).insert(ignore_if_duplicate=True)
frappe.get_doc(
{
"doctype": "Supplier",
"supplier_group": "All Supplier Groups",
"supplier_type": "Company",
"supplier_name": "Conrad Electronic",
}
).insert(ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
pass
@@ -198,12 +290,14 @@ def add_vouchers():
pe.submit()
try:
frappe.get_doc({
"doctype": "Supplier",
"supplier_group":"All Supplier Groups",
"supplier_type": "Company",
"supplier_name": "Mr G"
}).insert(ignore_if_duplicate=True)
frappe.get_doc(
{
"doctype": "Supplier",
"supplier_group": "All Supplier Groups",
"supplier_type": "Company",
"supplier_name": "Mr G",
}
).insert(ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
pass
@@ -222,26 +316,30 @@ def add_vouchers():
pe.submit()
try:
frappe.get_doc({
"doctype": "Supplier",
"supplier_group":"All Supplier Groups",
"supplier_type": "Company",
"supplier_name": "Poore Simon's"
}).insert(ignore_if_duplicate=True)
frappe.get_doc(
{
"doctype": "Supplier",
"supplier_group": "All Supplier Groups",
"supplier_type": "Company",
"supplier_name": "Poore Simon's",
}
).insert(ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
pass
try:
frappe.get_doc({
"doctype": "Customer",
"customer_group":"All Customer Groups",
"customer_type": "Company",
"customer_name": "Poore Simon's"
}).insert(ignore_if_duplicate=True)
frappe.get_doc(
{
"doctype": "Customer",
"customer_group": "All Customer Groups",
"customer_type": "Company",
"customer_name": "Poore Simon's",
}
).insert(ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
pass
pi = make_purchase_invoice(supplier="Poore Simon's", qty=1, rate=3900, is_paid=1, do_not_save =1)
pi = make_purchase_invoice(supplier="Poore Simon's", qty=1, rate=3900, is_paid=1, do_not_save=1)
pi.cash_bank_account = "_Test Bank - _TC"
pi.insert()
pi.submit()
@@ -261,33 +359,87 @@ def add_vouchers():
pe.submit()
try:
frappe.get_doc({
"doctype": "Customer",
"customer_group":"All Customer Groups",
"customer_type": "Company",
"customer_name": "Fayva"
}).insert(ignore_if_duplicate=True)
frappe.get_doc(
{
"doctype": "Customer",
"customer_group": "All Customer Groups",
"customer_type": "Company",
"customer_name": "Fayva",
}
).insert(ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
pass
mode_of_payment = frappe.get_doc({
"doctype": "Mode of Payment",
"name": "Cash"
})
mode_of_payment = frappe.get_doc({"doctype": "Mode of Payment", "name": "Cash"})
if not frappe.db.get_value('Mode of Payment Account', {'company': "_Test Company", 'parent': "Cash"}):
mode_of_payment.append("accounts", {
"company": "_Test Company",
"default_account": "_Test Bank - _TC"
})
if not frappe.db.get_value(
"Mode of Payment Account", {"company": "_Test Company", "parent": "Cash"}
):
mode_of_payment.append(
"accounts", {"company": "_Test Company", "default_account": "_Test Bank - _TC"}
)
mode_of_payment.save()
si = create_sales_invoice(customer="Fayva", qty=1, rate=109080, do_not_save=1)
si.is_pos = 1
si.append("payments", {
"mode_of_payment": "Cash",
"account": "_Test Bank - _TC",
"amount": 109080
})
si.append(
"payments", {"mode_of_payment": "Cash", "account": "_Test Bank - _TC", "amount": 109080}
)
si.insert()
si.submit()
def create_loan_and_repayment():
from erpnext.loan_management.doctype.loan.test_loan import (
create_loan,
create_loan_type,
create_repayment_entry,
make_loan_disbursement_entry,
)
from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import (
process_loan_interest_accrual_for_term_loans,
)
from erpnext.setup.doctype.employee.test_employee import make_employee
create_loan_type(
"Personal Loan",
500000,
8.4,
is_term_loan=1,
mode_of_payment="Cash",
disbursement_account="Disbursement Account - _TC",
payment_account="Payment Account - _TC",
loan_account="Loan Account - _TC",
interest_income_account="Interest Income Account - _TC",
penalty_income_account="Penalty Income Account - _TC",
)
applicant = make_employee("test_bank_reco@loan.com", company="_Test Company")
loan = create_loan(applicant, "Personal Loan", 5000, "Repay Over Number of Periods", 20)
loan = frappe.get_doc(
{
"doctype": "Loan",
"applicant_type": "Employee",
"company": "_Test Company",
"applicant": applicant,
"loan_type": "Personal Loan",
"loan_amount": 5000,
"repayment_method": "Repay Fixed Amount per Period",
"monthly_repayment_amount": 500,
"repayment_start_date": "2018-09-27",
"is_term_loan": 1,
"posting_date": "2018-09-27",
}
).insert()
make_loan_disbursement_entry(loan.name, loan.loan_amount, disbursement_date="2018-09-27")
process_loan_interest_accrual_for_term_loans(posting_date="2018-10-27")
repayment_entry = create_repayment_entry(
loan.name,
applicant,
"2018-10-27",
500,
)
repayment_entry.submit()
return repayment_entry

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 (
@@ -14,14 +13,15 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
from erpnext.accounts.utils import get_fiscal_year
class BudgetError(frappe.ValidationError): pass
class DuplicateBudgetError(frappe.ValidationError): pass
class BudgetError(frappe.ValidationError):
pass
class DuplicateBudgetError(frappe.ValidationError):
pass
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))
@@ -35,34 +35,44 @@ class Budget(Document):
budget_against = self.get(budget_against_field)
accounts = [d.account for d in self.accounts] or []
existing_budget = frappe.db.sql("""
existing_budget = frappe.db.sql(
"""
select
b.name, ba.account from `tabBudget` b, `tabBudget Account` ba
where
ba.parent = b.name and b.docstatus < 2 and b.company = %s and %s=%s and
b.fiscal_year=%s and b.name != %s and ba.account in (%s) """
% ('%s', budget_against_field, '%s', '%s', '%s', ','.join(['%s'] * len(accounts))),
(self.company, budget_against, self.fiscal_year, self.name) + tuple(accounts), as_dict=1)
% ("%s", budget_against_field, "%s", "%s", "%s", ",".join(["%s"] * len(accounts))),
(self.company, budget_against, self.fiscal_year, self.name) + tuple(accounts),
as_dict=1,
)
for d in existing_budget:
frappe.throw(_("Another Budget record '{0}' already exists against {1} '{2}' and account '{3}' for fiscal year {4}")
.format(d.name, self.budget_against, budget_against, d.account, self.fiscal_year), DuplicateBudgetError)
frappe.throw(
_(
"Another Budget record '{0}' already exists against {1} '{2}' and account '{3}' for fiscal year {4}"
).format(d.name, self.budget_against, budget_against, d.account, self.fiscal_year),
DuplicateBudgetError,
)
def validate_accounts(self):
account_list = []
for d in self.get('accounts'):
for d in self.get("accounts"):
if d.account:
account_details = frappe.db.get_value("Account", d.account,
["is_group", "company", "report_type"], as_dict=1)
account_details = frappe.db.get_value(
"Account", d.account, ["is_group", "company", "report_type"], as_dict=1
)
if account_details.is_group:
frappe.throw(_("Budget cannot be assigned against Group Account {0}").format(d.account))
elif account_details.company != self.company:
frappe.throw(_("Account {0} does not belongs to company {1}")
.format(d.account, self.company))
frappe.throw(_("Account {0} does not belongs to company {1}").format(d.account, self.company))
elif account_details.report_type != "Profit and Loss":
frappe.throw(_("Budget cannot be assigned against {0}, as it's not an Income or Expense account")
.format(d.account))
frappe.throw(
_("Budget cannot be assigned against {0}, as it's not an Income or Expense account").format(
d.account
)
)
if d.account in account_list:
frappe.throw(_("Account {0} has been entered multiple times").format(d.account))
@@ -70,51 +80,69 @@ class Budget(Document):
account_list.append(d.account)
def set_null_value(self):
if self.budget_against == 'Cost Center':
if self.budget_against == "Cost Center":
self.project = None
else:
self.cost_center = None
def validate_applicable_for(self):
if (self.applicable_on_material_request
and not (self.applicable_on_purchase_order and self.applicable_on_booking_actual_expenses)):
frappe.throw(_("Please enable Applicable on Purchase Order and Applicable on Booking Actual Expenses"))
if self.applicable_on_material_request and not (
self.applicable_on_purchase_order and self.applicable_on_booking_actual_expenses
):
frappe.throw(
_("Please enable Applicable on Purchase Order and Applicable on Booking Actual Expenses")
)
elif (self.applicable_on_purchase_order
and not (self.applicable_on_booking_actual_expenses)):
elif self.applicable_on_purchase_order and not (self.applicable_on_booking_actual_expenses):
frappe.throw(_("Please enable Applicable on Booking Actual Expenses"))
elif not(self.applicable_on_material_request
or self.applicable_on_purchase_order or self.applicable_on_booking_actual_expenses):
elif not (
self.applicable_on_material_request
or self.applicable_on_purchase_order
or self.applicable_on_booking_actual_expenses
):
self.applicable_on_booking_actual_expenses = 1
def validate_expense_against_budget(args):
def before_naming(self):
self.naming_series = f"{{{frappe.scrub(self.budget_against)}}}./.{self.fiscal_year}/.###"
def validate_expense_against_budget(args, expense_amount=0):
args = frappe._dict(args)
if args.get('company') and not args.fiscal_year:
args.fiscal_year = get_fiscal_year(args.get('posting_date'), company=args.get('company'))[0]
frappe.flags.exception_approver_role = frappe.get_cached_value('Company',
args.get('company'), 'exception_budget_approver_role')
if args.get("company") and not args.fiscal_year:
args.fiscal_year = get_fiscal_year(args.get("posting_date"), company=args.get("company"))[0]
frappe.flags.exception_approver_role = frappe.get_cached_value(
"Company", args.get("company"), "exception_budget_approver_role"
)
if not args.account:
args.account = args.get("expense_account")
if not (args.get('account') and args.get('cost_center')) and args.item_code:
if not (args.get("account") and args.get("cost_center")) and args.item_code:
args.cost_center, args.account = get_item_details(args)
if not args.account:
return
for budget_against in ['project', 'cost_center'] + get_accounting_dimensions():
if (args.get(budget_against) and args.account
and frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"})):
for budget_against in ["project", "cost_center"] + get_accounting_dimensions():
if (
args.get(budget_against)
and args.account
and frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"})
):
doctype = frappe.unscrub(budget_against)
if frappe.get_cached_value('DocType', doctype, 'is_tree'):
if frappe.get_cached_value("DocType", doctype, "is_tree"):
lft, rgt = frappe.db.get_value(doctype, args.get(budget_against), ["lft", "rgt"])
condition = """and exists(select name from `tab%s`
where lft<=%s and rgt>=%s and name=b.%s)""" % (doctype, lft, rgt, budget_against) #nosec
where lft<=%s and rgt>=%s and name=b.%s)""" % (
doctype,
lft,
rgt,
budget_against,
) # nosec
args.is_tree = True
else:
condition = "and b.%s=%s" % (budget_against, frappe.db.escape(args.get(budget_against)))
@@ -123,7 +151,8 @@ def validate_expense_against_budget(args):
args.budget_against_field = budget_against
args.budget_against_doctype = doctype
budget_records = frappe.db.sql("""
budget_records = frappe.db.sql(
"""
select
b.{budget_against_field} as budget_against, ba.budget_amount, b.monthly_distribution,
ifnull(b.applicable_on_material_request, 0) as for_material_request,
@@ -138,100 +167,136 @@ def validate_expense_against_budget(args):
b.name=ba.parent and b.fiscal_year=%s
and ba.account=%s and b.docstatus=1
{condition}
""".format(condition=condition, budget_against_field=budget_against), (args.fiscal_year, args.account), as_dict=True) #nosec
""".format(
condition=condition, budget_against_field=budget_against
),
(args.fiscal_year, args.account),
as_dict=True,
) # 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"]:
budget_amount = get_accumulated_monthly_budget(budget.monthly_distribution,
args.posting_date, args.fiscal_year, budget.budget_amount)
budget_amount = get_accumulated_monthly_budget(
budget.monthly_distribution, args.posting_date, args.fiscal_year, budget.budget_amount
)
args["month_end_date"] = get_last_day(args.posting_date)
compare_expense_with_budget(args, budget_amount,
_("Accumulated Monthly"), monthly_action, budget.budget_against, amount)
compare_expense_with_budget(
args, budget_amount, _("Accumulated Monthly"), monthly_action, budget.budget_against, amount
)
if (
yearly_action in ("Stop", "Warn")
and monthly_action != "Stop"
and yearly_action != monthly_action
):
compare_expense_with_budget(
args, flt(budget.budget_amount), _("Annual"), yearly_action, budget.budget_against, amount
)
if yearly_action in ("Stop", "Warn") and monthly_action != "Stop" \
and yearly_action != monthly_action:
compare_expense_with_budget(args, flt(budget.budget_amount),
_("Annual"), yearly_action, budget.budget_against, amount)
def compare_expense_with_budget(args, budget_amount, action_for, action, budget_against, amount=0):
actual_expense = amount or get_actual_expense(args)
if actual_expense > budget_amount:
diff = actual_expense - budget_amount
currency = frappe.get_cached_value('Company', args.company, 'default_currency')
currency = frappe.get_cached_value("Company", args.company, "default_currency")
msg = _("{0} Budget for Account {1} against {2} {3} is {4}. It will exceed by {5}").format(
_(action_for), frappe.bold(args.account), args.budget_against_field,
frappe.bold(budget_against),
frappe.bold(fmt_money(budget_amount, currency=currency)),
frappe.bold(fmt_money(diff, currency=currency)))
_(action_for),
frappe.bold(args.account),
args.budget_against_field,
frappe.bold(budget_against),
frappe.bold(fmt_money(budget_amount, currency=currency)),
frappe.bold(fmt_money(diff, currency=currency)),
)
if (frappe.flags.exception_approver_role
and frappe.flags.exception_approver_role in frappe.get_roles(frappe.session.user)):
if (
frappe.flags.exception_approver_role
and frappe.flags.exception_approver_role in frappe.get_roles(frappe.session.user)
):
action = "Warn"
if action=="Stop":
if action == "Stop":
frappe.throw(msg, BudgetError)
else:
frappe.msgprint(msg, indicator='orange')
frappe.msgprint(msg, indicator="orange")
def get_actions(args, budget):
yearly_action = budget.action_if_annual_budget_exceeded
monthly_action = budget.action_if_accumulated_monthly_budget_exceeded
if args.get('doctype') == 'Material Request' and budget.for_material_request:
if args.get("doctype") == "Material Request" and budget.for_material_request:
yearly_action = budget.action_if_annual_budget_exceeded_on_mr
monthly_action = budget.action_if_accumulated_monthly_budget_exceeded_on_mr
elif args.get('doctype') == 'Purchase Order' and budget.for_purchase_order:
elif args.get("doctype") == "Purchase Order" and budget.for_purchase_order:
yearly_action = budget.action_if_annual_budget_exceeded_on_po
monthly_action = budget.action_if_accumulated_monthly_budget_exceeded_on_po
return yearly_action, monthly_action
def get_amount(args, budget):
amount = 0
if args.get('doctype') == 'Material Request' and budget.for_material_request:
amount = (get_requested_amount(args, budget)
+ get_ordered_amount(args, budget) + get_actual_expense(args))
if args.get("doctype") == "Material Request" and budget.for_material_request:
amount = (
get_requested_amount(args, budget) + get_ordered_amount(args, budget) + get_actual_expense(args)
)
elif args.get('doctype') == 'Purchase Order' and budget.for_purchase_order:
elif args.get("doctype") == "Purchase Order" and budget.for_purchase_order:
amount = get_ordered_amount(args, budget) + get_actual_expense(args)
return amount
def get_requested_amount(args, budget):
item_code = args.get('item_code')
condition = get_other_condition(args, budget, 'Material Request')
data = frappe.db.sql(""" select ifnull((sum(child.stock_qty - child.ordered_qty) * rate), 0) as amount
def get_requested_amount(args, budget):
item_code = args.get("item_code")
condition = get_other_condition(args, budget, "Material Request")
data = frappe.db.sql(
""" select ifnull((sum(child.stock_qty - child.ordered_qty) * rate), 0) as amount
from `tabMaterial Request Item` child, `tabMaterial Request` parent where parent.name = child.parent and
child.item_code = %s and parent.docstatus = 1 and child.stock_qty > child.ordered_qty and {0} and
parent.material_request_type = 'Purchase' and parent.status != 'Stopped'""".format(condition), item_code, as_list=1)
parent.material_request_type = 'Purchase' and parent.status != 'Stopped'""".format(
condition
),
item_code,
as_list=1,
)
return data[0][0] if data else 0
def get_ordered_amount(args, budget):
item_code = args.get('item_code')
condition = get_other_condition(args, budget, 'Purchase Order')
item_code = args.get("item_code")
condition = get_other_condition(args, budget, "Purchase Order")
data = frappe.db.sql(""" select ifnull(sum(child.amount - child.billed_amt), 0) as amount
data = frappe.db.sql(
""" select ifnull(sum(child.amount - child.billed_amt), 0) as amount
from `tabPurchase Order Item` child, `tabPurchase Order` parent where
parent.name = child.parent and child.item_code = %s and parent.docstatus = 1 and child.amount > child.billed_amt
and parent.status != 'Closed' and {0}""".format(condition), item_code, as_list=1)
and parent.status != 'Closed' and {0}""".format(
condition
),
item_code,
as_list=1,
)
return data[0][0] if data else 0
def get_other_condition(args, budget, for_doc):
condition = "expense_account = '%s'" % (args.expense_account)
budget_against_field = args.get("budget_against_field")
@@ -239,41 +304,51 @@ def get_other_condition(args, budget, for_doc):
if budget_against_field and args.get(budget_against_field):
condition += " and child.%s = '%s'" % (budget_against_field, args.get(budget_against_field))
if args.get('fiscal_year'):
date_field = 'schedule_date' if for_doc == 'Material Request' else 'transaction_date'
start_date, end_date = frappe.db.get_value('Fiscal Year', args.get('fiscal_year'),
['year_start_date', 'year_end_date'])
if args.get("fiscal_year"):
date_field = "schedule_date" if for_doc == "Material Request" else "transaction_date"
start_date, end_date = frappe.db.get_value(
"Fiscal Year", args.get("fiscal_year"), ["year_start_date", "year_end_date"]
)
condition += """ and parent.%s
between '%s' and '%s' """ %(date_field, start_date, end_date)
between '%s' and '%s' """ % (
date_field,
start_date,
end_date,
)
return condition
def get_actual_expense(args):
if not args.budget_against_doctype:
args.budget_against_doctype = frappe.unscrub(args.budget_against_field)
budget_against_field = args.get('budget_against_field')
condition1 = " and gle.posting_date <= %(month_end_date)s" \
if args.get("month_end_date") else ""
budget_against_field = args.get("budget_against_field")
condition1 = " and gle.posting_date <= %(month_end_date)s" if args.get("month_end_date") else ""
if args.is_tree:
lft_rgt = frappe.db.get_value(args.budget_against_doctype,
args.get(budget_against_field), ["lft", "rgt"], as_dict=1)
lft_rgt = frappe.db.get_value(
args.budget_against_doctype, args.get(budget_against_field), ["lft", "rgt"], as_dict=1
)
args.update(lft_rgt)
condition2 = """and exists(select name from `tab{doctype}`
where lft>=%(lft)s and rgt<=%(rgt)s
and name=gle.{budget_against_field})""".format(doctype=args.budget_against_doctype, #nosec
budget_against_field=budget_against_field)
and name=gle.{budget_against_field})""".format(
doctype=args.budget_against_doctype, budget_against_field=budget_against_field # nosec
)
else:
condition2 = """and exists(select name from `tab{doctype}`
where name=gle.{budget_against} and
gle.{budget_against} = %({budget_against})s)""".format(doctype=args.budget_against_doctype,
budget_against = budget_against_field)
gle.{budget_against} = %({budget_against})s)""".format(
doctype=args.budget_against_doctype, budget_against=budget_against_field
)
amount = flt(frappe.db.sql("""
amount = flt(
frappe.db.sql(
"""
select sum(gle.debit) - sum(gle.credit)
from `tabGL Entry` gle
where gle.account=%(account)s
@@ -282,46 +357,59 @@ def get_actual_expense(args):
and gle.company=%(company)s
and gle.docstatus=1
{condition2}
""".format(condition1=condition1, condition2=condition2), (args))[0][0]) #nosec
""".format(
condition1=condition1, condition2=condition2
),
(args),
)[0][0]
) # nosec
return amount
def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_year, annual_budget):
distribution = {}
if monthly_distribution:
for d in frappe.db.sql("""select mdp.month, mdp.percentage_allocation
for d in frappe.db.sql(
"""select mdp.month, mdp.percentage_allocation
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
where mdp.parent=md.name and md.fiscal_year=%s""", fiscal_year, as_dict=1):
distribution.setdefault(d.month, d.percentage_allocation)
where mdp.parent=md.name and md.fiscal_year=%s""",
fiscal_year,
as_dict=1,
):
distribution.setdefault(d.month, d.percentage_allocation)
dt = frappe.db.get_value("Fiscal Year", fiscal_year, "year_start_date")
accumulated_percentage = 0.0
while(dt <= getdate(posting_date)):
while dt <= getdate(posting_date):
if monthly_distribution:
accumulated_percentage += distribution.get(getdate(dt).strftime("%B"), 0)
else:
accumulated_percentage += 100.0/12
accumulated_percentage += 100.0 / 12
dt = add_months(dt, 1)
return annual_budget * accumulated_percentage / 100
def get_item_details(args):
cost_center, expense_account = None, None
if not args.get('company'):
if not args.get("company"):
return cost_center, expense_account
if args.item_code:
item_defaults = frappe.db.get_value('Item Default',
{'parent': args.item_code, 'company': args.get('company')},
['buying_cost_center', 'expense_account'])
item_defaults = frappe.db.get_value(
"Item Default",
{"parent": args.item_code, "company": args.get("company")},
["buying_cost_center", "expense_account"],
)
if item_defaults:
cost_center, expense_account = item_defaults
if not (cost_center and expense_account):
for doctype in ['Item Group', 'Company']:
for doctype in ["Item Group", "Company"]:
data = get_expense_cost_center(doctype, args)
if not cost_center and data:
@@ -335,11 +423,15 @@ def get_item_details(args):
return cost_center, expense_account
def get_expense_cost_center(doctype, args):
if doctype == 'Item Group':
return frappe.db.get_value('Item Default',
{'parent': args.get(frappe.scrub(doctype)), 'company': args.get('company')},
['buying_cost_center', 'expense_account'])
if doctype == "Item Group":
return frappe.db.get_value(
"Item Default",
{"parent": args.get(frappe.scrub(doctype)), "company": args.get("company")},
["buying_cost_center", "expense_account"],
)
else:
return frappe.db.get_value(doctype, args.get(frappe.scrub(doctype)),\
['cost_center', 'default_expense_account'])
return frappe.db.get_value(
doctype, args.get(frappe.scrub(doctype)), ["cost_center", "default_expense_account"]
)

View File

@@ -11,7 +11,8 @@ from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journ
from erpnext.accounts.utils import get_fiscal_year
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
test_dependencies = ['Monthly Distribution']
test_dependencies = ["Monthly Distribution"]
class TestBudget(unittest.TestCase):
def test_monthly_budget_crossed_ignore(self):
@@ -19,11 +20,18 @@ class TestBudget(unittest.TestCase):
budget = make_budget(budget_against="Cost Center")
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 40000, "_Test Cost Center - _TC", posting_date=nowdate(), submit=True)
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
40000,
"_Test Cost Center - _TC",
posting_date=nowdate(),
submit=True,
)
self.assertTrue(frappe.db.get_value("GL Entry",
{"voucher_type": "Journal Entry", "voucher_no": jv.name}))
self.assertTrue(
frappe.db.get_value("GL Entry", {"voucher_type": "Journal Entry", "voucher_no": jv.name})
)
budget.cancel()
jv.cancel()
@@ -33,10 +41,17 @@ class TestBudget(unittest.TestCase):
budget = make_budget(budget_against="Cost Center")
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 40000, "_Test Cost Center - _TC", posting_date=nowdate())
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
40000,
"_Test Cost Center - _TC",
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
@@ -48,49 +63,65 @@ class TestBudget(unittest.TestCase):
budget = make_budget(budget_against="Cost Center")
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 40000, "_Test Cost Center - _TC", posting_date=nowdate())
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
40000,
"_Test Cost Center - _TC",
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
frappe.db.set_value('Company', budget.company, 'exception_budget_approver_role', 'Accounts User')
frappe.db.set_value("Company", budget.company, "exception_budget_approver_role", "Accounts User")
jv.submit()
self.assertEqual(frappe.db.get_value('Journal Entry', jv.name, 'docstatus'), 1)
self.assertEqual(frappe.db.get_value("Journal Entry", jv.name, "docstatus"), 1)
jv.cancel()
frappe.db.set_value('Company', budget.company, 'exception_budget_approver_role', '')
frappe.db.set_value("Company", budget.company, "exception_budget_approver_role", "")
budget.load_from_db()
budget.cancel()
def test_monthly_budget_crossed_for_mr(self):
budget = make_budget(applicable_on_material_request=1,
applicable_on_purchase_order=1, action_if_accumulated_monthly_budget_exceeded_on_mr="Stop",
budget_against="Cost Center")
budget = make_budget(
applicable_on_material_request=1,
applicable_on_purchase_order=1,
action_if_accumulated_monthly_budget_exceeded_on_mr="Stop",
budget_against="Cost Center",
)
fiscal_year = get_fiscal_year(nowdate())[0]
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
frappe.db.set_value("Budget", budget.name, "fiscal_year", fiscal_year)
mr = frappe.get_doc({
"doctype": "Material Request",
"material_request_type": "Purchase",
"transaction_date": nowdate(),
"company": budget.company,
"items": [{
'item_code': '_Test Item',
'qty': 1,
'uom': "_Test UOM",
'warehouse': '_Test Warehouse - _TC',
'schedule_date': nowdate(),
'rate': 100000,
'expense_account': '_Test Account Cost for Goods Sold - _TC',
'cost_center': '_Test Cost Center - _TC'
}]
})
mr = frappe.get_doc(
{
"doctype": "Material Request",
"material_request_type": "Purchase",
"transaction_date": nowdate(),
"company": budget.company,
"items": [
{
"item_code": "_Test Item",
"qty": 1,
"uom": "_Test UOM",
"warehouse": "_Test Warehouse - _TC",
"schedule_date": nowdate(),
"rate": 100000,
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
}
],
}
)
mr.set_missing_values()
@@ -100,11 +131,16 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_monthly_budget_crossed_for_po(self):
budget = make_budget(applicable_on_purchase_order=1,
action_if_accumulated_monthly_budget_exceeded_on_po="Stop", budget_against="Cost Center")
budget = make_budget(
applicable_on_purchase_order=1,
action_if_accumulated_monthly_budget_exceeded_on_po="Stop",
budget_against="Cost Center",
)
fiscal_year = get_fiscal_year(nowdate())[0]
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
frappe.db.set_value("Budget", budget.name, "fiscal_year", fiscal_year)
po = create_purchase_order(transaction_date=nowdate(), do_not_submit=True)
@@ -122,12 +158,20 @@ class TestBudget(unittest.TestCase):
budget = make_budget(budget_against="Project")
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
project = frappe.get_value("Project", {"project_name": "_Test Project"})
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 40000, "_Test Cost Center - _TC", project=project, posting_date=nowdate())
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
40000,
"_Test Cost Center - _TC",
project=project,
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
@@ -139,8 +183,13 @@ class TestBudget(unittest.TestCase):
budget = make_budget(budget_against="Cost Center")
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 250000, "_Test Cost Center - _TC", posting_date=nowdate())
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
250000,
"_Test Cost Center - _TC",
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
@@ -153,9 +202,14 @@ class TestBudget(unittest.TestCase):
project = frappe.get_value("Project", {"project_name": "_Test Project"})
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 250000, "_Test Cost Center - _TC",
project=project, posting_date=nowdate())
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
250000,
"_Test Cost Center - _TC",
project=project,
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
@@ -169,14 +223,23 @@ class TestBudget(unittest.TestCase):
if month > 9:
month = 9
for i in range(month+1):
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 20000, "_Test Cost Center - _TC", posting_date=nowdate(), submit=True)
for i in range(month + 1):
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
20000,
"_Test Cost Center - _TC",
posting_date=nowdate(),
submit=True,
)
self.assertTrue(frappe.db.get_value("GL Entry",
{"voucher_type": "Journal Entry", "voucher_no": jv.name}))
self.assertTrue(
frappe.db.get_value("GL Entry", {"voucher_type": "Journal Entry", "voucher_no": jv.name})
)
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
self.assertRaises(BudgetError, jv.cancel)
@@ -193,14 +256,23 @@ class TestBudget(unittest.TestCase):
project = frappe.get_value("Project", {"project_name": "_Test Project"})
for i in range(month + 1):
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 20000, "_Test Cost Center - _TC", posting_date=nowdate(), submit=True,
project=project)
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
20000,
"_Test Cost Center - _TC",
posting_date=nowdate(),
submit=True,
project=project,
)
self.assertTrue(frappe.db.get_value("GL Entry",
{"voucher_type": "Journal Entry", "voucher_no": jv.name}))
self.assertTrue(
frappe.db.get_value("GL Entry", {"voucher_type": "Journal Entry", "voucher_no": jv.name})
)
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
self.assertRaises(BudgetError, jv.cancel)
@@ -212,10 +284,17 @@ class TestBudget(unittest.TestCase):
set_total_expense_zero(nowdate(), "cost_center", "_Test Cost Center 2 - _TC")
budget = make_budget(budget_against="Cost Center", cost_center="_Test Company - _TC")
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 40000, "_Test Cost Center 2 - _TC", posting_date=nowdate())
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
40000,
"_Test Cost Center 2 - _TC",
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
@@ -226,19 +305,28 @@ class TestBudget(unittest.TestCase):
cost_center = "_Test Cost Center 3 - _TC"
if not frappe.db.exists("Cost Center", cost_center):
frappe.get_doc({
'doctype': 'Cost Center',
'cost_center_name': '_Test Cost Center 3',
'parent_cost_center': "_Test Company - _TC",
'company': '_Test Company',
'is_group': 0
}).insert(ignore_permissions=True)
frappe.get_doc(
{
"doctype": "Cost Center",
"cost_center_name": "_Test Cost Center 3",
"parent_cost_center": "_Test Company - _TC",
"company": "_Test Company",
"is_group": 0,
}
).insert(ignore_permissions=True)
budget = make_budget(budget_against="Cost Center", cost_center=cost_center)
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value(
"Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop"
)
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 40000, cost_center, posting_date=nowdate())
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
40000,
cost_center,
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
@@ -246,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":
@@ -255,14 +376,16 @@ def set_total_expense_zero(posting_date, budget_against_field=None, budget_again
fiscal_year = get_fiscal_year(nowdate())[0]
args = frappe._dict({
"account": "_Test Account Cost for Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"monthly_end_date": posting_date,
"company": "_Test Company",
"fiscal_year": fiscal_year,
"budget_against_field": budget_against_field,
})
args = frappe._dict(
{
"account": "_Test Account Cost for Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"monthly_end_date": posting_date,
"company": "_Test Company",
"fiscal_year": fiscal_year,
"budget_against_field": budget_against_field,
}
)
if not args.get(budget_against_field):
args[budget_against_field] = budget_against
@@ -271,26 +394,42 @@ def set_total_expense_zero(posting_date, budget_against_field=None, budget_again
if existing_expense:
if budget_against_field == "cost_center":
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", -existing_expense, "_Test Cost Center - _TC", posting_date=nowdate(), submit=True)
make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
-existing_expense,
"_Test Cost Center - _TC",
posting_date=nowdate(),
submit=True,
)
elif budget_against_field == "project":
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", -existing_expense, "_Test Cost Center - _TC", submit=True, project=budget_against, posting_date=nowdate())
make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
-existing_expense,
"_Test Cost Center - _TC",
submit=True,
project=budget_against,
posting_date=nowdate(),
)
def make_budget(**args):
args = frappe._dict(args)
budget_against=args.budget_against
cost_center=args.cost_center
budget_against = args.budget_against
cost_center = args.cost_center
fiscal_year = get_fiscal_year(nowdate())[0]
if budget_against == "Project":
project_name = "{0}%".format("_Test Project/" + fiscal_year)
budget_list = frappe.get_all("Budget", fields=["name"], filters = {"name": ("like", project_name)})
budget_list = frappe.get_all("Budget", fields=["name"], filters={"name": ("like", project_name)})
else:
cost_center_name = "{0}%".format(cost_center or "_Test Cost Center - _TC/" + fiscal_year)
budget_list = frappe.get_all("Budget", fields=["name"], filters = {"name": ("like", cost_center_name)})
budget_list = frappe.get_all(
"Budget", fields=["name"], filters={"name": ("like", cost_center_name)}
)
for d in budget_list:
frappe.db.sql("delete from `tabBudget` where name = %(name)s", d)
frappe.db.sql("delete from `tabBudget Account` where parent = %(name)s", d)
@@ -300,7 +439,7 @@ def make_budget(**args):
if budget_against == "Project":
budget.project = frappe.get_value("Project", {"project_name": "_Test Project"})
else:
budget.cost_center =cost_center or "_Test Cost Center - _TC"
budget.cost_center = cost_center or "_Test Cost Center - _TC"
monthly_distribution = frappe.get_doc("Monthly Distribution", "_Test Distribution")
monthly_distribution.fiscal_year = fiscal_year
@@ -312,20 +451,27 @@ def make_budget(**args):
budget.action_if_annual_budget_exceeded = "Stop"
budget.action_if_accumulated_monthly_budget_exceeded = "Ignore"
budget.budget_against = budget_against
budget.append("accounts", {
"account": "_Test Account Cost for Goods Sold - _TC",
"budget_amount": 200000
})
budget.append(
"accounts", {"account": "_Test Account Cost for Goods Sold - _TC", "budget_amount": 200000}
)
if args.applicable_on_material_request:
budget.applicable_on_material_request = 1
budget.action_if_annual_budget_exceeded_on_mr = args.action_if_annual_budget_exceeded_on_mr or 'Warn'
budget.action_if_accumulated_monthly_budget_exceeded_on_mr = args.action_if_accumulated_monthly_budget_exceeded_on_mr or 'Warn'
budget.action_if_annual_budget_exceeded_on_mr = (
args.action_if_annual_budget_exceeded_on_mr or "Warn"
)
budget.action_if_accumulated_monthly_budget_exceeded_on_mr = (
args.action_if_accumulated_monthly_budget_exceeded_on_mr or "Warn"
)
if args.applicable_on_purchase_order:
budget.applicable_on_purchase_order = 1
budget.action_if_annual_budget_exceeded_on_po = args.action_if_annual_budget_exceeded_on_po or 'Warn'
budget.action_if_accumulated_monthly_budget_exceeded_on_po = args.action_if_accumulated_monthly_budget_exceeded_on_po or 'Warn'
budget.action_if_annual_budget_exceeded_on_po = (
args.action_if_annual_budget_exceeded_on_po or "Warn"
)
budget.action_if_accumulated_monthly_budget_exceeded_on_po = (
args.action_if_accumulated_monthly_budget_exceeded_on_po or "Warn"
)
budget.insert()
budget.submit()

View File

@@ -1 +0,0 @@
C Form (India specific only) - Will be deprecated.

View File

@@ -1,43 +0,0 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//c-form js file
// -----------------------------
frappe.ui.form.on('C-Form', {
setup(frm) {
frm.fields_dict.invoices.grid.get_field("invoice_no").get_query = function(doc) {
return {
filters: {
"docstatus": 1,
"customer": doc.customer,
"company": doc.company,
"c_form_applicable": 'Yes',
"c_form_no": ''
}
};
}
frm.fields_dict.state.get_query = function() {
return {
filters: {
country: "India"
}
};
}
}
});
frappe.ui.form.on('C-Form Invoice Detail', {
invoice_no(frm, cdt, cdn) {
let d = frappe.get_doc(cdt, cdn);
if (d.invoice_no) {
frm.call('get_invoice_details', {
invoice_no: d.invoice_no
}).then(r => {
frappe.model.set_value(cdt, cdn, r.message);
});
}
}
});

View File

@@ -1,511 +0,0 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
"beta": 0,
"creation": "2013-03-07 11:55:06",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"fieldname": "naming_series",
"fieldtype": "Select",
"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": "Series",
"length": 0,
"no_copy": 0,
"options": "ACC-CF-.YYYY.-",
"permlevel": 0,
"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": 1,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "c_form_no",
"fieldtype": "Data",
"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": "C-Form No",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "received_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": "Received Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer",
"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": "Customer",
"length": 0,
"no_copy": 0,
"options": "Customer",
"permlevel": 0,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"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,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "50%",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "50%"
},
{
"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": 0,
"in_standard_filter": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "quarter",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Quarter",
"length": 0,
"no_copy": 0,
"options": "\nI\nII\nIII\nIV",
"permlevel": 0,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_amount",
"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 Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "state",
"fieldtype": "Data",
"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": "State",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break0",
"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,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "invoices",
"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": "Invoices",
"length": 0,
"no_copy": 0,
"options": "C-Form Invoice Detail",
"permlevel": 0,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_invoiced_amount",
"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 Invoiced Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"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
},
{
"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": 1,
"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": "C-Form",
"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
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-file-text",
"idx": 1,
"image_view": 0,
"in_create": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 3,
"modified": "2018-08-21 14:44:30.558767",
"modified_by": "Administrator",
"module": "Accounts",
"name": "C-Form",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 1,
"print": 0,
"read": 1,
"report": 1,
"role": "All",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_order": "DESC",
"timeline_field": "customer",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,72 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt
class CForm(Document):
def validate(self):
"""Validate invoice that c-form is applicable
and no other c-form is received for that"""
for d in self.get('invoices'):
if d.invoice_no:
inv = frappe.db.sql("""select c_form_applicable, c_form_no from
`tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no)
if inv and inv[0][0] != 'Yes':
frappe.throw(_("C-form is not applicable for Invoice: {0}").format(d.invoice_no))
elif inv and inv[0][1] and inv[0][1] != self.name:
frappe.throw(_("""Invoice {0} is tagged in another C-form: {1}.
If you want to change C-form no for this invoice,
please remove invoice no from the previous c-form and then try again"""\
.format(d.invoice_no, inv[0][1])))
elif not inv:
frappe.throw(_("Row {0}: Invoice {1} is invalid, it might be cancelled / does not exist. \
Please enter a valid Invoice".format(d.idx, d.invoice_no)))
def on_update(self):
""" Update C-Form No on invoices"""
self.set_total_invoiced_amount()
def on_submit(self):
self.set_cform_in_sales_invoices()
def before_cancel(self):
# remove cform reference
frappe.db.sql("""update `tabSales Invoice` set c_form_no=null where c_form_no=%s""", self.name)
def set_cform_in_sales_invoices(self):
inv = [d.invoice_no for d in self.get('invoices')]
if inv:
frappe.db.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s where name in (%s)""" %
('%s', '%s', ', '.join(['%s'] * len(inv))), tuple([self.name, self.modified] + inv))
frappe.db.sql("""update `tabSales Invoice` set c_form_no = null, modified = %s
where name not in (%s) and ifnull(c_form_no, '') = %s""" %
('%s', ', '.join(['%s']*len(inv)), '%s'), tuple([self.modified] + inv + [self.name]))
else:
frappe.throw(_("Please enter atleast 1 invoice in the table"))
def set_total_invoiced_amount(self):
total = sum(flt(d.grand_total) for d in self.get('invoices'))
frappe.db.set(self, 'total_invoiced_amount', total)
@frappe.whitelist()
def get_invoice_details(self, invoice_no):
""" Pull details from invoices for referrence """
if invoice_no:
inv = frappe.db.get_value("Sales Invoice", invoice_no,
["posting_date", "territory", "base_net_total", "base_grand_total"], as_dict=True)
return {
'invoice_date' : inv.posting_date,
'territory' : inv.territory,
'net_total' : inv.base_net_total,
'grand_total' : inv.base_grand_total
}

View File

@@ -1,9 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
# test_records = frappe.get_test_records('C-Form')
class TestCForm(unittest.TestCase):
pass

View File

@@ -1 +0,0 @@
Invoice detail for parent C-Form.

View File

@@ -1,168 +0,0 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2013-02-22 01:27:38",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 1,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "invoice_no",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Invoice No",
"length": 0,
"no_copy": 0,
"options": "Sales Invoice",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "160px",
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "160px"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "invoice_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Invoice Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "120px",
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "120px"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "",
"fieldname": "territory",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Territory",
"length": 0,
"no_copy": 0,
"options": "Territory",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "120px",
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "120px"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "net_total",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Net Total",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "120px",
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "120px"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "grand_total",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Grand Total",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "120px",
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "120px"
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 1,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:27:58.768719",
"modified_by": "Administrator",
"module": "Accounts",
"name": "C-Form Invoice Detail",
"owner": "Administrator",
"permissions": [],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"track_seen": 0
}

View File

@@ -1,9 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from frappe.model.document import Document
class CFormInvoiceDetail(Document):
pass

View File

@@ -1,25 +1,25 @@
DEFAULT_MAPPERS = [
{
'doctype': 'Cash Flow Mapper',
'section_footer': 'Net cash generated by operating activities',
'section_header': 'Cash flows from operating activities',
'section_leader': 'Adjustments for',
'section_name': 'Operating Activities',
'position': 0,
'section_subtotal': 'Cash generated from operations',
},
{
'doctype': 'Cash Flow Mapper',
'position': 1,
'section_footer': 'Net cash used in investing activities',
'section_header': 'Cash flows from investing activities',
'section_name': 'Investing Activities'
},
{
'doctype': 'Cash Flow Mapper',
'position': 2,
'section_footer': 'Net cash used in financing activites',
'section_header': 'Cash flows from financing activities',
'section_name': 'Financing Activities',
}
{
"doctype": "Cash Flow Mapper",
"section_footer": "Net cash generated by operating activities",
"section_header": "Cash flows from operating activities",
"section_leader": "Adjustments for",
"section_name": "Operating Activities",
"position": 0,
"section_subtotal": "Cash generated from operations",
},
{
"doctype": "Cash Flow Mapper",
"position": 1,
"section_footer": "Net cash used in investing activities",
"section_header": "Cash flows from investing activities",
"section_name": "Investing Activities",
},
{
"doctype": "Cash Flow Mapper",
"position": 2,
"section_footer": "Net cash used in financing activites",
"section_header": "Cash flows from financing activities",
"section_name": "Financing Activities",
},
]

View File

@@ -3,6 +3,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
@@ -11,9 +12,11 @@ class CashFlowMapping(Document):
self.validate_checked_options()
def validate_checked_options(self):
checked_fields = [d for d in self.meta.fields if d.fieldtype == 'Check' and self.get(d.fieldname) == 1]
checked_fields = [
d for d in self.meta.fields if d.fieldtype == "Check" and self.get(d.fieldname) == 1
]
if len(checked_fields) > 1:
frappe.throw(
frappe._('You can only select a maximum of one option from the list of check boxes.'),
title='Error'
_("You can only select a maximum of one option from the list of check boxes."),
title=_("Error"),
)

View File

@@ -9,19 +9,16 @@ import frappe
class TestCashFlowMapping(unittest.TestCase):
def setUp(self):
if frappe.db.exists("Cash Flow Mapping", "Test Mapping"):
frappe.delete_doc('Cash Flow Mappping', 'Test Mapping')
frappe.delete_doc("Cash Flow Mappping", "Test Mapping")
def tearDown(self):
frappe.delete_doc('Cash Flow Mapping', 'Test Mapping')
frappe.delete_doc("Cash Flow Mapping", "Test Mapping")
def test_multiple_selections_not_allowed(self):
doc = frappe.new_doc('Cash Flow Mapping')
doc.mapping_name = 'Test Mapping'
doc.label = 'Test label'
doc.append(
'accounts',
{'account': 'Accounts Receivable - _TC'}
)
doc = frappe.new_doc("Cash Flow Mapping")
doc.mapping_name = "Test Mapping"
doc.label = "Test label"
doc.append("accounts", {"account": "Accounts Receivable - _TC"})
doc.is_working_capital = 1
doc.is_finance_cost = 1

View File

@@ -17,11 +17,14 @@ class CashierClosing(Document):
self.make_calculations()
def get_outstanding(self):
values = frappe.db.sql("""
values = frappe.db.sql(
"""
select sum(outstanding_amount)
from `tabSales Invoice`
where posting_date=%s and posting_time>=%s and posting_time<=%s and owner=%s
""", (self.date, self.from_time, self.time, self.user))
""",
(self.date, self.from_time, self.time, self.user),
)
self.outstanding_amount = flt(values[0][0] if values else 0)
def make_calculations(self):
@@ -29,7 +32,9 @@ class CashierClosing(Document):
for i in self.payments:
total += flt(i.amount)
self.net_amount = total + self.outstanding_amount + flt(self.expense) - flt(self.custody) + flt(self.returns)
self.net_amount = (
total + self.outstanding_amount + flt(self.expense) - flt(self.custody) + flt(self.returns)
)
def validate_time(self):
if self.from_time >= self.time:

View File

@@ -25,33 +25,41 @@ from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import
class ChartofAccountsImporter(Document):
def validate(self):
if self.import_file:
get_coa('Chart of Accounts Importer', 'All Accounts', file_name=self.import_file, for_validate=1)
get_coa(
"Chart of Accounts Importer", "All Accounts", file_name=self.import_file, for_validate=1
)
def validate_columns(data):
if not data:
frappe.throw(_('No data found. Seems like you uploaded a blank file'))
frappe.throw(_("No data found. Seems like you uploaded a blank file"))
no_of_columns = max([len(d) for d in data])
if no_of_columns > 7:
frappe.throw(_('More columns found than expected. Please compare the uploaded file with standard template'),
title=(_("Wrong Template")))
frappe.throw(
_("More columns found than expected. Please compare the uploaded file with standard template"),
title=(_("Wrong Template")),
)
@frappe.whitelist()
def validate_company(company):
parent_company, allow_account_creation_against_child_company = frappe.db.get_value('Company',
{'name': company}, ['parent_company',
'allow_account_creation_against_child_company'])
parent_company, allow_account_creation_against_child_company = frappe.db.get_value(
"Company", {"name": company}, ["parent_company", "allow_account_creation_against_child_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.throw(msg, title=_('Wrong Company'))
frappe.bold(_("Allow Account Creation Against Child Company"))
)
frappe.throw(msg, title=_("Wrong Company"))
if frappe.db.get_all('GL Entry', {"company": company}, "name", limit=1):
if frappe.db.get_all("GL Entry", {"company": company}, "name", limit=1):
return False
@frappe.whitelist()
def import_coa(file_name, company):
# delete existing data for accounts
@@ -60,7 +68,7 @@ def import_coa(file_name, company):
# create accounts
file_doc, extension = get_file(file_name)
if extension == 'csv':
if extension == "csv":
data = generate_data_from_csv(file_doc)
else:
data = generate_data_from_excel(file_doc, extension)
@@ -72,27 +80,33 @@ def import_coa(file_name, company):
# trigger on_update for company to reset default accounts
set_default_accounts(company)
def get_file(file_name):
file_doc = frappe.get_doc("File", {"file_url": file_name})
parts = file_doc.get_extension()
extension = parts[1]
extension = extension.lstrip(".")
if extension not in ('csv', 'xlsx', 'xls'):
frappe.throw(_("Only CSV and Excel files can be used to for importing data. Please check the file format you are trying to upload"))
if extension not in ("csv", "xlsx", "xls"):
frappe.throw(
_(
"Only CSV and Excel files can be used to for importing data. Please check the file format you are trying to upload"
)
)
return file_doc, extension
return file_doc, extension
def generate_data_from_csv(file_doc, as_dict=False):
''' read csv file and return the generated nested tree '''
"""read csv file and return the generated nested tree"""
file_path = file_doc.get_full_path()
data = []
with open(file_path, 'r') as in_file:
with open(file_path, "r") as in_file:
csv_reader = list(csv.reader(in_file))
headers = csv_reader[0]
del csv_reader[0] # delete top row and headers row
del csv_reader[0] # delete top row and headers row
for row in csv_reader:
if as_dict:
@@ -106,6 +120,7 @@ def generate_data_from_csv(file_doc, as_dict=False):
# convert csv data
return data
def generate_data_from_excel(file_doc, extension, as_dict=False):
content = file_doc.get_content()
@@ -123,20 +138,21 @@ def generate_data_from_excel(file_doc, extension, as_dict=False):
data.append({frappe.scrub(header): row[index] for index, header in enumerate(headers)})
else:
if not row[1]:
row[1] = row[0]
row[3] = row[2]
row[1] = row[0]
row[3] = row[2]
data.append(row)
return data
@frappe.whitelist()
def get_coa(doctype, parent, is_root=False, file_name=None, for_validate=0):
''' called by tree view (to fetch node's children) '''
"""called by tree view (to fetch node's children)"""
file_doc, extension = get_file(file_name)
parent = None if parent==_('All Accounts') else parent
parent = None if parent == _("All Accounts") else parent
if extension == 'csv':
if extension == "csv":
data = generate_data_from_csv(file_doc)
else:
data = generate_data_from_excel(file_doc, extension)
@@ -146,32 +162,33 @@ def get_coa(doctype, parent, is_root=False, file_name=None, for_validate=0):
if not for_validate:
forest = build_forest(data)
accounts = build_tree_from_json("", chart_data=forest, from_coa_importer=True) # returns a list of dict in a tree render-able form
accounts = build_tree_from_json(
"", chart_data=forest, from_coa_importer=True
) # returns a list of dict in a tree render-able form
# filter out to show data for the selected node only
accounts = [d for d in accounts if d['parent_account']==parent]
accounts = [d for d in accounts if d["parent_account"] == parent]
return accounts
else:
return {
'show_import_button': 1
}
return {"show_import_button": 1}
def build_forest(data):
'''
converts list of list into a nested tree
if a = [[1,1], [1,2], [3,2], [4,4], [5,4]]
tree = {
1: {
2: {
3: {}
}
},
4: {
5: {}
}
}
'''
"""
converts list of list into a nested tree
if a = [[1,1], [1,2], [3,2], [4,4], [5,4]]
tree = {
1: {
2: {
3: {}
}
},
4: {
5: {}
}
}
"""
# set the value of nested dictionary
def set_nested(d, path, value):
@@ -195,8 +212,11 @@ def build_forest(data):
elif account_name == child:
parent_account_list = return_parent(data, parent_account)
if not parent_account_list and parent_account:
frappe.throw(_("The parent account {0} does not exists in the uploaded template").format(
frappe.bold(parent_account)))
frappe.throw(
_("The parent account {0} does not exists in the uploaded template").format(
frappe.bold(parent_account)
)
)
return [child] + parent_account_list
charts_map, paths = {}, []
@@ -205,7 +225,15 @@ def build_forest(data):
error_messages = []
for i in data:
account_name, parent_account, account_number, parent_account_number, is_group, account_type, root_type = i
(
account_name,
parent_account,
account_number,
parent_account_number,
is_group,
account_type,
root_type,
) = i
if not account_name:
error_messages.append("Row {0}: Please enter Account Name".format(line_no))
@@ -216,13 +244,17 @@ def build_forest(data):
account_name = "{} - {}".format(account_number, account_name)
charts_map[account_name] = {}
charts_map[account_name]['account_name'] = name
if account_number: charts_map[account_name]["account_number"] = account_number
if cint(is_group) == 1: charts_map[account_name]["is_group"] = is_group
if account_type: charts_map[account_name]["account_type"] = account_type
if root_type: charts_map[account_name]["root_type"] = root_type
charts_map[account_name]["account_name"] = name
if account_number:
charts_map[account_name]["account_number"] = account_number
if cint(is_group) == 1:
charts_map[account_name]["is_group"] = is_group
if account_type:
charts_map[account_name]["account_type"] = account_type
if root_type:
charts_map[account_name]["root_type"] = root_type
path = return_parent(data, account_name)[::-1]
paths.append(path) # List of path is created
paths.append(path) # List of path is created
line_no += 1
if error_messages:
@@ -231,27 +263,32 @@ def build_forest(data):
out = {}
for path in paths:
for n, account_name in enumerate(path):
set_nested(out, path[:n+1], charts_map[account_name]) # setting the value of nested dictionary.
set_nested(
out, path[: n + 1], charts_map[account_name]
) # setting the value of nested dictionary.
return out
def build_response_as_excel(writer):
filename = frappe.generate_hash("", 10)
with open(filename, 'wb') as f:
f.write(cstr(writer.getvalue()).encode('utf-8'))
with open(filename, "wb") as f:
f.write(cstr(writer.getvalue()).encode("utf-8"))
f = open(filename)
reader = csv.reader(f)
from frappe.utils.xlsxutils import make_xlsx
xlsx_file = make_xlsx(reader, "Chart of Accounts Importer Template")
f.close()
os.remove(filename)
# write out response as a xlsx type
frappe.response['filename'] = 'coa_importer_template.xlsx'
frappe.response['filecontent'] = xlsx_file.getvalue()
frappe.response['type'] = 'binary'
frappe.response["filename"] = "coa_importer_template.xlsx"
frappe.response["filecontent"] = xlsx_file.getvalue()
frappe.response["type"] = "binary"
@frappe.whitelist()
def download_template(file_type, template_type):
@@ -259,34 +296,46 @@ def download_template(file_type, template_type):
writer = get_template(template_type)
if file_type == 'CSV':
if file_type == "CSV":
# download csv file
frappe.response['result'] = cstr(writer.getvalue())
frappe.response['type'] = 'csv'
frappe.response['doctype'] = 'Chart of Accounts Importer'
frappe.response["result"] = cstr(writer.getvalue())
frappe.response["type"] = "csv"
frappe.response["doctype"] = "Chart of Accounts Importer"
else:
build_response_as_excel(writer)
def get_template(template_type):
fields = ["Account Name", "Parent Account", "Account Number", "Parent Account Number", "Is Group", "Account Type", "Root Type"]
fields = [
"Account Name",
"Parent Account",
"Account Number",
"Parent Account Number",
"Is Group",
"Account Type",
"Root Type",
]
writer = UnicodeWriter()
writer.writerow(fields)
if template_type == 'Blank Template':
for root_type in get_root_types():
writer.writerow(['', '', '', 1, '', root_type])
if template_type == "Blank Template":
for root_type in get_root_types():
writer.writerow(["", "", "", 1, "", root_type])
for account in get_mandatory_group_accounts():
writer.writerow(['', '', '', 1, account, "Asset"])
writer.writerow(["", "", "", 1, account, "Asset"])
for account_type in get_mandatory_account_types():
writer.writerow(['', '', '', 0, account_type.get('account_type'), account_type.get('root_type')])
writer.writerow(
["", "", "", 0, account_type.get("account_type"), account_type.get("root_type")]
)
else:
writer = get_sample_template(writer)
return writer
def get_sample_template(writer):
template = [
["Application Of Funds(Assets)", "", "", "", 1, "", "Asset"],
@@ -316,7 +365,7 @@ def get_sample_template(writer):
@frappe.whitelist()
def validate_accounts(file_doc, extension):
if extension == 'csv':
if extension == "csv":
accounts = generate_data_from_csv(file_doc, as_dict=True)
else:
accounts = generate_data_from_excel(file_doc, extension, as_dict=True)
@@ -325,7 +374,9 @@ def validate_accounts(file_doc, extension):
for account in accounts:
accounts_dict.setdefault(account["account_name"], account)
if "parent_account" not in account:
msg = _("Please make sure the file you are using has 'Parent Account' column present in the header.")
msg = _(
"Please make sure the file you are using has 'Parent Account' column present in the header."
)
msg += "<br><br>"
msg += _("Alternatively, you can download the template and fill your data in.")
frappe.throw(msg, title=_("Parent Account Missing"))
@@ -336,77 +387,106 @@ def validate_accounts(file_doc, extension):
return [True, len(accounts)]
def validate_root(accounts):
roots = [accounts[d] for d in accounts if not accounts[d].get('parent_account')]
roots = [accounts[d] for d in accounts if not accounts[d].get("parent_account")]
error_messages = []
for account in roots:
if not account.get("root_type") and account.get("account_name"):
error_messages.append(_("Please enter Root Type for account- {0}").format(account.get("account_name")))
error_messages.append(
_("Please enter Root Type for account- {0}").format(account.get("account_name"))
)
elif account.get("root_type") not in get_root_types() and account.get("account_name"):
error_messages.append(_("Root Type for {0} must be one of the Asset, Liability, Income, Expense and Equity").format(account.get("account_name")))
error_messages.append(
_("Root Type for {0} must be one of the Asset, Liability, Income, Expense and Equity").format(
account.get("account_name")
)
)
validate_missing_roots(roots)
if error_messages:
frappe.throw("<br>".join(error_messages))
def validate_missing_roots(roots):
root_types_added = set(d.get('root_type') for d in roots)
root_types_added = set(d.get("root_type") for d in roots)
missing = list(set(get_root_types()) - root_types_added)
if missing:
frappe.throw(_("Please add Root Account for - {0}").format(' , '.join(missing)))
frappe.throw(_("Please add Root Account for - {0}").format(" , ".join(missing)))
def get_root_types():
return ('Asset', 'Liability', 'Expense', 'Income', 'Equity')
return ("Asset", "Liability", "Expense", "Income", "Equity")
def get_report_type(root_type):
if root_type in ('Asset', 'Liability', 'Equity'):
return 'Balance Sheet'
if root_type in ("Asset", "Liability", "Equity"):
return "Balance Sheet"
else:
return 'Profit and Loss'
return "Profit and Loss"
def get_mandatory_group_accounts():
return ('Bank', 'Cash', 'Stock')
return ("Bank", "Cash", "Stock")
def get_mandatory_account_types():
return [
{'account_type': 'Cost of Goods Sold', 'root_type': 'Expense'},
{'account_type': 'Depreciation', 'root_type': 'Expense'},
{'account_type': 'Fixed Asset', 'root_type': 'Asset'},
{'account_type': 'Payable', 'root_type': 'Liability'},
{'account_type': 'Receivable', 'root_type': 'Asset'},
{'account_type': 'Stock Adjustment', 'root_type': 'Expense'},
{'account_type': 'Bank', 'root_type': 'Asset'},
{'account_type': 'Cash', 'root_type': 'Asset'},
{'account_type': 'Stock', 'root_type': 'Asset'}
{"account_type": "Cost of Goods Sold", "root_type": "Expense"},
{"account_type": "Depreciation", "root_type": "Expense"},
{"account_type": "Fixed Asset", "root_type": "Asset"},
{"account_type": "Payable", "root_type": "Liability"},
{"account_type": "Receivable", "root_type": "Asset"},
{"account_type": "Stock Adjustment", "root_type": "Expense"},
{"account_type": "Bank", "root_type": "Asset"},
{"account_type": "Cash", "root_type": "Asset"},
{"account_type": "Stock", "root_type": "Asset"},
]
def unset_existing_data(company):
linked = frappe.db.sql('''select fieldname from tabDocField
where fieldtype="Link" and options="Account" and parent="Company"''', as_dict=True)
linked = frappe.db.sql(
'''select fieldname from tabDocField
where fieldtype="Link" and options="Account" and parent="Company"''',
as_dict=True,
)
# remove accounts data from company
update_values = {d.fieldname: '' for d in linked}
frappe.db.set_value('Company', company, update_values, update_values)
update_values = {d.fieldname: "" for d in linked}
frappe.db.set_value("Company", company, update_values, update_values)
# remove accounts data from various doctypes
for doctype in ["Account", "Party Account", "Mode of Payment Account", "Tax Withholding Account",
"Sales Taxes and Charges Template", "Purchase Taxes and Charges Template"]:
frappe.db.sql('''delete from `tab{0}` where `company`="%s"''' # nosec
.format(doctype) % (company))
for doctype in [
"Account",
"Party Account",
"Mode of Payment Account",
"Tax Withholding Account",
"Sales Taxes and Charges Template",
"Purchase Taxes and Charges Template",
]:
frappe.db.sql(
'''delete from `tab{0}` where `company`="%s"'''.format(doctype) % (company) # nosec
)
def set_default_accounts(company):
from erpnext.setup.doctype.company.company import install_country_fixtures
company = frappe.get_doc('Company', company)
company.update({
"default_receivable_account": frappe.db.get_value("Account",
{"company": company.name, "account_type": "Receivable", "is_group": 0}),
"default_payable_account": frappe.db.get_value("Account",
{"company": company.name, "account_type": "Payable", "is_group": 0})
})
company = frappe.get_doc("Company", company)
company.update(
{
"default_receivable_account": frappe.db.get_value(
"Account", {"company": company.name, "account_type": "Receivable", "is_group": 0}
),
"default_payable_account": frappe.db.get_value(
"Account", {"company": company.name, "account_type": "Payable", "is_group": 0}
),
}
)
company.save()
install_country_fixtures(company.name, company.country)

View File

@@ -10,17 +10,20 @@ from frappe.model.document import Document
class ChequePrintTemplate(Document):
pass
@frappe.whitelist()
def create_or_update_cheque_print_format(template_name):
if not frappe.db.exists("Print Format", template_name):
cheque_print = frappe.new_doc("Print Format")
cheque_print.update({
"doc_type": "Payment Entry",
"standard": "No",
"custom_format": 1,
"print_format_type": "Jinja",
"name": template_name
})
cheque_print.update(
{
"doc_type": "Payment Entry",
"standard": "No",
"custom_format": 1,
"print_format_type": "Jinja",
"name": template_name,
}
)
else:
cheque_print = frappe.get_doc("Print Format", template_name)
@@ -69,10 +72,12 @@ def create_or_update_cheque_print_format(template_name):
{{doc.company}}
</span>
</div>
</div>"""%{
"starting_position_from_top_edge": doc.starting_position_from_top_edge \
if doc.cheque_size == "A4" else 0.0,
"cheque_width": doc.cheque_width, "cheque_height": doc.cheque_height,
</div>""" % {
"starting_position_from_top_edge": doc.starting_position_from_top_edge
if doc.cheque_size == "A4"
else 0.0,
"cheque_width": doc.cheque_width,
"cheque_height": doc.cheque_height,
"acc_pay_dist_from_top_edge": doc.acc_pay_dist_from_top_edge,
"acc_pay_dist_from_left_edge": doc.acc_pay_dist_from_left_edge,
"message_to_show": doc.message_to_show if doc.message_to_show else _("Account Pay Only"),
@@ -89,7 +94,7 @@ def create_or_update_cheque_print_format(template_name):
"amt_in_figures_from_top_edge": doc.amt_in_figures_from_top_edge,
"amt_in_figures_from_left_edge": doc.amt_in_figures_from_left_edge,
"signatory_from_top_edge": doc.signatory_from_top_edge,
"signatory_from_left_edge": doc.signatory_from_left_edge
"signatory_from_left_edge": doc.signatory_from_left_edge,
}
cheque_print.save(ignore_permissions=True)

View File

@@ -5,5 +5,6 @@ import unittest
# test_records = frappe.get_test_records('Cheque Print Template')
class TestChequePrintTemplate(unittest.TestCase):
pass

View File

@@ -10,11 +10,14 @@ from erpnext.accounts.utils import validate_field_number
class CostCenter(NestedSet):
nsm_parent_field = 'parent_cost_center'
nsm_parent_field = "parent_cost_center"
def autoname(self):
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.name = get_autoname_with_number(
self.cost_center_number, self.cost_center_name, self.company
)
def validate(self):
self.validate_mandatory()
@@ -28,9 +31,12 @@ class CostCenter(NestedSet):
def validate_parent_cost_center(self):
if self.parent_cost_center:
if not frappe.db.get_value('Cost Center', self.parent_cost_center, 'is_group'):
frappe.throw(_("{0} is not a group node. Please select a group node as parent cost center").format(
frappe.bold(self.parent_cost_center)))
if not frappe.db.get_value("Cost Center", self.parent_cost_center, "is_group"):
frappe.throw(
_("{0} is not a group node. Please select a group node as parent cost center").format(
frappe.bold(self.parent_cost_center)
)
)
@frappe.whitelist()
def convert_group_to_ledger(self):
@@ -48,7 +54,9 @@ class CostCenter(NestedSet):
if self.if_allocation_exists_against_cost_center():
frappe.throw(_("Cost Center with Allocation records can not be converted to a group"))
if self.check_if_part_of_cost_center_allocation():
frappe.throw(_("Cost Center is a part of Cost Center Allocation, hence cannot be converted to a group"))
frappe.throw(
_("Cost Center is a part of Cost Center Allocation, hence cannot be converted to a group")
)
if self.check_gle_exists():
frappe.throw(_("Cost Center with existing transactions can not be converted to group"))
self.is_group = 1
@@ -59,24 +67,26 @@ class CostCenter(NestedSet):
return frappe.db.get_value("GL Entry", {"cost_center": self.name})
def check_if_child_exists(self):
return frappe.db.sql("select name from `tabCost Center` where \
parent_cost_center = %s and docstatus != 2", self.name)
return frappe.db.sql(
"select name from `tabCost Center` where \
parent_cost_center = %s and docstatus != 2",
self.name,
)
def if_allocation_exists_against_cost_center(self):
return frappe.db.get_value("Cost Center Allocation", filters = {
"main_cost_center": self.name,
"docstatus": 1
})
return frappe.db.get_value(
"Cost Center Allocation", filters={"main_cost_center": self.name, "docstatus": 1}
)
def check_if_part_of_cost_center_allocation(self):
return frappe.db.get_value("Cost Center Allocation Percentage", filters = {
"cost_center": self.name,
"docstatus": 1
})
return frappe.db.get_value(
"Cost Center Allocation Percentage", filters={"cost_center": self.name, "docstatus": 1}
)
def before_rename(self, olddn, newdn, merge=False):
# Add company abbr if not provided
from erpnext.setup.doctype.company.company import get_name_with_abbr
new_cost_center = get_name_with_abbr(newdn, self.company)
# Validate properties before merging
@@ -90,7 +100,9 @@ class CostCenter(NestedSet):
super(CostCenter, self).after_rename(olddn, newdn, merge)
if not merge:
new_cost_center = frappe.db.get_value("Cost Center", newdn, ["cost_center_name", "cost_center_number"], as_dict=1)
new_cost_center = frappe.db.get_value(
"Cost Center", newdn, ["cost_center_name", "cost_center_number"], as_dict=1
)
# exclude company abbr
new_parts = newdn.split(" - ")[:-1]
@@ -99,7 +111,9 @@ class CostCenter(NestedSet):
if len(new_parts) == 1:
new_parts = newdn.split(" ")
if new_cost_center.cost_center_number != new_parts[0]:
validate_field_number("Cost Center", self.name, new_parts[0], self.company, "cost_center_number")
validate_field_number(
"Cost Center", self.name, new_parts[0], self.company, "cost_center_number"
)
self.cost_center_number = new_parts[0]
self.db_set("cost_center_number", new_parts[0])
new_parts = new_parts[1:]
@@ -110,10 +124,12 @@ class CostCenter(NestedSet):
self.cost_center_name = cost_center_name
self.db_set("cost_center_name", cost_center_name)
def on_doctype_update():
frappe.db.add_index("Cost Center", ["lft", "rgt"])
def get_name_with_number(new_account, account_number):
if account_number and not new_account[0].isdigit():
new_account = account_number + " - " + new_account
return new_account
return new_account

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