Compare commits

..

1503 Commits

Author SHA1 Message Date
Nabin Hait
4e6f49209f Merge branch 'version-13-pre-release' into version-13 2021-07-16 15:21:33 +05:30
Nabin Hait
e079a1bb33 bumped to version 13.7.0 2021-07-16 15:41:33 +05:50
Nabin Hait
e8abb201c1 Merge pull request #26526 from rohitwaghchaure/patch-to-fix-missing-fg-item-pre
fix: added patch to fix missing FG item
2021-07-16 15:05:16 +05:30
Rohit Waghchaure
0c6ca09e06 fix: added patch to fix missing FG item 2021-07-16 14:33:25 +05:30
Nabin Hait
f6d6897f34 Merge pull request #26525 from nabinhait/change-log-v13-7-0
chore: Added change log for v13.7.0
2021-07-16 13:09:31 +05:30
Nabin Hait
a0df79ee8c chore: Added change log for v13.7.0 2021-07-16 13:07:39 +05:30
Noah Jacob
2f775ee53c fix: WIP needs to be set before submit on skip_transfer (#26507) 2021-07-15 16:29:28 +05:30
rohitwaghchaure
a51e230f4a Merge pull request #26509 from rohitwaghchaure/fixed-fg-items-not-added-for-batch-item-pre
fix: FG item not fetched in manufacture entry
2021-07-15 15:32:59 +05:30
Rohit Waghchaure
9997cce1ea fix: FG item not fetched in manufacture entry 2021-07-15 15:32:21 +05:30
Deepesh Garg
cc73e7d6fa Merge pull request #26472 from deepeshgarg007/payment_entry_taxes_unallocated_amount_v13
fix: Unallocated amount in Payment Entry after taxes
2021-07-15 12:38:45 +05:30
Marica
f225196028 Merge pull request #26497 from marination/paging-btns-pre-release
fix: Paging buttons not working on item group portal page
2021-07-14 21:19:59 +05:30
marination
f40da4ac4c fix: Paging buttons not working on item group portal page 2021-07-14 20:48:06 +05:30
Marica
683d18dd95 Merge pull request #26493 from 18alantom/bp-pr-fix-item-group-portal-issues
fix: item group portal issues (backport)
2021-07-14 18:01:19 +05:30
18alantom
9ea5072c52 fix: set item group as a persistent filter 2021-07-14 17:41:38 +05:30
18alantom
b24c0bfbf9 fix: show child item group items on portal 2021-07-14 17:41:32 +05:30
Noah Jacob
03f4db0606 fix: validation check for batch for stock reconciliation type in stock entry(bp #26370 ) (#26488)
* fix(ux): added filter for valid batch nos.

* fix: not validating batch no if entry type stock reconciliation

* test: validate batch_no
2021-07-14 16:28:54 +05:30
Saqib
72715956f1 fix: tds computation summary shows cancelled invoices (#26486) 2021-07-14 15:56:20 +05:30
Saqib
59bf2df28e fix: pos item cart dom updates (#26461) 2021-07-14 11:40:58 +05:30
Deepesh Garg
7ff6865817 Merge pull request #26470 from deepeshgarg007/new_company_error_v13
fix: Errors on parallel requests creation of company for India
2021-07-13 20:30:06 +05:30
Deepesh Garg
c00d851a88 fix: Unallocated amount for inclusive charges 2021-07-13 16:42:21 +05:30
Deepesh Garg
740d5c6c53 fix: Deduct included taxes from unallocated amount 2021-07-13 16:42:10 +05:30
Deepesh Garg
01c89eaad9 fix: Remove unintentional changes 2021-07-13 16:42:10 +05:30
Deepesh Garg
2f350bf450 fix: Remove unintentional changes 2021-07-13 16:42:10 +05:30
Deepesh Garg
9513d61a50 fix: Hide amount after tax fields 2021-07-13 16:42:10 +05:30
Deepesh Garg
51ae46f0de fix: Unallocated amount in Payment Entry after taxes 2021-07-13 16:42:10 +05:30
Deepesh Garg
2f89b5b38e Merge pull request #26466 from deepeshgarg007/amended_doc_discount_v13
fix: Incorrect discount amount on amended document
2021-07-13 16:24:54 +05:30
Deepesh Garg
41c5357602 Merge pull request #26468 from deepeshgarg007/gstr_1_json_dpwnload_error_v13
fix: Unable to download GSTR-1 json
2021-07-13 16:17:52 +05:30
rohitwaghchaure
bd8699b8a9 Merge pull request #26458 from rohitwaghchaure/fixed-multi-currency-issue-pre
fix: multi-currency issue
2021-07-13 16:05:36 +05:30
Deepesh Garg
fea29ae8cb fix: Use update flag for company dependant fixtures 2021-07-13 16:05:05 +05:30
Deepesh Garg
7be9f8dab1 fix: Error on creation of company for India 2021-07-13 16:04:56 +05:30
Deepesh Garg
0bad696faf fix: Unable to download GSTR-1 json 2021-07-13 15:46:58 +05:30
Deepesh Garg
07d9f3f74b fix: Incorrect discount amount on amended document 2021-07-13 15:35:59 +05:30
Rohit Waghchaure
4acbeecbbe fix: multi-currency issue 2021-07-13 15:35:30 +05:30
Saqib
621927d9f9 fix: move the rename abbreviation job to long queue (#26462) 2021-07-13 14:13:39 +05:30
Marica
fad426fd5c Merge pull request #26454 from noahjacob/supplier_defaults_v13pr
feat: fetching details from supplier/customer groups
2021-07-13 11:39:55 +05:30
Noah Jacob
74b3fc1e1c refactor: suggested changes 2021-07-13 11:05:53 +05:30
Noah Jacob
1e8f598ba5 fix: Sider 2021-07-13 11:05:53 +05:30
Noah Jacob
dd0a8f20e2 test: updated test cases 2021-07-13 11:05:53 +05:30
Noah Jacob
fedee0e8da test: test cases for fetching customer group details 2021-07-13 11:05:53 +05:30
Noah Jacob
f07f7e9305 test: test case for fetching supplier group details 2021-07-13 11:05:53 +05:30
Noah Jacob
1cb2af00a8 feat: details fetched from customer group in customer 2021-07-13 11:05:53 +05:30
Noah Jacob
9965af166e feat: details fetched from supplier group in supplier 2021-07-13 11:05:53 +05:30
Nabin Hait
1ef1daf383 Merge pull request #26432 from nabinhait/reposting-optimization-v13-pre-release
refactor: Optimized code for reposting item valuation
2021-07-12 15:42:19 +05:30
Nabin Hait
0003938f2b refactor: Optimized code for reposting item valuation 2021-07-12 13:29:20 +05:30
Nabin Hait
01aada6c90 refactor: Optimized code for reposting item valuation 2021-07-12 13:28:19 +05:30
Noah Jacob
ae41b53cee fix: stock_rbnb not defined (#26354) 2021-07-12 12:51:38 +05:30
Nabin Hait
470c7e773f fix: merge conflict 2021-07-12 12:45:49 +05:30
Afshan
10473b1195 fix: dunning calculation of grand total when rate of interest is 0% (#26285) 2021-07-12 11:11:29 +05:30
Afshan
bf03671a33 fix(report): iterate on accounts only when accounts exist (#26391) 2021-07-12 11:10:28 +05:30
Afshan
f60c3f0655 fix: error popup for COA errors (#26358) 2021-07-12 11:07:30 +05:30
Saqib
432d8efa3d fix(pos): taxes amount in pos item cart (#26411) 2021-07-12 10:47:40 +05:30
Ankush
caacd0ad2c fix: stock levels disapperaing on refresh (bp #26305)
refresh_section removes all sections with `custom` class, added
different class to avoid this behaviour.

# Conflicts:
#	erpnext/stock/doctype/item/item.js
2021-07-12 10:20:19 +05:30
Marica
f7748e4109 Merge pull request #26133 from marination/qi-rejection
feat: Optionally allow rejected quality inspection on submission
2021-07-10 21:04:32 +05:30
marination
c8a825c478 chore: Test case for QI Rejection in Stock Entry
- Use `get_single_value` instead of `get_doc` in validation
- Test Case to check impact of stock settings on SE with rejected qi
2021-07-10 18:26:36 +05:30
Saqib
13d7043451 fix: column 'outstanding_amount' cannot be null (#26404) 2021-07-09 15:33:14 +05:30
Saqib
fe4f58d0f6 fix(e-invoicing): allow export invoice even if no taxes applied (#26405) 2021-07-09 15:32:54 +05:30
Saqib
8e8434a78a fix: omit item discount amount for e-invoicing (#26353) (#26407) 2021-07-09 15:32:28 +05:30
Subin Tom
9ac63da457 fix: value fetching for custom field in POS (#26367) 2021-07-09 14:35:11 +05:30
Subin Tom
d53991857c fix: Fixed Budget Variance Graph color from all black to default (#26368) 2021-07-09 14:33:00 +05:30
Marica
eb0dea09bb Merge pull request #26333 from marination/lcv-validate-invoice
fix: Validate LCV for Invoices without Update Stock
2021-07-09 13:41:34 +05:30
Marica
01be96adb2 Merge branch 'version-13-hotfix' into qi-rejection 2021-07-09 13:30:21 +05:30
marination
bf462abb00 fix: Rename function and tweak logic
- Dont validate PI on `else`
2021-07-09 13:12:33 +05:30
Anurag Mishra
afafe406c8 Merge pull request #26388 from Anurag810/training_fix_v13
fix: Query for Training Event
2021-07-09 12:21:17 +05:30
Saqib
8f3c7ab402 fix: escape quotes while fetching customer emails (#26329) (#26376) 2021-07-09 10:35:55 +05:30
Rucha Mahabal
e5a1bb7141 Merge pull request #26394 from ruchamahabal/fix-test-precision
fix: precision for expected values in payment entry test
2021-07-08 23:46:19 +05:30
Rucha Mahabal
3888488b36 fix: precision for expected values in payment entry test 2021-07-08 23:21:48 +05:30
Alan
257cbd3b92 fix: track changes on batch (#26382) 2021-07-08 18:44:30 +05:30
Anurag Mishra
a82e9e42e1 fix: query for training Event 2021-07-08 17:27:21 +05:30
Jannat Patel
cf28950327 Merge pull request #26349 from Anurag810/salary-slip-fix--hotfix
fix: payroll-entry minor fix
2021-07-08 13:43:55 +05:30
Anurag Mishra
8f945a9852 fix: Removed un-used flag 2021-07-08 13:06:04 +05:30
Mohammad Hasnain Mohsin Rajan
00f90c50c0 chore: add product listing link in settings (#26026)
* chore: add product listing link in settings

* chore: add icon in workspace card

Co-authored-by: Ankush <ankush@iwebnotes.com>
2021-07-07 18:21:12 +05:30
Sagar Vora
ea2470d174 Merge pull request #26361 from ankush/backport/version-13-pre-release/pr-26354
fix: stock_rbnb not defined (#26354)
2021-07-07 11:59:37 +05:30
Noah Jacob
a01264dae7 fix: stock_rbnb not defined (#26354) 2021-07-07 11:07:19 +05:30
rohitwaghchaure
f130f8385e Merge pull request #26332 from rohitwaghchaure/fixed-bom-stock-report-not-working
fix: bom stock report not working
2021-07-07 00:22:03 +05:30
rohitwaghchaure
2bdc0e8993 Merge pull request #26350 from rohitwaghchaure/fixed-putaway-fixing-for-material-receipt
fix: stock entry with putaway rule not working
2021-07-07 00:15:26 +05:30
Rohit Waghchaure
0bd190b885 fix: stock entry with putaway rule not working 2021-07-07 00:14:51 +05:30
Nabin Hait
11d56903e7 Merge pull request #25415 from deepeshgarg007/bootstraped_gst_setup
feat(India): Bootstrapped GST Setup
2021-07-06 21:44:30 +05:30
Deepesh Garg
67c7067778 Merge pull request #26300 from AfshanKhan/fix-account-selection-gst-settings-v13
fix: only "Tax" type accounts should be shown for selection in GST Settings
2021-07-06 20:33:41 +05:30
Saqib
422325bb74 test: fetching of previous sle (#26352) 2021-07-06 18:37:12 +05:30
Deepesh Garg
3636efd7e6 Merge pull request #26355 from deepeshgarg007/flaky_test
test: Purchase Invoice advance test case
2021-07-06 18:22:26 +05:30
Noah Jacob
5e99aa7f65 fix: stock_rbnb not defined (#26354) 2021-07-06 18:00:35 +05:30
Deepesh Garg
7f794cc0ea fix: Purchase Invoice advance test case 2021-07-06 17:58:44 +05:30
Afshan
c8eca8a448 fix: remove cancelled entries in consolidated financial statements (#26331) 2021-07-06 14:37:57 +05:30
Anurag Mishra
f0b62f70d5 fix: payroll-entry minor fix 2021-07-06 13:40:22 +05:30
Mohammed Yusuf Shaikh
842674ce79 fix: Added a message to enable appontment booking if disabled (#26334) 2021-07-06 13:34:32 +05:30
Marica
dfe11aca6a Merge pull request #26284 from marination/order-by-weightage-for-web-items
fix: Order Items by weightage in the web items query
2021-07-06 13:20:08 +05:30
rohitwaghchaure
7b781b1498 Merge pull request #26158 from marination/stock-reco-repost_qty
fix: Include Stock Reco logic in `update_qty_in_future_sle`
2021-07-06 11:22:26 +05:30
marination
57d06a86f8 chore: Test to block backdated reco causing future scarcity 2021-07-05 21:56:57 +05:30
Marica
4f51b56928 Merge branch 'version-13-hotfix' into stock-reco-repost_qty 2021-07-05 20:26:01 +05:30
marination
fa9e67502c chore: Test for backdated reco qty reposting 2021-07-05 20:23:00 +05:30
Deepesh Garg
9b6d9a41f4 fix: Test Cases 2021-07-05 17:08:27 +05:30
Deepesh Garg
15b336df28 fix: Test cases 2021-07-05 14:45:33 +05:30
marination
c69bc54297 fix: Validate LCV for Invoices without Update Stock 2021-07-05 14:24:38 +05:30
Rohit Waghchaure
5638fbb1aa fix: bom stock report not working 2021-07-05 13:54:05 +05:30
Deepesh Garg
db682d9e4c fix: Create mode of payment if doesn't exists 2021-07-05 13:46:03 +05:30
Richard Case
75fdf79376 fix: incorrect bom no. added for non-variant items on variant boms (#26320) 2021-07-05 10:56:34 +05:30
Deepesh Garg
a0599e5ac2 fix: Test cases for M-pesa 2021-07-05 10:09:42 +05:30
rohitwaghchaure
22c2d4f118 Merge pull request #26312 from rohitwaghchaure/fixed-employee-issue-in-job-card
fix: allow to make job card without employee
2021-07-04 22:58:50 +05:30
Deepesh Garg
ddf87594a1 Merge pull request #26287 from deepeshgarg007/bank_statement_import_fix
fix: Bank statement import
2021-07-04 20:34:10 +05:30
Deepesh Garg
ea5b7d38bb Merge pull request #26277 from deepeshgarg007/multi-company-deferred-revenue
fix: Auto process deferred accounting for multi-company setup
2021-07-04 20:32:22 +05:30
Deepesh Garg
cd036e115b Merge pull request #26231 from deepeshgarg007/party_dashboard
fix: Do not consider cancelled entries in party dashboard
2021-07-04 20:30:34 +05:30
Rohit Waghchaure
3105332e3c fix: allow to make job card without employee 2021-07-03 17:25:08 +05:30
Deepesh Garg
63096014a7 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into bootstraped_gst_setup 2021-07-02 20:30:18 +05:30
marination
311e277204 fix: Sider 2021-07-02 18:11:13 +05:30
Anurag Mishra
73db919c99 fix: set query for training events (#26303)
* fix: set query

* fix: remove whitespace between function and params

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-07-02 17:55:42 +05:30
marination
4503a38361 fix: Handle Stock Reco cancellation and limit reposting
- Handled cancellation of reco with and without prior SLE
- Repost / Recalculate balance qty only till next stock reco
2021-07-02 17:13:45 +05:30
Afshan
b6076f772d fix: only "Tax" type accounts should be shown for selection in GST Settings 2021-07-02 15:39:16 +05:30
Ashish Shah
c0817838d9 fix: when lead is created with mobile_no, mobile_no value gets lost (#26298)
Summary: When a Lead is created with mobile_no, mobile_no value gets lost (mobile_no value is overwritten by phone value)
It is backport of https://github.com/frappe/erpnext/pull/26116

Steps to reproduce
[1]Create a Lead.
[2]Enter 
Person Name(lead_name): before_fix
Under Contact section, 
enter Phone(phone): 11 and 
Mobile No.(mobile_no):22
[3]Save it
[4] F12, 
cur_frm.doc.phone : 11 (correct)
cur_frm.doc.mobile_no : 11 (incorrect, it should be 22)
[5]Under Address & Contact section ,check contact_html it shows
before_fix
Phone: 11 (Primary label is missing)
Phone: 22 (incorrect, it should be Mobile No:22, also Primary label is missing)


Actual:
mobile_no value is lost. it is overwritten by phone value
following is image with error (before fix)
![image](https://user-images.githubusercontent.com/29812965/122664017-54b2e880-d1bc-11eb-8e4c-767a23ed7eb7.png)


Expected:
mobile_no value should be retained
following is image after fix
![image](https://user-images.githubusercontent.com/29812965/122664037-64323180-d1bc-11eb-8f6f-7628cdaa7adc.png)
2021-07-02 15:16:42 +05:30
Anupam Kumar
877597bc16 fix: feating employee in payroll entry (#26271) 2021-07-02 13:10:18 +05:30
Jannat Patel
18533e381a fix: lms progress issue (#26253) 2021-07-02 12:57:06 +05:30
Mohammed Yusuf Shaikh
ad6f20c5c7 fix: Added permission for employee to book appointment (#26255) 2021-07-02 12:32:22 +05:30
Jannat Patel
5173e74a04 fix: Project Portal Enhancements (#26290)
* fix: project portal enhancements

* fix: condition for pills
2021-07-02 11:48:46 +05:30
Deepesh Garg
d4146a91d6 Merge pull request #25323 from m1ngaa/patch-1
Delete accounts (an empty file)
2021-07-01 23:38:56 +05:30
Deepesh Garg
ba2c3c776f fix: Bank statement import 2021-07-01 18:56:51 +05:30
marination
752f099e9d fix: Order Items by weightage in the web items query 2021-07-01 17:20:24 +05:30
Anuja Pawar
d8bc514226 fix: to fetch the correct field in Tax Rule (#25927) 2021-07-01 14:06:01 +05:30
Nabin Hait
c2b5562a3f Merge branch 'version-13-pre-release' into version-13 2021-07-01 12:37:13 +05:30
Nabin Hait
eee03fcbab bumped to version 13.6.0 2021-07-01 12:57:13 +05:50
rohitwaghchaure
117cf4eca6 Merge pull request #26278 from rohitwaghchaure/fixed-employee-selection-issue-in-payroll-entry
fix: employee selection not working in payroll entry
2021-07-01 12:31:45 +05:30
Nabin Hait
d7c4818a5d Merge pull request #26281 from rohitwaghchaure/fixed-update-cost-not-working-for-draft-bom-pre
fix: update cost not working in the draft BOM
2021-07-01 12:30:55 +05:30
Nabin Hait
9a4926bb0d Merge pull request #26280 from rohitwaghchaure/fixed-employee-selection-issue-in-payroll-entry-pre
fix: employee selection not working in payroll entry
2021-07-01 12:30:13 +05:30
Rohit Waghchaure
f99f872946 fix: update cost not working in the draft bom 2021-07-01 12:02:37 +05:30
Rohit Waghchaure
87b4e6ea32 fix: employee selection not working in payroll entry 2021-07-01 12:02:03 +05:30
rohitwaghchaure
c14fc9530c Merge pull request #26279 from rohitwaghchaure/fixed-update-cost-not-working-for-draft-bom
fix: update cost not working in the draft BOM
2021-07-01 11:57:32 +05:30
Rohit Waghchaure
a856624ccb fix: employee selection not working in payroll entry 2021-07-01 11:56:55 +05:30
Rohit Waghchaure
0bfd56e615 fix: update cost not working in the draft bom 2021-07-01 11:50:48 +05:30
Deepesh Garg
68c697b354 fix: Auto process deferred accounting for multi-company setup 2021-07-01 09:31:31 +05:30
Nabin Hait
cf4e29a604 chore: Added change log for v13.6.0 2021-06-30 20:27:43 +05:30
Anupam Kumar
4df54cc62c Merge pull request #26269 from anupamvs/payroll-iss-pre-release
fix: fetching employee in payroll entry
2021-06-30 17:22:17 +05:30
Anupam
8492bf040d fix: feating employee in payroll entry 2021-06-30 17:17:43 +05:30
rohitwaghchaure
d482c41eeb Merge pull request #26263 from rohitwaghchaure/fixed-removed-unused-file
fix: minor removed unused file
2021-06-30 11:36:51 +05:30
Rohit Waghchaure
815e6ec846 fix: minor removed unused file 2021-06-30 11:35:50 +05:30
rohitwaghchaure
2a1d1e1cb1 Merge pull request #26240 from rohitwaghchaure/production-plan-sub-assembly-enhancement
feat: provision to make subcontracted purchase order from the production plan
2021-06-30 11:15:11 +05:30
rohitwaghchaure
713c92e6fd Merge pull request #26259 from rohitwaghchaure/fixed-incorrect-valuation-rate-in-stock-reco
fix: incorrect valuation rate in stock reconciliation
2021-06-30 11:11:41 +05:30
Rohit Waghchaure
46b67b901b fix: incorrect valuation rate in stock reconciliation 2021-06-30 00:31:00 +05:30
Deepesh Garg
a287b22b55 Merge pull request #26252 from deepeshgarg007/loan_security_pledge_on_cancel
fix: Cancellation of Loan Security Pledges
2021-06-29 20:23:46 +05:30
Rohit Waghchaure
61690775a8 feat: provision to make subcontracted purchase order from the production plan 2021-06-29 19:59:20 +05:30
Deepesh Garg
9181dde86a fix: Cancelation of Loan Security Pledges 2021-06-29 17:18:39 +05:30
Rucha Mahabal
1f10a99910 fix: Employee Inactive status implications (#26245) 2021-06-29 15:58:56 +05:30
Rucha Mahabal
91dcc07e26 fix: Employee Inactive status implications (#26244) 2021-06-29 15:58:46 +05:30
rohitwaghchaure
09b081ccad Merge pull request #26241 from rohitwaghchaure/fixed-allow-to-change-to-date
fix: allow user to change the To Date in the blanket order even after submit of order
2021-06-29 10:05:04 +05:30
Rohit Waghchaure
2d1c4fee1d fix: allow to changes to date in the blanket order 2021-06-29 00:33:55 +05:30
rohitwaghchaure
9bcc402f41 Merge pull request #26230 from rohitwaghchaure/fixed-fetch-bom-items-in-stock-reco-pre
fix: fetch batch items in stock reconciliation
2021-06-28 15:18:07 +05:30
Deepesh Garg
7d7d797ffc fix: Do not consider cancelled entries in party dashboard 2021-06-28 11:24:32 +05:30
Deepesh Garg
ebc46c1e09 fix: Update account heads in GST test cases 2021-06-28 10:52:38 +05:30
Deepesh Garg
cf445eb7b4 fix: Add validate bank account method back 2021-06-26 23:59:47 +05:30
Deepesh Garg
1e5482cedd fix: Revert Changes 2021-06-26 23:49:32 +05:30
rohitwaghchaure
5abf905ff7 Merge pull request #26229 from rohitwaghchaure/fixed-removed-values-out-of-sync-on-stock-transaction-submission-pre
fix: removed values out of sync validation from stock transactions
2021-06-26 23:43:57 +05:30
Rohit Waghchaure
478360397d fix: fetch batch items in stock reco 2021-06-26 22:31:03 +05:30
Rohit Waghchaure
5d5dc56f94 fix: removed values out of sync validation from stock transactions 2021-06-26 22:29:19 +05:30
rohitwaghchaure
c1853ddf73 Merge pull request #26226 from rohitwaghchaure/fixed-removed-values-out-of-sync-on-stock-transaction-submission
fix: removed values out of sync validation from stock transactions
2021-06-26 22:28:42 +05:30
Rohit Waghchaure
170f2ad056 fix: removed values out of sync validation from stock transactions 2021-06-26 21:42:47 +05:30
rohitwaghchaure
9f051a24db Merge pull request #26213 from rohitwaghchaure/fixed-fetch-bom-items-in-stock-reco
fix: fetch batch items in stock reconciliation
2021-06-26 21:21:23 +05:30
Rohit Waghchaure
e5c47f8957 fix: fetch batch items in stock reco 2021-06-26 17:40:27 +05:30
Ankush Menat
6588a936d5 fix: order and time of operations for multilevel bom
- Order of operations was being sorted by idx of individual operations in
BOM table, which made the ordering useless.
- This adds ordering that's sorted from lowest level item to top level
item.
- chore: remove dead functionality. There's no `items` table. Required
  item level operations get overwritten on fetching of items /
  operations e.g. when clicking on multi-level BOM checkbox.
- test: add test for tree representation
- feat: BOMTree class to get complete representation of a tree
2021-06-25 20:16:11 +05:30
Ankush Menat
9af3f12411 fix(ux): show bom in operations child table 2021-06-25 20:16:11 +05:30
Ankush Menat
b4e7ee0e45 chore: remove dead and py2 compatibility code
form_grid_template doesn't exist
2021-06-25 20:16:11 +05:30
Marica
5474c09c70 Merge pull request #25886 from ankush/work_order_flat_ops
fix: order and time of operations in multilevel BOM work order
2021-06-25 16:05:54 +05:30
Ankush Menat
9e43445f36 fix: order and time of operations for multilevel bom
- Order of operations was being sorted by idx of individual operations in
BOM table, which made the ordering useless.
- This adds ordering that's sorted from lowest level item to top level
item.
- chore: remove dead functionality. There's no `items` table. Required
  item level operations get overwritten on fetching of items /
  operations e.g. when clicking on multi-level BOM checkbox.
- test: add test for tree representation
- feat: BOMTree class to get complete representation of a tree
2021-06-25 14:44:55 +05:30
Ankush Menat
6ec8875434 fix(ux): show bom in operations child table 2021-06-25 14:44:53 +05:30
Ankush Menat
ff4aadc657 chore: remove dead and py2 compatibility code
form_grid_template doesn't exist
2021-06-25 14:43:49 +05:30
Deepesh Garg
bb0b1e61d6 Merge pull request #26220 from deepeshgarg007/item_tax_error_fetch_v13
fix: Error while fetching item taxes
2021-06-25 14:03:14 +05:30
Deepesh Garg
6eb8d19cc9 fix: Check for is None 2021-06-25 14:02:12 +05:30
Deepesh Garg
cd36ba7e64 fix: Error while fetching item taxes 2021-06-25 14:02:04 +05:30
Deepesh Garg
2f0298ee11 Merge pull request #26218 from deepeshgarg007/item_tax_error_fetch
fix: Error while fetching item taxes
2021-06-25 14:00:19 +05:30
Deepesh Garg
e955a4ee72 fix: Check for is None 2021-06-25 13:38:06 +05:30
Deepesh Garg
2ca9b765ef fix: Error while fetching item taxes 2021-06-25 13:34:00 +05:30
Ankush
532a224c44 fix: precision rate for packed items (#26046) (#26217)
Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
2021-06-25 13:28:01 +05:30
Noah Jacob
58daf5f916 fix: precision rate for packed items (#26046) 2021-06-25 12:52:17 +05:30
Subin Tom
43f85a2877 fix: changed profitability analysis report width (#26165) 2021-06-25 11:38:11 +05:30
Alan
8958f55890 fix: add validation for 'for_qty' else throws errors (#25829)
* fix: add validation for 'for_qty' else throws errors

* fix: check if for_qty is None

* fix: check purpose

* fix: add purpose to pick list get_doc

* fix: set as read only to prevent se from picking up value

Co-authored-by: Ankush <ankushmenat@gmail.com>

* chore: undo changes to doctype modified timestamp

Co-authored-by: Ankush <ankushmenat@gmail.com>
2021-06-24 21:01:55 +05:30
Ankush
21e44b19f0 perf: don't query unless required (bp #26175)
re-order conditionals so queries are not evaluated unless required.
# Conflicts:
#	erpnext/stock/doctype/batch/batch.py
2021-06-24 20:58:07 +05:30
Nabin Hait
67768faaef Merge branch 'version-13-hotfix' into version-13-pre-release 2021-06-24 20:16:04 +05:30
Deepesh Garg
b4b76b75cd Merge pull request #26176 from deepeshgarg007/item_tax_fetch_fix
fix: User is not able to change item tax template
2021-06-24 19:55:49 +05:30
Deepesh Garg
970d2af7ad Merge pull request #26211 from deepeshgarg007/include_dimension_filter
fix: Account filter not working with accounting dimension filter
2021-06-24 19:55:12 +05:30
Deepesh Garg
1564d39bf4 Merge pull request #26188 from deepeshgarg007/internal_transfer_payment_tax_v13
fix: Taxes on Internal Transfer payment entry
2021-06-24 19:51:48 +05:30
Deepesh Garg
e3ca177828 fix: Remove debug flag 2021-06-24 19:51:23 +05:30
Deepesh Garg
bdba29bab5 fix: Account filter not working with accounting dimension filter 2021-06-24 19:48:11 +05:30
Ankush
5708b7140b fix: batch nos in packed items (bp #26105)
* test: batch info in packed_items

* fix(ux): make packed items editable

* refactor: allow custom table name for set_batch

In some doctypes there are multiple child tables requiring batched
items. This change makes the function a bit more flexible.

* fix: Auto fetch batch_nos in packed_item table
2021-06-24 19:38:37 +05:30
Saqib
b3a0a7b432 fix: too many writes while renaming company abbreviation (#26203) 2021-06-24 19:30:10 +05:30
Deepesh Garg
1658107a92 fix: Linting fixes 2021-06-24 19:18:50 +05:30
Deepesh Garg
e21e435a0d fix: Add python 3 compatible string types 2021-06-24 19:17:58 +05:30
Nabin Hait
a57976660a fix: merge conflict 2021-06-24 19:14:33 +05:30
Deepesh Garg
9382b1f154 fix: Flaky test 2021-06-24 19:03:22 +05:30
Deepesh Garg
11591b3e3e Merge pull request #26202 from nextchamp-saqib/pr-item-gl-fix-v13
fix: purchase receipt gl entries with same item code
2021-06-24 18:36:23 +05:30
rohitwaghchaure
27797ffa46 Merge pull request #24523 from rohitwaghchaure/sub-operation-new-branch
Feat: Job Card Enhancements
2021-06-24 18:19:42 +05:30
Rohit Waghchaure
2330c41cca fix: total time calculation 2021-06-24 18:14:19 +05:30
Rohit Waghchaure
57307443f0 is corrective job card 2021-06-24 18:14:19 +05:30
Rohit Waghchaure
c878389050 fix: or condition filter in the get_all 2021-06-24 18:14:18 +05:30
Jannat Patel
6a9798f305 fix: update leave allocation after submit (#26191)
* fix: update leave allocation after submit v13

* fix: test

* fix: test
2021-06-24 18:11:33 +05:30
Rohit Waghchaure
fcab53b238 fix: skip job card 2021-06-24 18:07:31 +05:30
Rohit Waghchaure
6e81489095 feat: Job Card Enhancements 2021-06-24 18:07:30 +05:30
Saqib Ansari
f6dce4df73 test: service item purchase with perpetual inventory enabled 2021-06-24 17:41:52 +05:30
Saqib Ansari
1ca8f6a51d fix: purchase receipt gl entries with same item code 2021-06-24 17:41:44 +05:30
Saqib
81d164134d Merge pull request #26198 from nextchamp-saqib/pos-fixes-9-v13
refactor(pos): use pos invoice item name as unique identifier
2021-06-24 17:37:51 +05:30
Afshan
9dc625c1c9 fix: validate product bundle for existing transactions before deletion (#25978) 2021-06-24 17:36:39 +05:30
Deepesh Garg
79daed00c1 Merge pull request #26201 from noahjacob/shipping_address_fix_v13
fix: fetch preferred shipping address (bp #26132)
2021-06-24 17:35:34 +05:30
Deepesh Garg
755ebdf582 Update party.js 2021-06-24 17:35:14 +05:30
Noah Jacob
da82bd4b51 refactor: update cost updates operation time and hour rates in BOM (#25891)
* refactor: updates hour_rate and operation time on update cost

* refactor: hour_rates are updated in routing when updated in workstations

* test: test cases for updating hour_rates and operation time in linked bom
2021-06-24 17:23:21 +05:30
Noah Jacob
dbdf2515cd fix: fetches correct preferred shipping address 2021-06-24 17:06:18 +05:30
Nabin Hait
4704003c94 Merge branch 'version-13-pre-release' into version-13 2021-06-24 15:35:50 +05:30
Nabin Hait
b5d1a7731c bumped to version 13.5.2 2021-06-24 15:55:50 +05:50
Nabin Hait
c1954ec72a Merge pull request #26195 from deepeshgarg007/deferred_revenue_error
fix: Error while booking deferred revenue
2021-06-24 15:35:02 +05:30
Nabin Hait
7a8a449ed4 Merge pull request #26197 from deepeshgarg007/deferred_revenue_error_pre_release
fix: Error while booking deferred revenue
2021-06-24 15:34:58 +05:30
Saqib Ansari
3b12601461 fix: sider issues 2021-06-24 15:03:04 +05:30
Saqib Ansari
e39c3f2e69 fix: add missing semicolons 2021-06-24 15:02:59 +05:30
Saqib Ansari
ea70f6f933 fix: hide images from cart & details 2021-06-24 15:02:53 +05:30
Saqib Ansari
54cc1dedf2 refactor(pos): use pos invoice item name as unique identifier 2021-06-24 15:02:43 +05:30
Marica
bf3e191570 Merge pull request #26193 from marination/country-modal-cart-v13-release
fix: Address Card issues in e-commerce
2021-06-24 14:57:39 +05:30
Marica
b5ffaff6a8 Merge pull request #26194 from marination/web-item-group-v13-pre-release
fix: Website item group logic for product listing in Item Group pages
2021-06-24 14:57:29 +05:30
Deepesh Garg
f79a72dbf3 fix: Error while booking deferred revenue 2021-06-24 14:49:09 +05:30
Afshan
7fd44907ba feat: fetching of qty as per received qty from PR to PI (#26184) 2021-06-24 14:26:36 +05:30
Ankush
98e98d25e6 fix(Work Order): added freeze when trying to stop work order (#26192) (#26196)
* fix: added freeze when trying to stop work order

* fix(ux): add freeze message

Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
2021-06-24 14:24:28 +05:30
Deepesh Garg
ca2e914715 fix: Error while booking deferred revenue 2021-06-24 14:14:46 +05:30
marination
820a579051 chore: Test for Item visibility in multiple item group pages 2021-06-24 13:57:18 +05:30
marination
4f0e6cd911 fix: Sider 2021-06-24 13:57:00 +05:30
marination
f913838373 fix: Consider Table Multiselect fields in Query engine
- Since table multiselect fields were not handled, the query tried searching for this child field in item master
- This broke the query
- On trying to reload or go back to all-products page with field filters that are table mutiselect, page breaks
2021-06-24 13:56:49 +05:30
marination
9f305e983c fix: Filters did not consider Website Item Group 2021-06-24 13:56:35 +05:30
marination
ea2408744a fix: Consider Website Item Groups in Item group page product listing
- Passed an argument to query engine to know when query is for item group page
- If for item group page, get data with regards to website item group table
- This query should be fast since there's one filter and that shortens the table beforehand
- This data is merged with the results from the Item master (results only considering item attributes and field filters)
- The combined data is then sorted as per weightage

Co-authored-by: Gavin D'souza <gavin18d@gmail.com>
2021-06-24 13:56:15 +05:30
marination
5884f1aeb0 fix: (style) Address card buttons hover state 2021-06-24 13:50:29 +05:30
marination
26bec9d7b4 fix: Country Link field in 'Add address' website modal auto-clears 2021-06-24 13:50:18 +05:30
Marica
ce99701150 Merge pull request #26170 from marination/web-item-group
fix: Website item group logic for product listing in Item Group pages
2021-06-24 13:28:18 +05:30
marination
a4f5dcaa9a chore: Test for Item visibility in multiple item group pages 2021-06-24 13:08:20 +05:30
Marica
6b15a05de4 Merge pull request #26187 from marination/country-modal-cart
fix: Address Card issues in e-commerce
2021-06-24 12:25:21 +05:30
Deepesh Garg
437e972108 Merge pull request #26143 from deepeshgarg007/gstr_1_export_invoices_error
fix: Export invoices not visible in GSTR-1 report
2021-06-24 12:15:29 +05:30
Deepesh Garg
9d8e8f8bdf fix: Do not show received amount after tax for internal tarnsfers 2021-06-24 12:02:39 +05:30
Deepesh Garg
bd9317956b fix: Taxes on Internal Transfer payment entry 2021-06-24 12:02:32 +05:30
marination
bbe64b5604 fix: (style) Address card buttons hover state 2021-06-24 12:01:12 +05:30
Rucha Mahabal
a9b5dc6030 fix: chart not visible for First Response Time reports (#26032) (#26185) 2021-06-24 11:53:28 +05:30
marination
f5fa1ee4b6 fix: Country Link field in 'Add address' website modal auto-clears 2021-06-24 11:03:32 +05:30
Deepesh Garg
5e49bee755 Merge pull request #26083 from deepeshgarg007/payroll_accounting_dimension
fix: Accounting Dimensions for payroll entry accrual Journal Entry
2021-06-24 10:38:42 +05:30
Deepesh Garg
03b629c851 Merge pull request #26100 from deepeshgarg007/pi_billing_address
fix: Billing address not fetched in Purchase Invoice
2021-06-24 10:29:01 +05:30
Deepesh Garg
4cf0b02ddc Merge pull request #26095 from deepeshgarg007/sales_order_billed_qty
fix: Incorrect billed qty in Sales Order analytics
2021-06-24 10:21:57 +05:30
Deepesh Garg
3007c9900b Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into payroll_accounting_dimension 2021-06-23 23:06:15 +05:30
Deepesh Garg
7e006496dd fix: Check if item tax template exists 2021-06-23 22:52:51 +05:30
Deepesh Garg
c9c1d10435 fix: Make item tax templates optional 2021-06-23 22:47:29 +05:30
Deepesh Garg
1f7b95f390 fix: User is not able to change item tax template 2021-06-23 20:56:27 +05:30
marination
078826d510 fix: Sider 2021-06-23 20:12:59 +05:30
marination
f913e0dd05 fix: Consider Table Multiselect fields in Query engine
- Since table multiselect fields were not handled, the query tried searching for this child field in item master
- This broke the query
- On trying to reload or go back to all-products page with field filters that are table mutiselect, page breaks
2021-06-23 20:06:11 +05:30
rohitwaghchaure
b4863bfa50 Merge pull request #25696 from rohitwaghchaure/incorrect-serial-no-qty-valuation-report
feat: Incorrect valuation rate report for serialized items
2021-06-23 16:52:51 +05:30
marination
1b9b72d12e fix: Filters did not consider Website Item Group 2021-06-23 16:03:24 +05:30
Deepesh Garg
0bfffddac4 fix: Test Cases 2021-06-23 15:37:17 +05:30
marination
d802d73973 fix: Consider Website Item Groups in Item group page product listing
- Passed an argument to query engine to know when query is for item group page
- If for item group page, get data with regards to website item group table
- This query should be fast since there's one filter and that shortens the table beforehand
- This data is merged with the results from the Item master (results only considering item attributes and field filters)
- The combined data is then sorted as per weightage

Co-authored-by: Gavin D'souza <gavin18d@gmail.com>
2021-06-23 14:24:13 +05:30
Jannat Patel
9ec0ded28f fix: Staffing plan vacancies data type issue (#25941)
* fix: staffing plan vacancies data type issue

* fix: translation issue

* fix: removed greater than 0 condition
2021-06-23 14:05:10 +05:30
Deepesh Garg
35e11fbea6 fix: Tests 2021-06-23 13:17:01 +05:30
Deepesh Garg
208b5f9e73 chore: Add comments 2021-06-23 12:44:56 +05:30
Deepesh Garg
40a4330ec1 fix: Move tax categories up in country wise json 2021-06-23 12:38:37 +05:30
Jannat Patel
44815393b3 fix: job applicant link issue (#25934) 2021-06-23 12:28:02 +05:30
Deepesh Garg
673470705b Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into bootstraped_gst_setup 2021-06-23 11:33:15 +05:30
Anurag Mishra
fc98abece9 feat: Employee Grievance (#25705)
* feat: Employee Grievance

* feat: link to desk and automatic unsuspend

* test: Employee Grievance

* fix: Sider and Translation

* fix: sider

* fix: formatting

* feat: changes requested

* feat: Employee Grievance

* feat: link to desk and automatic unsuspend

* test: Employee Grievance

* fix: Sider and Translation

* fix: sider

* fix: formatting

* feat: changes requested

* fix: patch test and sider issue

* fix: make Employee Responsible non-mandatory since there cannot be an employee responsible for all sorts of grievances

- show pay cut and suspension buttons only if Employee Resposible is set

- some label changes

* feat: added subject field for more context

- set title for documents

- added list view settings

- refactor suspend and unsuspend functions

- add submit and cancel perms for system and hr managers

- fix tests

* fix: sider issues

* fix: removed suspension and paycut

* fix:sider

* fix: test

* fix: test

* fix: resolved Conflicts

* fix: sider

* fix: remove debugging print statements

* fix: validation message

* fix: unnecessary comma

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-06-23 11:21:38 +05:30
marination
ea2c02738d fix: Include Stock Reco logic in update_qty_in_future_sle 2021-06-22 21:44:50 +05:30
Noah Jacob
c05496a5a7 fix: fixed rounding off ordered percent to 100 in condition (#26152) 2021-06-22 17:53:53 +05:30
Subin Tom
219a87d530 fix: disable sales order cancellation if linked to draft invoice (#26125) 2021-06-22 16:28:58 +05:30
Subin Tom
889140fd8c fix: sql syntax error in get_project_name method (#26147) 2021-06-22 16:26:19 +05:30
Deepesh Garg
cfdda21dd2 fix: Export invoices not visible in GSTR-1 report 2021-06-22 13:03:22 +05:30
Marica
703c30f5f8 fix: Consistent alert indicators 2021-06-22 11:20:17 +05:30
Marica
9f15ebe711 Merge pull request #26134 from marination/product-weightage
fix: Sort website products by weightage mentioned in Item master
2021-06-22 11:16:20 +05:30
marination
f97206b3cb fix: Sort website products by weightage mentioned in Item master 2021-06-21 19:38:37 +05:30
marination
ea0dea46e0 fix: sider and semgrep 2021-06-21 16:51:12 +05:30
marination
49ec0e5ac3 feat: Optionally allow rejected quality inspection on submission 2021-06-21 16:18:35 +05:30
rohitwaghchaure
d6eacf556d Merge pull request #26126 from rohitwaghchaure/production-plan-fix-to-show-parent-warehouse
fix: allow to select group warehouse while downloading materials from production plan
2021-06-21 15:39:13 +05:30
rohitwaghchaure
8347eb1dba Update production_plan.js 2021-06-21 15:38:44 +05:30
Rohit Waghchaure
773aabae44 fix: allow to select group warehouse while downloading materials from production plan 2021-06-21 14:54:27 +05:30
rohitwaghchaure
3956f82e7c Merge pull request #26122 from rohitwaghchaure/fix-rate-not-able-to-change
fix: rate not able to change in purchase order
2021-06-21 13:40:29 +05:30
Nabin Hait
6495a4d2ed Merge branch 'version-13-pre-release' into version-13 2021-06-21 11:28:57 +05:30
Nabin Hait
94484d7766 bumped to version 13.5.1 2021-06-21 11:48:57 +05:50
Nabin Hait
9cab26b7bf Merge pull request #26123 from nextchamp-saqib/pos-change-gl-fix-pre-release
fix(pos): unsupported operand type -= for 'float' and 'NoneType'
2021-06-21 11:27:59 +05:30
Ankush
e78364c191 fix: status indicator for delivery notes (#26062)
On list view `per_returned` isn't fetched i.e. `undefined` which become
0 hence the list view indicator is false.

This "computation" is already done by status updater, so relying on
doc.status is better than redefining it.
2021-06-21 11:15:16 +05:30
Saqib
4b32ccb124 fix(pos): unsupported operand type -=: for 'float' and 'NoneType' (#26097) 2021-06-21 10:49:25 +05:30
Saqib
fb89008a13 fix(pos): unsupported operand type -=: for 'float' and 'NoneType' (#26097) 2021-06-21 10:49:09 +05:30
Saqib Ansari
99531a35e0 fix(pos): unsupported operand type -= for 'float' and 'NoneType' 2021-06-21 10:47:23 +05:30
Rohit Waghchaure
582f187726 fix: rate not able to change in purchase order 2021-06-21 00:59:02 +05:30
rohitwaghchaure
ab3cd7e283 Merge pull request #26023 from rohitwaghchaure/fixed-linking-between-mr-and-sq
fix: material request and supplier quotation not linked if supplier quotation created from supplier portal
2021-06-20 15:16:32 +05:30
Marica
29a1a8d2d6 Merge pull request #25878 from rohitwaghchaure/v13-sub-contract-enhancemnet
feat: subcontract code refactor and enhancement
2021-06-20 11:54:23 +05:30
Rohit Waghchaure
3d7f660bec fix: test case for Project Profitability report 2021-06-20 10:20:35 +05:30
Rohit Waghchaure
f5db407461 fix: available qty for consumption 2021-06-19 23:19:45 +05:30
Rohit Waghchaure
5cc3f14506 fix: purchase invoice qty change not recalculate the consumed qty and added test cases for purchase invoice 2021-06-19 23:16:23 +05:30
Rohit Waghchaure
ddb0ec261a fix: code cleanup and convert public method to private for subcontracting class 2021-06-19 23:16:23 +05:30
Rohit Waghchaure
2fb5291785 fix: toggle consumed qty field based on condition 2021-06-19 23:16:22 +05:30
Rohit Waghchaure
9a2db0b5b1 fix: semgrep error 2021-06-19 23:16:22 +05:30
Rohit Waghchaure
a94b89727c feat: subcontract code refactor and enhancement 2021-06-19 23:16:22 +05:30
rohitwaghchaure
a2bb1b8acd Merge pull request #26081 from rohitwaghchaure/fixed-stock-entry-submission-performance
fix: time out while submit / cancel the stock transactions with more than 50 Items
2021-06-19 16:14:14 +05:30
Rohit Waghchaure
8c844e4515 fix: material request and supplier quotation not linked if sq created from supplier portal against rfq 2021-06-19 16:08:26 +05:30
Rohit Waghchaure
8520edc952 fix: time out while submitting the stock transactions with more than 50 items 2021-06-19 00:55:35 +05:30
Deepesh Garg
be881c743e Merge pull request #26108 from deepeshgarg007/loan_repay_via_salary_v13
fix: Sanctioned loan amount limit check
2021-06-18 23:30:29 +05:30
Deepesh Garg
81c97c13ce fix: Sanctioned loan amount limit check 2021-06-18 19:57:53 +05:30
Anurag Mishra
ef6e005c04 Merge pull request #26071 from Anurag810/training_event_fixes_2.0
fix: Training event
2021-06-18 15:44:56 +05:30
Ganga Manoj
3d8f82459b fix(Issue): reset response_by and resolution_by if SLA is removed (#25997) 2021-06-18 11:42:28 +05:30
Anuja Pawar
b066fe9519 fix: insufficient permission for dunning error (#26092) 2021-06-18 11:29:07 +05:30
Deepesh Garg
a58b571ccb fix: Billing address not fetched in Purchase Invoice 2021-06-18 10:45:35 +05:30
rohitwaghchaure
3bb9f4a742 Merge pull request #26098 from rohitwaghchaure/enqueue-cancel-action-in-stock-reco
fix: timeout while cancelling stock reconciliation
2021-06-18 10:44:59 +05:30
Rohit Waghchaure
ef97269386 fix: timeout while cancelling stock reconciliation 2021-06-18 10:11:53 +05:30
Deepesh Garg
59e2e4989b fix: Incorrect billed qty in Sales Order analytics 2021-06-17 19:58:16 +05:30
Eben van Deventer
ddef85ae97 fix: Correct South Africa VAT Rate (#25894)
On 1 April 2018 South Africa increased the VAT rate from 14% to 15%, this proposed change seeks to update the default parameters for a fresh ERPNext installation.
2021-06-17 18:43:30 +05:30
Alan
f9390f596d fix: auto unlink warehouse from item on delete (#26073)
* fix: auto unlink warehouse from item on delete

* fix: sider

* refactor: use delete_doc

* test: add test for unlinking warehouse from item

* refactor: add msgprint to inform user of unlink

* refactor: cleanup and reuse extant functions

* fix: don't delete row, update table
2021-06-17 18:13:23 +05:30
Deepesh Garg
d3ccb024f8 Merge pull request #26078 from nemesis189/fixed-label-rate-for-purchase-invoice-item-v13
fix: removed extra space from label rate
2021-06-17 17:19:17 +05:30
Deepesh Garg
510077b3d4 fix(minor): Translation and linting issues 2021-06-17 11:21:21 +05:30
Deepesh Garg
b8442816ca Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into payroll_accounting_dimension 2021-06-17 11:19:12 +05:30
Deepesh Garg
913e92c29f Merge pull request #26044 from GangaManoj/account-multiselect-gl
feat(General Ledger): Implement multi-account selection
2021-06-16 22:33:50 +05:30
Deepesh Garg
5c19a9251f fix: Accouting Dimensions for payroll entry accrual Journal Entry 2021-06-16 22:14:29 +05:30
Subin Tom
6f9de8c86f fix: removed extra space from label rate 2021-06-16 20:01:29 +05:30
GangaManoj
41b7c1aec0 fix(General Ledger): Improve account filter 2021-06-16 14:40:14 +05:30
Afshan
3b1b4684ba fix: check for duplicate payment terms in Payment Term Template (#26003) 2021-06-16 14:30:45 +05:30
Afshan
8c73f6f19e fix(pos): pos loyalty card alignment (#26051) 2021-06-16 14:28:26 +05:30
Saqib
60ce00531d fix: label for enabling ledger posting of change amount (#26070) 2021-06-16 14:25:55 +05:30
GangaManoj
86f689e54a fix(General Ledger): Get account_currency accurately 2021-06-16 14:23:02 +05:30
Anurag Mishra
b1c72da7d7 fix: Training event 2021-06-16 14:08:32 +05:30
Saqib
1fd80992d7 fix(pos): 'NoneType' object is not iterable (#26066) 2021-06-16 13:27:34 +05:30
Deepesh Garg
d70c6996f2 Merge pull request #25951 from nextchamp-saqib/invoice-opening-pnl-validation
fix: opening invoices can alter profit and loss of a closed year
2021-06-16 10:52:40 +05:30
GangaManoj
53a9ac4466 fix(General Ledger): Condense account_conditions 2021-06-16 04:10:29 +05:30
GangaManoj
79dc0f0afc fix: Remove console.log() 2021-06-16 03:37:11 +05:30
Deepesh Garg
fb9cb78980 Merge pull request #26045 from GangaManoj/filter-cc-project
fix(General Ledger): Filter Cost Center and Project drop-down lists by Company
2021-06-15 21:18:49 +05:30
Nabin Hait
a97556fa8d Merge branch 'version-13-pre-release' into version-13 2021-06-15 19:58:40 +05:30
Nabin Hait
24a88f6cf6 bumped to version 13.5.0 2021-06-15 20:18:40 +05:50
Nabin Hait
1e2df2c109 fix(pos): 'NoneType' object is not iterable 2021-06-15 19:53:57 +05:30
Nabin Hait
b2f2d0e749 chore: Added change log for v13.5.0 2021-06-15 19:44:06 +05:30
Noah Jacob
b5a1491176 fix: escaped warehouse value for sql query (#26049) 2021-06-15 12:44:04 +05:30
Deepesh Garg
95bc141531 Merge pull request #26056 from deepeshgarg007/gst_taxtable_value_with_discount_v13
fix(India): Taxable value for invoices with additional discount
2021-06-15 12:05:16 +05:30
Deepesh Garg
433815daba fix: Update einvoice json test 2021-06-14 20:43:51 +05:30
Deepesh Garg
4afda3c89c fix(India): Taxable value for invoices with additional discount 2021-06-14 20:43:42 +05:30
Deepesh Garg
a717b5ad6e Merge pull request #26055 from deepeshgarg007/payment_entry_auto_tax_fixes_pre_release
fix: Auto tax calculations in Payment Entry
2021-06-14 20:39:52 +05:30
Deepesh Garg
5149101045 Merge pull request #26037 from deepeshgarg007/payment_entry_auto_tax_fixes
fix: Auto tax calculations in Payment Entry
2021-06-14 20:39:41 +05:30
Deepesh Garg
bbf6121bb5 fix: Revert unintended changes 2021-06-14 20:09:31 +05:30
Deepesh Garg
ac52daa14f fix: Import throw 2021-06-14 20:09:23 +05:30
Deepesh Garg
5ef9a62917 fix: Add separate function to validate payment entry taxes 2021-06-14 20:09:17 +05:30
Deepesh Garg
302855e160 fix: Auto tax calculations in Payment Entry 2021-06-14 20:09:10 +05:30
Deepesh Garg
4cd0f6ce23 fix: Revert unintended changes 2021-06-14 20:01:04 +05:30
Deepesh Garg
cf1fc40b06 Merge pull request #25906 from deepeshgarg007/gst_taxtable_value_with_discount
fix(India): Taxable value for invoices with additional discount
2021-06-14 17:11:08 +05:30
GangaManoj
75b30efb05 fix(General Ledger): Filter Project drop-down list by Company 2021-06-14 16:42:27 +05:30
GangaManoj
27ec51f021 fix(General Ledger): Filter Cost Center drop-down list by Company 2021-06-14 16:41:56 +05:30
Marica
18833b5ea1 Merge pull request #26043 from marination/subcontracted-rm-transfer-report-test
fix: Flaky test for Report Subcontracted Raw materials to be transferred
2021-06-14 15:25:05 +05:30
marination
3b070d1b05 fix: Flaky test for Report Subcontracted Raw materials to be transferred 2021-06-14 14:51:33 +05:30
Deepesh Garg
9eac4d0af6 fix: Import throw 2021-06-14 14:44:19 +05:30
Deepesh Garg
8718013c96 fix: Add separate function to validate payment entry taxes 2021-06-14 14:34:44 +05:30
GangaManoj
0511ffcf30 fix(General Ledger): Implement multi-account selection 2021-06-14 13:22:44 +05:30
Nabin Hait
ad58182395 Merge pull request #26030 from ruchamahabal/add-inactive-status-to-employee-v13
feat: add Inactive status to Employee
2021-06-14 12:33:28 +05:30
Nabin Hait
c8ed863454 Merge pull request #26029 from ruchamahabal/add-inactive-status-to-employee-v13-release
feat: add Inactive status to Employee
2021-06-14 12:32:28 +05:30
Deepesh Garg
856484aeb0 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into gst_taxtable_value_with_discount 2021-06-14 11:29:41 +05:30
Deepesh Garg
580346360f fix: Auto tax calculations in Payment Entry 2021-06-14 11:16:39 +05:30
Anoop
28cdff10cf fix: update linked Customer on Patient update only if Link Customer to Patient is enabled (#25926) 2021-06-12 14:17:04 +05:30
Rucha Mahabal
cf349aadf9 fix: unable to enter score in Assessment Result details grid (#25945) (#26031) 2021-06-12 14:05:12 +05:30
Rucha Mahabal
17550fb4bf feat: add Inactive status to Employee 2021-06-12 13:36:47 +05:30
Rucha Mahabal
efd7d584b2 feat: add Inactive status to Employee 2021-06-12 13:34:20 +05:30
Anupam Kumar
400205cc8a fix: payroll entry employee detail issue (#25968)
* fix: payroll entry employee detail issue

* fix: review changes
2021-06-12 12:30:53 +05:30
Marica
d7d5c4c329 Merge pull request #26011 from marination/subcontracted-rm-to-transfer-report
fix: Report Subcontracted Raw Materials to be Transferred
2021-06-11 17:50:30 +05:30
marination
c4d851e45f fix: Test 2021-06-11 17:27:43 +05:30
Ankush Menat
a9c84f749a perf(minor): remove unnecessary comprehensions (#25645) 2021-06-11 16:00:48 +05:30
Ankush Menat
5bb89b0ead test(perf): eliminate repeat creation of HSN codes (#25947) 2021-06-11 15:57:01 +05:30
marination
ec4a3723cc fix: Sider 2021-06-11 12:47:06 +05:30
marination
687ad9b942 fix: Report Raw Materials to be Transferred 2021-06-10 21:18:19 +05:30
Nabin Hait
42d72b55b8 Merge branch 'version-13-hotfix' into version-13-pre-release 2021-06-10 20:26:31 +05:30
Nabin Hait
d17217c4e2 Merge pull request #25831 from deepeshgarg007/tds_advance_payment_v13
feat: Tax deduction against advance payments
2021-06-10 20:25:30 +05:30
Nabin Hait
27299cfcc5 Merge branch 'version-13-hotfix' into version-13-pre-release 2021-06-10 19:45:38 +05:30
Nabin Hait
002ec69b2f Merge pull request #25961 from deepeshgarg007/dynamic_gst_rates
feat: Item Taxes based on net rate
2021-06-10 19:39:48 +05:30
Deepesh Garg
3b34fc4cce Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into tds_advance_payment_v13 2021-06-10 18:57:31 +05:30
Deepesh Garg
5434dd048b Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into dynamic_gst_rates 2021-06-10 18:56:39 +05:30
Deepesh Garg
0d49b6c211 Merge pull request #26004 from gavindsouza/patch-tests-v13
ci: Update Patch tests (backport)
2021-06-10 18:52:27 +05:30
Saqib
9a67141bfb fix(einvoicing): service item check (#26010) 2021-06-10 18:48:55 +05:30
Deepesh Garg
d52539798c Merge pull request #26009 from deepeshgarg007/account_balance_test
fix: Sort account balances by account name
2021-06-10 18:47:43 +05:30
Deepesh Garg
9a243ed469 fix: Sort account balances by account name 2021-06-10 18:16:46 +05:30
Deepesh Garg
a5c3427293 fix: Sort account balances by account name 2021-06-10 18:09:49 +05:30
Deepesh Garg
88176e65e4 fix: Check for gst_hsn_code 2021-06-10 17:31:28 +05:30
Gavin D'souza
137d08a9d7 fix: Manually link_fields from flags before rename_doc 2021-06-10 15:09:17 +05:30
Gavin D'souza
96f8ebc308 fix(patch): Handle NULL values from fieldtype change 2021-06-10 15:08:55 +05:30
Gavin D'souza
43a24f2aa8 ci: Update ERPNext backup patch test >= v10
* Generated v10 backup archive
    * used old v7 erpnext backup hosted via build.erpnext.com
    * upgraded to v10 frappe + erpnext
* Hosted backup on https://erpnext.com/files/v10-erpnext.sql.gz
2021-06-10 15:08:42 +05:30
Gavin D'souza
3dfbfe87e9 chore: Drop < v10 patches from list
v7 backup was restored and upgraded to latest v10.x.x branch. The patches run uptil the upgrade are removed in this change. This means only existing v10 sites are allowed direct upgrade to v13 and newer

There are older version patches still left since they're being used in later ERPNext versions too.
2021-06-10 15:07:56 +05:30
Gavin D'souza
aedf25ba46 chore: Drop old patches
v7 backup was restored and upgraded to latest v10.x.x branch. The
patches run uptil the upgrade are removed in this change. This means
only existing v10 sites are allowed direct upgrade to v13 and newer
2021-06-10 15:07:39 +05:30
rohitwaghchaure
8975c5241e Merge pull request #25988 from rohitwaghchaure/donot-copy-difference-account
fix: on click of duplicate button system has not copied the difference account
2021-06-10 14:39:56 +05:30
Deepesh Garg
882913ca4e Merge pull request #26000 from GangaManoj/gst-settings-card
fix: Only display GST card in Accounting Workspace if it's in India
2021-06-10 12:46:15 +05:30
Deepesh Garg
d063f9a5d1 fix: GL Entry ordering 2021-06-10 12:26:21 +05:30
GangaManoj
076bd5eaab fix: Only display GST card in Accounting Workspace if it's in India 2021-06-10 12:08:44 +05:30
Deepesh Garg
701cba7f03 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into gst_taxtable_value_with_discount 2021-06-10 12:04:38 +05:30
Deepesh Garg
edecd5b0c6 fix: Update einvoice json test 2021-06-10 12:04:30 +05:30
Deepesh Garg
0b5fe1b5eb fix: Failing test case 2021-06-10 10:34:49 +05:30
Deepesh Garg
911818a9e2 fix: Add multiple fixes 2021-06-09 22:55:10 +05:30
Saqib
42557c4ad3 feat: cost-center wise period closing entry (#25766) 2021-06-09 19:48:31 +05:30
Saqib
26f0609390 feat: enable/disable gl entry posting for change given in pos (#25822) 2021-06-09 19:47:28 +05:30
Deepesh Garg
9e648183db fix: Test case 2021-06-09 18:26:16 +05:30
Deepesh Garg
7dabb6be30 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into tds_advance_payment_v13 2021-06-09 18:10:55 +05:30
Deepesh Garg
b57ebba3fd fix: Validate negative allocated amount in Payment Entry (#25799) 2021-06-09 17:56:41 +05:30
Deepesh Garg
4c1dad8207 fix: Debug tests 2021-06-09 14:18:23 +05:30
Deepesh Garg
8090965162 fix: Debug test 2021-06-09 13:45:42 +05:30
Deepesh Garg
758db793be Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into tds_advance_payment_v13 2021-06-09 13:39:07 +05:30
Deepesh Garg
bf5f87c2fe Merge pull request #25969 from deepeshgarg007/inernal_transfer_invoices_ignore
fix: Ignore internal transfer invoices from GST Reports
2021-06-09 13:32:52 +05:30
Deepesh Garg
be631d1caf Merge pull request #25986 from nextchamp-saqib/einvoicing-service-item-check
fix(e-invoicing): service item check
2021-06-09 13:00:43 +05:30
Anupam Kumar
21b8e2f0d8 fix: hiding Rounding Adjustment field (#25380)
* fix: hiding Rounding Adjustment field

* fix: updating purchase_invoice.json
2021-06-09 12:57:21 +05:30
Deepesh Garg
9a282aa593 Merge pull request #25858 from alyf-de/item-tax-templates
feat: Item Tax Templates for Germany
2021-06-09 12:50:27 +05:30
Rohit Waghchaure
99b583f688 fix: on click of duplicate button system copy the difference account from first row 2021-06-09 00:06:35 +05:30
Saqib Ansari
18eed58fc5 fix(e-invoicing): service item check 2021-06-08 20:52:14 +05:30
Rucha Mahabal
5ed2ef493a Merge pull request #25984 from pateljannat/quiz-fixes-v13
fix: Quiz fixes v13
2021-06-08 18:57:24 +05:30
pateljannat
7ace06ac21 fix: sider 2021-06-08 18:26:23 +05:30
Ganga Manoj
0ea4d850e1 fix: Allow all System Managers to delete company transactions (#25834) 2021-06-08 17:23:44 +05:30
pateljannat
bbf07d9214 fix: quiz timer issues 2021-06-08 17:05:44 +05:30
Deepesh Garg
e4fcc5562f refactor: Advance taxes and charges calculation 2021-06-08 16:35:47 +05:30
Sagar Vora
3f1231b77c Merge pull request #25981 from resilient-tech/ssa-selection-v13
fix: choose correct Salary Structure Assignment when getting data for formula eval
2021-06-08 15:21:10 +05:30
Sagar Vora
062e247353 test: remove unused imports 2021-06-08 14:43:28 +05:30
Sagar Vora
ca205be5ac fix: tests 2021-06-08 14:43:28 +05:30
Sagar Vora
0e5e1350b2 perf: use frappe.get_value with wildcard instead of another frappe.get_doc call 2021-06-08 14:43:28 +05:30
Sagar Vora
74818c7b62 fix: improve filter for from_date; validation for joining and relieving date 2021-06-08 14:43:28 +05:30
Sagar Vora
447c978757 fix: choose correct Salary Structure Assignment when getting data for formula eval 2021-06-08 14:43:28 +05:30
Anuja Pawar
d4398fd84a fix: update cost center from pos (#25971) 2021-06-07 16:20:21 +05:30
rohitwaghchaure
cf7baeab16 Merge pull request #25956 from rohitwaghchaure/fixed-conversion-factor-issue
fix: custom conversion factor field not mapped from job card to stock entry
2021-06-07 11:45:44 +05:30
Deepesh Garg
6f2dacc60c Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into tds_advance_payment_v13 2021-06-06 19:31:50 +05:30
Deepesh Garg
7a20c3b92a fix: Ignore internal transfer inoices from GST Reports 2021-06-06 19:23:21 +05:30
Deepesh Garg
18be767f75 fix: Remove invalid test 2021-06-06 13:25:34 +05:30
Saqib
d689068d82 Merge pull request #25928 from nextchamp-saqib/pos-fixes-8
fix(pos): multiple pos issues
2021-06-06 11:25:29 +05:30
Saqib Ansari
3f32969bee fix(pos): broken image in item details section 2021-06-06 11:18:20 +05:30
Saqib Ansari
bc46a9772d fix(pos): cash shortcuts not working 2021-06-06 11:11:07 +05:30
Saqib Ansari
a85c2c16b4 fix(pos): item rate precision in item selector 2021-06-06 11:07:20 +05:30
Deepesh Garg
3646c301ed fix: Linting issues 2021-06-05 13:21:03 +05:30
Deepesh Garg
e8a78bd43d fix: Add test cases 2021-06-05 13:16:39 +05:30
Deepesh Garg
8a7e283926 feat: Item Taxes based on net rate 2021-06-04 22:53:26 +05:30
barredterra
572b6df0f2 Merge branch 'version-13-hotfix' into item-tax-templates 2021-06-04 16:55:11 +02:00
Ankush Menat
215516f819 fix: AttributeError: 'PurchaseReceiptItem' object has no attribute 'purchase_invoice' (#25902) (#25957)
* fix: AttributeError: 'PurchaseReceiptItem' object has no attribute 'purchase_invoice'

This error occurs when upgrading from erpnext 13.0.1 to 13.4.0 after typing
bench update --patch --reset

* fix(minor): use .get instead of getattr

Co-authored-by: D Tim Cummings <tim@triptera.com.au>
2021-06-04 13:09:14 +05:30
Rucha Mahabal
3f45901f25 fix: invalid 'depends_on' expression in opportunity (#25955) 2021-06-04 11:16:38 +05:30
Rohit Waghchaure
af4794b2d1 fix: custom conversion factor field not mapped from job card to stock entry 2021-06-04 10:53:44 +05:30
Saqib
c6e016e545 fix: wrong round off gl entry posted in case of purchase invoice (#25775) 2021-06-04 10:08:22 +05:30
Saqib Ansari
4a1e270072 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into pos-fixes-8 2021-06-04 10:04:09 +05:30
Saqib Ansari
48036b4bab fix: invoices can alter profit and loss of a closed year 2021-06-04 09:54:34 +05:30
rohitwaghchaure
25b953ad16 Merge pull request #25854 from rohitwaghchaure/fixed-timeout-error-in-repost-item-valuation
fix: timeout error in the repost item valuation
2021-06-03 22:14:22 +05:30
rohitwaghchaure
cd503ce01d Merge pull request #25938 from rohitwaghchaure/fixed-timeout-error-in-repost-item-valuation-v13-pre
fix: timeout error in the repost item valuation
2021-06-03 22:14:01 +05:30
rohitwaghchaure
c59371ab0c fix: filter type for item query (#25942) 2021-06-03 20:02:58 +05:30
Raffael Meyer
cee0ddea78 Merge pull request #25943 from rohitwaghchaure/fixed-filters-for-item-query-pre
fix: filter type for item query
2021-06-03 15:58:20 +02:00
Rohit Waghchaure
8449a47048 fix: filter type for item query 2021-06-03 18:32:28 +05:30
barredterra
c99eaf106e Merge branch 'version-13-hotfix' into item-tax-templates 2021-06-03 14:17:43 +02:00
Rohit Waghchaure
4e10ce1632 fix: timeout error in the repost item valuation 2021-06-03 16:35:59 +05:30
Rohit Waghchaure
10558344b0 fix: timeout error in the repost item valuation 2021-06-03 16:34:31 +05:30
Marica
7437748a1d Merge pull request #25805 from ankush/refactor_item
refactor: item doctype
2021-06-03 14:23:18 +05:30
Saqib Ansari
81b9a5ee47 fix(pos): cannot cancel consolidated sales invoice 2021-06-03 12:59:09 +05:30
Saqib Ansari
311b378328 fix(pos): searching items with barcode or serial no 2021-06-03 12:58:53 +05:30
rohitwaghchaure
40b90e5b6e Merge pull request #25478 from noahjacob/prod_plan_feat
feat: Added check box to combine items with same BOM
2021-06-03 12:37:02 +05:30
Marica
e7d9200e0f Merge pull request #25221 from Alchez/dev-quality-inspection-accounts
feat: create Quality Inspections from account and stock documents
2021-06-03 01:39:05 +05:30
Nabin Hait
0385ae2b43 Merge branch 'version-13-pre-release' into version-13 2021-06-02 22:14:20 +05:30
Nabin Hait
8821d71094 bumped to version 13.4.1 2021-06-02 22:34:19 +05:50
barredterra
9affcd8f54 Merge branch 'version-13-hotfix' into item-tax-templates 2021-06-02 17:54:02 +02:00
Nabin Hait
88d94dbf0a Merge pull request #25915 from rohitwaghchaure/fixed-work-order-no-able-to-select-item
fix: not able to select the item code in work order
2021-06-02 19:00:34 +05:30
Nabin Hait
830e87a4dd Merge pull request #25917 from rohitwaghchaure/fixed-work-order-no-able-to-select-item-pre
fix: not able to select the item code in work order
2021-06-02 18:59:41 +05:30
Raffael Meyer
f6627550d1 fix: remove wrong tax_category 2021-06-02 15:17:00 +02:00
barredterra
3c748efae3 feat: add Item Tax Templates for german COAs "SKR03" and "SKR04" 2021-06-02 13:27:15 +02:00
barredterra
b6f27a4cae feat: set is_default for german tax templates 2021-06-02 13:20:33 +02:00
barredterra
f259bf48aa refactor: make tax category 2021-06-02 13:20:03 +02:00
barredterra
e3557ff131 Merge branch 'version-13-hotfix' into item-tax-templates 2021-06-02 12:17:27 +02:00
Rohan Bansal
a06ec03efc test: add test for new QI function 2021-06-02 14:55:31 +05:30
Rohit Waghchaure
5dd92934ae fix: not able to select the item code in work order 2021-06-02 14:27:24 +05:30
Rohan Bansal
11aff80dea Merge remote-tracking branch 'upstream/version-13-hotfix' into dev-quality-inspection-accounts 2021-06-02 14:22:32 +05:30
Rohit Waghchaure
721b4130db fix: not able to select the item code in work order 2021-06-02 14:13:09 +05:30
Deepesh Garg
7c7c084159 fix: Check for tax category 2021-06-02 14:12:28 +05:30
Deepesh Garg
ca34eec2d6 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into bootstraped_gst_setup 2021-06-02 13:26:27 +05:30
Deepesh Garg
b3ed807b70 fix: Regional settings setup 2021-06-02 13:26:21 +05:30
Deepesh Garg
c6dcc9d94a fix(India): Taxable value for invoices with additional discount 2021-06-01 13:13:04 +05:30
Rohit Waghchaure
6432aaa07a feat: added reports to check incorrect qty and valuation for serialized items 2021-06-01 12:46:43 +05:30
Fisher Yu
865663857c fix: chart of accounts importer always error (#25882)
* fix: chart of accounts importer always error 

chart of accounts importer always error Parent Account Missing

* Update chart_of_accounts_importer.py
2021-06-01 12:15:58 +05:30
Ankush Menat
2c7fac0e76 fix: reload doc for possible future schema changes (#25904) 2021-06-01 11:56:00 +05:30
Deepesh Garg
2f5885627d fix: Labeling and other fixes 2021-06-01 11:07:18 +05:30
Jannat Patel
1175e0686b refactor: leave balance report (#25771)
* refactor: leave balance report

* refactor: sql to orm
2021-06-01 10:53:00 +05:30
Ganga Manoj
c8b34798fe fix(Delivery Note): Assign Product Bundle's conversion_factor to Packed Items (#25840) 2021-06-01 10:44:26 +05:30
rohitwaghchaure
970f00922d Merge pull request #25898 from anupamvs/stock-reconciliation
fix: featching serialized items
2021-05-31 20:00:35 +05:30
Jannat Patel
022b5c973a fix: wrap dates in getdate for leave application (#25899)
* fix: wrap dates in getdate for leave application

* fix: translation issue

* fix: replaced today with getdate
2021-05-31 19:49:53 +05:30
Ganga Manoj
908b0090e9 fix: Create POS Invoice for Product Bundles (#25847)
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2021-05-31 19:49:03 +05:30
Deepesh Garg
0ea6725baa fix: Rename Loan Management workspace to Loans (#25856) 2021-05-31 19:48:31 +05:30
Anupam
0358b64743 fix: featching serialized items 2021-05-31 15:59:32 +05:30
Raffael Meyer
80540d38ba fix: add_deduct_tax in Purchase Taxes setup (#25871) 2021-05-31 15:36:20 +05:30
Nabin Hait
d0ba0217e4 Merge branch 'version-13-pre-release' into version-13 2021-05-31 11:14:33 +05:30
Nabin Hait
c63e233bc7 bumped to version 13.4.0 2021-05-31 11:34:33 +05:50
Nabin Hait
4c94ccc8d8 chore: Added change log 2021-05-31 10:51:57 +05:30
Saqib
89f621baa4 fix(pos): closing entry shows incorrect expected amount (#25868) 2021-05-31 09:56:49 +05:30
Rucha Mahabal
3be28054de refactor: Vehicle Expenses Report (#25727)
* refactor: Vehicle Expense Report

* test: Vehicle Expenses Report

* feat: Added Employee filter to report

- fix Vehicle Log form view

* fix: set currency fieldtype for chart data

- added filters for employee and vehicle

* fix: service expenses not getting set
2021-05-31 09:11:42 +05:30
Marica
42b2ea556f Merge pull request #25358 from noahjacob/maintenance_feat
refactor: maintenance schedule and visit enhancements.
2021-05-30 01:20:30 +05:30
Deepesh Garg
48b1a82fa1 fix: Add accounts and templates for reverse charge 2021-05-29 23:54:51 +05:30
Deepesh Garg
ea4f8102e8 Merge pull request #25869 from nextchamp-saqib/plaid-link-reset
fix(plaid): cannot reset plaid link for a bank account
2021-05-29 20:05:25 +05:30
Deepesh Garg
d067e25dad Merge pull request #25828 from Anuja-pawar/issue-summary-report-fix
fix: Add Hold status column in the Issue Summary Report
2021-05-29 19:24:15 +05:30
Deepesh Garg
c3d8115ca1 Merge pull request #25849 from nextchamp-saqib/pos-rate-as-identifier
fix(pos): cannot add same item with different rates
2021-05-29 17:33:11 +05:30
Deepesh Garg
5483f21fe7 Merge pull request #25872 from nextchamp-saqib/fix-pos-broken-img
fix(pos): rendering of broken image on pos
2021-05-29 17:28:03 +05:30
Ankush Menat
431d3295b4 fix: use dictionary filter instead of list (#25874)
Item query doesn't support list filter anymore.
2021-05-28 21:12:25 +05:30
Ankush Menat
2df7f474fa fix: use dictionary filter instead of list (#25875)
Item query doesn't support list filter anymore.
2021-05-28 21:12:10 +05:30
Deepesh Garg
fb9cb0fd23 Merge pull request #25866 from deepeshgarg007/itc_reversa_address
fix(India): Show only company addresses for ITC reversal entry
2021-05-28 18:46:09 +05:30
Deepesh Garg
d4dc76c3ee Merge pull request #25867 from deepeshgarg007/itc_reversal_address_pre
fix(India): Show only company addresses for ITC reversal entry
2021-05-28 18:45:59 +05:30
Saqib Ansari
b72b4c0bf9 fix(pos): rendering of broken image on pos 2021-05-28 17:38:01 +05:30
Noah Jacob
6fb218e033 refactor: suggested changes 2021-05-28 16:15:50 +05:30
Saqib Ansari
05386ff12f chore: remove unwanted method 2021-05-28 12:58:18 +05:30
Deepesh Garg
b084f1d320 fix(India): Show only company addresses for ITC reversal entry 2021-05-28 12:14:56 +05:30
Deepesh Garg
20be7fb93d fix(India): Show only company addresses for ITC reversal entry 2021-05-28 11:57:38 +05:30
Saqib Ansari
bbce2e91a3 fix: reset plaid link button 2021-05-28 11:56:47 +05:30
Saqib Ansari
d24eccd623 fix(plaid): cannot reset plaid link for a bank account 2021-05-28 11:36:24 +05:30
Suraj Shetty
faa25166a9 revert: "ci: Do not generate coverage report for hotfix branch"
Reverts: bcf116422a
2021-05-28 11:23:18 +05:30
noahjacob
0b02f1335f refactor: removed redundant links in test case 2021-05-28 11:04:34 +05:30
noahjacob
d071586589 refactor: removed maintenance schedule detail link 2021-05-28 10:54:35 +05:30
noahjacob
7fa045c1c9 refactor: using parent form links of maintenance schedule 2021-05-28 10:54:35 +05:30
noahjacob
3bca90dbe6 refactor: updated mapping for maintenance schedule links in maintenance visit 2021-05-28 10:54:22 +05:30
Suraj Shetty
68b050de97 Merge pull request #25863 from surajshetty3416/website-theme-fixes-version-13-hotfix 2021-05-28 10:48:23 +05:30
Ganga Manoj
17736afab5 fix(POS): Fix stock availability calculation if negative_stock_allowed is checked (#25859) 2021-05-28 10:03:41 +05:30
Ganga Manoj
8a776a63cd fix(POS): Add Product Bundles to POS item search (#25860) 2021-05-28 09:56:30 +05:30
Suraj Shetty
24f2d58f53 Merge pull request #25862 from surajshetty3416/parallel-distributed-testing-version-13-hotfix 2021-05-28 09:40:58 +05:30
Suraj Shetty
f4db3139b7 refactor: Use css variables for breakpoint value 2021-05-28 09:22:46 +05:30
prssanna
c4d4be3265 fix: ensure website theme is applied correctly 2021-05-28 09:22:45 +05:30
Suraj Shetty
bcf116422a ci: Do not generate coverage report for hotfix branch 2021-05-28 09:12:24 +05:30
Suraj Shetty
85aeca1443 ci: Update Python version to 3.7 2021-05-28 09:10:34 +05:30
Suraj Shetty
6da2212e2d ci: Update frappe branch 2021-05-28 09:10:34 +05:30
Suraj Shetty
113a6f3d80 fix: Use frappe.safe_eval instead of eval 2021-05-28 09:10:34 +05:30
Suraj Shetty
77f2686142 ci: Use only 3 containers for now 2021-05-28 09:10:34 +05:30
Suraj Shetty
b9a8afc234 ci: Add test orchestrator URL 2021-05-28 09:10:34 +05:30
Suraj Shetty
96542c3d04 style: Fix sider issues 2021-05-28 09:10:34 +05:30
Suraj Shetty
273589e835 test: Fix a case where test used to fail due to holiday list
- fixes: "Please set a default Holiday List for Employee EMP-00009 or Company Wind Power LLC" error
2021-05-28 09:10:33 +05:30
Suraj Shetty
54354a84e1 test: Fix permission error 2021-05-28 09:10:33 +05:30
Suraj Shetty
d48ea663d9 test: Fix test name
- Rename TestSubcontractedItemToBeReceived > TestSubcontractedItemToBeTransferred
2021-05-28 09:10:33 +05:30
Suraj Shetty
d1a13ec050 test: Fix valuation rate for raw materials 2021-05-28 09:10:33 +05:30
Suraj Shetty
a891d6eed2 fix: allow_zero_valuation_rate for rejected qty 2021-05-28 09:10:33 +05:30
Suraj Shetty
b3e647feca fix: Pass ORCHESTRATOR_URL via secrets 2021-05-28 09:10:33 +05:30
Suraj Shetty
19c5fd72d6 refactor: Rename assertEquals to assertEqual to avoid deprecation warnings 2021-05-28 09:10:33 +05:30
Suraj Shetty
a70e11450e ci: Check limits 2021-05-28 09:09:36 +05:30
Suraj Shetty
ab8816e11d test: Fix test dependency 2021-05-28 09:09:36 +05:30
Suraj Shetty
c79f5d7514 ci: Try parallel testing with orchestrator 2021-05-28 09:09:36 +05:30
Suraj Shetty
175cb27bcb test: Pass ConflictingTaxRule during tax rule test 2021-05-28 09:09:36 +05:30
Suraj Shetty
8696580254 ci: Fix coveralls 2021-05-28 09:09:36 +05:30
Suraj Shetty
6ca8989013 ci: Disble failfast temporarily 2021-05-28 09:09:36 +05:30
Suraj Shetty
5e88b14a01 chore: Debug 2021-05-28 09:09:36 +05:30
Suraj Shetty
b4c958caf0 chore: Debug 2021-05-28 09:09:36 +05:30
Suraj Shetty
3b69aa80fc ci: Enable coveralls 2021-05-28 09:09:36 +05:30
Suraj Shetty
c26d41acf9 chore: Remove unnecessary print statements 2021-05-28 09:09:36 +05:30
Suraj Shetty
232cd28d67 test: Fix dependencies 2021-05-28 09:07:57 +05:30
Suraj Shetty
7b74985a54 test: Fix test_dependencies 2021-05-28 09:07:57 +05:30
Suraj Shetty
0f3d862ba9 chore: Debug 2021-05-28 09:07:57 +05:30
Suraj Shetty
85dd5d2252 chore: Debug 2021-05-28 09:07:57 +05:30
Suraj Shetty
34e620fb5b test: Fix dependency 2021-05-28 09:07:57 +05:30
Suraj Shetty
dd15304921 fix: Frappe branch 2021-05-28 09:07:57 +05:30
Suraj Shetty
591f3f0bb9 ci: Try Parallel tests 2021-05-28 09:07:57 +05:30
Deepesh Garg
a150645b57 fix: Remove GL Entry from print 2021-05-27 20:10:50 +05:30
Deepesh Garg
2e83cb77ca fix: Split GL Entry 2021-05-27 20:09:45 +05:30
Deepesh Garg
4311fdc3a1 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into bootstraped_gst_setup 2021-05-27 17:49:23 +05:30
barredterra
50794407b4 feat: Item Tax Templates for Germany 2021-05-27 14:17:53 +02:00
barredterra
86ee3ebb09 feat: create tax category during taxes setup 2021-05-27 14:16:26 +02:00
barredterra
46d39d27aa fix: validate company in taxes setup 2021-05-27 14:16:01 +02:00
anushka19
04dfaf3b2a fix: Broken help links fixed 2021-05-27 17:45:37 +05:30
Deepesh Garg
740c68d075 fix: Debug Test 2021-05-27 17:43:53 +05:30
Deepesh Garg
5269f1537d Merge pull request #25857 from Anuja-pawar/fix-ageing-error-pre-release
fix: ageing error in PSOA
2021-05-27 17:38:01 +05:30
noahjacob
fbc8694291 refactor: added maintenance schedule links to parent form 2021-05-27 17:37:57 +05:30
noahjacob
bd783e8072 refactor: renamed item_ref to item_reference 2021-05-27 17:34:16 +05:30
Anuja P
753e5894de fix: ageing error in PSOA 2021-05-27 17:33:22 +05:30
noahjacob
9e4c28852e refactor: added maintenance visit to maintenance schedule dashboard 2021-05-27 17:25:50 +05:30
Deepesh Garg
5dad72260f Merge pull request #25855 from Anuja-pawar/fix-ageing-report-psoa
fix: ageing error in PSOA
2021-05-27 17:24:04 +05:30
Anuja P
bb0a40b995 fix: ageing error in PSOA 2021-05-27 17:15:47 +05:30
Deepesh Garg
ea18230274 fix: Update GL Entry ordering 2021-05-27 16:40:37 +05:30
Saqib Ansari
3382655b5e fix: sider issues 2021-05-27 14:27:38 +05:30
Saqib Ansari
45a89a7c67 fix(pos): cannot add same item with different rates 2021-05-27 13:49:45 +05:30
Deepesh Garg
be3671fe7b fix: Create new supplier for test case 2021-05-27 13:27:17 +05:30
Anuja P
e2059fb9f6 fix: spaces to tabs 2021-05-26 20:07:53 +05:30
Anuja P
5e4128e70c fix: patch for existing issues 2021-05-26 20:03:14 +05:30
noahjacob
dc51388666 style: fixed indentations and formatting 2021-05-26 18:28:24 +05:30
Rohan Bansal
9857d63523 fix: add requested changes 2021-05-26 15:41:36 +05:30
Rohan Bansal
1e3a3b27c6 style: semgrep issues 2021-05-26 15:18:10 +05:30
Rohan Bansal
1cdf5a0dba fix: add requested changes 2021-05-26 14:42:15 +05:30
Rohan Bansal
c5b074269a Merge remote-tracking branch 'upstream/version-13-hotfix' into dev-quality-inspection-accounts 2021-05-26 14:32:14 +05:30
Marica
477a90e2ac Merge pull request #25833 from ankush/translation_fixes
fix(ux): fix unstranslated text in msgprint/throw
2021-05-26 14:12:36 +05:30
Marica
7342eb64e9 Merge pull request #25810 from marination/se-supplier-customer
chore: Cleanup Customer and Supplier Details section in Stock Entry
2021-05-26 14:10:41 +05:30
Anupam Kumar
349ef8274b fix: student invalid password reset link (#25826) 2021-05-26 12:14:02 +05:30
Deepesh Garg
36a11bf9ce Merge pull request #25841 from nextchamp-saqib/fix(gstr-1)--incorrect-gstin-fetched-incase-of-branch-company-address
fix(gstr-1): incorrect gstin fetched incase of branch company address
2021-05-26 11:20:30 +05:30
Marica
be157e7467 Merge branch 'version-13-hotfix' into se-supplier-customer 2021-05-26 11:19:50 +05:30
Anurag Mishra
2e0e4a7861 refactor: Additional Salary form clean up (#25785)
* feat: additional salary clean up

* fix: Label and description

* fix: labels

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-05-26 11:13:19 +05:30
Anuja P
db5217e48e fix: renaming hold to on hold 2021-05-26 11:09:48 +05:30
Saqib Ansari
0e804e292a fix(gstr-1): incorrect gstin fetched incase of branch company address 2021-05-26 10:54:16 +05:30
Anuja P
f3f87886a9 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into issue-summary-report-fix 2021-05-26 10:21:46 +05:30
Deepesh Garg
5e27c7dae2 fix: Add non group filter for account 2021-05-25 22:34:58 +05:30
Deepesh Garg
8fddd0f0c1 fix: Update TDS rate for test 2021-05-25 22:03:50 +05:30
Ankush Menat
ff96bdf0c1 fix(ux): fix unstranslated text in msgprint/throw 2021-05-25 20:59:20 +05:30
Nabin Hait
e5df60287e Merge branch 'version-13-hotfix' into version-13-pre-release 2021-05-25 20:42:58 +05:30
Nabin Hait
ba2cbf8ec6 Merge pull request #25714 from deepeshgarg007/net_values_gl_v13
feat: Show net values in Party Accounts
2021-05-25 20:41:30 +05:30
Deepesh Garg
c262705143 feat: Show net values in Party Accounts (#25714) 2021-05-25 20:39:28 +05:30
Deepesh Garg
81376ea44f feat: Show net values in Party Accounts (#25714) 2021-05-25 20:39:17 +05:30
Ganga Manoj
18cfced032 fix(Material Request): Make status on list and form view the same (#24856) 2021-05-25 19:54:07 +05:30
Nabin Hait
db95db892c fix: merge conflict 2021-05-25 19:33:23 +05:30
Ganga Manoj
99636c6aca fix: rearrange buttons for company doctype (#25617) 2021-05-25 19:17:01 +05:30
Afshan
4d61fa2497 fix: incorrect cr/dr shown in general ledger for multi-currency transactions (#25654) 2021-05-25 19:16:02 +05:30
Laurynas Sakalauskas
6a62ad325f fix(plaid): withdrawals and deposits are recorded incorrectly (#25784) 2021-05-25 19:09:44 +05:30
Rakshith N
507a211c81 fix: fetch email id from dialog box in pos past order summary' (#25808) 2021-05-25 19:03:29 +05:30
Deepesh Garg
84f270e732 fix: Remove unwanted commits 2021-05-25 18:03:42 +05:30
noahjacob
73e41c0bd6 refactor: suggested changes 2021-05-25 18:01:47 +05:30
Deepesh Garg
55a3fb57dd fix: Linting Issues 2021-05-25 17:40:06 +05:30
Deepesh Garg
36d47f97f4 fix: Linting issues 2021-05-25 17:40:04 +05:30
Deepesh Garg
6f84cee6fe fix: Uncommentt test 2021-05-25 17:39:06 +05:30
Deepesh Garg
b07f7d1b70 fix: Linting and other fixes 2021-05-25 17:39:04 +05:30
Deepesh Garg
c9da1fc568 chore: Test case for adance TDS allocation 2021-05-25 17:37:17 +05:30
Deepesh Garg
a23aaf43f4 fix: Allocate advance taxes only for payment entry 2021-05-25 17:36:06 +05:30
Deepesh Garg
e2f83ffaa4 fix: Linting fixes and other checks 2021-05-25 17:35:41 +05:30
Deepesh Garg
77dcee9d67 fix: Test Cases 2021-05-25 17:35:15 +05:30
Deepesh Garg
fd380d34f9 fix: Linting errors 2021-05-25 17:35:05 +05:30
Deepesh Garg
a87e3fcb7c fix: TDS report cleanup 2021-05-25 17:34:45 +05:30
Deepesh Garg
79b422c0a9 fix: Advance TDS in TDS payable monthly report 2021-05-25 17:33:59 +05:30
Deepesh Garg
d18dde7757 fix: Add tds in PO and code cleanup 2021-05-25 17:32:28 +05:30
Deepesh Garg
c26de28613 fix: TDS against Purhase Orders 2021-05-25 17:25:13 +05:30
Deepesh Garg
61c5e478af feat: Tax deduction against advance payments 2021-05-25 17:20:52 +05:30
Deepesh Garg
c9aa726818 feat: Tax deduction against advance payments 2021-05-25 17:17:40 +05:30
Anuja P
3efd411ddb fix: Hold status is added in the report 2021-05-25 16:24:01 +05:30
Ankush Menat
073dcf7e42 ci(semgrep): fix false positives (#25823) 2021-05-25 14:06:10 +05:30
Deepesh Garg
09d9bd19ac Merge pull request #25816 from deepeshgarg007/jv_diff_ignore_v13
fix: Ignore rounding diff while importing JV using data import
2021-05-25 10:59:50 +05:30
rohitwaghchaure
bc7c5bfbe2 Merge pull request #25817 from rohitwaghchaure/fix-removed-serial-no-validate-for-sales-invoice
fix: removed serial no validation for sales invoice
2021-05-25 10:40:46 +05:30
Rohit Waghchaure
b4f0347c02 fix: removed serial no validation for sales invoice 2021-05-24 23:39:25 +05:30
Deepesh Garg
7c0383a9a6 Merge pull request #25815 from deepeshgarg007/cash_flow_mapper_v13
fix: Cashflow mapper not showing data
2021-05-24 20:40:07 +05:30
Anurag Mishra
5670cf4386 feat: enhancements in Training Event (#25782)
* feat: Some Minor fixes

* fix: patch file

* fix: patch

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-05-24 20:24:20 +05:30
Deepesh Garg
25112244ed fix: Ignore rounding diff while importig JV using data import 2021-05-24 20:01:21 +05:30
Deepesh Garg
c348215f61 fix: Cashlfow mapper not showing data 2021-05-24 19:57:53 +05:30
Deepesh Garg
63e4ab4f2d Merge pull request #25777 from Anuja-pawar/fix-process-SOA-format
fix: Process Statement of Accounts formatting
2021-05-24 19:55:21 +05:30
Saqib
dd5b31f8c4 fix: set disable rounded total if it is globally enabled (#25789) 2021-05-24 18:23:03 +05:30
Saqib
b6d061fa8c fix(pos): handle db lock timeout error while pos closing (#25813) 2021-05-24 18:22:03 +05:30
Ankush Menat
15f8a0fb22 test: fix flaky test 2021-05-24 17:55:39 +05:30
Ankush Menat
3aed662f46 chore: translation / semgrep / sider fixes 2021-05-24 17:55:39 +05:30
Ankush Menat
c15fef571f test: item naming series behaviour 2021-05-24 17:55:39 +05:30
Ankush Menat
76dd6e9046 test: contextmanager to change settings 2021-05-24 17:55:39 +05:30
Ankush Menat
42e057d079 test: add test for get_timeline_data in item 2021-05-24 17:55:38 +05:30
Ankush Menat
e971b4592e test: add test for is_stock_item 2021-05-24 17:55:38 +05:30
Ankush Menat
57266a7343 refactor: check_stock_uom_with_bin 2021-05-24 17:55:38 +05:30
Ankush Menat
fc54cf68ac test: add tests for checking stock_uom with bin 2021-05-24 17:55:38 +05:30
Ankush Menat
4e360f805f test: hoist defaults to function signature 2021-05-24 17:55:38 +05:30
Ankush Menat
a11a8e8ab2 chore: add blame ignore file 2021-05-24 17:55:38 +05:30
Ankush Menat
eb17732876 test: add test for item attribute completion 2021-05-24 17:55:37 +05:30
Ankush Menat
f5a937bc45 test: check index creation on item table 2021-05-24 17:55:37 +05:30
Ankush Menat
b9fa12d572 test: add tests for uom conversion function 2021-05-24 17:55:37 +05:30
Ankush Menat
019be66b7b fix: consider all UOMs for intermediate conversion
- Using `get_value` will restrict intermediate UOM to first UOM that is
  found.
- A self join is required to truly capture the required behaviour.
- Add explanation and examples.
2021-05-24 17:55:37 +05:30
Ankush Menat
0d7f54c6c2 refactor: simplify UOM conversion logic
- Remove unnecessary sql query
- Remove convoluted matching logic and be explcitiy while querying.
- better variable names for understanding matching cases
2021-05-24 17:55:37 +05:30
Ankush Menat
297dc5e345 perf: add basic optimisation for uom conversion 2021-05-24 17:55:37 +05:30
Ankush Menat
958d485ba4 refactor: msgprint(raise_exception)->frappe.throw 2021-05-24 17:55:36 +05:30
Ankush Menat
ccbde0efa0 refactor: use enumerate instead of trackign index
also removed dead code
2021-05-24 17:55:36 +05:30
Ankush Menat
44c489223b chore: remove py2 compat code 2021-05-24 17:55:18 +05:30
Jannat Patel
dc7afa743c fix: profitability test (#25812)
* fix: profitability test

* fix: replaced class method

* fix: removed print statement
2021-05-24 17:33:48 +05:30
noahjacob
bf1b3b89d1 refactor: updated conditional visibility of check box 2021-05-24 17:03:15 +05:30
rohitwaghchaure
6809ff4f64 Merge pull request #25776 from rohitwaghchaure/fixed-warehouse-not-found-issue
fix: warehouse not found in stock entry
2021-05-24 17:00:06 +05:30
Nabin Hait
8f057b4bac Merge branch 'version-13-pre-release' into version-13 2021-05-24 16:45:27 +05:30
Nabin Hait
10085580c8 bumped to version 13.3.1 2021-05-24 17:05:27 +05:50
Saqib
6368c976c7 fix: expected amount in pos closing payments table (#25737) 2021-05-24 16:44:38 +05:30
marination
c12264f6bc chore: Cleanup Customer and Supplier Details section in Stock Entry
- Changed depends on value to "Send to Subcontractor" for supplier fields
- Removed Customer fields as they are not relevant to any Stock Entry purpose
- Renamed section to "Supplier Details" visibe on subcontracting transfer
2021-05-24 13:20:22 +05:30
rohitwaghchaure
ce88c945cd Update stock_entry.js 2021-05-24 11:53:27 +05:30
krishnagirishp
5457db0601 chore: remove uses of six.PY2 in codebase (#25062)
* remove uses of six.py2 in codebase

* changes based on pr feedback

* Update amazon_mws_api.py

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-05-23 21:13:44 +05:30
Ankush Menat
7b4a38c71e chore: remove print from account controller (#25807)
This is polluting test output and it's not useful for debugging without
context.
2021-05-23 18:49:26 +05:30
Ankush Menat
a2d6cf3125 chore: remove pytlint config (#25796)
- We have flake8 config and it runs in Sider. Flake8 and pylint have
  huge overlap, no point in using both tools.
- The config is not valid pylint config. So it's useless anyway.
2021-05-23 18:38:14 +05:30
Ankush Menat
c229ac9322 refactor: add guard clause for readability
Both functions only execute based on a condition. In such cases
condition should immediately exit the function, this is called "guard
clause" and helps in readability (less indent, and easy to "exit" when
reading the code.
2021-05-23 16:31:29 +05:30
Ankush Menat
4b484d741d refactor: use is_new() instead of __islocal
Interface over implementation.
2021-05-23 16:31:29 +05:30
Ankush Menat
931c886f92 fix: not checking all fields
`break` will break out of the loop without checking remaining fields.
2021-05-23 16:31:29 +05:30
Ankush Menat
83e6e2e68a refactor: add guard clause for readability 2021-05-23 16:31:29 +05:30
Ankush Menat
0b4858d8e5 refactor: eliminate unnecessary loop, container casts 2021-05-23 16:31:29 +05:30
Ankush Menat
ad58a8164a refactor: code cleanup
minor fixes for improving code quality
2021-05-23 16:31:29 +05:30
Ankush Menat
4a2dbd4885 refactor: cleanup get_timeline_data, remove py2 2021-05-23 16:31:28 +05:30
Ankush Menat
330353a5ce refactor: use frappe.throw instread of recreating
_msgprint was basically duplicating behvaiour of frappe.throw
2021-05-23 16:31:16 +05:30
Ankush Menat
e1ab290911 chore: remove woocommerce package (#25736)
This is not used anywhere. It was added in this commit
df83148d7c
even there it isn't being used.
2021-05-23 11:25:35 +05:30
Marica
eaf0465c44 Merge pull request #25797 from marination/item-variants-report
fix: Item Variant Details Report
2021-05-22 19:05:54 +05:30
marination
b0019bcf5b fix: Item Variant Details Report
Co-authored-by: gavindsouza <gavin18d@gmail.com>

- Handling of variants with special characters
- Set data in appropriately named columns
- Code cleanup
2021-05-21 21:42:11 +05:30
rohitwaghchaure
ab34f5b485 Merge pull request #25742 from ankush/disable_submit_btn
fix: duplicate stock entry on multiple click
2021-05-21 18:13:01 +05:30
rohitwaghchaure
579a1b7028 Merge pull request #25779 from ankush/parallel_stock_transactions
fix: wrong quantity after transaction for parallel stock transactions
2021-05-21 18:11:34 +05:30
Saqib
0b5e340b6e fix(pos): return case for item with available qty equal to one (#25760) 2021-05-21 16:32:56 +05:30
Saqib
e930456be2 fix(e-invoicing): 'NoneType' object is not iterable (#25781) 2021-05-21 16:31:12 +05:30
Alan
1097dc89c5 fix: show allow zero valuation only when auto checked (#25778) 2021-05-21 14:04:03 +05:30
Ankush Menat
4dcac4ae81 refactor(minor): Use identity instead of equality
Ignore false positive.
2021-05-21 13:49:58 +05:30
Ankush Menat
9979cf5fcc fix: wrong quantity after transaction for parallel stock transactions
When two transactions are inserted parallelly then previous SLE could be
incorrect for some of them. Locking SLE table would prevent reading from
it till transaction is complete.
2021-05-21 12:31:06 +05:30
rohitwaghchaure
651e934415 Merge pull request #25683 from noahjacob/supplier_item_group_link
feat: linking supplier with an item group for filtering items
2021-05-21 12:07:53 +05:30
Rohit Waghchaure
795909fdcd fix: warehouse not found in stock entry 2021-05-21 11:31:01 +05:30
Anuja P
605ea044f3 fix: update process SOA format 2021-05-21 11:24:33 +05:30
rohitwaghchaure
84730aa4a5 Merge pull request #25754 from rohitwaghchaure/fixed-do-not-repost-if-scheduler-is-in-running-13
fix: the status of repost item valuation showing In Progress since long time
2021-05-21 09:50:18 +05:30
Rucha Mahabal
722cfdb7e5 Merge pull request #25701 from anupamvs/timesheet-refactor
refactor: timesheet
2021-05-20 23:43:19 +05:30
Rucha Mahabal
a7d0dbb085 fix: calculate total billing amount on fetching timesheets
- show timesheet billing amounts in doc currency
2021-05-20 23:02:11 +05:30
Rucha Mahabal
8a407f1ec3 fix: sider issues 2021-05-20 22:23:44 +05:30
Rucha Mahabal
be247ec3de fix: error message placeholders and sider issues 2021-05-20 22:17:20 +05:30
Rucha Mahabal
0d8b9a9d0a fix(patch): billable field not renamed 2021-05-20 19:53:30 +05:30
noahjacob
f0e6a16910 test: updated test for generated schedule dates 2021-05-20 19:29:12 +05:30
Deepesh Garg
181c5d240b Merge pull request #25767 from deepeshgarg007/gst-ptach-fix-1
fix: Do not throw error on migrate
2021-05-20 18:40:48 +05:30
Mohammad Hasnain Mohsin Rajan
21e662f678 fix: apply permission while selecting projects (#25765) 2021-05-20 17:20:05 +05:30
Deepesh Garg
4427390ab3 fix: Do not throw error in migrate 2021-05-20 17:19:24 +05:30
noahjacob
0169cd845a fix: sider 2021-05-20 15:40:07 +05:30
Anupam
1270febfff fix: sider issues 2021-05-20 14:15:58 +05:30
Anupam
aa516e5d17 fix: review changes 2021-05-20 14:12:18 +05:30
Anupam
aeb88385bb patch: timesheet changes 2021-05-20 14:11:36 +05:30
noahjacob
08598238d7 refactor: suggested changes 2021-05-20 13:23:10 +05:30
Deepesh Garg
8bc90ffcf5 Merge pull request #25755 from nextchamp-saqib/improve-missing-cost-center-msg
fix: missing cost center message on creating gl entries
2021-05-20 11:20:43 +05:30
Deepesh Garg
b63cc307cc Merge pull request #25759 from nextchamp-saqib/einvoicing-fix-7
fix: cannot bypass e-invoicing for non gst item invoices
2021-05-20 11:19:47 +05:30
Saqib Ansari
b9ad385232 fix: remove uncessary query 2021-05-19 19:13:06 +05:30
Saqib Ansari
7fb385a89f fix: cannot bypass e-invoicing for non gst item invoices 2021-05-19 18:47:06 +05:30
Saqib
4bd641367b fix: address template with upper filter throws jinja error (#25756) 2021-05-19 16:38:53 +05:30
noahjacob
516c789127 refactor: variable names and suggested changes 2021-05-19 16:01:39 +05:30
Anupam
4e73c8a79f restructuring timesheet fields 2021-05-19 14:58:12 +05:30
noahjacob
bf7f0530e6 fix: added error handling if entry already exists 2021-05-19 13:53:22 +05:30
noahjacob
8e34c49ac9 refactor: using get_all instead of get_list 2021-05-19 13:51:36 +05:30
noahjacob
3768216dca refactor: updated permissions and mandatory fields 2021-05-19 13:50:35 +05:30
Saqib Ansari
f79ef5d8cf fix: missing cost center message on creating gl entries 2021-05-19 13:04:44 +05:30
Rohit Waghchaure
5456873641 fix: run scheduler for reposting if there is no scheduler is running for the reposting 2021-05-19 12:30:28 +05:30
Anupam
9bd779401d added multi-currency fields 2021-05-18 22:41:28 +05:30
anushka19
90f7ec840c fix: Accumulated depreciation (#25748)
* fix: Accumulated depreciation

* fix: Sider issues
2021-05-18 22:21:42 +05:30
Saqib
8d7d4b0ba7 fix: expected amount in pos closing payments table (#25737) 2021-05-18 18:39:35 +05:30
Marica
0b29bc0eeb Merge pull request #25744 from mujeerhashmi/fix-project-kanban-filter-hotfix
fix: Project filter for Kanban Board
2021-05-18 17:36:30 +05:30
Syed Mujeer Hashmi
426b04003c fix: Project filter for Kanban Board
Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>
2021-05-18 17:02:21 +05:30
Marica
814fd19424 Merge pull request #25732 from noahjacob/ux_landed_cost_voucher
refactor: updated applicable charges form in landed cost voucher
2021-05-18 16:39:31 +05:30
Ankush Menat
ecbb8cbc84 revert: "fix: duplicate stock entry (#25486)"
Not required anymore, submit button is disabled.
2021-05-18 16:35:55 +05:30
Ankush Menat
042b8524cc fix: disable submit button to avoid multiple calls 2021-05-18 16:35:49 +05:30
Marica
5da34bddd6 Merge pull request #25731 from ankush/escaping_company_name
fix: escape company name
2021-05-18 16:35:19 +05:30
Devin Slauenwhite
bdba064fa6 fix: duplicate stock entry (#25486)
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-05-18 16:12:53 +05:30
noahjacob
0ab0fcdd51 feat: added supplier item group link in supplier dashboard 2021-05-18 15:21:24 +05:30
noahjacob
ca2fb47d44 feat: updates item_code filters if item_group is linked to supplier 2021-05-18 15:01:05 +05:30
Ankush Menat
b6783b158f chore: translation fixes 2021-05-17 17:06:41 +05:30
Ankush Menat
f3b3d81e0b fix: escape company name in deferred_revenue 2021-05-17 17:06:41 +05:30
noahjacob
41ac8be6f2 refactor: base_amount field moved below amount field and renamed 2021-05-17 13:58:27 +05:30
Nabin Hait
6bae78f410 Merge branch 'version-13-pre-release' into version-13 2021-05-17 11:36:29 +05:30
Nabin Hait
bc92ecb10f bumped to version 13.3.0 2021-05-17 11:56:29 +05:50
Anupam
42d2f663fa fix: sider fixes 2021-05-17 11:08:26 +05:30
Nabin Hait
9ec0f11800 fix: renamed change log 2021-05-17 10:50:42 +05:30
Nabin Hait
2f403f1bcd fix: renamed change log 2021-05-17 10:50:26 +05:30
Nabin Hait
ad0b8fdd1e chore: Added change log for v13.3.0 2021-05-17 10:49:21 +05:30
Deepesh Garg
87baa646e7 Merge pull request #25260 from AfshanKhan/dimension-wise-accounts-balance-reports
feat: Dimension-wise Accounts Balance Report
2021-05-16 18:04:01 +05:30
Anupam
35137ba9e0 removing currency filter and added rate conversion while fetching timesheets in SI 2021-05-16 14:17:56 +05:30
Anupam
cab998c293 adding patch 2021-05-15 20:40:20 +05:30
Anupam
fd4743cc31 refactor: timesheet 2021-05-15 20:01:17 +05:30
Deepesh Garg
d8de7fccc2 feat: Show net values in Party Accounts 2021-05-14 19:17:28 +05:30
Alan
55c2fec683 feat: add pending qty section to batch/serial selector dialog (#25519)
* feat: add pending qty section to batch/serial selector dialog

* fix: call attach in setup and refresh, fix conditional

* refactor: camel to snake casing
2021-05-14 12:36:41 +05:30
rohitwaghchaure
2aa401826e fix: validation message of quality inspection in purchase receipt (#25666) 2021-05-14 12:34:50 +05:30
rohitwaghchaure
e9f6c8cdb1 fix: validation message of quality inspection in purchase receipt (#25667) 2021-05-14 12:34:13 +05:30
Alan
98fc4195b3 fix: send emails on rfq submit (#25695)
* fix: send emails on rfq submit

* fix: check if email is present for supplier
2021-05-14 12:22:28 +05:30
Alan
eca86290bc fix: show uom for item in selector dialog (#25697) 2021-05-14 12:21:38 +05:30
Deepesh Garg
be3cde9313 chore: Code clean up for purchase receipt GL (#25379)
* chore: Code clean up for purchase receipt GL

* fix: add params for debit and credit in account curreny

* chore: Asset GL entry code cleanup

* fix: Syntax error

* fix: Update variable names

* fix: function naming

* fix: Add undefined variables

* fix: Supplier warehouse fetching

* fix: Linting issues
2021-05-14 12:20:38 +05:30
Deepesh Garg
55fe85d850 feat(India): Multiple GST enhancement and fixes (#25249)
* fix: RCM tax calculation

* feat(India): ITC Reversal via Journal Entry

* fix: Reverse Charge booking logic and validation

* fix: Addd patch for availed ITC fields

* fix: Hooks method to update availed ITC field

* fix: Cleanup and fixes in GSTR3B report

* fix: Update params in GSTR-1 report

* fix: Debit note using Sales Invoice

* fix: Setup and patch

* fix: GSTR 3B report cleanup and updates

* fix: Add method to get invoices liable to reverse charge

* fix: Add taxable value in Purchase Invoice Item

* fix: Inward supplies liable to reverse charge

* fix: Linting issues

* fix: GSTR3B report test
2021-05-14 12:17:41 +05:30
rohitwaghchaure
ba940bb9e1 Merge pull request #25702 from rohitwaghchaure/change-today-to-now-for-reposting
fix: change today to now to get data for reposting
2021-05-13 17:44:38 +05:30
rohitwaghchaure
0048418c46 Merge pull request #25703 from rohitwaghchaure/change-today-to-now-for-reposting-pre
fix: change today to now to get data for reposting
2021-05-13 17:44:27 +05:30
rohitwaghchaure
fc44478810 Update repost_item_valuation.py 2021-05-13 17:42:33 +05:30
Rohit Waghchaure
a0a88a710e fix: change today to now to get data for reposting 2021-05-13 17:42:06 +05:30
Rohit Waghchaure
af1376c1df chore: change today to now to get data for reposting 2021-05-13 17:39:49 +05:30
Mohammad Hasnain Mohsin Rajan
e85770fe3f fix: bank statement import via google sheet (#25676)
* fix: google sheet bank statement import

* fix: quotes

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

* chore: add translation

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

* chore: grammar

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

* fix: remove comment

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2021-05-13 17:33:18 +05:30
Mohammad Hasnain Mohsin Rajan
7c6de1a8ac fix: bank statement import via google sheet (#25677)
* fix: change links in workspace

* fix: google sheet bank statement import

* chore: quotes

* fix: capitalization

* fix: typo

* chore: add translation
2021-05-13 17:28:49 +05:30
rohitwaghchaure
d42dd5d868 Merge pull request #25694 from rohitwaghchaure/fixed-warehouse-tree-time-out-error-13hotfix
fix: timeout error while loading warehouse tree
2021-05-13 17:21:16 +05:30
Rohit Waghchaure
27f50d5852 fix: timeout error while loading warehouse tree 2021-05-13 15:54:35 +05:30
Deepesh Garg
6084baa9ae Merge pull request #25700 from deepeshgarg007/consolidated_report_param_fix_v13
fix: Parameter for get_filtered_list_for_consolidated_report in consolidated balance sheet
2021-05-13 15:23:53 +05:30
Deepesh Garg
347fcedb2e Merge pull request #25698 from deepeshgarg007/consolidated_report_param_fix
fix: Parameter for get_filtered_list_for_consolidated_report in consolidated balance sheet
2021-05-13 15:23:36 +05:30
Deepesh Garg
8e748f8451 fix: Parameter for get_filtered_list_for_consolidated_report in consolidated balance sheet 2021-05-13 15:21:51 +05:30
Deepesh Garg
95e05fbdac fix: Parameter for get_filtered_list_for_consolidated_report in consolidated balance sheet 2021-05-13 14:59:28 +05:30
Anurag Mishra
0c482fde5f feat: Leave Policy Assignment Refactor (#24327)
* feat: Leave Policy Assignment Refactor

* fix: Changes Requested

* fix: sider

* fix: changes requested

* test: fixed

* test: fixed wrong set query

* fix: remove commented code

* fix(style): extra space

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-05-13 13:20:14 +05:30
rohitwaghchaure
c29c6ff9a7 Merge pull request #25692 from rohitwaghchaure/fixed-woocommerce-order-sync-issue-pre
fix: Woocommerce order sync issue
2021-05-12 23:09:33 +05:30
Rohit Waghchaure
fe68a0ff80 fix: Woocommerce order sync issue 2021-05-12 23:08:16 +05:30
rohitwaghchaure
0612300631 Merge pull request #25688 from rohitwaghchaure/fixed-woocommerce-order-sync-issue
fix: Woocommerce order sync issue
2021-05-12 23:07:46 +05:30
Rohit Waghchaure
c3c54fe058 fix: Woocommerce order sync issue 2021-05-12 19:42:04 +05:30
rohitwaghchaure
3c79ee3a2b Merge pull request #25672 from rohitwaghchaure/fixed-don-not-mao-set-warehouse
fix: don't map set warehouse from delivery note to purchase receipt
2021-05-12 17:47:28 +05:30
Afshan
dc205e805f fix: Dialog variable assignment after definition in POS (#25681) 2021-05-12 17:42:06 +05:30
Afshan
6578c045ca fix: Dialog variable assignment after definition in POS (#25680) 2021-05-12 17:41:50 +05:30
rohitwaghchaure
4fbabb4132 Merge pull request #25679 from rohitwaghchaure/fixed-new-fields-not-added
fix: updated modified time in purchase invoice to pull new fields
2021-05-12 16:40:23 +05:30
rohitwaghchaure
4ec0656f64 Merge pull request #25678 from rohitwaghchaure/fixed-new-fields-not-added-pre
fix: updated modified time in purchase invoice to pull new fields
2021-05-12 16:39:35 +05:30
Rohit Waghchaure
aaca8335f0 fix: updated modified time to pull new fields 2021-05-12 16:36:25 +05:30
Rohit Waghchaure
9f017a351b fix: updated modified time to pull new fields 2021-05-12 16:35:19 +05:30
Mohammad Hasnain Mohsin Rajan
e7a2fdd81a fix: change links in workspace (#25674) 2021-05-12 13:02:32 +05:30
Mohammad Hasnain Mohsin Rajan
dd1822ef58 fix: change links in workspace (#25673) 2021-05-12 13:01:53 +05:30
Rohit Waghchaure
d984be0ccd fix: don't map set warehouse from delivery note to purchase receipt 2021-05-12 12:32:14 +05:30
Ankush Menat
b1f8c80be3 ci: enable semgrep check on v13 branches and update rules (#25647)
* ci: enable semgrep on v13 branches

* ci: break semgrep steps for nicer output

* ci: update semgrep rules inline with frappe repo
2021-05-11 18:27:20 +05:30
rohitwaghchaure
958c96ee3f Merge pull request #25660 from deepeshgarg007/promotional_item_cost_center
fix: Breaking cost center validation
2021-05-11 18:08:17 +05:30
Deepesh Garg
a665f14620 fix: Error on adding bank account to plaid (#25658) 2021-05-11 17:33:59 +05:30
Deepesh Garg
a60c3081cf fix: Breaking cost center validation 2021-05-11 16:38:33 +05:30
Nabin Hait
e38192cb6d fix: merge conflict 2021-05-11 11:15:09 +05:30
Deepesh Garg
d2520680bc fix: Error on applying TDS without party (#25632)
* fix: Error on applying TDS without party

* fix: Add placeholder value
2021-05-10 21:17:06 +05:30
Deepesh Garg
83f98f6992 Merge pull request #25653 from deepeshgarg007/tax_labels
fix: Client script breaking while settings tax labels
2021-05-10 18:24:02 +05:30
Deepesh Garg
9f0823a164 fix: Linting issues 2021-05-10 16:07:41 +05:30
Saqib
55d47a2baa fix(pos): UI fixes related to overflowing payment section (#25652)
* fix: additional fields overflowing in payment section

* fix: pos profile filter in pos opening dialog

* fix: item quantity pill
2021-05-10 15:59:37 +05:30
Deepesh Garg
13dfb9734c fix: Lable for transaction child tables 2021-05-10 15:38:32 +05:30
Deepesh Garg
1a48eb49cf fix: Client script breaking while settings tax labels 2021-05-10 14:37:10 +05:30
Ganga Manoj
f2eb8dd1d5 feat: Transaction Deletion Record (#25354)
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2021-05-10 14:02:58 +05:30
Ankush Menat
6e179c3092 fix: sync shopify customer addresses (#25481) 2021-05-10 13:24:26 +05:30
Saqib
9226cd3932 feat(india): reduced rate of depreciation as per IT Act (#25648)
* feat(india): reduced rate of depreciation as per IT Act

* refactor: check date difference instead of month difference

* feat: add test for regional feature
2021-05-10 12:36:56 +05:30
noahjacob
50f52dfbcb refactor: variable names and refactored cancel function into submit function 2021-05-09 20:04:06 +05:30
noahjacob
7715441842 feat: added supplier item group doctype 2021-05-09 20:02:23 +05:30
Ganga Manoj
aa9e172091 feat: Add Create Expense Claim button in Delivery Trip (#25526)
* feat(Delivery Trip): Add employee_code field

* feat(Expense Claim): Add Delivery Trip Number field

* feat(Delivery Trip): Add Create Expense Claim button

* feat(Delivery Trip): Make Create Expense Claim button show up after save

* fix(Delivery Trip): Fix Sider issues

* fix(Delivery Trip): Display button after submit

* fix(Delivery Trip & Expense Claim): Rename new fields

* fix(Delivery Trip): Add button in refresh

* fix(Delivery Trip): Remove redundant line

* fix(Expense Claim): Display delivery_trip only if non-empty

* fix(Delivery Trip): Add test for Create Expense Claim

* fix(Delivery Trip): Fix Sider Issue

* fix(Delivery Trip): Only display Create Expense Claim if the driver is an employee

* fix(Delivery Trip): Fix test

* fix(Delivery Trip): Fix make_expense_claim()

* fix: sider

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2021-05-08 17:15:33 +05:30
rohitwaghchaure
64bd4f27b8 Merge pull request #25611 from rohitwaghchaure/validation-to-check-duplicate-serial-nos
fix: added validation in stock entry to check duplicate serial nos
2021-05-07 23:30:27 +05:30
rohitwaghchaure
42fe07bd19 Merge pull request #25551 from rohitwaghchaure/fixed-total-stock-summary-report
fix: total stock summary report not working
2021-05-07 23:30:06 +05:30
rohitwaghchaure
1726ce547c Merge pull request #25471 from rohitwaghchaure/allow-to-receipt-same-serial-no
fix: allow to receive same serial numbers multiple times
2021-05-07 23:27:50 +05:30
Alan
c6dc9eaf2e feat!: add pick batch button (#25413)
* feat!: add pick batch button

BREAKING CHANGE: replaces setup_serial_no with setup_serial_or_batch_no.

* refactor: use setup_serial_or_batch_no instead of setup_serial_no

* refactor: use setup_serial_or_batch_no instead of setup_serial_no

* refactor: use setup_serial_or_batch_no instead of setup_serial_no

* style: add sider review changes

* refactor: make consice, extract function

* refactor: camel to snake casing
2021-05-07 20:30:04 +05:30
Ankush Menat
90e671905a chore: replace assertEquals with alias assertEqual (#25613)
* chore: replace assertEquals with alias assertEqual

assertEquals has been deprecated.

ref: https://docs.python.org/3/library/unittest.html#deprecated-aliases

* chore: sider fixes
2021-05-07 20:28:51 +05:30
Ankush Menat
e28165ea87 fix: force https for shopify webhook registration (#25630) 2021-05-07 20:27:51 +05:30
Anupam Kumar
da7fefe29d fix: timesheet filter date exclusive issue (#25626) 2021-05-07 20:26:50 +05:30
Saqib
27cf19a19f feat(pos): show POS reserved stock in stock projected qty report (#25593)
* feat(pos): consider POS reserved stock in stock projected qty report

* chore: remove unwanted string formats
2021-05-07 13:37:42 +05:30
Ganga Manoj
5618ce3852 fix(Material Request): Add 'Partially Received' to Status drop-down list (#24857)
Co-authored-by: Ganga Manoj <ganga_manoj@Gangas-MacBook-Air.local>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-05-07 13:35:09 +05:30
Rucha Mahabal
062d30146f fix: Include search fields in Project Link field query (#25505)
* fix: Include search fields in Project Link field query

* fix: add project_name to Project search fields
2021-05-07 13:31:14 +05:30
Umair Sayed
7f79d463f6 fix: Stock and Accounts Settings form refactor (#25534)
* stock and accounts settings page

* fix: Stock and accounts settings page cleanup

Co-authored-by: Umair Sayed <umairsayed@Umairs-MacBook-Air.local>
2021-05-07 12:28:57 +05:30
Shariq Ansari
735fbdc350 fix: Updating Standard Notification's channel field (#25564) 2021-05-07 12:26:32 +05:30
Deepesh Garg
00e00e4e90 fix: Report summary showing inflated values when values are accumulated in Group Company (#25577)
* fix: Report summary showing inflated values when values are accumullated in Group Company

* fix: Remove extra space

* fix: Translate strings

* fix: Remove unintended changes
2021-05-07 12:16:44 +05:30
Shadrak Gurupnor
f648d2d7c4 fix: added tax_types list (#25587) 2021-05-07 12:15:19 +05:30
Ankush Menat
996f7e53a1 fix: update shopify api version (#25600) 2021-05-07 12:14:14 +05:30
Anuja Pawar
f132ed4335 fix: update item level cost center from POS (#25609) 2021-05-07 12:11:09 +05:30
Alan
0e0de6baa1 fix: prevent spurious defaults for items when making prec from dnote (#25559)
* fix: prevent spurious defaults for items when making prec from dnote

* refactor: make concise, use dict comp
2021-05-07 11:40:02 +05:30
Noah Jacob
4ecae62194 fix: added is_stock_item filter (#25530) 2021-05-06 19:42:01 +05:30
Nabin Hait
ec2ba6bc1f Merge branch 'version-13-pre-release' into version-13 2021-05-06 19:18:17 +05:30
Nabin Hait
ae18efaa0a bumped to version 13.2.1 2021-05-06 19:38:17 +05:50
Nabin Hait
0e41295c0e perf: Performance enhancement on setup wizard (#25606)
* perf: Performance enhancement on setup wizard

* fix: create departments without updating nsm
2021-05-06 19:14:06 +05:30
Nabin Hait
134eaa5786 perf: Performance enhancement on setup wizard (#25605)
* perf: Performance enhancement on setup wizard

* fix: create departments without updating nsm
2021-05-06 19:13:54 +05:30
Rohit Waghchaure
695becdd05 fix: added validation in stock entry to check duplicate serial nos 2021-05-06 18:03:32 +05:30
rohitwaghchaure
dc6233b703 Merge pull request #25541 from rohitwaghchaure/fixed-incorrect-serial-no-set
fix: serial no changed after saving stock reconciliation
2021-05-06 17:44:36 +05:30
Saqib
92cefd5655 feat(pos): ability to retry on pos closing failure (#25604)
* feat(pos): ability to retry on pos closing failure

* fix: sider issues

* fix: sider issues

* fix: mark all queued closing entry as failed

* feat: add headline message
2021-05-06 17:03:16 +05:30
Saqib
900a8fb21a feat(pos): ability to retry on pos closing failure (#25595)
* feat(pos): ability to retry on pos closing failure

* fix: sider issues

* fix: sider issues

* fix: mark all queued closing entry as failed

* feat: add headline message
2021-05-06 17:02:47 +05:30
Deepesh Garg
daf6c124a9 fix: Check if payment schedule exists 2021-05-06 16:47:02 +05:30
Deepesh Garg
be66ee9723 fix: Check if payment schedule exits before updating label 2021-05-06 16:46:55 +05:30
Deepesh Garg
a0ed517c85 fix: function call to update payment schedule labels 2021-05-06 16:46:47 +05:30
Sagar Vora
f43a86d90f perf: significant reduction in time taken to save a delivery note (#25475) 2021-05-06 16:40:06 +05:30
Saqib
d502f76319 feat(e-invoicing): e-way bill validity field (#25555) 2021-05-06 16:10:55 +05:30
Deepesh Garg
8a1f86db16 Merge pull request #25582 from deepeshgarg007/this_variable
fix: function call to update payment schedule labels
2021-05-06 15:50:47 +05:30
Deepesh Garg
9dd0a26e92 Merge pull request #25598 from deepeshgarg007/payment_reco_invoice_fix
fix: Invoices not getting fetched during payment reconciliation
2021-05-06 15:49:19 +05:30
rohitwaghchaure
7ed531611b Merge pull request #25588 from 18alantom/fix-check-schedule-date
fix: check for None in item.schedule_date before setting
2021-05-06 14:04:14 +05:30
rohitwaghchaure
180ba1dfc9 Merge pull request #25590 from 18alantom/fix-use-get-serial-nos
fix: use get_serial_nos for splitting
2021-05-06 14:03:15 +05:30
Rohit Waghchaure
bb3e5d00f4 fix: allow to receive same serial numbers multiple times 2021-05-06 12:38:35 +05:30
Deepesh Garg
85b675a554 fix: Invoices not fetch during payment reconciliation 2021-05-05 20:57:31 +05:30
Deepesh Garg
ffea9d4126 fix: Check if payment schedule exists 2021-05-05 12:28:40 +05:30
18alantom
136eb30081 fix: use get_serial_nos for splitting 2021-05-05 12:26:29 +05:30
Deepesh Garg
1bb7bb74ad fix: Check if payment schedule exits before updating label 2021-05-05 12:19:57 +05:30
18alantom
2a20a03c28 fix: check for None in item.schedule_date before setting 2021-05-05 11:59:15 +05:30
rohitwaghchaure
8be414873b Merge pull request #25575 from rohitwaghchaure/fixed-stock-balance-report-and-batchwise-report
fix: stock balance and batch-wise balance history report showing different closing stock
2021-05-05 10:04:23 +05:30
Deepesh Garg
04923d6a65 fix: function call to update payment schedule labels 2021-05-04 21:01:12 +05:30
Asharam Seervi
18ad15ed16 fix: designation insufficient permission on lead doctype. (#25331) 2021-05-04 19:28:07 +05:30
Afshan
eebc6e9277 refactor: Show item's full name on hover over item in POS (#25554)
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2021-05-04 17:05:12 +05:30
Rushabh Mehta
5fc4f1e37d Merge pull request #25238 from alyf-de/datev_fixes
feat: Improve DATEV export
2021-05-04 15:38:57 +05:30
Rohit Waghchaure
ba8dc1ffbd fix: stock balance and batchwise balance history report showing different closing stock 2021-05-04 15:03:10 +05:30
Saqib
384f4b5b7e fix: can't open general ledger from consolidated financial report (#25542) 2021-05-04 12:33:49 +05:30
Saqib
1e554378c7 fix(pos): incorrect expense account set in pos invoice (#25571) 2021-05-04 12:28:24 +05:30
Saqib
076020643d fix: empty payment term column in accounts receivable report (#25556) 2021-05-04 12:26:49 +05:30
18alantom
308905b1be fix: semgrep, refactor default mutable dict 2021-05-04 11:46:13 +05:30
18alantom
e36f303042 fix: use percent string templates for db.sql calls 2021-05-04 11:46:13 +05:30
barredterra
24e2cc9107 Merge branch 'develop' into datev_fixes 2021-05-03 18:19:28 +02:00
Suraj Shetty
ca37380d2e Merge branch 'develop' of github.com:frappe/erpnext into develop 2021-05-03 19:44:22 +05:30
Rucha Mahabal
f1bdfac7a8 fix: Employee Separation (#25503)
* fix: Employee Separation

- add ignore_mandatory flag for project creation

- form clean-up

* fix: Employee Separation test
2021-05-03 18:37:00 +05:30
rohitwaghchaure
1f4df80565 Merge pull request #25531 from noahjacob/fix_mr_filter
fix: updated item filters for material request
2021-05-03 18:36:25 +05:30
rohitwaghchaure
88734eea14 Merge pull request #25557 from rohitwaghchaure/increased-timeout-of-stoc-reco
fix: stock reconciliation getting time out error during submission
2021-05-03 18:25:33 +05:30
Rohit Waghchaure
8f34ca4ac6 fix: stock reconciliation getting time out error during submission 2021-05-03 15:32:13 +05:30
Saqib
cdc99cdd49 fix(pos): incorrect expense account set in pos invoice (#25543) 2021-05-03 11:54:55 +05:30
rohitwaghchaure
9cc7c294e7 Update stock_reconciliation.py 2021-05-03 10:25:53 +05:30
Deepesh Garg
0ae702aab9 Merge branch 'develop' of https://github.com/frappe/erpnext into bootstraped_gst_setup 2021-05-02 22:37:04 +05:30
Deepesh Garg
84ec295b43 Merge pull request #25546 from deepeshgarg007/loan_schedule_fixes
fix: Minor fixes in loan
2021-05-02 22:35:34 +05:30
Deepesh Garg
1bac72b74d fix: Add GST accounts to GST Settings 2021-05-02 22:29:48 +05:30
Deepesh Garg
72e602ae54 fix: Add validation for GST Settings 2021-05-02 18:22:29 +05:30
Rohit Waghchaure
6a5a380c07 fix: total stock summary report not working 2021-05-02 18:02:28 +05:30
Rohit Waghchaure
35d4829383 fix: serial no changed after saving stock reconciliation 2021-05-02 17:57:28 +05:30
rohitwaghchaure
5f177aaeaa Merge pull request #25545 from rohitwaghchaure/fixed-depost-withdrwal-values-has-not-updated
fix: rename field has not updated value of deposit and withdrawal fields
2021-05-02 17:54:22 +05:30
Deepesh Garg
c571141c1f fix: Test cases 2021-05-02 15:31:04 +05:30
Deepesh Garg
f6610c96dd fix: Gracefully handle duplicate bank account name to make setup faster 2021-05-02 12:23:11 +05:30
Deepesh Garg
a66184fe3c fix: Remove redundant get_doc 2021-05-02 12:22:16 +05:30
Deepesh Garg
824f089569 fix: Auto write off on loan closure 2021-05-01 22:07:13 +05:30
Deepesh Garg
1efafb3ce8 fix: Do not roundoff balance amount 2021-05-01 21:52:43 +05:30
Rohit Waghchaure
2fb573781d fix: rename field has not updated value of deposit and withdrawal fields 2021-05-01 17:56:40 +05:30
Nabin Hait
0c7448fc41 fix: Fixed merge conflict 2021-05-01 14:54:22 +05:30
Nabin Hait
a2fcca85a5 fix: Fixed merge conflict 2021-05-01 14:53:13 +05:30
Nabin Hait
d8cd5a95cb bumped to version 13.2.0 2021-05-01 15:12:44 +05:50
Nabin Hait
3c788f0325 chore: Add release note for v13.2.0 2021-05-01 14:42:30 +05:30
rohitwaghchaure
2e38f1514f fix: stock ledger entry created against draft stock entry (#25539) 2021-05-01 13:53:46 +05:30
rohitwaghchaure
00ea336b52 fix: stock ledger entry created against draft stock entry (#25540) 2021-05-01 13:53:39 +05:30
Afshan
1fd1e2bb60 fix: fieldname when updating docfield property (#25517) 2021-04-30 18:41:26 +05:30
Afshan
e91b0021ac fix: fieldname when updating docfield property (#25516) 2021-04-30 18:41:19 +05:30
Afshan
5a4615fd4e fix: allow to cancel loan with cancelled replayment entry (#25508) 2021-04-30 18:40:43 +05:30
Nabin Hait
a19c6a9278 fix: Fetch total stock at company in PO (#25533) 2021-04-30 18:38:49 +05:30
Nabin Hait
da0ba15cbf fix: Fetch total stock at company in PO (#25532) 2021-04-30 18:38:41 +05:30
Deepesh Garg
204ea1027f fix: Ignore validations for Tax Setup 2021-04-30 16:35:52 +05:30
Deepesh Garg
89120695a6 Merge pull request #25529 from deepeshgarg007/psoa_fixes_v13_pre_release
fix: Ageing errors in PSOA
2021-04-30 16:33:26 +05:30
Raffael Meyer
07a081d8ac Merge branch 'develop' into datev_fixes 2021-04-30 12:25:40 +02:00
noahjacob
a90c81626f fix: updated item filters for material request 2021-04-30 15:49:36 +05:30
Deepesh Garg
88d40e8dc4 fix: Remove extra space 2021-04-30 15:33:33 +05:30
Deepesh Garg
1deef5229e fix: Linting and translation issues 2021-04-30 15:20:55 +05:30
Deepesh Garg
bd5ee7d725 fix: Use party account currency 2021-04-30 15:20:45 +05:30
Deepesh Garg
9cbca06f4e fix: Updated filters for process statement of accounts 2021-04-30 15:20:31 +05:30
Deepesh Garg
303f6d2d36 Merge branch 'version-13-pre-release' of https://github.com/frappe/erpnext into psoa_fixes_v13_pre_release 2021-04-30 15:17:07 +05:30
Deepesh Garg
178938b2f0 fix: Ageing errors in PSOA 2021-04-30 15:14:24 +05:30
Deepesh Garg
3d9fa2b8de Merge pull request #25528 from Anuja-pawar/fix_allocated_amt_pre_release
fix: update allocated amount after paid amount is changed in PE version13 pre release
2021-04-30 14:42:18 +05:30
Deepesh Garg
c4231c72a6 Merge pull request #25524 from aerele/develop
fix: List invoices in Payment Reconciliation Payment
2021-04-30 14:15:33 +05:30
noahjacob
c0352010d3 test: creating schedule and visit 2021-04-30 14:09:30 +05:30
Anuja P
435e93bda9 fix: allocated amount change wrt paid amount change 2021-04-30 13:52:48 +05:30
Deepesh Garg
8aa57953ee Merge pull request #25490 from deepeshgarg007/psoa_fixes_v2
fix: Ageing errors in PSOA
2021-04-30 13:07:00 +05:30
Deepesh Garg
cd9fa61659 Merge pull request #25521 from ernestoruiz89/patch-4
fix: Make strings translatable
2021-04-30 12:58:26 +05:30
Deepesh Garg
26920b439a Merge pull request #25394 from meike289/feature/check-field-subscription-invoice
feat: new check field in subscriptions for (not) submitting invoices
2021-04-30 12:32:45 +05:30
noahjacob
7ad66caf7f refactor: migrated calculation and validation logic in js to py 2021-04-30 11:43:38 +05:30
Deepesh Garg
0dc411951e Merge pull request #25438 from nextchamp-saqib/round-off-diff-allowance
fix: ignore fraction difference while making round off gl entry
2021-04-30 11:11:21 +05:30
Deepesh Garg
1ec53c1cf2 Merge pull request #25518 from nextchamp-saqib/payment-term-amount-currency-fix-v13
fix: payment amount showing in foreign currency
2021-04-30 11:09:58 +05:30
Deepesh Garg
338a006e28 Merge pull request #25515 from Anuja-pawar/fix_PE_allocated_amt
fix: update Allocated amount after Paid Amount is changed in PE
2021-04-30 11:08:51 +05:30
Vignesh S
7783a56c08 fix: List invoices in Payment Reconciliation Payment
Invoices are not listed in the Payment Reconciliation Payment table due to a typo in the code
2021-04-29 22:39:42 +05:30
Ernesto Ruiz
76e1e68cf4 fix: Make strings translatable
Make strings translatable
2021-04-29 08:24:56 -06:00
Saqib Ansari
3e83542360 fix: sider issues 2021-04-29 18:12:47 +05:30
Saqib
2bde1baa38 fix: remove print statement 2021-04-29 18:12:42 +05:30
Saqib Ansari
6dd1c5cf92 refactor: remove extra fields 2021-04-29 18:12:36 +05:30
Saqib Ansari
3a5ecb7587 fix: test 2021-04-29 18:12:32 +05:30
Saqib Ansari
973afeac3c feat: set dynamic labels for payment schedule fields 2021-04-29 18:12:27 +05:30
Saqib Ansari
a91eebf6aa feat: base payment amount in payment schedule 2021-04-29 18:12:23 +05:30
Saqib Ansari
e70d9c925c fix: payment amount showing in foreign currency 2021-04-29 18:12:17 +05:30
Anuja Pawar
07fb98b91d Merge branch 'develop' into fix_PE_allocated_amt 2021-04-29 17:17:21 +05:30
Anuja P
dd1e7624bf fix: changing paid amount should change allocated amount 2021-04-29 17:00:59 +05:30
Deepesh Garg
7bf25b4cef Merge pull request #25292 from nextchamp-saqib/payment-term-amount-display-currency-fix
fix: payment amount showing in foreign currency
2021-04-29 16:33:01 +05:30
Mohammad Hasnain Mohsin Rajan
0dc00219e8 fix: coveralls different services for different events (#25513) 2021-04-29 15:21:16 +05:30
Saqib Ansari
6fb417590f fix: sider issues 2021-04-29 14:05:20 +05:30
noahjacob
90c667205a test: added on_cancel test 2021-04-29 13:06:04 +05:30
noahjacob
93c22ebbb9 refactor: created separate function to update work_order on cancel 2021-04-29 12:57:41 +05:30
Deepesh Garg
3386d4948e Merge pull request #25507 from AfshanKhan/fix-cancel-loan
fix: allow to cancel loan with cancelled repayment entry
2021-04-29 12:31:52 +05:30
Saqib
83e3820575 fix: remove print statement 2021-04-29 12:21:56 +05:30
Noah Jacob
dc086dd52f fix: item stock levels displaying inconsistently (#25506)
* fix: fixed stock levels dashboard not displaying after any interactions

* fix: minor translation fix
2021-04-29 11:03:27 +05:30
Afshan
ab052599c0 fix: allow to cancel loan with cancelled replayment entry 2021-04-28 20:21:04 +05:30
noahjacob
56f697052c test: added test case for combining items 2021-04-28 20:12:33 +05:30
noahjacob
b7ca913904 fix: Added Item Reference field to link tables and update work_order_qty 2021-04-28 19:27:20 +05:30
gavin
3b1ae4eb90 Merge pull request #25501 from ankush/remove_frappe_dep
chore: remove frappe from requirements.txt
2021-04-28 17:38:35 +05:30
Ankush Menat
64a38f52cf chore: remove frappe from requirements.txt
Due to recent changes in pip dependency resolver, in some random cases
pip thinks frappe is not installed and tries to fetch it from pypi,
which results in errors like #25496

Until a better solution is available, frappe should not be part
of requirements.txt
2021-04-28 16:56:10 +05:30
Raffael Meyer
d75b4c37a3 Merge branch 'develop' into feature/check-field-subscription-invoice 2021-04-28 12:38:49 +02:00
Raffael Meyer
a949480acf fix: add translation to make semgrep pass 2021-04-28 12:38:23 +02:00
Saqib Ansari
44b07e4ef5 refactor: remove extra fields 2021-04-28 15:11:57 +05:30
Saqib Ansari
da5b55c4f5 fix: test 2021-04-28 14:55:33 +05:30
Saqib Ansari
3f7ec95af8 Merge branch 'develop' of https://github.com/frappe/erpnext into payment-term-amount-display-currency-fix 2021-04-28 14:45:27 +05:30
Saqib Ansari
aa4f750d8c fix: test 2021-04-28 14:42:49 +05:30
Saqib Ansari
3f53b87379 Merge branch 'develop' of https://github.com/frappe/erpnext into round-off-diff-allowance 2021-04-28 14:34:51 +05:30
Mohammad Hasnain Mohsin Rajan
c9187b00af fix: change coveralls version (#25499) 2021-04-28 13:32:27 +05:30
noahjacob
82905166d9 fix: Fixed updating sales order work qty after cancelling work order 2021-04-28 10:14:36 +05:30
Nabin Hait
f085c89994 Merge branch 'version-13-hotfix' into version-13 2021-04-27 20:08:01 +05:30
Nabin Hait
b7fea12cdf Merge branch 'version-13' into develop 2021-04-27 20:08:01 +05:30
Nabin Hait
3e5c6424ed bumped to version 13.1.1 2021-04-27 20:28:01 +05:50
Rucha Mahabal
a86a51f020 fix(HR): Permission error while adding weekly holidays (#25450) 2021-04-27 20:01:49 +05:30
Saqib
7b3dd3585b fix: unexpected keyword argument 'merge_logs' (#25489)
* fix: unexpected keyword arguement 'merge_logs'

* fix: reference error

* fix: test
2021-04-27 20:01:08 +05:30
Saqib
ad4365eb0e fix: unexpected keyword argument 'merge_logs' (#25489)
* fix: unexpected keyword arguement 'merge_logs'

* fix: reference error

* fix: test
2021-04-27 20:00:21 +05:30
Deepesh Garg
8a1e5e189c fix: Ageing errors in PSOA 2021-04-27 16:57:34 +05:30
barredterra
5b9d3f15a2 docs: replace whitespace indent in docstring with tabs 2021-04-27 12:34:10 +02:00
Raffael Meyer
b2be91e731 Merge branch 'develop' into datev_fixes 2021-04-27 12:21:14 +02:00
rohitwaghchaure
b9078a0c86 Merge pull request #25126 from rohitwaghchaure/purchase-invoice-to-purchase-receipt-develop
feat: purchase receipt creation from purchase invoice
2021-04-27 09:56:28 +05:30
Deepesh Garg
ebc6c51abe Merge pull request #25384 from deepeshgarg007/psoa_fixes
fix: Updated filters for process statement of accounts
2021-04-26 22:58:42 +05:30
Afshan
df06e49e0c feat: enable custom field search on POS (#25421)
* feat: multi lingual item search in POS

* fix: limit the options for selection and broken down funtion for geting condition
2021-04-26 22:48:13 +05:30
Anurag Mishra
7f1b2de74d feat: Employee Referral (#24997)
* feat: Employee referal design and status sync

* feat: create job Applicant and linked Document

* feat: Added list view indicator

* chore: formatted file

* feat: Addedd Employee Referral form Dashboard

* feat: pay compensation via additional salary

* test: Employee Rreferral

* Update erpnext/hr/doctype/employee_advance/employee_advance.js

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>

* fix: changes requested

* fix: changes requested

* fix: sider

* fix: translation

* fix: test

* feat: added to Dashboard

* fix: changes

* chore: clean-up Employee Referral form

- fix labels

- fix full name field

- fix failing test

- set title for Employee Referral form

- set fields in List View and Standard Filter

* feat: option to add a resume link

- copy resume and resume link from Employee Referral to Job Applicant

* fix: multiple fixes

- confirm before rejecting employee referral

- set primary actions for custom buttons

- Validations for additional salary against employee referrals with status as accepted only

- fix list view indicators

- code formatting style

* feat: Add field to track Referral Bonus Payment Status

- fix visibility of additional salary button

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-04-26 22:23:48 +05:30
Nabin Hait
2ddca77243 Merge branch 'develop' into version-13-pre-release 2021-04-26 21:12:07 +05:30
Saqib
b643776c53 feat(e-invoicing): auto calculate distance for e-way bill generations (#25480) 2021-04-26 17:12:20 +05:30
Rucha Mahabal
1608658700 Merge pull request #25209 from NagariaHussain/employee-util-report
feat: Employee Hours Utilization Report
2021-04-26 17:04:35 +05:30
Saqib
34ce4edf29 fix: cannot scan spacebar character in pos (#25479) 2021-04-26 16:38:57 +05:30
Rucha Mahabal
d5ca9474ce fix: add employee name in report data 2021-04-26 16:10:06 +05:30
Rucha Mahabal
926a9aed58 Merge branch 'develop' into employee-util-report 2021-04-26 16:03:39 +05:30
Rucha Mahabal
7a84d76489 fix: tests 2021-04-26 16:03:10 +05:30
noahjacob
1e912db3bb feat: Added check box to combine items 2021-04-26 16:01:17 +05:30
Ankush Menat
9178d95cca fix: can not create item variants (#25433)
* fix: item_code assigned to function returning None

* fix: ignore has_variants and attributes in variant

* fix: patch to remove has_variants and attributes

* chore: fix whitespace in translation
2021-04-26 15:37:17 +05:30
Jannat Patel
616f1d3624 fix: issue in project custom status (#25452) 2021-04-26 15:35:49 +05:30
Sagar Vora
71342320ce fix(Italy): multiple fixes in import supplier invoice (#25466)
* fix(Italy): remove incorrect method, use defined variable

* fix: show attach section after save; use db_set
2021-04-26 15:32:28 +05:30
Ankush Menat
c2de4f6b35 chore: update snyk (#25477) 2021-04-26 15:28:17 +05:30
Deepesh Garg
4c8d15b487 fix: Incorrect GL Entry validation (#25474)
* fix: Incorrect GL Entry validation

* fix: Add validation for party accounts

* fix: Scrub labels

* fix: Translation
2021-04-26 15:24:34 +05:30
Deepesh Garg
ab7664e595 Merge pull request #25444 from deepeshgarg007/gstr_backward_compatiability
fix: Backward compatibility for GSTR-1 report
2021-04-26 15:09:55 +05:30
Deepesh Garg
0b9aa58b81 Merge branch 'develop' of https://github.com/frappe/erpnext into psoa_fixes 2021-04-26 14:51:20 +05:30
Deepesh Garg
968ec110f3 fix: Linting and translation issues 2021-04-26 14:51:00 +05:30
Deepesh Garg
cac3fd3a24 Merge pull request #25460 from Anuja-pawar/fix_allocated_amt_in_PE
fix: to update Allocated amount after Paid Amount is changed in PE
2021-04-26 13:29:17 +05:30
Rucha Mahabal
4716ebea5a feat: Add % Utilization (Billed Only)
- Added billed utilization metric in report summary
2021-04-26 11:40:26 +05:30
Anuja Pawar
fee9a56d4e Merge branch 'develop' into fix_allocated_amt_in_PE 2021-04-26 11:36:10 +05:30
Anuja P
802518b8ac Merge branch 'fix_allocated_amt_in_PE' of https://github.com/Anuja-pawar/erpnext into fix_allocated_amt_in_PE 2021-04-26 11:34:33 +05:30
Anuja P
f74d8d2e16 fix: suggested changes 2021-04-26 11:31:51 +05:30
Rucha Mahabal
2a1a472371 chore: clean-up
- set default date filters for last month instead of year

- added abbreviations for columns to use them in the metrics labels
2021-04-26 11:18:32 +05:30
Shadrak Gurupnor
b9d4719285 fix: circular loop in project task (#25454)
* fix: circular loop in project task
2021-04-26 11:14:07 +05:30
Rucha Mahabal
0decc2b66a fix: validate Standard Working Hours
- use standard working hours in metrics calculation
2021-04-26 11:00:54 +05:30
Rucha Mahabal
b7a7e1b11a Merge branch 'develop' into employee-util-report 2021-04-26 10:25:42 +05:30
Rucha Mahabal
9d6520d4a7 Merge pull request #24944 from pateljannat/profitability-report
feat: Project Profitability Report
2021-04-26 10:02:36 +05:30
Rucha Mahabal
e939da982e Merge branch 'develop' into profitability-report 2021-04-26 09:17:12 +05:30
Rucha Mahabal
2a25c7505e fix: report column widths 2021-04-25 20:29:14 +05:30
Walstan Baptista
4a805b5622 chore: frappe.whitelist for doc methods (#25465) 2021-04-24 14:23:08 +05:30
Anuja Pawar
dc215ec08d Merge branch 'develop' into fix_allocated_amt_in_PE 2021-04-23 22:06:15 +05:30
Rucha Mahabal
e63f3b2f36 fix: standard working hours message and link for HR Settings 2021-04-23 20:33:42 +05:30
Rucha Mahabal
184317d5bd fix(HR): Permission error while adding weekly holidays (#25450) 2021-04-23 20:03:50 +05:30
Anuja P
dc599e0164 fix: to update Allocated amount after Paid Amount is changed 2021-04-23 19:24:53 +05:30
gavin
1b1c1bcbd0 Merge pull request #25455 from revant/docs-docker-readme
docs: add docker repo link in README
2021-04-23 16:31:41 +05:30
gavin
62d2df5815 docs: Add Frappe reference in Containerized Install section 2021-04-23 16:31:13 +05:30
Saqib Ansari
c5c9f9a941 feat: set dynamic labels for payment schedule fields 2021-04-23 15:34:58 +05:30
Saqib Ansari
d552fe6778 feat: base payment amount in payment schedule 2021-04-23 14:46:52 +05:30
Suraj Shetty
52ea6b126b Revert "fix: email digest user not found"
This reverts commit 188657d05a.
2021-04-23 14:14:47 +05:30
Saqib Ansari
242242c43f Merge branch 'develop' of https://github.com/frappe/erpnext into payment-term-amount-display-currency-fix 2021-04-23 13:54:13 +05:30
Revant Nandgaonkar
68b514b1f5 docs: add docker repo link in README 2021-04-23 13:06:13 +05:30
meike289
8787ebf83d Apply suggestions from code review
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2021-04-23 08:06:29 +02:00
Rucha Mahabal
373e248e9f fix(patch): lab module patch fix (#25447) (#25449)
* fix(patch): lab module patch fix

* fix: param

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>

Co-authored-by: Anoop <3326959+akurungadam@users.noreply.github.com>
2021-04-22 22:47:39 +05:30
Anoop
c21ce42559 fix(patch): lab module patch fix (#25447)
* fix(patch): lab module patch fix

* fix: param

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-04-22 22:44:44 +05:30
Deepesh Garg
eed60bf035 fix: Backward compatibility for GSTR-1 report 2021-04-22 17:11:22 +05:30
pateljannat
84ef7419da fix: sider 2021-04-22 16:31:16 +05:30
Saqib
3d4acf9e5c fix: permission error after submitting exchange rate revaluation (#25432) 2021-04-22 16:16:03 +05:30
Rucha Mahabal
e3b8057eb4 fix: Laboratory Module patch (#25431) 2021-04-22 16:11:17 +05:30
Rucha Mahabal
3847452b60 fix: Laboratory Module patch (#25436) 2021-04-22 16:11:01 +05:30
pateljannat
2004fec8eb fix: removed multicurrency 2021-04-22 14:52:36 +05:30
Saqib
19b73968d7 fix(pos): validations & minor ui issues (#25351)
* fix: pos print format

* fix: stock validation on pos invoice creation
2021-04-22 13:38:20 +05:30
Saqib Ansari
b0e160ff78 fix: ignore fraction difference while making round off gl entry 2021-04-22 13:23:50 +05:30
pateljannat
ba6ad7f5be fix: escape for format and msg for working hours if not set 2021-04-22 11:19:44 +05:30
Mohammad Hasnain Mohsin Rajan
7f932cfb30 fix: display reconcile tool when closing balance 0 (#25417)
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2021-04-22 04:53:09 +05:30
Alan
157b388209 fix: change subcontracted item display (#25425) 2021-04-21 21:00:22 +05:30
Deepesh Garg
66a71bdd1a fix: Issues on new company setup 2021-04-21 20:42:20 +05:30
Deepesh Garg
50997709d5 fix: Update country-wise-tax JSON and tax setup 2021-04-21 20:41:57 +05:30
Ernesto Ruiz
090177494d fix: Make strings translatable
Make strings translatable
2021-04-21 09:04:06 -06:00
Deepesh Garg
e5e20c50a9 Merge branch 'develop' into purchase-invoice-to-purchase-receipt-develop 2021-04-21 19:09:41 +05:30
pateljannat
485464d1f4 fix: added back a hook 2021-04-21 18:04:58 +05:30
Afshan
6d3305c446 fix: added total column 2021-04-21 15:34:58 +05:30
Afshan
48b2fc9b12 Merge branch 'develop' into dimension-wise-accounts-balance-reports 2021-04-21 15:21:02 +05:30
Nabin Hait
db76612462 Merge branch 'version-13-pre-release' into version-13 2021-04-21 12:34:49 +05:30
Nabin Hait
29d4ac13ac Merge branch 'version-13' into develop 2021-04-21 12:34:49 +05:30
Nabin Hait
c3b7c1b998 bumped to version 13.1.0 2021-04-21 12:54:49 +05:50
pateljannat
a92560d79f Merge branch 'profitability-report' of https://github.com/pateljannat/erpnext into profitability-report 2021-04-21 12:32:31 +05:30
pateljannat
039a5a829d fix: dynamic values for tests 2021-04-21 12:32:25 +05:30
Deepesh Garg
2acc66db2c fix: Add tax categories on company setup 2021-04-21 11:49:02 +05:30
noahjacob
fa9629c1e1 fix: Updated forms and fixed an error. 2021-04-21 11:29:40 +05:30
Nabin Hait
cb92ead061 fix: Added Change Log 2021-04-21 11:22:35 +05:30
Jannat Patel
d106db60ad Merge branch 'develop' into profitability-report 2021-04-21 09:10:49 +05:30
Ernesto Ruiz
66250351d2 fix: Add transtlation function to strings
Add transtlation function to strings
2021-04-20 14:35:14 -06:00
Deepesh Garg
3130ed52ff fix: Item Tax templates for GST 2021-04-20 23:23:07 +05:30
Deepesh Garg
e379f083bb feat(India): Separate Input and Output GST tax accounts 2021-04-20 23:04:39 +05:30
Deepesh Garg
e7895cea71 Merge pull request #25393 from deepeshgarg007/loan_manager_amend
fix: Add amend perm for loan and system manager for loan doctypes
2021-04-20 22:21:52 +05:30
Raffael Meyer
48cd4de0d2 Merge branch 'develop' into feature/check-field-subscription-invoice 2021-04-20 16:15:01 +02:00
Deepesh Garg
6d88cf9ede Merge branch 'develop' into loan_manager_amend 2021-04-20 19:08:31 +05:30
pateljannat
cbdcfb4873 fix: multicurrency 2021-04-20 17:53:41 +05:30
Syed Mujeer Hashmi
704ec132b7 feat:Inpatient Occupancy Table Editable for Healthcare Admin (#24989)
Make Admitted datetime and  Discharge Datetime editable along with
Inaptient Occupancy Service Unit, Check_In and Check_out time.

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-04-20 16:39:46 +05:30
gavin
59a2ebd2f4 Merge pull request #25156 from Alchez/feat-py3-dependencies
feat: manage Python 3 compatiblity with dependencies
2021-04-20 15:38:29 +05:30
Rohan Bansal
524b81abd9 feat: manage Python 3 compatiblity with dependencies 2021-04-20 14:13:55 +05:30
noahjacob
57f487a16b fix: Updated serial_no filters in maintenance visit. 2021-04-20 13:51:34 +05:30
Marica
0278646fd8 fix: Cashier query in POS Opening/Closing Entry (#25399) 2021-04-20 12:53:33 +05:30
Marica
125c3d64a9 fix: Cashier query in POS Opening/Closing Entry (#25398) 2021-04-20 12:53:22 +05:30
Afshan
de69a1186c Merge branch 'develop' into dimension-wise-accounts-balance-reports 2021-04-20 11:43:28 +05:30
Marica
b91fcbd70e fix: Ignore Customer Group Perm on AlL Products page (#25396) 2021-04-19 22:21:07 +05:30
Marica
846200d069 fix: Ignore Customer Group Perm on AlL Products page (#25397) 2021-04-19 22:20:01 +05:30
Rucha Mahabal
c221682373 fix: Bulk Salary Structure Assignment (#25389) 2021-04-19 21:11:27 +05:30
Rucha Mahabal
923fb008c7 fix: remove non-standard module cards from Home Workspace (#25391) 2021-04-19 21:09:47 +05:30
Raffael Meyer
4a1159408a Merge branch 'develop' into feature/check-field-subscription-invoice 2021-04-19 16:40:35 +02:00
Meike Nedwidek
ebbcc90d89 add check field for subscription invoices if they should be submitted automatically 2021-04-19 15:28:37 +02:00
noahjacob
5d7d338d2a feat: Schedule status is now updated on submitting a visit. 2021-04-19 18:39:34 +05:30
Deepesh Garg
047044f975 fix: Add amend perm for loan and system manager for loan doctypes 2021-04-19 18:27:37 +05:30
Deepesh Garg
135b852cf0 fix: Use party account currency 2021-04-19 17:27:26 +05:30
pateljannat
73896ce94c fix: conflicts 2021-04-19 16:50:39 +05:30
pateljannat
3b54b1e975 fix: report name and columns 2021-04-19 16:49:28 +05:30
noahjacob
9a0a561ec6 feat: Created Dialog Box on trying to create a maintenance visit. 2021-04-19 16:42:50 +05:30
Rucha Mahabal
5d7f7094d6 Merge branch 'develop' into employee-util-report 2021-04-19 16:24:55 +05:30
Hussain Nagaria
1f8326bb1f chore: Add Report to Dashboard 2021-04-19 16:19:13 +05:30
Afshan
0e949adea5 Merge branch 'develop' into dimension-wise-accounts-balance-reports 2021-04-19 14:04:49 +05:30
Nabin Hait
840c921229 Merge branch 'develop' into purchase-invoice-to-purchase-receipt-develop 2021-04-19 13:30:19 +05:30
Deepesh Garg
cb718fce88 feat: Role to allow over billing, delivery, receipt (#24854)
* feat: Role to allow  over billing, delivery, receipt

* fix: Typo
2021-04-19 13:25:15 +05:30
Rakshith N
ceba5774be fix(pos): special character scanning in point of sale (#25353)
Co-authored-by: rakshith.n <rakshith.n@promantia.com>
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2021-04-19 13:21:49 +05:30
Afshan
632166a933 fix: make filters for payroll entry (#25386) 2021-04-19 12:58:27 +05:30
Ankush Menat
edf3dfa5a4 fix: commit leave_allocation change to db (#25382) (#25383) 2021-04-19 12:47:41 +05:30
Jannat Patel
119b27b97f feat: Delayed Tasks Summary (#25024)
* feat: delayed deliverables summary

* fix: sider

* fix: renamed to delayed tasks

* fix: renamed test

* fix: test

* fix: sider

* fix: dates, validations and chart

* fix: space and column width

* feat: Sort tasks by descending order of delay

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-04-19 12:46:14 +05:30
Alan
ac8a467b0a fix: exclude spurious Stock Entry Types from 'consumed' calculation (#25352)
* fix: exclude spurious 'Stock Entry Type's from 'consumed' calculation

* fix: filter using purpose, make requested changes

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-04-19 12:38:25 +05:30
Deepesh Garg
bb746fcbe4 fix: Updated filters for process statement of accounts 2021-04-19 12:19:31 +05:30
Ankush Menat
6c88ab07c7 fix: commit leave_allocation change to db (#25382) 2021-04-19 11:51:46 +05:30
Afshan
b6d2106184 fix: available employee for selection (#25378)
* fix: available employee for selection

* fix: available employee for selection

fix: available employee for selection
2021-04-19 11:48:43 +05:30
Afshan
9c9907cf8e fix: available employee for selection (#25377)
* fix: available employee for selection

* fix: available employee for selection

fix: available employee for selection
2021-04-19 11:48:28 +05:30
Marica
e8bc912ffc perf: Fetching exchange rate on every line item slows down PO (#25345)
* fix: Dont fetch exchange rates for each line item once fetched at parent
`

* perf: Use price list conversion rate from parent

- If price list conversion rate exists in args already from earlier call, use that
- `get_price_list_currency_and_exchange_rate` wont be called for each child row

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-04-19 11:05:21 +05:30
Jannat Patel
dcdd3bebbe feat: Timer in LMS Quiz (#24246)
* feat: new fields in quiz doctypes

* feat: timer in lms quiz

* fix: variable initialisation

* fix: context, exception fix

* fix:sider

* fix:sider

* fix: indentation

* fix: timer

* fix: sider

* fix: return value and format

* fix: show time taken only after all attempts are over

* fix: sider

Co-authored-by: pateljannat <jannatpatel@MacBook-Air.local>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-04-19 10:36:40 +05:30
Ankush Menat
7eac4a250d fix: functions using mutable defaults (#25370) 2021-04-19 10:33:39 +05:30
Saqib
e782531529 fix: Apply single transaction threshold on net_total instead of supplier credit amount (#25243)
* fix: Apply single transaction threshold on net_total instead of supplier credit amount

* fix: Apply single transaction threshold on net_total instead of supplier credit amount

* fix: test

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-04-19 10:15:51 +05:30
Deepesh Garg
1e0d22a38f Merge pull request #24805 from alyf-de/improve_taxes_setup
refactor: Setup Taxes and Charges
2021-04-19 09:12:47 +05:30
Raffael Meyer
9ee6e4feb8 Merge branch 'develop' into improve_taxes_setup 2021-04-18 18:34:41 +02:00
barredterra
d397bb1b74 Merge branch 'improve_taxes_setup' of https://github.com/alyf-de/erpnext into improve_taxes_setup 2021-04-18 18:34:02 +02:00
barredterra
80d44cada4 fix: remove is_default from country wise tax 2021-04-18 18:33:34 +02:00
rohitwaghchaure
4ed5d994a4 Merge pull request #25374 from ankush/shipment_status_update
fix: commit  changes to shipment status in database
2021-04-18 17:56:22 +05:30
Ankush Menat
c28fcba779 ci(semgrep): add correctness rule for on_cancel
Changes done to doctype object in `on_submit` are not commited to
database. Add rule to catch similar bugs.
2021-04-18 13:22:19 +05:30
Ankush Menat
e972ceb798 fix: patch for updating shipment status 2021-04-18 13:22:19 +05:30
Ankush Menat
9229ee1745 fix: update shipment status in database
Caught by semgrep rule:
https://github.com/frappe/erpnext/blob/develop/.github/helper/semgrep_rules/frappe_correctness.yml#L4
2021-04-18 13:22:19 +05:30
rohitwaghchaure
72e3a81878 Merge pull request #25375 from ankush/minor_semgrep_fixes
fix: remove duplicate keys from dictionaries
2021-04-18 13:04:00 +05:30
Raffael Meyer
ef4c494b2b Merge branch 'develop' into improve_taxes_setup 2021-04-17 19:38:36 +02:00
barredterra
476fff149b Merge branch 'develop' into improve_taxes_setup 2021-04-17 18:41:31 +02:00
Ankush Menat
ad6a2657ae chore: minor translation fixes 2021-04-17 16:56:09 +05:30
Ankush Menat
dedf2c1b61 fix: remove duplicate keys from dictionaries 2021-04-17 16:56:08 +05:30
Saqib
75e13f7bb6 fix(e-invoicing): add company validation for e-invoicing (#25348)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-04-17 15:38:47 +05:30
Saqib
18c7815a1b fix: presentation currency in statement of accounts (#25367) 2021-04-17 15:37:40 +05:30
rohitwaghchaure
fbc0d16d8b Merge pull request #25372 from ankush/eq_assignment_fix
fix: equality check instead of assignment in cart
2021-04-17 13:43:54 +05:30
rohitwaghchaure
1254af502b Merge pull request #25362 from anupamvs/disable_rounded_total
feat: added Disable Rounded Total in sales transactions
2021-04-17 13:30:24 +05:30
Ankush Menat
d6be154ac2 fix: implicit string concatenation (#25371)
* fix: implicit string concatenations

* chore: rerun healthcare patch for company fields
2021-04-16 22:08:44 +05:30
Ankush Menat
67e647232c ci(semgrep): Add semgrep testing (#24871)
Adds semgrep testing in CI.

Refer to:
- https://github.com/frappe/frappe/pull/12524
- https://github.com/frappe/frappe/pull/12577
2021-04-16 21:44:49 +05:30
Ankush Menat
adf974810d fix: equality check instead of assignment in cart 2021-04-16 21:15:50 +05:30
Saqib
36247faf1a fix(e-invoicing): add company validation for e-invoicing (#25349)
* fix(e-invoicing): add company validation for e-invoicing

* fix: test
2021-04-16 18:45:19 +05:30
Nabin Hait
eeece59a17 Merge branch 'develop' into disable_rounded_total 2021-04-16 18:44:17 +05:30
Marica
ede339f80b fix: Serial No not updated correctly via Inter Company Stock Transfer (#25006)
* fix: Serial No not updated correctly via Inter Company Stock Transfer

* chore: Added More Test Cases for inter company Serial Transfer

* fix: Test for serial no duplication

- fixed serial no test
- made errors more meaningful on serial no validation

* fix: Stock Reco Test

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2021-04-16 18:42:54 +05:30
noahjacob
5ebc6abfad feat: Sales Person field is now editable after submitting. 2021-04-16 16:59:10 +05:30
Jannat Patel
b1aad63a99 fix: leave policy in leave allocation (#25334)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-04-16 16:08:22 +05:30
Raffael Meyer
6daae681bd Merge branch 'develop' into datev_fixes 2021-04-16 12:37:14 +02:00
noahjacob
e6fd3b86bd fix: fixed sider issues and translation syntax. 2021-04-16 15:48:36 +05:30
Hussain Nagaria
2399e84052 Merge branch 'employee-util-report' of https://github.com/NagariaHussain/erpnext into employee-util-report 2021-04-16 15:41:25 +05:30
Hussain Nagaria
f1b4ce7430 feat: Add filtering by department
Also:

- Add department filter to js
- Add department column to report
- Fetch only those timesheets which have an Employee Linked
- Update unit tests
2021-04-16 15:36:43 +05:30
Anupam
9d9c256e70 feat: added Disable Rounded Total in sales transactions 2021-04-16 00:11:40 +05:30
Afshan
4b496b65b7 fix: filter for employees in salary slip (#25361) 2021-04-15 23:53:12 +05:30
Afshan
c0db286dc1 fix: filter for employees in salary slip (#25360) 2021-04-15 23:48:25 +05:30
Ankush Menat
799b3c26a4 Merge pull request #25359 from 18alantom/fix_shipment_pickup_to
fix: shipment pickup_to, pickup_from functionality.
2021-04-15 21:16:24 +05:30
Ankush Menat
5207edc188 Merge branch 'develop' into fix_shipment_pickup_to 2021-04-15 21:01:52 +05:30
18alantom
6179cc1311 fix: make pickup_to and pickup_from mandatory fields 2021-04-15 20:36:28 +05:30
18alantom
597bb8be18 fix: remove pickup_to, pickup_from and get_pickup_time
relies on server-side validation instead js controller
2021-04-15 20:32:45 +05:30
noahjacob
2c802720c3 feat: Automated setting end_date based on periodicity, no of visits and improved ux. 2021-04-15 20:31:18 +05:30
Rucha Mahabal
56c428663f fix: Additional Salary component amount not getting set (#25356) 2021-04-15 18:54:38 +05:30
Rucha Mahabal
39b1cd827a fix: Additional Salary component amount not getting set (#25355) 2021-04-15 18:54:29 +05:30
Afshan
2da6ab7f2a Merge branch 'develop' into dimension-wise-accounts-balance-reports 2021-04-15 18:07:04 +05:30
noahjacob
1ac471e04f feat: generate schedule is also triggered on save. 2021-04-15 16:48:01 +05:30
rohitwaghchaure
72929aab38 Merge pull request #24878 from anupamvs/planning
feat: add total available stock field in PO
2021-04-15 16:28:49 +05:30
Sun Howwrongbum
c50fbc6897 fix: list lookup with undefined variable (#25210)
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-04-15 14:52:13 +05:30
rohitwaghchaure
640b5e00ce Merge pull request #25152 from ankush/customer_duplicates
fix: disable auto naming of customer during import
2021-04-15 14:46:11 +05:30
rohitwaghchaure
1bdc457777 Merge pull request #25304 from ankush/fix_sl_rounding
fix(stock_ledger): round off values near to zero
2021-04-15 14:44:09 +05:30
Saqib
593071bd53 fix: currency symbol in bank transaction list view (#25336) 2021-04-15 14:12:11 +05:30
Anupam Kumar
ee0dda6ba5 Merge branch 'develop' into planning 2021-04-15 12:48:25 +05:30
Marica
4e25aa77dd Merge branch 'develop' into dev-quality-inspection-accounts 2021-04-14 19:06:14 +05:30
Marica
61f5f36c65 Merge pull request #24910 from AndyOverLord/patch-8
fix: copy_parent_value_in_all_row function error
2021-04-14 19:04:23 +05:30
Marica
f045fde9f4 Merge branch 'develop' into patch-8 2021-04-14 18:56:15 +05:30
Marica
24e45163d5 fix: Sider 2021-04-14 18:53:15 +05:30
Ganga Manoj
c4565651ff fix: Let Administrator delete company transactions (#25300)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-04-14 17:11:36 +05:30
Saqib
b54cc7c7f5 fix: pos print receipt (#25330) 2021-04-14 15:09:11 +05:30
Saqib
d4fd1038dc fix: pos print receipt (#25329) 2021-04-14 15:07:10 +05:30
Saqib
8798f30808 fix: pos print receipt (#25328) 2021-04-14 15:05:33 +05:30
Rohan Bansal
03f711e3a2 style: sider issues 2021-04-14 14:41:55 +05:30
rohitwaghchaure
ac6facda3d Merge pull request #25186 from rohitwaghchaure/fixed-incorrect-batch-selected-in-purchase-rceipt-develop
fix: incorrect batch picked in subcontracted purchase receipt
2021-04-14 14:35:12 +05:30
rohitwaghchaure
3d9d4e03de Merge pull request #25145 from rohitwaghchaure/fixed-incorrect-incoming-rate-for-sales-return-issue-develop
fix: incorrect incoming rate for the sales return
2021-04-14 14:34:46 +05:30
Rohan Bansal
7f8b95efe8 fix: move QI logic to stock module 2021-04-14 14:15:45 +05:30
Nabin Hait
2535fe9b1e fix: Resolved merge conflict 2021-04-14 13:09:50 +05:30
Nabin Hait
b77793763a Merge branch 'version-13-pre-release' into version-13 2021-04-14 12:53:53 +05:30
Nabin Hait
88b3c52533 bumped to version 13.0.2 2021-04-14 13:13:53 +05:50
Nabin Hait
ece4c16d8f chore: Added change log 2021-04-14 12:53:25 +05:30
rohitwaghchaure
3f6ba12344 Merge pull request #24408 from rohitwaghchaure/custom-user-type-feat
feat: Employee Self Service
2021-04-14 11:54:25 +05:30
Nabin Hait
1bc65ddbe4 Merge branch 'develop' into purchase-invoice-to-purchase-receipt-develop 2021-04-14 11:23:34 +05:30
Nabin Hait
90df99e470 Merge branch 'develop' into fixed-incorrect-incoming-rate-for-sales-return-issue-develop 2021-04-14 11:23:25 +05:30
Nabin Hait
5931931c93 Merge branch 'develop' into customer_duplicates 2021-04-14 11:23:12 +05:30
Nabin Hait
f7441c4c0a Merge branch 'develop' into fixed-incorrect-batch-selected-in-purchase-rceipt-develop 2021-04-14 11:23:00 +05:30
Nabin Hait
b7b35734a7 Merge branch 'develop' into employee-util-report 2021-04-14 11:22:51 +05:30
Deepesh Garg
e2dc102bc6 fix: Zero amount completed delivery notes being shown in Sales Invocie get items (#25317) 2021-04-14 11:21:11 +05:30
Deepesh Garg
b67058869a fix: Round off final tax amount instead of current tax amount (#25188)
* fix: Round off final tax amount instead of current tax amount

* fix: Syntax error

* fix: Indentation

* fix: Round Off taxes order execution

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-04-14 11:20:27 +05:30
Deepesh Garg
b717420842 fix: Role to override maintain same rate check in transactions (#25193)
* feat: configurable action if the same purchase/selling rate is not maintained

* fix: Role to override maintain same rate check in transactions

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-04-14 10:43:45 +05:30
Nabin Hait
dd02b5abf1 Merge branch 'develop' into fix_sl_rounding 2021-04-14 10:36:40 +05:30
m1ngaa
f68205468c Delete accounts (an empty file)
This file has no purpose, and must've been included as a tiny mistake..?
2021-04-14 05:50:31 +08:00
rohitwaghchaure
ce6c3b5b74 fix: incorrect incoming rate for the sales return (#25306) 2021-04-13 20:55:52 +05:30
Afshan
82ebc47ba1 Merge branch 'develop' into dimension-wise-accounts-balance-reports 2021-04-13 19:38:04 +05:30
Rohit Waghchaure
a8f78fabfd fix: patch failing while migrating from v7 to v13 2021-04-13 18:51:21 +05:30
Rohit Waghchaure
610ccd4c03 fix: modified permission 2021-04-13 18:51:21 +05:30
Rohit Waghchaure
03635fb0c4 feat: ESS User 2021-04-13 18:51:21 +05:30
Saqib
dbb76a7d00 fix(e-invoicing): validations & tax calculation fixes (#25314)
* fix: GST on freight charge in e-invoicing

* feat(india): bulk e-invoice generation (#24969)

* fix: cannot fetch e invoice settings

* fix: patch condition (#25301)

* fix: patch condition

* fix: except einvoice loading error seperately

* fix: json.loads error

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-04-13 18:49:03 +05:30
Deepesh Garg
ca412d37c8 Merge pull request #25290 from deepeshgarg007/gstr_1_taxable_value_update
fix: Taxable value including Freight and Forwarding charges in GSTR-1 Report
2021-04-13 17:49:56 +05:30
Nabin Hait
10c61376e3 fix: Backport missing commits to develop branch (#25305) 2021-04-13 15:46:01 +05:30
Marica
1f9d231acf Merge branch 'develop' into patch-8 2021-04-13 15:43:46 +05:30
Deepesh Garg
2fe3056fa2 Merge pull request #24993 from frappe/ishanloya-regional
Correct state code for 'Other Territory'
2021-04-13 15:37:29 +05:30
Deepesh Garg
9aad73b9f0 Merge pull request #25195 from ankush/use_isinstance_instead_of_type
fix: broken type check in stock ageing report
2021-04-13 15:24:53 +05:30
Deepesh Garg
0dcb48a6ee Merge pull request #25167 from ankush/escape_sql_credit_report
fix: escape sql filters in credit report
2021-04-13 15:24:15 +05:30
Deepesh Garg
3db8ba2d4a Merge pull request #25033 from anupamvs/se-add-to-transit
fix: unable to submit stock entry
2021-04-13 14:59:54 +05:30
Deepesh Garg
c05f4ee1aa Merge pull request #25082 from AfshanKhan/add-blank-for-status-issue-reports
fix: added blank option for status in report related to issue
2021-04-13 14:59:01 +05:30
Deepesh Garg
bb92929048 Merge pull request #25256 from nextchamp-saqib/italy-e-invoicing
feat(italy): add document type field for e-invoicing
2021-04-13 13:48:21 +05:30
Suraj Shetty
36083ff36c Merge pull request #25310 from rmehta/grid-field-fix 2021-04-13 12:40:27 +05:30
Suraj Shetty
82d0a1a13e style: Add missing semicolons
- & make formatting consistent
2021-04-13 12:35:42 +05:30
Rushabh Mehta
ff935b4586 fix(minor): fix dynamically changing grid properties 2021-04-13 12:09:36 +05:30
Rushabh Mehta
3c58fd4d5e fix(minor): fix dynamically changing grid properties 2021-04-13 12:05:10 +05:30
Rushabh Mehta
65f25c27b3 fix(minor): fix dynamically changing grid properties 2021-04-13 11:58:16 +05:30
Abdullah Abouzekry
20140425c8 fix: sales order not saving due type mismatch in promo scheme (#24748) (#25222) 2021-04-13 11:36:39 +05:30
Deepesh Garg
1f49335335 Merge branch 'develop' into gstr_1_taxable_value_update 2021-04-13 10:29:52 +05:30
Ankush Menat
34d00772e7 Merge pull request #25303 from ankush/fix_bom_test
test: ignore floating point errors in test_bom
2021-04-12 20:34:10 +05:30
Ankush Menat
6a014d12c1 fix(stock_ledger): round off values near to zero 2021-04-12 20:21:27 +05:30
Ankush Menat
c65751d97f test: ignore floating point errors in test_bom 2021-04-12 19:45:34 +05:30
Saqib
a19c98255f fix: patch condition (#25301) 2021-04-12 19:02:28 +05:30
Saqib
9320316462 feat(india): bulk e-invoice generation (#24969) 2021-04-12 17:55:46 +05:30
Andy Zhu
bffe933c22 Fix: attempts to add overrides function
Overrides parent_fieldname in outer form to all child rows's fieldname
2021-04-12 22:49:26 +12:00
rohitwaghchaure
913845e4ce Merge pull request #25295 from rohitwaghchaure/changed-scheduler-check-time-pre
fix: update scheduler check time
2021-04-12 16:15:33 +05:30
rohitwaghchaure
5e8ec48e7f Merge pull request #25294 from rohitwaghchaure/changed-scheduler-check-time
fix: update scheduler check time
2021-04-12 16:12:13 +05:30
Rohit Waghchaure
bda4c5cc52 fix: update scheduler check tim 2021-04-12 16:11:52 +05:30
Rohit Waghchaure
2339de7333 fix: update scheduler check tim 2021-04-12 16:09:55 +05:30
Saqib Ansari
faca478317 fix: payment amount showing in foreign currency 2021-04-12 15:40:27 +05:30
Deepesh Garg
719e0c1e60 fix: Taxxable value including Freight and Forwarding charges in GSTR-1 Report 2021-04-12 14:37:43 +05:30
Ankush Menat
53ce877ad9 Merge branch 'develop' into escape_sql_credit_report 2021-04-12 14:37:31 +05:30
Saqib
49336b8065 fix: consolidated sales invoice posting date (#25119) 2021-04-12 12:17:50 +05:30
Prssanna Desai
1fd1e0d4e9 Merge pull request #25287 from prssanna/invoice-timesheet-fix
fix: declare data before assigning
2021-04-12 12:07:29 +05:30
prssanna
42f4a00c88 fix: declare data before assigining 2021-04-12 12:01:20 +05:30
Marica
be26e59087 Merge pull request #25196 from noahjacob/UX
fix: Company field in Warehouse
2021-04-12 11:08:45 +05:30
Deepesh Garg
5f3d7f547c fix: Item wise tax rate for consolidated POS invoice (#25029)
* fix: Item wise tax rate for consolidated POS invoice

* fix: Do not alter item wise taxes for consolidated invoices

* fix: Add test case

* fix: Update

* fix: Set opening stock for test item

* fix: Add valuation rate for opening stock
2021-04-12 10:56:47 +05:30
Deepesh Garg
c36e48a869 fix: GST on freight charge in e-invoicing (#25000)
* fix: GST on freight charge in e-invocing

* fix: Add patch for taxable value field

* fix: Handle discounts on net total

* fix: Handle all types of discounts for e-invoicing

* fix: Absolute taxable values

* fix: Use correct tax amount
2021-04-12 10:55:43 +05:30
Marica
99522252c4 Merge branch 'develop' into UX 2021-04-12 10:51:24 +05:30
Anupam Kumar
9f73bd8040 fix: don't delete mode of payment account details while deleting company transactions (#25217) 2021-04-12 10:31:36 +05:30
Saqib
b8a270074e fix(pos): cannot set qty to less than zero (#25258) 2021-04-12 10:28:05 +05:30
Anoop
207166fe8b fix(patch): copy Lab Test / Template renamed field values (#25276)
reload_doc doctypes introduced since v11
2021-04-12 10:25:34 +05:30
Ankush Menat
d235fc75ad fix: remove nonexistent method from pick list (#25279)
This method is merged in calculate_rate_and_amount() during repost item
valuation refactoring.

Ref:
e10f0a5a6c (diff-a160e3a8907dcdf28ce7728bb7dd45914ad8ab033489ea3de4c80fb1c4ca7fe9)
2021-04-12 10:23:06 +05:30
Deepesh Garg
4d4d7074d0 Merge pull request #25053 from deepeshgarg007/delivery_note_gst_category
fix: Add GST category field in Delivery Note
2021-04-10 22:12:42 +05:30
Deepesh Garg
1466e2d758 Merge pull request #25271 from deepeshgarg007/loan_penalty_new_fix
fix: Consider paid repayment entries in subsequent loan repayments
2021-04-10 21:00:46 +05:30
Deepesh Garg
81ecd0b8b6 Merge branch 'develop' of https://github.com/frappe/erpnext into delivery_note_gst_category 2021-04-10 20:54:38 +05:30
Deepesh Garg
b58590251b fix: minor improvements and tests 2021-04-10 19:55:36 +05:30
rohitwaghchaure
5899477cbb Merge pull request #25015 from rohitwaghchaure/fixed-patch-item-reposting-for-incorrect-sl-and-gl-develop
fix: patch
2021-04-10 18:58:44 +05:30
Raffael Meyer
dc9ef51d97 Merge branch 'develop' into improve_taxes_setup 2021-04-10 15:09:41 +02:00
Deepesh Garg
f38a653a08 fix: Show exact error message in datetime 2021-04-10 18:34:51 +05:30
Deepesh Garg
e7efbc1d33 Merge branch 'develop' of https://github.com/frappe/erpnext into loan_penalty_new_fix 2021-04-10 18:33:38 +05:30
Deepesh Garg
37d6c19a34 fix: Consider paid repayment entries in subsequent loan repayments 2021-04-10 18:33:26 +05:30
Deepesh Garg
8a01dbe8e1 Merge pull request #25261 from ankush/issue_status_banner_fix
fix: condition for SLA status banner
2021-04-10 17:56:51 +05:30
Rohit Waghchaure
a5d062453e feat: added test case 2021-04-10 10:49:31 +05:30
Rohit Waghchaure
cb6494876f feat: purchase receipt creation from purchase invoice 2021-04-10 10:49:30 +05:30
Rohit Waghchaure
1db8c51749 fix: changed logic 2021-04-10 10:45:29 +05:30
Rohit Waghchaure
b9aa775f3b fix: pricing_rule test cases 2021-04-10 10:45:28 +05:30
Rohit Waghchaure
1358443cdb fix: patch 2021-04-10 10:42:08 +05:30
Deepesh Garg
c85c243f9c Merge pull request #25255 from nextchamp-saqib/issue-condition-fix
fix: condition for setting agreement status
2021-04-09 21:40:14 +05:30
Deepesh Garg
df9388aa8e Merge pull request #25086 from deepeshgarg007/advance_amount_precision
fix: Precision issues while allocating advance amount
2021-04-09 21:39:02 +05:30
noahjacob
110f28f869 Company field editable and is readonly after saving. 2021-04-09 20:01:47 +05:30
Saqib
14b98c1737 Merge branch 'develop' into issue-condition-fix 2021-04-09 18:29:01 +05:30
Afshan
23f645e7da Merge branch 'develop' into dimension-wise-accounts-balance-reports 2021-04-09 18:22:43 +05:30
Anupam Kumar
986452107b fix: Lead Source's module (#24583)
* fix: Lead Source's module

* fix: patch fix
2021-04-09 18:15:51 +05:30
Anupam Kumar
a91d7bd4b5 Merge branch 'develop' into se-add-to-transit 2021-04-09 18:00:03 +05:30
Anupam Kumar
cd2aedd0c6 Merge branch 'develop' into planning 2021-04-09 17:59:47 +05:30
Afshan
1f08d8e3de Merge branch 'develop' into dimension-wise-accounts-balance-reports 2021-04-09 17:44:54 +05:30
Afshan
c42318ec24 chores: clean up 2021-04-09 17:44:30 +05:30
Ankush Menat
5451bbf7d2 fix: condition for SLA status banner
If the document is NOT in the closed state and fulfilled then there
won't be any banner. This bug was introduced while fixing a bug related
to buttons, so separated out code for showing buttons and showing
banners.
2021-04-09 17:19:02 +05:30
rohitwaghchaure
526f76c27d Merge pull request #25257 from rohitwaghchaure/travis-fix-for-project
fix: travis
2021-04-09 17:07:22 +05:30
Afshan
31b5dfe9ee feat: Dimension-wise Accounts Balance Report 2021-04-09 16:52:14 +05:30
Rohit Waghchaure
ca5e10892c fix: travis 2021-04-09 16:23:45 +05:30
Afshan
dc73a9995d Merge branch 'develop' into add-blank-for-status-issue-reports 2021-04-09 13:04:34 +05:30
Marica
c6b3766fb2 Merge pull request #24921 from Anurag810/item-dashboard-fixes
fix: precision and formatted document for stock level in item dashboard.
2021-04-09 12:43:06 +05:30
Saqib Ansari
032246dc2b feat(italy): add document type field for e-invoicing 2021-04-09 12:08:24 +05:30
Marica
d38618fc34 Merge branch 'develop' into item-dashboard-fixes 2021-04-09 11:57:56 +05:30
Marica
5467d7c3e3 fix: Use system precision instead of SLE precision 2021-04-09 11:56:49 +05:30
Marica
a7ac01153e fix: Remove redundant import and import cint 2021-04-09 11:55:44 +05:30
Marica
ad75944960 Merge pull request #25105 from Anuja-pawar/fix_picked_qty_in_DN
fix: Picked Qty conversion from Stock Qty to Qty while creating DN from Pick List
2021-04-09 11:48:56 +05:30
Saqib Ansari
e7813b69c4 fix: condition for setting agreement status 2021-04-09 11:46:16 +05:30
Marica
b89a40aa3c Merge branch 'develop' into fix_picked_qty_in_DN 2021-04-09 11:45:39 +05:30
Marica
7f0e92c9b9 Merge pull request #25232 from nextchamp-saqib/coa-importer-validate-fix
fix: keyerror while validating coa file
2021-04-09 11:44:40 +05:30
Deepesh Garg
63e6036d12 Merge pull request #25235 from ankush/remove_purch_inv_validation
fix: remove gst name validation for purchase Invoice
2021-04-09 10:48:34 +05:30
barredterra
e66cf0aa44 fix: hanging indent 2021-04-08 18:26:45 +02:00
barredterra
0a45fc8c58 fix: remove unused import 2021-04-08 18:25:17 +02:00
barredterra
3a12f1f1ae fix: prettier error log 2021-04-08 17:53:48 +02:00
Saqib
4191e7999d chore: add error title
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-04-08 21:04:56 +05:30
barredterra
ea0fd31f60 Merge branch 'datev_fixes' of https://github.com/alyf-de/erpnext into datev_fixes 2021-04-08 17:25:54 +02:00
Raffael Meyer
3b4b17476a Merge branch 'develop' into datev_fixes 2021-04-08 17:25:12 +02:00
Deepesh Garg
edb4663258 Merge pull request #25251 from nextchamp-saqib/einv-ack-no-fix
fix(india): set correct ack no. on irn generation
2021-04-08 20:48:01 +05:30
barredterra
c6e13ac218 fix: patch to fill Debtor/Creditor Number 2021-04-08 16:57:55 +02:00
barredterra
ed36fb2073 docs: doctring for patch 2021-04-08 16:57:20 +02:00
barredterra
03425071e7 fix: patch to add custom fields 2021-04-08 16:31:00 +02:00
barredterra
368a6541e9 fix: Debtor/Creditor Number is not translatable 2021-04-08 16:26:56 +02:00
Saqib Ansari
30720d2139 fix: set correct ack no. on irn generation 2021-04-08 19:06:44 +05:30
Rucha Mahabal
b7aa658a51 refactor(HR): Add missing reports and doctypes to the Workspace (#24994)
* refactor(HR): Add missing reports and doctypes to the Workspace

* refactor: remove Employee Tax and Benefits from HR Workspace

Co-authored-by: Anurag Mishra <32095923+Anurag810@users.noreply.github.com>
2021-04-08 18:13:21 +05:30
Jannat Patel
d9fa79de99 fix: serial no refresh issue (#25127)
* fix: serial no refresh issue

* fix: sider
2021-04-08 16:04:57 +05:30
Anupam Kumar
9d830255c1 Merge branch 'develop' into se-add-to-transit 2021-04-08 14:44:08 +05:30
rohitwaghchaure
f9fde054e1 Merge pull request #25242 from rohitwaghchaure/fixed-test-case-for-bom-cost
fix: bom cost test case
2021-04-08 14:39:08 +05:30
Marica
6a98d39201 Merge branch 'develop' into fixed-incorrect-batch-selected-in-purchase-rceipt-develop 2021-04-08 13:57:35 +05:30
HENRY Florian
e286750a0f fix: UOM length unit in global setup list is empty (#24855)
* When ERPNext is installed in localized language the category of UOM Conversion Factor is tranlasted into installed languaes. Filter must be locallized

* fix

* fix

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-04-08 13:56:29 +05:30
Marica
fb9fc944c5 Merge branch 'develop' into coa-importer-validate-fix 2021-04-08 13:46:42 +05:30
Rohit Waghchaure
fa8bb87a86 fix: bom cost test case 2021-04-08 13:38:22 +05:30
rohitwaghchaure
5d3f665cc5 Merge pull request #25240 from ankush/job_card_rounding
fix: round total quantity in job card
2021-04-08 13:10:09 +05:30
Ankush Menat
cb625d868c fix: round total quantity in job card 2021-04-08 12:05:52 +05:30
Saqib
f10d107a0a Merge branch 'develop' into coa-importer-validate-fix 2021-04-08 11:25:29 +05:30
Anupam Kumar
dfdf72cbb2 Merge branch 'develop' into planning 2021-04-08 10:58:05 +05:30
Anupam Kumar
8edf9d23c0 Merge branch 'develop' into se-add-to-transit 2021-04-08 10:57:50 +05:30
barredterra
94f293940c fix: better party export 2021-04-07 20:06:16 +02:00
barredterra
4fe2d35b2e feat: more infos for transactions 2021-04-07 20:05:41 +02:00
barredterra
b39608a02e fix: handle encoding errors
replace unknown characters by '?'
2021-04-07 20:04:38 +02:00
barredterra
6b2e4f2b5d feat: add custom field debtor_creditor_number to Party Account 2021-04-07 20:03:59 +02:00
barredterra
09c7598a67 fix: make account field non-mandatory 2021-04-07 20:03:33 +02:00
Ankush Menat
76c8521010 fix: remove gst name validation for purch Invoice 2021-04-07 16:28:13 +05:30
Afshan
e2da3cbc28 fix: payroll issues (#24540)
* fix: payroll issues

* fix: enhancements

* fix: rename variables and refactor

* fix: slider

* fix: added missing arguments

* fix: test cases

* fix: slider

* fix: slider

fix: slider

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-04-07 15:13:44 +05:30
Saqib Ansari
5541aeaa82 fix: keyerror while validating coa file 2021-04-07 12:34:20 +05:30
Walstan Baptista
c39720db50 fix: frappe.whitelist for doc methods (#25231) 2021-04-07 11:51:22 +05:30
Walstan Baptista
90e240c3e6 fix: frappe.whitelist for doc methods (#25230) 2021-04-07 11:32:51 +05:30
Deepesh Garg
3d5a4ffd66 Merge pull request #24879 from deepeshgarg007/loan_fixes_phase_2
fix: Loan Repayment entry cancellation on salary slip cancel
2021-04-07 10:33:46 +05:30
Deepesh Garg
5af6aea9f9 fix: Posting Date check 2021-04-07 09:46:13 +05:30
Deepesh Garg
d551940dc5 fix: Remove comments 2021-04-06 23:55:48 +05:30
Deepesh Garg
a42194f3d5 Merge branch 'develop' of https://github.com/frappe/erpnext into loan_fixes_phase_2 2021-04-06 23:53:34 +05:30
Rohan Bansal
a93b514b2f feat: create Quality Inspections from account and stock documents 2021-04-06 17:20:16 +05:30
Rucha Mahabal
d77ea7c88b Merge pull request #25190 from ruchamahabal/approver-perms
feat(HR): share doc with employee approvers if they don't have access
2021-04-06 14:32:34 +05:30
Rucha Mahabal
0bcd3c45ed fix: leave approver perms test 2021-04-06 13:46:53 +05:30
Hussain Nagaria
d2da7b673b fix: Sider Issues 2021-04-06 11:44:54 +05:30
Hussain Nagaria
33e0c8ed19 test: Unique Employee IDs for tests 2021-04-06 11:40:35 +05:30
Deepesh Garg
dfe91b5df3 Merge pull request #25212 from deepeshgarg007/loan_shortfall_preference
fix: Give first preference to loan security on repayment
2021-04-06 11:06:03 +05:30
Anupam Kumar
7b6c8bb3ab fix: error message compensatory leave request (#25206) 2021-04-06 10:20:10 +05:30
Rucha Mahabal
d1970d3c38 Merge branch 'develop' into approver-perms 2021-04-06 10:09:18 +05:30
Rucha Mahabal
084e90e5d3 fix(test): set user as Administrator 2021-04-06 10:07:50 +05:30
Deepesh Garg
015fd681ec fix: Give first preference to loan security on repayment 2021-04-06 00:49:46 +05:30
Hussain Nagaria
bb32f5a92a fix: Rename utilisation to utilization 2021-04-05 19:32:10 +05:30
Sagar Vora
c9cdf74dc5 test: remove print() (#25205) 2021-04-05 16:38:10 +05:30
Marica
4440ff7a0d Merge branch 'develop' into item-dashboard-fixes 2021-04-05 16:25:57 +05:30
Marica
bc50193702 Merge branch 'develop' into fix_picked_qty_in_DN 2021-04-05 16:24:53 +05:30
Sagar Vora
9967a7ce02 test: clear all existing quotations to avoid AssertionError (#25202) 2021-04-05 15:35:52 +05:30
Rucha Mahabal
9948525dd3 Merge branch 'develop' into approver-perms 2021-04-05 14:54:11 +05:30
Sagar Vora
9a0907131a test: create tax rule if it doesnt exist (#25199) 2021-04-05 14:50:09 +05:30
Walstan Baptista
8789ef16a1 test: uses _Test Item instead of _Test Item Home Desktop 100 (#25198) 2021-04-05 13:18:03 +05:30
Hussain Nagaria
ccb15de1c9 fix: Handle overtime edge case 2021-04-05 11:23:06 +05:30
Anoop
b27441b40c fix: failing patch - reload_doc new doctypes added in v13 (#25194) 2021-04-05 10:41:28 +05:30
Ankush Menat
36ff0748bf fix: broken type check in stock ageing report 2021-04-05 10:18:44 +05:30
Rucha Mahabal
b7436a04c3 fix: Ignore Permission for Leave Ledger Entry (#25172) 2021-04-04 20:09:00 +05:30
Rucha Mahabal
57ab3a5a88 Merge branch 'develop' into approver-perms 2021-04-04 19:57:58 +05:30
Rucha Mahabal
19c3286b06 fix: linter and sider issues 2021-04-04 19:54:00 +05:30
Rucha Mahabal
8c055b5469 fix: ignore share permission while sharing doc with approver 2021-04-04 18:45:06 +05:30
Rucha Mahabal
13c0a350af test: leave, expense, shift request approver permissions 2021-04-04 18:37:46 +05:30
Rucha Mahabal
ba10ef4403 feat(HR): share doc with employee approvers if they don't have access 2021-04-04 17:16:48 +05:30
Rohit Waghchaure
8b829711fc fix: incorrect batch picked in subcontracted purchase receipt 2021-04-04 12:43:38 +05:30
Sagar Vora
8aacd341c7 test: disable shopping cart before running Tax Rule tests (#25183) 2021-04-03 23:01:16 +05:30
Sagar Vora
993cf8c2cd test: cleanup BOM in test_routing and prevent overlap in test_job_card (#25180) 2021-04-03 20:25:19 +05:30
Walstan Baptista
37b826b988 fix: correct calculation for discount amount when margin is set (#25179) 2021-04-03 19:48:46 +05:30
Sagar Vora
cce3efe0c1 test: specify warehouse list to avoid error (#25174)
* test: specify warehouse list to avoid error

* test: get_all_warehouses of BOM company
2021-04-03 19:46:44 +05:30
Walstan Baptista
b7481633b1 test: adds role after setting user to Administrator (#25177) 2021-04-03 17:37:59 +05:30
Sagar Vora
f68f41d7a7 test: fix multiple tests in Leave Application (#25173) 2021-04-03 17:34:57 +05:30
Deepesh Garg
232c127295 Merge pull request #25107 from deepeshgarg007/stock_entry_serial_batch_selector
fix: Hide serial and batch selector in Stock Entry
2021-04-03 17:15:22 +05:30
Deepesh Garg
b7e7eeaf8d Merge pull request #25138 from deepeshgarg007/loan_shortfall_percentage
fix: Add shortfall ratio in Loan Security Shortfall
2021-04-03 17:13:27 +05:30
rohitwaghchaure
fe72e17a7b Merge pull request #25109 from ankush/po_to_pr_fixes
fix: incorrect status creating PR from PO after creating PI
2021-04-03 17:11:14 +05:30
Sagar Vora
f6b1fa0a1c test: clear tax rules before making POS Invoices (#25171) 2021-04-03 16:06:41 +05:30
Walstan Baptista
5d77f10baa test: docs are not deleted in tearDown (#25123)
* test: docs are not deleted in tearDown
2021-04-03 13:38:55 +05:30
Ankush Menat
87b2a51322 fix: escape sql filters in credit report
closes #24965
2021-04-03 12:34:34 +05:30
Saqib
a30d70e490 Merge branch 'develop' into customer_duplicates 2021-04-03 12:22:22 +05:30
Kaviya Periyasamy
2cef23d4c9 fix: object referencing the same address issue (#25159)
* fix: variable reference to same address

* fix: object referencing same address issue

* fix: value error
2021-04-03 11:30:49 +05:30
Hussain Nagaria
40abd2a2e1 test: Add test case for summary data 2021-04-02 19:55:54 +05:30
Hussain Nagaria
d27fc93edd feat: Add additional stats to report summary 2021-04-02 19:54:58 +05:30
Rucha Mahabal
2453b0cf6a fix: component amount calculation based on formula with abbr not working (#25117) 2021-04-02 17:00:28 +05:30
bhavesh95863
7535341016 fix(regional): remove shipping address GSTIN validation for e-invoice (#25153) 2021-04-02 15:04:48 +05:30
Ankush Menat
e41d48c7de fix: disable auto naming of customer during import 2021-04-02 14:22:04 +05:30
Marica
7f9fedf08a Merge branch 'develop' into fix_picked_qty_in_DN 2021-04-02 13:19:19 +05:30
Saqib
5447b250fe fix: place of supply of e-invoicing (#25148) 2021-04-02 12:16:19 +05:30
Deepesh Garg
7f10044195 fix: Typo 2021-04-02 12:04:42 +05:30
Jannat Patel
0353b0f5f6 Merge branch 'develop' into profitability-report 2021-04-02 10:15:28 +05:30
Rohit Waghchaure
9896907565 fix: incorrect incoming rate for the sales return 2021-04-02 00:27:08 +05:30
Afshan
ace4ce64a0 fix: validation msg for TransDocNo e-invoicing (#25121) 2021-04-01 20:28:12 +05:30
Suraj Shetty
7b97d49a58 Merge pull request #25141 from surajshetty3416/fix-get_route_options_for_new_doc
fix: get_route_options_for_new_doc for Project
2021-04-01 19:58:01 +05:30
Suraj Shetty
67169ba2d3 fix: get_route_options_for_new_doc for project 2021-04-01 19:52:07 +05:30
Marica
f46fbcc1ad Merge pull request #25118 from marination/qc-back-update
fix: Query values incorrectly escaped while back updating Quality Inspection
2021-04-01 18:30:58 +05:30
Sagar Vora
d3ee8c7731 fix: customer creation from shopping cart (#25136) 2021-04-01 18:18:19 +05:30
Deepesh Garg
eea20f83ab fix: Add shortfall ratio in Loan Security Shortfall 2021-04-01 18:13:54 +05:30
Marica
913e7254cb Merge branch 'develop' into qc-back-update 2021-04-01 17:40:46 +05:30
Walstan Baptista
446a6df662 test: set opening stock to fix NegativeStock errors (#25101)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-04-01 16:54:26 +05:30
Sagar Vora
88f5c42b09 test: set formula in scorecard to avoid ValidationError (#25116) 2021-04-01 16:44:05 +05:30
Anuja P
7982688508 fix: sider changes 2021-04-01 16:04:28 +05:30
Walstan Baptista
58625674f4 test: correct naming series to avoid ValidationError (#25132) 2021-04-01 15:55:37 +05:30
Marica
9ef323fcfd Merge branch 'develop' into qc-back-update 2021-04-01 15:44:20 +05:30
Anuja P
45d0b9bce6 test: added tests for Pick List for item with multiple UOM 2021-04-01 15:38:13 +05:30
Sagar Vora
4c31fbb687 fix(India): create property setters for shorter naming series (as per GST Rules) (#25128) 2021-04-01 15:32:37 +05:30
Rucha Mahabal
53a1aaf33d fix: Salary Structure object has no attribute set_totals (#25113) 2021-04-01 14:40:15 +05:30
marination
561fa6b530 fix: Don't string format args as they may not be escaped properly
- Append even conditional args to args list and send to query executer
- It will escape all values that are sent to it
- String formatting without escaping causes issues with % sign, etc.
2021-04-01 12:56:05 +05:30
Ankush Menat
1bdf9c4161 fix: patch for purchase receipt status 2021-04-01 11:58:34 +05:30
Ankush Menat
427a98d6cd fix: do not copy percent billed from PO to PR 2021-04-01 11:51:31 +05:30
Ankush Menat
8993ccb7d2 fix: update PR status in database 2021-04-01 11:51:31 +05:30
Ankush Menat
4198cf58e5 test: add tests for PO->PI, PO->PR workflow
Add failing test cases for PR status and PR percent billed.
2021-04-01 11:51:30 +05:30
Hussain Nagaria
1e772bb9a4 test: Basic report data testing 2021-04-01 00:44:35 +05:30
rohitwaghchaure
56bd4d71a9 Merge pull request #25112 from rohitwaghchaure/fixed-clear-source-warehouse
fix: not able to save material request
2021-03-31 23:58:44 +05:30
Rohit Waghchaure
825850a58f fix: not able to save material request 2021-03-31 23:55:06 +05:30
Marica
b4913e7db4 Merge pull request #23509 from AndyOverLord/patch-7
fix: Update Bin via Update Item on Purchase/Sales Order
2021-03-31 22:28:14 +05:30
Marica
bfc2590e3b Merge branch 'develop' into patch-7 2021-03-31 22:23:23 +05:30
Prssanna Desai
f3c34aa6ae fix: don't set "Company:company:default_currency" as default for currency link fields (#25095)
* fix: don't set Company:company:default_currency as default for currency link fields

* fix: Company:company:default_currency and refactor

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
Co-authored-by: Afshan <afshan13k@gmail.com>
2021-03-31 21:52:48 +05:30
marination
7665a85039 fix: Run Patches to updated Reserved, Requested and Ordered Qty 2021-03-31 21:03:55 +05:30
Marica
7d3eda47b4 Merge pull request #25063 from ankush/mr_stopped_validation
fix: do not fetch stopped MR in production plan
2021-03-31 20:10:54 +05:30
Deepesh Garg
9f7bb14ea1 fix: Remove console 2021-03-31 20:01:00 +05:30
Anuja P
a1d0932093 fix: suggested changes 2021-03-31 19:59:28 +05:30
Deepesh Garg
2d86eb3ab1 fix: Hide serial and batch selector in Stock Entry 2021-03-31 19:57:50 +05:30
Ankush Menat
777745f1e0 fix: do not fetch stopped MR in production plan
- Ignore stopped MR while using fetch button
- Add filter on field inside child table.

Related issue: ISS-20-21-10757
2021-03-31 19:53:19 +05:30
Anupam Kumar
1033cf72f6 fix: added flag for dont_fetch_price_list_rate in transaction (#25041) 2021-03-31 19:39:45 +05:30
Anuja P
fb9ce3f37b fix: Picked Qty conversion from Stock Qty to item Qty in DN 2021-03-31 19:26:42 +05:30
Sagar Vora
27f48739d4 test: pass force parameter to avoid LinkExistsError (#25100) 2021-03-31 18:49:03 +05:30
Sagar Vora
4e07695a08 test: use insert instead of save (#25045)
* test: use insert instead of save

* test: use do_not_save
2021-03-31 18:33:27 +05:30
Jannat Patel
11e9ae3841 fix: delivery note print error (#25080) 2021-03-31 16:24:08 +05:30
Prssanna Desai
45eccfafc1 fix: do not set standard link in Sales Invoice as custom (#25096) 2021-03-31 16:16:00 +05:30
Marica
116ac3cde7 Merge pull request #24863 from marination/drop-shipping
fix: PO not created against all selected suppliers (drop shipping)
2021-03-31 16:06:44 +05:30
Deepesh Garg
21a3ea462a fix: Purchase from registered composition dealer (#25040)
* fix: Purchase from registered composition dealer

* fix: Test case for GSTR 3b report
2021-03-31 16:05:12 +05:30
Marica
1b8d36634f Merge branch 'develop' into patch-7 2021-03-31 16:04:24 +05:30
Marica
8339987cf1 Merge branch 'develop' into drop-shipping 2021-03-31 16:03:14 +05:30
rohitwaghchaure
e353c84aa5 Merge pull request #25092 from rohitwaghchaure/fixed-multiply-issue-material-request-develop
fix: can't multiply sequence by non-int of type 'float'
2021-03-31 15:31:50 +05:30
Rohit Waghchaure
1bc53a32bf fix: can't multiply sequence by non-int of type 'float' 2021-03-31 15:30:42 +05:30
Rohan
99a8cb7143 fix: commit individual SLE rename for large datasets (#25084) 2021-03-31 15:22:00 +05:30
Marica
0af1aedf34 Merge branch 'develop' into drop-shipping 2021-03-31 15:05:11 +05:30
Saqib
0586b7db79 feat: discount configuration on early payments (#24586)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-03-31 15:03:53 +05:30
Deepesh Garg
5d73d8281b fix: Remove unintentionally added field 2021-03-31 14:10:56 +05:30
Deepesh Garg
f54d596ae1 fix: Precision issues while allocating advance amoount 2021-03-31 14:06:02 +05:30
Afshan
b07de03ddb fix: added blank option for status in report related to issue 2021-03-31 13:39:04 +05:30
Hussain Nagaria
39b75c63ad feat: Add chart generation 2021-03-31 13:13:25 +05:30
Marica
5a601ce851 Merge branch 'develop' into drop-shipping 2021-03-31 13:12:13 +05:30
Walstan Baptista
d6360755b9 chore: frappe.whitelist for doc methods (#25068)
* chore: frappe.whitelist for doc methods

* fix: incorrect spelling

* fix: sider issue

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-03-31 12:30:32 +05:30
Marica
14c44e5e9e Merge branch 'develop' into drop-shipping 2021-03-31 12:27:32 +05:30
marination
120da991d0 fix: Test
- Preserve order of supplier list while removing duplicates
- Dont use list of set, but list of dict with unique keys
2021-03-31 12:27:57 +05:30
Hussain Nagaria
92c768972f fix: Missing quotation marks in SQL query 2021-03-31 12:26:37 +05:30
Hussain Nagaria
f5576d67dd feat: Add Report Summary generation 2021-03-31 12:25:36 +05:30
Walstan Baptista
353aa59c42 test: sets company while making a project (#25061) 2021-03-31 12:16:54 +05:30
Walstan Baptista
d65458d534 test: corrected item name (#25075) 2021-03-31 12:14:41 +05:30
Marica
8451da7924 Merge branch 'develop' into drop-shipping 2021-03-31 11:44:07 +05:30
Anurag Mishra
720f69caaf fix: column width in Recruitment analytics report (#25003)
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-03-31 11:23:34 +05:30
marination
0673f558c1 fix: Cleaned up and fixed validation and bin updation on deletion
- Created separate smaller functions for validation and bin updation of deleted row
- Made sure previous doc (linked doc) was also updated after deletion of row
- Tests to check bin updation on add/update/delete
- Made reserved qty for subcontrating read only in bin
2021-03-31 01:42:18 +05:30
Hussain Nagaria
1a0229eb36 feat: Add report table data generation 2021-03-30 18:20:22 +05:30
Marica
c5739957de Merge branch 'develop' into patch-7 2021-03-30 18:07:32 +05:30
Anurag Mishra
679177f9e0 Merge pull request #25022 from shariquerik/employee-profile-pic-access-fix
fix: Employee profile pic upload access for erpnext user
2021-03-30 14:32:21 +05:30
Hussain Nagaria
2b85a81a1c feat: Add filters to front end 2021-03-30 13:57:44 +05:30
Rucha Mahabal
30f67c3f57 fix: add filters to account link fields in Non Profit Settings (#25060)
- fetch memberships ordered by date in certificate
2021-03-30 12:39:56 +05:30
Hussain Nagaria
b7f2ba1556 feat: Add Report boilerplate 2021-03-30 12:19:16 +05:30
Deepesh Garg
f954ec7c78 fix: Add patch for GST category field in Delivery Note 2021-03-29 20:31:11 +05:30
Sagar Vora
ba76f87e44 fix(Italy): setup, validations, optimisations (#25054)
* fix(Italy): setup, validations, optimisations

* fix: remove unused import
2021-03-29 20:18:45 +05:30
Deepesh Garg
29997414ad fix: Add GST category field in Dellivery Note 2021-03-29 19:49:52 +05:30
Sagar Vora
5c907fa7f0 test: make Stock Entry to avoid NegativeStockError (#25044) 2021-03-27 20:30:26 +05:30
Walstan Baptista
ee822a9dcd test: use different product attribute value; cleanup (#25043)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-03-27 19:42:25 +05:30
Raffael Meyer
1bbc8008eb Merge branch 'develop' into improve_taxes_setup 2021-03-27 15:02:58 +01:00
Walstan Baptista
d6c7d8e631 test: reset session user if test errors in test_sle (#25042) 2021-03-27 18:30:07 +05:30
Sagar Vora
868c0bf45b perf: reduce no of queries for checking if future sl entry exists (#24881) 2021-03-27 16:10:20 +05:30
walstanb
ab673d9e4b fix: minor changes 2021-03-27 12:54:49 +05:30
walstanb
225c64a1ad test: sets is_purchase_item while item creation 2021-03-27 12:54:49 +05:30
walstanb
52403c537b fix: check if gst account exists before appending 2021-03-27 12:54:49 +05:30
walstanb
9826ac4602 test: reset session user if test errors 2021-03-27 12:54:49 +05:30
walstanb
98dcf8a1fd fix: type casting for None type value 2021-03-27 12:54:49 +05:30
Anupam
096da429ed fix: unable to submit stock entry 2021-03-27 00:45:31 +05:30
rohitwaghchaure
d5759bab11 Merge pull request #24922 from rohitwaghchaure/feat-recursice-pricing-rule
feat: recursive pricing rule
2021-03-26 19:10:10 +05:30
rohitwaghchaure
86628ea287 Merge pull request #25025 from ruchamahabal/production-raw-material-enhancements
feat(Production Plan): Enhancements in Material Request Plan Item
2021-03-26 18:59:23 +05:30
Rucha Mahabal
87a70fe8cb feat: Show Required Qty as per BOM in Material Request Items 2021-03-26 18:37:50 +05:30
Rucha Mahabal
9dbabb92df feat: Add more fields to raw material download 2021-03-26 18:37:40 +05:30
Rucha Mahabal
07409990a0 fix: Ordered and Reserved Qty for Production not getting fetched in Items 2021-03-26 18:37:24 +05:30
Rucha Mahabal
1f86471656 feat: show ordered and reserved qty in Material Request Plan Item table 2021-03-26 18:36:52 +05:30
Rucha Mahabal
66bae19c16 feat(Production Plan): Consider Safety Stock in Required Qty Calculation 2021-03-26 18:36:33 +05:30
shariquerik
82d7986a2f fix: sider fix 2021-03-26 17:02:37 +05:30
shariquerik
1989375be4 fix: Employee profile pic upload access for erpnext user 2021-03-26 16:34:22 +05:30
Prssanna Desai
1bbd5c98d3 Merge pull request #24996 from prssanna/help-links-fix 2021-03-26 16:04:25 +05:30
Prssanna Desai
3da2df55f4 Merge branch 'develop' into help-links-fix 2021-03-26 15:35:17 +05:30
Sagar Vora
0b569b3e43 fix: allow creating stock entry based on work order for customer provided items (#24885) 2021-03-26 14:40:15 +05:30
prssanna
dd2a315d06 style: fix formatting 2021-03-26 14:35:47 +05:30
Marica
ffb4e3f280 Merge pull request #24937 from ankush/hide_alt_field
fix: hide alt tag if item is not shown in website
2021-03-25 20:14:52 +05:30
Anurag Mishra
344c14c9ca Merge pull request #25004 from ruchamahabal/fix-exchange-rate-in-salary-slip
fix(Payroll): Exchange Rate not getting set in Salary Slip
2021-03-25 18:12:11 +05:30
Deepesh Garg
74200bcd62 Merge pull request #24975 from frappe/revert-24039-fixed-incorrect-gstr-report-issue
Revert "fix: GSTR B2C report"
2021-03-25 16:50:10 +05:30
Deepesh Garg
7b8742bd70 Merge pull request #24998 from frappe/revert-24318-fix-currency-validation-for-party
Revert "fix: validating party currency with doc currency"
2021-03-25 16:49:50 +05:30
Rucha Mahabal
b2b12f303e fix(Payroll): Exchange Rate not getting set in Salary Slip 2021-03-25 14:48:08 +05:30
pateljannat
c0b4eea415 fix: sider 2021-03-25 14:39:05 +05:30
pateljannat
6597bf7dd7 feat: profitability report default working hours and tests 2021-03-25 13:31:43 +05:30
Mohammad Hasnain Mohsin Rajan
52701dcbbc fix: patch regional fields for old companies (#24988) 2021-03-25 12:56:33 +05:30
Marica
36d125a720 Merge branch 'develop' into item-dashboard-fixes 2021-03-25 12:32:47 +05:30
Marica
7c6f72fd39 Merge branch 'develop' into hide_alt_field 2021-03-25 12:15:58 +05:30
Syed Mujeer Hashmi
f8b44e05c4 refactor: Add student mobile number to student attendance (#24990)
To setup SMS alert notification for student attendance we need student mobile
number in this doctype.

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>
2021-03-25 11:48:29 +05:30
Anupam Kumar
b4e842e25e fix: opportunity-quotation mapping order status (#25001) 2021-03-25 11:45:57 +05:30
Deepesh Garg
1a6e6320cf Revert "fix: validating party currency with doc currency (#24318)"
This reverts commit 02142c41bb.
2021-03-24 21:26:04 +05:30
Prssanna Desai
8a87ffc8f6 fix: POS print receipt (#24924)
* fix: POS print receipt

* fix: print recepit dialog
2021-03-24 19:52:39 +05:30
Saqib
dd39a6b47c fix(pos): mode of payments disappear on loading draft pos invoice (#24917) 2021-03-24 17:56:24 +05:30
prssanna
194dd12882 fix: re-execute add_standard_navbar_items patch
- check that same items aren't appended again
2021-03-24 16:45:32 +05:30
prssanna
97aab3ac21 fix: missing help links in navbar help dropdown 2021-03-24 16:44:49 +05:30
Anurag Mishra
4217a4b1ff Merge branch 'develop' into item-dashboard-fixes 2021-03-24 15:35:33 +05:30
Anupam Kumar
d1bbb4c311 Merge branch 'develop' into planning 2021-03-24 15:12:04 +05:30
Ishan Loya
de774ae080 Correct state code for 'Other Territory'
Corrects state code for 'Other Territory' to match e-invoicing state codes list. Attempts to fix #24992
2021-03-24 12:30:51 +05:30
rohitwaghchaure
575f8f226b fix: repost not completed backdated transactions (#24980) 2021-03-24 11:30:53 +05:30
Deepesh Garg
734f5c2533 Merge pull request #24971 from deepeshgarg007/loan_security_shortfall_process_update
fix: Pending shortfall update  on processing loan security shortfall
2021-03-24 11:24:49 +05:30
Anupam Kumar
5ce0569f80 fix: validate_series (#24984) 2021-03-23 21:13:41 +05:30
Deepesh Garg
82983369fa fix: Period list for exponential smoothing forecasting report (#24982) 2021-03-23 21:11:01 +05:30
Jannat Patel
12f0923a61 fix: serial no trim issue (#24949)
* fix: serial no trim issue

* fix: valid serial nos

* fix: sider

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-03-23 21:09:49 +05:30
Afshan
02142c41bb fix: validating party currency with doc currency (#24318)
* fix: validating supplier currency

* fix: compare current currency with company currency as well.

* fix: replaced or with add in condition

* fix: conditioning to get proper payment terms values

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2021-03-23 20:53:56 +05:30
Syed Mujeer Hashmi
f114da2f67 refactor: Make Discharge Schedule Date as Datetime (#24940)
* refactor: Make Discharge Schedule Date as Datetime

Like Admitted Datetime make discharge date as discharge datetime.

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>

* fix: Add patch for renaming discharge_date to discharge_datetime

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>

* fix: quote style

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-03-23 17:48:25 +05:30
Marica
23b32381e7 Merge pull request #24888 from ankush/allow_zero_valuation_SR
fix: Allow zero valuation in stock reconciliation
2021-03-23 13:58:46 +05:30
Ankush Menat
e76ecb8f74 fix: set valuation rate for customer items to zero
- In stock reconciliation always set valuation rate of customer provided
items to zero during validation.
- Let user know the valuation has been changed.
2021-03-23 13:01:21 +05:30
Ankush Menat
714b780868 test: customer item in stock reconciliation 2021-03-23 12:43:02 +05:30
pateljannat
453e07e32a fix: exclude cancelled salary slips 2021-03-23 11:18:57 +05:30
Ankush Menat
762d6e38f7 fix: Allow zero valuation in stock reconciliation
Stock reconciliation can not be done for customer provided item as they
have zero valuation. This change adds a checkbox in item table to allow
such items.

Related issue: ISS-20-21-10248
2021-03-23 11:18:04 +05:30
Marica
e6ad39038e chore: Allow changing Work Stations in WO. (#24897) 2021-03-23 10:46:03 +05:30
Deepesh Garg
ad9b65fcf2 fix: TDS check getting checked after reload (#24972) 2021-03-23 10:45:20 +05:30
Rohit Waghchaure
bde159a77d fix: total weight not set for free items 2021-03-22 23:36:48 +05:30
Deepesh Garg
48d5a65ef5 fix: Add test for pending shortfall update 2021-03-22 21:19:19 +05:30
Deepesh Garg
ea487b6c2e Revert "fix: GSTR B2C report" 2021-03-22 20:54:07 +05:30
Deepesh Garg
f112ce14cf fix: Pending shortfall update on processing loan security shortfall 2021-03-22 18:33:55 +05:30
Anupam
661b1e59c1 Merge branch 'develop' of https://github.com/frappe/erpnext into planning 2021-03-22 11:48:11 +05:30
Anupam
4980dd616b fix: resolving commits 2021-03-22 11:23:47 +05:30
Rucha Mahabal
5e1cb5e4bc fix: membership renewal validation (#24963) 2021-03-20 22:22:01 +05:30
Sagar Vora
a85959f574 fix: remove unwanted parameter in calculate_rate_and_amount (#24883)
* fix: remove unwanted parameter in calculate_rate_and_amount

* fix: translation syntax
2021-03-20 16:37:33 +05:30
Walstan Baptista
22054044a3 test: created a new user to test warehouse user perms (#24954)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-03-20 16:35:14 +05:30
Jannat Patel
08855182a3 test: fix test_loan for payroll module (#24946)
* test: fix test_loan for payroll module

* fix: minor style changes
2021-03-19 16:34:14 +05:30
rohitwaghchaure
081499c0c0 Merge pull request #24956 from rohitwaghchaure/revert-stock-balance-value-calculation-develop
fix: revert stock balance value calculation
2021-03-19 16:22:13 +05:30
Rohit Waghchaure
f21a55c8ef fix: revert stock balance value calculation 2021-03-19 16:19:34 +05:30
Deepesh Garg
9b0a9cc2c0 Merge pull request #24912 from deepeshgarg007/multi_currency_lcv_issues
fix: Allow user to update exchange rate in Multi-currency LCV
2021-03-18 21:20:06 +05:30
Deepesh Garg
adcf9a42bd Merge pull request #24916 from deepeshgarg007/nil_exempt_gstr_3b
fix(India): Incorrect Nil Exempt and Non GST amount in GSTR3B report
2021-03-18 21:02:51 +05:30
Walstan Baptista
6df61d217f test: created a new user to test child perms (#24943)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-03-18 19:23:59 +05:30
Sagar Vora
6ac11a04b0 test: added warehouse for TCS Item as it is a Stock Item (#24942) 2021-03-18 18:07:21 +05:30
Sagar Vora
8ee1146f72 test: add stock to avoid NegativeStockError (#24941) 2021-03-18 17:45:25 +05:30
Mohammad Hasnain Mohsin Rajan
192ab05869 ci: use ubuntu 18 specifically (#24904) 2021-03-18 17:12:12 +05:30
Afshan
a04091aaf7 fix: exclude current doc while validation. (#24914) 2021-03-18 16:40:43 +05:30
Sagar Vora
b134b89fb0 test: fix NegativeStockError (#24936) 2021-03-18 16:36:40 +05:30
pateljannat
a2068d9b98 feat: profitability report 2021-03-18 15:25:22 +05:30
Sagar Vora
78e576ee6a fix: default total_estimated_cost to zero (#24939)
Co-authored-by: walstanb <walstanb@gmail.com>
2021-03-18 15:23:52 +05:30
Ankush Menat
c0a9c391eb fix: hide alt tag if item is not shown in website 2021-03-18 14:07:24 +05:30
Deepesh Garg
d39055785a Merge pull request #24934 from Anuja-pawar/fix_report_issue_summary
fix: Report Issue Summary fix for zero issues
2021-03-18 12:24:43 +05:30
Anuja Pawar
9bf1083d9e fix: payment references from disappearing on selecting cost center (#24831)
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-03-18 11:22:24 +05:30
Rushabh Mehta
14c3c5172d fix(minor): rearrange the cards on home workspace 2021-03-18 10:45:38 +05:30
Anuja P
2c8a38d9fa fix: report issue summary fix for zero issues 2021-03-18 10:36:46 +05:30
Sagar Vora
500f54e515 test: fix shift type not found (#24929) 2021-03-17 23:25:04 +05:30
Sagar Vora
52bbd4e182 test: clear Leave Period before running Leave Allocation tests (#24928) 2021-03-17 22:37:59 +05:30
Mohammad Hasnain Mohsin Rajan
7f906f9aaa chore: add sider config (#24892)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-03-17 20:06:35 +05:30
Sagar Vora
c647b6088a ci: update badge in README and add push event trigger (#24911) 2021-03-17 20:04:59 +05:30
Sagar Vora
19bb8c1137 ci: get branch name from GITHUB_REF if GITHUB_BASE_REF not available (#24913) 2021-03-17 20:03:54 +05:30
Sagar Vora
7645315424 test: set correct qty when creating subcontract transfer entry (#24903) 2021-03-17 20:01:21 +05:30
Sagar Vora
f4a6c7823a test: create new item instead of using _Test Item to prevent error (#24915) 2021-03-17 19:57:53 +05:30
Sagar Vora
cf3fc99b12 test: fix salary component not found; other optimisation (#24920) 2021-03-17 19:54:08 +05:30
Rucha Mahabal
cbd67e662f fix: calculate 80g certificate amount on validate for memberships (#24925) 2021-03-17 19:49:27 +05:30
Anurag Mishra
abf974daee fix: precision and formated document 2021-03-17 18:55:04 +05:30
Rohit Waghchaure
77add49c6a fix: don't club same free item 2021-03-17 18:49:54 +05:30
Deepesh Garg
f9f0e347ed fix: Remove print statement 2021-03-17 18:03:17 +05:30
Deepesh Garg
084ec9773e fix: Group nil exempted and non gst items separately 2021-03-17 18:00:08 +05:30
Anurag Mishra
23b6294f5c Merge pull request #24842 from resilient-tech/allow-duplicate-additional
fix(payroll): allow duplicate additional salaries
2021-03-17 17:39:52 +05:30
Deepesh Garg
56c20fb79f fix(India): Incorrect Nil Exempt and Non GST amount in GSTR3B report 2021-03-17 15:47:03 +05:30
Rohit Waghchaure
a9b1347600 fix: nonetype object has no attribute options 2021-03-17 14:30:34 +05:30
Rohit Waghchaure
ff70e61d7a feat: recursive product discount 2021-03-17 14:30:34 +05:30
Deepesh Garg
22f5ff8492 fix: Allow user to update exchange rate in Multi-currency LCV 2021-03-17 10:56:52 +05:30
Sagar Vora
68aaf12902 test: use _Test Company to avoid Holiday List error (#24902) 2021-03-17 10:06:05 +05:30
Sagar Vora
bce904cf97 test: fix Employee Not Found errors (#24906) 2021-03-17 10:03:30 +05:30
Sagar Vora
65d7f2c798 fix(Project): get correct holiday list when calculating dates; test fixes (#24901) 2021-03-17 10:00:35 +05:30
Andy Zhu
6117ac5aff fix: copy_parent_value_in_all_row function error 2021-03-17 13:53:02 +13:00
Raffael Meyer
344cb11a21 Merge branch 'develop' into improve_taxes_setup 2021-03-16 18:38:16 +01:00
Anurag Mishra
8fbb043190 Merge pull request #24824 from resilient-tech/fix-salary
refactor(payroll): simplified logic for additional salary
2021-03-16 21:42:10 +05:30
Rucha Mahabal
1482b2883f fix(Non Profit): Membership and Donation API fixes (#24900)
* fix: Donation fixes

- differentiate between subscription payment and payment

- issue with donation amount

* fix: existing membership validation

* fix: ignore subscription payments while capturing donations
2021-03-16 20:08:51 +05:30
Prssanna Desai
b74436d535 Merge pull request #24896 from prssanna/redesign-fixes 2021-03-16 16:08:15 +05:30
prssanna
1cdef8bd97 style: missing semicolon 2021-03-16 15:39:16 +05:30
prssanna
b8b89a02af fix: item variant dialog dropdown issue 2021-03-16 14:16:22 +05:30
prssanna
f1dbc021fc fix: issue web list style 2021-03-16 14:15:59 +05:30
Anurag Mishra
5cc322e01d Merge pull request #24877 from Anurag810/settings_for_eanbling_leave_notificstion
feat: Add checkbox for disabling leave notification in HR Settings
2021-03-16 13:23:16 +05:30
Afshan
46eb4b2f90 Merge branch 'develop' into settings_for_eanbling_leave_notificstion 2021-03-16 13:15:55 +05:30
Deepesh Garg
4470291243 Merge pull request #24893 from deepeshgarg007/add_account_method
fix: Add method for regional round off account back
2021-03-16 13:13:50 +05:30
Deepesh Garg
004f9e6b0c fix: Add method for regional round off account back 2021-03-16 13:09:59 +05:30
Anurag Mishra
6bafbffee0 fix: added also for leave applier as requested 2021-03-16 13:01:39 +05:30
Anurag Mishra
54482fd83f feat: added for disabling leave notification in HR settings 2021-03-16 13:01:39 +05:30
Rushabh Mehta
45735b35c4 fix(minor): login: set as Login to ERPNext 2021-03-16 12:22:31 +05:30
Rushabh Mehta
6ef213e5c6 fix(minor): patch add_state_code_for_ladakh 2021-03-16 11:59:54 +05:30
Marica
4d869906b6 Merge branch 'develop' into drop-shipping 2021-03-16 11:43:46 +05:30
Deepesh Garg
93f925fb98 fix: Unequal debit and credit issue on RCM Invoice (#24836)
* fix: Unequal debit and credit issue on RCM Invoice

* fix: Travis

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-03-15 18:04:42 +05:30
Raffael Meyer
db24b13a7d Merge branch 'develop' into improve_taxes_setup 2021-03-15 13:27:56 +01:00
Anurag Mishra
4f6f224544 Merge pull request #24622 from Anurag810/suplier_portal_fixes
fix: supplier was not able to Submit RFQ due to insufficient permission
2021-03-15 16:33:49 +05:30
Anurag Mishra
5e475f85b9 Merge branch 'develop' into suplier_portal_fixes 2021-03-15 16:21:55 +05:30
Raffael Meyer
6d5ea4cee8 Merge branch 'develop' into improve_taxes_setup 2021-03-15 11:40:39 +01:00
Marica
3575314260 Merge branch 'develop' into drop-shipping 2021-03-15 12:53:45 +05:30
Marica
4ceea333a7 fix: POS Opening Entry with empty balance detail rows (#24876) 2021-03-15 12:49:14 +05:30
Mohammad Hasnain Mohsin Rajan
46d5431bad fix: Github Action not failing when tests fail (#24867)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-03-15 11:17:19 +05:30
Anupam Kumar
ed42afc5e8 feat: price margin in buying (#24685) 2021-03-15 11:11:28 +05:30
Marica
5499401fcb Merge branch 'develop' into drop-shipping 2021-03-15 11:09:04 +05:30
Deepesh Garg
a2e4564464 fix: Prevent non sequential repayment entries 2021-03-15 10:32:38 +05:30
Anupam
d8f7a75eae feat: add total available stock field 2021-03-15 10:31:53 +05:30
Deepesh Garg
5165859e51 Merge pull request #24873 from GangaManoj/filter-bank-reconciliation
fix(Bank Reconciliation Tool): Filter Bank Account drop-down list
2021-03-15 10:21:14 +05:30
Deepesh Garg
61fb9bf869 fix: Loan Repayment entry cancellation on salary slip cancel 2021-03-14 21:25:21 +05:30
Ganga Manoj
ca03997ab5 fix(Bank Reconciliation): Filter Bank Account drop-down list 2021-03-13 22:21:07 +05:30
Deepesh Garg
e196be4d8a Merge pull request #24866 from resilient-tech/fix-test-import
test: fix import_doc call in test_shopify_settings
2021-03-13 19:12:15 +05:30
Sagar Vora
c5869d5b47 test: fix import_doc call in test_shopify_settings 2021-03-12 16:21:45 +05:30
Afshan
5d66a2b326 fix: added correct path in hooks (#24862) 2021-03-12 15:51:34 +05:30
marination
e685c787d2 fix: Sider (unused variables) 2021-03-12 14:24:09 +05:30
marination
86725a6580 fix: PO not created against all selected suppliers (drop shipping)
- Return list of created POs instead of first doc
- test case added
2021-03-12 14:12:46 +05:30
Mohammad Hasnain Mohsin Rajan
0f60f08f3e ci: Port CI test from Travis to Github Actions (#24846) 2021-03-12 14:09:52 +05:30
Sagar Vora
6727792aaf test: fix syntax error 2021-03-11 18:12:01 +05:30
Raffael Meyer
fb68aba30d Merge branch 'develop' into improve_taxes_setup 2021-03-11 13:17:44 +01:00
Sagar Vora
514122bf6f refactor(payroll): simplified logic for additional salary 2021-03-11 17:22:11 +05:30
Sagar Vora
5822b6d76f fix(payroll): allow duplicate additional salaries 2021-03-10 21:45:32 +05:30
Raffael Meyer
fbd810c2ae Merge branch 'develop' into improve_taxes_setup 2021-03-10 11:38:52 +01:00
barredterra
99c8b8efcf Merge branch 'develop' into improve_taxes_setup 2021-03-08 20:00:59 +01:00
barredterra
ebd1d08e55 refactor: taxes setup
Better structure of input data.
2021-03-08 19:53:50 +01:00
barredterra
25afad3dc1 refactor: extend taxes and charges setup
Add option to specify taxes and charges template depending on the CoA used. Differentiate between purchase, sales and item taxes. Maintain flexibility by using wildcards.
2021-03-04 21:11:31 +01:00
barredterra
dcfc3d7d12 fix: remove redundant calls to create_sales_tax 2021-03-04 19:29:55 +01:00
Anurag Mishra
5ec592d09c fix: supplier was not able to Submit RFQ due to in sufficient permission 2021-02-18 13:42:04 +05:30
Andy Zhu
b44af32628 Update accounts_controller.py
Updating Bin quantity based on doctype to optimize running efficiency.
2020-10-27 14:57:59 +13:00
Andy Zhu
1062d7eee0 fix: Update Items on Purchase Order
1. set warehouse using `get_item_warehouse`
2. update "reserved_qty" for sales order
2020-10-06 10:51:42 +13:00
Andy Zhu
760248911d fix: Update Items on Purchase Order
If user add rows or remove rows to update items on purchase order, the quantity in bin won't get updated.
This fix is not mature yet but to give an tempopary solution for fixing this issue.
2020-10-05 12:16:48 +13:00
1226 changed files with 31511 additions and 27266 deletions

View File

@@ -29,4 +29,5 @@ ignore =
B950,
W191,
max-line-length = 200
max-line-length = 200
exclude=.github/helper/semgrep_rules

12
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,12 @@
# Since version 2.23 (released in August 2019), git-blame has a feature
# to ignore or bypass certain commits.
#
# This file contains a list of commits that are not likely what you
# are looking for in a blame, such as mass reformatting or renaming.
# You can set this file as a default ignore file for blame by running
# the following command.
#
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
# This commit just changes spaces to tabs for indentation in some files
5f473611bd6ed57703716244a054d3fb5ba9cd23

46
.github/helper/install.sh vendored Normal file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
set -e
cd ~ || exit
sudo apt-get install redis-server
sudo apt install nodejs
sudo apt install npm
pip install frappe-bench
git clone https://github.com/frappe/frappe --branch "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" --depth 1
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
mkdir ~/frappe-bench/sites/test_site
cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config.json" ~/frappe-bench/sites/test_site/
mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL character_set_server = 'utf8mb4'"
mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE DATABASE test_frappe"
mysql --host 127.0.0.1 --port 3306 -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
mysql --host 127.0.0.1 --port 3306 -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'"
mysql --host 127.0.0.1 --port 3306 -u root -e "FLUSH PRIVILEGES"
wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
sudo chmod o+x /usr/local/bin/wkhtmltopdf
sudo apt-get install libcups2-dev
cd ~/frappe-bench || exit
sed -i 's/watch:/# watch:/g' Procfile
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 erpnext "${GITHUB_WORKSPACE}"
bench start &
bench --site test_site reinstall --yes

38
.github/helper/semgrep_rules/README.md vendored Normal file
View File

@@ -0,0 +1,38 @@
# Semgrep linting
## What is semgrep?
Semgrep or "semantic grep" is language agnostic static analysis tool. In simple terms semgrep is syntax-aware `grep`, so unlike regex it doesn't get confused by different ways of writing same thing or whitespaces or code split in multiple lines etc.
Example:
To check if a translate function is using f-string or not the regex would be `r"_\(\s*f[\"']"` while equivalent rule in semgrep would be `_(f"...")`. As semgrep knows grammer of language it takes care of unnecessary whitespace, type of quotation marks etc.
You can read more such examples in `.github/helper/semgrep_rules` directory.
# Why/when to use this?
We want to maintain quality of contributions, at the same time remembering all the good practices can be pain to deal with while evaluating contributions. Using semgrep if you can translate "best practice" into a rule then it can automate the task for us.
## Running locally
Install semgrep using homebrew `brew install semgrep` or pip `pip install semgrep`.
To run locally use following command:
`semgrep --config=.github/helper/semgrep_rules [file/folder names]`
## Testing
semgrep allows testing the tests. Refer to this page: https://semgrep.dev/docs/writing-rules/testing-rules/
When writing new rules you should write few positive and few negative cases as shown in the guide and current tests.
To run current tests: `semgrep --test --test-ignore-todo .github/helper/semgrep_rules`
## Reference
If you are new to Semgrep read following pages to get started on writing/modifying rules:
- https://semgrep.dev/docs/getting-started/
- https://semgrep.dev/docs/writing-rules/rule-syntax
- https://semgrep.dev/docs/writing-rules/pattern-examples/
- https://semgrep.dev/docs/writing-rules/rule-ideas/#common-use-cases

View File

@@ -0,0 +1,64 @@
import frappe
from frappe import _, flt
from frappe.model.document import Document
# ruleid: frappe-modifying-but-not-comitting
def on_submit(self):
if self.value_of_goods == 0:
frappe.throw(_('Value of goods cannot be 0'))
self.status = 'Submitted'
# ok: frappe-modifying-but-not-comitting
def on_submit(self):
if self.value_of_goods == 0:
frappe.throw(_('Value of goods cannot be 0'))
self.status = 'Submitted'
self.db_set('status', 'Submitted')
# ok: frappe-modifying-but-not-comitting
def on_submit(self):
if self.value_of_goods == 0:
frappe.throw(_('Value of goods cannot be 0'))
x = "y"
self.status = x
self.db_set('status', x)
# ok: frappe-modifying-but-not-comitting
def on_submit(self):
x = "y"
self.status = x
self.save()
# ruleid: frappe-modifying-but-not-comitting-other-method
class DoctypeClass(Document):
def on_submit(self):
self.good_method()
self.tainted_method()
def tainted_method(self):
self.status = "uptate"
# ok: frappe-modifying-but-not-comitting-other-method
class DoctypeClass(Document):
def on_submit(self):
self.good_method()
self.tainted_method()
def tainted_method(self):
self.status = "update"
self.db_set("status", "update")
# ok: frappe-modifying-but-not-comitting-other-method
class DoctypeClass(Document):
def on_submit(self):
self.good_method()
self.tainted_method()
self.save()
def tainted_method(self):
self.status = "uptate"

View File

@@ -0,0 +1,135 @@
# This file specifies rules for correctness according to how frappe doctype data model works.
rules:
- id: frappe-modifying-but-not-comitting
patterns:
- pattern: |
def $METHOD(self, ...):
...
self.$ATTR = ...
- pattern-not: |
def $METHOD(self, ...):
...
self.$ATTR = ...
...
self.db_set(..., self.$ATTR, ...)
- pattern-not: |
def $METHOD(self, ...):
...
self.$ATTR = $SOME_VAR
...
self.db_set(..., $SOME_VAR, ...)
- pattern-not: |
def $METHOD(self, ...):
...
self.$ATTR = $SOME_VAR
...
self.save()
- metavariable-regex:
metavariable: '$ATTR'
# this is negative look-ahead, add more attrs to ignore like (ignore|ignore_this_too|ignore_me)
regex: '^(?!ignore_linked_doctypes|status_updater)(.*)$'
- metavariable-regex:
metavariable: "$METHOD"
regex: "(on_submit|on_cancel)"
message: |
DocType modified in self.$METHOD. Please check if modification of self.$ATTR is commited to database.
languages: [python]
severity: ERROR
- id: frappe-modifying-but-not-comitting-other-method
patterns:
- pattern: |
class $DOCTYPE(...):
def $METHOD(self, ...):
...
self.$ANOTHER_METHOD()
...
def $ANOTHER_METHOD(self, ...):
...
self.$ATTR = ...
- pattern-not: |
class $DOCTYPE(...):
def $METHOD(self, ...):
...
self.$ANOTHER_METHOD()
...
def $ANOTHER_METHOD(self, ...):
...
self.$ATTR = ...
...
self.db_set(..., self.$ATTR, ...)
- pattern-not: |
class $DOCTYPE(...):
def $METHOD(self, ...):
...
self.$ANOTHER_METHOD()
...
def $ANOTHER_METHOD(self, ...):
...
self.$ATTR = $SOME_VAR
...
self.db_set(..., $SOME_VAR, ...)
- pattern-not: |
class $DOCTYPE(...):
def $METHOD(self, ...):
...
self.$ANOTHER_METHOD()
...
self.save()
def $ANOTHER_METHOD(self, ...):
...
self.$ATTR = ...
- metavariable-regex:
metavariable: "$METHOD"
regex: "(on_submit|on_cancel)"
message: |
self.$ANOTHER_METHOD is called from self.$METHOD, check if changes to self.$ATTR are commited to database.
languages: [python]
severity: ERROR
- id: frappe-print-function-in-doctypes
pattern: print(...)
message: |
Did you mean to leave this print statement in? Consider using msgprint or logger instead of print statement.
languages: [python]
severity: WARNING
paths:
exclude:
- test_*.py
include:
- "*/**/doctype/*"
- id: frappe-modifying-child-tables-while-iterating
pattern-either:
- pattern: |
for $ROW in self.$TABLE:
...
self.remove(...)
- pattern: |
for $ROW in self.$TABLE:
...
self.append(...)
message: |
Child table being modified while iterating on it.
languages: [python]
severity: ERROR
paths:
include:
- "*/**/doctype/*"
- id: frappe-same-key-assigned-twice
pattern-either:
- pattern: |
{..., $X: $A, ..., $X: $B, ...}
- pattern: |
dict(..., ($X, $A), ..., ($X, $B), ...)
- pattern: |
_dict(..., ($X, $A), ..., ($X, $B), ...)
message: |
key `$X` is uselessly assigned twice. This could be a potential bug.
languages: [python]
severity: ERROR

View File

@@ -0,0 +1,6 @@
def function_name(input):
# ruleid: frappe-codeinjection-eval
eval(input)
# ok: frappe-codeinjection-eval
eval("1 + 1")

View File

@@ -0,0 +1,25 @@
rules:
- id: frappe-codeinjection-eval
patterns:
- pattern-not: eval("...")
- pattern: eval(...)
message: |
Detected the use of eval(). eval() can be dangerous if used to evaluate
dynamic content. Avoid it or use safe_eval().
languages: [python]
severity: ERROR
- id: frappe-sqli-format-strings
patterns:
- pattern-inside: |
@frappe.whitelist()
def $FUNC(...):
...
- pattern-either:
- pattern: frappe.db.sql("..." % ...)
- pattern: frappe.db.sql(f"...", ...)
- pattern: frappe.db.sql("...".format(...), ...)
message: |
Detected use of raw string formatting for SQL queries. This can lead to sql injection vulnerabilities. Refer security guidelines - https://github.com/frappe/erpnext/wiki/Code-Security-Guidelines
languages: [python]
severity: WARNING

View File

@@ -0,0 +1,44 @@
// ruleid: frappe-translation-empty-string
__("")
// ruleid: frappe-translation-empty-string
__('')
// ok: frappe-translation-js-formatting
__('Welcome {0}, get started with ERPNext in just a few clicks.', [full_name]);
// ruleid: frappe-translation-js-formatting
__(`Welcome ${full_name}, get started with ERPNext in just a few clicks.`);
// ok: frappe-translation-js-formatting
__('This is fine');
// ok: frappe-translation-trailing-spaces
__('This is fine');
// ruleid: frappe-translation-trailing-spaces
__(' this is not ok ');
// ruleid: frappe-translation-trailing-spaces
__('this is not ok ');
// ruleid: frappe-translation-trailing-spaces
__(' this is not ok');
// ok: frappe-translation-js-splitting
__('You have {0} subscribers in your mailing list.', [subscribers.length])
// todoruleid: frappe-translation-js-splitting
__('You have') + subscribers.length + __('subscribers in your mailing list.')
// ruleid: frappe-translation-js-splitting
__('You have' + 'subscribers in your mailing list.')
// ruleid: frappe-translation-js-splitting
__('You have {0} subscribers' +
'in your mailing list', [subscribers.length])
// ok: frappe-translation-js-splitting
__("Ctrl+Enter to add comment")
// ruleid: frappe-translation-js-splitting
__('You have {0} subscribers \
in your mailing list', [subscribers.length])

View File

@@ -0,0 +1,61 @@
# Examples taken from https://frappeframework.com/docs/user/en/translations
# This file is used for testing the tests.
from frappe import _
full_name = "Jon Doe"
# ok: frappe-translation-python-formatting
_('Welcome {0}, get started with ERPNext in just a few clicks.').format(full_name)
# ruleid: frappe-translation-python-formatting
_('Welcome %s, get started with ERPNext in just a few clicks.' % full_name)
# ruleid: frappe-translation-python-formatting
_('Welcome %(name)s, get started with ERPNext in just a few clicks.' % {'name': full_name})
# ruleid: frappe-translation-python-formatting
_('Welcome {0}, get started with ERPNext in just a few clicks.'.format(full_name))
subscribers = ["Jon", "Doe"]
# ok: frappe-translation-python-formatting
_('You have {0} subscribers in your mailing list.').format(len(subscribers))
# ruleid: frappe-translation-python-splitting
_('You have') + len(subscribers) + _('subscribers in your mailing list.')
# ruleid: frappe-translation-python-splitting
_('You have {0} subscribers \
in your mailing list').format(len(subscribers))
# ok: frappe-translation-python-splitting
_('You have {0} subscribers') \
+ 'in your mailing list'
# ruleid: frappe-translation-trailing-spaces
msg = _(" You have {0} pending invoice ")
# ruleid: frappe-translation-trailing-spaces
msg = _("You have {0} pending invoice ")
# ruleid: frappe-translation-trailing-spaces
msg = _(" You have {0} pending invoice")
# ok: frappe-translation-trailing-spaces
msg = ' ' + _("You have {0} pending invoices") + ' '
# ruleid: frappe-translation-python-formatting
_(f"can not format like this - {subscribers}")
# ruleid: frappe-translation-python-splitting
_(f"what" + f"this is also not cool")
# ruleid: frappe-translation-empty-string
_("")
# ruleid: frappe-translation-empty-string
_('')
class Test:
# ok: frappe-translation-python-splitting
def __init__(
args
):
pass

View File

@@ -0,0 +1,64 @@
rules:
- id: frappe-translation-empty-string
pattern-either:
- pattern: _("")
- pattern: __("")
message: |
Empty string is useless for translation.
Please refer: https://frappeframework.com/docs/user/en/translations
languages: [python, javascript, json]
severity: ERROR
- id: frappe-translation-trailing-spaces
pattern-either:
- pattern: _("=~/(^[ \t]+|[ \t]+$)/")
- pattern: __("=~/(^[ \t]+|[ \t]+$)/")
message: |
Trailing or leading whitespace not allowed in translate strings.
Please refer: https://frappeframework.com/docs/user/en/translations
languages: [python, javascript, json]
severity: ERROR
- id: frappe-translation-python-formatting
pattern-either:
- pattern: _("..." % ...)
- pattern: _("...".format(...))
- pattern: _(f"...")
message: |
Only positional formatters are allowed and formatting should not be done before translating.
Please refer: https://frappeframework.com/docs/user/en/translations
languages: [python]
severity: ERROR
- id: frappe-translation-js-formatting
patterns:
- pattern: __(`...`)
- pattern-not: __("...")
message: |
Template strings are not allowed for text formatting.
Please refer: https://frappeframework.com/docs/user/en/translations
languages: [javascript, json]
severity: ERROR
- id: frappe-translation-python-splitting
pattern-either:
- pattern: _(...) + _(...)
- pattern: _("..." + "...")
- pattern-regex: '[\s\.]_\([^\)]*\\\s*' # lines broken by `\`
- pattern-regex: '[\s\.]_\(\s*\n' # line breaks allowed by python for using ( )
message: |
Do not split strings inside translate function. Do not concatenate using translate functions.
Please refer: https://frappeframework.com/docs/user/en/translations
languages: [python]
severity: ERROR
- id: frappe-translation-js-splitting
pattern-either:
- pattern-regex: '__\([^\)]*[\\]\s+'
- pattern: __('...' + '...', ...)
- pattern: __('...') + __('...')
message: |
Do not split strings inside translate function. Do not concatenate using translate functions.
Please refer: https://frappeframework.com/docs/user/en/translations
languages: [javascript, json]
severity: ERROR

9
.github/helper/semgrep_rules/ux.js vendored Normal file
View File

@@ -0,0 +1,9 @@
// ok: frappe-missing-translate-function-js
frappe.msgprint('{{ _("Both login and password required") }}');
// ruleid: frappe-missing-translate-function-js
frappe.msgprint('What');
// ok: frappe-missing-translate-function-js
frappe.throw(' {{ _("Both login and password required") }}. ');

31
.github/helper/semgrep_rules/ux.py vendored Normal file
View File

@@ -0,0 +1,31 @@
import frappe
from frappe import msgprint, throw, _
# ruleid: frappe-missing-translate-function-python
throw("Error Occured")
# ruleid: frappe-missing-translate-function-python
frappe.throw("Error Occured")
# ruleid: frappe-missing-translate-function-python
frappe.msgprint("Useful message")
# ruleid: frappe-missing-translate-function-python
msgprint("Useful message")
# ok: frappe-missing-translate-function-python
translatedmessage = _("Hello")
# ok: frappe-missing-translate-function-python
throw(translatedmessage)
# ok: frappe-missing-translate-function-python
msgprint(translatedmessage)
# ok: frappe-missing-translate-function-python
msgprint(_("Helpful message"))
# ok: frappe-missing-translate-function-python
frappe.throw(_("Error occured"))

30
.github/helper/semgrep_rules/ux.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
rules:
- id: frappe-missing-translate-function-python
pattern-either:
- patterns:
- pattern: frappe.msgprint("...", ...)
- pattern-not: frappe.msgprint(_("..."), ...)
- patterns:
- pattern: frappe.throw("...", ...)
- pattern-not: frappe.throw(_("..."), ...)
message: |
All user facing text must be wrapped in translate function. Please refer to translation documentation. https://frappeframework.com/docs/user/en/guides/basics/translations
languages: [python]
severity: ERROR
- id: frappe-missing-translate-function-js
pattern-either:
- patterns:
- pattern: frappe.msgprint("...", ...)
- pattern-not: frappe.msgprint(__("..."), ...)
# ignore microtemplating e.g. msgprint("{{ _("server side translation") }}")
- pattern-not: frappe.msgprint("=~/\{\{.*\_.*\}\}/i", ...)
- patterns:
- pattern: frappe.throw("...", ...)
- pattern-not: frappe.throw(__("..."), ...)
# ignore microtemplating
- pattern-not: frappe.throw("=~/\{\{.*\_.*\}\}/i", ...)
message: |
All user facing text must be wrapped in translate function. Please refer to translation documentation. https://frappeframework.com/docs/user/en/guides/basics/translations
languages: [javascript]
severity: ERROR

View File

@@ -1,4 +1,6 @@
{
"db_host": "127.0.0.1",
"db_port": 3306,
"db_name": "test_frappe",
"db_password": "test_frappe",
"auto_email_id": "test@example.com",

73
.github/workflows/patch.yml vendored Normal file
View File

@@ -0,0 +1,73 @@
name: Patch
on: [pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-18.04
name: Patch Test
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.6
- 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: Install
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
- name: Run Patch Tests
run: |
cd ~/frappe-bench/
wget https://erpnext.com/files/v10-erpnext.sql.gz
bench --site test_site --force restore ~/frappe-bench/v10-erpnext.sql.gz
bench --site test_site migrate

34
.github/workflows/semgrep.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Semgrep
on:
pull_request:
branches:
- develop
- version-13-hotfix
- version-13-pre-release
jobs:
semgrep:
name: Frappe Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python3
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Setup semgrep
run: |
python -m pip install -q semgrep
git fetch origin $GITHUB_BASE_REF:$GITHUB_BASE_REF -q
- name: Semgrep errors
run: |
files=$(git diff --name-only --diff-filter=d $GITHUB_BASE_REF)
[[ -d .github/helper/semgrep_rules ]] && semgrep --severity ERROR --config=.github/helper/semgrep_rules --quiet --error $files
semgrep --config="r/python.lang.correctness" --quiet --error $files
- name: Semgrep warnings
run: |
files=$(git diff --name-only --diff-filter=d $GITHUB_BASE_REF)
[[ -d .github/helper/semgrep_rules ]] && semgrep --severity WARNING --severity INFO --config=.github/helper/semgrep_rules --quiet $files

110
.github/workflows/server-tests.yml vendored Normal file
View File

@@ -0,0 +1,110 @@
name: Server
on: [pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
container: [1, 2, 3]
name: Python Unit Tests
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.7
- 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: Install
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator --with-coverage
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
- name: Upload Coverage Data
run: |
cp ~/frappe-bench/sites/.coverage ${GITHUB_WORKSPACE}
cd ${GITHUB_WORKSPACE}
pip3 install coverage==5.5
pip3 install coveralls==3.0.1
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-${{ matrix.container }}
COVERALLS_SERVICE_NAME: ${{ github.event_name == 'pull_request' && 'github' || 'github-actions' }}
COVERALLS_PARALLEL: true
coveralls:
name: Coverage Wrap Up
needs: test
container: python:3-slim
runs-on: ubuntu-18.04
steps:
- name: Clone
uses: actions/checkout@v2
- name: Coveralls Finished
run: |
cd ${GITHUB_WORKSPACE}
pip3 install coverage==5.5
pip3 install coveralls==3.0.1
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1 +0,0 @@
disable=access-member-before-definition

View File

@@ -1,69 +0,0 @@
language: python
dist: trusty
git:
depth: 1
cache:
- pip
addons:
hosts: test_site
mariadb: 10.3
jobs:
include:
- name: "Python 3.6 Server Side Test"
python: 3.6
script: bench --site test_site run-tests --app erpnext --coverage
- name: "Python 3.6 Patch Test"
python: 3.6
before_script:
- wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz
- bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz
script: bench --site test_site migrate
install:
- cd ~
- nvm install 10
- pip install frappe-bench
- git clone https://github.com/frappe/frappe --branch $TRAVIS_BRANCH --depth 1
- bench init --skip-assets --frappe-path ~/frappe --python $(which python) frappe-bench
- mkdir ~/frappe-bench/sites/test_site
- cp -r $TRAVIS_BUILD_DIR/.travis/site_config.json ~/frappe-bench/sites/test_site/
- mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'"
- mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
- mysql -u root -e "CREATE DATABASE test_frappe"
- mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
- mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
- mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'"
- mysql -u root -e "FLUSH PRIVILEGES"
- wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
- tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
- sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
- sudo chmod o+x /usr/local/bin/wkhtmltopdf
- sudo apt-get install libcups2-dev
- cd ~/frappe-bench
- sed -i 's/watch:/# watch:/g' Procfile
- 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 erpnext $TRAVIS_BUILD_DIR
- bench start &
- bench --site test_site reinstall --yes
after_script:
- pip install coverage==4.5.4
- pip install python-coveralls
- coveralls -b apps/erpnext -d ../../sites/.coverage

View File

@@ -5,7 +5,7 @@
<p>ERP made simple</p>
</p>
[![Build Status](https://api.travis-ci.com/frappe/erpnext.svg?branch=develop)](https://travis-ci.com/frappe/erpnext)
[![CI](https://github.com/frappe/erpnext/actions/workflows/ci-tests.yml/badge.svg?branch=develop)](https://github.com/frappe/erpnext/actions/workflows/ci-tests.yml)
[![Open Source Helpers](https://www.codetriage.com/frappe/erpnext/badges/users.svg)](https://www.codetriage.com/frappe/erpnext)
[![Coverage Status](https://coveralls.io/repos/github/frappe/erpnext/badge.svg?branch=develop)](https://coveralls.io/github/frappe/erpnext?branch=develop)
@@ -39,6 +39,10 @@ ERPNext is built on the [Frappe Framework](https://github.com/frappe/frappe), a
---
### 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
The Easy Way: our install script for bench will install all dependencies (e.g. MariaDB). See https://github.com/frappe/bench for more details.

View File

@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '13.0.1'
__version__ = '13.7.0'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -33,6 +33,8 @@ def get_shipping_address(company, address = None):
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])
address = frappe.get_all("Address", filters=filters, fields=fields) or {}

View File

@@ -41,7 +41,7 @@ def build_conditions(process_type, account, company):
if account:
conditions += "AND %s='%s'"%(deferred_account, account)
elif company:
conditions += "AND p.company='%s'"%(company)
conditions += f"AND p.company = {frappe.db.escape(company)}"
return conditions
@@ -263,6 +263,9 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
amount, base_amount = calculate_amount(doc, item, last_gl_entry,
total_days, total_booking_days, account_currency)
if not amount:
return
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)
@@ -298,17 +301,21 @@ def process_deferred_accounting(posting_date=None):
start_date = add_months(today(), -1)
end_date = add_days(today(), -1)
for record_type in ('Income', 'Expense'):
doc = frappe.get_doc(dict(
doctype='Process Deferred Accounting',
posting_date=posting_date,
start_date=start_date,
end_date=end_date,
type=record_type
))
companies = frappe.get_all('Company')
doc.insert()
doc.submit()
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
))
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):
@@ -360,12 +367,10 @@ def make_gl_entries(doc, credit_account, debit_account, against,
frappe.flags.deferred_accounting_error = True
def send_mail(deferred_process):
title = _("Error while processing deferred accounting for {0}".format(deferred_process))
content = _("""
Deferred accounting failed for some invoices:
Please check Process Deferred Accounting {0}
and submit manually after resolving errors
""").format(get_link_to_form('Process Deferred Accounting', deferred_process))
title = _("Error while processing deferred accounting for {0}").format(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)
sendmail_to_system_managers(title, content)
def book_revenue_via_journal_entry(doc, credit_account, debit_account, against,

View File

@@ -13,7 +13,7 @@ class BalanceMismatchError(frappe.ValidationError): pass
class Account(NestedSet):
nsm_parent_field = 'parent_account'
def on_update(self):
if frappe.local.flags.ignore_on_update:
if frappe.local.flags.ignore_update_nsm:
return
else:
super(Account, self).on_update()
@@ -214,6 +214,7 @@ class Account(NestedSet):
if parent_value_changed:
doc.save()
@frappe.whitelist()
def convert_group_to_ledger(self):
if self.check_if_child_exists():
throw(_("Account with child nodes cannot be converted to ledger"))
@@ -224,6 +225,7 @@ class Account(NestedSet):
self.save()
return 1
@frappe.whitelist()
def convert_ledger_to_group(self):
if self.check_gle_exists():
throw(_("Account with existing transaction can not be converted to group."))

View File

@@ -57,10 +57,10 @@ def create_charts(company, chart_template=None, existing_company=None, custom_ch
# Rebuild NestedSet HSM tree for Account Doctype
# after all accounts are already inserted.
frappe.local.flags.ignore_on_update = True
frappe.local.flags.ignore_update_nsm = True
_import_accounts(chart, None, None, root_account=True)
rebuild_tree("Account", "parent_account")
frappe.local.flags.ignore_on_update = False
frappe.local.flags.ignore_update_nsm = False
def add_suffix_if_duplicate(account_name, account_number, accounts):
if account_number:

View File

@@ -19,7 +19,7 @@ class AccountingDimension(Document):
def validate(self):
if self.document_type in core_doctypes_list + ('Accounting Dimension', 'Project',
'Cost Center', 'Accounting Dimension Detail', 'Company') :
'Cost Center', 'Accounting Dimension Detail', 'Company', 'Account') :
msg = _("Not allowed to create accounting dimension for {0}").format(self.document_type)
frappe.throw(msg)
@@ -27,7 +27,7 @@ class AccountingDimension(Document):
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")
frappe.throw(_("Document Type already used as a dimension"))
if not self.is_new():
self.validate_document_type_change()

View File

@@ -7,7 +7,8 @@ import frappe
import unittest
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import delete_accounting_dimension
test_dependencies = ['Cost Center', 'Location', 'Warehouse', 'Department']
class TestAccountingDimension(unittest.TestCase):
def setUp(self):

View File

@@ -9,6 +9,8 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import create_dimension, disable_dimension
from erpnext.exceptions import InvalidAccountDimensionError, MandatoryAccountDimensionError
test_dependencies = ['Location', 'Cost Center', 'Department']
class TestAccountingDimensionFilter(unittest.TestCase):
def setUp(self):
create_dimension()

View File

@@ -39,6 +39,7 @@ class AccountingPeriod(Document):
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", \

View File

@@ -10,37 +10,39 @@ from erpnext.accounts.general_ledger import ClosedAccountingPeriod
from erpnext.accounts.doctype.accounting_period.accounting_period import OverlapError
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
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.save()
def test_overlap(self):
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")
self.assertRaises(OverlapError, ap2.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")
self.assertRaises(OverlapError, ap2.save)
def test_accounting_period(self):
ap1 = create_accounting_period(period_name = "Test Accounting Period 2")
ap1.save()
def test_accounting_period(self):
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")
self.assertRaises(ClosedAccountingPeriod, doc.submit)
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 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)
args = frappe._dict(args)
accounting_period = frappe.new_doc("Accounting Period")
accounting_period.start_date = args.start_date or nowdate()
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 = frappe.new_doc("Accounting Period")
accounting_period.start_date = args.start_date or nowdate()
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
})
return accounting_period
return accounting_period

View File

@@ -7,25 +7,31 @@
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"auto_accounting_for_stock",
"acc_frozen_upto",
"frozen_accounts_modifier",
"determine_address_tax_category_from",
"accounts_transactions_settings_section",
"over_billing_allowance",
"column_break_4",
"credit_controller",
"check_supplier_invoice_uniqueness",
"role_allowed_to_over_bill",
"make_payment_via_journal_entry",
"column_break_11",
"check_supplier_invoice_uniqueness",
"unlink_payment_on_cancellation_of_invoice",
"unlink_advance_payment_on_cancelation_of_order",
"book_asset_depreciation_entry_automatically",
"add_taxes_from_item_tax_template",
"automatically_fetch_payment_terms",
"delete_linked_ledger_entries",
"book_asset_depreciation_entry_automatically",
"unlink_advance_payment_on_cancelation_of_order",
"post_change_gl_entries",
"tax_settings_section",
"determine_address_tax_category_from",
"column_break_19",
"add_taxes_from_item_tax_template",
"period_closing_settings_section",
"acc_frozen_upto",
"frozen_accounts_modifier",
"column_break_4",
"credit_controller",
"deferred_accounting_settings_section",
"automatically_process_deferred_accounting_entry",
"book_deferred_entries_based_on",
"column_break_18",
"automatically_process_deferred_accounting_entry",
"book_deferred_entries_via_journal_entry",
"submit_journal_entries",
"print_settings",
@@ -39,15 +45,6 @@
"use_custom_cash_flow"
],
"fields": [
{
"default": "1",
"description": "If enabled, the system will post accounting entries for inventory automatically",
"fieldname": "auto_accounting_for_stock",
"fieldtype": "Check",
"hidden": 1,
"in_list_view": 1,
"label": "Make Accounting Entry For Every Stock Movement"
},
{
"description": "Accounting entries are frozen up to this date. Nobody can create or modify entries except users with the role specified below",
"fieldname": "acc_frozen_upto",
@@ -93,6 +90,7 @@
"default": "0",
"fieldname": "make_payment_via_journal_entry",
"fieldtype": "Check",
"hidden": 1,
"label": "Make Payment via Journal Entry"
},
{
@@ -226,6 +224,43 @@
"fieldname": "delete_linked_ledger_entries",
"fieldtype": "Check",
"label": "Delete Accounting and Stock Ledger Entries on deletion of Transaction"
},
{
"description": "Users with this role are allowed to over bill above the allowance percentage",
"fieldname": "role_allowed_to_over_bill",
"fieldtype": "Link",
"label": "Role Allowed to Over Bill ",
"options": "Role"
},
{
"fieldname": "period_closing_settings_section",
"fieldtype": "Section Break",
"label": "Period Closing Settings"
},
{
"fieldname": "accounts_transactions_settings_section",
"fieldtype": "Section Break",
"label": "Transactions Settings"
},
{
"fieldname": "column_break_11",
"fieldtype": "Column Break"
},
{
"fieldname": "tax_settings_section",
"fieldtype": "Section Break",
"label": "Tax Settings"
},
{
"fieldname": "column_break_19",
"fieldtype": "Column Break"
},
{
"default": "1",
"description": "If enabled, ledger entries will be posted for change amount in POS transactions",
"fieldname": "post_change_gl_entries",
"fieldtype": "Check",
"label": "Create Ledger Entries for Change Amount"
}
],
"icon": "icon-cog",
@@ -233,7 +268,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-01-05 13:04:00.118892",
"modified": "2021-06-17 20:26:03.721202",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -5,6 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint
from frappe.model.document import Document
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
@@ -24,11 +25,11 @@ class AccountsSettings(Document):
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',
_("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")
make_property_setter(doctype, "payment_schedule", "print_hide", 0 if show_in_print else 1, "Check")
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)

View File

@@ -0,0 +1,197 @@
{
"actions": [],
"creation": "2020-09-12 22:26:19.594367",
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"add_deduct_tax",
"charge_type",
"row_id",
"account_head",
"col_break_1",
"description",
"included_in_paid_amount",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"section_break_8",
"rate",
"section_break_9",
"currency",
"tax_amount",
"total",
"allocated_amount",
"column_break_13",
"base_tax_amount",
"base_total",
"base_allocated_amount"
],
"fields": [
{
"columns": 2,
"fieldname": "charge_type",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Type",
"oldfieldname": "charge_type",
"oldfieldtype": "Select",
"options": "\nActual\nOn Paid Amount\nOn Previous Row Amount\nOn Previous Row Total",
"reqd": 1
},
{
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"fieldname": "row_id",
"fieldtype": "Data",
"label": "Reference Row #",
"oldfieldname": "row_id",
"oldfieldtype": "Data"
},
{
"columns": 2,
"fieldname": "account_head",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Account Head",
"oldfieldname": "account_head",
"oldfieldtype": "Link",
"options": "Account",
"reqd": 1,
"search_index": 1
},
{
"fieldname": "col_break_1",
"fieldtype": "Column Break",
"width": "50%"
},
{
"fieldname": "description",
"fieldtype": "Small Text",
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"print_width": "300px",
"reqd": 1,
"width": "300px"
},
{
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions"
},
{
"default": ":Company",
"fieldname": "cost_center",
"fieldtype": "Link",
"label": "Cost Center",
"oldfieldname": "cost_center_other_charges",
"oldfieldtype": "Link",
"options": "Cost Center"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_8",
"fieldtype": "Section Break"
},
{
"columns": 2,
"fieldname": "rate",
"fieldtype": "Float",
"in_list_view": 1,
"label": "Rate",
"oldfieldname": "rate",
"oldfieldtype": "Currency"
},
{
"fieldname": "section_break_9",
"fieldtype": "Section Break"
},
{
"columns": 2,
"fieldname": "tax_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Amount",
"options": "currency"
},
{
"columns": 2,
"fieldname": "total",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Total",
"options": "currency",
"read_only": 1
},
{
"fieldname": "column_break_13",
"fieldtype": "Column Break"
},
{
"fieldname": "base_tax_amount",
"fieldtype": "Currency",
"label": "Amount (Company Currency)",
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"fieldname": "base_total",
"fieldtype": "Currency",
"label": "Total (Company Currency)",
"oldfieldname": "total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"fieldname": "add_deduct_tax",
"fieldtype": "Select",
"label": "Add Or Deduct",
"options": "Add\nDeduct",
"reqd": 1
},
{
"default": "0",
"fieldname": "included_in_paid_amount",
"fieldtype": "Check",
"label": "Considered In Paid Amount"
},
{
"fieldname": "allocated_amount",
"fieldtype": "Currency",
"label": "Allocated Amount",
"options": "currency"
},
{
"fieldname": "base_allocated_amount",
"fieldtype": "Currency",
"label": "Allocated Amount (Company Currency)",
"options": "Company:company:default_currency"
},
{
"fetch_from": "account_head.account_currency",
"fieldname": "currency",
"fieldtype": "Link",
"label": "Account Currency",
"options": "Currency",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-06-09 11:46:58.373170",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Advance Taxes and Charges",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "ASC"
}

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class AdvanceTaxesandCharges(Document):
pass

View File

@@ -42,10 +42,9 @@ let add_fields_to_mapping_table = function (frm) {
});
});
frappe.meta.get_docfield("Bank Transaction Mapping", "bank_transaction_field",
frm.doc.name).options = options;
frm.fields_dict.bank_transaction_mapping.grid.refresh();
frm.fields_dict.bank_transaction_mapping.grid.update_docfield_property(
'bank_transaction_field', 'options', options
);
};
erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
@@ -121,4 +120,4 @@ erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
plaid_success(token, response) {
frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
}
};
};

View File

@@ -12,6 +12,7 @@ form_grid_templates = {
}
class BankClearance(Document):
@frappe.whitelist()
def get_payment_entries(self):
if not (self.from_date and self.to_date):
frappe.throw(_("From Date and To Date are Mandatory"))
@@ -108,6 +109,7 @@ class BankClearance(Document):
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'):

View File

@@ -8,6 +8,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
return {
filters: {
company: ["in", frm.doc.company],
'is_company_account': 1
},
};
});
@@ -77,8 +78,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
if (
frm.doc.bank_account &&
frm.doc.bank_statement_from_date &&
frm.doc.bank_statement_to_date &&
frm.doc.bank_statement_closing_balance
frm.doc.bank_statement_to_date
) {
frm.trigger("render_chart");
frm.trigger("render");

View File

@@ -39,13 +39,13 @@
"depends_on": "eval: doc.bank_account",
"fieldname": "bank_statement_from_date",
"fieldtype": "Date",
"label": "Bank Statement From Date"
"label": "From Date"
},
{
"depends_on": "eval: doc.bank_statement_from_date",
"fieldname": "bank_statement_to_date",
"fieldtype": "Date",
"label": "Bank Statement To Date"
"label": "To Date"
},
{
"fieldname": "column_break_2",
@@ -63,11 +63,10 @@
"depends_on": "eval: doc.bank_statement_to_date",
"fieldname": "bank_statement_closing_balance",
"fieldtype": "Currency",
"label": "Bank Statement Closing Balance",
"label": "Closing Balance",
"options": "Currency"
},
{
"depends_on": "eval: doc.bank_statement_closing_balance",
"fieldname": "section_break_1",
"fieldtype": "Section Break",
"label": "Reconcile"
@@ -90,7 +89,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-02-02 01:35:53.043578",
"modified": "2021-04-21 11:13:49.831769",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation Tool",

View File

@@ -239,6 +239,7 @@ frappe.ui.form.on("Bank Statement Import", {
"withdrawal",
"description",
"reference_number",
"bank_account"
],
},
});
@@ -532,43 +533,4 @@ frappe.ui.form.on("Bank Statement Import", {
</table>
`);
},
show_missing_link_values(frm, missing_link_values) {
let can_be_created_automatically = missing_link_values.every(
(d) => d.has_one_mandatory_field
);
let html = missing_link_values
.map((d) => {
let doctype = d.doctype;
let values = d.missing_values;
return `
<h5>${doctype}</h5>
<ul>${values.map((v) => `<li>${v}</li>`).join("")}</ul>
`;
})
.join("");
if (can_be_created_automatically) {
// prettier-ignore
let message = __('There are some linked records which needs to be created before we can import your file. Do you want to create the following missing records automatically?');
frappe.confirm(message + html, () => {
frm.call("create_missing_link_values", {
missing_link_values,
}).then((r) => {
let records = r.message;
frappe.msgprint(__(
"Created {0} records successfully.", [
records.length,
]
));
});
});
} else {
frappe.msgprint(
// prettier-ignore
__('The following records needs to be created before we can import your file.') + html
);
}
},
});

View File

@@ -146,7 +146,7 @@
},
{
"depends_on": "eval:!doc.__islocal && !doc.import_file\n",
"description": "Must be a publicly accessible Google Sheets URL",
"description": "Must be a publicly accessible Google Sheets URL and adding Bank Account column is necessary for importing via Google Sheets",
"fieldname": "google_sheets_url",
"fieldtype": "Data",
"label": "Import from Google Sheets"
@@ -202,7 +202,7 @@
],
"hide_toolbar": 1,
"links": [],
"modified": "2021-02-10 19:29:59.027325",
"modified": "2021-05-12 14:17:37.777246",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Statement Import",
@@ -224,4 +224,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}
}

View File

@@ -47,6 +47,13 @@ class BankStatementImport(DataImport):
def start_import(self):
preview = frappe.get_doc("Bank Statement Import", self.name).get_preview_from_template(
self.import_file, self.google_sheets_url
)
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
@@ -67,6 +74,7 @@ class BankStatementImport(DataImport):
data_import=self.name,
bank_account=self.bank_account,
import_file_path=self.import_file,
google_sheets_url=self.google_sheets_url,
bank=self.bank,
template_options=self.template_options,
now=frappe.conf.developer_mode or frappe.flags.in_test,
@@ -90,18 +98,20 @@ def download_errored_template(data_import_name):
data_import = frappe.get_doc("Bank Statement Import", data_import_name)
data_import.export_errored_rows()
def start_import(data_import, bank_account, import_file_path, 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)
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 = import_file_path, import_type="Insert New Records")
import_file = ImportFile("Bank Transaction", file = file, import_type="Insert New Records")
data = import_file.raw_data
add_bank_account(data, bank_account)
write_files(import_file, data)
if import_file_path:
add_bank_account(data, bank_account)
write_files(import_file, data)
try:
i = Importer(data_import.reference_doctype, data_import=data_import)

View File

@@ -175,22 +175,24 @@
},
{
"fieldname": "deposit",
"oldfieldname": "debit",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Deposit"
"label": "Deposit",
"oldfieldname": "debit",
"options": "currency"
},
{
"fieldname": "withdrawal",
"oldfieldname": "credit",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Withdrawal"
"label": "Withdrawal",
"oldfieldname": "credit",
"options": "currency"
}
],
"is_submittable": 1,
"links": [],
"modified": "2020-12-30 19:40:54.221070",
"modified": "2021-04-14 17:31:58.963529",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Transaction",

View File

@@ -15,12 +15,14 @@ from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profi
test_dependencies = ["Item", "Cost Center"]
class TestBankTransaction(unittest.TestCase):
def setUp(self):
@classmethod
def setUpClass(cls):
make_pos_profile()
add_transactions()
add_vouchers()
def tearDown(self):
@classmethod
def tearDownClass(cls):
for bt in frappe.get_all("Bank Transaction"):
doc = frappe.get_doc("Bank Transaction", bt.name)
doc.cancel()
@@ -33,9 +35,6 @@ class TestBankTransaction(unittest.TestCase):
# Delete POS Profile
frappe.db.sql("delete from `tabPOS Profile`")
frappe.flags.test_bank_transactions_created = False
frappe.flags.test_payments_created = False
# 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"))
@@ -44,8 +43,8 @@ class TestBankTransaction(unittest.TestCase):
# 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/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
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,
@@ -62,7 +61,6 @@ class TestBankTransaction(unittest.TestCase):
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'])
print(linked_payments)
self.assertTrue(linked_payments[0][3])
# Check error if already reconciled
@@ -116,10 +114,6 @@ def create_bank_account(bank_name="Citi Bank", account_name="_Test Bank - _TC"):
pass
def add_transactions():
if frappe.flags.test_bank_transactions_created:
return
frappe.set_user("Administrator")
create_bank_account()
doc = frappe.get_doc({
@@ -172,14 +166,8 @@ def add_transactions():
}).insert()
doc.submit()
frappe.flags.test_bank_transactions_created = True
def add_vouchers():
if frappe.flags.test_payments_created:
return
frappe.set_user("Administrator")
try:
frappe.get_doc({
"doctype": "Supplier",
@@ -272,13 +260,6 @@ def add_vouchers():
except frappe.DuplicateEntryError:
pass
si = create_sales_invoice(customer="Fayva", qty=1, rate=109080)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank - _TC")
pe.reference_no = "Fayva Oct 18"
pe.reference_date = "2018-10-29"
pe.insert()
pe.submit()
mode_of_payment = frappe.get_doc({
"doctype": "Mode of Payment",
"name": "Cash"
@@ -291,14 +272,12 @@ def add_vouchers():
})
mode_of_payment.save()
si = create_sales_invoice(customer="Fayva", qty=1, rate=109080, do_not_submit=1)
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.save()
si.insert()
si.submit()
frappe.flags.test_payments_created = True

View File

@@ -11,6 +11,8 @@ from erpnext.buying.doctype.purchase_order.test_purchase_order import create_pur
from erpnext.accounts.doctype.budget.budget import get_actual_expense, BudgetError
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
test_dependencies = ['Monthly Distribution']
class TestBudget(unittest.TestCase):
def test_monthly_budget_crossed_ignore(self):
set_total_expense_zero(nowdate(), "cost_center")

View File

@@ -54,9 +54,10 @@ class CForm(Document):
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')])
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:

View File

@@ -13,7 +13,8 @@ from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import
from frappe.utils.xlsxutils import read_xlsx_file_from_attached_file, read_xls_file_from_attached_file
class ChartofAccountsImporter(Document):
pass
def validate(self):
validate_accounts(self.import_file)
@frappe.whitelist()
def validate_company(company):
@@ -22,7 +23,7 @@ def validate_company(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 = _("{} 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'))
@@ -56,7 +57,7 @@ def get_file(file_name):
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")
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
@@ -293,31 +294,35 @@ def validate_accounts(file_name):
accounts_dict = {}
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 += "<br><br>"
msg += _("Alternatively, you can download the template and fill your data in.")
frappe.throw(msg, title=_("Parent Account Missing"))
if account["parent_account"] and accounts_dict.get(account["parent_account"]):
accounts_dict[account["parent_account"]]["is_group"] = 1
message = validate_root(accounts_dict)
if message: return message
message = validate_account_types(accounts_dict)
if message: return message
validate_root(accounts_dict)
validate_account_types(accounts_dict)
return [True, len(accounts)]
def validate_root(accounts):
roots = [accounts[d] for d in accounts if not accounts[d].get('parent_account')]
if len(roots) < 4:
return _("Number of root accounts cannot be less than 4")
frappe.throw(_("Number of root accounts cannot be less than 4"))
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")))
if error_messages:
return "<br>".join(error_messages)
frappe.throw("<br>".join(error_messages))
def get_root_types():
return ('Asset', 'Liability', 'Expense', 'Income', 'Equity')
@@ -351,7 +356,7 @@ def validate_account_types(accounts):
missing = list(set(account_types_for_ledger) - set(account_types))
if missing:
return _("Please identify/create Account (Ledger) for type - {0}").format(' , '.join(missing))
frappe.throw(_("Please identify/create Account (Ledger) for type - {0}").format(' , '.join(missing)))
account_types_for_group = ["Bank", "Cash", "Stock"]
# fix logic bug
@@ -359,7 +364,7 @@ def validate_account_types(accounts):
missing = list(set(account_types_for_group) - set(account_groups))
if missing:
return _("Please identify/create Account (Group) for type - {0}").format(' , '.join(missing))
frappe.throw(_("Please identify/create Account (Group) for type - {0}").format(' , '.join(missing)))
def unset_existing_data(company):
linked = frappe.db.sql('''select fieldname from tabDocField

View File

@@ -50,6 +50,7 @@ class CostCenter(NestedSet):
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):
if self.check_if_child_exists():
frappe.throw(_("Cannot convert Cost Center to ledger as it has child nodes"))
@@ -60,6 +61,7 @@ class CostCenter(NestedSet):
self.save()
return 1
@frappe.whitelist()
def convert_ledger_to_group(self):
if cint(self.enable_distributed_cost_center):
frappe.throw(_("Cost Center with enabled distributed cost center can not be converted to group"))

View File

@@ -14,7 +14,7 @@ class CouponCode(Document):
if not self.coupon_code:
if self.coupon_type == "Promotional":
self.coupon_code =''.join([i for i in self.coupon_name if not i.isdigit()])[0:8].upper()
self.coupon_code =''.join(i for i in self.coupon_name if not i.isdigit())[0:8].upper()
elif self.coupon_type == "Gift Card":
self.coupon_code = frappe.generate_hash()[:10].upper()

View File

@@ -25,7 +25,7 @@ class Dunning(AccountsController):
def validate_amount(self):
amounts = calculate_interest_and_amount(
self.posting_date, self.outstanding_amount, self.rate_of_interest, self.dunning_fee, self.overdue_days)
self.outstanding_amount, self.rate_of_interest, self.dunning_fee, self.overdue_days)
if self.interest_amount != amounts.get('interest_amount'):
self.interest_amount = flt(amounts.get('interest_amount'), self.precision('interest_amount'))
if self.dunning_amount != amounts.get('dunning_amount'):
@@ -86,18 +86,18 @@ def resolve_dunning(doc, state):
for reference in doc.references:
if reference.reference_doctype == 'Sales Invoice' and reference.outstanding_amount <= 0:
dunnings = frappe.get_list('Dunning', filters={
'sales_invoice': reference.reference_name, 'status': ('!=', 'Resolved')})
'sales_invoice': reference.reference_name, 'status': ('!=', 'Resolved')}, ignore_permissions=True)
for dunning in dunnings:
frappe.db.set_value("Dunning", dunning.name, "status", 'Resolved')
def calculate_interest_and_amount(posting_date, outstanding_amount, rate_of_interest, dunning_fee, overdue_days):
def calculate_interest_and_amount(outstanding_amount, rate_of_interest, dunning_fee, overdue_days):
interest_amount = 0
grand_total = 0
grand_total = flt(outstanding_amount) + flt(dunning_fee)
if rate_of_interest:
interest_per_year = flt(outstanding_amount) * flt(rate_of_interest) / 100
interest_amount = (interest_per_year * cint(overdue_days)) / 365
grand_total = flt(outstanding_amount) + flt(interest_amount) + flt(dunning_fee)
interest_amount = (interest_per_year * cint(overdue_days)) / 365
grand_total += flt(interest_amount)
dunning_amount = flt(interest_amount) + flt(dunning_fee)
return {
'interest_amount': interest_amount,

View File

@@ -16,6 +16,7 @@ class TestDunning(unittest.TestCase):
@classmethod
def setUpClass(self):
create_dunning_type()
create_dunning_type_with_zero_interest_rate()
unlink_payment_on_cancel_of_invoice()
@classmethod
@@ -25,11 +26,20 @@ class TestDunning(unittest.TestCase):
def test_dunning(self):
dunning = create_dunning()
amounts = calculate_interest_and_amount(
dunning.posting_date, dunning.outstanding_amount, dunning.rate_of_interest, dunning.dunning_fee, dunning.overdue_days)
dunning.outstanding_amount, dunning.rate_of_interest, dunning.dunning_fee, dunning.overdue_days)
self.assertEqual(round(amounts.get('interest_amount'), 2), 0.44)
self.assertEqual(round(amounts.get('dunning_amount'), 2), 20.44)
self.assertEqual(round(amounts.get('grand_total'), 2), 120.44)
def test_dunning_with_zero_interest_rate(self):
dunning = create_dunning_with_zero_interest_rate()
amounts = calculate_interest_and_amount(
dunning.outstanding_amount, dunning.rate_of_interest, dunning.dunning_fee, dunning.overdue_days)
self.assertEqual(round(amounts.get('interest_amount'), 2), 0)
self.assertEqual(round(amounts.get('dunning_amount'), 2), 20)
self.assertEqual(round(amounts.get('grand_total'), 2), 120)
def test_gl_entries(self):
dunning = create_dunning()
dunning.submit()
@@ -42,9 +52,9 @@ class TestDunning(unittest.TestCase):
['Sales - _TC', 0.0, 20.44]
])
for gle in gl_entries:
self.assertEquals(expected_values[gle.account][0], gle.account)
self.assertEquals(expected_values[gle.account][1], gle.debit)
self.assertEquals(expected_values[gle.account][2], gle.credit)
self.assertEqual(expected_values[gle.account][0], gle.account)
self.assertEqual(expected_values[gle.account][1], gle.debit)
self.assertEqual(expected_values[gle.account][2], gle.credit)
def test_payment_entry(self):
dunning = create_dunning()
@@ -83,6 +93,27 @@ def create_dunning():
dunning.save()
return dunning
def create_dunning_with_zero_interest_rate():
posting_date = add_days(today(), -20)
due_date = add_days(today(), -15)
sales_invoice = create_sales_invoice_against_cost_center(
posting_date=posting_date, due_date=due_date, status='Overdue')
dunning_type = frappe.get_doc("Dunning Type", 'First Notice with 0% Rate of Interest')
dunning = frappe.new_doc("Dunning")
dunning.sales_invoice = sales_invoice.name
dunning.customer_name = sales_invoice.customer_name
dunning.outstanding_amount = sales_invoice.outstanding_amount
dunning.debit_to = sales_invoice.debit_to
dunning.currency = sales_invoice.currency
dunning.company = sales_invoice.company
dunning.posting_date = nowdate()
dunning.due_date = sales_invoice.due_date
dunning.dunning_type = 'First Notice with 0% Rate of Interest'
dunning.rate_of_interest = dunning_type.rate_of_interest
dunning.dunning_fee = dunning_type.dunning_fee
dunning.save()
return dunning
def create_dunning_type():
dunning_type = frappe.new_doc("Dunning Type")
dunning_type.dunning_type = 'First Notice'
@@ -98,3 +129,19 @@ def create_dunning_type():
}
)
dunning_type.save()
def create_dunning_type_with_zero_interest_rate():
dunning_type = frappe.new_doc("Dunning Type")
dunning_type.dunning_type = 'First Notice with 0% Rate of Interest'
dunning_type.start_day = 10
dunning_type.end_day = 20
dunning_type.dunning_fee = 20
dunning_type.rate_of_interest = 0
dunning_type.append(
"dunning_letter_text", {
'language': 'en',
'body_text': 'We have still not received payment for our invoice ',
'closing_text': 'We kindly request that you pay the outstanding amount immediately, and late fees.'
}
)
dunning_type.save()

View File

@@ -21,21 +21,17 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
refresh: function(frm) {
if(frm.doc.docstatus==1) {
frappe.db.get_value("Journal Entry Account", {
'reference_type': 'Exchange Rate Revaluation',
'reference_name': frm.doc.name,
'docstatus': 1
}, "sum(debit) as sum", (r) =>{
let total_amt = 0;
frm.doc.accounts.forEach(d=> {
total_amt = total_amt + d['new_balance_in_base_currency'];
});
if(total_amt !== r.sum) {
frm.add_custom_button(__('Journal Entry'), function() {
return frm.events.make_jv(frm);
}, __('Create'));
frappe.call({
method: 'check_journal_entry_condition',
doc: frm.doc,
callback: function(r) {
if (r.message) {
frm.add_custom_button(__('Journal Entry'), function() {
return frm.events.make_jv(frm);
}, __('Create'));
}
}
}, 'Journal Entry');
});
}
},

View File

@@ -27,6 +27,24 @@ class ExchangeRateRevaluation(Document):
if not (self.company and self.posting_date):
frappe.throw(_("Please select Company and Posting Date to getting entries"))
@frappe.whitelist()
def check_journal_entry_condition(self):
total_debit = frappe.db.get_value("Journal Entry Account", {
'reference_type': 'Exchange Rate Revaluation',
'reference_name': self.name,
'docstatus': 1
}, "sum(debit) as sum")
total_amt = 0
for d in self.accounts:
total_amt = total_amt + d.new_balance_in_base_currency
if total_amt != total_debit:
return True
return False
@frappe.whitelist()
def get_accounts_data(self, account=None):
accounts = []
self.validate_mandatory()
@@ -95,6 +113,7 @@ class ExchangeRateRevaluation(Document):
message = _("No outstanding invoices found")
frappe.msgprint(message)
@frappe.whitelist()
def make_jv_entry(self):
if self.total_gain_loss == 0:
return

View File

@@ -12,6 +12,7 @@ from frappe.model.document import Document
class FiscalYearIncorrectDate(frappe.ValidationError): pass
class FiscalYear(Document):
@frappe.whitelist()
def set_as_default(self):
frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.name)
global_defaults = frappe.get_doc("Global Defaults")
@@ -54,7 +55,7 @@ class FiscalYear(Document):
def on_update(self):
check_duplicate_fiscal_year(self)
frappe.cache().delete_value("fiscal_years")
def on_trash(self):
global_defaults = frappe.get_doc("Global Defaults")
if global_defaults.current_fiscal_year == self.name:

View File

@@ -75,8 +75,13 @@ class GLEntry(Document):
def pl_must_have_cost_center(self):
if frappe.get_cached_value("Account", self.account, "report_type") == "Profit and Loss":
if not self.cost_center and self.voucher_type != 'Period Closing Voucher':
frappe.throw(_("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}. Please set up a default Cost Center for the Company.")
.format(self.voucher_type, self.voucher_no, self.account))
msg = _("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}.").format(
self.voucher_type, self.voucher_no, self.account)
msg += " "
msg += _("Please set the cost center field in {0} or setup a default Cost Center for the Company.").format(
self.voucher_type)
frappe.throw(msg, title=_("Missing Cost Center"))
def validate_dimensions_for_pl_and_bs(self):
account_type = frappe.db.get_value("Account", self.account, "report_type")
@@ -116,8 +121,7 @@ class GLEntry(Document):
def check_pl_account(self):
if self.is_opening=='Yes' and \
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss" and \
self.voucher_type not in ['Purchase Invoice', 'Sales Invoice']:
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss":
frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry")
.format(self.voucher_type, self.voucher_no, self.account))
@@ -290,4 +294,8 @@ def rename_temporarily_named_docs(doctype):
oldname = doc.name
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
newname = doc.name
frappe.db.sql("""UPDATE `tab{}` SET name = %s, to_rename = 0 where name = %s""".format(doctype), (newname, oldname))
frappe.db.sql(
"UPDATE `tab{}` SET name = %s, to_rename = 0 where name = %s".format(doctype),
(newname, oldname),
auto_commit=True
)

View File

@@ -54,4 +54,4 @@ class TestGLEntry(unittest.TestCase):
self.assertTrue(all(new.name != old.name for new, old in zip(gl_entries, new_gl_entries)))
new_naming_series_current_value = frappe.db.sql("SELECT current from tabSeries where name = %s", naming_series)[0][0]
self.assertEquals(old_naming_series_current_value + 2, new_naming_series_current_value)
self.assertEqual(old_naming_series_current_value + 2, new_naming_series_current_value)

View File

@@ -1,196 +1,82 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2018-01-02 15:48:58.768352",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"actions": [],
"creation": "2018-01-02 15:48:58.768352",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"company",
"cgst_account",
"sgst_account",
"igst_account",
"cess_account",
"is_reverse_charge_account"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"columns": 1,
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cgst_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "CGST Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"columns": 2,
"fieldname": "cgst_account",
"fieldtype": "Link",
"in_list_view": 1,
"label": "CGST Account",
"options": "Account",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sgst_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "SGST Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"columns": 2,
"fieldname": "sgst_account",
"fieldtype": "Link",
"in_list_view": 1,
"label": "SGST Account",
"options": "Account",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "igst_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "IGST Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"columns": 2,
"fieldname": "igst_account",
"fieldtype": "Link",
"in_list_view": 1,
"label": "IGST Account",
"options": "Account",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cess_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "CESS Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"columns": 2,
"fieldname": "cess_account",
"fieldtype": "Link",
"in_list_view": 1,
"label": "CESS Account",
"options": "Account"
},
{
"columns": 1,
"default": "0",
"fieldname": "is_reverse_charge_account",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Is Reverse Charge Account"
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-01-02 15:52:22.335988",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GST Account",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-04-09 12:30:25.889993",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GST Account",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}

View File

@@ -42,18 +42,18 @@ class InvoiceDiscounting(AccountsController):
record.idx, frappe.bold(actual_outstanding), frappe.bold(record.sales_invoice)))
def calculate_total_amount(self):
self.total_amount = sum([flt(d.outstanding_amount) for d in self.invoices])
self.total_amount = sum(flt(d.outstanding_amount) for d in self.invoices)
def on_submit(self):
self.update_sales_invoice()
self.make_gl_entries()
def on_cancel(self):
self.set_status()
self.set_status(cancel=1)
self.update_sales_invoice()
self.make_gl_entries()
def set_status(self, status=None):
def set_status(self, status=None, cancel=0):
if status:
self.status = status
self.db_set("status", status)
@@ -66,6 +66,9 @@ class InvoiceDiscounting(AccountsController):
elif self.docstatus == 2:
self.status = "Cancelled"
if cancel:
self.db_set('status', self.status, update_modified = True)
def update_sales_invoice(self):
for d in self.invoices:
if self.docstatus == 1:
@@ -125,6 +128,7 @@ class InvoiceDiscounting(AccountsController):
make_gl_entries(gl_entries, cancel=(self.docstatus == 2), update_outstanding='No')
@frappe.whitelist()
def create_disbursement_entry(self):
je = frappe.new_doc("Journal Entry")
je.voucher_type = 'Journal Entry'
@@ -174,6 +178,7 @@ class InvoiceDiscounting(AccountsController):
return je
@frappe.whitelist()
def close_loan(self):
je = frappe.new_doc("Journal Entry")
je.voucher_type = 'Journal Entry'

View File

@@ -327,18 +327,16 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
},
setup_balance_formatter: function() {
var me = this;
$.each(["balance", "party_balance"], function(i, field) {
var df = frappe.meta.get_docfield("Journal Entry Account", field, me.frm.doc.name);
df.formatter = function(value, df, options, doc) {
var currency = frappe.meta.get_field_currency(df, doc);
var dr_or_cr = value ? ('<label>' + (value > 0.0 ? __("Dr") : __("Cr")) + '</label>') : "";
return "<div style='text-align: right'>"
+ ((value==null || value==="") ? "" : format_currency(Math.abs(value), currency))
+ " " + dr_or_cr
+ "</div>";
}
})
const formatter = function(value, df, options, doc) {
var currency = frappe.meta.get_field_currency(df, doc);
var dr_or_cr = value ? ('<label>' + (value > 0.0 ? __("Dr") : __("Cr")) + '</label>') : "";
return "<div style='text-align: right'>"
+ ((value==null || value==="") ? "" : format_currency(Math.abs(value), currency))
+ " " + dr_or_cr
+ "</div>";
};
this.frm.fields_dict.accounts.grid.update_docfield_property('balance', 'formatter', formatter);
this.frm.fields_dict.accounts.grid.update_docfield_property('party_balance', 'formatter', formatter);
},
reference_name: function(doc, cdt, cdn) {
@@ -431,15 +429,6 @@ cur_frm.cscript.validate = function(doc,cdt,cdn) {
cur_frm.cscript.update_totals(doc);
}
cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
if(doc.select_print_heading){
// print heading
cur_frm.pformat.print_heading = doc.select_print_heading;
}
else
cur_frm.pformat.print_heading = __("Journal Entry");
}
frappe.ui.form.on("Journal Entry Account", {
party: function(frm, cdt, cdn) {
var d = frappe.get_doc(cdt, cdn);
@@ -511,8 +500,11 @@ $.extend(erpnext.journal_entry, {
};
$.each(field_label_map, function (fieldname, label) {
var df = frappe.meta.get_docfield("Journal Entry Account", fieldname, frm.doc.name);
df.label = frm.doc.multi_currency ? (label + " in Account Currency") : label;
frm.fields_dict.accounts.grid.update_docfield_property(
fieldname,
'label',
frm.doc.multi_currency ? (label + " in Account Currency") : label
);
})
},

View File

@@ -39,7 +39,11 @@ class JournalEntry(AccountsController):
self.validate_multi_currency()
self.set_amounts_in_company_currency()
self.validate_debit_credit_amount()
self.validate_total_debit_and_credit()
# Do not validate while importing via data import
if not frappe.flags.in_import:
self.validate_total_debit_and_credit()
self.validate_against_jv()
self.validate_reference_doc()
self.set_against_account()
@@ -192,8 +196,8 @@ class JournalEntry(AccountsController):
frappe.throw(_("Row {0}: Party Type and Party is required for Receivable / Payable account {1}").format(d.idx, d.account))
def check_credit_limit(self):
customers = list(set([d.party for d in self.get("accounts")
if d.party_type=="Customer" and d.party and flt(d.debit) > 0]))
customers = list(set(d.party for d in self.get("accounts")
if d.party_type=="Customer" and d.party and flt(d.debit) > 0))
if customers:
from erpnext.selling.doctype.customer.customer import check_credit_limit
for customer in customers:
@@ -564,6 +568,7 @@ class JournalEntry(AccountsController):
if gl_map:
make_gl_entries(gl_map, cancel=cancel, adv_adj=adv_adj, update_outstanding=update_outstanding)
@frappe.whitelist()
def get_balance(self):
if not self.get('accounts'):
msgprint(_("'Entries' cannot be empty"), raise_exception=True)
@@ -591,6 +596,7 @@ class JournalEntry(AccountsController):
self.validate_total_debit_and_credit()
@frappe.whitelist()
def get_outstanding_invoices(self):
self.set('accounts', [])
total = 0

View File

@@ -0,0 +1,17 @@
frappe.ui.form.on("Journal Entry", {
refresh: function(frm) {
frm.set_query('company_address', function(doc) {
if(!doc.company) {
frappe.throw(__('Please set Company'));
}
return {
query: 'frappe.contacts.doctype.address.address.address_query',
filters: {
link_doctype: 'Company',
link_name: doc.company
}
};
});
}
});

View File

@@ -8,6 +8,7 @@ from frappe.utils import (flt, add_months)
from frappe.model.document import Document
class MonthlyDistribution(Document):
@frappe.whitelist()
def get_months(self):
month_list = ['January','February','March','April','May','June','July','August','September',
'October','November','December']
@@ -20,7 +21,7 @@ class MonthlyDistribution(Document):
idx += 1
def validate(self):
total = sum([flt(d.percentage_allocation) for d in self.get("percentages")])
total = sum(flt(d.percentage_allocation) for d in self.get("percentages"))
if flt(total, 2) != 100.0:
frappe.throw(_("Percentage Allocation should be equal to 100%") + \

View File

@@ -167,6 +167,7 @@ class OpeningInvoiceCreationTool(Document):
return invoice
@frappe.whitelist()
def make_invoices(self):
self.validate_company()
invoices = self.get_invoices()

View File

@@ -6,10 +6,12 @@ from __future__ import unicode_literals
import frappe
import unittest
test_dependencies = ["Customer", "Supplier"]
from frappe.cache_manager import clear_doctype_cache
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
from erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool import get_temporary_opening_account
test_dependencies = ["Customer", "Supplier"]
class TestOpeningInvoiceCreationTool(unittest.TestCase):
def setUp(self):
if not frappe.db.exists("Company", "_Test Opening Invoice Company"):
@@ -24,22 +26,25 @@ class TestOpeningInvoiceCreationTool(unittest.TestCase):
def test_opening_sales_invoice_creation(self):
property_setter = make_property_setter("Sales Invoice", "update_stock", "default", 1, "Check")
invoices = self.make_invoices(company="_Test Opening Invoice Company")
try:
invoices = self.make_invoices(company="_Test Opening Invoice Company")
self.assertEqual(len(invoices), 2)
expected_value = {
"keys": ["customer", "outstanding_amount", "status"],
0: ["_Test Customer", 300, "Overdue"],
1: ["_Test Customer 1", 250, "Overdue"],
}
self.check_expected_values(invoices, expected_value)
self.assertEqual(len(invoices), 2)
expected_value = {
"keys": ["customer", "outstanding_amount", "status"],
0: ["_Test Customer", 300, "Overdue"],
1: ["_Test Customer 1", 250, "Overdue"],
}
self.check_expected_values(invoices, expected_value)
si = frappe.get_doc("Sales Invoice", invoices[0])
si = frappe.get_doc("Sales Invoice", invoices[0])
# Check if update stock is not enabled
self.assertEqual(si.update_stock, 0)
# Check if update stock is not enabled
self.assertEqual(si.update_stock, 0)
property_setter.delete()
finally:
property_setter.delete()
clear_doctype_cache("Sales Invoice")
def check_expected_values(self, invoices, expected_value, invoice_type="Sales"):
doctype = "Sales Invoice" if invoice_type == "Sales" else "Purchase Invoice"
@@ -143,4 +148,4 @@ def make_customer(customer=None):
customer.insert(ignore_permissions=True)
return customer.name
else:
return frappe.db.exists("Customer", customer_name)
return frappe.db.exists("Customer", customer_name)

View File

@@ -1,87 +1,39 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2014-08-29 16:02:39.740505",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"actions": [],
"creation": "2014-08-29 16:02:39.740505",
"doctype": "DocType",
"editable_grid": 1,
"field_order": [
"company",
"account"
],
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"reqd": 1
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"fieldname": "account",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Account",
"options": "Account"
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:03.348246",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Party Account",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_seen": 0
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-04-07 18:13:08.833822",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Party Account",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
}

View File

@@ -3,6 +3,8 @@
{% include "erpnext/public/js/controllers/accounts.js" %}
frappe.provide("erpnext.accounts.dimensions");
cur_frm.cscript.tax_table = "Advance Taxes and Charges";
frappe.ui.form.on('Payment Entry', {
onload: function(frm) {
if(frm.doc.__islocal) {
@@ -91,6 +93,16 @@ frappe.ui.form.on('Payment Entry', {
}
});
frm.set_query("advance_tax_account", function() {
return {
filters: {
"company": frm.doc.company,
"root_type": ["in", ["Asset", "Liability"]],
"is_group": 0
}
}
});
frm.set_query("reference_doctype", "references", function() {
if (frm.doc.party_type == "Customer") {
var doctypes = ["Sales Order", "Sales Invoice", "Journal Entry", "Dunning"];
@@ -182,6 +194,8 @@ frappe.ui.form.on('Payment Entry', {
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
frm.toggle_display("base_total_taxes_and_charges", frm.doc.total_taxes_and_charges &&
(frm.doc.paid_from_account_currency != company_currency));
frm.toggle_display("base_received_amount", (
frm.doc.paid_to_account_currency != company_currency
@@ -216,7 +230,7 @@ frappe.ui.form.on('Payment Entry', {
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount",
"difference_amount"], company_currency);
"difference_amount", "base_paid_amount_after_tax", "base_received_amount_after_tax"], company_currency);
frm.set_currency_labels(["paid_amount"], frm.doc.paid_from_account_currency);
frm.set_currency_labels(["received_amount"], frm.doc.paid_to_account_currency);
@@ -224,11 +238,13 @@ frappe.ui.form.on('Payment Entry', {
var party_account_currency = frm.doc.payment_type=="Receive" ?
frm.doc.paid_from_account_currency : frm.doc.paid_to_account_currency;
frm.set_currency_labels(["total_allocated_amount", "unallocated_amount"], party_account_currency);
frm.set_currency_labels(["total_allocated_amount", "unallocated_amount",
"total_taxes_and_charges"], party_account_currency);
var currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency"
frm.set_df_property("total_allocated_amount", "options", currency_field);
frm.set_df_property("unallocated_amount", "options", currency_field);
frm.set_df_property("total_taxes_and_charges", "options", currency_field);
frm.set_df_property("party_balance", "options", currency_field);
frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
@@ -364,6 +380,16 @@ frappe.ui.form.on('Payment Entry', {
}
},
apply_tax_withholding_amount: function(frm) {
if (!frm.doc.apply_tax_withholding_amount) {
frm.set_value("tax_withholding_category", '');
} else {
frappe.db.get_value('Supplier', frm.doc.party, 'tax_withholding_category', (values) => {
frm.set_value("tax_withholding_category", values.tax_withholding_category);
});
}
},
paid_from: function(frm) {
if(frm.set_party_account_based_on_party) return;
@@ -561,7 +587,7 @@ frappe.ui.form.on('Payment Entry', {
flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate));
if(frm.doc.payment_type == "Pay")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount, 1);
else
frm.events.set_unallocated_amount(frm);
@@ -582,7 +608,7 @@ frappe.ui.form.on('Payment Entry', {
}
if(frm.doc.payment_type == "Receive")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount);
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount, 1);
else
frm.events.set_unallocated_amount(frm);
},
@@ -606,9 +632,9 @@ frappe.ui.form.on('Payment Entry', {
{fieldtype:"Float", label: __("Less Than Amount"), fieldname:"outstanding_amt_less_than"},
{fieldtype:"Section Break"},
{fieldtype:"Link", label:__("Cost Center"), fieldname:"cost_center", options:"Cost Center",
"get_query": function() {
return {
"filters": {"company": frm.doc.company}
"get_query": function() {
return {
"filters": {"company": frm.doc.company}
}
}
},
@@ -743,7 +769,7 @@ frappe.ui.form.on('Payment Entry', {
});
},
allocate_party_amount_against_ref_docs: function(frm, paid_amount) {
allocate_party_amount_against_ref_docs: function(frm, paid_amount, paid_amount_change) {
var total_positive_outstanding_including_order = 0;
var total_negative_outstanding = 0;
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
@@ -800,22 +826,15 @@ frappe.ui.form.on('Payment Entry', {
//If allocate payment amount checkbox is unchecked, set zero to allocate amount
row.allocated_amount = 0;
} else if (frappe.flags.allocate_payment_amount != 0 && !row.allocated_amount) {
if (row.outstanding_amount > 0 && allocated_positive_outstanding > 0) {
if (row.outstanding_amount >= allocated_positive_outstanding) {
row.allocated_amount = allocated_positive_outstanding;
} else {
row.allocated_amount = row.outstanding_amount;
}
} else if (frappe.flags.allocate_payment_amount != 0 && (!row.allocated_amount || paid_amount_change)) {
if (row.outstanding_amount > 0 && allocated_positive_outstanding >= 0) {
row.allocated_amount = (row.outstanding_amount >= allocated_positive_outstanding) ?
allocated_positive_outstanding : row.outstanding_amount;
allocated_positive_outstanding -= flt(row.allocated_amount);
} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
if (Math.abs(row.outstanding_amount) >= allocated_negative_outstanding) {
row.allocated_amount = -1*allocated_negative_outstanding;
} else {
row.allocated_amount = row.outstanding_amount;
};
} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
row.allocated_amount = (Math.abs(row.outstanding_amount) >= allocated_negative_outstanding) ?
-1*allocated_negative_outstanding : row.outstanding_amount;
allocated_negative_outstanding -= Math.abs(flt(row.allocated_amount));
}
}
@@ -850,12 +869,12 @@ frappe.ui.form.on('Payment Entry', {
if(frm.doc.payment_type == "Receive"
&& frm.doc.base_total_allocated_amount < frm.doc.base_received_amount + total_deductions
&& frm.doc.total_allocated_amount < frm.doc.paid_amount + (total_deductions / frm.doc.source_exchange_rate)) {
unallocated_amount = (frm.doc.base_received_amount + total_deductions
- frm.doc.base_total_allocated_amount) / frm.doc.source_exchange_rate;
unallocated_amount = (frm.doc.base_received_amount + total_deductions + frm.doc.base_total_taxes_and_charges
+ frm.doc.base_total_allocated_amount) / frm.doc.source_exchange_rate;
} else if (frm.doc.payment_type == "Pay"
&& frm.doc.base_total_allocated_amount < frm.doc.base_paid_amount - total_deductions
&& frm.doc.total_allocated_amount < frm.doc.received_amount + (total_deductions / frm.doc.target_exchange_rate)) {
unallocated_amount = (frm.doc.base_paid_amount - (total_deductions
unallocated_amount = (frm.doc.base_paid_amount + frm.doc.base_total_taxes_and_charges - (total_deductions
+ frm.doc.base_total_allocated_amount)) / frm.doc.target_exchange_rate;
}
}
@@ -881,7 +900,8 @@ frappe.ui.form.on('Payment Entry', {
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
function(d) { return flt(d.amount) }));
frm.set_value("difference_amount", difference_amount - total_deductions);
frm.set_value("difference_amount", difference_amount - total_deductions +
frm.doc.base_total_taxes_and_charges);
frm.events.hide_unhide_fields(frm);
},
@@ -1009,7 +1029,266 @@ frappe.ui.form.on('Payment Entry', {
}
});
}
}
},
sales_taxes_and_charges_template: function(frm) {
frm.trigger('fetch_taxes_from_template');
},
purchase_taxes_and_charges_template: function(frm) {
frm.trigger('fetch_taxes_from_template');
},
fetch_taxes_from_template: function(frm) {
let master_doctype = '';
let taxes_and_charges = '';
if (frm.doc.party_type == 'Supplier') {
master_doctype = 'Purchase Taxes and Charges Template';
taxes_and_charges = frm.doc.purchase_taxes_and_charges_template;
} else if (frm.doc.party_type == 'Customer') {
master_doctype = 'Sales Taxes and Charges Template';
taxes_and_charges = frm.doc.sales_taxes_and_charges_template;
}
if (!taxes_and_charges) {
return;
}
frappe.call({
method: "erpnext.controllers.accounts_controller.get_taxes_and_charges",
args: {
"master_doctype": master_doctype,
"master_name": taxes_and_charges
},
callback: function(r) {
if(!r.exc && r.message) {
// set taxes table
if(r.message) {
for (let tax of r.message) {
if (tax.charge_type === 'On Net Total') {
tax.charge_type = 'On Paid Amount';
}
me.frm.add_child("taxes", tax);
}
frm.events.apply_taxes(frm);
frm.events.set_unallocated_amount(frm);
}
}
}
});
},
apply_taxes: function(frm) {
frm.events.initialize_taxes(frm);
frm.events.determine_exclusive_rate(frm);
frm.events.calculate_taxes(frm);
},
initialize_taxes: function(frm) {
$.each(frm.doc["taxes"] || [], function(i, tax) {
frm.events.validate_taxes_and_charges(tax);
frm.events.validate_inclusive_tax(tax);
tax.item_wise_tax_detail = {};
let tax_fields = ["total", "tax_fraction_for_current_item",
"grand_total_fraction_for_current_item"];
if (cstr(tax.charge_type) != "Actual") {
tax_fields.push("tax_amount");
}
$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; });
frm.doc.paid_amount_after_tax = frm.doc.paid_amount;
});
},
validate_taxes_and_charges: function(d) {
let msg = "";
if (d.account_head && !d.description) {
// set description from account head
d.description = d.account_head.split(' - ').slice(0, -1).join(' - ');
}
if (!d.charge_type && (d.row_id || d.rate || d.tax_amount)) {
msg = __("Please select Charge Type first");
d.row_id = "";
d.rate = d.tax_amount = 0.0;
} else if ((d.charge_type == 'Actual' || d.charge_type == 'On Net Total' || d.charge_type == 'On Paid Amount') && d.row_id) {
msg = __("Can refer row only if the charge type is 'On Previous Row Amount' or 'Previous Row Total'");
d.row_id = "";
} else if ((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id) {
if (d.idx == 1) {
msg = __("Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row");
d.charge_type = '';
} else if (!d.row_id) {
msg = __("Please specify a valid Row ID for row {0} in table {1}", [d.idx, __(d.doctype)]);
d.row_id = "";
} else if (d.row_id && d.row_id >= d.idx) {
msg = __("Cannot refer row number greater than or equal to current row number for this Charge type");
d.row_id = "";
}
}
if (msg) {
frappe.validated = false;
refresh_field("taxes");
frappe.throw(msg);
}
},
validate_inclusive_tax: function(tax) {
let actual_type_error = function() {
let msg = __("Actual type tax cannot be included in Item rate in row {0}", [tax.idx])
frappe.throw(msg);
};
let on_previous_row_error = function(row_range) {
let msg = __("For row {0} in {1}. To include {2} in Item rate, rows {3} must also be included",
[tax.idx, __(tax.doctype), tax.charge_type, row_range])
frappe.throw(msg);
};
if(cint(tax.included_in_paid_amount)) {
if(tax.charge_type == "Actual") {
// inclusive tax cannot be of type Actual
actual_type_error();
} else if(tax.charge_type == "On Previous Row Amount" &&
!cint(this.frm.doc["taxes"][tax.row_id - 1].included_in_paid_amount)
) {
// referred row should also be an inclusive tax
on_previous_row_error(tax.row_id);
} else if(tax.charge_type == "On Previous Row Total") {
let taxes_not_included = $.map(this.frm.doc["taxes"].slice(0, tax.row_id),
function(t) { return cint(t.included_in_paid_amount) ? null : t; });
if(taxes_not_included.length > 0) {
// all rows above this tax should be inclusive
on_previous_row_error(tax.row_id == 1 ? "1" : "1 - " + tax.row_id);
}
}
}
},
determine_exclusive_rate: function(frm) {
let has_inclusive_tax = false;
$.each(frm.doc["taxes"] || [], function(i, row) {
if(cint(row.included_in_paid_amount)) has_inclusive_tax = true;
});
if(has_inclusive_tax==false) return;
let cumulated_tax_fraction = 0.0;
$.each(frm.doc["taxes"] || [], function(i, tax) {
tax.tax_fraction_for_current_item = frm.events.get_current_tax_fraction(frm, tax);
if(i==0) {
tax.grand_total_fraction_for_current_item = 1 + tax.tax_fraction_for_current_item;
} else {
tax.grand_total_fraction_for_current_item =
me.frm.doc["taxes"][i-1].grand_total_fraction_for_current_item +
tax.tax_fraction_for_current_item;
}
cumulated_tax_fraction += tax.tax_fraction_for_current_item;
frm.doc.paid_amount_after_tax = flt(frm.doc.paid_amount/(1+cumulated_tax_fraction))
});
},
get_current_tax_fraction: function(frm, tax) {
let current_tax_fraction = 0.0;
if(cint(tax.included_in_paid_amount)) {
let tax_rate = tax.rate;
if(tax.charge_type == "On Paid Amount") {
current_tax_fraction = (tax_rate / 100.0);
} else if(tax.charge_type == "On Previous Row Amount") {
current_tax_fraction = (tax_rate / 100.0) *
frm.doc["taxes"][cint(tax.row_id) - 1].tax_fraction_for_current_item;
} else if(tax.charge_type == "On Previous Row Total") {
current_tax_fraction = (tax_rate / 100.0) *
frm.doc["taxes"][cint(tax.row_id) - 1].grand_total_fraction_for_current_item;
}
}
if(tax.add_deduct_tax && tax.add_deduct_tax == "Deduct") {
current_tax_fraction *= -1;
}
return current_tax_fraction;
},
calculate_taxes: function(frm) {
frm.doc.total_taxes_and_charges = 0.0;
frm.doc.base_total_taxes_and_charges = 0.0;
let actual_tax_dict = {};
// maintain actual tax rate based on idx
$.each(frm.doc["taxes"] || [], function(i, tax) {
if (tax.charge_type == "Actual") {
actual_tax_dict[tax.idx] = flt(tax.tax_amount, precision("tax_amount", tax));
}
});
$.each(me.frm.doc["taxes"] || [], function(i, tax) {
let current_tax_amount = frm.events.get_current_tax_amount(frm, tax);
// Adjust divisional loss to the last item
if (tax.charge_type == "Actual") {
actual_tax_dict[tax.idx] -= current_tax_amount;
if (i == frm.doc["taxes"].length - 1) {
current_tax_amount += actual_tax_dict[tax.idx];
}
}
tax.tax_amount = current_tax_amount;
tax.base_tax_amount = tax.tax_amount * frm.doc.source_exchange_rate;
current_tax_amount *= (tax.add_deduct_tax == "Deduct") ? -1.0 : 1.0;
if(i==0) {
tax.total = flt(frm.doc.paid_amount_after_tax + current_tax_amount, precision("total", tax));
} else {
tax.total = flt(frm.doc["taxes"][i-1].total + current_tax_amount, precision("total", tax));
}
tax.base_total = tax.total * frm.doc.source_exchange_rate;
frm.doc.total_taxes_and_charges += current_tax_amount;
frm.doc.base_total_taxes_and_charges += current_tax_amount * frm.doc.source_exchange_rate;
frm.refresh_field('taxes');
frm.refresh_field('total_taxes_and_charges');
frm.refresh_field('base_total_taxes_and_charges');
});
},
get_current_tax_amount: function(frm, tax) {
let tax_rate = tax.rate;
let current_tax_amount = 0.0;
// To set row_id by default as previous row.
if(["On Previous Row Amount", "On Previous Row Total"].includes(tax.charge_type)) {
if (tax.idx === 1) {
frappe.throw(
__("Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
}
}
if(tax.charge_type == "Actual") {
current_tax_amount = flt(tax.tax_amount, precision("tax_amount", tax))
} else if(tax.charge_type == "On Paid Amount") {
current_tax_amount = flt((tax_rate / 100.0) * frm.doc.paid_amount_after_tax);
} else if(tax.charge_type == "On Previous Row Amount") {
current_tax_amount = flt((tax_rate / 100.0) *
frm.doc["taxes"][cint(tax.row_id) - 1].tax_amount);
} else if(tax.charge_type == "On Previous Row Total") {
current_tax_amount = flt((tax_rate / 100.0) *
frm.doc["taxes"][cint(tax.row_id) - 1].total);
}
return current_tax_amount;
},
});
@@ -1056,6 +1335,38 @@ frappe.ui.form.on('Payment Entry Reference', {
}
})
frappe.ui.form.on('Advance Taxes and Charges', {
rate: function(frm) {
frm.events.apply_taxes(frm);
frm.events.set_unallocated_amount(frm);
},
tax_amount : function(frm) {
frm.events.apply_taxes(frm);
frm.events.set_unallocated_amount(frm);
},
row_id: function(frm) {
frm.events.apply_taxes(frm);
frm.events.set_unallocated_amount(frm);
},
taxes_remove: function(frm) {
frm.events.apply_taxes(frm);
frm.events.set_unallocated_amount(frm);
},
included_in_paid_amount: function(frm) {
frm.events.apply_taxes(frm);
frm.events.set_unallocated_amount(frm);
},
charge_type: function(frm) {
frm.events.apply_taxes(frm);
frm.events.set_unallocated_amount(frm);
}
})
frappe.ui.form.on('Payment Entry Deduction', {
amount: function(frm) {
frm.events.set_unallocated_amount(frm);

View File

@@ -35,12 +35,16 @@
"paid_to_account_balance",
"payment_amounts_section",
"paid_amount",
"paid_amount_after_tax",
"source_exchange_rate",
"base_paid_amount",
"base_paid_amount_after_tax",
"column_break_21",
"received_amount",
"received_amount_after_tax",
"target_exchange_rate",
"base_received_amount",
"base_received_amount_after_tax",
"section_break_14",
"get_outstanding_invoice",
"references",
@@ -52,6 +56,17 @@
"unallocated_amount",
"difference_amount",
"write_off_difference_amount",
"taxes_and_charges_section",
"purchase_taxes_and_charges_template",
"sales_taxes_and_charges_template",
"advance_tax_account",
"column_break_55",
"apply_tax_withholding_amount",
"tax_withholding_category",
"section_break_56",
"taxes",
"base_total_taxes_and_charges",
"total_taxes_and_charges",
"deductions_or_loss_section",
"deductions",
"transaction_references",
@@ -320,6 +335,7 @@
"reqd": 1
},
{
"depends_on": "doc.received_amount",
"fieldname": "base_received_amount",
"fieldtype": "Currency",
"label": "Received Amount (Company Currency)",
@@ -584,12 +600,119 @@
"fieldname": "custom_remarks",
"fieldtype": "Check",
"label": "Custom Remarks"
},
{
"depends_on": "eval:doc.apply_tax_withholding_amount",
"fieldname": "tax_withholding_category",
"fieldtype": "Link",
"label": "Tax Withholding Category",
"mandatory_depends_on": "eval:doc.apply_tax_withholding_amount",
"options": "Tax Withholding Category"
},
{
"default": "0",
"depends_on": "eval:doc.party_type == 'Supplier'",
"fieldname": "apply_tax_withholding_amount",
"fieldtype": "Check",
"label": "Apply Tax Withholding Amount"
},
{
"collapsible": 1,
"fieldname": "taxes_and_charges_section",
"fieldtype": "Section Break",
"label": "Taxes and Charges"
},
{
"depends_on": "eval:doc.party_type == 'Supplier'",
"fieldname": "purchase_taxes_and_charges_template",
"fieldtype": "Link",
"label": "Taxes and Charges Template",
"options": "Purchase Taxes and Charges Template"
},
{
"depends_on": "eval: doc.party_type == 'Customer'",
"fieldname": "sales_taxes_and_charges_template",
"fieldtype": "Link",
"label": "Taxes and Charges Template",
"options": "Sales Taxes and Charges Template"
},
{
"depends_on": "eval: doc.party_type == 'Supplier' || doc.party_type == 'Customer'",
"fieldname": "taxes",
"fieldtype": "Table",
"label": "Advance Taxes and Charges",
"options": "Advance Taxes and Charges"
},
{
"fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
"label": "Total Taxes and Charges (Company Currency)",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"label": "Total Taxes and Charges",
"read_only": 1
},
{
"fieldname": "paid_amount_after_tax",
"fieldtype": "Currency",
"hidden": 1,
"label": "Paid Amount After Tax",
"options": "paid_from_account_currency",
"read_only": 1
},
{
"fieldname": "base_paid_amount_after_tax",
"fieldtype": "Currency",
"hidden": 1,
"label": "Paid Amount After Tax (Company Currency)",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"fieldname": "column_break_55",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_56",
"fieldtype": "Section Break",
"hide_border": 1
},
{
"depends_on": "eval:doc.apply_tax_withholding_amount",
"description": "Provisional tax account for advance tax. Taxes are parked in this account until payments are allocated to invoices",
"fieldname": "advance_tax_account",
"fieldtype": "Link",
"label": "Advance Tax Account",
"mandatory_depends_on": "eval:doc.apply_tax_withholding_amount",
"options": "Account"
},
{
"depends_on": "eval:doc.received_amount && doc.payment_type != 'Internal Transfer'",
"fieldname": "received_amount_after_tax",
"fieldtype": "Currency",
"hidden": 1,
"label": "Received Amount After Tax",
"options": "paid_to_account_currency",
"read_only": 1
},
{
"depends_on": "doc.received_amount",
"fieldname": "base_received_amount_after_tax",
"fieldtype": "Currency",
"hidden": 1,
"label": "Received Amount After Tax (Company Currency)",
"options": "Company:company:default_currency",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-03-08 13:05:16.958866",
"modified": "2021-07-09 08:58:15.008761",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
@@ -633,4 +756,4 @@
"sort_order": "DESC",
"title_field": "title",
"track_changes": 1
}
}

View File

@@ -4,8 +4,8 @@
from __future__ import unicode_literals
import frappe, erpnext, json
from frappe import _, scrub, ValidationError
from frappe.utils import flt, comma_or, nowdate, getdate
from frappe import _, scrub, ValidationError, throw
from frappe.utils import flt, comma_or, nowdate, getdate, cint
from erpnext.accounts.utils import get_outstanding_invoices, get_account_currency, get_balance_on
from erpnext.accounts.party import get_party_account
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
@@ -15,9 +15,11 @@ from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amo
from erpnext.accounts.doctype.bank_account.bank_account import get_party_bank_account, get_bank_account_details
from erpnext.controllers.accounts_controller import AccountsController, get_supplier_block_status
from erpnext.accounts.doctype.invoice_discounting.invoice_discounting import get_party_account_based_on_invoice_discounting
from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import get_party_tax_withholding_details
from six import string_types, iteritems
from erpnext.controllers.accounts_controller import validate_taxes_and_charges
class InvalidPaymentEntry(ValidationError):
pass
@@ -52,6 +54,8 @@ class PaymentEntry(AccountsController):
self.set_exchange_rate()
self.validate_mandatory()
self.validate_reference_documents()
self.set_tax_withholding()
self.apply_taxes()
self.set_amounts()
self.clear_unallocated_reference_document_rows()
self.validate_payment_against_negative_invoice()
@@ -65,7 +69,6 @@ class PaymentEntry(AccountsController):
self.set_status()
def on_submit(self):
self.setup_party_account_field()
if self.difference_amount:
frappe.throw(_("Difference Amount must be zero"))
self.make_gl_entries()
@@ -78,7 +81,6 @@ class PaymentEntry(AccountsController):
def on_cancel(self):
self.ignore_linked_doctypes = ('GL Entry', 'Stock Ledger Entry')
self.setup_party_account_field()
self.make_gl_entries(cancel=1)
self.update_outstanding_amounts()
self.update_advance_paid()
@@ -122,6 +124,11 @@ class PaymentEntry(AccountsController):
if flt(d.allocated_amount) > flt(d.outstanding_amount):
frappe.throw(_("Row #{0}: Allocated Amount cannot be greater than outstanding amount.").format(d.idx))
# Check for negative outstanding invoices as well
if flt(d.allocated_amount) < 0:
if flt(d.allocated_amount) < flt(d.outstanding_amount):
frappe.throw(_("Row #{0}: Allocated Amount cannot be greater than outstanding amount.").format(d.idx))
def delink_advance_entry_references(self):
for reference in self.references:
if reference.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
@@ -177,7 +184,7 @@ class PaymentEntry(AccountsController):
for field, value in iteritems(ref_details):
if field == 'exchange_rate' or not d.get(field) or force:
d.set(field, value)
d.db_set(field, value)
def validate_payment_type(self):
if self.payment_type not in ("Receive", "Pay", "Internal Transfer"):
@@ -303,11 +310,10 @@ class PaymentEntry(AccountsController):
for k, v in no_oustanding_refs.items():
frappe.msgprint(
_("{} - {} now have {} as they had no outstanding amount left before submitting the Payment Entry.")
.format(k, frappe.bold(", ".join([d.reference_name for d in v])), frappe.bold("negative outstanding amount"))
.format(k, frappe.bold(", ".join(d.reference_name for d in v)), frappe.bold("negative outstanding amount"))
+ "<br><br>" + _("If this is undesirable please cancel the corresponding Payment Entry."),
title=_("Warning"), indicator="orange")
def validate_journal_entry(self):
for d in self.get("references"):
if d.allocated_amount and d.reference_doctype == "Journal Entry":
@@ -386,12 +392,104 @@ class PaymentEntry(AccountsController):
else:
self.status = 'Draft'
self.db_set('status', self.status, update_modified = True)
def set_tax_withholding(self):
if not self.party_type == 'Supplier':
return
if not self.apply_tax_withholding_amount:
return
if not self.advance_tax_account:
frappe.throw(_("Advance TDS account is mandatory for advance TDS deduction"))
net_total = self.paid_amount
for reference in self.get("references"):
net_total_for_tds = 0
if reference.reference_doctype == 'Purchase Order':
net_total_for_tds += flt(frappe.db.get_value('Purchase Order', reference.reference_name, 'net_total'))
if net_total_for_tds:
net_total = net_total_for_tds
# Adding args as purchase invoice to get TDS amount
args = frappe._dict({
'company': self.company,
'doctype': 'Purchase Invoice',
'supplier': self.party,
'posting_date': self.posting_date,
'net_total': net_total
})
tax_withholding_details = get_party_tax_withholding_details(args, self.tax_withholding_category)
if not tax_withholding_details:
return
tax_withholding_details.update({
'add_deduct_tax': 'Add',
'cost_center': self.cost_center or erpnext.get_default_cost_center(self.company)
})
accounts = []
for d in self.taxes:
if d.account_head == tax_withholding_details.get("account_head"):
# Preserve user updated included in paid amount
if d.included_in_paid_amount:
tax_withholding_details.update({'included_in_paid_amount': d.included_in_paid_amount})
d.update(tax_withholding_details)
accounts.append(d.account_head)
if not accounts or tax_withholding_details.get("account_head") not in accounts:
self.append("taxes", tax_withholding_details)
to_remove = [d for d in self.taxes
if not d.tax_amount and d.account_head == tax_withholding_details.get("account_head")]
for d in to_remove:
self.remove(d)
def apply_taxes(self):
self.initialize_taxes()
self.determine_exclusive_rate()
self.calculate_taxes()
def set_amounts(self):
self.set_received_amount()
self.set_amounts_in_company_currency()
self.set_amounts_after_tax()
self.set_total_allocated_amount()
self.set_unallocated_amount()
self.set_difference_amount()
def set_received_amount(self):
self.base_received_amount = self.base_paid_amount
def set_amounts_after_tax(self):
applicable_tax = 0
base_applicable_tax = 0
for tax in self.get('taxes'):
if not tax.included_in_paid_amount:
amount = -1 * tax.tax_amount if tax.add_deduct_tax == 'Deduct' else tax.tax_amount
base_amount = -1 * tax.base_tax_amount if tax.add_deduct_tax == 'Deduct' else tax.base_tax_amount
applicable_tax += amount
base_applicable_tax += base_amount
self.paid_amount_after_tax = flt(flt(self.paid_amount) + flt(applicable_tax),
self.precision("paid_amount_after_tax"))
self.base_paid_amount_after_tax = flt(flt(self.paid_amount_after_tax) * flt(self.source_exchange_rate),
self.precision("base_paid_amount_after_tax"))
self.received_amount_after_tax = flt(flt(self.received_amount) + flt(applicable_tax),
self.precision("paid_amount_after_tax"))
self.base_received_amount_after_tax = flt(flt(self.received_amount_after_tax) * flt(self.target_exchange_rate),
self.precision("base_paid_amount_after_tax"))
def set_amounts_in_company_currency(self):
self.base_paid_amount, self.base_received_amount, self.difference_amount = 0, 0, 0
if self.paid_amount:
@@ -419,17 +517,20 @@ class PaymentEntry(AccountsController):
def set_unallocated_amount(self):
self.unallocated_amount = 0
if self.party:
total_deductions = sum([flt(d.amount) for d in self.get("deductions")])
total_deductions = sum(flt(d.amount) for d in self.get("deductions"))
included_taxes = self.get_included_taxes()
if self.payment_type == "Receive" \
and self.base_total_allocated_amount < self.base_received_amount + total_deductions \
and self.total_allocated_amount < self.paid_amount + (total_deductions / self.source_exchange_rate):
self.unallocated_amount = (self.base_received_amount + total_deductions -
self.base_total_allocated_amount) / self.source_exchange_rate
self.unallocated_amount = (self.received_amount + total_deductions -
self.base_total_allocated_amount) / self.source_exchange_rate
self.unallocated_amount -= included_taxes
elif self.payment_type == "Pay" \
and self.base_total_allocated_amount < (self.base_paid_amount - total_deductions) \
and self.total_allocated_amount < self.received_amount + (total_deductions / self.target_exchange_rate):
self.unallocated_amount = (self.base_paid_amount - (total_deductions +
self.base_total_allocated_amount)) / self.target_exchange_rate
self.unallocated_amount = (self.base_paid_amount - (total_deductions +
self.base_total_allocated_amount)) / self.target_exchange_rate
self.unallocated_amount -= included_taxes
def set_difference_amount(self):
base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate)
@@ -444,11 +545,23 @@ class PaymentEntry(AccountsController):
else:
self.difference_amount = self.base_paid_amount - flt(self.base_received_amount)
total_deductions = sum([flt(d.amount) for d in self.get("deductions")])
total_deductions = sum(flt(d.amount) for d in self.get("deductions"))
included_taxes = self.get_included_taxes()
self.difference_amount = flt(self.difference_amount - total_deductions,
self.difference_amount = flt(self.difference_amount - total_deductions - included_taxes,
self.precision("difference_amount"))
def get_included_taxes(self):
included_taxes = 0
for tax in self.get('taxes'):
if tax.included_in_paid_amount:
if tax.add_deduct_tax == 'Add':
included_taxes += tax.base_tax_amount
else:
included_taxes -= tax.base_tax_amount
return included_taxes
# Paid amount is auto allocated in the reference document by default.
# Clear the reference document which doesn't have allocated amount on validate so that form can be loaded fast
def clear_unallocated_reference_document_rows(self):
@@ -460,8 +573,8 @@ class PaymentEntry(AccountsController):
if ((self.payment_type=="Pay" and self.party_type=="Customer")
or (self.payment_type=="Receive" and self.party_type=="Supplier")):
total_negative_outstanding = sum([abs(flt(d.outstanding_amount))
for d in self.get("references") if flt(d.outstanding_amount) < 0])
total_negative_outstanding = sum(abs(flt(d.outstanding_amount))
for d in self.get("references") if flt(d.outstanding_amount) < 0)
paid_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount
additional_charges = sum([flt(d.amount) for d in self.deductions])
@@ -532,6 +645,7 @@ class PaymentEntry(AccountsController):
self.add_party_gl_entries(gl_entries)
self.add_bank_gl_entries(gl_entries)
self.add_deductions_gl_entries(gl_entries)
self.add_tax_gl_entries(gl_entries)
make_gl_entries(gl_entries, cancel=cancel, adv_adj=adv_adj)
@@ -571,7 +685,7 @@ class PaymentEntry(AccountsController):
gl_entries.append(gle)
if self.unallocated_amount:
base_unallocated_amount = base_unallocated_amount = self.unallocated_amount * \
base_unallocated_amount = self.unallocated_amount * \
(self.source_exchange_rate if self.payment_type=="Receive" else self.target_exchange_rate)
gle = party_gl_dict.copy()
@@ -607,6 +721,51 @@ class PaymentEntry(AccountsController):
}, item=self)
)
def add_tax_gl_entries(self, gl_entries):
for d in self.get('taxes'):
account_currency = get_account_currency(d.account_head)
if account_currency != self.company_currency:
frappe.throw(_("Currency for {0} must be {1}").format(d.account_head, self.company_currency))
if self.payment_type in ('Pay', 'Internal Transfer'):
dr_or_cr = "debit" if d.add_deduct_tax == "Add" else "credit"
against = self.party or self.paid_from
elif self.payment_type == 'Receive':
dr_or_cr = "credit" if d.add_deduct_tax == "Add" else "debit"
against = self.party or self.paid_to
payment_or_advance_account = self.get_party_account_for_taxes()
tax_amount = d.tax_amount
base_tax_amount = d.base_tax_amount
if self.advance_tax_account:
tax_amount = -1 * tax_amount
base_tax_amount = -1 * base_tax_amount
gl_entries.append(
self.get_gl_dict({
"account": d.account_head,
"against": against,
dr_or_cr: tax_amount,
dr_or_cr + "_in_account_currency": base_tax_amount
if account_currency==self.company_currency
else d.tax_amount,
"cost_center": d.cost_center
}, account_currency, item=d))
#Intentionally use -1 to get net values in party account
if not d.included_in_paid_amount or self.advance_tax_account:
gl_entries.append(
self.get_gl_dict({
"account": payment_or_advance_account,
"against": against,
dr_or_cr: -1 * tax_amount,
dr_or_cr + "_in_account_currency": -1 * base_tax_amount
if account_currency==self.company_currency
else d.tax_amount,
"cost_center": self.cost_center,
}, account_currency, item=d))
def add_deductions_gl_entries(self, gl_entries):
for d in self.get("deductions"):
if d.amount:
@@ -625,6 +784,14 @@ class PaymentEntry(AccountsController):
}, item=d)
)
def get_party_account_for_taxes(self):
if self.advance_tax_account:
return self.advance_tax_account
elif self.payment_type == 'Receive':
return self.paid_to
elif self.payment_type in ('Pay', 'Internal Transfer'):
return self.paid_from
def update_advance_paid(self):
if self.payment_type in ("Receive", "Pay") and self.party:
for d in self.get("references"):
@@ -671,6 +838,139 @@ class PaymentEntry(AccountsController):
self.append('deductions', row)
self.set_unallocated_amount()
def initialize_taxes(self):
for tax in self.get("taxes"):
validate_taxes_and_charges(tax)
validate_inclusive_tax(tax, self)
tax_fields = ["total", "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"]
if tax.charge_type != "Actual":
tax_fields.append("tax_amount")
for fieldname in tax_fields:
tax.set(fieldname, 0.0)
self.paid_amount_after_tax = self.paid_amount
def determine_exclusive_rate(self):
if not any((cint(tax.included_in_paid_amount) for tax in self.get("taxes"))):
return
cumulated_tax_fraction = 0
for i, tax in enumerate(self.get("taxes")):
tax.tax_fraction_for_current_item = self.get_current_tax_fraction(tax)
if i==0:
tax.grand_total_fraction_for_current_item = 1 + tax.tax_fraction_for_current_item
else:
tax.grand_total_fraction_for_current_item = \
self.get("taxes")[i-1].grand_total_fraction_for_current_item \
+ tax.tax_fraction_for_current_item
cumulated_tax_fraction += tax.tax_fraction_for_current_item
self.paid_amount_after_tax = flt(self.paid_amount/(1+cumulated_tax_fraction))
def calculate_taxes(self):
self.total_taxes_and_charges = 0.0
self.base_total_taxes_and_charges = 0.0
actual_tax_dict = dict([[tax.idx, flt(tax.tax_amount, tax.precision("tax_amount"))]
for tax in self.get("taxes") if tax.charge_type == "Actual"])
for i, tax in enumerate(self.get('taxes')):
current_tax_amount = self.get_current_tax_amount(tax)
if tax.charge_type == "Actual":
actual_tax_dict[tax.idx] -= current_tax_amount
if i == len(self.get("taxes")) - 1:
current_tax_amount += actual_tax_dict[tax.idx]
tax.tax_amount = current_tax_amount
tax.base_tax_amount = tax.tax_amount * self.source_exchange_rate
if tax.add_deduct_tax == "Deduct":
current_tax_amount *= -1.0
else:
current_tax_amount *= 1.0
if i == 0:
tax.total = flt(self.paid_amount_after_tax + current_tax_amount, self.precision("total", tax))
else:
tax.total = flt(self.get('taxes')[i-1].total + current_tax_amount, self.precision("total", tax))
tax.base_total = tax.total * self.source_exchange_rate
self.total_taxes_and_charges += current_tax_amount
self.base_total_taxes_and_charges += current_tax_amount * self.source_exchange_rate
if self.get('taxes'):
self.paid_amount_after_tax = self.get('taxes')[-1].base_total
def get_current_tax_amount(self, tax):
tax_rate = tax.rate
# To set row_id by default as previous row.
if tax.charge_type in ["On Previous Row Amount", "On Previous Row Total"]:
if tax.idx == 1:
frappe.throw(_("Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"))
if not tax.row_id:
tax.row_id = tax.idx - 1
if tax.charge_type == "Actual":
current_tax_amount = flt(tax.tax_amount, self.precision("tax_amount", tax))
elif tax.charge_type == "On Paid Amount":
current_tax_amount = (tax_rate / 100.0) * self.paid_amount_after_tax
elif tax.charge_type == "On Previous Row Amount":
current_tax_amount = (tax_rate / 100.0) * \
self.get('taxes')[cint(tax.row_id) - 1].tax_amount
elif tax.charge_type == "On Previous Row Total":
current_tax_amount = (tax_rate / 100.0) * \
self.get('taxes')[cint(tax.row_id) - 1].total
return current_tax_amount
def get_current_tax_fraction(self, tax):
current_tax_fraction = 0
if cint(tax.included_in_paid_amount):
tax_rate = tax.rate
if tax.charge_type == "On Paid Amount":
current_tax_fraction = tax_rate / 100.0
elif tax.charge_type == "On Previous Row Amount":
current_tax_fraction = (tax_rate / 100.0) * \
self.get("taxes")[cint(tax.row_id) - 1].tax_fraction_for_current_item
elif tax.charge_type == "On Previous Row Total":
current_tax_fraction = (tax_rate / 100.0) * \
self.get("taxes")[cint(tax.row_id) - 1].grand_total_fraction_for_current_item
if getattr(tax, "add_deduct_tax", None) and tax.add_deduct_tax == "Deduct":
current_tax_fraction *= -1.0
return current_tax_fraction
def validate_inclusive_tax(tax, doc):
def _on_previous_row_error(row_range):
throw(_("To include tax in row {0} in Item rate, taxes in rows {1} must also be included").format(tax.idx, row_range))
if cint(getattr(tax, "included_in_paid_amount", None)):
if tax.charge_type == "Actual":
# inclusive tax cannot be of type Actual
throw(_("Charge of type 'Actual' in row {0} cannot be included in Item Rate or Paid Amount").format(tax.idx))
elif tax.charge_type == "On Previous Row Amount" and \
not cint(doc.get("taxes")[cint(tax.row_id) - 1].included_in_paid_amount):
# referred row should also be inclusive
_on_previous_row_error(tax.row_id)
elif tax.charge_type == "On Previous Row Total" and \
not all([cint(t.included_in_paid_amount for t in doc.get("taxes")[:cint(tax.row_id) - 1])]):
# all rows about the referred tax should be inclusive
_on_previous_row_error("1 - %d" % (cint(tax.row_id),))
elif tax.get("category") == "Valuation":
frappe.throw(_("Valuation type charges can not be marked as Inclusive"))
@frappe.whitelist()
def get_outstanding_reference_documents(args):
@@ -791,7 +1091,7 @@ def split_invoices_based_on_payment_terms(outstanding_invoices):
outstanding_invoices.pop(idx - 1)
outstanding_invoices += invoice_ref_based_on_payment_terms[idx]
return outstanding_invoices
def get_orders_to_be_billed(posting_date, party_type, party,
@@ -989,6 +1289,7 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
outstanding_amount = ref_doc.get("outstanding_amount")
elif reference_doctype == "Donation":
total_amount = ref_doc.get("amount")
outstanding_amount = total_amount
exchange_rate = 1
elif reference_doctype == "Dunning":
total_amount = ref_doc.get("dunning_amount")
@@ -1045,9 +1346,9 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
return frappe._dict({
"due_date": ref_doc.get("due_date"),
"total_amount": total_amount,
"outstanding_amount": outstanding_amount,
"exchange_rate": exchange_rate,
"total_amount": flt(total_amount),
"outstanding_amount": flt(outstanding_amount),
"exchange_rate": flt(exchange_rate),
"bill_no": bill_no
})
@@ -1235,6 +1536,13 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
})
pe.set_difference_amount()
if doc.doctype == 'Purchase Order' and doc.apply_tds:
pe.apply_tax_withholding_amount = 1
pe.tax_withholding_category = doc.tax_withholding_category
if not pe.advance_tax_account:
pe.advance_tax_account = frappe.db.get_value('Company', pe.company, 'unrealized_profit_loss_account')
return pe
def get_bank_cash_account(doc, bank_account):
@@ -1353,6 +1661,7 @@ def set_paid_amount_and_received_amount(dt, party_account_currency, bank, outsta
paid_amount = received_amount * doc.get('conversion_rate', 1)
if dt == "Employee Advance":
paid_amount = received_amount * doc.get('exchange_rate', 1)
return paid_amount, received_amount
def apply_early_payment_discount(paid_amount, received_amount, doc):

View File

@@ -589,9 +589,9 @@ class TestPaymentEntry(unittest.TestCase):
party_account_balance = get_balance_on(account=pe.paid_from, cost_center=pe.cost_center)
self.assertEqual(pe.cost_center, si.cost_center)
self.assertEqual(expected_account_balance, account_balance)
self.assertEqual(expected_party_balance, party_balance)
self.assertEqual(expected_party_account_balance, party_account_balance)
self.assertEqual(flt(expected_account_balance), account_balance)
self.assertEqual(flt(expected_party_balance), party_balance)
self.assertEqual(flt(expected_party_account_balance), party_account_balance)
def create_payment_terms_template():

View File

@@ -1,140 +1,70 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2016-06-15 15:56:30.815503",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"actions": [],
"creation": "2016-06-15 15:56:30.815503",
"doctype": "DocType",
"editable_grid": 1,
"field_order": [
"account",
"cost_center",
"amount",
"column_break_2",
"description"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "account",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Account",
"options": "Account",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cost_center",
"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": "Cost Center",
"length": 0,
"no_copy": 0,
"options": "Cost Center",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "cost_center",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Cost Center",
"options": "Cost Center",
"print_hide": 1,
"reqd": 1,
"show_days": 1,
"show_seconds": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amount",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldname": "amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Amount",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
},
{
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1
},
{
"fieldname": "description",
"fieldtype": "Small Text",
"label": "Description",
"show_days": 1,
"show_seconds": 1
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2019-01-07 16:52:07.040146",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Deduction",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2020-09-12 20:38:08.110674",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Deduction",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
}

View File

@@ -31,10 +31,10 @@ class TestPaymentOrder(unittest.TestCase):
doc = create_payment_order_against_payment_entry(payment_entry, "Payment Entry")
reference_doc = doc.get("references")[0]
self.assertEquals(reference_doc.reference_name, payment_entry.name)
self.assertEquals(reference_doc.reference_doctype, "Payment Entry")
self.assertEquals(reference_doc.supplier, "_Test Supplier")
self.assertEquals(reference_doc.amount, 250)
self.assertEqual(reference_doc.reference_name, payment_entry.name)
self.assertEqual(reference_doc.reference_doctype, "Payment Entry")
self.assertEqual(reference_doc.supplier, "_Test Supplier")
self.assertEqual(reference_doc.amount, 250)
def create_payment_order_against_payment_entry(ref_doc, order_type):
payment_order = frappe.get_doc(dict(

View File

@@ -234,8 +234,9 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
});
if (invoices) {
frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number",
me.frm.doc.name).options = "\n" + invoices.join("\n");
this.frm.fields_dict.payments.grid.update_docfield_property(
'invoice_number', 'options', "\n" + invoices.join("\n")
);
$.each(me.frm.doc.payments || [], function(i, p) {
if(!in_list(invoices, cstr(p.invoice_number))) p.invoice_number = null;

View File

@@ -11,6 +11,7 @@ from erpnext.accounts.utils import (get_outstanding_invoices,
from erpnext.controllers.accounts_controller import get_advance_payment_entries
class PaymentReconciliation(Document):
@frappe.whitelist()
def get_unreconciled_entries(self):
self.get_nonreconciled_payment_entries()
self.get_invoice_entries()
@@ -113,7 +114,7 @@ class PaymentReconciliation(Document):
'party_type': self.party_type,
'voucher_type': voucher_type,
'account': self.receivable_payable_account
}, as_dict=1, debug=1)
}, as_dict=1)
def add_payment_entries(self, entries):
self.set('payments', [])
@@ -147,6 +148,7 @@ class PaymentReconciliation(Document):
ent.currency = e.get('currency')
ent.outstanding_amount = e.get('outstanding_amount')
@frappe.whitelist()
def reconcile(self, args):
for e in self.get('payments'):
e.invoice_type = None
@@ -197,6 +199,7 @@ class PaymentReconciliation(Document):
'difference_account': row.difference_account
})
@frappe.whitelist()
def get_difference_amount(self, child_row):
if child_row.get("reference_type") != 'Payment Entry': return

View File

@@ -101,7 +101,7 @@ class PaymentRequest(Document):
controller.validate_transaction_currency(self.currency)
controller.request_for_payment(**payment_record)
def get_request_amount(self):
data_of_completed_requests = frappe.get_all("Integration Request", filters={
'reference_doctype': self.doctype,
@@ -112,7 +112,7 @@ class PaymentRequest(Document):
if not data_of_completed_requests:
return self.grand_total
request_amounts = sum([json.loads(d).get('request_amount') for d in data_of_completed_requests])
request_amounts = sum(json.loads(d).get('request_amount') for d in data_of_completed_requests)
return request_amounts
def on_cancel(self):
@@ -492,7 +492,6 @@ def update_payment_req_status(doc, method):
status = 'Requested'
pay_req_doc.db_set('status', status)
frappe.db.commit()
def get_dummy_message(doc):
return frappe.render_template("""{% if doc.contact_person -%}

View File

@@ -20,10 +20,11 @@
"discount",
"section_break_9",
"payment_amount",
"outstanding",
"paid_amount",
"discounted_amount",
"column_break_3",
"outstanding",
"paid_amount"
"base_payment_amount"
],
"fields": [
{
@@ -78,7 +79,8 @@
"depends_on": "paid_amount",
"fieldname": "paid_amount",
"fieldtype": "Currency",
"label": "Paid Amount"
"label": "Paid Amount",
"options": "currency"
},
{
"fieldname": "column_break_3",
@@ -97,6 +99,7 @@
"fieldname": "outstanding",
"fieldtype": "Currency",
"label": "Outstanding",
"options": "currency",
"read_only": 1
},
{
@@ -145,12 +148,18 @@
{
"fieldname": "section_break_4",
"fieldtype": "Section Break"
},
{
"fieldname": "base_payment_amount",
"fieldtype": "Currency",
"label": "Payment Amount (Company Currency)",
"options": "Company:company:default_currency"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-02-15 21:03:12.540546",
"modified": "2021-04-28 05:41:35.084233",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",

View File

@@ -26,7 +26,7 @@ class PaymentTermsTemplate(Document):
def check_duplicate_terms(self):
terms = []
for term in self.terms:
term_info = (term.credit_days, term.credit_months, term.due_date_based_on)
term_info = (term.payment_term, term.credit_days, term.credit_months, term.due_date_based_on)
if term_info in terms:
frappe.msgprint(
_('The Payment Term at row {0} is possibly a duplicate.').format(term.idx),

View File

@@ -1,350 +1,138 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "ACC-PCV-.YYYY.-.#####",
"beta": 0,
"creation": "2013-01-10 16:34:07",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"engine": "InnoDB",
"actions": [],
"autoname": "ACC-PCV-.YYYY.-.#####",
"creation": "2013-01-10 16:34:07",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"transaction_date",
"posting_date",
"fiscal_year",
"amended_from",
"company",
"cost_center_wise_pnl",
"column_break1",
"closing_account_head",
"remarks"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "transaction_date",
"fieldtype": "Date",
"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": "Transaction Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "transaction_date",
"oldfieldtype": "Date",
"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
},
"fieldname": "transaction_date",
"fieldtype": "Date",
"label": "Transaction Date",
"oldfieldname": "transaction_date",
"oldfieldtype": "Date"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "posting_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Posting Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "posting_date",
"oldfieldtype": "Date",
"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
},
"fieldname": "posting_date",
"fieldtype": "Date",
"label": "Posting Date",
"oldfieldname": "posting_date",
"oldfieldtype": "Date",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "fiscal_year",
"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": 1,
"label": "Closing Fiscal Year",
"length": 0,
"no_copy": 0,
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
"options": "Fiscal Year",
"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
},
"fieldname": "fiscal_year",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Closing Fiscal Year",
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
"options": "Fiscal Year",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 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,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"options": "Period Closing Voucher",
"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
},
"fieldname": "amended_from",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"options": "Period Closing Voucher",
"read_only": 1
},
{
"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": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Select",
"options": "Company",
"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
},
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Select",
"options": "Company",
"reqd": 1
},
{
"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,
"oldfieldtype": "Column Break",
"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
},
"fieldname": "column_break1",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "The account head under Liability or Equity, in which Profit/Loss will be booked",
"fieldname": "closing_account_head",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Closing Account Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "closing_account_head",
"oldfieldtype": "Link",
"options": "Account",
"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
},
"description": "The account head under Liability or Equity, in which Profit/Loss will be booked",
"fieldname": "closing_account_head",
"fieldtype": "Link",
"label": "Closing Account Head",
"oldfieldname": "closing_account_head",
"oldfieldtype": "Link",
"options": "Account",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "remarks",
"fieldtype": "Small Text",
"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": "Remarks",
"length": 0,
"no_copy": 0,
"oldfieldname": "remarks",
"oldfieldtype": "Small Text",
"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
"fieldname": "remarks",
"fieldtype": "Small Text",
"label": "Remarks",
"oldfieldname": "remarks",
"oldfieldtype": "Small Text",
"reqd": 1
},
{
"default": "0",
"fieldname": "cost_center_wise_pnl",
"fieldtype": "Check",
"label": "Book Cost Center Wise Profit/Loss"
}
],
"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": 0,
"modified": "2020-09-18 17:26:09.703215",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Period Closing Voucher",
"owner": "Administrator",
],
"icon": "fa fa-file-text",
"idx": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-05-20 15:27:37.210458",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Period Closing Voucher",
"owner": "Administrator",
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"submit": 1,
"write": 1
},
},
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 1,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "posting_date, fiscal_year",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "closing_account_head",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
],
"search_fields": "posting_date, fiscal_year",
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "closing_account_head"
}

View File

@@ -51,63 +51,96 @@ class PeriodClosingVoucher(AccountsController):
def make_gl_entries(self):
gl_entries = []
net_pl_balance = 0
dimension_fields = ['t1.cost_center']
net_pl_balance = 0
accounting_dimensions = get_accounting_dimensions()
for dimension in accounting_dimensions:
dimension_fields.append('t1.{0}'.format(dimension))
dimension_filters, default_dimensions = get_dimensions()
pl_accounts = self.get_pl_balances(dimension_fields)
pl_accounts = self.get_pl_balances()
for acc in pl_accounts:
if flt(acc.balance_in_company_currency):
if flt(acc.bal_in_company_currency):
gl_entries.append(self.get_gl_dict({
"account": acc.account,
"cost_center": acc.cost_center,
"account_currency": acc.account_currency,
"debit_in_account_currency": abs(flt(acc.balance_in_account_currency)) \
if flt(acc.balance_in_account_currency) < 0 else 0,
"debit": abs(flt(acc.balance_in_company_currency)) \
if flt(acc.balance_in_company_currency) < 0 else 0,
"credit_in_account_currency": abs(flt(acc.balance_in_account_currency)) \
if flt(acc.balance_in_account_currency) > 0 else 0,
"credit": abs(flt(acc.balance_in_company_currency)) \
if flt(acc.balance_in_company_currency) > 0 else 0
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) < 0 else 0,
"debit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) < 0 else 0,
"credit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) > 0 else 0,
"credit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0
}, item=acc))
net_pl_balance += flt(acc.balance_in_company_currency)
net_pl_balance += flt(acc.bal_in_company_currency)
if net_pl_balance:
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entry = self.get_gl_dict({
"account": self.closing_account_head,
"debit_in_account_currency": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"debit": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"credit_in_account_currency": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"cost_center": cost_center
})
for dimension in accounting_dimensions:
gl_entry.update({
dimension: default_dimensions.get(self.company, {}).get(dimension)
})
gl_entries.append(gl_entry)
if self.cost_center_wise_pnl:
costcenter_wise_gl_entries = self.get_costcenter_wise_pnl_gl_entries(pl_accounts)
gl_entries += costcenter_wise_gl_entries
else:
gl_entry = self.get_pnl_gl_entry(net_pl_balance)
gl_entries.append(gl_entry)
from erpnext.accounts.general_ledger import make_gl_entries
make_gl_entries(gl_entries)
def get_pnl_gl_entry(self, net_pl_balance):
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entry = self.get_gl_dict({
"account": self.closing_account_head,
"debit_in_account_currency": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"debit": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"credit_in_account_currency": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"cost_center": cost_center
})
self.update_default_dimensions(gl_entry)
return gl_entry
def get_costcenter_wise_pnl_gl_entries(self, pl_accounts):
company_cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entries = []
for acc in pl_accounts:
if flt(acc.bal_in_company_currency):
gl_entry = self.get_gl_dict({
"account": self.closing_account_head,
"cost_center": acc.cost_center or company_cost_center,
"account_currency": acc.account_currency,
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) > 0 else 0,
"debit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0,
"credit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) < 0 else 0,
"credit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) < 0 else 0
}, item=acc)
self.update_default_dimensions(gl_entry)
gl_entries.append(gl_entry)
return gl_entries
def update_default_dimensions(self, gl_entry):
if not self.accounting_dimensions:
self.accounting_dimensions = get_accounting_dimensions()
_, default_dimensions = get_dimensions()
for dimension in self.accounting_dimensions:
gl_entry.update({
dimension: default_dimensions.get(self.company, {}).get(dimension)
})
def get_pl_balances(self):
"""Get balance for dimension-wise pl accounts"""
dimension_fields = ['t1.cost_center']
self.accounting_dimensions = get_accounting_dimensions()
for dimension in self.accounting_dimensions:
dimension_fields.append('t1.{0}'.format(dimension))
def get_pl_balances(self, dimension_fields):
"""Get balance for pl accounts"""
return frappe.db.sql("""
select
t1.account, t2.account_currency, {dimension_fields},
sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) as balance_in_account_currency,
sum(t1.debit) - sum(t1.credit) as balance_in_company_currency
sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) as bal_in_account_currency,
sum(t1.debit) - sum(t1.credit) as bal_in_company_currency
from `tabGL Entry` t1, `tabAccount` t2
where t1.account = t2.name and t2.report_type = 'Profit and Loss'
and t2.docstatus < 2 and t2.company = %s

View File

@@ -8,6 +8,7 @@ import frappe
from frappe.utils import flt, today
from erpnext.accounts.utils import get_fiscal_year, now
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
class TestPeriodClosingVoucher(unittest.TestCase):
def test_closing_entry(self):
@@ -65,6 +66,58 @@ class TestPeriodClosingVoucher(unittest.TestCase):
self.assertEqual(gle_for_random_expense_account[0].amount_in_account_currency,
-1*random_expense_account[0].balance_in_account_currency)
def test_cost_center_wise_posting(self):
frappe.db.sql("delete from `tabGL Entry` where company='Test PCV Company'")
company = create_company()
surplus_account = create_account()
cost_center1 = create_cost_center("Test Cost Center 1")
cost_center2 = create_cost_center("Test Cost Center 2")
create_sales_invoice(
company=company,
cost_center=cost_center1,
income_account="Sales - TPC",
expense_account="Cost of Goods Sold - TPC",
rate=400,
debit_to="Debtors - TPC"
)
create_sales_invoice(
company=company,
cost_center=cost_center2,
income_account="Sales - TPC",
expense_account="Cost of Goods Sold - TPC",
rate=200,
debit_to="Debtors - TPC"
)
pcv = frappe.get_doc({
"transaction_date": today(),
"posting_date": today(),
"fiscal_year": get_fiscal_year(today())[0],
"company": "Test PCV Company",
"cost_center_wise_pnl": 1,
"closing_account_head": surplus_account,
"remarks": "Test",
"doctype": "Period Closing Voucher"
})
pcv.insert()
pcv.submit()
expected_gle = (
('Sales - TPC', 200.0, 0.0, cost_center2),
(surplus_account, 0.0, 200.0, cost_center2),
('Sales - TPC', 400.0, 0.0, cost_center1),
(surplus_account, 0.0, 400.0, cost_center1)
)
pcv_gle = frappe.db.sql("""
select account, debit, credit, cost_center from `tabGL Entry` where voucher_no=%s
""", (pcv.name))
self.assertTrue(pcv_gle, expected_gle)
def make_period_closing_voucher(self):
pcv = frappe.get_doc({
"doctype": "Period Closing Voucher",
@@ -80,6 +133,38 @@ class TestPeriodClosingVoucher(unittest.TestCase):
return pcv
def create_company():
company = frappe.get_doc({
'doctype': 'Company',
'company_name': "Test PCV Company",
'country': 'United States',
'default_currency': 'USD'
})
company.insert(ignore_if_duplicate = True)
return company.name
def create_account():
account = frappe.get_doc({
"account_name": "Reserve and Surplus",
"is_group": 0,
"company": "Test PCV Company",
"root_type": "Liability",
"report_type": "Balance Sheet",
"account_currency": "USD",
"parent_account": "Current Liabilities - TPC",
"doctype": "Account"
}).insert(ignore_if_duplicate = True)
return account.name
def create_cost_center(cc_name):
costcenter = frappe.get_doc({
"company": "Test PCV Company",
"cost_center_name": cc_name,
"doctype": "Cost Center",
"parent_cost_center": "Test PCV Company - TPC"
})
costcenter.insert(ignore_if_duplicate = True)
return costcenter.name
test_dependencies = ["Customer", "Cost Center"]
test_records = frappe.get_test_records("Period Closing Voucher")

View File

@@ -22,7 +22,43 @@ frappe.ui.form.on('POS Closing Entry', {
});
if (frm.doc.docstatus === 0 && !frm.doc.amended_from) frm.set_value("period_end_date", frappe.datetime.now_datetime());
if (frm.doc.docstatus === 1) set_html_data(frm);
frappe.realtime.on('closing_process_complete', async function(data) {
await frm.reload_doc();
if (frm.doc.status == 'Failed' && frm.doc.error_message && data.user == frappe.session.user) {
frappe.msgprint({
title: __('POS Closing Failed'),
message: frm.doc.error_message,
indicator: 'orange',
clear: true
});
}
});
set_html_data(frm);
},
refresh: function(frm) {
if (frm.doc.docstatus == 1 && frm.doc.status == 'Failed') {
const issue = '<a id="jump_to_error" style="text-decoration: underline;">issue</a>';
frm.dashboard.set_headline(
__('POS Closing failed while running in a background process. You can resolve the {0} and retry the process again.', [issue]));
$('#jump_to_error').on('click', (e) => {
e.preventDefault();
frappe.utils.scroll_to(
cur_frm.get_field("error_message").$wrapper,
true,
30
);
});
frm.add_custom_button(__('Retry'), function () {
frm.call('retry', {}, () => {
frm.reload_doc();
});
});
}
},
pos_opening_entry(frm) {
@@ -61,48 +97,37 @@ frappe.ui.form.on('POS Closing Entry', {
refresh_fields(frm);
set_html_data(frm);
}
})
});
},
before_save: function(frm) {
frm.set_value("grand_total", 0);
frm.set_value("net_total", 0);
frm.set_value("total_quantity", 0);
frm.set_value("taxes", []);
for (let row of frm.doc.payment_reconciliation) {
row.expected_amount = row.opening_amount;
}
for (let row of frm.doc.pos_transactions) {
frappe.db.get_doc("POS Invoice", row.pos_invoice).then(doc => {
frm.doc.grand_total += flt(doc.grand_total);
frm.doc.net_total += flt(doc.net_total);
frm.doc.total_quantity += flt(doc.total_qty);
refresh_payments(doc, frm);
refresh_taxes(doc, frm);
refresh_fields(frm);
set_html_data(frm);
});
}
}
});
cur_frm.cscript.before_pos_transactions_remove = function(doc, cdt, cdn) {
const removed_row = locals[cdt][cdn];
if (!removed_row.pos_invoice) return;
frappe.db.get_doc("POS Invoice", removed_row.pos_invoice).then(doc => {
cur_frm.doc.grand_total -= flt(doc.grand_total);
cur_frm.doc.net_total -= flt(doc.net_total);
cur_frm.doc.total_quantity -= flt(doc.total_qty);
refresh_payments(doc, cur_frm, 1);
refresh_taxes(doc, cur_frm, 1);
refresh_fields(cur_frm);
set_html_data(cur_frm);
});
}
frappe.ui.form.on('POS Invoice Reference', {
pos_invoice(frm, cdt, cdn) {
const added_row = locals[cdt][cdn];
if (!added_row.pos_invoice) return;
frappe.db.get_doc("POS Invoice", added_row.pos_invoice).then(doc => {
frm.doc.grand_total += flt(doc.grand_total);
frm.doc.net_total += flt(doc.net_total);
frm.doc.total_quantity += flt(doc.total_qty);
refresh_payments(doc, frm);
refresh_taxes(doc, frm);
refresh_fields(frm);
set_html_data(frm);
});
}
})
frappe.ui.form.on('POS Closing Entry Detail', {
closing_amount: (frm, cdt, cdn) => {
const row = locals[cdt][cdn];
frappe.model.set_value(cdt, cdn, "difference", flt(row.expected_amount - row.closing_amount))
frappe.model.set_value(cdt, cdn, "difference", flt(row.expected_amount - row.closing_amount));
}
})
@@ -126,28 +151,31 @@ function add_to_pos_transaction(d, frm) {
})
}
function refresh_payments(d, frm, remove) {
function refresh_payments(d, frm) {
d.payments.forEach(p => {
const payment = frm.doc.payment_reconciliation.find(pay => pay.mode_of_payment === p.mode_of_payment);
if (p.account == d.account_for_change_amount) {
p.amount -= flt(d.change_amount);
}
if (payment) {
if (!remove) payment.expected_amount += flt(p.amount);
else payment.expected_amount -= flt(p.amount);
payment.expected_amount += flt(p.amount);
payment.difference = payment.closing_amount - payment.expected_amount;
} else {
frm.add_child("payment_reconciliation", {
mode_of_payment: p.mode_of_payment,
opening_amount: 0,
expected_amount: p.amount
expected_amount: p.amount,
closing_amount: 0
})
}
})
}
function refresh_taxes(d, frm, remove) {
function refresh_taxes(d, frm) {
d.taxes.forEach(t => {
const tax = frm.doc.taxes.find(tx => tx.account_head === t.account_head && tx.rate === t.rate);
if (tax) {
if (!remove) tax.amount += flt(t.tax_amount);
else tax.amount -= flt(t.tax_amount);
tax.amount += flt(t.tax_amount);
} else {
frm.add_child("taxes", {
account_head: t.account_head,
@@ -177,11 +205,13 @@ function refresh_fields(frm) {
}
function set_html_data(frm) {
frappe.call({
method: "get_payment_reconciliation_details",
doc: frm.doc,
callback: (r) => {
frm.get_field("payment_reconciliation_details").$wrapper.html(r.message);
}
})
if (frm.doc.docstatus === 1 && frm.doc.status == 'Submitted') {
frappe.call({
method: "get_payment_reconciliation_details",
doc: frm.doc,
callback: (r) => {
frm.get_field("payment_reconciliation_details").$wrapper.html(r.message);
}
});
}
}

View File

@@ -30,6 +30,8 @@
"total_quantity",
"column_break_16",
"taxes",
"failure_description_section",
"error_message",
"section_break_14",
"amended_from"
],
@@ -195,7 +197,7 @@
"fieldtype": "Select",
"hidden": 1,
"label": "Status",
"options": "Draft\nSubmitted\nQueued\nCancelled",
"options": "Draft\nSubmitted\nQueued\nFailed\nCancelled",
"print_hide": 1,
"read_only": 1
},
@@ -203,6 +205,21 @@
"fieldname": "period_details_section",
"fieldtype": "Section Break",
"label": "Period Details"
},
{
"collapsible": 1,
"collapsible_depends_on": "error_message",
"depends_on": "error_message",
"fieldname": "failure_description_section",
"fieldtype": "Section Break",
"label": "Failure Description"
},
{
"depends_on": "error_message",
"fieldname": "error_message",
"fieldtype": "Small Text",
"label": "Error",
"read_only": 1
}
],
"is_submittable": 1,
@@ -212,7 +229,7 @@
"link_fieldname": "pos_closing_entry"
}
],
"modified": "2021-02-01 13:47:20.722104",
"modified": "2021-05-05 16:59:49.723261",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Closing Entry",

View File

@@ -16,33 +16,13 @@ class POSClosingEntry(StatusUpdater):
if frappe.db.get_value("POS Opening Entry", self.pos_opening_entry, "status") != "Open":
frappe.throw(_("Selected POS Opening Entry should be open."), title=_("Invalid Opening Entry"))
self.validate_pos_closing()
self.validate_pos_invoices()
def validate_pos_closing(self):
user = frappe.db.sql("""
SELECT name FROM `tabPOS Closing Entry`
WHERE
user = %(user)s AND docstatus = 1 AND pos_profile = %(profile)s AND
(period_start_date between %(start)s and %(end)s OR period_end_date between %(start)s and %(end)s)
""", {
'user': self.user,
'profile': self.pos_profile,
'start': self.period_start_date,
'end': self.period_end_date
})
if user:
bold_already_exists = frappe.bold(_("already exists"))
bold_user = frappe.bold(self.user)
frappe.throw(_("POS Closing Entry {} against {} between selected period")
.format(bold_already_exists, bold_user), title=_("Invalid Period"))
def validate_pos_invoices(self):
invalid_rows = []
for d in self.pos_transactions:
invalid_row = {'idx': d.idx}
pos_invoice = frappe.db.get_values("POS Invoice", d.pos_invoice,
pos_invoice = frappe.db.get_values("POS Invoice", d.pos_invoice,
["consolidated_invoice", "pos_profile", "docstatus", "owner"], as_dict=1)[0]
if pos_invoice.consolidated_invoice:
invalid_row.setdefault('msg', []).append(_('POS Invoice is {}').format(frappe.bold("already consolidated")))
@@ -68,17 +48,22 @@ class POSClosingEntry(StatusUpdater):
frappe.throw(error_list, title=_("Invalid POS Invoices"), as_list=True)
@frappe.whitelist()
def get_payment_reconciliation_details(self):
currency = frappe.get_cached_value('Company', self.company, "default_currency")
return frappe.render_template("erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html",
{"data": self, "currency": currency})
def on_submit(self):
consolidate_pos_invoices(closing_entry=self)
def on_cancel(self):
unconsolidate_pos_invoices(closing_entry=self)
@frappe.whitelist()
def retry(self):
consolidate_pos_invoices(closing_entry=self)
def update_opening_entry(self, for_cancel=False):
opening_entry = frappe.get_doc("POS Opening Entry", self.pos_opening_entry)
opening_entry.pos_closing_entry = self.name if not for_cancel else None
@@ -88,8 +73,8 @@ class POSClosingEntry(StatusUpdater):
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_cashiers(doctype, txt, searchfield, start, page_len, filters):
cashiers_list = frappe.get_all("POS Profile User", filters=filters, fields=['user'])
return [c['user'] for c in cashiers_list]
cashiers_list = frappe.get_all("POS Profile User", filters=filters, fields=['user'], as_list=1)
return [c for c in cashiers_list]
@frappe.whitelist()
def get_pos_invoices(start, end, pos_profile, user):

View File

@@ -8,6 +8,7 @@ frappe.listview_settings['POS Closing Entry'] = {
"Draft": "red",
"Submitted": "blue",
"Queued": "orange",
"Failed": "red",
"Cancelled": "red"
};

View File

@@ -5,12 +5,21 @@ from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import nowdate
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry
from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_invoice
from erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry import make_closing_entry_from_opening
from erpnext.accounts.doctype.pos_opening_entry.test_pos_opening_entry import create_opening_entry
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
class TestPOSClosingEntry(unittest.TestCase):
def setUp(self):
# Make stock available for POS Sales
make_stock_entry(target="_Test Warehouse - _TC", qty=2, basic_rate=100)
def tearDown(self):
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
def test_pos_closing_entry(self):
test_user, pos_profile = init_user_and_profile()
opening_entry = create_opening_entry(pos_profile, test_user.name)
@@ -41,9 +50,6 @@ class TestPOSClosingEntry(unittest.TestCase):
self.assertEqual(pcv_doc.total_quantity, 2)
self.assertEqual(pcv_doc.net_total, 6700)
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
def test_cancelling_of_pos_closing_entry(self):
test_user, pos_profile = init_user_and_profile()
opening_entry = create_opening_entry(pos_profile, test_user.name)
@@ -84,8 +90,6 @@ class TestPOSClosingEntry(unittest.TestCase):
self.assertEqual(si_doc.docstatus, 2)
self.assertEqual(pos_inv1.status, 'Paid')
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
def init_user_and_profile(**args):
user = 'test@example.com'
@@ -103,4 +107,4 @@ def init_user_and_profile(**args):
pos_profile.save()
return test_user, pos_profile
return test_user, pos_profile

View File

@@ -46,6 +46,7 @@
"reqd": 1
},
{
"default": "0",
"fieldname": "closing_amount",
"fieldtype": "Currency",
"in_list_view": 1,
@@ -57,7 +58,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2020-10-23 16:45:43.662034",
"modified": "2021-05-19 20:08:44.523861",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Closing Entry Detail",

View File

@@ -96,46 +96,58 @@ class POSInvoice(SalesInvoice):
if paid_amt and pay.amount != paid_amt:
return frappe.throw(_("Payment related to {0} is not completed").format(pay.mode_of_payment))
def validate_pos_reserved_serial_nos(self, item):
serial_nos = get_serial_nos(item.serial_no)
filters = {"item_code": item.item_code, "warehouse": item.warehouse}
if item.batch_no:
filters["batch_no"] = item.batch_no
reserved_serial_nos = get_pos_reserved_serial_nos(filters)
invalid_serial_nos = [s for s in serial_nos if s in reserved_serial_nos]
bold_invalid_serial_nos = frappe.bold(', '.join(invalid_serial_nos))
if len(invalid_serial_nos) == 1:
frappe.throw(_("Row #{}: Serial No. {} has already been transacted into another POS Invoice. Please select valid serial no.")
.format(item.idx, bold_invalid_serial_nos), title=_("Item Unavailable"))
elif invalid_serial_nos:
frappe.throw(_("Row #{}: Serial Nos. {} has already been transacted into another POS Invoice. Please select valid serial no.")
.format(item.idx, bold_invalid_serial_nos), title=_("Item Unavailable"))
def validate_delivered_serial_nos(self, item):
serial_nos = get_serial_nos(item.serial_no)
delivered_serial_nos = frappe.db.get_list('Serial No', {
'item_code': item.item_code,
'name': ['in', serial_nos],
'sales_invoice': ['is', 'set']
}, pluck='name')
if delivered_serial_nos:
bold_delivered_serial_nos = frappe.bold(', '.join(delivered_serial_nos))
frappe.throw(_("Row #{}: Serial No. {} has already been transacted into another Sales Invoice. Please select valid serial no.")
.format(item.idx, bold_delivered_serial_nos), title=_("Item Unavailable"))
def validate_stock_availablility(self):
if self.is_return:
return
allow_negative_stock = frappe.db.get_value('Stock Settings', None, 'allow_negative_stock')
error_msg = []
allow_negative_stock = frappe.db.get_single_value('Stock Settings', 'allow_negative_stock')
for d in self.get('items'):
msg = ""
if d.serial_no:
filters = { "item_code": d.item_code, "warehouse": d.warehouse }
if d.batch_no:
filters["batch_no"] = d.batch_no
reserved_serial_nos = get_pos_reserved_serial_nos(filters)
serial_nos = get_serial_nos(d.serial_no)
invalid_serial_nos = [s for s in serial_nos if s in reserved_serial_nos]
bold_invalid_serial_nos = frappe.bold(', '.join(invalid_serial_nos))
if len(invalid_serial_nos) == 1:
msg = (_("Row #{}: Serial No. {} has already been transacted into another POS Invoice. Please select valid serial no.")
.format(d.idx, bold_invalid_serial_nos))
elif invalid_serial_nos:
msg = (_("Row #{}: Serial Nos. {} has already been transacted into another POS Invoice. Please select valid serial no.")
.format(d.idx, bold_invalid_serial_nos))
self.validate_pos_reserved_serial_nos(d)
self.validate_delivered_serial_nos(d)
else:
if allow_negative_stock:
return
available_stock = get_stock_availability(d.item_code, d.warehouse)
item_code, warehouse, qty = frappe.bold(d.item_code), frappe.bold(d.warehouse), frappe.bold(d.qty)
if flt(available_stock) <= 0:
msg = (_('Row #{}: Item Code: {} is not available under warehouse {}.').format(d.idx, item_code, warehouse))
frappe.throw(_('Row #{}: Item Code: {} is not available under warehouse {}.')
.format(d.idx, item_code, warehouse), title=_("Item Unavailable"))
elif flt(available_stock) < flt(d.qty):
msg = (_('Row #{}: Stock quantity not enough for Item Code: {} under warehouse {}. Available quantity {}.')
.format(d.idx, item_code, warehouse, qty))
if msg:
error_msg.append(msg)
if error_msg:
frappe.throw(error_msg, title=_("Item Unavailable"), as_list=True)
frappe.throw(_('Row #{}: Stock quantity not enough for Item Code: {} under warehouse {}. Available quantity {}.')
.format(d.idx, item_code, warehouse, available_stock), title=_("Item Unavailable"))
def validate_serialised_or_batched_item(self):
error_msg = []
@@ -202,9 +214,9 @@ class POSInvoice(SalesInvoice):
for d in self.get("items"):
is_stock_item = frappe.get_cached_value("Item", d.get("item_code"), "is_stock_item")
if not is_stock_item:
frappe.throw(_("Row #{}: Item {} is a non stock item. You can only include stock items in a POS Invoice. ").format(
d.idx, frappe.bold(d.item_code)
), title=_("Invalid Item"))
if not frappe.db.exists('Product Bundle', d.item_code):
frappe.throw(_("Row #{}: Item {} is a non stock item. You can only include stock items in a POS Invoice.")
.format(d.idx, frappe.bold(d.item_code)), title=_("Invalid Item"))
def validate_mode_of_payment(self):
if len(self.payments) == 0:
@@ -220,7 +232,7 @@ class POSInvoice(SalesInvoice):
base_grand_total = flt(self.base_rounded_total) or flt(self.base_grand_total)
if not flt(self.change_amount) and grand_total < flt(self.paid_amount):
self.change_amount = flt(self.paid_amount - grand_total + flt(self.write_off_amount))
self.base_change_amount = flt(self.base_paid_amount - base_grand_total + flt(self.base_write_off_amount))
self.base_change_amount = flt(self.base_paid_amount) - base_grand_total + flt(self.base_write_off_amount)
if flt(self.change_amount) and not self.account_for_change_amount:
frappe.msgprint(_("Please enter Account for Change Amount"), raise_exception=1)
@@ -354,6 +366,7 @@ class POSInvoice(SalesInvoice):
return profile
@frappe.whitelist()
def set_missing_values(self, for_validate=False):
profile = self.set_pos_fields(for_validate)
@@ -376,12 +389,20 @@ class POSInvoice(SalesInvoice):
"allow_print_before_pay": profile.get("allow_print_before_pay")
}
@frappe.whitelist()
def reset_mode_of_payments(self):
if self.pos_profile:
pos_profile = frappe.get_cached_doc('POS Profile', self.pos_profile)
update_multi_mode_option(self, pos_profile)
self.paid_amount = 0
def set_account_for_mode_of_payment(self):
self.payments = [d for d in self.payments if d.amount or d.base_amount or d.default]
for pay in self.payments:
if not pay.account:
pay.account = get_bank_cash_account(pay.mode_of_payment, self.company).get("account")
@frappe.whitelist()
def create_payment_request(self):
for pay in self.payments:
if pay.type == "Phone":
@@ -436,29 +457,48 @@ class POSInvoice(SalesInvoice):
@frappe.whitelist()
def get_stock_availability(item_code, warehouse):
latest_sle = frappe.db.sql("""select qty_after_transaction
from `tabStock Ledger Entry`
if frappe.db.get_value('Item', item_code, 'is_stock_item'):
bin_qty = get_bin_qty(item_code, warehouse)
pos_sales_qty = get_pos_reserved_qty(item_code, warehouse)
return bin_qty - pos_sales_qty
else:
if frappe.db.exists('Product Bundle', item_code):
return get_bundle_availability(item_code, warehouse)
def get_bundle_availability(bundle_item_code, warehouse):
product_bundle = frappe.get_doc('Product Bundle', bundle_item_code)
bundle_bin_qty = 1000000
for item in product_bundle.items:
item_bin_qty = get_bin_qty(item.item_code, warehouse)
item_pos_reserved_qty = get_pos_reserved_qty(item.item_code, warehouse)
available_qty = item_bin_qty - item_pos_reserved_qty
max_available_bundles = available_qty / item.qty
if bundle_bin_qty > max_available_bundles:
bundle_bin_qty = max_available_bundles
pos_sales_qty = get_pos_reserved_qty(bundle_item_code, warehouse)
return bundle_bin_qty - pos_sales_qty
def get_bin_qty(item_code, warehouse):
bin_qty = frappe.db.sql("""select actual_qty from `tabBin`
where item_code = %s and warehouse = %s
order by posting_date desc, posting_time desc
limit 1""", (item_code, warehouse), as_dict=1)
pos_sales_qty = frappe.db.sql("""select sum(p_item.qty) as qty
return bin_qty[0].actual_qty or 0 if bin_qty else 0
def get_pos_reserved_qty(item_code, warehouse):
reserved_qty = frappe.db.sql("""select sum(p_item.qty) as qty
from `tabPOS Invoice` p, `tabPOS Invoice Item` p_item
where p.name = p_item.parent
and p.consolidated_invoice is NULL
and p.docstatus = 1
and ifnull(p.consolidated_invoice, '') = ''
and p_item.docstatus = 1
and p_item.item_code = %s
and p_item.warehouse = %s
""", (item_code, warehouse), as_dict=1)
sle_qty = latest_sle[0].qty_after_transaction or 0 if latest_sle else 0
pos_sales_qty = pos_sales_qty[0].qty or 0 if pos_sales_qty else 0
if sle_qty and pos_sales_qty:
return sle_qty - pos_sales_qty
else:
return sle_qty
return reserved_qty[0].qty or 0 if reserved_qty else 0
@frappe.whitelist()
def make_sales_return(source_name, target_doc=None):
@@ -505,4 +545,4 @@ def add_return_modes(doc, pos_profile):
mode_of_payment = pos_payment_method.mode_of_payment
if pos_payment_method.allow_in_returns and not [d for d in doc.get('payments') if d.mode_of_payment == mode_of_payment]:
payment_mode = get_mode_of_payment_info(mode_of_payment, doc.company)
append_payment(payment_mode[0])
append_payment(payment_mode[0])

View File

@@ -9,8 +9,22 @@ from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profi
from erpnext.accounts.doctype.pos_invoice.pos_invoice import make_sales_return
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
class TestPOSInvoice(unittest.TestCase):
@classmethod
def setUpClass(cls):
make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item", qty=800, basic_rate=100)
frappe.db.sql("delete from `tabTax Rule`")
def tearDown(self):
if frappe.session.user != "Administrator":
frappe.set_user("Administrator")
if frappe.db.get_single_value("Selling Settings", "validate_selling_price"):
frappe.db.set_value("Selling Settings", None, "validate_selling_price", 0)
def test_timestamp_change(self):
w = create_pos_invoice(do_not_save=1)
w.docstatus = 0
@@ -308,6 +322,34 @@ class TestPOSInvoice(unittest.TestCase):
self.assertRaises(frappe.ValidationError, pos2.insert)
def test_delivered_serialized_item_transaction(self):
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
se = make_serialized_item(company='_Test Company',
target_warehouse="Stores - _TC", cost_center='Main - _TC', expense_account='Cost of Goods Sold - _TC')
serial_nos = get_serial_nos(se.get("items")[0].serial_no)
si = create_sales_invoice(company='_Test Company', debit_to='Debtors - _TC',
account_for_change_amount='Cash - _TC', warehouse='Stores - _TC', income_account='Sales - _TC',
expense_account='Cost of Goods Sold - _TC', cost_center='Main - _TC',
item=se.get("items")[0].item_code, rate=1000, do_not_save=1)
si.get("items")[0].serial_no = serial_nos[0]
si.insert()
si.submit()
pos2 = create_pos_invoice(company='_Test Company', debit_to='Debtors - _TC',
account_for_change_amount='Cash - _TC', warehouse='Stores - _TC', income_account='Sales - _TC',
expense_account='Cost of Goods Sold - _TC', cost_center='Main - _TC',
item=se.get("items")[0].item_code, rate=1000, do_not_save=1)
pos2.get("items")[0].serial_no = serial_nos[0]
pos2.append("payments", {'mode_of_payment': 'Bank Draft', 'account': '_Test Bank - _TC', 'amount': 1000})
self.assertRaises(frappe.ValidationError, pos2.insert)
def test_loyalty_points(self):
from erpnext.accounts.doctype.loyalty_program.test_loyalty_program import create_records
from erpnext.accounts.doctype.loyalty_program.loyalty_program import get_loyalty_program_details_with_points
@@ -370,7 +412,6 @@ class TestPOSInvoice(unittest.TestCase):
pos_inv.load_from_db()
rounded_total = frappe.db.get_value("Sales Invoice", pos_inv.consolidated_invoice, "rounded_total")
self.assertEqual(rounded_total, 3470)
frappe.set_user("Administrator")
def test_merging_into_sales_invoice_with_discount_and_inclusive_tax(self):
from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile
@@ -412,7 +453,6 @@ class TestPOSInvoice(unittest.TestCase):
pos_inv.load_from_db()
rounded_total = frappe.db.get_value("Sales Invoice", pos_inv.consolidated_invoice, "rounded_total")
self.assertEqual(rounded_total, 840)
frappe.set_user("Administrator")
def test_merging_with_validate_selling_price(self):
from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile
@@ -421,10 +461,12 @@ class TestPOSInvoice(unittest.TestCase):
if not frappe.db.get_single_value("Selling Settings", "validate_selling_price"):
frappe.db.set_value("Selling Settings", "Selling Settings", "validate_selling_price", 1)
make_purchase_receipt(item_code="_Test Item", warehouse="_Test Warehouse - _TC", qty=1, rate=300)
item = "Test Selling Price Validation"
make_item(item, {"is_stock_item": 1})
make_purchase_receipt(item_code=item, warehouse="_Test Warehouse - _TC", qty=1, rate=300)
frappe.db.sql("delete from `tabPOS Invoice`")
test_user, pos_profile = init_user_and_profile()
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv = create_pos_invoice(item=item, rate=300, do_not_submit=1)
pos_inv.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 300
})
@@ -438,7 +480,7 @@ class TestPOSInvoice(unittest.TestCase):
})
self.assertRaises(frappe.ValidationError, pos_inv.submit)
pos_inv2 = create_pos_invoice(rate=400, do_not_submit=1)
pos_inv2 = create_pos_invoice(item=item, rate=400, do_not_submit=1)
pos_inv2.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 400
})
@@ -457,8 +499,6 @@ class TestPOSInvoice(unittest.TestCase):
pos_inv2.load_from_db()
rounded_total = frappe.db.get_value("Sales Invoice", pos_inv2.consolidated_invoice, "rounded_total")
self.assertEqual(rounded_total, 400)
frappe.set_user("Administrator")
frappe.db.set_value("Selling Settings", "Selling Settings", "validate_selling_price", 0)
def create_pos_invoice(**args):
args = frappe._dict(args)
@@ -508,4 +548,4 @@ def create_pos_invoice(**args):
else:
pos_inv.payment_schedule = []
return pos_inv
return pos_inv

View File

@@ -12,8 +12,8 @@ from frappe.utils.background_jobs import enqueue
from frappe.model.mapper import map_doc, map_child_doc
from frappe.utils.scheduler import is_scheduler_inactive
from frappe.core.page.background_jobs.background_jobs import get_info
from six import iteritems
import json
import six
class POSInvoiceMergeLog(Document):
def validate(self):
@@ -42,8 +42,9 @@ class POSInvoiceMergeLog(Document):
if return_against_status != "Consolidated":
# if return entry is not getting merged in the current pos closing and if it is not consolidated
bold_unconsolidated = frappe.bold("not Consolidated")
msg = (_("Row #{}: Original Invoice {} of return invoice {} is {}. ")
msg = (_("Row #{}: Original Invoice {} of return invoice {} is {}.")
.format(d.idx, bold_return_against, bold_pos_invoice, bold_unconsolidated))
msg += " "
msg += _("Original invoice should be consolidated before or along with the return invoice.")
msg += "<br><br>"
msg += _("You can add original invoice {} manually to proceed.").format(bold_return_against)
@@ -56,12 +57,12 @@ class POSInvoiceMergeLog(Document):
sales = [d for d in pos_invoice_docs if d.get('is_return') == 0]
sales_invoice, credit_note = "", ""
if sales:
sales_invoice = self.process_merging_into_sales_invoice(sales)
if returns:
credit_note = self.process_merging_into_credit_note(returns)
if sales:
sales_invoice = self.process_merging_into_sales_invoice(sales)
self.save() # save consolidated_sales_invoice & consolidated_credit_note ref in merge log
self.update_pos_invoices(pos_invoice_docs, sales_invoice, credit_note)
@@ -78,8 +79,11 @@ class POSInvoiceMergeLog(Document):
sales_invoice = self.merge_pos_invoice_into(sales_invoice, data)
sales_invoice.is_consolidated = 1
sales_invoice.set_posting_time = 1
sales_invoice.posting_date = getdate(self.posting_date)
sales_invoice.save()
sales_invoice.submit()
self.consolidated_invoice = sales_invoice.name
return sales_invoice.name
@@ -91,10 +95,13 @@ class POSInvoiceMergeLog(Document):
credit_note = self.merge_pos_invoice_into(credit_note, data)
credit_note.is_consolidated = 1
credit_note.set_posting_time = 1
credit_note.posting_date = getdate(self.posting_date)
# TODO: return could be against multiple sales invoice which could also have been consolidated?
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
credit_note.submit()
self.consolidated_credit_note = credit_note.name
return credit_note.name
@@ -131,12 +138,14 @@ class POSInvoiceMergeLog(Document):
if t.account_head == tax.account_head and t.cost_center == tax.cost_center:
t.tax_amount = flt(t.tax_amount) + flt(tax.tax_amount_after_discount_amount)
t.base_tax_amount = flt(t.base_tax_amount) + flt(tax.base_tax_amount_after_discount_amount)
update_item_wise_tax_detail(t, tax)
found = True
if not found:
tax.charge_type = 'Actual'
tax.included_in_print_rate = 0
tax.tax_amount = tax.tax_amount_after_discount_amount
tax.base_tax_amount = tax.base_tax_amount_after_discount_amount
tax.item_wise_tax_detail = tax.item_wise_tax_detail
taxes.append(tax)
for payment in doc.get('payments'):
@@ -168,11 +177,9 @@ class POSInvoiceMergeLog(Document):
sales_invoice = frappe.new_doc('Sales Invoice')
sales_invoice.customer = self.customer
sales_invoice.is_pos = 1
# date can be pos closing date?
sales_invoice.posting_date = getdate(nowdate())
return sales_invoice
def update_pos_invoices(self, invoice_docs, sales_invoice='', credit_note=''):
for doc in invoice_docs:
doc.load_from_db()
@@ -187,6 +194,26 @@ class POSInvoiceMergeLog(Document):
si.flags.ignore_validate = True
si.cancel()
def update_item_wise_tax_detail(consolidate_tax_row, tax_row):
consolidated_tax_detail = json.loads(consolidate_tax_row.item_wise_tax_detail)
tax_row_detail = json.loads(tax_row.item_wise_tax_detail)
if not consolidated_tax_detail:
consolidated_tax_detail = {}
for item_code, tax_data in tax_row_detail.items():
if consolidated_tax_detail.get(item_code):
consolidated_tax_data = consolidated_tax_detail.get(item_code)
consolidated_tax_detail.update({
item_code: [consolidated_tax_data[0], consolidated_tax_data[1] + tax_data[1]]
})
else:
consolidated_tax_detail.update({
item_code: [tax_data[0], tax_data[1]]
})
consolidate_tax_row.item_wise_tax_detail = json.dumps(consolidated_tax_detail, separators=(',', ':'))
def get_all_unconsolidated_invoices():
filters = {
'consolidated_invoice': [ 'in', [ '', None ]],
@@ -208,13 +235,13 @@ def get_invoice_customer_map(pos_invoices):
return pos_invoice_customer_map
def consolidate_pos_invoices(pos_invoices=[], closing_entry={}):
invoices = pos_invoices or closing_entry.get('pos_transactions') or get_all_unconsolidated_invoices()
def consolidate_pos_invoices(pos_invoices=None, closing_entry=None):
invoices = pos_invoices or (closing_entry and closing_entry.get('pos_transactions')) or get_all_unconsolidated_invoices()
invoice_by_customer = get_invoice_customer_map(invoices)
if len(invoices) >= 5 and closing_entry:
if len(invoices) >= 10 and closing_entry:
closing_entry.set_status(update=True, status='Queued')
enqueue_job(create_merge_logs, invoice_by_customer, closing_entry)
enqueue_job(create_merge_logs, invoice_by_customer=invoice_by_customer, closing_entry=closing_entry)
else:
create_merge_logs(invoice_by_customer, closing_entry)
@@ -225,50 +252,83 @@ def unconsolidate_pos_invoices(closing_entry):
pluck='name'
)
if len(merge_logs) >= 5:
if len(merge_logs) >= 10:
closing_entry.set_status(update=True, status='Queued')
enqueue_job(cancel_merge_logs, merge_logs, closing_entry)
enqueue_job(cancel_merge_logs, merge_logs=merge_logs, closing_entry=closing_entry)
else:
cancel_merge_logs(merge_logs, closing_entry)
def create_merge_logs(invoice_by_customer, closing_entry={}):
for customer, invoices in iteritems(invoice_by_customer):
merge_log = frappe.new_doc('POS Invoice Merge Log')
merge_log.posting_date = getdate(nowdate())
merge_log.customer = customer
merge_log.pos_closing_entry = closing_entry.get('name', None)
def create_merge_logs(invoice_by_customer, closing_entry=None):
try:
for customer, invoices in six.iteritems(invoice_by_customer):
merge_log = frappe.new_doc('POS Invoice Merge Log')
merge_log.posting_date = getdate(closing_entry.get('posting_date')) if closing_entry else nowdate()
merge_log.customer = customer
merge_log.pos_closing_entry = closing_entry.get('name') if closing_entry else None
merge_log.set('pos_invoices', invoices)
merge_log.save(ignore_permissions=True)
merge_log.submit()
if closing_entry:
closing_entry.set_status(update=True, status='Submitted')
closing_entry.update_opening_entry()
merge_log.set('pos_invoices', invoices)
merge_log.save(ignore_permissions=True)
merge_log.submit()
def cancel_merge_logs(merge_logs, closing_entry={}):
for log in merge_logs:
merge_log = frappe.get_doc('POS Invoice Merge Log', log)
merge_log.flags.ignore_permissions = True
merge_log.cancel()
if closing_entry:
closing_entry.set_status(update=True, status='Submitted')
closing_entry.db_set('error_message', '')
closing_entry.update_opening_entry()
if closing_entry:
closing_entry.set_status(update=True, status='Cancelled')
closing_entry.update_opening_entry(for_cancel=True)
except Exception as e:
frappe.db.rollback()
message_log = frappe.message_log.pop() if frappe.message_log else str(e)
error_message = safe_load_json(message_log)
def enqueue_job(job, invoice_by_customer, closing_entry):
if closing_entry:
closing_entry.set_status(update=True, status='Failed')
closing_entry.db_set('error_message', error_message)
raise
finally:
frappe.db.commit()
frappe.publish_realtime('closing_process_complete', {'user': frappe.session.user})
def cancel_merge_logs(merge_logs, closing_entry=None):
try:
for log in merge_logs:
merge_log = frappe.get_doc('POS Invoice Merge Log', log)
merge_log.flags.ignore_permissions = True
merge_log.cancel()
if closing_entry:
closing_entry.set_status(update=True, status='Cancelled')
closing_entry.db_set('error_message', '')
closing_entry.update_opening_entry(for_cancel=True)
except Exception as e:
frappe.db.rollback()
message_log = frappe.message_log.pop() if frappe.message_log else str(e)
error_message = safe_load_json(message_log)
if closing_entry:
closing_entry.set_status(update=True, status='Submitted')
closing_entry.db_set('error_message', error_message)
raise
finally:
frappe.db.commit()
frappe.publish_realtime('closing_process_complete', {'user': frappe.session.user})
def enqueue_job(job, **kwargs):
check_scheduler_status()
closing_entry = kwargs.get('closing_entry') or {}
job_name = closing_entry.get("name")
if not job_already_enqueued(job_name):
enqueue(
job,
**kwargs,
queue="long",
timeout=10000,
event="processing_merge_logs",
job_name=job_name,
closing_entry=closing_entry,
invoice_by_customer=invoice_by_customer,
now=frappe.conf.developer_mode or frappe.flags.in_test
)
@@ -286,4 +346,12 @@ def check_scheduler_status():
def job_already_enqueued(job_name):
enqueued_jobs = [d.get("job_name") for d in get_info()]
if job_name in enqueued_jobs:
return True
return True
def safe_load_json(message):
try:
json_message = json.loads(message).get('message')
except Exception:
json_message = message
return json_message

View File

@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe
import unittest
import json
from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_invoice
from erpnext.accounts.doctype.pos_invoice.pos_invoice import make_sales_return
from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import consolidate_pos_invoices
@@ -14,85 +15,136 @@ class TestPOSInvoiceMergeLog(unittest.TestCase):
def test_consolidated_invoice_creation(self):
frappe.db.sql("delete from `tabPOS Invoice`")
test_user, pos_profile = init_user_and_profile()
try:
test_user, pos_profile = init_user_and_profile()
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 300
})
pos_inv.submit()
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 300
})
pos_inv.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 3200
})
pos_inv2.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 3200
})
pos_inv2.submit()
pos_inv3 = create_pos_invoice(customer="_Test Customer 2", rate=2300, do_not_submit=1)
pos_inv3.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 2300
})
pos_inv3.submit()
pos_inv3 = create_pos_invoice(customer="_Test Customer 2", rate=2300, do_not_submit=1)
pos_inv3.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 2300
})
pos_inv3.submit()
consolidate_pos_invoices()
consolidate_pos_invoices()
pos_inv.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv.consolidated_invoice))
pos_inv.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv.consolidated_invoice))
pos_inv3.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv3.consolidated_invoice))
pos_inv3.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv3.consolidated_invoice))
self.assertFalse(pos_inv.consolidated_invoice == pos_inv3.consolidated_invoice)
self.assertFalse(pos_inv.consolidated_invoice == pos_inv3.consolidated_invoice)
finally:
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
frappe.db.sql("delete from `tabPOS Invoice`")
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
frappe.db.sql("delete from `tabPOS Invoice`")
def test_consolidated_credit_note_creation(self):
frappe.db.sql("delete from `tabPOS Invoice`")
test_user, pos_profile = init_user_and_profile()
try:
test_user, pos_profile = init_user_and_profile()
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 300
})
pos_inv.submit()
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 300
})
pos_inv.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 3200
})
pos_inv2.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 3200
})
pos_inv2.submit()
pos_inv3 = create_pos_invoice(customer="_Test Customer 2", rate=2300, do_not_submit=1)
pos_inv3.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 2300
})
pos_inv3.submit()
pos_inv3 = create_pos_invoice(customer="_Test Customer 2", rate=2300, do_not_submit=1)
pos_inv3.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 2300
})
pos_inv3.submit()
pos_inv_cn = make_sales_return(pos_inv.name)
pos_inv_cn.set("payments", [])
pos_inv_cn.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': -300
})
pos_inv_cn.paid_amount = -300
pos_inv_cn.submit()
pos_inv_cn = make_sales_return(pos_inv.name)
pos_inv_cn.set("payments", [])
pos_inv_cn.append('payments', {
'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': -300
})
pos_inv_cn.paid_amount = -300
pos_inv_cn.submit()
consolidate_pos_invoices()
consolidate_pos_invoices()
pos_inv.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv.consolidated_invoice))
pos_inv.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv.consolidated_invoice))
pos_inv3.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv3.consolidated_invoice))
pos_inv3.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv3.consolidated_invoice))
pos_inv_cn.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv_cn.consolidated_invoice))
self.assertTrue(frappe.db.get_value("Sales Invoice", pos_inv_cn.consolidated_invoice, "is_return"))
pos_inv_cn.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv_cn.consolidated_invoice))
self.assertTrue(frappe.db.get_value("Sales Invoice", pos_inv_cn.consolidated_invoice, "is_return"))
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
finally:
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
frappe.db.sql("delete from `tabPOS Invoice`")
def test_consolidated_invoice_item_taxes(self):
frappe.db.sql("delete from `tabPOS Invoice`")
try:
inv = create_pos_invoice(qty=1, rate=100, do_not_save=True)
inv.append("taxes", {
"account_head": "_Test Account VAT - _TC",
"charge_type": "On Net Total",
"cost_center": "_Test Cost Center - _TC",
"description": "VAT",
"doctype": "Sales Taxes and Charges",
"rate": 9
})
inv.insert()
inv.submit()
inv2 = create_pos_invoice(qty=1, rate=100, do_not_save=True)
inv2.get('items')[0].item_code = '_Test Item 2'
inv2.append("taxes", {
"account_head": "_Test Account VAT - _TC",
"charge_type": "On Net Total",
"cost_center": "_Test Cost Center - _TC",
"description": "VAT",
"doctype": "Sales Taxes and Charges",
"rate": 5
})
inv2.insert()
inv2.submit()
consolidate_pos_invoices()
inv.load_from_db()
consolidated_invoice = frappe.get_doc('Sales Invoice', inv.consolidated_invoice)
item_wise_tax_detail = json.loads(consolidated_invoice.get('taxes')[0].item_wise_tax_detail)
tax_rate, amount = item_wise_tax_detail.get('_Test Item')
self.assertEqual(tax_rate, 9)
self.assertEqual(amount, 9)
tax_rate2, amount2 = item_wise_tax_detail.get('_Test Item 2')
self.assertEqual(tax_rate2, 5)
self.assertEqual(amount2, 5)
finally:
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
frappe.db.sql("delete from `tabPOS Invoice`")

View File

@@ -0,0 +1,37 @@
{
"actions": [],
"creation": "2021-04-19 14:56:06.652327",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"field",
"fieldname"
],
"fields": [
{
"fieldname": "fieldname",
"fieldtype": "Data",
"hidden": 1,
"label": "Fieldname"
},
{
"fieldname": "field",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Field"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-04-21 11:12:54.632093",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Search Fields",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class POSSearchFields(Document):
pass

View File

@@ -1,9 +1,17 @@
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
let search_fields_datatypes = ['Data', 'Link', 'Dynamic Link', 'Long Text', 'Select', 'Small Text', 'Text', 'Text Editor'];
let do_not_include_fields = ["naming_series", "item_code", "item_name", "stock_uom", "hub_sync_id", "asset_naming_series",
"default_material_request_type", "valuation_method", "warranty_period", "weight_uom", "batch_number_series",
"serial_no_series", "purchase_uom", "customs_tariff_number", "sales_uom", "deferred_revenue_account",
"deferred_expense_account", "quality_inspection_template", "route", "slideshow", "website_image_alt", "thumbnail",
"web_long_description", "hub_sync_id"]
frappe.ui.form.on('POS Settings', {
onload: function(frm) {
frm.trigger("get_invoice_fields");
frm.trigger("add_search_options");
},
get_invoice_fields: function(frm) {
@@ -16,8 +24,43 @@ frappe.ui.form.on('POS Settings', {
}
});
frappe.meta.get_docfield("POS Field", "fieldname", frm.doc.name).options = [""].concat(fields);
frm.fields_dict.invoice_fields.grid.update_docfield_property(
'fieldname', 'options', [""].concat(fields)
);
});
},
add_search_options: function(frm) {
frappe.model.with_doctype("Item", () => {
var fields = $.map(frappe.get_doc("DocType", "Item").fields, function(d) {
if (search_fields_datatypes.includes(d.fieldtype) && !(do_not_include_fields.includes(d.fieldname))) {
return [d.label];
} else {
return null;
}
});
fields.unshift('');
frm.fields_dict.pos_search_fields.grid.update_docfield_property('field', 'options', fields);
});
}
});
frappe.ui.form.on("POS Search Fields", {
field: function(frm, doctype, name) {
var doc = frappe.get_doc(doctype, name);
var df = $.map(frappe.get_doc("DocType", "Item").fields, function(d) {
if (doc.field == d.label && search_fields_datatypes.includes(d.fieldtype)) {
return d;
} else {
return null;
}
})[0];
doc.fieldname = df.fieldname;
frm.refresh_field("fields");
}
});

View File

@@ -5,7 +5,8 @@
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"invoice_fields"
"invoice_fields",
"pos_search_fields"
],
"fields": [
{
@@ -13,11 +14,17 @@
"fieldtype": "Table",
"label": "POS Field",
"options": "POS Field"
},
{
"fieldname": "pos_search_fields",
"fieldtype": "Table",
"label": "POS Search Fields",
"options": "POS Search Fields"
}
],
"issingle": 1,
"links": [],
"modified": "2020-06-01 15:46:41.478928",
"modified": "2021-04-19 14:56:24.465218",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Settings",

View File

@@ -152,7 +152,7 @@ class PricingRule(Document):
frappe.throw(_("Valid from date must be less than valid upto date"))
def validate_condition(self):
if self.condition and ("=" in self.condition) and re.match("""[\w\.:_]+\s*={1}\s*[\w\.@'"]+""", self.condition):
if self.condition and ("=" in self.condition) and re.match(r'[\w\.:_]+\s*={1}\s*[\w\.@\'"]+', self.condition):
frappe.throw(_("Invalid condition expression"))
#--------------------------------------------------------------------------------

View File

@@ -99,7 +99,7 @@ class TestPricingRule(unittest.TestCase):
args.item_code = "_Test Item 2"
details = get_item_details(args)
self.assertEquals(details.get("discount_percentage"), 15)
self.assertEqual(details.get("discount_percentage"), 15)
def test_pricing_rule_for_margin(self):
from erpnext.stock.get_item_details import get_item_details
@@ -145,8 +145,8 @@ class TestPricingRule(unittest.TestCase):
"name": None
})
details = get_item_details(args)
self.assertEquals(details.get("margin_type"), "Percentage")
self.assertEquals(details.get("margin_rate_or_amount"), 10)
self.assertEqual(details.get("margin_type"), "Percentage")
self.assertEqual(details.get("margin_rate_or_amount"), 10)
def test_mixed_conditions_for_item_group(self):
for item in ["Mixed Cond Item 1", "Mixed Cond Item 2"]:
@@ -192,7 +192,7 @@ class TestPricingRule(unittest.TestCase):
"name": None
})
details = get_item_details(args)
self.assertEquals(details.get("discount_percentage"), 10)
self.assertEqual(details.get("discount_percentage"), 10)
def test_pricing_rule_for_variants(self):
from erpnext.stock.get_item_details import get_item_details
@@ -322,11 +322,11 @@ class TestPricingRule(unittest.TestCase):
si.insert(ignore_permissions=True)
item = si.items[0]
self.assertEquals(item.margin_rate_or_amount, 10)
self.assertEquals(item.rate_with_margin, 1100)
self.assertEqual(item.margin_rate_or_amount, 10)
self.assertEqual(item.rate_with_margin, 1100)
self.assertEqual(item.discount_percentage, 10)
self.assertEquals(item.discount_amount, 110)
self.assertEquals(item.rate, 990)
self.assertEqual(item.discount_amount, 110)
self.assertEqual(item.rate, 990)
def test_pricing_rule_with_margin_and_discount_amount(self):
frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule')
@@ -338,10 +338,10 @@ class TestPricingRule(unittest.TestCase):
si.insert(ignore_permissions=True)
item = si.items[0]
self.assertEquals(item.margin_rate_or_amount, 10)
self.assertEquals(item.rate_with_margin, 1100)
self.assertEquals(item.discount_amount, 110)
self.assertEquals(item.rate, 990)
self.assertEqual(item.margin_rate_or_amount, 10)
self.assertEqual(item.rate_with_margin, 1100)
self.assertEqual(item.discount_amount, 110)
self.assertEqual(item.rate, 990)
def test_pricing_rule_for_product_discount_on_same_item(self):
frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule')
@@ -458,21 +458,21 @@ class TestPricingRule(unittest.TestCase):
si.items[0].price_list_rate = 1000
si.submit()
item = si.items[0]
self.assertEquals(item.rate, 100)
self.assertEqual(item.rate, 100)
# Correct Customer and Incorrect is_return value
si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", is_return=1, qty=-1)
si.items[0].price_list_rate = 1000
si.submit()
item = si.items[0]
self.assertEquals(item.rate, 100)
self.assertEqual(item.rate, 100)
# Correct Customer and correct is_return value
si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", is_return=0)
si.items[0].price_list_rate = 1000
si.submit()
item = si.items[0]
self.assertEquals(item.rate, 900)
self.assertEqual(item.rate, 900)
def test_multiple_pricing_rules(self):
make_pricing_rule(discount_percentage=20, selling=1, priority=1, apply_multiple_pricing_rules=1,
@@ -545,11 +545,11 @@ class TestPricingRule(unittest.TestCase):
apply_on="Transaction", free_item="Water Flask 1", free_qty=1, free_item_rate=10)
si = create_sales_invoice(qty=5, do_not_submit=True)
self.assertEquals(len(si.items), 2)
self.assertEquals(si.items[1].rate, 10)
self.assertEqual(len(si.items), 2)
self.assertEqual(si.items[1].rate, 10)
si1 = create_sales_invoice(qty=2, do_not_submit=True)
self.assertEquals(len(si1.items), 1)
self.assertEqual(len(si1.items), 1)
for doc in [si, si1]:
doc.delete()

View File

@@ -20,9 +20,9 @@ from frappe.utils import cint, flt, get_link_to_form, getdate, today, fmt_money
class MultiplePricingRuleConflict(frappe.ValidationError): pass
apply_on_table = {
'Item Code': 'items',
'Item Group': 'item_groups',
'Brand': 'brands'
'Item Code': 'items',
'Item Group': 'item_groups',
'Brand': 'brands'
}
def get_pricing_rules(args, doc=None):
@@ -173,7 +173,7 @@ def _get_tree_conditions(args, parenttype, table, allow_blank=True):
if parenttype in ["Customer Group", "Item Group", "Territory"]:
parent_field = "parent_{0}".format(frappe.scrub(parenttype))
root_name = frappe.db.get_list(parenttype,
{"is_group": 1, parent_field: ("is", "not set")}, "name", as_list=1)
{"is_group": 1, parent_field: ("is", "not set")}, "name", as_list=1, ignore_permissions=True)
if root_name and root_name[0][0]:
parent_groups.append(root_name[0][0])
@@ -183,7 +183,7 @@ def _get_tree_conditions(args, parenttype, table, allow_blank=True):
condition = "ifnull({table}.{field}, '') in ({parent_groups})".format(
table=table,
field=field,
parent_groups=", ".join([frappe.db.escape(d) for d in parent_groups])
parent_groups=", ".join(frappe.db.escape(d) for d in parent_groups)
)
frappe.flags.tree_conditions[key] = condition
@@ -264,7 +264,7 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
# find pricing rule with highest priority
if pricing_rules:
max_priority = max([cint(p.priority) for p in pricing_rules])
max_priority = max(cint(p.priority) for p in pricing_rules)
if max_priority:
pricing_rules = list(filter(lambda x: cint(x.priority)==max_priority, pricing_rules))
@@ -272,14 +272,14 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
pricing_rules = list(pricing_rules)
if len(pricing_rules) > 1:
rate_or_discount = list(set([d.rate_or_discount for d in pricing_rules]))
rate_or_discount = list(set(d.rate_or_discount for d in pricing_rules))
if len(rate_or_discount) == 1 and rate_or_discount[0] == "Discount Percentage":
pricing_rules = list(filter(lambda x: x.for_price_list==args.price_list, pricing_rules)) \
or pricing_rules
if len(pricing_rules) > 1 and not args.for_shopping_cart:
frappe.throw(_("Multiple Price Rules exists with same criteria, please resolve conflict by assigning priority. Price Rules: {0}")
.format("\n".join([d.name for d in pricing_rules])), MultiplePricingRuleConflict)
.format("\n".join(d.name for d in pricing_rules)), MultiplePricingRuleConflict)
elif pricing_rules:
return pricing_rules[0]
@@ -471,7 +471,7 @@ def apply_pricing_rule_on_transaction(doc):
if not d.get(pr_field): continue
if d.validate_applied_rule and doc.get(field) < d.get(pr_field):
if d.validate_applied_rule and doc.get(field) is not None and doc.get(field) < d.get(pr_field):
frappe.msgprint(_("User has not applied rule on the invoice {0}")
.format(doc.name))
else:
@@ -541,7 +541,7 @@ def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None):
def apply_pricing_rule_for_free_items(doc, pricing_rule_args, set_missing_values=False):
if pricing_rule_args:
items = tuple([(d.item_code, d.pricing_rules) for d in doc.items if d.is_free_item])
items = tuple((d.item_code, d.pricing_rules) for d in doc.items if d.is_free_item)
for args in pricing_rule_args:
if not items or (args.get('item_code'), args.get('pricing_rules')) not in items:
@@ -589,4 +589,4 @@ def update_coupon_code_count(coupon_name,transaction_type):
elif transaction_type=='cancelled':
if coupon.used>0:
coupon.used=coupon.used-1
coupon.save(ignore_permissions=True)
coupon.save(ignore_permissions=True)

View File

@@ -1,25 +1,43 @@
<h1 class="text-center" style="page-break-before:always">{{ filters.party[0] }}</h1>
<h3 class="text-center">{{ _("Statement of Accounts") }}</h3>
<div class="page-break">
<div id="header-html" class="hidden-pdf">
{% if letter_head %}
<div class="letter-head text-center">{{ letter_head.content }}</div>
<hr style="height:2px;border-width:0;color:black;background-color:black;">
{% endif %}
</div>
<div id="footer-html" class="visible-pdf">
{% if letter_head.footer %}
<div class="letter-head-footer">
<hr style="border-width:0;color:black;background-color:black;padding-bottom:2px;">
{{ letter_head.footer }}
</div>
{% endif %}
</div>
<h2 class="text-center">{{ _("STATEMENTS OF ACCOUNTS") }}</h2>
<div>
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{filters.party[0] }}</b></h5>
<h5 style="float: right;">
{{ _("Date: ") }}
<b>{{ frappe.format(filters.from_date, 'Date')}}
{{ _("to") }}
{{ frappe.format(filters.to_date, 'Date')}}</b>
</h5>
</div>
<br>
<h5 class="text-center">
{{ frappe.format(filters.from_date, 'Date')}}
{{ _("to") }}
{{ frappe.format(filters.to_date, 'Date')}}
</h5>
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 12%">{{ _("Date") }}</th>
<th style="width: 15%">{{ _("Ref") }}</th>
<th style="width: 25%">{{ _("Party") }}</th>
<th style="width: 15%">{{ _("Debit") }}</th>
<th style="width: 15%">{{ _("Credit") }}</th>
<th style="width: 18%">{{ _("Balance (Dr - Cr)") }}</th>
</tr>
</thead>
<tbody>
{% for row in data %}
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 12%">{{ _("Date") }}</th>
<th style="width: 15%">{{ _("Reference") }}</th>
<th style="width: 25%">{{ _("Remarks") }}</th>
<th style="width: 15%">{{ _("Debit") }}</th>
<th style="width: 15%">{{ _("Credit") }}</th>
<th style="width: 18%">{{ _("Balance (Dr - Cr)") }}</th>
</tr>
</thead>
<tbody>
{% for row in data %}
<tr>
{% if(row.posting_date) %}
<td>{{ frappe.format(row.posting_date, 'Date') }}</td>
@@ -38,52 +56,54 @@
{% endif %}
</td>
<td style="text-align: right">
{{ frappe.utils.fmt_money(row.debit, filters.presentation_currency) }}</td>
{{ frappe.utils.fmt_money(row.debit, currency=filters.presentation_currency) }}</td>
<td style="text-align: right">
{{ frappe.utils.fmt_money(row.credit, filters.presentation_currency) }}</td>
{{ frappe.utils.fmt_money(row.credit, currency=filters.presentation_currency) }}</td>
{% else %}
<td></td>
<td></td>
<td><b>{{ frappe.format(row.account, {fieldtype: "Link"}) or "&nbsp;" }}</b></td>
<td style="text-align: right">
{{ row.account and frappe.utils.fmt_money(row.debit, filters.presentation_currency) }}
{{ row.account and frappe.utils.fmt_money(row.debit, currency=filters.presentation_currency) }}
</td>
<td style="text-align: right">
{{ row.account and frappe.utils.fmt_money(row.credit, filters.presentation_currency) }}
{{ row.account and frappe.utils.fmt_money(row.credit, currency=filters.presentation_currency) }}
</td>
{% endif %}
<td style="text-align: right">
{{ frappe.utils.fmt_money(row.balance, filters.presentation_currency) }}
{{ frappe.utils.fmt_money(row.balance, currency=filters.presentation_currency) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<br><br>
{% if aging %}
<h3 class="text-center">{{ _("Ageing Report Based On ") }} {{ aging.ageing_based_on }}</h3>
<h5 class="text-center">
{{ _("Up to " ) }} {{ frappe.format(filters.to_date, 'Date')}}
</h5>
<br>
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 12%">30 Days</th>
<th style="width: 15%">60 Days</th>
<th style="width: 25%">90 Days</th>
<th style="width: 15%">120 Days</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ aging.range1 }}</td>
<td>{{ aging.range2 }}</td>
<td>{{ aging.range3 }}</td>
<td>{{ aging.range4 }}</td>
</tr>
</tbody>
</table>
{% endif %}
<p class="text-right text-muted">Printed On {{ frappe.format(frappe.utils.get_datetime(), 'Datetime') }}</p>
</table>
<br>
{% if ageing %}
<h4 class="text-center">{{ _("Ageing Report based on ") }} {{ ageing.ageing_based_on }}
{{ _("up to " ) }} {{ frappe.format(filters.to_date, 'Date')}}
</h4>
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 25%">30 Days</th>
<th style="width: 25%">60 Days</th>
<th style="width: 25%">90 Days</th>
<th style="width: 25%">120 Days</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ frappe.utils.fmt_money(ageing.range1, currency=filters.presentation_currency) }}</td>
<td>{{ frappe.utils.fmt_money(ageing.range2, currency=filters.presentation_currency) }}</td>
<td>{{ frappe.utils.fmt_money(ageing.range3, currency=filters.presentation_currency) }}</td>
<td>{{ frappe.utils.fmt_money(ageing.range4, currency=filters.presentation_currency) }}</td>
</tr>
</tbody>
</table>
{% endif %}
{% if terms_and_conditions %}
<div>
{{ terms_and_conditions }}
</div>
{% endif %}
</div>

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