Compare commits

...

1409 Commits

Author SHA1 Message Date
Rushabh Mehta
d55d0c06e3 Merge branch 'develop' 2015-12-23 16:29:34 +05:30
Rushabh Mehta
8681a95010 bumped to version 6.14.1 2015-12-23 16:59:34 +06:00
Rushabh Mehta
1f63747916 [minor] [fix] add child in sales browser 2015-12-23 16:23:37 +05:30
Rushabh Mehta
332ec15dd7 Merge pull request #4525 from nabinhait/jv_fix_10
[fix] Validate advance entry based on party
2015-12-23 16:09:29 +05:30
Nabin Hait
6f8dafbb5e [fix] Validate advance entry based on party 2015-12-23 13:03:31 +05:30
Rushabh Mehta
d4073d50b2 Merge pull request #4530 from umairsy/develop
Updated screenshots in some articles
2015-12-23 13:01:30 +05:30
Rushabh Mehta
88bcee78a7 Merge pull request #4524 from nabinhait/jv_fix_9
[fix] Set debit/credit in company currency
2015-12-23 12:59:02 +05:30
Rushabh Mehta
cc2796e676 Merge pull request #4520 from partzsch/develop
Time Log now down to seconds
2015-12-23 12:56:44 +05:30
Umair Sayyed
dbaf6b569b Updated screenshots in some articles 2015-12-23 12:11:53 +05:30
Nabin Hait
d37cef7f60 [fix] Set debit/credit in company currency 2015-12-22 15:13:01 +05:30
Rushabh Mehta
01293bb3a3 [fix] [minor] fix available qty even if 0 2015-12-22 12:57:42 +05:30
partzsch
55ad42cfd0 Time Log now down to seconds
according to request of @anadpdoshi
new branch new commit new PR
2015-12-21 17:51:42 +01:00
Anand Doshi
381cec7b87 [fix] added Shopping Cart and Report Builder in Learn module 2015-12-21 18:56:20 +05:30
Anand Doshi
4c87497b7c Merge branch 'develop' 2015-12-21 18:34:08 +05:30
Anand Doshi
9fdf2a8bfe bumped to version 6.14.0 2015-12-21 19:04:08 +06:00
Anand Doshi
f773f1f539 [videos] added missing videos 2015-12-21 18:32:23 +05:30
Anand Doshi
7b8a224dd0 Merge pull request #4519 from umairsy/develop
video help page on report builder and shopping cart
2015-12-21 18:16:26 +05:30
Umair Sayyed
e1482f1acc video help page on report builder and shopping cart 2015-12-21 18:06:15 +05:30
Anand Doshi
c98d244af0 [change-log] 2015-12-21 17:31:09 +05:30
Anand Doshi
ee19fc0c7f [translations] + added Gujarati - Fixes frappe/translator#63 2015-12-21 17:10:20 +05:30
Anand Doshi
ee2129ce1c Merge pull request #4513 from nabinhait/discount_percentage
Additional Discount amount based on percentage
2015-12-21 16:13:17 +05:30
Anand Doshi
beed9ae4f8 Merge pull request #4510 from nabinhait/account_merge
[fix] Group account merging with sub-ordinate group
2015-12-21 16:03:19 +05:30
Anand Doshi
50ddf921be [minor] UOM message 2015-12-21 10:58:33 +05:30
Nabin Hait
3769d87240 Additional Discount amount based on percentage 2015-12-18 13:12:08 +05:30
Anand Doshi
15050e326c Merge pull request #4509 from anandpdoshi/fix/validate-total-transfer-in-material-request
[fix] Validate transfer qty cannot be greater than qty
2015-12-18 10:50:36 +05:30
Anand Doshi
0f809426d2 [fix] Validate transfer qty cannot be greater than qty 2015-12-17 22:35:03 +05:30
Nabin Hait
adab5d308c [fix] Group account merging with sub-ordinate group 2015-12-17 12:53:25 +05:30
Nabin Hait
824122c42a Merge branch 'ccfiel-develop' into develop 2015-12-17 12:20:40 +05:30
Nabin Hait
afda26e4f3 Fixed conflict 2015-12-17 12:19:58 +05:30
Chris Ian Fiel
d6d354b5c3 By: nabinhait
Depreciation account is an expense account, it is debited while booking depreciation. Thats why Depreciation amount is coming as negative, I think it should be positive and added to the "Net Profit and Loss".
2015-12-17 09:42:12 +08:00
Chris Ian Fiel
7d310bd182 Merge branch 'develop' of https://github.com/frappe/erpnext into develop 2015-12-17 09:18:24 +08:00
Nabin Hait
8b33a6cdc0 Cleanup in cash flow 2015-12-16 16:09:43 +05:30
Anand Doshi
1abe550e65 Merge branch 'develop' 2015-12-16 13:18:41 +05:30
Anand Doshi
5605f8f20e bumped to version 6.13.1 2015-12-16 13:48:40 +06:00
Anand Doshi
a1580f2781 [language] Added Malayalam - Fixes frappe/translator#62 2015-12-16 13:17:24 +05:30
Anand Doshi
dfdededcf0 [fix] product search limit = 12 instead of 10, since we show it in a grid of 12 2015-12-16 12:57:02 +05:30
Rushabh Mehta
5aa744893d Merge pull request #4504 from venetanji/master
Changelog file naming issue
2015-12-16 10:32:52 +05:30
Giovanni Lion
55cca49371 Changelog file naming issue 2015-12-16 12:29:15 +08:00
Nabin Hait
5e173c7106 Merge branch 'develop' of https://github.com/ccfiel/erpnext into ccfiel-develop 2015-12-15 17:39:55 +05:30
Anand Doshi
cf3da35d67 Merge branch 'develop' 2015-12-15 17:33:02 +05:30
Anand Doshi
a17ddcfe89 bumped to version 6.13.0 2015-12-15 18:03:01 +06:00
Anand Doshi
088826f6f0 [change-log] 2015-12-15 17:28:34 +05:30
Anand Doshi
f89eaa96d1 [docs] Fixed heading and added attribution to 'CWT Connector & Wire Technology GmbH' for german docs 2015-12-15 17:22:15 +05:30
Martin Ender
e526cfe7ec Update concepts-and-terms.md 2015-12-15 17:22:15 +05:30
Martin Ender
21c189184d Update concepts-and-terms.md 2015-12-15 17:22:15 +05:30
Martin Ender
2aaebdbe11 Update concepts-and-terms.md 2015-12-15 17:22:14 +05:30
Martin Ender
cda3174a57 Update concepts-and-terms.md 2015-12-15 17:22:14 +05:30
Martin Ender
91eeb76f7b Update concepts-and-terms.md 2015-12-15 17:22:14 +05:30
Martin Ender
df18c29fb7 Update concepts-and-terms.md 2015-12-15 17:22:14 +05:30
Martin Ender
7aebb39003 Update implementation-strategy.md 2015-12-15 17:22:14 +05:30
Martin Ender
91bb25d0c9 Update implementation-strategy.md 2015-12-15 17:22:14 +05:30
Martin Ender
b89d7eb558 Update implementation-strategy.md 2015-12-15 17:22:14 +05:30
Martin Ender
ba004aab83 Update the-champion.md 2015-12-15 17:22:14 +05:30
Martin Ender
4c3762989b Update the-champion.md 2015-12-15 17:22:14 +05:30
Martin Ender
225b907a03 Update getting-started-with-erpnext.md 2015-12-15 17:22:14 +05:30
Martin Ender
b543861cbe Update getting-started-with-erpnext.md 2015-12-15 17:22:14 +05:30
Martin Ender
fc6595b92b Update getting-started-with-erpnext.md 2015-12-15 17:22:14 +05:30
Martin Ender
d11df3645b Update getting-started-with-erpnext.md 2015-12-15 17:22:13 +05:30
Martin Ender
ea4c83dcb3 Update open-source.md 2015-12-15 17:22:13 +05:30
Martin Ender
3d05635d7a Update open-source.md 2015-12-15 17:22:13 +05:30
Martin Ender
90b0db2d18 Update open-source.md 2015-12-15 17:22:13 +05:30
Martin Ender
91a71d4f2c Update open-source.md 2015-12-15 17:22:13 +05:30
Martin Ender
36ab7f01b4 Update do-i-need-an-erp.md 2015-12-15 17:22:13 +05:30
Martin Ender
130dd2da61 Update do-i-need-an-erp.md 2015-12-15 17:22:13 +05:30
Martin Ender
6d15d36639 Update do-i-need-an-erp.md 2015-12-15 17:22:13 +05:30
Martin Ender
4395d0bc4d Update do-i-need-an-erp.md 2015-12-15 17:22:13 +05:30
Martin Ender
6e4e2152af Update print-format.md 2015-12-15 17:22:13 +05:30
Martin Ender
fc5d5d1600 Create print-format.md 2015-12-15 17:22:13 +05:30
Martin Ender
180d7e9ceb Create hiding-modules-and-features.md 2015-12-15 17:22:12 +05:30
Martin Ender
7be281e712 Create document-title.md 2015-12-15 17:22:12 +05:30
Martin Ender
9d5f4f729e Update customize-form.md 2015-12-15 17:22:12 +05:30
Martin Ender
b68087d690 Update customize-form.md 2015-12-15 17:22:12 +05:30
Martin Ender
a970e72819 Create customize-form.md 2015-12-15 17:22:12 +05:30
Martin Ender
4d0c5a51c9 Create custom-button.md 2015-12-15 17:22:12 +05:30
Martin Ender
41e1eb6af7 Create update-field-based-on-value-in-other-date-field.md 2015-12-15 17:22:12 +05:30
Martin Ender
1761004bd5 Create sales-invoice-id-based-on-sales-order-id.md 2015-12-15 17:22:12 +05:30
Martin Ender
c8fc5a2048 Create restrict-user-based-on-child-record.md 2015-12-15 17:22:12 +05:30
Martin Ender
9b639b82cf Create restrict-purpose-of-stock-entry.md 2015-12-15 17:22:12 +05:30
Martin Ender
314fa2bdad Create restrict-cancel-rights.md 2015-12-15 17:22:12 +05:30
Martin Ender
bff501c401 Create make-read-only-after-saving.md 2015-12-15 17:22:12 +05:30
Martin Ender
89d64f5b12 Update generate-code-based-on-custom-logic.md 2015-12-15 17:22:11 +05:30
Martin Ender
670269f85c Create generate-code-based-on-custom-logic.md 2015-12-15 17:22:11 +05:30
Martin Ender
38a15ab4fc Update date-validation.md 2015-12-15 17:22:11 +05:30
Martin Ender
8dfb35bb79 Create date-validation.md 2015-12-15 17:22:11 +05:30
Martin Ender
20e97c9dbc Create index.txt 2015-12-15 17:22:11 +05:30
Martin Ender
909f6da868 Create index.md 2015-12-15 17:22:11 +05:30
Martin Ender
0ffc350f57 Create custom-script-fetch-values-from-master.md 2015-12-15 17:22:11 +05:30
Martin Ender
fea9357741 Update index.md 2015-12-15 17:22:11 +05:30
Martin Ender
2fbc3b7259 Create index.txt 2015-12-15 17:22:11 +05:30
Martin Ender
f99923dc08 Create index.md 2015-12-15 17:22:11 +05:30
Martin Ender
d5781b5de8 Create custom-doctype.md 2015-12-15 17:22:11 +05:30
Martin Ender
81adb7dec9 Create custom-field.md 2015-12-15 17:22:10 +05:30
Martin Ender
46d4ba904a Create index.txt 2015-12-15 17:22:10 +05:30
Martin Ender
8c48c36be6 Create index.md 2015-12-15 17:22:10 +05:30
Martin Ender
f52b3090a9 Create tags.md 2015-12-15 17:22:10 +05:30
Martin Ender
e8703298ed Update assignment.md 2015-12-15 17:22:10 +05:30
Martin Ender
98eba6b9ba Create assignment.md 2015-12-15 17:22:10 +05:30
Martin Ender
34dc5bc812 Create calendar.md 2015-12-15 17:22:10 +05:30
Martin Ender
ba9b85c1a6 Update notes.md 2015-12-15 17:22:10 +05:30
Martin Ender
4eefd2218a Create notes.md 2015-12-15 17:22:10 +05:30
Martin Ender
d58d56f4d4 Create messages.md 2015-12-15 17:22:10 +05:30
Martin Ender
1d7d055d16 Create collaborating-around-forms.md 2015-12-15 17:22:09 +05:30
Martin Ender
2e7dca8693 Create to-do.md 2015-12-15 17:22:09 +05:30
Martin Ender
746e21f283 Create index.txt 2015-12-15 17:22:09 +05:30
Martin Ender
60eed43269 Create index.md 2015-12-15 17:22:09 +05:30
Martin Ender
b2b7d91010 Create social-login-keys.md 2015-12-15 17:22:09 +05:30
Martin Ender
1641f0815e Create website-settings.md 2015-12-15 17:22:09 +05:30
Martin Ender
e3f4b6ce6f Create index.txt 2015-12-15 17:22:09 +05:30
Martin Ender
7a6ec814b9 Create index.md 2015-12-15 17:22:09 +05:30
Martin Ender
4325a8c82f Create blogger.md 2015-12-15 17:22:09 +05:30
Martin Ender
6bff33b949 Create web-form.md 2015-12-15 17:22:09 +05:30
Martin Ender
99c244c834 Create blog-post.md 2015-12-15 17:22:08 +05:30
Martin Ender
838db977fe Create web-page.md 2015-12-15 17:22:08 +05:30
Martin Ender
837b656c45 Create index.txt 2015-12-15 17:22:08 +05:30
Martin Ender
7641a957eb Create index.md 2015-12-15 17:22:08 +05:30
Martin Ender
f8a383b339 Create issues.md 2015-12-15 17:22:08 +05:30
Martin Ender
d144bfe2ca Create sign-up.md 2015-12-15 17:22:08 +05:30
Martin Ender
b5edc6676e Update portal-login.md 2015-12-15 17:22:08 +05:30
Martin Ender
f72a1eb782 Create portal-login.md 2015-12-15 17:22:08 +05:30
Martin Ender
a574979ebc Create customer-orders-invoices-and-shipping.md 2015-12-15 17:22:08 +05:30
Martin Ender
49b3c0c064 Create index.txt 2015-12-15 17:22:08 +05:30
Martin Ender
d32a43c39f Create index.md 2015-12-15 17:22:08 +05:30
Martin Ender
3162f31fd8 Create holyday-list.md 2015-12-15 17:22:08 +05:30
Martin Ender
952c336f70 Create leave-type.md 2015-12-15 17:22:07 +05:30
Martin Ender
2f6a29b060 Update leave-allocation.md 2015-12-15 17:22:07 +05:30
Martin Ender
55e467dc20 Create leave-allocation.md 2015-12-15 17:22:07 +05:30
Martin Ender
df5aa98d00 Create deduction-type.md 2015-12-15 17:22:07 +05:30
Martin Ender
ffa18f4dc8 Create earning-type.md 2015-12-15 17:22:07 +05:30
Martin Ender
cea952c1c4 Create designation.md 2015-12-15 17:22:07 +05:30
Martin Ender
92a3aa9fad Update branch.md 2015-12-15 17:22:07 +05:30
Martin Ender
3b7f626c0b Update branch.md 2015-12-15 17:22:07 +05:30
Martin Ender
8d71597c03 Update branch.md 2015-12-15 17:22:07 +05:30
Martin Ender
786779fd5c Create department.md 2015-12-15 17:22:07 +05:30
Martin Ender
0c30c9cccb Update branch.md 2015-12-15 17:22:07 +05:30
Martin Ender
6479f0e82a Update and rename department.md to branch.md 2015-12-15 17:22:07 +05:30
Martin Ender
f8da1ff59f Create department.md 2015-12-15 17:22:06 +05:30
Martin Ender
043ab0c47e Create employment-type.md 2015-12-15 17:22:06 +05:30
Martin Ender
6e982264db Update hr-settings.md 2015-12-15 17:22:06 +05:30
Martin Ender
ed9f8de78c Create hr-settings.md 2015-12-15 17:22:06 +05:30
Martin Ender
80f1fc4fcb Create index.txt 2015-12-15 17:22:06 +05:30
Martin Ender
c26b090c72 Create index.md 2015-12-15 17:22:06 +05:30
Martin Ender
a637010af1 Create human-resources-report.md 2015-12-15 17:22:06 +05:30
Martin Ender
108c1f8783 Create leave-allocation-tool.md 2015-12-15 17:22:06 +05:30
Martin Ender
cfb0b3d371 Create upload-attendance.md 2015-12-15 17:22:06 +05:30
Martin Ender
e1a3b369e8 Create index.txt 2015-12-15 17:22:06 +05:30
Martin Ender
f0f54d53f4 Create index.md 2015-12-15 17:22:06 +05:30
Martin Ender
fdf61e40f3 Create offer-letter.md 2015-12-15 17:22:06 +05:30
Martin Ender
9a12221d72 Create job-opening.md 2015-12-15 17:22:05 +05:30
Martin Ender
6bea8c7bc2 Create job-applicant.md 2015-12-15 17:22:05 +05:30
Martin Ender
7bfba0fb0e Create appraisal.md 2015-12-15 17:22:05 +05:30
Martin Ender
15597d7f60 Update salary-and-payroll.md 2015-12-15 17:22:05 +05:30
Martin Ender
19fb4f231d Create salary-and-payroll.md 2015-12-15 17:22:05 +05:30
Martin Ender
fc70f4c9e8 Update attendance.md 2015-12-15 17:22:05 +05:30
Martin Ender
b0fc040dcc Create attendance.md 2015-12-15 17:22:05 +05:30
Martin Ender
26018adff4 Create expense-claim.md 2015-12-15 17:22:05 +05:30
Martin Ender
73933c1195 Create leave-application.md 2015-12-15 17:22:05 +05:30
Martin Ender
1d3d0ed595 Create employee.md 2015-12-15 17:22:05 +05:30
Martin Ender
9d80e47d27 Create index.txt 2015-12-15 17:22:05 +05:30
Martin Ender
f2fc91b73e Create index.md 2015-12-15 17:22:04 +05:30
Martin Ender
b77eb6d383 Create maintenance-schedule.md 2015-12-15 17:22:04 +05:30
Martin Ender
6ced0da90b Create maintenance-visit.md 2015-12-15 17:22:04 +05:30
Martin Ender
6aaec8e874 Create warranty-claim.md 2015-12-15 17:22:04 +05:30
Martin Ender
e4ba4d0efd Update issue.md 2015-12-15 17:22:04 +05:30
Martin Ender
acef1eaa9d Create issue.md 2015-12-15 17:22:04 +05:30
Martin Ender
75960296c9 Create index.txt 2015-12-15 17:22:04 +05:30
Martin Ender
924b9c1763 Update index.md 2015-12-15 17:22:04 +05:30
Martin Ender
92f2771ae2 Create index.md 2015-12-15 17:22:04 +05:30
Martin Ender
88a2580ec5 Create activity-cost.md 2015-12-15 17:22:04 +05:30
Martin Ender
95a2e2f5e4 Create activity-type.md 2015-12-15 17:22:04 +05:30
Martin Ender
90f44ba6ac Create time-log-batch.md 2015-12-15 17:22:04 +05:30
Martin Ender
b32d97f071 Create time-log.md 2015-12-15 17:22:03 +05:30
Martin Ender
8cb9cfdb81 Create project.md 2015-12-15 17:22:03 +05:30
Martin Ender
44420e4df7 Create tasks.md 2015-12-15 17:22:03 +05:30
Martin Ender
55bd4f7d06 Create index.txt 2015-12-15 17:22:03 +05:30
Martin Ender
1d1e03b792 Create index.md 2015-12-15 17:22:03 +05:30
Martin Ender
bb4fcd9438 Create manufacturing-settings.md 2015-12-15 17:22:03 +05:30
Martin Ender
b61345c040 Create index.md 2015-12-15 17:22:03 +05:30
Martin Ender
1827c3bc5f Create index.txt 2015-12-15 17:22:03 +05:30
Martin Ender
e65df29aed Update bom-replace-tool.md 2015-12-15 17:22:03 +05:30
Martin Ender
c9588f5aa3 Create bom-replace-tool.md 2015-12-15 17:22:03 +05:30
Martin Ender
6a2a290194 Create production-planning-tool.md 2015-12-15 17:22:03 +05:30
Martin Ender
8c95b5492c Create index.txt 2015-12-15 17:22:02 +05:30
Martin Ender
3cf31eaefe Create index.md 2015-12-15 17:22:02 +05:30
Martin Ender
0349c8e96d Create subcontracting.md 2015-12-15 17:22:02 +05:30
Martin Ender
666b63aa5e Create operation.md 2015-12-15 17:22:02 +05:30
Martin Ender
16fca942bb Create workstation.md 2015-12-15 17:22:02 +05:30
Martin Ender
bf5f7425bb Create production-order.md 2015-12-15 17:22:02 +05:30
Martin Ender
a165451b84 Create bill-of-materials.md 2015-12-15 17:22:02 +05:30
Martin Ender
5f7ac05af3 Create introduction.md 2015-12-15 17:22:02 +05:30
Martin Ender
afc9afa01f Create index.txt 2015-12-15 17:22:02 +05:30
Martin Ender
fe032bfb6f Create index.md 2015-12-15 17:22:02 +05:30
Martin Ender
71f5792f02 Create supplier-type.md 2015-12-15 17:22:02 +05:30
Martin Ender
0c70bd4b10 Create buying-settings.md 2015-12-15 17:22:02 +05:30
Martin Ender
f8ee7e12ef Create index.txt 2015-12-15 17:22:01 +05:30
Martin Ender
f8a93b6cb1 Create index.md 2015-12-15 17:22:01 +05:30
Martin Ender
612ec6c289 Create purchase-order.md 2015-12-15 17:22:01 +05:30
Martin Ender
2fe811695c Create supplier-quotation.md 2015-12-15 17:22:01 +05:30
Martin Ender
3cedb81670 Create supplier.md 2015-12-15 17:22:01 +05:30
Martin Ender
393afdaa1f Create index.md 2015-12-15 17:22:01 +05:30
Martin Ender
80b1ff7744 Create index.txt 2015-12-15 17:22:01 +05:30
Martin Ender
0689d27072 Create sales-return.md 2015-12-15 17:22:01 +05:30
Martin Ender
e44372ca6b Create purchase-return.md 2015-12-15 17:22:01 +05:30
Martin Ender
a94073d37d Create item-attribute.md 2015-12-15 17:22:01 +05:30
Martin Ender
5d9a9473d3 Create item-group.md 2015-12-15 17:22:01 +05:30
Martin Ender
6854d66cdc Create stock-settings.md 2015-12-15 17:22:00 +05:30
Martin Ender
29675f8bbd Create index.txt 2015-12-15 17:22:00 +05:30
Martin Ender
2ffb4a7a8d Create index.md 2015-12-15 17:22:00 +05:30
Martin Ender
692e465829 Create uom-replacement-tool.md 2015-12-15 17:22:00 +05:30
Martin Ender
eaed755e0f Create landed-cost-voucher.md 2015-12-15 17:22:00 +05:30
Martin Ender
f32d3716b8 Create quality-inspection.md 2015-12-15 17:22:00 +05:30
Martin Ender
e493a9252b Update packing-slip.md 2015-12-15 17:22:00 +05:30
Martin Ender
e005662cf0 Create packing-slip.md 2015-12-15 17:22:00 +05:30
Martin Ender
e83697c21c Create index.txt 2015-12-15 17:22:00 +05:30
Martin Ender
c3c654c672 Create index.md 2015-12-15 17:22:00 +05:30
Martin Ender
c6a445fa8e Update migrate-to-perpetual-inventory.md 2015-12-15 17:22:00 +05:30
Martin Ender
6ebf5b0bbb Create migrate-to-perpetual-inventory.md 2015-12-15 17:22:00 +05:30
Martin Ender
668ea8a161 Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
49c58975d9 Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
3d9ef3202e Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
4dd13fd81e Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
edc5a79fbf Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
a3bb3cded0 Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
c8e88f5bba Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
c4ffa9ceb0 Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
b8834c3c1c Update perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
c384bc8045 Create perpetual-inventory.md 2015-12-15 17:21:59 +05:30
Martin Ender
9d0e4c841b Create index.txt 2015-12-15 17:21:59 +05:30
Martin Ender
3097e73e5a Create index.md 2015-12-15 17:21:59 +05:30
Martin Ender
eec101dffb Create projected-quantity.md 2015-12-15 17:21:58 +05:30
Martin Ender
40e5b0589a Create batch.md 2015-12-15 17:21:58 +05:30
Martin Ender
ee343c8c77 Create serial-no.md 2015-12-15 17:21:58 +05:30
Martin Ender
079ac113fb Create warehouse.md 2015-12-15 17:21:58 +05:30
Martin Ender
285ec76130 Delete article-variants.mg 2015-12-15 17:21:58 +05:30
Martin Ender
e1eb761807 Create article-variants.md 2015-12-15 17:21:58 +05:30
Martin Ender
ae8974b627 Create article-variants.mg 2015-12-15 17:21:58 +05:30
Martin Ender
ea18cc464a Create article-coding.md 2015-12-15 17:21:58 +05:30
Martin Ender
064da78734 Create index.txt 2015-12-15 17:21:58 +05:30
Martin Ender
c87dc4771c Create index.md 2015-12-15 17:21:58 +05:30
Martin Ender
c5aede5b4c Create installation-note.md 2015-12-15 17:21:58 +05:30
Martin Ender
d8785dde0c Create purchase-receipt.md 2015-12-15 17:21:58 +05:30
Martin Ender
669e4df639 Create delivery-note.md 2015-12-15 17:21:57 +05:30
Martin Ender
e7894fab39 Create stock-entry.md 2015-12-15 17:21:57 +05:30
Martin Ender
f8be4394dc Create material-request.md 2015-12-15 17:21:57 +05:30
Martin Ender
384f620c9d Create index.txt 2015-12-15 17:21:57 +05:30
Martin Ender
ba0ae97fdf Create index.md 2015-12-15 17:21:57 +05:30
Martin Ender
a95a189592 Update product-bundle.md 2015-12-15 17:21:57 +05:30
Martin Ender
5ede3a8a6f Create product-bundle.md 2015-12-15 17:21:57 +05:30
Martin Ender
49e8628627 Create shipping-rule.md 2015-12-15 17:21:57 +05:30
Martin Ender
05521ee102 Create sales-partner.md 2015-12-15 17:21:57 +05:30
Martin Ender
11e9c18b51 Update selling-settings.md 2015-12-15 17:21:57 +05:30
Martin Ender
5fcb3d7775 Update selling-settings.md 2015-12-15 17:21:57 +05:30
Martin Ender
84226006dd Create selling-settings.md 2015-12-15 17:21:56 +05:30
Martin Ender
4fc998d0f9 Create index.txt 2015-12-15 17:21:56 +05:30
Martin Ender
938b9b2097 Create index.md 2015-12-15 17:21:56 +05:30
Martin Ender
61c2d88781 Create sales-order.md 2015-12-15 17:21:56 +05:30
Martin Ender
fdba12d355 Update quotation.md 2015-12-15 17:21:56 +05:30
Martin Ender
8e1014565e Create quotation.md 2015-12-15 17:21:56 +05:30
Martin Ender
040c565a44 Create index.txt 2015-12-15 17:21:56 +05:30
Martin Ender
54f7616cf8 Create index.md 2015-12-15 17:21:56 +05:30
Martin Ender
b27f2dc012 Create tax-rule.md 2015-12-15 17:21:56 +05:30
Martin Ender
7bf3d908ba Create account-settings.md 2015-12-15 17:21:56 +05:30
Martin Ender
17caf1f6e5 Create cost-center.md 2015-12-15 17:21:56 +05:30
Martin Ender
b1c5f385bf Create fiscal-year.md 2015-12-15 17:21:56 +05:30
Martin Ender
457cfb7b60 Create index.txt 2015-12-15 17:21:55 +05:30
Martin Ender
46e0166d1f Create index.md 2015-12-15 17:21:55 +05:30
Martin Ender
0b55567b44 Create payment-tool.md 2015-12-15 17:21:55 +05:30
Martin Ender
f3ca6d0ac3 Create period-closing-voucher.md 2015-12-15 17:21:55 +05:30
Martin Ender
06ff0e42d9 Create payment-reconciliation.md 2015-12-15 17:21:55 +05:30
Martin Ender
1727bdb2b8 Create bank-reconciliation.md 2015-12-15 17:21:55 +05:30
Martin Ender
80300b321d Create index.md 2015-12-15 17:21:55 +05:30
Martin Ender
5c8c606b50 Create index.txt 2015-12-15 17:21:55 +05:30
Martin Ender
7b8e9a39e7 Update multi-currency-accounting.md 2015-12-15 17:21:55 +05:30
Martin Ender
054d63c94e Create multi-currency-accounting.md 2015-12-15 17:21:55 +05:30
Martin Ender
4deb7aaea2 Create point-of-sales-invoice.md 2015-12-15 17:21:55 +05:30
Martin Ender
f146046845 Create item-wise-tax.md 2015-12-15 17:21:55 +05:30
Martin Ender
f8942dd060 Update opening-accounts.md 2015-12-15 17:21:54 +05:30
Martin Ender
ee1f66bc86 Create opening-accounts.md 2015-12-15 17:21:54 +05:30
Martin Ender
ae77cb4959 Create budgeting.md 2015-12-15 17:21:54 +05:30
Martin Ender
6ba0f7bf75 Create accounting-entries.md 2015-12-15 17:21:54 +05:30
Martin Ender
3e2ebe5972 Update accounting-reports.md 2015-12-15 17:21:54 +05:30
Martin Ender
5f2f82de56 Create accounting-reports.md 2015-12-15 17:21:54 +05:30
Martin Ender
9d0d426ed6 Update opening-entry.md 2015-12-15 17:21:54 +05:30
Martin Ender
d7ea4ec2b6 Create opening-entry.md 2015-12-15 17:21:54 +05:30
Martin Ender
4d35ef149f Create credit-limit.md 2015-12-15 17:21:54 +05:30
Martin Ender
34fe511260 Create advance-payment-entry.md 2015-12-15 17:21:54 +05:30
Martin Ender
03a3d5089c Create making-payments.md 2015-12-15 17:21:54 +05:30
Martin Ender
8af11201d9 Update chart-of-accounts.md 2015-12-15 17:21:54 +05:30
Martin Ender
cd35d45628 Create chart-of-accounts.md 2015-12-15 17:21:53 +05:30
Martin Ender
dd09f67e75 Create purchase-invoice.md 2015-12-15 17:21:53 +05:30
Martin Ender
a51c4403a5 Update sales-invoice.md 2015-12-15 17:21:53 +05:30
Martin Ender
5656c6e969 Create sales-invoice.md 2015-12-15 17:21:53 +05:30
Martin Ender
635528e186 Create journal-entry.md 2015-12-15 17:21:53 +05:30
Martin Ender
49e39f0cde Create index.md 2015-12-15 17:21:53 +05:30
Martin Ender
e9784d1280 Create index.txt 2015-12-15 17:21:53 +05:30
Martin Ender
82e3e08650 Create sales-person.md 2015-12-15 17:21:53 +05:30
Martin Ender
721de2629e Create customer-group.md 2015-12-15 17:21:53 +05:30
Martin Ender
19d627c51f Create campaign.md 2015-12-15 17:21:53 +05:30
Martin Ender
a1d129f836 Create index.txt 2015-12-15 17:21:53 +05:30
Martin Ender
79f52a54ef Create index.md 2015-12-15 17:21:52 +05:30
Martin Ender
92091ce22d Create newsletter.md 2015-12-15 17:21:52 +05:30
Martin Ender
019196894c Create contact.md 2015-12-15 17:21:52 +05:30
Martin Ender
fbce19b2c6 Create opportunity.md 2015-12-15 17:21:52 +05:30
Martin Ender
84a9b6c816 Create customer.md 2015-12-15 17:21:52 +05:30
Martin Ender
aeb0934da0 Create lead.md 2015-12-15 17:21:52 +05:30
Martin Ender
347a580883 Create index.md 2015-12-15 17:21:52 +05:30
Martin Ender
2891c5ebca Create index.txt 2015-12-15 17:21:52 +05:30
Martin Ender
fc1bb3ee1d Create company-setup.md 2015-12-15 17:21:52 +05:30
Martin Ender
bd194a9fb7 Create bar-code.md 2015-12-15 17:21:52 +05:30
Martin Ender
4bd999cbc5 Update workflows.md 2015-12-15 17:21:52 +05:30
Martin Ender
bb154ad6c9 Create workflows.md 2015-12-15 17:21:52 +05:30
Martin Ender
f7d133f4a0 Update third-party-backups.md 2015-12-15 17:21:51 +05:30
Martin Ender
b79151ccac Create third-party-backups.md 2015-12-15 17:21:51 +05:30
Martin Ender
5b509ca194 Update territory.md 2015-12-15 17:21:51 +05:30
Martin Ender
38aa8982f8 Create territory.md 2015-12-15 17:21:51 +05:30
Martin Ender
c46504dfdf Update stock-reconciliation-for-non-serialized-item.md 2015-12-15 17:21:51 +05:30
Martin Ender
279fc35cb2 Create stock-reconciliation-for-non-serialized-item.md 2015-12-15 17:21:51 +05:30
Martin Ender
4887292513 Update sms-setting.md 2015-12-15 17:21:51 +05:30
Martin Ender
a056a7e390 Create sms-setting.md 2015-12-15 17:21:51 +05:30
Martin Ender
d82fec317e Create authorization-rule.md 2015-12-15 17:21:51 +05:30
Martin Ender
2545651a77 Create price-lists.md 2015-12-15 17:21:51 +05:30
Martin Ender
43029c2754 Create pos-setting.md 2015-12-15 17:21:51 +05:30
Martin Ender
3adcca8238 Update setting-up-taxes.md 2015-12-15 17:21:51 +05:30
Martin Ender
a76f957345 Update setting-up-taxes.md 2015-12-15 17:21:50 +05:30
Martin Ender
6935ae7f60 Create setting-up-taxes.md 2015-12-15 17:21:50 +05:30
Martin Ender
72e3741b44 Create terms-and-conditions.md 2015-12-15 17:21:50 +05:30
Martin Ender
609568d6d5 Create address-template.md 2015-12-15 17:21:50 +05:30
Martin Ender
576c76f71c Create letter-head.md 2015-12-15 17:21:50 +05:30
Martin Ender
a952fef53d Create print-headings.md 2015-12-15 17:21:50 +05:30
Martin Ender
5dc46b6096 Delete print-headings.md3 2015-12-15 17:21:50 +05:30
Martin Ender
463bd7b742 Create print-headings.md3 2015-12-15 17:21:50 +05:30
Martin Ender
e5cb6ab319 Create print-format-builder.md 2015-12-15 17:21:50 +05:30
Martin Ender
eeb280e06d Create print-settings.md 2015-12-15 17:21:50 +05:30
Martin Ender
2799039eec Create index.txt 2015-12-15 17:21:50 +05:30
Martin Ender
84f47e54af Create index.md 2015-12-15 17:21:50 +05:30
Martin Ender
3cd67c9e9b Create sending-email.md 2015-12-15 17:21:49 +05:30
Martin Ender
6b3d94a5df Update email-digest.md 2015-12-15 17:21:49 +05:30
Martin Ender
218cc5d1f2 Create email-digest.md 2015-12-15 17:21:49 +05:30
Martin Ender
f53407b76e Update concepts-and-terms.md 2015-12-15 17:21:49 +05:30
Martin Ender
92988591fc Update user-permissions.md 2015-12-15 17:21:49 +05:30
Martin Ender
9b69827d2c Update role-based-permissions.md 2015-12-15 17:21:49 +05:30
Martin Ender
4136b3170a Update adding-users.md 2015-12-15 17:21:49 +05:30
Martin Ender
f3459158c6 Delete globals-defaults.md 2015-12-15 17:21:49 +05:30
Martin Ender
a82056f424 Create global-defaults.md 2015-12-15 17:21:49 +05:30
Martin Ender
a440125ef2 Update system-settings.md 2015-12-15 17:21:49 +05:30
Martin Ender
3e8aec4d64 Update naming-series.md 2015-12-15 17:21:49 +05:30
Martin Ender
97a27f3d46 Update naming-series.md 2015-12-15 17:21:48 +05:30
Martin Ender
0eb0f59194 Update module-settings.md 2015-12-15 17:21:48 +05:30
Martin Ender
fce8780c08 Update globals-defaults.md 2015-12-15 17:21:48 +05:30
Martin Ender
48d45869ab Update email-alerts.md 2015-12-15 17:21:48 +05:30
Martin Ender
349360b3a1 Update email-alerts.md 2015-12-15 17:21:48 +05:30
Martin Ender
5e646cd8ad Update email-alerts.md 2015-12-15 17:21:48 +05:30
Martin Ender
8bcd104cec Create email-alerts.md 2015-12-15 17:21:48 +05:30
Martin Ender
5e91280912 Create email-account.md 2015-12-15 17:21:48 +05:30
Martin Ender
5fec1751a7 Create index.txt 2015-12-15 17:21:48 +05:30
Martin Ender
91802f914c Create index.md 2015-12-15 17:21:48 +05:30
Martin Ender
f779df2737 Create bulk-rename.md 2015-12-15 17:21:48 +05:30
Martin Ender
fad1363756 Update data-import-tool.md 2015-12-15 17:21:47 +05:30
Martin Ender
b041b905d0 Rename data-import-tool.md2.4.1 Werkzeug zum Datenimport Das Werkzeug zum Datenimport ist ein großartiger Weg um große Mengen an Daten, speziell Stammdaten, in das System hochzuladen oder zu bearbeiten. Um das Werkzeug zum Datenimport zu öffnen, gehen Sie entweder zu den Einstellungen oder zur Transaktion, für die Sie importieren wollen. Wenn der Datenimport erlaubt ist, sehen Sie eine Importschaltfläche: Das Werkzeug hat zwei Abschnitte, einen um eine Vorlage herunter zu laden, und einen zweiten um Daten hoch zu laden. (Anmerkung: Für den Import sind nur die DocTypes zugelassen, deren Dokumenttyp "Stammdaten" ist, oder bei denen die Einstellung "Import erlauben" aktiviert ist.) 1. Herunterladen der Vorlage Daten werden in ERPNext in Tabellen gespeichert, sehr ähnlich einer Tabellenkalkulation mit Spalten und Zeilen voller Daten. Jede Instanz in ERPNext kann mehrere verschiedene mit Ihr verbundene Untertabellen haben. Die Untertabellen sind mit Ihren übergeordneten Tabellen verknüpft und werden dort eingesetzt, wo es für eine Eigenschaft mehrere verschiedene Werte gibt. So kann z. B. ein Artikel mehrere verschiedene Preise haben, eine Rechnung hat mehrere verschiedene Artikel usw. - Klicken Sie auf die Tabelle, die Sie herunter laden wollen, oder auf "Alle Tabellen". - Für Massenbearbeitung klicken Sie auf "Mit Daten herunterladen". 2. Füllen Sie die Vorlage aus Öffnen Sie die Vorlage nach dem Herunterladen in einer Tabellenkalkulationsanwendung und fügen Sie die Daten unterhalb der Spaltenköpfe ein. Exportieren Sie dann Ihre Vorlage oder speichern Sie sie im CSV-Format (Comma Separated Values). 3. Hochladen der CSV-Datei Fügen Sie abschliessend die CSV-Datei im Abschnitt Import hinzu. Klicken Sie auf die Schaltfläche "Hochladen und Importieren". Anmerkungen: 1. Stellen Sie sicher, dass Sie als Verschlüsselung UTF-8 verwenden, wenn Ihre Anwendung das zulässt. 2. Lassen Sie die Spalte ID für einen neuen Datensatz leer. 4. Hochladen aller Tabellen (übergeordnete und Untertabellen) Wenn Sie alle Tabellen auswählen, dann erhalten Sie Spalten für alle Tabellen in einer Zeile gertrennt durch ~ Spalten. Wenn Sie mehrere verschiedene Unterzeilen haben, dann müssen Sie einen neuen Hauptartikel in einer neuen Zeile eintragen. Sehen Sie hierzu das Beispiel unten: Main Table ~ Child Table Column 1 Column 2 Column 3 ~ Column 1 Column 2 Column 3 v11 v12 v13 c11 c12 c13 c14 c15 c17 v21 v22 v23 c21 c22 c23 Um zu sehen, wie das gemacht wird, geben Sie manuell über Formulare einige Datensätze ein und exportieren Sie "Alle Tabellen" über "Mit Daten herunterladen". 5. Überschreiben ERPNext ermöglicht es Ihnen auch alle oder bestimmte Spalten zu überschreiben. Wenn Sie bestimmte Spalten aktualisieren möchten, können Sie die Vorlage mit Daten herunter laden. Vergessen Sie nicht die Box "Überschreiben" zu markieren, bevor sie hochladen. Anmerkung: Wenn Sie "Überschreiben" auswählen, werden alle Unterdatensätze eines übergeordneten Elements gelöscht. 6. Einschränkungen beim Hochladen ERPNext begrenzt die Menge an Daten, die Sie in einer Datei hochladen können. Die Menge kann sich je nach Datentyp unterscheiden. Normalerweise kann man problemlos ungefähr 1.000 Zeilen einer Tabelle in einem Vorgang hochladen. Wenn das System den Vorgang nicht akzeptiert, sehen Sie eine Fehlermeldung. Warum das alles? Wenn Sie zuviele Daten hochladen, kann das System abstürzen, im Besonderen dann, wenn andere Benutzer parallel arbeiten. Daher begrenzt ERPNext die Anzahl von Schreibvorgängen, die Sie mit einer Eingabe verarbeiten können. Wie fügen Sie Dateien an? Wenn Sie ein Formular öffnen, dann sehen Sie in der Seitenleiste rechts einen Abschnitt zum Anfügen von Dateien. Klicken Sie auf "Hinzufügen" und wählen Sie die Datei aus, die Sie anfügen möchten. Klicken Sie auf "Hochladen" und die Sache ist erledigt. Was ist eine CSV-Datei? Eine CSV (Durch Kommas getrennte Werte)-Datei ist ein Datensatz, den Sie in ERPNext hochladen können um verschiedene Daten zu aktualisieren. Jedes gebräuchliche Tabellenkalkulationsprogramm wie MS-Excel oder OpenOffice Spreadsheet kann im CSV-Format abspeichern. Wenn Sie Microsoft Excel benutzen und nicht-englische Zeichen verwenden, dann sollten Sie Ihre Datei UTF-8-kodiert abspeichern. Bei älteren Versionen von Excel gibt es keinen eindeutigen Weg als UTF-8 zu speichern. Deshalb können Sie die Datei auch ganz einfach als CSV abspeichern, dann mit Notepad öffnen und als UTF-8 abspeichern. (Microsoft Excel kann das leider nicht.) to data-import-tool.md 2015-12-15 17:21:47 +05:30
Martin Ender
ed4e85bf97 Create index.md 2015-12-15 17:21:47 +05:30
Martin Ender
1a8e484542 Create index.txt 2015-12-15 17:21:47 +05:30
Martin Ender
8794bb9c5f Delete system-settings.md 2015-12-15 17:21:47 +05:30
Martin Ender
1cd13ce2d5 Delete naming-series.md 2015-12-15 17:21:47 +05:30
Martin Ender
c1bdc108c8 Delete index.txt 2015-12-15 17:21:47 +05:30
Martin Ender
6549710eaa Delete module-settings.md 2015-12-15 17:21:47 +05:30
Martin Ender
4634194009 Delete index.md 2015-12-15 17:21:47 +05:30
Martin Ender
14006ad8c8 Delete global-defaults.md 2015-12-15 17:21:47 +05:30
Martin Ender
89a7730406 Create system-settings.md 2015-12-15 17:21:47 +05:30
Martin Ender
c2e913e0ca Create naming-series.md 2015-12-15 17:21:47 +05:30
Martin Ender
afbf3296d4 Create module-settings.md 2015-12-15 17:21:46 +05:30
Martin Ender
75963505dc Create index.md 2015-12-15 17:21:46 +05:30
Martin Ender
9ec61cf150 Create globals-defaults.md 2015-12-15 17:21:46 +05:30
Martin Ender
699feb0384 Create index.txt 2015-12-15 17:21:46 +05:30
Martin Ender
da00bacb55 Create global-defaults.md 2015-12-15 17:21:46 +05:30
Martin Ender
8ca8b14720 Create naming-series.md 2015-12-15 17:21:46 +05:30
Martin Ender
64b47ade3b Create module-settings.md 2015-12-15 17:21:46 +05:30
Martin Ender
423791a1cd Create system-settings.md 2015-12-15 17:21:46 +05:30
Martin Ender
9b09fea692 Create index.txt 2015-12-15 17:21:46 +05:30
Martin Ender
098cb65a54 Create index.md 2015-12-15 17:21:46 +05:30
Martin Ender
2cf2f48c02 Create sharing.md 2015-12-15 17:21:46 +05:30
Martin Ender
85febb969e Update user-permissions.md 2015-12-15 17:21:46 +05:30
Martin Ender
952e19a9bb Create user-permissions.md 2015-12-15 17:21:45 +05:30
Martin Ender
451ad3fe93 Update role-based-permissions.md 2015-12-15 17:21:45 +05:30
Martin Ender
cec0728bba Update role-based-permissions.md 2015-12-15 17:21:45 +05:30
Martin Ender
44838ea239 Update role-based-permissions.md 2015-12-15 17:21:45 +05:30
Martin Ender
3c29d6faa2 Update role-based-permissions.md 2015-12-15 17:21:45 +05:30
Martin Ender
5c4fdfce44 Create role-based-permissions.md 2015-12-15 17:21:45 +05:30
Martin Ender
19bed183b0 Update adding-users.md 2015-12-15 17:21:45 +05:30
Martin Ender
53523539f4 Create adding-users.md 2015-12-15 17:21:45 +05:30
Martin Ender
a5488e43ad Create index.md 2015-12-15 17:21:45 +05:30
Martin Ender
f8a2587cf4 Create index.txt 2015-12-15 17:21:45 +05:30
Martin Ender
337972eada Create step-10-item.md 2015-12-15 17:21:45 +05:30
Martin Ender
e5944e8866 Create step-9-suppliers.md 2015-12-15 17:21:45 +05:30
Martin Ender
ee17a60872 Create step-8-customer-names.md 2015-12-15 17:21:44 +05:30
Martin Ender
35ad87bb14 Create step-7-tax-details.md 2015-12-15 17:21:44 +05:30
Martin Ender
421bef2db4 Update step-6-add-users.md 2015-12-15 17:21:44 +05:30
Martin Ender
0048d29799 Create step-6-add-users.md 2015-12-15 17:21:44 +05:30
Martin Ender
5029670657 Update step-1-language.md 2015-12-15 17:21:44 +05:30
Martin Ender
d40ec15f1c Update step-2-currency-and-timezone.md 2015-12-15 17:21:44 +05:30
Martin Ender
9873c4029b Update step-3-user-details.md 2015-12-15 17:21:44 +05:30
Martin Ender
78b4ae02cb Update step-4-company-details.md 2015-12-15 17:21:44 +05:30
Martin Ender
9fa9b34930 Update step-5-letterhead-and-logo.md 2015-12-15 17:21:44 +05:30
Martin Ender
61b6918e73 Create step-5-letterhead-and-logo.md 2015-12-15 17:21:44 +05:30
Martin Ender
755d14b004 Create step-4-company-details.md 2015-12-15 17:21:44 +05:30
Martin Ender
2d3670b6a4 Create step-3-user-details.md 2015-12-15 17:21:44 +05:30
Martin Ender
8ff1c7b3e0 Create step-2-currency-and-timezone.md 2015-12-15 17:21:43 +05:30
Martin Ender
8df03c6e30 Create step-1-language.md 2015-12-15 17:21:43 +05:30
Martin Ender
cab2fc6e73 Create index.txt 2015-12-15 17:21:43 +05:30
Martin Ender
a5b9008088 Create index.md 2015-12-15 17:21:43 +05:30
Martin Ender
0a5ccb008a Create index.md 2015-12-15 17:21:43 +05:30
Martin Ender
83b8d33e78 Create index.txt 2015-12-15 17:21:43 +05:30
Martin Ender
9c2a20a67b Update the-champion.md 2015-12-15 17:21:43 +05:30
Martin Ender
a7465f8fd6 Update open-source.md 2015-12-15 17:21:43 +05:30
Martin Ender
49b476b9e5 Update key-workflows.md 2015-12-15 17:21:43 +05:30
Martin Ender
7f7f77f4d7 Create index.txt 2015-12-15 17:21:43 +05:30
Martin Ender
356c552b41 Update index.md 2015-12-15 17:21:43 +05:30
Martin Ender
1ccbd82b35 Update implementation-strategy.md 2015-12-15 17:21:43 +05:30
Martin Ender
e606678b8f Update getting-started-with-erpnext.md 2015-12-15 17:21:42 +05:30
Martin Ender
45db6156c7 Update getting-started-with-erpnext.md 2015-12-15 17:21:42 +05:30
Martin Ender
9d3da40351 Update getting-started-with-erpnext.md 2015-12-15 17:21:42 +05:30
Martin Ender
3f51a8aed4 Update do-i-need-an-erp.md 2015-12-15 17:21:42 +05:30
Martin Ender
e7d09edc0d Update do-i-need-an-erp.md 2015-12-15 17:21:42 +05:30
Martin Ender
94c7fa0141 Update concepts-and-terms.md 2015-12-15 17:21:42 +05:30
Martin Ender
abe9abc90b Update concepts-and-terms.md 2015-12-15 17:21:42 +05:30
Martin Ender
dbb25b67a5 Update concepts-and-terms.md 2015-12-15 17:21:42 +05:30
Martin Ender
d4e8e05749 Create concepts-and-terms.md 2015-12-15 17:21:42 +05:30
Martin Ender
02d28f1422 Create key-workflows.md 2015-12-15 17:21:42 +05:30
Martin Ender
a97265c8af Create implementation-strategy.md 2015-12-15 17:21:42 +05:30
Martin Ender
0480ad45f6 Create the-champion.md 2015-12-15 17:21:42 +05:30
Martin Ender
c8ea02d745 Update getting-started-with-erpnext.md 2015-12-15 17:21:41 +05:30
Martin Ender
028f246cae Update getting-started-with-erpnext.md 2015-12-15 17:21:41 +05:30
Martin Ender
f683bbee59 Create getting-started-with-erpnext.md 2015-12-15 17:21:41 +05:30
Martin Ender
e01309f07e Update open-source.md 2015-12-15 17:21:41 +05:30
Martin Ender
d7786190e6 Create open-source.md 2015-12-15 17:21:41 +05:30
Martin Ender
5bce109e8e Create do-i-need-an-erp.md 2015-12-15 17:21:41 +05:30
Martin Ender
a2531995f9 Create index.md 2015-12-15 17:21:41 +05:30
Martin Ender
98ccde84fb Create Beispiel.md 2015-12-15 17:21:41 +05:30
CWTGMBH
a12840f803 Create index.md 2015-12-15 17:21:41 +05:30
CWTGMBH
3e2f36034f Delete de 2015-12-15 17:21:41 +05:30
Martin Ender
d8c6213828 Create de 2015-12-15 17:21:41 +05:30
Anand Doshi
dd56b5f4ac Merge pull request #4503 from nabinhait/target_warehouse_patch
[patch] Repost entries with wrongly selected target warehouse
2015-12-15 17:01:37 +05:30
Nabin Hait
8444febbda [patch] Repost entries with wrongly selected target warehouse 2015-12-15 15:55:06 +05:30
Anand Doshi
b26c3f2263 Merge pull request #4502 from nabinhait/general_ledger_fix
[fix][report] General Ledger
2015-12-15 15:18:20 +05:30
Anand Doshi
03791fceee [translations] 2015-12-15 15:17:11 +05:30
Anand Doshi
542782e400 [fix] delete lead addresses in delete company transactions 2015-12-15 15:17:04 +05:30
Nabin Hait
8bdf8e675f [fix][report] General Ledger 2015-12-15 15:02:04 +05:30
Anand Doshi
2da81732eb Merge pull request #4500 from rmehta/fixes-to-tree
[fix] rename tree item fixes #2524
2015-12-15 14:38:26 +05:30
Anand Doshi
e1f46be230 Merge branch 'ShashaQin-patch-60' into develop 2015-12-15 14:37:11 +05:30
ShashaQin
81b8627250 Update serial_no.json 2015-12-15 14:14:51 +05:30
ShashaQin
79586775b2 Update serial_no.json
change "delivery_document_type" to Link and ""delivery_document_no" to Dynamic link will be more convenient, like "purchase_document_type" and "purchase_document_no".
2015-12-15 14:14:26 +05:30
Anand Doshi
8ee5498fe0 [fix] delete lead addresses in delete company transaction 2015-12-15 13:14:38 +05:30
Rushabh Mehta
e8ab320028 [fix] rename tree item fixes #2524 2015-12-15 12:06:37 +05:30
Chris Ian Fiel
c80796cdd5 Cash Flow Report 2015-12-12 11:26:54 +08:00
Chris Ian Fiel
fde03453e4 Cash Flow Report 2015-12-12 10:54:56 +08:00
Chris Ian Fiel
826e18a29f Cash Flow Report 2015-12-12 10:33:01 +08:00
Nabin Hait
bdd1ee2185 Merge branch 'develop' 2015-12-11 15:06:29 +05:30
Nabin Hait
660f479ec8 bumped to version 6.12.11 2015-12-11 15:36:29 +06:00
Nabin Hait
fa557f494b Merge pull request #4481 from nabinhait/develop
[fix] Ignore user permission in target warehouse in SO
2015-12-11 15:04:38 +05:30
Anand Doshi
695d09f9cd [fix] typo 2015-12-11 15:03:26 +05:30
Anand Doshi
66c9940d73 [fix] [validation] website url should be public 2015-12-11 15:02:58 +05:30
Nabin Hait
204af3ce90 [fix] Ignore user permission in target warehouse in SO 2015-12-11 15:01:02 +05:30
Nabin Hait
4a9f6ba520 Merge branch 'develop' 2015-12-11 14:35:41 +05:30
Nabin Hait
83f9f93015 bumped to version 6.12.10 2015-12-11 15:05:41 +06:00
Nabin Hait
53804c5bed Merge pull request #4472 from umairsy/develop
[docs] Added new videos
2015-12-11 14:31:35 +05:30
Nabin Hait
d3d4fe45c6 Merge pull request #4473 from nabinhait/sms_logs
[fix] Ignore permissions while creating sms logs
2015-12-11 14:31:26 +05:30
Nabin Hait
fae4f0269b Merge pull request #4478 from nabinhait/website_image
[fix] Website Image validation
2015-12-11 14:31:18 +05:30
Nabin Hait
fc4eca5cc7 [fix] Website Image validation 2015-12-11 11:47:05 +05:30
Rushabh Mehta
a1a712b0c6 [minor] [fix] task close button condition 2015-12-11 11:16:03 +05:30
Nabin Hait
2164595933 [fix] Ignore permissions while creating sms logs 2015-12-10 18:09:57 +05:30
Umair Sayyed
8eaf5eee74 [docs] Added videos 2015-12-10 17:58:12 +05:30
Nabin Hait
09e5306825 Merge branch 'develop' 2015-12-10 14:41:02 +05:30
Nabin Hait
9cca3494c0 bumped to version 6.12.9 2015-12-10 15:11:02 +06:00
Nabin Hait
360b057b0a [chnage-log] 2015-12-10 14:37:28 +05:30
Nabin Hait
56ae9481a0 Merge pull request #4466 from rmehta/task-notification-on-overdue
[enhancement] task status will be set to overdue when it crosses expected end date
2015-12-10 14:30:34 +05:30
Nabin Hait
12425e22a6 Merge pull request #4462 from nabinhait/sal_slip_fix
[fix] Payment days calculation in salary slip
2015-12-10 14:23:31 +05:30
Nabin Hait
da80a649fc Merge pull request #4465 from anandpdoshi/fix/validate-website-image-public
[fix] validate that Item's website image is public
2015-12-10 14:23:14 +05:30
Rushabh Mehta
13ec41abb2 [enhancement] task status will be set to overdue when it crosses expected end date 2015-12-10 12:59:02 +05:30
Anand Doshi
b3051ab84d [fix] validate that Item's website image is public 2015-12-10 11:46:20 +05:30
Nabin Hait
533aba02c5 [fix] Payment days calculation in salary slip 2015-12-10 10:50:42 +05:30
Rushabh Mehta
a5cf8a86c1 [minor] lang fixes for email digest 2015-12-10 10:38:46 +05:30
Rushabh Mehta
c819fd4ee8 [translations] for #4461 2015-12-10 10:34:32 +05:30
Anand Doshi
2af44ffd06 [fix] setup wizard is_private 2015-12-09 17:29:11 +05:30
Nabin Hait
cff91abd8d Merge pull request #4456 from nabinhait/drop_ship_fix1
[fix] Reload SO Item in patch
2015-12-09 17:06:54 +05:30
Nabin Hait
5d39a9594d [fix] Reload SO Item in patch 2015-12-09 17:06:09 +05:30
Nabin Hait
b1caeba0b4 Merge branch 'develop' 2015-12-09 15:32:30 +05:30
Nabin Hait
7290c79fdf bumped to version 6.12.8 2015-12-09 16:02:30 +06:00
Nabin Hait
547e916b00 Merge pull request #4452 from saurabh6790/drop-ship-fixes-3
[fixes] pull customer details only if drop shipping is marked
2015-12-09 15:31:49 +05:30
Nabin Hait
e4c0388b68 Merge pull request #4453 from nabinhait/translation_fix
suomalainen translation fixed for Extra Small
2015-12-09 15:30:11 +05:30
Nabin Hait
783e63a8e6 suomalainen translation fixed for Extra Small and Large 2015-12-09 15:29:21 +05:30
Saurabh
f6891975d5 [fixes] pull customer details only if drop shipping is marked 2015-12-09 15:04:12 +05:30
Nabin Hait
45a8f9d006 Merge branch 'develop' 2015-12-09 14:59:44 +05:30
Nabin Hait
1b0c797817 bumped to version 6.12.7 2015-12-09 15:29:44 +06:00
Nabin Hait
c119cbcb50 Merge pull request #4449 from nabinhait/coa_fix
[fix] Stock account identified in COA of Guatamala
2015-12-09 13:58:09 +05:30
Nabin Hait
d595534431 Merge pull request #4450 from venetanji/develop
Fix dynamic link in reports to generate correct link when user language is not english
2015-12-09 13:57:45 +05:30
Giovanni Lion
5de53eb0eb Voucher dynamic link fix to allow links to work if user language is not english 2015-12-09 15:45:40 +08:00
Giovanni Lion
5ccaf6f9d7 Merge remote-tracking branch 'frappe/develop' into develop 2015-12-09 15:25:47 +08:00
Anand Doshi
29fe53f63c [fix] use pip parse requirements in setup.py 2015-12-09 12:15:22 +05:30
Nabin Hait
49fe7af6de [fix] Stock account identified in COA of Guatamala 2015-12-09 11:27:10 +05:30
Nabin Hait
a68a3b5cc1 Merge branch 'develop' 2015-12-08 18:06:25 +05:30
Nabin Hait
3931a35e27 bumped to version 6.12.6 2015-12-08 18:36:25 +06:00
Nabin Hait
56595ecda0 Merge pull request #4445 from nabinhait/patch_fix1
[patch][fix] Fixed drop ship status and tax rule patch
2015-12-08 18:05:33 +05:30
Nabin Hait
466ff3d31b Merge pull request #4446 from nabinhait/translation_fix
[fix] Hungary translation for chart of accounts
2015-12-08 18:05:12 +05:30
Nabin Hait
61c6552434 [fix] Hungary translation for chart of accounts 2015-12-08 18:03:23 +05:30
Nabin Hait
4ad0963ee8 [patch][fix] Fixed drop ship status and tax rule patch 2015-12-08 16:51:04 +05:30
Nabin Hait
aa99fe2c4e Merge branch 'develop' 2015-12-08 15:40:17 +05:30
Nabin Hait
d56ec92682 bumped to version 6.12.5 2015-12-08 16:10:17 +06:00
Nabin Hait
90852d334f Merge branch 'nabinhait-tax_rule_patch' into develop 2015-12-08 15:30:32 +05:30
Nabin Hait
694373d022 Fixed conflict 2015-12-08 15:30:15 +05:30
Nabin Hait
40d49ccf98 Merge pull request #4444 from nabinhait/get_incoming_rate_fix
[fix] Get incoming rate if args as json
2015-12-08 15:17:32 +05:30
Nabin Hait
4372ac559a Merge pull request #4443 from nabinhait/bank_reco_print
[fix] Print format for bank reco statement
2015-12-08 15:17:24 +05:30
Nabin Hait
01478b3fc1 Merge pull request #4439 from saurabh6790/drop-ship-fixes-3
[fixes] Drop Shipping - Purchase Order Cancellation - Sales Order Status
2015-12-08 15:16:38 +05:30
Nabin Hait
41c8cf645a [fix] Get incoming rate if args as json 2015-12-08 14:50:24 +05:30
Saurabh
70ed6ede5c [fixes] patch to update delivery status for drop ship item 2015-12-08 14:48:19 +05:30
Nabin Hait
7af5c4aefc [fix] Print format for bank reco statement 2015-12-08 14:25:10 +05:30
Saurabh
01ca354d52 [fixes] Drop Shipping - Purchase Order Cancellation - Sales Order Status 2015-12-08 14:03:09 +05:30
Nabin Hait
a974ab3dc5 [fix][patch] Create Tax Rule based on default taxes and charges template in Customer and Supplier 2015-12-08 12:56:14 +05:30
Anand Doshi
cc24d28ddc [fix] address creation for new user 2015-12-08 12:34:13 +05:30
Rushabh Mehta
441b2c7657 [minor] limit pos search to 24 items at a time 2015-12-08 12:16:53 +05:30
Anand Doshi
51d07dfca2 [docs] rename perm level error article 2015-12-07 16:22:57 +05:30
Nabin Hait
5e6757f197 Merge branch 'develop' 2015-12-07 14:25:00 +05:30
Nabin Hait
6a8ff42a5a bumped to version 6.12.4 2015-12-07 14:54:59 +06:00
Nabin Hait
06db236aa0 [fix] Allow Production Order, by default unchecked in item 2015-12-07 14:19:13 +05:30
Nabin Hait
733680bc3f [translations] 2015-12-07 14:12:41 +05:30
Rushabh Mehta
14a0441b4b [fix] removed temp_highlight 2015-12-07 12:28:03 +05:30
Rushabh Mehta
a311e706b0 [docs] home.png 2015-12-07 12:13:17 +05:30
Rushabh Mehta
e6a16c29df [docs] index fix 2015-12-07 12:07:01 +05:30
Nabin Hait
92bb480fc3 Merge pull request #4432 from bohlian/develop
Purchase Invoice - Show Payment Button when Outstanding Amount !=0
2015-12-07 11:12:11 +05:30
Nabin Hait
7dc0da18b5 Merge pull request #4433 from nabinhait/expense_allow_import
[fix] Allowed import for Expense Claim
2015-12-07 11:11:35 +05:30
Nabin Hait
c8a2b94200 Merge pull request #4434 from nabinhait/whitelist_fix
[fix] get_incoming_rate function whitelisted
2015-12-07 11:11:21 +05:30
Nabin Hait
203d4088fa Merge pull request #4435 from saurabh6790/drop-ship-fixes-3
[fixes] recreate print format, shipping address on po for drop ship, …
2015-12-07 11:10:11 +05:30
Nabin Hait
5eefff13a1 [fix] get_incoming_rate function whitelisted 2015-12-07 10:44:56 +05:30
Nabin Hait
9421e9873a [fix] Allowed import for Expense Claim 2015-12-07 10:40:13 +05:30
bohlian
5e4c8a52ee Payment To Be Shown When Outstanding Amount != 0
Payment button should be shown when outstanding amount != 0.
2015-12-07 12:06:08 +08:00
bohlian
41f62f7250 Merge pull request #1 from frappe/develop
7/12/2015 Merge
2015-12-07 12:04:34 +08:00
Saurabh
4f39fd243e [fixes] recreate print format, shipping address on po for drop ship, validate update stock 2015-12-06 10:09:06 +05:30
Nabin Hait
c43a11a313 Merge pull request #4431 from nabinhait/leave_fix
[fix] Don't validate balance for lwp and in balance consider all leaves in the allocation period
2015-12-05 12:43:38 +05:30
Nabin Hait
1bffb42809 Merge pull request #4428 from nabinhait/get_exchange_rate
[fix] Get exchange rate as 1 if same currency
2015-12-05 12:43:13 +05:30
Nabin Hait
4660f820da Merge pull request #4427 from nabinhait/offer_letter_fix
[fix] Offer letter print format fixed
2015-12-05 12:42:39 +05:30
Nabin Hait
1a19c05ef0 Merge pull request #4425 from nabinhait/bank_reco_fix
[fix] Fixed amounts not reflected in bank
2015-12-05 12:42:20 +05:30
Nabin Hait
d53e780fb8 [fix] Don't validate balance for lwp and in balance consider all leaves in the allocation period 2015-12-05 12:15:49 +05:30
Nabin Hait
0f5d97a156 [fix] Get exchange rate as 1 if same currency 2015-12-04 16:47:34 +05:30
Rushabh Mehta
2f273674e9 [docs] fixed links 2015-12-04 16:00:38 +05:30
Nabin Hait
734a40ad62 [fix] Offer letter print format fixed 2015-12-04 12:19:21 +05:30
Nabin Hait
9547b774f7 [fix] Fixed amounts not reflected in bank 2015-12-04 11:05:25 +05:30
Rushabh Mehta
e1f8b1d695 [minor] [production planning tool] include non production items without default BOM in multi-level BOM 2015-12-04 10:53:15 +05:30
Rushabh Mehta
7be2e985b0 [docs] updated generated docs 2015-12-03 18:28:19 +05:30
Rushabh Mehta
3b6287d849 [docs] updated generated docs 2015-12-03 18:27:13 +05:30
Rushabh Mehta
ab7021ce64 [docs] merged kb and cleanup. warning: don't see the commit 2015-12-03 17:59:34 +05:30
Rushabh Mehta
ca4c663e07 Merge branch 'develop' 2015-12-03 17:58:58 +05:30
Rushabh Mehta
275b3eec0d bumped to version 6.12.3 2015-12-03 18:28:57 +06:00
Rushabh Mehta
acaef538c2 Merge pull request #4420 from rmehta/stock-entry-fix
[minor] allow stock entry for manufacture without production order
2015-12-03 17:58:07 +05:30
Rushabh Mehta
041b062014 Merge pull request #4419 from nabinhait/salary_payment_days
[fix] Payment Days and holidays considering joining and relieving dates
2015-12-03 17:57:24 +05:30
Rushabh Mehta
39e603a154 Merge pull request #4413 from nabinhait/bank_transfer_exchange_rate
Bank transfer exchange rate and account balance in COA
2015-12-03 17:56:03 +05:30
Nabin Hait
a4eeb919e6 [fix] Set payment days considering joinging date, reliving date and applicable holidays 2015-12-03 15:10:30 +05:30
Nabin Hait
c4d9554a05 [fix] Payment Days and holidays considering joining and relieving dates 2015-12-03 15:10:30 +05:30
Rushabh Mehta
2e1c8f27c4 Merge pull request #4421 from nabinhait/tax_rule_fix
[fix] Toggle required for sales and purchase tax template based on tax type
2015-12-03 11:50:09 +05:30
Nabin Hait
4c7a32e446 [fix] Toggle required for sales and purchase tax template based on tax type 2015-12-03 11:47:38 +05:30
Rushabh Mehta
2c069a418a [minor] allow stock entry for manufacture without production order 2015-12-03 11:10:23 +05:30
Rushabh Mehta
ba2596a7e0 [minor] validate email id before inviting user 2015-12-03 10:35:11 +05:30
Rushabh Mehta
f7911687a0 [minor] fixes to patch 2015-12-03 08:09:42 +05:30
Rushabh Mehta
ceb82324ad Merge branch 'develop' 2015-12-02 14:54:45 +05:30
Rushabh Mehta
5dd1aa9f31 bumped to version 6.12.2 2015-12-02 15:24:45 +06:00
Rushabh Mehta
80ada3eddd Merge pull request #4415 from nabinhait/salary_slip_fix
[fix] Inactive salary structure validation
2015-12-02 14:52:11 +05:30
Nabin Hait
8df5900f98 [fix] Inactive salary structure validation 2015-12-02 14:50:08 +05:30
Nabin Hait
f58a3726a7 Balance in chart of accounts in both company and account currency 2015-12-02 12:28:06 +05:30
Nabin Hait
1c77506e80 [fix] Don't overwrite exchange rate on saving for bank transfer 2015-12-02 12:28:06 +05:30
Rushabh Mehta
f1f556c0ac Merge pull request #4409 from nabinhait/reorder_level
[fix] Reorder Qty mandatory if reorder level entered
2015-12-02 12:25:09 +05:30
Rushabh Mehta
4a1b9ac793 Merge pull request #4407 from nabinhait/develop
[fix] Mapping allowed for negative quantity
2015-12-02 12:24:49 +05:30
Nabin Hait
20abc2d0e8 [fix] Reorder Qty mandatory if reorder level entered 2015-12-01 19:01:19 +05:30
Rushabh Mehta
4f9fe9c856 Merge branch 'develop' 2015-12-01 18:18:28 +05:30
Rushabh Mehta
4496cc1e80 bumped to version 6.12.1 2015-12-01 18:48:28 +06:00
Rushabh Mehta
29cca2352c [hot] [fix] trial balance report 2015-12-01 18:17:33 +05:30
Nabin Hait
d793fc9446 [fix] Mapping allowed for negative quantity 2015-12-01 17:28:12 +05:30
Rushabh Mehta
84f44ad5eb Merge pull request #4345 from nabinhait/stock_reco
[fix] Get items in stock reconciliation based on default warehouse
2015-12-01 16:50:32 +05:30
Nabin Hait
5b73dea9f6 [fix] Get items in stock reconciliation based on default warehouse or existing bin 2015-12-01 16:47:17 +05:30
Rushabh Mehta
cd90478c6d Merge pull request #4406 from nabinhait/recurring_test_fix
[fix] Recurring test case fixed for the 1st day of the month
2015-12-01 16:43:27 +05:30
Nabin Hait
c4edcf1532 [fix] Recurring test case fixed for the 1st day of the month 2015-12-01 16:28:35 +05:30
Rushabh Mehta
70885f63a5 Merge branch 'develop' 2015-12-01 16:24:13 +05:30
Rushabh Mehta
48b1633ff5 bumped to version 6.12.0 2015-12-01 16:54:13 +06:00
Rushabh Mehta
4140fa59c5 [translations] 2015-12-01 16:02:15 +05:30
Rushabh Mehta
afacc3d779 [minor] catch illegal reference, via error report 2015-12-01 15:53:07 +05:30
Rushabh Mehta
87b0bec2cf Merge pull request #4405 from rmehta/get-product-bundle-fixes
[fixes] [ux] get product bundle items only on po, mr and button on toolbar
2015-12-01 15:14:23 +05:30
Rushabh Mehta
29f9f6c147 [fixes] [ux] get product bundle items only on po, mr and button on toolbar 2015-12-01 11:36:22 +05:30
Rushabh Mehta
37d9d6fdea Merge pull request #4402 from nabinhait/allow_root_accounts
[feature] Allowed custom root accounts in Chart of Accounts
2015-12-01 10:59:44 +05:30
Rushabh Mehta
0cc177f73c Merge pull request #4400 from nabinhait/total_amount_in_jv
[fix] Total Amount in Journal Entry in bank currency
2015-12-01 10:58:34 +05:30
Nabin Hait
8c4e043747 [feature] Allowed custom root accounts in Chart of Accounts 2015-12-01 10:34:43 +05:30
Rushabh Mehta
3617942ff7 Merge pull request #4395 from nabinhait/drop_ship
[fix] Invoicing against drop-ship Purchase Order
2015-12-01 10:26:25 +05:30
Nabin Hait
ddc295b4b3 [minor] Set expense account as Stock RBNB for perpetual inventory after mapping 2015-11-30 18:40:28 +05:30
Nabin Hait
621f4cd7c9 [fix] Invoicing against drop-ship Purchase Order 2015-11-30 18:40:28 +05:30
Rushabh Mehta
4750b1fdb7 Merge pull request #4397 from rmehta/setup-wizard-fixes
[minor] system settings in setup wizard moved to frappe
2015-11-30 17:17:16 +05:30
Rushabh Mehta
e7bb6544f5 Merge pull request #4401 from nabinhait/pr-for-non-stock-items
[fix] Show 'Make Purchase Receipt' button in PO even if all items are non-stock items
2015-11-30 16:56:28 +05:30
Nabin Hait
72e348daf5 [fix] Show 'Make Purchase Receipt' button in PO even if all items are non-stock items 2015-11-30 16:26:49 +05:30
Nabin Hait
6c173e9730 [fix] Total Amount in Journal Entry in bank currency 2015-11-30 16:13:42 +05:30
Rushabh Mehta
0547a7668e Merge pull request #4398 from nabinhait/bank_reco
[fix] Bank Reconciliation in account currency
2015-11-30 16:06:06 +05:30
Nabin Hait
ec1695dbe3 [fix] Bank Reconciliation in account currency 2015-11-30 15:23:46 +05:30
Rushabh Mehta
7909102edd [minor] system settings in setup wizard moved to frappe 2015-11-30 15:12:45 +05:30
Rushabh Mehta
3f10e0ba2d Merge pull request #4396 from rmehta/stock-reco-fixes
[fixes] stock reco, must always set qty and rate
2015-11-30 14:18:09 +05:30
Rushabh Mehta
9f7de868ef [fixes] stock reco, must always set qty and rate 2015-11-30 14:16:36 +05:30
Rushabh Mehta
d6c5235d58 [minor] [translation] fix #4343 2015-11-30 11:33:01 +05:30
Rushabh Mehta
32e55e174d [minor] fix error message 2015-11-30 10:51:29 +05:30
Anand Doshi
8d968ceb94 Merge branch 'develop' 2015-11-27 17:38:46 +05:30
Anand Doshi
47e82d1a49 bumped to version 6.11.3 2015-11-27 18:08:46 +06:00
Anand Doshi
563c243ec6 Revert "[hotfix] total amount in journal entry"
This reverts commit 5b03a75970.
2015-11-27 17:38:17 +05:30
Anand Doshi
7781763efa Merge branch 'develop' 2015-11-27 17:24:49 +05:30
Anand Doshi
711e675987 bumped to version 6.11.2 2015-11-27 17:54:49 +06:00
Anand Doshi
5b03a75970 [hotfix] total amount in journal entry 2015-11-27 17:24:06 +05:30
Anand Doshi
f4c3819134 Merge branch 'develop' 2015-11-27 15:08:57 +05:30
Anand Doshi
b8591da62c bumped to version 6.11.1 2015-11-27 15:38:57 +06:00
Anand Doshi
a5f0a7ce06 [change-log] 2015-11-27 15:08:36 +05:30
Rushabh Mehta
9785cd35dc [minor] quote optional in email digest 2015-11-27 14:50:15 +05:30
Anand Doshi
e38a53443a Merge pull request #4386 from rmehta/bank-reco-bulk-edit
[enhancement] bulk edit in bank reconciliation, #4356
2015-11-27 14:46:58 +05:30
Anand Doshi
70f57eb7f0 [fix] call apply price list, apply pricing rule only if price list is mentioned or there are items in the table 2015-11-27 14:38:01 +05:30
Rushabh Mehta
2d70887aaf [enhancement] bulk edit in bank reconciliation, #4356 2015-11-27 11:37:18 +05:30
Anand Doshi
15b22c9d7d Merge pull request #4383 from anandpdoshi/fix/auto-material-request-template
[fix] Show Item Name in re-order email. Fixes #4381
2015-11-27 11:31:36 +05:30
Anand Doshi
4b12740e8d [fix] Shipment in portal. Fixes #4291 2015-11-26 18:22:03 +05:30
Anand Doshi
f942d97a18 [fix] removed UOM Replace Utility from message 2015-11-26 16:08:09 +05:30
Anand Doshi
5cf7a0bf72 [fix] Show Item Name in re-order email. Fixes #4381 2015-11-26 15:11:18 +05:30
Anand Doshi
49abb18928 Merge branch 'develop' 2015-11-26 12:42:07 +05:30
Anand Doshi
7c016d2ee2 bumped to version 6.11.0 2015-11-26 13:12:06 +06:00
Anand Doshi
666fbaff8c [translations] 2015-11-26 12:40:13 +05:30
Anand Doshi
6674d1dc2b [change-log] 2015-11-26 12:37:52 +05:30
Anand Doshi
5225a9752b Merge pull request #4377 from rmehta/jv-print-fix
[fix] total amount in journal entry
2015-11-26 11:05:35 +05:30
Rushabh Mehta
0fd67b23f4 [minor] duplicate button on BOM cancel 2015-11-26 10:37:24 +05:30
Rushabh Mehta
b82bdd6f1f [fix] total amount in journal entry 2015-11-26 09:08:07 +05:30
Rushabh Mehta
131bec67bc Merge pull request #4373 from anandpdoshi/fix/status-updater-after-not-null
[fix] status update - update qty after int float not null change
2015-11-25 18:09:13 +05:30
Anand Doshi
ebae726237 [fix] status update - update qty after int float not null change 2015-11-25 17:55:47 +05:30
Anand Doshi
3314f1cba7 Merge pull request #4374 from rmehta/reorder-fix
[minor] re-order at re-order level, not below
2015-11-25 17:54:36 +05:30
Anand Doshi
a4870118ea Merge pull request #4365 from anandpdoshi/fix/print-hide-if-0
[fix] Show Credit/Debit as blank in Journal Entry Account if its value is 0
2015-11-25 17:28:54 +05:30
Rushabh Mehta
03b3d66b90 [minor] re-order at re-order level, not below 2015-11-25 17:23:00 +05:30
Anand Doshi
5c968abcef [fix] Show Credit/Debit as blank in Journal Entry Account if its value is 0 2015-11-25 16:33:00 +05:30
Anand Doshi
699d9be4b7 Merge pull request #4369 from bohlian/develop
Removed Warehouse Requirement for SerialNo Listing
2015-11-25 15:19:47 +05:30
Anand Doshi
ad5cf9b22e Merge pull request #4370 from rmehta/manual-contribs
[manual] contributions via Robert Becht
2015-11-25 15:18:56 +05:30
Anand Doshi
cdb63fd52a Merge pull request #4366 from anandpdoshi/fix/setup-wizard-fiscal-year
[fix] validate fiscal year dates and company name
2015-11-25 15:18:28 +05:30
Rushabh Mehta
bf07cba6a8 [manual] contributions via Robert Becht 2015-11-25 14:42:02 +05:30
bohlian
ff1ab26088 Removed Warehouse Requirement for SerialNo Listing
Removed the requirement that Warehouse has to be assigned for Serial Number to appear in the listing.
2015-11-25 16:06:20 +08:00
Anand Doshi
5c3469a01e [fix] validate fiscal year dates and company name 2015-11-24 17:06:54 +05:30
Anand Doshi
625592e997 Merge pull request #4363 from anandpdoshi/fix/web-form-customization
[fix] Changed Country fieldtype to Link in Web Form
2015-11-24 13:26:23 +05:30
Anand Doshi
7221805587 [fix] Changed Country fieldtype to Link in Web Form 2015-11-23 19:20:51 +05:30
Anand Doshi
a0961bc0cf Merge pull request #4360 from nabinhait/bom_fix
[fix] Update exploded materials table from 'Update Cost' button
2015-11-23 16:55:31 +05:30
Nabin Hait
cf3cf2ca1f [fix] Update exploded materials table from 'Update Cost' button 2015-11-23 15:12:18 +05:30
Anand Doshi
17e9b9444d Merge pull request #4355 from nabinhait/items_from_product_bundle
Get Items from Product Bundle button in purchase cycle
2015-11-23 12:59:41 +05:30
Nabin Hait
c4f4c09e42 Get Items from Product Bundle button in purchase cycle 2015-11-23 12:51:37 +05:30
Anand Doshi
fe1e5884b8 Merge pull request #4354 from nabinhait/pcv
[fix] Period closing account should be of type Liability / Equity
2015-11-23 12:35:06 +05:30
Nabin Hait
072c540ae3 [fix] Period closing account should be of type Liability / Equity 2015-11-23 09:52:08 +05:30
Anand Doshi
3012f0d39a Merge branch 'develop' 2015-11-20 18:10:04 +05:30
Anand Doshi
c6d91b8fb2 bumped to version 6.10.2 2015-11-20 18:40:04 +06:00
Anand Doshi
019111b05c [translations] 2015-11-20 18:00:11 +05:30
Anand Doshi
ddad05dab3 [fix] Customer de-duplication sql 2015-11-20 17:29:40 +05:30
Nabin Hait
9e425863a1 Merge pull request #4342 from revant/patch-2
fix frappe call to update_purchase_receipt_status
2015-11-20 12:47:35 +05:30
Revant Nandgaonkar
bde324a90f fix frappe call to update_purchase_receipt_status
changed update_purchase_order_status to update_purchase_receipt_status
2015-11-20 12:41:58 +05:30
Anand Doshi
b133240298 Merge branch 'develop' 2015-11-20 00:42:15 +05:30
Anand Doshi
56c605f36e bumped to version 6.10.1 2015-11-20 01:12:15 +06:00
Anand Doshi
8c56adf42b [hotfix] drop ship patch 2015-11-20 00:41:28 +05:30
Nabin Hait
690023538e Merge branch 'develop' 2015-11-19 14:34:29 +05:30
Nabin Hait
19ce11aa9c bumped to version 6.10.0 2015-11-19 15:04:29 +06:00
Nabin Hait
f649013079 Merge pull request #4329 from anandpdoshi/int-float-not-null
[enhancement] Int, Currency, Float, Percent as not null and default to 0
2015-11-19 14:30:58 +05:30
Anand Doshi
120ea62acc [fix] get_balance_on: convert date to string 2015-11-19 14:24:39 +05:30
Anand Doshi
602e8253be [enhancement] Int, Currency, Float, Percent as not null and default to 0 2015-11-19 13:23:36 +05:30
Nabin Hait
06df19b56a Reload PO Item before patch 2015-11-19 12:46:37 +05:30
Nabin Hait
0f72750fc8 Merge pull request #4338 from anandpdoshi/fix/salary-slip-earning-deduction
[fix] pull earning and deduction on change of employee
2015-11-19 12:06:37 +05:30
Nabin Hait
5f0b93ed71 Merge pull request #4337 from nabinhait/payment_tool_fix
[fix] Mapping from Payment Tool
2015-11-19 12:05:38 +05:30
Nabin Hait
5284b22c53 [fix] Mapping from negative outstanding invoice 2015-11-19 11:42:23 +05:30
Nabin Hait
343c1a5cbd [fix] Mapping from Payment Tool 2015-11-19 11:42:22 +05:30
Nabin Hait
6daa5746f8 Merge pull request #4335 from saurabh6790/drop-ship-fixes-1
Move Drop Ship from Purchase Order to Purchase Order Items
2015-11-19 11:40:06 +05:30
Anand Doshi
7763bb5c15 [fix] pull earning and deduction on change of employee 2015-11-18 19:04:03 +05:30
Saurabh
b65c69f9eb [fixes] drop ship test case fixes 2015-11-18 17:39:26 +05:30
Saurabh
2e292060c5 [fix] Reserved and ordered qty fix for drop ship orders 2015-11-18 17:39:26 +05:30
Saurabh
a4bf02de6c [fixes] overlapping allocation 2015-11-18 17:39:26 +05:30
Saurabh
3bcf82c7a6 [fixes] test leave allocation record creation 2015-11-18 17:39:26 +05:30
Saurabh
55222a5b82 [fixes] test case fixes 2015-11-18 17:39:26 +05:30
Saurabh
2c85efe31a [fixes] hide drop ship section and typo 2015-11-18 17:39:26 +05:30
Saurabh
20628f5bd8 [patch] mo drop shipment from purchase order to purchase order item 2015-11-18 17:39:25 +05:30
Saurabh
caf122f015 [fixes] dropship fixes 2015-11-18 17:39:25 +05:30
Nabin Hait
b73f3da02c Merge pull request #4332 from nabinhait/pi_fix
[fix] Check Purchase Receipt mandatory only for stock items
2015-11-18 17:30:29 +05:30
Nabin Hait
f0607b45c5 Merge pull request #4334 from revant/patch-1
Mode of Payment validate
2015-11-18 17:29:54 +05:30
Nabin Hait
b45ca3ada0 Merge pull request #4331 from nabinhait/pcv_fix
[fix] Allowed Equity accounts in closing account in Period Closing Voucher
2015-11-18 17:15:57 +05:30
Nabin Hait
11e8728715 Merge pull request #4336 from nabinhait/offer_letter_print_format
[fix] Don't add pagebreak in print format if terms contains only spaces and newlines
2015-11-18 17:15:34 +05:30
Rushabh Mehta
edc8ab03b5 [minor] fixed description 2015-11-18 16:48:19 +05:30
Revant Nandgaonkar
27c266b081 improve mode_of_payment validate_accounts
using frappe.db.get_value instead of frappe.get_list
2015-11-18 13:28:09 +05:30
Nabin Hait
c7fc11a812 [fix] Don't add pagebreak in print format if terms contains only spaces and newlines 2015-11-18 12:59:00 +05:30
Rushabh Mehta
d962d1c96f [minor] remove feedback line from digest 2015-11-18 10:53:03 +05:30
Revant Nandgaonkar
11f8a0033a Mode of Payment validate
Error when Same Company is entered multiple times in accounts
Error when Company of Ledger account doesn't match with Company Selected
2015-11-17 21:15:00 +05:30
Anand Doshi
da79740cdf [fix] injection 2015-11-17 18:27:50 +05:30
Nabin Hait
2cf1699937 [fix] Check Purchase Receipt mandatory only for stock items 2015-11-17 17:32:07 +05:30
Nabin Hait
1a3413875f [fix] Allowed Equity accounts in closing account in Period Closing Voucher 2015-11-17 17:12:44 +05:30
Anand Doshi
3667da1053 [fix] Set user_id as Reply-To in birthday reminder emails 2015-11-16 19:31:20 +05:30
Nabin Hait
a5ac1f024e Merge branch 'develop' 2015-11-16 18:12:03 +05:30
Nabin Hait
d9e57978b8 bumped to version 6.9.2 2015-11-16 18:42:03 +06:00
Nabin Hait
fee95f1135 Merge pull request #4328 from nabinhait/hotfix1
[hotfix]
2015-11-16 18:11:18 +05:30
Nabin Hait
e8f4790d0a [hotfix] 2015-11-16 18:10:15 +05:30
Nabin Hait
e1feab1d70 Merge branch 'develop' 2015-11-16 17:07:38 +05:30
Nabin Hait
6826ca19b1 bumped to version 6.9.1 2015-11-16 17:37:38 +06:00
Nabin Hait
de46fd62d8 Delete v6_9_1.md 2015-11-16 17:06:51 +05:30
Nabin Hait
c7c2d17823 Merge pull request #4327 from nabinhait/item_fix
[change-log] Added change log
2015-11-16 17:05:45 +05:30
Nabin Hait
6f7cd47ac6 [change-log] Added change log 2015-11-16 17:04:48 +05:30
Nabin Hait
11fc0723c9 Merge pull request #4326 from nabinhait/item_fix
Item fix and change log
2015-11-16 17:02:02 +05:30
Nabin Hait
94e90bddaa [change-log] Added change log 2015-11-16 17:01:12 +05:30
Nabin Hait
43ce642649 [fix] Uncheck 'Is Production Item' if it is a non-stock item 2015-11-16 16:50:59 +05:30
Nabin Hait
a975fea3ac Merge branch 'develop' 2015-11-16 16:42:56 +05:30
Nabin Hait
8e2d76bd63 bumped to version 6.9.0 2015-11-16 17:12:56 +06:00
Anand Doshi
34af16140e Merge pull request #4315 from rmehta/standard-in-web-form
Web form, make standard
2015-11-16 16:24:14 +05:30
Nabin Hait
b3a68c3f40 Merge pull request #4323 from nabinhait/leaves
[fix][cleanup] Leave allocation, application and balance report cleanup and fixes
2015-11-16 15:57:04 +05:30
Nabin Hait
9f2fd009b0 Merge pull request #4318 from nabinhait/sal_fix
[fix] Check Salary Structure validity
2015-11-16 15:52:52 +05:30
Nabin Hait
3858d12f1d Merge pull request #4317 from nabinhait/close_feature
Show Close button in Delivery Note and Purchase Receipt, only if it is returned and user has submit permission
2015-11-16 15:52:41 +05:30
Nabin Hait
adc93b797a Merge pull request #4316 from nabinhait/advance_fix
[fix] Invoice Outstanding calculation related to advance
2015-11-16 15:50:32 +05:30
Nabin Hait
b6de519571 [fix] Test case fixed 2015-11-16 15:50:10 +05:30
Nabin Hait
58c4646199 [fix][cleanup] Leave allocation, application and balance report cleanup and fixes 2015-11-16 15:35:14 +05:30
Anand Doshi
4fbf01fd9d [fix] urlencode address list's link 2015-11-16 15:05:49 +05:30
Anand Doshi
1ed82834ce [fix] re-make setup wizard slides on change of language 2015-11-16 12:58:14 +05:30
Nabin Hait
cd87e76d88 [fix] Check Salary Structure validity 2015-11-15 11:06:55 +05:30
Rushabh Mehta
834b3e6f83 [fix] added missing address hook for website permissions 2015-11-13 14:38:12 +05:30
Nabin Hait
95d025f9aa Show Close button in Delivery Note and Purchase Receipt, only if it is returned and user has submit permission 2015-11-13 14:22:32 +05:30
Nabin Hait
90c6d7bb47 [fix] Invoice Outstanding calculation related to advance 2015-11-13 14:04:03 +05:30
Nabin Hait
59ba9e3d56 Merge pull request #4314 from anandpdoshi/fix/po-non-stock-receive
[fix] Don't show Receive for a Purchase Order having non-stock items, show Close button only for users with Submit rights
2015-11-13 13:59:04 +05:30
Rushabh Mehta
c1531e7008 [minor] catch SSL error on make_thumbnail, via support 2015-11-13 11:39:38 +05:30
Rushabh Mehta
511421b6a3 [minor] [enhancement] ability to make web-form standard, reload web-forms, merge after https://github.com/frappe/frappe/pull/1405 2015-11-13 11:04:50 +05:30
Rushabh Mehta
26c54bb4fb [minor] new quote 2015-11-13 10:42:20 +05:30
Anand Doshi
2c93d67463 Merge branch 'develop' 2015-11-12 20:37:12 +05:30
Anand Doshi
d4b05fbd51 bumped to version 6.8.4 2015-11-12 21:07:12 +06:00
Anand Doshi
d65a03d437 [fix] material request type in reorder 2015-11-12 20:36:44 +05:30
Anand Doshi
fd288d4211 Merge branch 'develop' 2015-11-12 20:35:48 +05:30
Anand Doshi
f774f75c63 bumped to version 6.8.3 2015-11-12 21:05:48 +06:00
Anand Doshi
e34a1b5fa2 Merge branch 'develop' 2015-11-12 20:01:53 +05:30
Anand Doshi
5f6546c8a5 bumped to version 6.8.2 2015-11-12 20:31:53 +06:00
Anand Doshi
ca5b593e38 [hotfix] setup wizard tax rate 2015-11-12 20:00:50 +05:30
Anand Doshi
cea5479f4d [fix] Don't show Receive for a Purchase Order having non-stock items, show Close button only for users with Submit rights 2015-11-12 18:39:57 +05:30
Anand Doshi
6303f84d45 [minor] fix test case 2015-11-12 18:11:58 +05:30
Anand Doshi
5dd00a7e89 Merge branch 'develop' 2015-11-12 17:42:41 +05:30
Anand Doshi
87c0e9f03a bumped to version 6.8.1 2015-11-12 18:12:41 +06:00
Anand Doshi
d40d1e9a59 [optimize] Payment Reconciliation and Payment Tool 2015-11-12 17:42:05 +05:30
Anand Doshi
e19abfbe70 Merge branch 'develop' 2015-11-12 17:10:49 +05:30
Anand Doshi
3fc1c44334 bumped to version 6.8.0 2015-11-12 17:40:48 +06:00
Anand Doshi
bb347f5afa [translations] 2015-11-12 16:39:58 +05:30
Anand Doshi
938b530ebf [change-log] 2015-11-12 15:44:09 +05:30
Anand Doshi
28962f26d4 Merge pull request #4307 from frappe/v5.x.x
[fix] Stock Entry additional costs patch fix for v4 accounts
2015-11-12 15:30:59 +05:30
Anand Doshi
0b5489ca88 Merge pull request #4312 from nabinhait/delete_uom_replace_utility
Deleted Stock UOM Replace Utility
2015-11-12 15:26:41 +05:30
Anand Doshi
adebf31041 Merge pull request #4313 from saurabh6790/doc
[help-page] drop-shipping documentation
2015-11-12 15:25:50 +05:30
Anand Doshi
7fbab12c5d Merge branch 'rmehta-setup-wizard-in-frappe' into develop 2015-11-12 12:48:31 +05:30
Saurabh
11cc43a5a6 [help-page] drop-shipping documentation 2015-11-12 12:39:21 +05:30
Nabin Hait
61fb7ee5b8 Deleted Stock UOM Replace Utility 2015-11-12 12:06:47 +05:30
Rushabh Mehta
37b4d75e4a [re-org] setup wizard in frappe 2015-11-12 11:45:47 +05:30
Anand Doshi
f71ecbba2c Merge pull request #4311 from rmehta/auth-rule-cleanup
Auth rule cleanup
2015-11-12 11:40:55 +05:30
Anand Doshi
c5c6c0669f [fix] gross profit 2015-11-12 11:07:32 +05:30
Anand Doshi
fe85b2ea17 Merge branch 'nabinhait-erpnext_docs' into develop 2015-11-10 18:59:55 +05:30
Anand Doshi
1c1eb7018c [docs] fixed Linked With and title 2015-11-10 18:58:56 +05:30
Anand Doshi
8df5b5e3a1 Merge branch 'develop' 2015-11-10 11:31:29 +05:30
Anand Doshi
39982a5f02 bumped to version 6.7.8 2015-11-10 12:01:29 +06:00
Rushabh Mehta
8f228dd7f9 [fix] [minor] closed not in notifications 2015-11-10 11:28:35 +05:30
Rushabh Mehta
739aa4d51a [minor] allow pricing rule to have negative discount 2015-11-09 17:05:12 +05:30
Nabin Hait
f9ef0e4e15 [docs] Fixed ref docs, image and video links 2015-11-09 15:41:45 +05:30
Nabin Hait
fc51ec7f58 [docs] Added existing erpnext manual 2015-11-09 14:40:34 +05:30
Nabin Hait
7ba4d02444 [docs] First commit for docs 2015-11-09 14:40:29 +05:30
Anand Doshi
87b5fcb3b5 Merge branch 'develop' 2015-11-09 13:17:49 +05:30
Anand Doshi
7489d29813 bumped to version 6.7.7 2015-11-09 13:47:49 +06:00
Anand Doshi
268d300030 Merge pull request #4297 from frappe/revert-4294-develop
Revert b28573ab03
2015-11-09 13:17:04 +05:30
Anand Doshi
7f77002015 Revert b28573ab03 2015-11-09 13:16:24 +05:30
Anand Doshi
b28573ab03 Merge pull request #4294 from neilLasrado/develop
[Minor fix] Allowed maintenance schedule to be imported via data import tool
2015-11-09 13:13:41 +05:30
Anand Doshi
c756ff67b0 Merge pull request #4296 from anandpdoshi/sales-order-allow-delivery
[fix] Allow both Purchase Order and Delivery from Sales Order, based on drop shipping checkbox
2015-11-09 13:13:14 +05:30
Anand Doshi
4e72ef1421 [fix] Allow both Purchase Order and Delivery from Sales Order, based on drop shipping checkbox 2015-11-09 13:01:49 +05:30
Neil Trini Lasrado
6b173f3a67 Allowed maintenance schedule to be imported via data import tool 2015-11-09 11:38:06 +05:30
Rushabh Mehta
bbcce8cca0 [minor] [cleanup] cosmetic cleanup and fix to start auth rule, did not do big cleanup 2015-11-09 11:28:51 +05:30
Rushabh Mehta
c438c1dec7 [minor] allow pricing rule to have negative discount 2015-11-07 20:28:43 +05:30
Anand Doshi
fcfced624a Merge branch 'develop' 2015-11-07 15:40:22 +05:30
Anand Doshi
64949bfc4b bumped to version 6.7.6 2015-11-07 16:10:22 +06:00
Anand Doshi
438c4fb279 [patch] reload doctype Leave Allocation 2015-11-07 15:38:29 +05:30
Rushabh Mehta
ae4c8a6a48 Merge branch 'develop' 2015-11-06 16:54:17 +05:30
Rushabh Mehta
0d7213122a bumped to version 6.7.5 2015-11-06 17:24:17 +06:00
Rushabh Mehta
4268b0092a [minor] don't show po / mr buttons if delivered 2015-11-06 16:52:18 +05:30
Rushabh Mehta
64e31e9a4e [fix] process payroll 2015-11-06 14:47:12 +05:30
Rushabh Mehta
0a0c267edb Merge branch 'develop' 2015-11-06 11:45:09 +05:30
Rushabh Mehta
1a8d4b6ea7 bumped to version 6.7.4 2015-11-06 12:15:09 +06:00
Rushabh Mehta
97426776bd Merge pull request #4281 from nabinhait/address_fix
[fix] Clear addressed and contacts on a new form
2015-11-06 11:02:31 +05:30
Rushabh Mehta
60e7f01fd4 Merge branch 'develop' 2015-11-06 10:49:53 +05:30
Rushabh Mehta
169089bdde bumped to version 6.7.3 2015-11-06 11:19:53 +06:00
Rushabh Mehta
c14f80838b [fix] [hot] leave allocation patch 2015-11-06 10:49:16 +05:30
Rushabh Mehta
a5007db902 Merge branch 'develop' 2015-11-06 10:41:06 +05:30
Rushabh Mehta
0d58501229 bumped to version 6.7.2 2015-11-06 11:11:06 +06:00
Nabin Hait
7c654cd1bb Leave allocation patch included 2015-11-06 10:37:26 +05:30
Rushabh Mehta
54fc260a42 [minor] trigger link triggers while mapping material request to po to set supplier default currency 2015-11-05 15:26:02 +05:30
Rushabh Mehta
7a39d51366 [fix] pull tax rate in item tax 2015-11-05 15:19:11 +05:30
Rushabh Mehta
79c94426f7 Merge pull request #4277 from nabinhait/gross_profit_fix
[fix][report] Buying amount for product bundle in Gross Profit report
2015-11-05 14:04:30 +05:30
Nabin Hait
c3ced9a0b5 [fix][report] Buying amount for product bundle in Gross Profit report 2015-11-05 13:13:31 +05:30
Rushabh Mehta
c825575940 Merge branch 'develop' 2015-11-05 10:51:31 +05:30
Rushabh Mehta
afd3209017 bumped to version 6.7.1 2015-11-05 11:21:31 +06:00
Rushabh Mehta
c541b87bb9 [thumbnail] remove attachment if fails 2015-11-05 10:49:42 +05:30
Rushabh Mehta
b42f3e34ef Merge branch 'develop' 2015-11-04 18:18:08 +05:30
Rushabh Mehta
6a7edd32aa bumped to version 6.7.0 2015-11-04 18:48:07 +06:00
Rushabh Mehta
fc307970aa [translations] 2015-11-04 18:02:45 +05:30
Rushabh Mehta
b9e7cb02f4 [change-log] 2015-11-04 17:02:13 +05:30
Rushabh Mehta
a20a419cb8 Merge pull request #4274 from saurabh6790/drop-shipping
[fixes] update delivery status
2015-11-04 16:41:22 +05:30
Saurabh
d805bd7daf [fixes] update delivery status 2015-11-04 16:40:09 +05:30
Rushabh Mehta
ac53f2dbb1 [test] [fix] 2015-11-04 15:47:08 +05:30
Rushabh Mehta
20a7d820ab [fix] shot ledger buttons for closed DN / PR 2015-11-04 15:31:41 +05:30
Rushabh Mehta
d48c2394e8 [cleanup] drop ship testing & cleanup 2015-11-04 15:24:04 +05:30
Rushabh Mehta
58101e9e6c Merge pull request #4272 from nabinhait/report-fix1
[report] Added delay in payment column
2015-11-04 13:18:42 +05:30
Rushabh Mehta
666131d2fe Merge pull request #4271 from saurabh6790/drop-shipping
Exclude warehouse from drop ship and re-open status for DN / PR
2015-11-04 13:18:20 +05:30
Rushabh Mehta
118f043335 Merge pull request #4270 from rmehta/email-digest-fix
Email digest fixes
2015-11-04 13:18:08 +05:30
Nabin Hait
b4a51ec80b [report] Added delay in payment column 2015-11-04 13:09:48 +05:30
Saurabh
6197860643 [fixes] test case update 2015-11-04 12:43:40 +05:30
Saurabh
95fbfa4928 [fixes] typo fixes 2015-11-04 12:10:01 +05:30
Saurabh
b7f0a4961e - no delivery / reserve warehouse in drop ship
- “Re-open” in DN / PR after “Stop” / “Close"
- check for closed status in reports
2015-11-04 12:03:54 +05:30
Rushabh Mehta
9c044eefff [cleanup] re-arrange drop ship field 2015-11-03 18:28:37 +05:30
Rushabh Mehta
5951692db0 [fix] cleanup stop-resume code 2015-11-03 18:20:39 +05:30
Rushabh Mehta
bd4814fbb7 [fix] email digest periods for weekly and monthly 2015-11-03 16:55:33 +05:30
Rushabh Mehta
7d23e4286e [minor] move item to top in stock module page 2015-11-03 16:25:09 +05:30
Rushabh Mehta
15ea751f3c Merge pull request #4268 from saurabh6790/drop-shipping
[fixes] missing delivered by supplier field
2015-11-03 10:43:27 +05:30
Saurabh
c40148e0da [fixes] missing delivered by supplier field 2015-11-03 10:32:46 +05:30
Rushabh Mehta
a9dda232b2 [minor] move item to top in stock module page 2015-11-02 17:47:50 +05:30
Rushabh Mehta
1f25c45ad7 Merge pull request #4266 from saurabh6790/fixes1
[fixes] args fixes
2015-11-02 16:26:40 +05:30
Saurabh
12ffd914ee [fixes] args fixes 2015-11-02 16:10:09 +05:30
Rushabh Mehta
b1d8979a59 Merge pull request #4179 from saurabh6790/drop-shipping
Drop shipping
2015-11-02 15:43:48 +05:30
Rushabh Mehta
ec2d0030b7 Merge pull request #4265 from nabinhait/jv_fix
[cleanup] Make Payment Entry from Order/Invoice
2015-11-02 15:23:01 +05:30
Rushabh Mehta
55d0506155 Merge pull request #4264 from superlack/patch-3
Update time_log_batch.py
2015-11-02 15:21:59 +05:30
Rushabh Mehta
5e9b52c273 Merge pull request #4263 from superlack/patch-2
Update time_log_batch_detail.json
2015-11-02 15:21:54 +05:30
Rushabh Mehta
00b4663e12 Merge pull request #4262 from saurabh6790/close_pr_dn
[feature] Close feature for Purchase Receipt and Delivery Note
2015-11-02 15:21:19 +05:30
Rushabh Mehta
e54a4004ec Merge pull request #4258 from anandpdoshi/fixes-3to6
[fix] issues encountered migrating from v3/4 to 6
2015-11-02 15:20:25 +05:30
Rushabh Mehta
d0b086ca54 Merge pull request #4255 from anandpdoshi/slovene-language
added Slovene and updated translations
2015-11-02 15:20:17 +05:30
Rushabh Mehta
8d1191ac8f Merge pull request #4252 from anandpdoshi/edge-case-website-variant-selection
[fix] Edge case in variant selection in website - when variant has less number of attributes than template
2015-11-02 15:20:10 +05:30
Rushabh Mehta
a938b81e1c Merge pull request #4251 from saurabh6790/hr
Leave allocation based on Date range
2015-11-02 15:19:55 +05:30
Saurabh
7cd0ba70d9 [fixes] typo error 2015-11-02 15:18:23 +05:30
Nabin Hait
66340f9894 [cleanup] Make Payment Entry from Order/Invoice 2015-11-02 14:40:47 +05:30
superlack
41f7f7442b Update time_log_batch.py 2015-11-02 00:39:36 -08:00
superlack
126fb31f9a Update time_log_batch_detail.json 2015-11-02 00:38:17 -08:00
Saurabh
a8a91cca16 [feature] Close feature for Purchase Receipt and Delivery Note 2015-11-02 12:57:08 +05:30
Saurabh
381385d19a [fixes] add status 'Closed' in filter creating PR, PI from PO and SI, DN from SO 2015-11-02 11:30:51 +05:30
Anand Doshi
aba8fdd18d [fix] issues encountered migrating from v3/4 to 6 2015-10-31 22:49:42 +05:30
Nabin Hait
915778fb69 [fix] Clear addressed and contacts on a new form 2015-10-30 14:43:13 +05:30
Anand Doshi
bacc679df5 [language] added Slovene and updated translations 2015-10-30 12:54:27 +05:30
Anand Doshi
b0388d971a [minor] reduced size of video placeholder 2015-10-30 12:54:10 +05:30
Saurabh
61c9ea938d [Change Log] change log entry for drop shipment 2015-10-30 12:02:24 +05:30
Saurabh
6956eee790 [fixes] test case and code rewrite 2015-10-29 19:43:35 +05:30
Saurabh
2e65aadb1e [fixes] reload doc after status update and supplier address fetching 2015-10-29 19:43:35 +05:30
Saurabh
653cffec1e [change_log and fixes] set print hide, add change_log 2015-10-29 19:43:35 +05:30
Saurabh
cc8f1afa56 [fixes] test case fixes for drop shipping 2015-10-29 19:43:35 +05:30
Saurabh
2f702dcb32 [fixes] bulk close facility, rename Drop Ship to Delivered By Supplier 2015-10-29 19:43:35 +05:30
Saurabh
f857d81f35 [fixes]test case to check updated delivered qty 2015-10-29 19:43:34 +05:30
Saurabh
6d64fe378d [fixes] remover per_ordered field and update delivered qty from perchase order via delivered by supplier -1 2015-10-29 19:43:34 +05:30
Saurabh
b0ab93f779 [fixes] typo error 2015-10-29 19:43:34 +05:30
Saurabh
df1c1a573f [fixes] test case for per_ordered 2015-10-29 19:43:34 +05:30
Saurabh
a1f2aec918 [fixes] check ordered and reserved qrt, check closed status for so and po 2015-10-29 19:43:34 +05:30
Saurabh
d8930a776d [fixes] test case import fix 2015-10-29 19:43:34 +05:30
Saurabh
8a8ef85174 [fixes] reviwe fixes 2015-10-29 19:43:33 +05:30
Saurabh
edba048c14 [fixes] set is_stock_item for test items 2015-10-29 19:43:33 +05:30
Saurabh
b705798ccb [enhance & fixes] Print Format on PO for Drop Shipping 2015-10-29 19:43:33 +05:30
Saurabh
5e0b0b4b97 [enhance] make PO from SO if supplier is specified 2015-10-29 19:43:33 +05:30
Saurabh
a4efbf0db7 [fixes] check for close status 2015-10-29 19:43:33 +05:30
Saurabh
e930f0f74e [fixes] filter on supplier list for DropShip, checking closed status 2015-10-29 19:43:33 +05:30
Saurabh
99543f72d8 [fixes] test case for drop shipping and minor fixes for test_reserved_qty_for_partial_delivery & test_reserved_qty_for_partial_delivery_with_packing_list 2015-10-29 19:43:32 +05:30
Saurabh
1a9646739a [fixes][rename-field-name] drop_ship to is_drop_ship 2015-10-29 19:43:32 +05:30
Saurabh
bd65cb8817 [fixes] field rename and test case for drop ship 2015-10-29 19:43:32 +05:30
Saurabh
98b287565a [enhance] close purchase order 2015-10-29 19:43:32 +05:30
Saurabh
c6dbe70256 [Fixes] Drop Shipping 2015-10-29 19:43:32 +05:30
Saurabh
556536615e [minor fix] Status fix in listview 2015-10-29 19:43:31 +05:30
Saurabh
8bd96f1c08 [Test Case] Test case to check drop shipping 2015-10-29 19:43:31 +05:30
Saurabh
5b7e9a1c94 [minor fixes] 2015-10-29 19:43:31 +05:30
Saurabh
c306b21415 [merge fixes] 2015-10-29 19:43:31 +05:30
Anand Doshi
c39cef363c [fix] stop welcome video if user moves to another page 2015-10-29 18:37:17 +05:30
Nabin Hait
baefec4498 Merge branch 'develop' 2015-10-29 16:35:06 +05:30
Nabin Hait
02a56b4e1a bumped to version 6.6.7 2015-10-29 17:05:06 +06:00
Nabin Hait
9a6df0341f Merge pull request #4246 from anandpdoshi/welcome-to-erpnext
Show Welcome to ERPNext after completing Setup Wizard
2015-10-29 16:29:10 +05:30
Nabin Hait
5a90e3b2e9 Merge pull request #4254 from nabinhait/pr_qty
[fix] Consider Rejected Qty for Qty validation in Purchase Receipt
2015-10-29 16:27:02 +05:30
Anand Doshi
7dab3c1f85 Show Welcome to ERPNext after completing Setup Wizard 2015-10-29 15:32:00 +05:30
Nabin Hait
f9a974385a [fix] Consider Rejected Qty for Qty validation in Purchase Receipt 2015-10-29 14:54:29 +05:30
Saurabh
20a653e829 [fixes] Test case fixes for leave application 2015-10-29 14:27:57 +05:30
Saurabh
a2c668cb77 [fixes] patch, test cases and validations 2015-10-29 14:27:57 +05:30
Saurabh
d0b0a80be3 [enhacement] remove fiscal year from leave allocation 2015-10-29 14:27:57 +05:30
Anand Doshi
532b9e8bfb [fix] Edge case in variant selection in website - when variant has less number of attributes than template 2015-10-29 13:20:07 +05:30
Anand Doshi
32e48bb568 Merge pull request #4250 from anandpdoshi/disable-item
[enhancement] Ability to disable an Item
2015-10-29 13:12:20 +05:30
Anand Doshi
21e09a2bd8 [enhancement] Ability to disable an Item 2015-10-29 12:39:47 +05:30
Nabin Hait
1aa6e98136 Merge pull request #4249 from nabinhait/cc_fix
[fix] Default cost center as per company
2015-10-29 12:28:20 +05:30
Nabin Hait
023c036afa Merge pull request #4248 from anandpdoshi/item-variant-expired
[fix] don't show expired items in website item list. Fixes #4210.
2015-10-29 12:28:03 +05:30
Nabin Hait
8372c44262 [fix] Default cost center as per company 2015-10-29 11:50:36 +05:30
Anand Doshi
6d69ca6bac [fix] don't show expired items in website item list. Fixes #4210. 2015-10-29 11:35:16 +05:30
Nabin Hait
283b55f88c Merge branch 'develop' 2015-10-28 16:07:13 +05:30
Nabin Hait
4757d0634a bumped to version 6.6.6 2015-10-28 16:37:13 +06:00
Nabin Hait
dc8ce7f7e9 Merge pull request #4245 from nabinhait/sr_no
[fix] Serial No query in Warranty Claim
2015-10-28 15:51:32 +05:30
Nabin Hait
d02375e89d Merge branch 'anandpdoshi-file-fix' into develop 2015-10-28 15:50:41 +05:30
Nabin Hait
a90a0528aa Fixed conflict 2015-10-28 15:50:26 +05:30
Nabin Hait
350f9592d3 Merge pull request #4237 from sbkolate/develop
[minor] Update Help Video Links in Buying, CRM, Selling  #4233
2015-10-28 15:44:39 +05:30
Nabin Hait
43e50de6ef Merge pull request #4243 from nabinhait/last_pur_rate
[patch] Deleted Item-wise Last Purchase Rate report
2015-10-28 15:42:35 +05:30
Nabin Hait
a530f410e3 Merge pull request #4242 from nabinhait/to_warehouse_dn
[fix] Ignore users permission for To Warehouse field in Delivery Note
2015-10-28 15:42:16 +05:30
Nabin Hait
bdfb070ed6 [fix] Serial No query in Warranty Claim 2015-10-28 15:38:22 +05:30
Anand Doshi
caa9fc033f [hotfix] vietnamese translation for Debit Note 2015-10-28 14:34:48 +05:30
Nabin Hait
15bf4e5599 [patch] Deleted Item-wise Last Purchase Rate report 2015-10-28 12:48:32 +05:30
Nabin Hait
6d490e530a [fix] Ignore users permission for To Warehouse field in Delivery Note 2015-10-28 12:43:45 +05:30
Rushabh Mehta
9b363fe5f1 Merge pull request #4240 from hubdotcom/patch-1
change to JavaScript
2015-10-28 10:10:23 +05:30
Jamie
3c5df9f64c change to JavaScript 2015-10-27 16:37:45 +00:00
Sambhaji Kolate
fd53991dfa [minor] Update Help Video Links in Buying, CRM, Selling #4233 2015-10-27 17:01:27 +05:30
Anand Doshi
c794ca53fb [fix] delete file records created via item.py even if website_image file didn't exist 2015-10-27 16:56:42 +05:30
Nabin Hait
fa0adafa82 Merge branch 'develop' 2015-10-27 11:29:35 +05:30
Nabin Hait
99f4b43641 bumped to version 6.6.5 2015-10-27 11:59:35 +06:00
Nabin Hait
fdeab29e94 Removed console.log 2015-10-27 11:23:43 +05:30
Nabin Hait
31755b485f Merge pull request #4232 from anandpdoshi/variant-smart-selection
Numeric attribute selector, smart selection of variant based on attribute combinations
2015-10-27 11:22:54 +05:30
Anand Doshi
3f3696d1eb [enhancement] [website] numeric attribute selector, smart selection of variant based on attribute combinations 2015-10-26 21:55:34 +05:30
Nabin Hait
e1a478779c Merge pull request #4231 from nabinhait/pos_fix
[fix] Is POS trigger
2015-10-26 18:22:04 +05:30
Nabin Hait
6c6f3789d0 [fix] Is POS trigger 2015-10-26 18:01:12 +05:30
Nabin Hait
044c43a5cb Merge pull request #4230 from nabinhait/fix26
minor fix
2015-10-26 17:43:17 +05:30
Nabin Hait
9ce9c052e4 Merge pull request #4229 from nabinhait/fix25
[fix] Account Type in Chart of Accounts
2015-10-26 17:43:11 +05:30
Nabin Hait
83e68bb837 minor fix 2015-10-26 17:40:31 +05:30
Nabin Hait
415df04834 [fix] Account Type in Chart of Accounts 2015-10-26 16:43:09 +05:30
Nabin Hait
6d2d6862d6 Merge pull request #4228 from nabinhait/exchange_rate
[fix] account currency is not mandatory in get exchange rate
2015-10-26 15:27:19 +05:30
Nabin Hait
13a65d52dd Merge pull request #4226 from nabinhait/email_digest
[fix] Events in Email Digest
2015-10-26 14:47:09 +05:30
Nabin Hait
6485d4a749 [fix] account currency is not mandatory in get exchange rate 2015-10-26 14:31:17 +05:30
Nabin Hait
2e63c80523 Merge pull request #4220 from nabinhait/fix21
Don't delete tax template and pos profile while deleting company transactions
2015-10-26 14:14:44 +05:30
Nabin Hait
23bd21778e [fix] Events in Email Digest 2015-10-26 14:14:09 +05:30
Nabin Hait
a3f490890d Merge pull request #4227 from nabinhait/dn_to_wh
[fix] Label changed for Target Warehouse in Delivery Note
2015-10-26 13:02:59 +05:30
Nabin Hait
8e3ea32d6d Merge pull request #4222 from nabinhait/tax_rule
Set tax rule based on date
2015-10-26 13:02:21 +05:30
Nabin Hait
c4a1a943ef Merge pull request #4221 from nabinhait/fix22
[fix] Value mapping while making bank entry from Expense Claim
2015-10-26 13:00:52 +05:30
Nabin Hait
abc0b64b68 [fix] Label changed for Target Warehouse in Delivery Note 2015-10-26 11:58:43 +05:30
Nabin Hait
00818bfa90 Set tax rule based on date 2015-10-23 16:26:09 +05:30
Anand Doshi
b9bfe6117e [optimization] Stock Projected Qty report 2015-10-23 14:49:09 +05:30
Nabin Hait
7a9f46d9d1 [fix] Value mapping while making bank entry from Expense Claim 2015-10-23 13:19:01 +05:30
Nabin Hait
a10b52c6e6 Don't delete tax template and pos profile while deleting company transactions 2015-10-23 13:02:55 +05:30
Rushabh Mehta
5033e7b431 [hot] fix stock projected qty 2015-10-23 10:51:56 +05:30
Rushabh Mehta
e6791ee78e [fix] digest values in absolute 2015-10-23 10:39:46 +05:30
Anand Doshi
b84ba868e6 Merge branch 'develop' 2015-10-22 22:02:59 +05:30
Anand Doshi
1c501b6aac bumped to version 6.6.4 2015-10-22 22:32:59 +06:00
Anand Doshi
9a2a6d8fcb [hotfix] setup wizard is_pro_application if not service 2015-10-22 22:02:22 +05:30
Anand Doshi
0b59d1c78b Merge branch 'develop' 2015-10-22 21:59:21 +05:30
Anand Doshi
0fbf10797c bumped to version 6.6.3 2015-10-22 22:29:21 +06:00
Anand Doshi
58344cbb81 [hotfix] setup wizard is_pro_application if not service 2015-10-22 21:57:13 +05:30
Anand Doshi
c6e2c8f79e Merge branch 'develop' 2015-10-22 19:36:09 +05:30
Anand Doshi
b64b461d53 bumped to version 6.6.2 2015-10-22 20:06:09 +06:00
Anand Doshi
0b93bdcf40 [fix] get_party_gle_currency caching 2015-10-22 19:33:08 +05:30
Anand Doshi
e3910d02a5 Merge branch 'develop' 2015-10-22 18:53:19 +05:30
Anand Doshi
0af146cea6 bumped to version 6.6.1 2015-10-22 19:23:19 +06:00
Anand Doshi
683f756d0f [fix] Fetch company of employee in leave application 2015-10-22 18:52:15 +05:30
Anand Doshi
d905204e49 [fix] Update expense account in old purchase invoices if missing 2015-10-22 18:49:08 +05:30
Anand Doshi
d8bc40d7f0 [fix] party gle currency validation 2015-10-22 17:55:22 +05:30
Anand Doshi
54059b77a0 Merge branch 'develop' 2015-10-22 17:12:01 +05:30
Anand Doshi
f9f0e2591f bumped to version 6.6.0 2015-10-22 17:42:00 +06:00
Anand Doshi
5810bf70c7 [change-log] 2015-10-22 17:02:44 +05:30
Anand Doshi
97d8db775e Merge pull request #4208 from nabinhait/pcv
Period Closing Voucher as per multi currency
2015-10-22 16:46:26 +05:30
Nabin Hait
fbe08ec7d0 Period Closing Voucher Test Cases 2015-10-22 16:21:37 +05:30
Nabin Hait
0045c305ac Period Closing Voucher as per multi currency 2015-10-22 16:21:37 +05:30
Anand Doshi
5dd0fb6e2a Merge pull request #4213 from nabinhait/serial_no_fix
[fix] For Serial No Status
2015-10-22 15:25:11 +05:30
Anand Doshi
e99fff8d08 Merge pull request #4212 from anandpdoshi/leave-application-js-clenup
[minor] leave application cleanup
2015-10-22 15:19:57 +05:30
Anand Doshi
b61fed9106 Merge pull request #4205 from nabinhait/expenses_included_in_valuation
Expenses Included in Valuation
2015-10-22 15:19:38 +05:30
Nabin Hait
398c83afa5 [fix] For Serial No Status 2015-10-22 15:11:44 +05:30
Anand Doshi
c346484ca4 [minor] leave application cleanup 2015-10-21 19:56:14 +05:30
Nabin Hait
70b7f7f036 minor improvement in patch 2015-10-21 17:40:06 +05:30
Nabin Hait
31c51ef914 [fix] test case for purchase invoice gle 2015-10-21 17:40:06 +05:30
Nabin Hait
be464696cc [fix][patch] Fix wrong gle for Purchase Invoice against Expenses Included in Valuation account 2015-10-21 17:40:06 +05:30
Anand Doshi
191b2970e9 [translations] updated 2015-10-21 16:59:33 +05:30
Anand Doshi
c50f033722 [language] Added Ukranian language - українська. Closes frappe/translator#57 2015-10-21 16:59:32 +05:30
Anand Doshi
e1e1414894 Merge pull request #4195 from anandpdoshi/journal-entry-posting-date
[enhancement] Quick Entry in Journal Entry, remember Posting Date
2015-10-21 16:50:40 +05:30
Anand Doshi
d1441245fb [fix] variant website page render 2015-10-21 16:36:43 +05:30
Anand Doshi
87da662703 [enhancement] Quick Entry in Journal Entry, remember Posting Date 2015-10-21 16:27:13 +05:30
Anand Doshi
99ba924303 Merge pull request #4207 from rmehta/rename-tool
[feature] rename via console merge with frappe/frappe#1349
2015-10-21 14:27:49 +05:30
Anand Doshi
066ff9599a Merge pull request #4206 from neilLasrado/variant
Prevent Template Item from going into infinite loop while saving
2015-10-21 14:20:49 +05:30
Rushabh Mehta
33ebaf479d [feature] rename via console merge with frappe/frappe#1349 2015-10-21 12:26:37 +05:30
Neil Trini Lasrado
3a573d1a6d Prevent Template Item from going into infinite loop while saving 2015-10-21 12:20:06 +05:30
Rushabh Mehta
7f66983309 [minor] added column type definition in batch-wise balance history 2015-10-21 12:04:27 +05:30
Rushabh Mehta
2c867fdd73 [fix] email digest cache 2015-10-21 11:13:40 +05:30
Anand Doshi
95dfc2730b [fix] re-run thumbnail patch 2015-10-20 19:03:30 +05:30
Anand Doshi
558646c6b8 [fix] ignore mandatory when creating customer and contact in cart 2015-10-20 18:57:38 +05:30
Anand Doshi
ea0d98891f [minor] don't display missing file doc message in item's make thumbnail 2015-10-20 18:57:38 +05:30
Anand Doshi
1b4c5ad1e1 Merge branch 'develop' 2015-10-20 18:35:49 +05:30
Anand Doshi
2678135f5e bumped to version 6.5.3 2015-10-20 19:05:49 +06:00
Anand Doshi
25ef4ff373 [fix] variant selector display 2015-10-20 18:34:21 +05:30
Anand Doshi
c85a37fe00 Merge branch 'develop' 2015-10-20 17:53:37 +05:30
Anand Doshi
3c3d69f905 bumped to version 6.5.2 2015-10-20 18:23:37 +06:00
Anand Doshi
aed8da40ae Merge pull request #4198 from nabinhait/mc_fix
[fix] Set higher precision for debit, credit and exchange rate field
2015-10-20 17:46:22 +05:30
Anand Doshi
3bc43682f1 Merge pull request #4199 from neilLasrado/item
Default value of allow production order in Item master changed to 1
2015-10-20 17:44:26 +05:30
Rushabh Mehta
725816e616 Merge pull request #4203 from anandpdoshi/item-variant-in-website
[fix] Patch template item to be shown in website, show variant's description and price on change of attribute
2015-10-20 17:41:26 +05:30
Anand Doshi
7c0eadb451 [fix] Patch template item to be shown in website, show variant's description and price on change of attribute 2015-10-20 17:30:02 +05:30
Neil Trini Lasrado
d4357e80d7 Fixed Test Cases 2015-10-20 16:21:02 +05:30
Neil Trini Lasrado
c0f88e4caf Default value fot allow production order in Item master changed to 1 2015-10-20 15:51:04 +05:30
Anand Doshi
73286dd9f5 [minor] define email field for Issue 2015-10-20 14:53:22 +05:30
Anand Doshi
1f259ba73d Merge pull request #4178 from anandpdoshi/item-reorder-if-no-bin
[fix] Item Re-order if Bin does not exists and fixed Stock Projected Qty report to show per Warehouse Re-order level
2015-10-20 14:43:20 +05:30
Anand Doshi
7b2b0cd73c [fix] Item Re-order if Bin does not exists and fixed Stock Projected Qty report to show per Warehouse Re-order level 2015-10-20 14:29:47 +05:30
Anand Doshi
2c749db2a9 Merge pull request #4196 from neilLasrado/develop
Fixed issue in Item Variant for Numeric Attributes
2015-10-20 14:28:16 +05:30
Anand Doshi
17c633d00f [fix] Set fieldtype of description field as Text Editor in Landed Cost Item 2015-10-20 14:26:44 +05:30
Anand Doshi
4ee5b75687 Merge pull request #4200 from nabinhait/fix16
[fix] Set fieldtype of description field as Text in Landed Cost Item
2015-10-20 14:24:36 +05:30
Neil Trini Lasrado
a4fad72a65 Considered greater precision of value and increment (better code) 2015-10-20 12:20:49 +05:30
Neil Trini Lasrado
e65ac00f36 Considered greater precision of value and increment 2015-10-20 12:20:49 +05:30
Neil Trini Lasrado
75bd0f7cfe Fixed issue in Item Variant for Numeric Attributes 2015-10-20 12:20:49 +05:30
Nabin Hait
4d20f3029b [fix] Set fieldtype of description field as Text in Landed Cost Item 2015-10-20 12:18:19 +05:30
Nabin Hait
c35b35abca [fix] Set higher precision for exchange rate field 2015-10-20 12:11:51 +05:30
Anand Doshi
17dc249841 [fix] rollback if exception in bulk rename 2015-10-20 12:11:26 +05:30
Anand Doshi
12af47918d [fix] rename tool 2015-10-20 12:02:39 +05:30
Anand Doshi
84ca0197e4 Merge pull request #4197 from saurabh6790/fixes
[minor][fix] set default fiscal year for holiday list calendar view
2015-10-20 11:40:00 +05:30
Anand Doshi
3395e7a2e4 [fix] Daily digest date format 2015-10-20 08:48:43 +05:30
Anand Doshi
25956d6282 [fix] Item thumbnail 2015-10-20 08:48:43 +05:30
Saurabh
ba2133cba2 [minor][fix] set default fiscal year for holiday list calendar view 2015-10-19 19:20:11 +05:30
Anand Doshi
28e3d63280 Merge branch 'develop' 2015-10-19 19:10:58 +05:30
Anand Doshi
414660313a bumped to version 6.5.1 2015-10-19 19:40:58 +06:00
Anand Doshi
c52a601e87 Merge pull request #4189 from nabinhait/dn_target_wh_testcase
Test case fixed for swtiching valuation method
2015-10-19 19:09:27 +05:30
Anand Doshi
7a869b0dca [hotfix] print in patch 2015-10-19 17:33:40 +05:30
Nabin Hait
6f64a78ecf Test case fixed for swtiching valuation method 2015-10-19 16:53:35 +05:30
Nabin Hait
608bbc7850 Test case fixed for swtiching valuation method 2015-10-19 16:53:35 +05:30
Anand Doshi
639826e888 Merge branch 'develop' 2015-10-19 16:30:33 +05:30
Anand Doshi
16b2c51988 bumped to version 6.5.0 2015-10-19 17:00:33 +06:00
Anand Doshi
76e9ba1e76 [change-log] 2015-10-19 16:03:34 +05:30
Anand Doshi
9dad86c189 Merge pull request #4190 from nabinhait/income_expense_account_query
[fix] Allowed accounts with account type='Income Account' for default income account in item
2015-10-19 15:43:32 +05:30
Anand Doshi
5302b46955 Merge pull request #4183 from nabinhait/multi_currency_fix
Multi currency fix
2015-10-19 15:32:24 +05:30
Nabin Hait
afd14f6f0e [fix] Allowed accounts with account type='Income Account' for default income account in item 2015-10-19 15:27:58 +05:30
Anand Doshi
05584d6d8b Merge pull request #4191 from rmehta/email-digest-quotes
[enhancement] add a quote with email digest
2015-10-19 15:18:20 +05:30
Nabin Hait
aa015902d5 Validate currency of default receivable/payable accounts 2015-10-19 15:10:11 +05:30
Nabin Hait
2873f2e7de Validate currency of default receivable/payable accounts 2015-10-19 15:10:11 +05:30
Rushabh Mehta
64fd970a8a Merge pull request #4193 from anandpdoshi/attach-as-small-text
[fix] change attach fields to small text
2015-10-19 14:58:57 +05:30
Anand Doshi
b4e9c1da64 [fix] thumbnail generation for item 2015-10-19 12:57:19 +05:30
Anand Doshi
1d093a4039 [fix] change attach fields to small text 2015-10-19 12:56:29 +05:30
Rushabh Mehta
fe9717cb9c [enhancement] add a quote with email digest 2015-10-19 12:35:07 +05:30
Anand Doshi
d665a07621 [fix] remove label 'Column Break' 2015-10-16 15:44:28 +05:30
Rushabh Mehta
2a1ba886f1 [patch-fix] 2015-10-15 16:56:53 +05:30
Rushabh Mehta
55f1ea05da [release] Added change log 2015-10-15 16:32:36 +05:30
Rushabh Mehta
2e7f9d2b8f [fixes] email digest 2015-10-15 16:31:16 +05:30
Rushabh Mehta
3a519f269d Merge pull request #4175 from anandpdoshi/dynamic-linked-with
[fix] exclude gl entry and stock ledger entry in linked with. Depends on frappe/frappe#1339
2015-10-15 14:25:18 +05:30
Rushabh Mehta
4c0d0793a3 Merge pull request #4174 from saurabh6790/shopping_cart
[fix] order.html rate display
2015-10-15 14:01:46 +05:30
Rushabh Mehta
d3b8a74508 [test] fix, force values in target warehouse too 2015-10-15 13:23:10 +05:30
Anand Doshi
77760db89c [fix] strip whitespace in setup wizard args 2015-10-15 12:54:40 +05:30
Anand Doshi
1d23ebb51d [fix] exclude gl entry and stock ledger entry in linked with. Depends on frappe/frappe#1339 2015-10-15 12:54:40 +05:30
Rushabh Mehta
ba5b0e8458 [test] [fix] print values for failing test 2015-10-15 12:45:42 +05:30
Rushabh Mehta
14a908bdec [test] [fix] abs(valuation_rate) for moving average 2015-10-15 12:28:20 +05:30
Rushabh Mehta
9f436a7c71 [fix] [exchange-rate] let user defined exchange rate take preceedence 2015-10-15 11:57:46 +05:30
Rushabh Mehta
746fd90625 [fix] [exchange-rate] let user defined exchange rate take preceedence 2015-10-15 11:50:38 +05:30
Rushabh Mehta
f861856ed9 [fix] do not check purchase invoice uniqueness for cancelled documents 2015-10-15 11:37:34 +05:30
Rushabh Mehta
f94f153078 [test] fixes 2015-10-15 11:31:59 +05:30
Rushabh Mehta
c9bacedbfe [test] fixes 2015-10-15 11:00:34 +05:30
Saurabh
c0cee82727 [small fixes] frozen customer testcase 2015-10-14 18:03:07 +05:30
Saurabh
4c53931363 [fixes and test case] test case to avoid duplicate customer name exection 2015-10-14 18:03:07 +05:30
Saurabh
53f7e6281c [fix] Duplicate Customer Name Error 2015-10-14 18:03:07 +05:30
Saurabh
9f235b891f [fix] order.html rate display 2015-10-14 18:03:07 +05:30
Rushabh Mehta
c4d4c7feb0 [fix] repost_actual_qty fix 2015-10-14 17:37:28 +05:30
Rushabh Mehta
ee6862b277 [fix] VARCHAR lengths as 140 2015-10-14 17:28:35 +05:30
Rushabh Mehta
53f77ad5e8 Merge pull request #4125 from rmehta/variant-in-website
[enhancement] add variants in website
2015-10-14 16:22:36 +05:30
Rushabh Mehta
fb73151da6 [fixes] 2015-10-14 16:22:01 +05:30
Rushabh Mehta
6e322d0a02 [enhancement] use thumbnails in grid views, patch to make thumbnails 2015-10-14 16:21:24 +05:30
Rushabh Mehta
73e73795f1 [minor] Added 'Invite User' in Contact 2015-10-14 16:20:39 +05:30
Rushabh Mehta
80d2a55342 [enhancement] add variants in website 2015-10-14 16:16:00 +05:30
Rushabh Mehta
9cbf6b1b22 Merge pull request #4114 from anandpdoshi/varchar-140
Limit varchar length to 140 instead of 255 to mitigate Row Size Too Large error
2015-10-14 16:14:53 +05:30
Anand Doshi
41dd2c458b [minor] pass does not exist error 2015-10-14 16:13:49 +05:30
Anand Doshi
71ebad5668 Limit varchar length to 140 instead of 255 to mitigate Row Size Too Large error 2015-10-14 16:13:49 +05:30
Rushabh Mehta
b4c0e94e99 Merge pull request #4113 from rmehta/email-digest-cleanup
[cleanup] Email Digest
2015-10-14 15:53:53 +05:30
Rushabh Mehta
73f1dc4edf [cleanup] added unsubscribe to email digest 2015-10-14 15:53:37 +05:30
Rushabh Mehta
174299124f [cleanup] [wip] email digest 2015-10-14 15:53:37 +05:30
Rushabh Mehta
c27748b2b3 Merge pull request #4040 from nabinhait/dn_target_warehouse
Delivery to target warehouse
2015-10-14 15:29:54 +05:30
Rushabh Mehta
626ba1bb81 [translations] added bn, da-DK, es-PE, si 2015-10-14 15:24:42 +05:30
Rushabh Mehta
591f047974 Merge pull request #4163 from neilLasrado/develop
Cost Center - Income Account
2015-10-14 15:20:11 +05:30
Nabin Hait
38e4c6f2af Allow same serial nos for raw materials and fg item in repack / manufacture entry 2015-10-13 18:37:39 +05:30
Neil Trini Lasrado
58e9590850 Fixed issues with Permissions in Company Doctype 2015-10-13 17:45:43 +05:30
Nabin Hait
03afb45e34 [fix] Validate deletion of serial no 2015-10-13 15:46:42 +05:30
Nabin Hait
d91382dbf3 [fix] serial no status 2015-10-13 15:46:42 +05:30
Nabin Hait
e07958bbda Change log and sopnsors for delivery to target warehouse 2015-10-13 15:46:42 +05:30
Nabin Hait
b445be3552 Test case for delivery to target warehouse 2015-10-13 15:46:42 +05:30
Nabin Hait
c865f229fb Target Warehouse in Delivery Note and Sales Invoice and removed Serial No status 2015-10-13 15:46:42 +05:30
Neil Trini Lasrado
ec5deb6e48 Changed label in Company 2015-10-13 15:28:12 +05:30
Neil Trini Lasrado
486bf2e113 Added Change Log 2015-10-13 15:17:53 +05:30
Neil Trini Lasrado
f49b085625 Allowed Income account to be added to Cost Center 2015-10-13 14:54:39 +05:30
Rushabh Mehta
adcaf75bb0 Merge branch 'develop' 2015-10-13 14:46:15 +05:30
Rushabh Mehta
4f4fc45ae6 bumped to version 6.4.7 2015-10-13 15:16:15 +06:00
Rushabh Mehta
079d0b7108 Merge pull request #4161 from rmehta/sales-order-status
[fix] Sales Order status for Maintenance
2015-10-13 12:38:00 +05:30
Rushabh Mehta
86125b2b9f [fix] sales order status for maintenance 2015-10-13 12:31:05 +05:30
Rushabh Mehta
22d0d586ab [minor] [typo] 2015-10-13 12:30:21 +05:30
Rushabh Mehta
eb62aed8c7 Merge pull request #4157 from nabinhait/bin
[fix][patch] Delete duplicate bins
2015-10-12 18:39:16 +05:30
Rushabh Mehta
60f1739ca5 Merge pull request #4158 from rmehta/journal-entry-title-fix
[fix] set title in Journal Entry only if not set
2015-10-12 18:35:49 +05:30
Rushabh Mehta
5f349a67c9 Merge pull request #4156 from rmehta/item-section-fix
[fix] [minor] collapsible section for Item - removed custom script
2015-10-12 18:35:38 +05:30
Rushabh Mehta
fd294eb981 Merge pull request #4154 from rmehta/sales-analytics-fix
[minor] [fix] Use customer_name in Sales Analytics
2015-10-12 18:32:39 +05:30
Rushabh Mehta
d256055a8c Merge pull request #4153 from rmehta/stock-entry-fix
[fix] [minor] stock_entry.py error for None qty
2015-10-12 18:32:28 +05:30
Rushabh Mehta
cefa106a06 Merge pull request #4151 from anandpdoshi/purchase-invoice-letterhead
[fix] Added Letter Head field to Purchase Invoice
2015-10-12 18:30:25 +05:30
Rushabh Mehta
67ecfcf52c Merge pull request #4148 from saurabh6790/erp_support
[minor fix], escape % char
2015-10-12 18:30:13 +05:30
Nabin Hait
b7e46c4ed9 [fix][patch] Delete duplicate bins 2015-10-12 18:28:50 +05:30
Rushabh Mehta
bc5ecfff06 Merge pull request #4146 from nabinhait/fix10
[fix] Multiple minor fixes
2015-10-12 18:27:02 +05:30
Rushabh Mehta
8fa4845d00 [fix] set title in Journal Entry only if not set 2015-10-12 16:59:52 +05:30
Rushabh Mehta
d4882653c3 [fix] [minor] collapsible section for Item - removed custom script 2015-10-12 16:45:53 +05:30
Anand Doshi
9a4d165ba2 [fix] get_party_details.js - set posting_date if args are initialised 2015-10-12 16:23:51 +05:30
Rushabh Mehta
a7099eaa8d [minor] [fix] Use customer_name in Sales Analytics 2015-10-12 16:22:10 +05:30
Anand Doshi
4b72d05793 [fix] get allocated_percentage from party's sales team 2015-10-12 16:15:52 +05:30
Rushabh Mehta
a30f3ea1f9 [fix] [minor] stock_entry.py error for None qty 2015-10-12 16:12:52 +05:30
Rushabh Mehta
3b6a8af0da Merge pull request #4150 from rmehta/project-title-fix
[fix] copy task titles with project
2015-10-12 15:57:04 +05:30
Anand Doshi
4fa69780a8 [fix] Added Letter Head field to Purchase Invoice 2015-10-12 15:55:24 +05:30
Rushabh Mehta
2dc619ae1f [fix] copy task titles with project 2015-10-12 15:55:12 +05:30
Nabin Hait
fc9031924e [fix] Field type of Age field converted to Int 2015-10-12 15:47:07 +05:30
Saurabh
e14124198d minor fix, escape % char 2015-10-12 15:08:09 +05:30
Nabin Hait
51e980dd2c [fix] Multiple minor fixes 2015-10-10 18:10:05 +05:30
Rushabh Mehta
95781919fb [fix] sales order notification 2015-10-08 11:50:04 +05:30
Rushabh Mehta
c03cba9d17 [fix] sales order notification 2015-10-08 11:46:32 +05:30
Nabin Hait
72cd206286 Merge branch 'develop' 2015-10-07 17:27:23 +05:30
Nabin Hait
9801745090 bumped to version 6.4.6 2015-10-07 17:57:23 +06:00
Anand Doshi
7866c6e6db [fix] modified in sales order and purchase order 2015-10-07 17:26:19 +05:30
Nabin Hait
5812fdb574 Merge branch 'develop' 2015-10-07 14:40:32 +05:30
Nabin Hait
4c502bcd26 bumped to version 6.4.5 2015-10-07 15:10:32 +06:00
Nabin Hait
714948c867 Merge pull request #4136 from nabinhait/uom
[fix] Fetch UOM Conversion Factor from template if not specified in variants
2015-10-07 14:30:18 +05:30
Nabin Hait
8f3b360f83 Merge pull request #4133 from saurabh6790/erp_support
Calendar view for holiday listing
2015-10-07 14:29:38 +05:30
Nabin Hait
314086d6c0 [fix] Fetch UOM Conversion Factor from template if not specified in variants 2015-10-07 11:55:08 +05:30
Nabin Hait
bcd655a985 Merge pull request #4109 from rmehta/fix-sales-purchase-order-status
[fix] sales & purchase order status
2015-10-07 11:34:30 +05:30
Saurabh
b0dbdc1439 minor fixes 2015-10-07 11:27:25 +05:30
Nabin Hait
37b0bf257d Merge pull request #4117 from nabinhait/sample_data
[fix] Create sample opportunity and quotation only if Customer exists
2015-10-07 11:25:50 +05:30
Nabin Hait
c5a25f44e1 Merge pull request #4119 from nabinhait/fix3
[fix] Return account currency only if account provided
2015-10-07 11:25:19 +05:30
Nabin Hait
8dafa376ab Merge pull request #4123 from nabinhait/fix4
[fix] allowed more than 2 currencies in Journal Entry
2015-10-07 11:24:45 +05:30
Saurabh
74eb8e34da [Fixes] minor fix for fiscal year in holiday list 2015-10-07 11:17:14 +05:30
Nabin Hait
5c66fb7631 Merge pull request #4130 from nabinhait/reports
[fix][report] Left join used in pending reports
2015-10-07 11:15:36 +05:30
Nabin Hait
be3b3b2107 Merge pull request #4132 from nabinhait/credit_limit
minor fix in credit limit
2015-10-07 11:15:02 +05:30
Nabin Hait
9ab09fd1d6 Merge pull request #4134 from nabinhait/valuation_rate
[fix] Valuation Rate in Stock Balance report
2015-10-07 11:09:56 +05:30
Nabin Hait
8a7bdd5a92 [fix] Valuation Rate in Stock Balance report 2015-10-06 18:46:56 +05:30
Saurabh
1d753c92b1 Calendar view for holiday listing 2015-10-06 15:21:23 +05:30
Nabin Hait
54ecc8ebba minor fix in credit limit 2015-10-06 14:28:41 +05:30
Nabin Hait
f4edaef481 [fix][report] Left join used in pending reports 2015-10-06 12:48:04 +05:30
Nabin Hait
ebbd163903 [fix] allowed more than 2 currencies in Journal Entry 2015-10-05 13:21:38 +05:30
Nabin Hait
8954b24b22 [fix] Return account currency only if account provided 2015-10-04 12:27:46 +05:30
Nabin Hait
ae92fc7f35 [fix] Create sample opportunity and quotation only if Customer exists 2015-10-03 13:42:44 +05:30
Rushabh Mehta
0bc3ca02f3 [fix] default contact for website 2015-10-03 12:08:43 +05:30
Rushabh Mehta
d10ba853e6 [fix] sales & purchase order status 2015-10-02 17:16:51 +05:30
Anand Doshi
5bcf8315de Merge branch 'develop' 2015-10-02 16:35:36 +05:30
Anand Doshi
789a798e36 bumped to version 6.4.4 2015-10-02 17:05:36 +06:00
Nabin Hait
ee1169dac7 Merge pull request #4112 from nabinhait/fix1
Minor fix
2015-10-02 16:27:49 +05:30
Nabin Hait
fbef1fdf3a Minor fix 2015-10-02 16:26:18 +05:30
Anand Doshi
4358e1cd46 Merge pull request #4111 from nabinhait/payment_reco_patch
[patch] Fix affected Journal Entries due to reconciliation
2015-10-02 16:05:03 +05:30
Nabin Hait
7a287a9153 [patch] Fix affected Journal Entries due to reconciliation 2015-10-02 16:00:42 +05:30
Anand Doshi
5a49ded5d9 Merge branch 'develop' 2015-10-02 12:43:27 +05:30
Anand Doshi
71f23acc2b bumped to version 6.4.3 2015-10-02 13:13:27 +06:00
Anand Doshi
1a1f790150 [fix] test case 2015-10-02 12:34:18 +05:30
Rushabh Mehta
3c54e9779b Merge pull request #4108 from nabinhait/payment_reco
[fix] Payment Reconciliation in multi-currency
2015-10-02 12:32:54 +05:30
Nabin Hait
db48b7d764 [fix] Payment Reconciliation in multi-currency 2015-10-02 12:05:55 +05:30
Rushabh Mehta
83c0899c83 [fix] [minor] default ranges for demo 2015-10-02 11:31:37 +05:30
Nabin Hait
e5047ec90a Merge pull request #4106 from anandpdoshi/payment-tool-amount
In Payment Tool, Set Payment Amount = Outstanding Amount if checked
2015-10-02 10:39:57 +05:30
Anand Doshi
d9ab725be4 [fix] In Payment Tool, Set Payment Amount = Outstanding Amount if checked 2015-10-01 19:17:02 +05:30
Anand Doshi
7afaeb0820 [fix] the case when party account currency is missing 2015-10-01 18:55:43 +05:30
Anand Doshi
da2d8b958d Merge branch 'develop' 2015-10-01 14:01:22 +05:30
Anand Doshi
ba48f82e03 bumped to version 6.4.2 2015-10-01 14:31:22 +06:00
Anand Doshi
8e7e128e81 Merge pull request #4104 from nabinhait/addresses_and_contacts
[fix] get permission query condition if no permitted links
2015-10-01 14:00:38 +05:30
Anand Doshi
0353569e8b Merge pull request #4103 from nabinhait/monthly_attendance_sheet
[fix] Month issue fixed in Monthly Attendance Sheet
2015-10-01 13:58:33 +05:30
Anand Doshi
665e2f5418 Merge pull request #4100 from nabinhait/general_ledger_report
[fix] General Ledger report fixed
2015-10-01 13:56:13 +05:30
Nabin Hait
dace2b6796 [fix] get permission query condition if no permitted links 2015-10-01 13:54:46 +05:30
Nabin Hait
712b02593a [fix] Month issue fixed in Monthly Attendance Sheet 2015-10-01 12:35:54 +05:30
Anand Doshi
d2a60fd727 Merge pull request #4102 from nabinhait/lead_email
[fix] Validate duplicate email ids in Lead
2015-10-01 12:07:37 +05:30
Nabin Hait
f924e08b93 [fix] Validate duplicate email ids in Lead 2015-10-01 11:51:48 +05:30
Nabin Hait
5c623dae4d [fix] General Ledger report fixed 2015-10-01 11:22:15 +05:30
Anand Doshi
e2c3d40b57 [hotfix] Payment Reconciliation Invoice Type 2015-10-01 11:21:26 +05:30
Anand Doshi
673887455f [fix] Show Contribution (%) in Sales Team table in Customer Form 2015-10-01 11:21:25 +05:30
Anand Doshi
63199e486b Merge branch 'develop' 2015-09-30 20:51:00 +05:30
Anand Doshi
bf7294cf5c bumped to version 6.4.1 2015-09-30 21:20:59 +06:00
Anand Doshi
8aa06a809a Merge pull request #4096 from nabinhait/jv_reference
Repost GL Entries for Journal Entries where reference name is missing
2015-09-30 19:44:21 +05:30
Nabin Hait
72d2d682ae Repost GL Entries for Journal Entries where reference name is missing 2015-09-30 18:50:54 +05:30
Anand Doshi
21f6ea6f7e [hotfix] remove allow on submit from item tables 2015-09-30 18:45:29 +05:30
Anand Doshi
185f488c51 Merge branch 'develop' 2015-09-30 17:23:52 +05:30
Anand Doshi
f3006972d5 bumped to version 6.4.0 2015-09-30 17:53:52 +06:00
Anand Doshi
dccc6bc11d [change-log] 2015-09-30 17:19:51 +05:30
Anand Doshi
15d2c89939 Merge remote-tracking branch 'upstream/master' into develop
Conflicts:
	erpnext/accounts/report/general_ledger/general_ledger.py
2015-09-30 17:13:58 +05:30
Anand Doshi
ca4c8a2a46 [translations] 2015-09-30 17:10:58 +05:30
Anand Doshi
c320fe541d Merge pull request #4067 from anandpdoshi/remove-party-account-currency
Remove party_account_currency from Customer and Supplier, and use currency derived from get_party_account
2015-09-30 16:55:24 +05:30
Anand Doshi
f40a87511e Merge pull request #4091 from rmehta/repack-allow-low-rate
[fix] remove validation to disallow lower rate
2015-09-30 16:46:31 +05:30
Anand Doshi
4945b94950 [fix] added validation to match account currency with existing gle and test case 2015-09-30 16:41:15 +05:30
Rushabh Mehta
cb96b61449 [fix] remove validation to disallow lower rate 2015-09-30 16:22:05 +05:30
Anand Doshi
248c867a2c [minor] removed test case for party multi-currency validation, since party multi-currency is now based on account 2015-09-30 15:11:13 +05:30
Anand Doshi
da98ab6f3c [fix] Only 1 account per company for a party 2015-09-30 15:11:12 +05:30
Anand Doshi
cd0989e051 Added method get_account_currency 2015-09-30 15:11:12 +05:30
Anand Doshi
b20baf894f [fix] Remove party_account_currency from Customer and Supplier, and use currency derived from get_party_account 2015-09-30 15:11:12 +05:30
Nabin Hait
d3cf4f1264 Merge pull request #4075 from anandpdoshi/journal-entry-get-exchange-rate
return exchange rate as 1 if no account is specified
2015-09-30 15:05:41 +05:30
Anand Doshi
2dbe2b63b2 Merge pull request #4088 from anandpdoshi/address-contact-permissions
Apply permissions on address and contact based on permissions of Customer, Supplier
2015-09-30 12:19:50 +05:30
Anand Doshi
edba8f5582 [fix] Print 'Attach' field in Stock Entry Detail 2015-09-30 11:50:08 +05:30
Anand Doshi
89b8d11f9c [fix] Apply permissions on address and contact based on permissions of Customer, Supplier 2015-09-29 20:11:57 +05:30
Anand Doshi
19a33994da [cleanup] removed desk_home and desk_home_flows from conf.js 2015-09-29 20:06:22 +05:30
Rushabh Mehta
89349d3ae3 [fix] [payment-reconciliation] ignore rows with blank invoice numbers 2015-09-29 16:39:53 +05:30
Anand Doshi
f6a31a568a Merge pull request #4085 from rmehta/bulk-priority
[enhancement] lower priority for newsletter emails
2015-09-29 15:25:13 +05:30
Rushabh Mehta
4bcbcd29f7 [enhancement] lower priority for newsletter emails 2015-09-29 14:58:45 +05:30
Anand Doshi
740a11263f [minor] validate invoice number is selected in Payment Reconciliation 2015-09-29 12:55:11 +05:30
Anand Doshi
142859f36e Merge pull request #4076 from anandpdoshi/shopping-cart-order
check doc.has_website_permission in order.html. Merge after frappe/frappe#1316
2015-09-28 19:40:17 +05:30
Anand Doshi
6534ad082d Merge pull request #4069 from anandpdoshi/round-status-updater-percentages
Round status update percentages to 2 decimals
2015-09-28 19:40:01 +05:30
Anand Doshi
6361ae3495 Merge branch 'rmehta-backup-cleanup' into develop 2015-09-28 19:38:06 +05:30
Rushabh Mehta
7f75dbf061 [cleanup] remove backup manager 2015-09-28 19:12:54 +05:30
Anand Doshi
199d8a44fc [fix] check doc.has_website_permission in order.html 2015-09-28 19:04:42 +05:30
Rushabh Mehta
72b1128467 [fixes] accounts controller add flt 2015-09-28 17:29:46 +05:30
Anand Doshi
d6cb55ad1a [fix] return exchange rate as 1 if no account is specified 2015-09-28 17:20:02 +05:30
Anand Doshi
c76e34d7de [fix] In get_bom_items_as_dict don't filter by is_pro_applicable for multi-level bom 2015-09-28 17:01:44 +05:30
Anand Doshi
33b10faf94 Merge pull request #4074 from anandpdoshi/multi-level-bom-fetch
[fix] In get_bom_items_as_dict don't filter by is_pro_applicable for multi-level bom
2015-09-28 17:00:52 +05:30
Anand Doshi
d970b001a4 [fix] Round status update percentages to 2 decimals 2015-09-28 16:52:22 +05:30
Anand Doshi
d767fb6134 [fix] In get_bom_items_as_dict don't filter by is_pro_applicable for multi-level bom 2015-09-28 16:44:48 +05:30
Rushabh Mehta
6239923340 Merge pull request #4071 from gmarke/patch-2
Update get_item_details.py
2015-09-28 10:18:56 +05:30
gmarke
e5a31462fe Update get_item_details.py
like this it will be possible to correctly handle cost center for stock entries when no default cost center per company is set
2015-09-27 09:38:01 +02:00
Anand Doshi
6f39300d43 Merge pull request #4068 from anandpdoshi/due-date-validation
if no party, don't validate due date based on credit days
2015-09-25 17:31:33 +05:30
Anand Doshi
0ca587e018 [fix] if no party, don't validate due date based on credit days 2015-09-25 16:32:14 +05:30
Rushabh Mehta
8ffe12ebe4 [chart-of-accounts] added default for Guatemala 2015-09-25 15:40:33 +05:30
Anand Doshi
8579af371c Merge pull request #4057 from rmehta/gl-report-fix
GL Report Fix
2015-09-25 12:30:26 +05:30
Rushabh Mehta
b5ff9421e1 [optimize] customer outstanding query 2015-09-25 12:25:12 +05:30
Rushabh Mehta
ba8ec17f0b Merge pull request #4065 from nabinhait/receivable_payable
[fix] Fetch gl entries in receivable/payable report only if party mentioned
2015-09-25 11:34:14 +05:30
Nabin Hait
44bd3b2601 [fix] Fetch gl entries in receivable/payable report only if party mentioned 2015-09-25 10:33:51 +05:30
Rushabh Mehta
9d40eca428 Merge pull request #4064 from nabinhait/trial_balance_for_party
[report] Trial Balance for Party
2015-09-25 10:01:44 +05:30
Nabin Hait
1b6c00e2c7 [report] Trial Balance for Party 2015-09-25 09:18:03 +05:30
Anand Doshi
52efde31e7 Merge branch 'develop' 2015-09-24 17:31:12 +05:30
Anand Doshi
f723032fd7 bumped to version 6.3.2 2015-09-24 18:01:11 +06:00
Anand Doshi
3297c43bdf [fix] Tax Rule permission to Account Manager 2015-09-24 17:29:28 +05:30
Anand Doshi
aea250bc5a [fix] [patch] fix missing default lead 2015-09-24 16:31:36 +05:30
Anand Doshi
d37d4dfdec [fix] applicable territory patch and tax rule tests 2015-09-24 15:44:39 +05:30
Anand Doshi
0ea68b33ed Merge branch 'develop' 2015-09-24 15:23:05 +05:30
Anand Doshi
7f96c20f5b bumped to version 6.3.1 2015-09-24 15:53:05 +06:00
Anand Doshi
e75d947867 [fix] [patch] convert applicable territory 2015-09-24 15:22:12 +05:30
Anand Doshi
bba0a5d38f [fix] [patch] tax rule 2015-09-24 15:11:24 +05:30
Anand Doshi
953e97536a [fix] [patch] tax rule 2015-09-24 15:05:06 +05:30
Anand Doshi
e74d7ca33e [fix] [patch] tax rule 2015-09-24 15:04:15 +05:30
Rushabh Mehta
8f2b8afcb7 [fix] gl entry report if not filtered 2015-09-24 15:03:53 +05:30
Anand Doshi
b3f12c3109 [fix] [patch] convert_applicable_territory 2015-09-24 15:01:27 +05:30
Anand Doshi
f66e6aacd4 [fix] [patch] convert_applicable_territory 2015-09-24 14:59:26 +05:30
Anand Doshi
1d621be1f7 Merge branch 'develop' 2015-09-24 14:35:36 +05:30
Anand Doshi
ab57e52cbd bumped to version 6.3.0 2015-09-24 15:05:35 +06:00
Anand Doshi
e63da9813c Merge remote-tracking branch 'frappe/master' into develop
Conflicts:
	erpnext/patches.txt
2015-09-24 14:34:50 +05:30
Anand Doshi
c020e42d20 [fix] [patch] convert applicable territory 2015-09-24 13:08:35 +05:30
Anand Doshi
b126ba0132 [change-log] 2015-09-24 13:06:00 +05:30
Anand Doshi
20ae349ebd Merge pull request #4055 from anandpdoshi/project-sales-order-query
Project's Sales Order - get_query fix
2015-09-24 12:49:54 +05:30
Anand Doshi
c6e4b5978d [fix] Sales Order - get_query fix 2015-09-24 11:32:54 +05:30
Anand Doshi
361eca4cae Merge pull request #4054 from anandpdoshi/sales-team-update-after-submit
Sales Team editable after submit
2015-09-24 11:30:31 +05:30
Anand Doshi
9fc03b6c10 Merge pull request #4052 from rmehta/fix-operation-name
[fix] minor, remove operation naming field from operation
2015-09-24 11:30:07 +05:30
Anand Doshi
e2d46d0474 [fix] Allow Sales Team to be added/updated after submit 2015-09-23 19:26:29 +05:30
Rushabh Mehta
dd2f2f5321 [fix] minor, remove operation naming field from operation 2015-09-23 17:06:01 +05:30
Anand Doshi
6e4f5a214a Merge pull request #4033 from rmehta/portal-fixes
Portal Fixes
2015-09-23 16:05:12 +05:30
Anand Doshi
b07b0a9e54 [fix] Sales Order indicators for Maintenance 2015-09-23 15:52:11 +05:30
Rushabh Mehta
307978fea9 [test-fixes] 2015-09-23 15:43:09 +05:30
Anand Doshi
06ad308ca1 [fixes] setup wizard and other fixes related to cart 2015-09-23 12:50:35 +05:30
Anand Doshi
52dfc32eca [fix] validate_valuation_rate for Repack 2015-09-23 12:50:35 +05:30
Rushabh Mehta
72fbf902d7 [cleanup] added single price list for shopping cart, removed Applicable Territory 2015-09-23 12:50:34 +05:30
Rushabh Mehta
8ffd483e24 [wip] shopping cart shipping rule, price list cleanup 2015-09-23 12:49:16 +05:30
Rushabh Mehta
3d76686b82 [shopping-cart] cart via Jinja WIP 2015-09-23 12:49:16 +05:30
Rushabh Mehta
156ce607e2 [cleanup] [wip] portal, shopping cart cleanup 2015-09-23 12:49:16 +05:30
Anand Doshi
65b6762247 Merge pull request #4049 from bobzz-zone/patch-11
Update item_grid.html
2015-09-23 12:09:26 +05:30
Rushabh Mehta
abdfb4d3db [fixed] New button in POS Sales Invoice, reported via forum 2015-09-23 12:05:51 +05:30
bobzz-zone
3bcb13b1b8 Update item_grid.html
Change the colour of the indicator to be green when delivered qty is bigger than ordered qty
2015-09-23 11:42:06 +07:00
Anand Doshi
b6ec680c46 [fix] round percentages in get_indicator 2015-09-22 16:36:20 +05:30
Anand Doshi
53a0de7607 [fix] Recalculate rate after applying Pricing Rule 2015-09-22 15:26:53 +05:30
Anand Doshi
0a1d037f01 Merge pull request #3974 from rmehta/dms
[enhancement] document management system
2015-09-22 14:51:01 +05:30
Anand Doshi
ce3e15d30c Merge pull request #4042 from anandpdoshi/fix-payment-reconciliation-invoice
[fix] Show payment's invoice number as 'Invoice Type | Invoice Number' for better unsability
2015-09-22 14:21:23 +05:30
Nabin Hait
5b649521d1 [fix] Get outstanding invoices in Payment Reconciliation and Payment Tool 2015-09-22 13:06:34 +05:30
Anand Doshi
798e75832c [fix] Show payment's invoice number as 'Invoice Type | Invoice Number' for better unsability 2015-09-22 12:59:43 +05:30
Anand Doshi
aa95a1b1ef Merge pull request #4047 from nabinhait/payment_reco
[fix] Get outstanding invoices in Payment Reconciliation and Payment Tool
2015-09-22 12:55:27 +05:30
Nabin Hait
c0c94aef44 [fix] Get outstanding invoices in Payment Reconciliation and Payment Tool 2015-09-22 08:37:37 +05:30
Anand Doshi
e4dfeb651f [optimization] get balance on 2015-09-21 19:31:43 +05:30
Anand Doshi
f7e6eb4fd7 [optimization] get balance on 2015-09-21 19:30:21 +05:30
Rushabh Mehta
97c858a5e3 [fix] pull sales team from customer 2015-09-21 10:03:38 +05:30
Rushabh Mehta
974892bf87 Merge pull request #4036 from rmehta/no-party-currency
[fix] no default party currency
2015-09-18 13:40:42 +05:30
Rushabh Mehta
361df8993f [fix] no default party currency 2015-09-18 12:59:51 +05:30
Anand Doshi
b8b8de7a49 [hotfix] multicurrency gl entry 2015-09-17 21:07:45 +05:30
Anand Doshi
be6cfddc4d [hotfix] multicurrency gl entry 2015-09-17 21:07:04 +05:30
Anand Doshi
bf8c8df9ce Revert "[hotfix] set_balance_in_account_currency"
This reverts commit 9acd6a2629.
2015-09-17 20:55:50 +05:30
Anand Doshi
40759c284c Revert "[hotfix] set_balance_in_account_currency"
This reverts commit 9acd6a2629.
2015-09-17 20:51:41 +05:30
Nabin Hait
a48d754158 [fix] minor issue 2015-09-17 20:37:07 +05:30
Anand Doshi
26bcd89d10 [hotfix] journal entry - get balance 2015-09-17 20:36:44 +05:30
Anand Doshi
20fd360a63 [hotfix] journal entry - get balance 2015-09-17 20:36:19 +05:30
Anand Doshi
df8efce36f [hotfix] set_balance_in_account_currency 2015-09-17 20:29:57 +05:30
Anand Doshi
9acd6a2629 [hotfix] set_balance_in_account_currency 2015-09-17 20:29:31 +05:30
Anand Doshi
779ae439cd Merge pull request #4034 from nabinhait/mc5
[fix] minor issue
2015-09-17 20:10:19 +05:30
Nabin Hait
a8ef4c9220 [fix] minor issue 2015-09-17 19:38:11 +05:30
Anand Doshi
ce6b61b41e [fix] customer naming series validation and patch to fix missing default taxes and lead 2015-09-17 19:02:59 +05:30
Anand Doshi
0332f83bc2 [fix] customer naming series validation and patch to fix missing default taxes and lead 2015-09-17 19:01:48 +05:30
Nabin Hait
926ae17e5a Update journal_entry.py 2015-09-17 18:42:55 +05:30
Nabin Hait
8adb5f3e32 Update journal_entry.py 2015-09-17 18:40:35 +05:30
Anand Doshi
5532a14938 [hotfix] create customer contact and address from lead only on create 2015-09-17 18:27:56 +05:30
Anand Doshi
a69682c4e0 [hotfix] create customer contact and address from lead only on create 2015-09-17 18:27:36 +05:30
Anand Doshi
d20120e649 [fix] remove duplicate newsletter subscribers 2015-09-17 17:47:26 +05:30
Anand Doshi
e9b14e497b [fix] remove duplicate newsletter subscribers 2015-09-17 17:46:40 +05:30
Anand Doshi
ba0bf9e13d [hotfix] multicurrency patch 2015-09-17 17:36:20 +05:30
Anand Doshi
cba5a684cb [hotfix] multicurrency patch 2015-09-17 17:36:05 +05:30
Anand Doshi
c439b87ccc [hotfix] multicurrency patch 2015-09-17 17:28:58 +05:30
Anand Doshi
340709b2da [hotfix] multicurrency patch 2015-09-17 17:28:39 +05:30
Nabin Hait
a8de61e24b [fix] Multi currency patch 2015-09-17 17:16:58 +05:30
Anand Doshi
28386f551b Merge pull request #4032 from nabinhait/mc4
[fix] Multi currency patch
2015-09-17 17:16:08 +05:30
Nabin Hait
9ff52cd57e [fix] Multi currency patch 2015-09-17 17:07:26 +05:30
Rushabh Mehta
e3401182c8 Merge pull request #4012 from saurabh6790/cart
Taxation for Shopping Cart based on Tax Rule template
2015-09-17 16:26:35 +05:30
Anand Doshi
7523429ded Merge branch 'develop' 2015-09-17 15:35:09 +05:30
Anand Doshi
0401e418be bumped to version 6.2.0 2015-09-17 16:05:08 +06:00
Anand Doshi
ff6fd7fa9d [change-log] 2015-09-17 15:27:01 +05:30
Anand Doshi
7620393b9b Merge pull request #4031 from anandpdoshi/translations
Translations
2015-09-17 15:13:19 +05:30
Anand Doshi
6489e97726 [translations] 2015-09-17 15:08:09 +05:30
Anand Doshi
8c1a4c0c48 Merge branch 'nabinhait-mc3' into develop 2015-09-17 14:43:58 +05:30
Nabin Hait
77ca80217c [fix] Account Currency and Balance fixed in chart of accounts #4019 2015-09-17 14:43:33 +05:30
Nabin Hait
8247ad4028 [fix] Currency symbol fixed in Accounts receivable/payable report #4020 2015-09-17 14:40:15 +05:30
Anand Doshi
1194c6ef4b [fix] use the new split_emails method to split emails by comma 2015-09-17 14:40:15 +05:30
Anand Doshi
70fed64cd5 Merge pull request #4029 from nabinhait/mc2
[fix] Account Currency and Balance fixed in chart of accounts #4019
2015-09-17 14:37:00 +05:30
Nabin Hait
87c2d1d634 [fix] Dashboard info in accounting currency for Customer and Supplier #4017 2015-09-17 14:16:01 +05:30
Anand Doshi
d4aa27cbb8 Merge pull request #4025 from anandpdoshi/split-emails
use the new split_emails method to split emails by comma. Merge this after Communication CC is merged.
2015-09-17 14:00:03 +05:30
Nabin Hait
59f4fa9a8c [fix] Account Currency and Balance fixed in chart of accounts #4019 2015-09-17 13:57:42 +05:30
Anand Doshi
3b0c0a76b4 Merge pull request #4028 from nabinhait/mc1
[fix] Currency symbol fixed in Accounts receivable/payable report #4020
2015-09-17 13:38:32 +05:30
Nabin Hait
262ac09305 [fix] Currency symbol fixed in Accounts receivable/payable report #4020 2015-09-17 13:24:14 +05:30
Anand Doshi
2a04d98c16 Merge pull request #4023 from saurabh6790/error_report
[Fixes] Check Warehouse for Company Delete and Variant Attribute Value
2015-09-17 13:20:05 +05:30
Anand Doshi
fec9f75707 Merge pull request #4021 from anandpdoshi/payment-tool-ignore-journal-entry
ignore journal entry based invoice in payment tool and payment reconciliation tool
2015-09-17 13:19:06 +05:30
Anand Doshi
12106725fb [fix] set Payment Amount in Payment Tool 2015-09-17 12:59:44 +05:30
Anand Doshi
c5f919eb68 [fix] use the new split_emails method to split emails by comma 2015-09-16 19:20:55 +05:30
Saurabh
5fe0086d9a [Fixes] Warehouse check while company delete & Variant Attribute value check 2015-09-16 16:59:24 +05:30
Anand Doshi
0b031cdd6c [fix] ignore journal entry based invoice in payment tool and payment reconciliation tool 2015-09-16 12:46:54 +05:30
Anand Doshi
c19afa140d [fix] reload time log in update projects patch 2015-09-16 12:44:22 +05:30
Saurabh
0bd145a608 [fixes] test cases and tax rule validation 2015-09-15 17:06:52 +05:30
Saurabh
c663f5c2bd [Test] test state based taxasion 2015-09-15 15:41:01 +05:30
Saurabh
adde1cff48 [Enhancement] add state ccriteria in tax rule 2015-09-15 15:41:01 +05:30
Saurabh
bb9427d1ef [Fixes] deprecated 2015-09-15 15:41:01 +05:30
Saurabh
052babc6b6 [Fixes] [Minor] removed console statement 2015-09-15 15:41:01 +05:30
Saurabh
24fa06bc53 [Fixes] rebase conflict fixes 2015-09-15 15:41:01 +05:30
Saurabh
7c867ae9ad [Fixes] Tax Rule preparation and test taxes creation, remove dummy quotation 2015-09-15 15:41:01 +05:30
Saurabh
8f7317175d [enhancement] bring taxes from tax rules and test cases 2015-09-15 15:41:01 +05:30
Saurabh
957e7a37be [Shopping Cart][Fixes] tax calculation based on tax rule 2015-09-15 15:41:01 +05:30
Saurabh
def71d4d5d [Shopping Cart][Fixes] tax calculation based on tax rule 2015-09-15 15:41:00 +05:30
Neil Trini Lasrado
ef511b160e Added Tax Rule under ERPNext > Accounts > Setup 2015-09-15 15:41:00 +05:30
Neil Trini Lasrado
09f9c96c53 Fixes in Tax Rule 2015-09-15 15:41:00 +05:30
Neil Trini Lasrado
1a2d121073 Removed default taxes and charges from customer and supplier master. Added patch to create tax rules against customer/supplier 2015-09-15 15:41:00 +05:30
Neil Trini Lasrado
810bd35609 Apply Tax Rule based on Customer Selection in Sales / Purchase Transactions 2015-09-15 15:41:00 +05:30
Neil Trini Lasrado
949d7dbaba Added validations, test-cases to Tax Rule 2015-09-15 15:41:00 +05:30
Neil Trini Lasrado
72e6aa160c Added New Doctype Tax Rule 2015-09-15 15:41:00 +05:30
Anand Doshi
0870b185de Merge pull request #4015 from anandpdoshi/use-add-fetch
Use add_fetch in Product Bundle, Maintenance Visit and Maintenance Schedule instead of redundant get_item_details method
2015-09-15 14:02:06 +05:30
Anand Doshi
69f2cc8d24 [fix] don't fetch template item in get items of stock reconciliation 2015-09-15 11:54:13 +05:30
Anand Doshi
86102064a5 [fix] Use add_fetch in Product Bundle, Maintenance Visit and Maintenance Schedule instead of redundant get_item_details method 2015-09-15 11:50:30 +05:30
Anand Doshi
0fd3347148 [fix] handle invalid date in get_retirement_date 2015-09-15 11:29:51 +05:30
Anand Doshi
b74265c842 [minor] [patch] reload activity cost in default_activity_rate 2015-09-15 11:27:19 +05:30
Anand Doshi
1fef2fad2d [minor] fixes in queries and payment tool 2015-09-14 18:27:21 +05:30
Anand Doshi
9345240ff1 Merge pull request #4007 from anandpdoshi/setup-wizard-duplicate-entry
catch DuplicateEntryError in install_fixtures step of Setup Wizard
2015-09-14 16:33:16 +05:30
Anand Doshi
9ab23231e6 Merge pull request #4011 from anandpdoshi/defaults-during-creation
[fix] Use User Permission value as default only if the document type is Setup. Merge with frappe/frappe#1304
2015-09-14 16:33:00 +05:30
Anand Doshi
dbe623b167 [fix] Use User Permission value as default only if the document type is Setup 2015-09-14 13:08:53 +05:30
Anand Doshi
71e51c179c [fix] changed modified for multi-currency sync 2015-09-11 16:55:11 +05:30
Anand Doshi
4b8dbbdf98 [minor] Change modified of Sales Invoice.json 2015-09-11 16:39:03 +05:30
Anand Doshi
aaf1895a12 Merge branch 'nabinhait-multi-currency' into develop
Conflicts:
	erpnext/accounts/doctype/journal_entry/journal_entry.json
2015-09-11 16:35:17 +05:30
Anand Doshi
979326b0b1 minor fixes in multi-currency 2015-09-11 16:33:45 +05:30
Anand Doshi
5d9cfc76cd Don't copy title field in Duplicate 2015-09-11 15:35:26 +05:30
Nabin Hait
8db7bd2d8f [fix] Igonre permissions while saving Company and Warehouse from Accounts Settings 2015-09-11 15:34:42 +05:30
Rushabh Mehta
d461d462aa [minor] rename notified_modifed > notified_update. Merge with #1296 2015-09-11 15:34:41 +05:30
Anand Doshi
e67fa424b2 [fix] catch DuplicateEntryError in install_fixtures step of Setup Wizard 2015-09-11 15:32:06 +05:30
Anand Doshi
121176f0e9 Merge pull request #4002 from rmehta/notify-update-rename
[minor] rename notified_modifed > notified_update. Merge with #1296
2015-09-11 15:11:57 +05:30
Anand Doshi
1c2636e7b3 Merge pull request #4003 from nabinhait/fix8
[fix] Igonre permissions while saving Company and Warehouse from Accounts Settings
2015-09-11 15:00:13 +05:30
Anand Doshi
840cad0ff7 Don't copy title field in Duplicate 2015-09-11 12:26:57 +05:30
Nabin Hait
f76d63b92a Merge branch 'develop' of https://github.com/frappe/erpnext into multi-currency
[fix][patch] delete item variant attributes if no variants exists against that item
2015-09-10 19:26:02 +05:30
Nabin Hait
71ef6675ce [fix] Journal Entry client side minor fixes 2015-09-10 19:25:50 +05:30
Anand Doshi
793b87948c [fix] [patch] item template attributes 2015-09-10 18:10:15 +05:30
Anand Doshi
a1b0ff09a8 Merge pull request #4004 from nabinhait/fix9
[fix] Bypass Root Not Editable validation from Setup Wizard
2015-09-10 15:56:45 +05:30
Nabin Hait
5a803d76ad [fix] Bypass Root Not Editable validation from Setup Wizard 2015-09-10 13:20:35 +05:30
Nabin Hait
9513025130 [fix] Igonre permissions while saving Company and Warehouse from Accounts Settings 2015-09-10 12:13:27 +05:30
Rushabh Mehta
a13c60bf9f [minor] fix title in readme 2015-09-10 10:43:43 +05:30
Rushabh Mehta
bc23e5ac5c [minor] rename notified_modifed > notified_update. Merge with #1296 2015-09-10 10:30:41 +05:30
Nabin Hait
2377cdfa4e Fixed conflict 2015-09-09 18:45:41 +05:30
Nabin Hait
e3ae05aabd Multi-currency: Exchange Rate in Journal Entry 2015-09-09 18:43:12 +05:30
Anand Doshi
a2fda1c779 Merge branch 'develop' 2015-09-09 18:42:49 +05:30
Anand Doshi
a29577ca71 bumped to version 6.1.1 2015-09-09 19:12:48 +06:00
Anand Doshi
b1454cdf9f [fix] fix planned qty 2015-09-09 18:00:09 +05:30
Anand Doshi
f668a4d03c Merge branch 'develop' 2015-09-09 15:32:03 +05:30
Anand Doshi
c2b4ae6667 bumped to version 6.1.0 2015-09-09 16:02:03 +06:00
Anand Doshi
1857bb8b0b [change-log] 2015-09-09 15:23:16 +05:30
Anand Doshi
888a70c2d4 [fix] Setup Wizard - the case of forgetting mute emails 2015-09-09 15:14:54 +05:30
Anand Doshi
9d5b84e78a Merge pull request #3996 from nabinhait/fix6
Check credit limit in Delivery Note / Sales Invoice, only if not created against Sales Order
2015-09-09 15:11:12 +05:30
Anand Doshi
bdc125ad0f Merge pull request #3999 from nabinhait/planned_qty
Planned Qty logic fixed and reposted for existing
2015-09-09 13:14:09 +05:30
Nabin Hait
f0b3014a23 Planned Qty logic fixed and reposted for existing 2015-09-09 11:04:10 +05:30
Nabin Hait
0b17a91aba Merge pull request #3998 from nabinhait/fix7
[fix] Gross Profit report should not include return entries
2015-09-09 10:37:30 +05:30
Nabin Hait
83dd3e14e5 [fix] Gross Profit report should not include return entries 2015-09-09 10:37:04 +05:30
Anand Doshi
38f64ea3ab Merge pull request #3991 from anandpdoshi/apply-user-permissions-fix
[minor] Unset Apply User Permissions in default permissions
2015-09-08 22:09:44 +05:30
Nabin Hait
cd103c05d6 Check credit limit in Delivery Note / Sales Invoice, only if not created against Sales Order 2015-09-08 19:24:35 +05:30
Anand Doshi
bc1e8b4408 [minor] Unset Apply User Permissions in default permissions 2015-09-08 19:23:23 +05:30
Nabin Hait
6c3ff3e2ed Fixed conflict 2015-09-08 18:09:03 +05:30
Anand Doshi
4fb7f881c8 Merge branch 'nabinhait-fix4' into develop 2015-09-08 16:37:52 +05:30
Nabin Hait
83a358afc1 Fix invoice outstanding where party missing
Conflicts:
	erpnext/accounts/doctype/gl_entry/gl_entry.py
	erpnext/patches.txt
2015-09-08 16:37:26 +05:30
Nabin Hait
96bb070781 Payment against invoices where party not specified
Conflicts:
	erpnext/accounts/doctype/gl_entry/gl_entry.py
2015-09-08 16:36:44 +05:30
Nabin Hait
d387dd3bc6 [fix] Project: round percent_complete to 2 decimals 2015-09-08 16:15:00 +05:30
Anand Doshi
9f25575e0c Merge pull request #3988 from nabinhait/fix2
Set expense account in stock reco only if company available
2015-09-08 15:59:18 +05:30
Anand Doshi
e1af7f1a0f [minor] default mins_between_operations = 10 2015-09-08 15:55:09 +05:30
Anand Doshi
c35df5ce80 Merge branch 'rmehta-stock-settings' into develop
Conflicts:
	erpnext/patches.txt
2015-09-08 15:54:17 +05:30
Anand Doshi
2c2868db11 [translations] 2015-09-08 15:53:54 +05:30
Anand Doshi
17f28c13ed [fix] Customer match condition in autosuggest 2015-09-08 15:53:54 +05:30
Anand Doshi
3f1f2dd307 [fix] setup wizard - industry type 2015-09-08 15:53:53 +05:30
Anand Doshi
ab05dcd9f9 [fix] [patch] reload item attribute + value 2015-09-08 15:53:53 +05:30
Rushabh Mehta
f21edba97f [fixes] to task test case and fix tree ui for mobile 2015-09-08 15:53:53 +05:30
Rushabh Mehta
91b0e2348c [minor] task not mandatory for Time Log and Expense Claim #3904 2015-09-08 15:53:53 +05:30
Nabin Hait
4de91887db [patch] Re-run the 'default_title' patch 2015-09-08 15:53:35 +05:30
Anand Doshi
9b1288605f bumped to version 6.0.1 2015-09-08 15:53:05 +05:30
Anand Doshi
43888546f6 Merge pull request #3968 from rmehta/task-not-mandatory
[minor] task not mandatory for Time Log and Expense Claim #3904
2015-09-08 15:47:11 +05:30
Anand Doshi
68d2e317d2 Merge pull request #3992 from anandpdoshi/translations
[translations]
2015-09-08 15:45:08 +05:30
Nabin Hait
2249eea59f Fixed conflict 2015-09-08 12:55:21 +05:30
Nabin Hait
d608363d7b [fix] Map amount in advance payment entry agaionst SO/PO based on party account currency 2015-09-08 12:53:59 +05:30
Nabin Hait
b2739cbb79 Get average exchange rate in case of bank transfer 2015-09-08 12:18:45 +05:30
Anand Doshi
f5940907ae [translations] 2015-09-07 18:47:04 +05:30
Anand Doshi
90162078d5 Merge pull request #3989 from anandpdoshi/customer-query-match-condition
Customer match condition in autosuggest
2015-09-07 14:52:49 +05:30
Anand Doshi
cba99743a4 [fix] Customer match condition in autosuggest 2015-09-07 14:51:30 +05:30
Nabin Hait
f44128f81c Set expense account in stock reco only if company available 2015-09-07 10:45:15 +05:30
Nabin Hait
3607737b5e Merge branch 'develop' of https://github.com/frappe/erpnext into multi-currency 2015-09-07 10:41:01 +05:30
Nabin Hait
bf9691ed39 Multiple fixes 2015-09-07 10:40:48 +05:30
Anand Doshi
bbca95fd1b [fix] setup wizard - industry type 2015-09-07 10:11:46 +05:30
Anand Doshi
4df98d52c1 [fix] setup wizard - industry type 2015-09-07 10:11:23 +05:30
Nabin Hait
e9b445c853 [fix] Stock Entry additional costs patch fix for v4 accounts 2015-09-05 11:17:11 +05:30
Anand Doshi
28f8664b93 [fix] [patch] reload item attribute + value 2015-09-04 16:41:27 +05:30
Nabin Hait
216aaaf1d6 Set currency and exchange rate based on Customer's currency while making Quotation from Opportunity 2015-09-04 16:41:04 +05:30
Rushabh Mehta
be9edae961 [fixes] to task test case and fix tree ui for mobile 2015-09-04 16:18:17 +05:30
Rushabh Mehta
4223d7c044 [minor] task not mandatory for Time Log and Expense Claim #3904 2015-09-04 16:18:17 +05:30
Nabin Hait
3a53d49b7e [fix] Set account and party balance in Journal Entry 2015-09-04 15:46:47 +05:30
Nabin Hait
4d62d7867e [report] Bank Reconciliation Statement in account currency 2015-09-04 13:26:45 +05:30
Nabin Hait
c0e3b1a0c7 Removed account and party balance in company currency from Journal Entry 2015-09-04 13:26:23 +05:30
Nabin Hait
34fe81f7eb Patch fixed 2015-09-03 19:18:00 +05:30
Nabin Hait
11a746d363 Fixed conflict 2015-09-03 16:04:11 +05:30
Nabin Hait
1609933748 Test cases for multi currency 2015-09-03 16:03:07 +05:30
Anand Doshi
5f90f7096d Merge pull request #3976 from nabinhait/fixes1
[patch] Re-run the 'default_title' patch
2015-09-03 11:15:53 +05:30
Nabin Hait
59c4ae5a46 [patch] Re-run the 'default_title' patch 2015-09-03 10:46:48 +05:30
Rushabh Mehta
85abdc4fad [minor] added stock settings for serial no. #3967. Merge with https://github.com/frappe/frappe/pull/1291 2015-09-03 10:29:38 +05:30
Nabin Hait
98096771c2 [multi currency] Introduced Accounting Currency in Customer and Supplier, and validation according to that 2015-09-03 10:28:08 +05:30
Rushabh Mehta
deb38f7a68 [enhancement] document management system 2015-09-02 18:34:24 +05:30
Nabin Hait
bac9b8eef6 Payment Tool changes due to multi currency 2015-08-31 19:01:11 +05:30
Nabin Hait
76bb927337 Fixed conflict 2015-08-31 17:28:05 +05:30
Nabin Hait
699751c531 [report] Accounts Receivable / Payable in multi currency 2015-08-31 17:02:04 +05:30
Nabin Hait
06b15bfd63 [report] General Ledger in multi currency 2015-08-31 15:39:03 +05:30
Nabin Hait
c68f68d6cc [fix] Patch fixed for account_currency field rename 2015-08-28 19:26:28 +05:30
Nabin Hait
6e439a5e53 Multi currency: test case and fixes 2015-08-28 19:24:22 +05:30
Nabin Hait
78be566428 minor fix 2015-08-27 16:27:44 +05:30
Nabin Hait
f6f38f2f2d [new fields] Exchange Rate in Journal Entry and some properties changes in Journal Entry Account 2015-08-27 16:27:33 +05:30
Nabin Hait
9a9a4293b3 [new fields] Party Account Currency, Paid Amount and Write Off Amount in Acompany Currency 2015-08-27 16:26:38 +05:30
Nabin Hait
09c68c9ad0 Merge branch 'develop' of https://github.com/frappe/erpnext into multi-currency 2015-08-27 14:55:55 +05:30
Nabin Hait
13d8835b75 Fixed merge conflict 2015-08-27 14:55:34 +05:30
Nabin Hait
2091f0c97e Checked out json files from upstream 2015-08-27 14:35:17 +05:30
Nabin Hait
54fe26dcfb [patch] Multi currency 2015-08-27 12:55:24 +05:30
Nabin Hait
4ffd7f3d05 Outstanding, paid and write-off amount in Invoice 2015-08-27 12:28:36 +05:30
Nabin Hait
a12d959729 GL Entries for Sales/Purchase Invoice in multi currency 2015-08-27 12:27:24 +05:30
Nabin Hait
895029dc15 Validate currency in transactions 2015-08-21 14:31:47 +05:30
Nabin Hait
c561a499d7 Multi currency GL entry fixes 2015-08-21 14:31:47 +05:30
Nabin Hait
69c1401764 Multi currency patch initialized 2015-08-21 14:31:47 +05:30
Nabin Hait
50ba6faaf6 Currency input from Chart of Accounts page 2015-08-21 14:31:47 +05:30
Nabin Hait
46bcbaf97b GL Entry in account currency 2015-08-21 14:31:47 +05:30
Nabin Hait
0e46a9b86e Journal Entry: client side triggers 2015-08-21 14:31:46 +05:30
Nabin Hait
e459cb4d09 Journal Entry: validate and post gle in multi currency 2015-08-21 14:31:46 +05:30
Nabin Hait
7dbd395781 Toggle alternative currency fields 2015-08-21 14:31:46 +05:30
Nabin Hait
6aea1c0da5 Currency validation in gl entry 2015-08-21 14:31:46 +05:30
Rushabh Mehta
aeab6c559c [enhancement] multi-currency, added fields #1002 2015-08-21 14:31:46 +05:30
2408 changed files with 236611 additions and 86075 deletions

View File

@@ -1,12 +1,12 @@
# ERPNext - Open source ERP for small and medium-size business [![Build Status](https://travis-ci.org/frappe/erpnext.png)](https://travis-ci.org/frappe/erpnext)
# ERPNext - ERP made simple
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/frappe/erpnext?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/frappe/erpnext.png)](https://travis-ci.org/frappe/erpnext) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/frappe/erpnext?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[https://erpnext.com](https://erpnext.com)
Includes: Accounting, Inventory, CRM, Sales, Purchase, Projects, HRMS. Requires MariaDB.
ERPNext is built on the [Frappe](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & Javascript.
ERPNext is built on the [Frappe](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & JavaScript.
- [User Guide](https://manual.erpnext.com)
- [Getting Help](http://erpnext.org/getting-help.html)

View File

@@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '6.0.1'
__version__ = '6.14.1'

View File

@@ -7,7 +7,7 @@
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -20,10 +20,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -41,9 +43,11 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -63,11 +67,13 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Account Name",
"length": 0,
"no_copy": 1,
"oldfieldname": "account_name",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
@@ -87,10 +93,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Group",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -109,12 +117,14 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
@@ -133,10 +143,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Root Type",
"length": 0,
"no_copy": 0,
"options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -155,10 +167,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Report Type",
"length": 0,
"no_copy": 0,
"options": "\nBalance Sheet\nProfit and Loss",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -166,6 +180,32 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:doc.is_group==0",
"fieldname": "account_currency",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Currency",
"length": 0,
"no_copy": 0,
"options": "Currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -176,9 +216,11 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -198,12 +240,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Parent Account",
"length": 0,
"no_copy": 0,
"oldfieldname": "parent_account",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -223,12 +267,14 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Account Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "account_type",
"oldfieldtype": "Select",
"options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nRound Off\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary",
"options": "\nBank\nCash\nDepreciation\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nRound Off\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -248,11 +294,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "tax_rate",
"oldfieldtype": "Currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -272,12 +320,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Frozen",
"length": 0,
"no_copy": 0,
"oldfieldname": "freeze_account",
"oldfieldtype": "Select",
"options": "No\nYes",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -296,10 +346,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -318,10 +370,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Balance must be",
"length": 0,
"no_copy": 0,
"options": "\nDebit\nCredit",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -340,9 +394,11 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Lft",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -361,9 +417,11 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Rgt",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -382,9 +440,11 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Old Parent",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -402,7 +462,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-07-20 03:54:14.297995",
"max_attachments": 0,
"modified": "2015-12-12 10:19:54.365839",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
@@ -410,7 +471,7 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -430,7 +491,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -450,7 +511,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -470,7 +531,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,

View File

@@ -7,6 +7,8 @@ from frappe.utils import cstr, cint
from frappe import throw, _
from frappe.model.document import Document
class RootNotEditable(frappe.ValidationError): pass
class Account(Document):
nsm_parent_field = 'parent_account'
@@ -28,6 +30,7 @@ class Account(Document):
self.validate_warehouse_account()
self.validate_frozen_accounts_modifier()
self.validate_balance_must_be_debit_or_credit()
self.validate_account_currency()
def validate_parent(self):
"""Fetch Parent Details and validate parent account"""
@@ -47,27 +50,34 @@ class Account(Document):
def set_root_and_report_type(self):
if self.parent_account:
par = frappe.db.get_value("Account", self.parent_account, ["report_type", "root_type"], as_dict=1)
if par.report_type:
self.report_type = par.report_type
if par.root_type:
self.root_type = par.root_type
if self.is_group:
db_value = frappe.db.get_value("Account", self.name, ["report_type", "root_type"], as_dict=1)
if db_value:
if self.report_type != db_value.report_type:
frappe.db.sql("update `tabAccount` set report_type=%s where lft > %s and rgt < %s",
frappe.db.sql("update `tabAccount` set report_type=%s where lft > %s and rgt < %s",
(self.report_type, self.lft, self.rgt))
if self.root_type != db_value.root_type:
frappe.db.sql("update `tabAccount` set root_type=%s where lft > %s and rgt < %s",
frappe.db.sql("update `tabAccount` set root_type=%s where lft > %s and rgt < %s",
(self.root_type, self.lft, self.rgt))
if self.root_type and not self.report_type:
self.report_type = "Balance Sheet" \
if self.root_type in ("Asset", "Liability", "Equity") else "Profit and Loss"
def validate_root_details(self):
# does not exists parent
if frappe.db.exists("Account", self.name):
if not frappe.db.get_value("Account", self.name, "parent_account"):
throw(_("Root cannot be edited."))
throw(_("Root cannot be edited."), RootNotEditable)
if not self.parent_account and not self.is_group:
frappe.throw(_("Root Account must be a group"))
def validate_frozen_accounts_modifier(self):
old_value = frappe.db.get_value("Account", self.name, "freeze_account")
@@ -87,6 +97,14 @@ class Account(Document):
elif account_balance < 0 and self.balance_must_be == "Debit":
frappe.throw(_("Account balance already in Credit, you are not allowed to set 'Balance Must Be' as 'Debit'"))
def validate_account_currency(self):
if not self.account_currency:
self.account_currency = frappe.db.get_value("Company", self.company, "default_currency")
elif self.account_currency != frappe.db.get_value("Account", self.name, "account_currency"):
if frappe.db.get_value("GL Entry", {"account": self.name}):
frappe.throw(_("Currency can not be changed after making entries using some other currency"))
def convert_group_to_ledger(self):
if self.check_if_child_exists():
throw(_("Account with child nodes cannot be converted to ledger"))
@@ -116,11 +134,11 @@ class Account(Document):
and docstatus != 2""", self.name)
def validate_mandatory(self):
if not self.report_type:
throw(_("Report Type is mandatory"))
if not self.root_type:
throw(_("Root Type is mandatory"))
if not self.report_type:
throw(_("Report Type is mandatory"))
def validate_warehouse_account(self):
if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
@@ -136,6 +154,8 @@ class Account(Document):
self.validate_warehouse(old_warehouse)
if self.warehouse:
self.validate_warehouse(self.warehouse)
elif self.warehouse:
self.warehouse = None
def validate_warehouse(self, warehouse):
if frappe.db.get_value("Stock Ledger Entry", {"warehouse": warehouse}):
@@ -179,6 +199,10 @@ class Account(Document):
if val != [self.is_group, self.root_type, self.company]:
throw(_("""Merging is only possible if following properties are same in both records. Is Group, Root Type, Company"""))
if self.is_group and frappe.db.get_value("Account", new, "parent_account") == old:
frappe.db.set_value("Account", new, "parent_account",
frappe.db.get_value("Account", old, "parent_account"))
return new_account
@@ -196,3 +220,16 @@ def get_parent_account(doctype, txt, searchfield, start, page_len, filters):
and %s like %s order by name limit %s, %s""" %
("%s", searchfield, "%s", "%s", "%s"),
(filters["company"], "%%%s%%" % txt, start, page_len), as_list=1)
def get_account_currency(account):
"""Helper function to get account currency"""
if not account:
return
def generator():
account_currency, company = frappe.db.get_value("Account", account, ["account_currency", "company"])
if not account_currency:
account_currency = frappe.db.get_value("Company", company, "default_currency")
return account_currency
return frappe.local_cache("account_currency", account, generator)

View File

@@ -36,7 +36,8 @@ def create_charts(chart_name, company):
"is_group": is_group,
"root_type": root_type,
"report_type": report_type,
"account_type": child.get("account_type")
"account_type": child.get("account_type"),
"account_currency": frappe.db.get_value("Company", company, "default_currency")
})
if root_account:

View File

@@ -0,0 +1,93 @@
{
"country_code": "gt",
"name": "Cuentas de Guatemala",
"is_active": "Yes",
"tree": {
"Activos": {
"Activo Corriente": {
"Caja y Bancos": {},
"Cuentas por Cobrar": {},
"Impuestos por Cobrar": {
"IVA por Cobrar": {},
"Retenciones de IVA recibidas": {}
},
"Inventario": {
"is_group": 1,
"account_type": "Stock"
}
},
"No Corriente": {
"Activos Fijos": {},
"Cargos Diferidos": {}
},
"root_type": "Asset"
},
"Pasivos": {
"Pasivo Corriente": {
"Proveedores": {
"Inventario Recibido pero No Cobrado": {
"account_type": "Stock Received But Not Billed"
}
},
"Impuestos por Pagar": {},
"Sueldos por Liquidar": {},
"Prestaciones": {},
"Cuentas por Pagar": {},
"Otras Cuentas por Pagar": {},
"Acreedores": {}
},
"Pasivo No Corriente": {
"Provisión para Indemnizaciones": {},
"Acreedores": {}
},
"root_type": "Liability"
},
"Patrimonio": {
"Capital": {},
"Utilidades Retenidas": {},
"Resultados del Ejercicio": {},
"root_type": "Asset"
},
"Costos": {
"Costo de Ventas": {},
"Costos Incluidos en la Valuación": {
"account_type": "Expenses Included In Valuation"
},
"Stock Adjustment": {
"account_type": "Stock Adjustment"
},
"root_type": "Expense"
},
"Gastos": {
"Gastos de Personal": {},
"Honorarios Profesionales": {},
"Servicios Básicos": {},
"Alquileres": {},
"Seguros": {},
"Mantenimiento": {},
"Depreciaciones": {},
"Gastos Diversos": {},
"root_type": "Expense"
},
"Ingresos": {
"Productos": {},
"Servicios": {},
"root_type": "Income"
},
"Otros Gastos y Productos Financieros": {
"Otros Ingresos": {
"Otros Gastos y Productos Financieros": {
"Intereses": {},
"Otros Gastos Financieros": {}
}
},
"Otros Gastos": {
"Otros Gastos y Productos Financieros": {
"Intereses": {},
"Otros Gastos Financieros": {}
}
},
"root_type": "Expense"
}
}
}

View File

@@ -9,36 +9,39 @@ def _make_test_records(verbose):
accounts = [
# [account_name, parent_account, is_group]
["_Test Account Bank Account", "Bank Accounts", 0, "Bank"],
["_Test Bank", "Bank Accounts", 0, "Bank", None],
["_Test Bank USD", "Bank Accounts", 0, "Bank", "USD"],
["_Test Bank EUR", "Bank Accounts", 0, "Bank", "EUR"],
["_Test Account Stock Expenses", "Direct Expenses", 1, None],
["_Test Account Shipping Charges", "_Test Account Stock Expenses", 0, "Chargeable"],
["_Test Account Customs Duty", "_Test Account Stock Expenses", 0, "Tax"],
["_Test Account Insurance Charges", "_Test Account Stock Expenses", 0, "Chargeable"],
["_Test Account Stock Adjustment", "_Test Account Stock Expenses", 0, "Stock Adjustment"],
["_Test Account Stock Expenses", "Direct Expenses", 1, None, None],
["_Test Account Shipping Charges", "_Test Account Stock Expenses", 0, "Chargeable", None],
["_Test Account Customs Duty", "_Test Account Stock Expenses", 0, "Tax", None],
["_Test Account Insurance Charges", "_Test Account Stock Expenses", 0, "Chargeable", None],
["_Test Account Stock Adjustment", "_Test Account Stock Expenses", 0, "Stock Adjustment", None],
["_Test Account Tax Assets", "Current Assets", 1, None, None],
["_Test Account VAT", "_Test Account Tax Assets", 0, "Tax", None],
["_Test Account Service Tax", "_Test Account Tax Assets", 0, "Tax", None],
["_Test Account Tax Assets", "Current Assets", 1, None],
["_Test Account VAT", "_Test Account Tax Assets", 0, "Tax"],
["_Test Account Service Tax", "_Test Account Tax Assets", 0, "Tax"],
["_Test Account Reserves and Surplus", "Current Liabilities", 0, None, None],
["_Test Account Reserves and Surplus", "Current Liabilities", 0, None],
["_Test Account Cost for Goods Sold", "Expenses", 0, None],
["_Test Account Excise Duty", "_Test Account Tax Assets", 0, "Tax"],
["_Test Account Education Cess", "_Test Account Tax Assets", 0, "Tax"],
["_Test Account S&H Education Cess", "_Test Account Tax Assets", 0, "Tax"],
["_Test Account CST", "Direct Expenses", 0, "Tax"],
["_Test Account Discount", "Direct Expenses", 0, None],
["_Test Write Off", "Indirect Expenses", 0, None],
["_Test Account Cost for Goods Sold", "Expenses", 0, None, None],
["_Test Account Excise Duty", "_Test Account Tax Assets", 0, "Tax", None],
["_Test Account Education Cess", "_Test Account Tax Assets", 0, "Tax", None],
["_Test Account S&H Education Cess", "_Test Account Tax Assets", 0, "Tax", None],
["_Test Account CST", "Direct Expenses", 0, "Tax", None],
["_Test Account Discount", "Direct Expenses", 0, None, None],
["_Test Write Off", "Indirect Expenses", 0, None, None],
# related to Account Inventory Integration
["_Test Account Stock In Hand", "Current Assets", 0, None],
["_Test Account Fixed Assets", "Current Assets", 0, None],
["_Test Account Stock In Hand", "Current Assets", 0, None, None],
["_Test Account Fixed Assets", "Current Assets", 0, None, None],
# Receivable / Payable Account
["_Test Receivable", "Current Assets", 0, "Receivable"],
["_Test Payable", "Current Liabilities", 0, "Payable"],
["_Test Receivable", "Current Assets", 0, "Receivable", None],
["_Test Payable", "Current Liabilities", 0, "Payable", None],
["_Test Receivable USD", "Current Assets", 0, "Receivable", "USD"],
["_Test Payable USD", "Current Liabilities", 0, "Payable", "USD"]
]
for company, abbr in [["_Test Company", "_TC"], ["_Test Company 1", "_TC1"]]:
@@ -48,7 +51,8 @@ def _make_test_records(verbose):
"parent_account": parent_account + " - " + abbr,
"company": company,
"is_group": is_group,
"account_type": account_type
} for account_name, parent_account, is_group, account_type in accounts])
"account_type": account_type,
"account_currency": currency
} for account_name, parent_account, is_group, account_type, currency in accounts])
return test_objects

View File

@@ -16,7 +16,9 @@ class AccountsSettings(Document):
if cint(self.auto_accounting_for_stock):
# set default perpetual account in company
for company in frappe.db.sql("select name from tabCompany"):
frappe.get_doc("Company", company[0]).save()
company = frappe.get_doc("Company", company[0])
company.flags.ignore_permissions = True
company.save()
# Create account head for warehouses
warehouse_list = frappe.db.sql("select name, company from tabWarehouse", as_dict=1)
@@ -25,4 +27,5 @@ class AccountsSettings(Document):
frappe.throw(_("Company is missing in warehouses {0}").format(comma_and(warehouse_with_no_company)))
for wh in warehouse_list:
wh_doc = frappe.get_doc("Warehouse", wh.name)
wh_doc.flags.ignore_permissions = True
wh_doc.save()

View File

@@ -2,10 +2,29 @@
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Bank Reconciliation", {
setup: function(frm) {
frm.get_docfield("journal_entries").allow_bulk_edit = 1;
frm.add_fetch("bank_account", "account_currency", "account_currency");
},
onload: function(frm) {
frm.set_query("bank_account", function() {
return {
"filters": {
"account_type": "Bank",
"is_group": 0
}
};
});
frm.set_value("from_date", frappe.datetime.month_start());
frm.set_value("to_date", frappe.datetime.month_end());
},
refresh: function(frm) {
frm.disable_save();
},
update_clearance_date: function(frm) {
return frappe.call({
method: "update_details",
@@ -22,19 +41,3 @@ frappe.ui.form.on("Bank Reconciliation", {
});
}
});
cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.add_fetch("bank_account", "company", "company");
cur_frm.set_query("bank_account", function() {
return {
"filters": {
"account_type": "Bank",
"is_group": 0
}
};
});
cur_frm.set_value("from_date", frappe.datetime.month_start());
cur_frm.set_value("to_date", frappe.datetime.month_end());
}

View File

@@ -19,10 +19,12 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Bank 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,
@@ -34,17 +36,19 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "company",
"fieldname": "account_currency",
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
"in_list_view": 0,
"label": "Account Currency",
"length": 0,
"no_copy": 0,
"options": "Company",
"options": "Currency",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -63,9 +67,11 @@
"in_filter": 0,
"in_list_view": 1,
"label": "From Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -84,9 +90,11 @@
"in_filter": 0,
"in_list_view": 1,
"label": "To Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -105,9 +113,11 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Include Reconciled Entries",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -126,10 +136,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Get Relevant Entries",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -148,10 +160,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Journal Entries",
"length": 0,
"no_copy": 0,
"options": "Bank Reconciliation Detail",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -170,10 +184,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Update Clearance Date",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -192,10 +208,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"options": "account_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -213,7 +231,9 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"modified": "2015-02-05 05:11:34.776660",
"max_attachments": 0,
"menu_index": 0,
"modified": "2015-11-30 12:44:45.105451",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation",
@@ -241,5 +261,6 @@
}
],
"read_only": 1,
"read_only_onload": 0
"read_only_onload": 0,
"version": 0
}

View File

@@ -15,12 +15,11 @@ class BankReconciliation(Document):
condition = ""
if not self.include_reconciled_entries:
condition = "and ifnull(clearance_date, '') in ('', '0000-00-00')"
condition = "and (clearance_date is null or clearance_date='0000-00-00')"
dl = frappe.db.sql("""select t1.name, t1.cheque_no, t1.cheque_date, t2.debit,
t2.credit, t1.posting_date, t2.against_account, t1.clearance_date,
t2.reference_type, t2.reference_name
dl = frappe.db.sql("""select t1.name, t1.cheque_no, t1.cheque_date, t2.debit_in_account_currency,
t2.credit_in_account_currency, t1.posting_date, t2.against_account, t1.clearance_date
from
`tabJournal Entry` t1, `tabJournal Entry Account` t2
where
@@ -39,11 +38,11 @@ class BankReconciliation(Document):
nl.voucher_id = d.name
nl.cheque_number = d.cheque_no
nl.cheque_date = d.cheque_date
nl.debit = d.debit
nl.credit = d.credit
nl.debit = d.debit_in_account_currency
nl.credit = d.credit_in_account_currency
nl.against_account = d.against_account
nl.clearance_date = d.clearance_date
self.total_amount += flt(d.debit) - flt(d.credit)
self.total_amount += flt(d.debit_in_account_currency) - flt(d.credit_in_account_currency)
def update_details(self):
vouchers = []

View File

@@ -18,35 +18,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Voucher ID",
"length": 0,
"no_copy": 0,
"oldfieldname": "voucher_id",
"oldfieldtype": "Link",
"options": "Journal Entry",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "clearance_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Clearance Date",
"no_copy": 0,
"oldfieldname": "clearance_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -65,34 +44,13 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Against Account",
"length": 0,
"no_copy": 0,
"oldfieldname": "against_account",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "cheque_number",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Cheque Number",
"no_copy": 0,
"oldfieldname": "cheque_number",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -111,12 +69,14 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Debit",
"length": 0,
"no_copy": 0,
"oldfieldname": "debit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "account_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -135,12 +95,14 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Credit",
"length": 0,
"no_copy": 0,
"oldfieldname": "credit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "account_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -152,47 +114,25 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "reference_type",
"fieldtype": "Link",
"fieldname": "column_break_5",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Name",
"no_copy": 0,
"options": "reference_type",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"unique": 0,
"width": "50%"
},
{
"allow_on_submit": 0,
@@ -205,11 +145,38 @@
"in_filter": 0,
"in_list_view": 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": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "cheque_number",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Cheque Number",
"length": 0,
"no_copy": 0,
"oldfieldname": "cheque_number",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -226,19 +193,69 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Cheque Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "cheque_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "clearance_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Clearance Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "clearance_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "data_10",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
@@ -249,12 +266,15 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-10 16:59:43.974705",
"max_attachments": 0,
"menu_index": 0,
"modified": "2015-12-04 11:01:24.286320",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation Detail",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
"read_only_onload": 0
"read_only_onload": 0,
"version": 0
}

View File

@@ -19,6 +19,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Account",
"length": 0,
"no_copy": 0,
"oldfieldname": "account",
"oldfieldtype": "Link",
@@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Budget Allocated",
"length": 0,
"no_copy": 0,
"oldfieldname": "budget_allocated",
"oldfieldtype": "Currency",
@@ -67,6 +69,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Fiscal Year",
"length": 0,
"no_copy": 0,
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
@@ -89,7 +92,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-02-19 01:06:59.471417",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.050558",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget Detail",

View File

@@ -18,6 +18,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
"length": 0,
"no_copy": 0,
"options": "C-FORM-",
"permlevel": 0,
@@ -63,6 +65,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "C-Form No",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -84,6 +87,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Received Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -105,6 +109,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Customer",
"length": 0,
"no_copy": 0,
"options": "Customer",
"permlevel": 0,
@@ -126,6 +131,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -149,6 +155,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
@@ -171,6 +178,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Fiscal Year",
"length": 0,
"no_copy": 0,
"options": "Fiscal Year",
"permlevel": 0,
@@ -193,6 +201,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Quarter",
"length": 0,
"no_copy": 0,
"options": "\nI\nII\nIII\nIV",
"permlevel": 0,
@@ -215,6 +224,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -237,6 +247,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "State",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -257,6 +268,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -278,6 +290,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Invoices",
"length": 0,
"no_copy": 0,
"options": "C-Form Invoice Detail",
"permlevel": 0,
@@ -300,6 +313,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total Invoiced Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -322,6 +336,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"options": "C-Form",
"permlevel": 0,
@@ -344,7 +359,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 3,
"modified": "2015-02-05 05:11:35.427357",
"modified": "2015-11-16 06:29:43.143528",
"modified_by": "Administrator",
"module": "Accounts",
"name": "C-Form",
@@ -352,7 +367,7 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,

View File

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

View File

@@ -18,6 +18,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Invoice No",
"length": 0,
"no_copy": 0,
"options": "Sales Invoice",
"permlevel": 0,
@@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Invoice Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -66,6 +68,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Territory",
"length": 0,
"no_copy": 0,
"options": "Territory",
"permlevel": 0,
@@ -90,6 +93,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Net Total",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -114,6 +118,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Grand Total",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -136,7 +141,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-01-01 14:29:58.597428",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.221484",
"modified_by": "Administrator",
"module": "Accounts",
"name": "C-Form Invoice Detail",

View File

@@ -17,8 +17,7 @@ erpnext.accounts.CostCenterController = frappe.ui.form.Controller.extend({
return {
filters:[
['Account', 'company', '=', me.frm.doc.company],
['Account', 'root_type', '=', 'Expense'],
['Account', 'is_group', '=', '0'],
['Account', 'is_group', '=', '0']
]
}
});

View File

@@ -8,7 +8,7 @@
"description": "Track separate Income and Expense for product verticals or divisions.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Cost Center Name",
"length": 0,
"no_copy": 1,
"oldfieldname": "cost_center_name",
"oldfieldtype": "Data",
@@ -65,6 +67,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Parent Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "parent_cost_center",
"oldfieldtype": "Link",
@@ -89,6 +92,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company_name",
"oldfieldtype": "Link",
@@ -112,6 +116,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -135,6 +140,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Group",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -158,6 +164,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Budget",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -180,6 +187,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Distribution Id",
"length": 0,
"no_copy": 0,
"oldfieldname": "distribution_id",
"oldfieldtype": "Link",
@@ -205,6 +213,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Budgets",
"length": 0,
"no_copy": 0,
"oldfieldname": "budget_details",
"oldfieldtype": "Table",
@@ -229,6 +238,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "lft",
"length": 0,
"no_copy": 1,
"oldfieldname": "lft",
"oldfieldtype": "Int",
@@ -252,6 +262,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "rgt",
"length": 0,
"no_copy": 1,
"oldfieldname": "rgt",
"oldfieldtype": "Int",
@@ -275,6 +286,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "old_parent",
"length": 0,
"no_copy": 1,
"oldfieldname": "old_parent",
"oldfieldtype": "Data",
@@ -298,7 +310,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-07-13 05:28:25.504801",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.870712",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cost Center",
@@ -326,7 +339,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -346,7 +359,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -366,7 +379,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -386,7 +399,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,

View File

@@ -32,13 +32,13 @@ class CostCenter(NestedSet):
for d in self.get('budgets'):
if d.account:
account_details = frappe.db.get_value("Account", d.account,
["is_group", "company", "root_type"], as_dict=1)
["is_group", "company", "report_type"], as_dict=1)
if account_details.is_group:
frappe.throw(_("Budget cannot be assigned against Group Account {0}").format(d.account))
elif account_details.company != self.company:
frappe.throw(_("Account {0} does not belongs to company {1}").format(d.account, self.company))
elif account_details.root_type != "Expense":
frappe.throw(_("Budget cannot be assigned against {0}, as it's not an Expense account")
elif account_details.report_type != "Profit and Loss":
frappe.throw(_("Budget cannot be assigned against {0}, as it's not an Income or Expense account")
.format(d.account))
if [d.account, d.fiscal_year] in check_acc_list:

View File

@@ -8,7 +8,7 @@
"description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -22,6 +22,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Year Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "year",
"oldfieldtype": "Data",
@@ -45,6 +46,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -67,6 +69,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Year Start Date",
"length": 0,
"no_copy": 1,
"oldfieldname": "year_start_date",
"oldfieldtype": "Date",
@@ -90,6 +93,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Year End Date",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@@ -111,6 +115,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Companies",
"length": 0,
"no_copy": 0,
"options": "Fiscal Year Company",
"permlevel": 0,
@@ -133,7 +138,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-07-13 05:28:27.745408",
"max_attachments": 0,
"modified": "2015-11-16 06:29:47.289982",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year",
@@ -161,7 +167,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,

View File

@@ -1,32 +1,38 @@
[
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2012",
"year_end_date": "2012-12-31",
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2012",
"year_end_date": "2012-12-31",
"year_start_date": "2012-01-01"
},
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2013",
"year_end_date": "2013-12-31",
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2013",
"year_end_date": "2013-12-31",
"year_start_date": "2013-01-01"
},
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2014",
"year_end_date": "2014-12-31",
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2014",
"year_end_date": "2014-12-31",
"year_start_date": "2014-01-01"
},
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2015",
"year_end_date": "2015-12-31",
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2015",
"year_end_date": "2015-12-31",
"year_start_date": "2015-01-01"
},
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2016",
"year_end_date": "2016-12-31",
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2016",
"year_end_date": "2016-12-31",
"year_start_date": "2016-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2017",
"year_end_date": "2017-12-31",
"year_start_date": "2017-01-01"
}
]
]

View File

@@ -6,7 +6,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
@@ -39,7 +40,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2014-10-02 13:35:44.155278",
"max_attachments": 0,
"modified": "2015-11-16 06:29:47.344839",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year Company",

View File

@@ -19,6 +19,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Posting Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "posting_date",
"oldfieldtype": "Date",
@@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Transaction Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "transaction_date",
"oldfieldtype": "Date",
@@ -65,6 +67,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Account",
"length": 0,
"no_copy": 0,
"oldfieldname": "account",
"oldfieldtype": "Link",
@@ -89,6 +92,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Party Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@@ -111,6 +115,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Party",
"length": 0,
"no_copy": 0,
"options": "party_type",
"permlevel": 0,
@@ -133,6 +138,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
@@ -156,12 +162,14 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Debit Amt",
"label": "Debit Amount",
"length": 0,
"no_copy": 0,
"oldfieldname": "debit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -180,12 +188,86 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Amt",
"label": "Credit Amount",
"length": 0,
"no_copy": 0,
"oldfieldname": "credit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "account_currency",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Account Currency",
"length": 0,
"no_copy": 0,
"options": "Currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "debit_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Debit Amount in Account Currency",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "credit_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Amount in Account Currency",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -205,6 +287,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Against",
"length": 0,
"no_copy": 0,
"oldfieldname": "against",
"oldfieldtype": "Text",
@@ -228,6 +311,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Against Voucher Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "against_voucher_type",
"oldfieldtype": "Data",
@@ -252,6 +336,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Against Voucher",
"length": 0,
"no_copy": 0,
"oldfieldname": "against_voucher",
"oldfieldtype": "Data",
@@ -261,7 +346,7 @@
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -276,6 +361,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Voucher Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
@@ -300,6 +386,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Voucher No",
"length": 0,
"no_copy": 0,
"oldfieldname": "voucher_no",
"oldfieldtype": "Data",
@@ -324,6 +411,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Remarks",
"length": 0,
"no_copy": 1,
"oldfieldname": "remarks",
"oldfieldtype": "Text",
@@ -347,6 +435,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Is Opening",
"length": 0,
"no_copy": 0,
"oldfieldname": "is_opening",
"oldfieldtype": "Select",
@@ -371,6 +460,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Advance",
"length": 0,
"no_copy": 0,
"oldfieldname": "is_advance",
"oldfieldtype": "Select",
@@ -395,6 +485,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Fiscal Year",
"length": 0,
"no_copy": 0,
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
@@ -419,6 +510,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Link",
@@ -442,7 +534,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-07-09 15:51:04.986518",
"max_attachments": 0,
"modified": "2015-11-16 06:29:47.382225",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",
@@ -450,7 +543,7 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,

View File

@@ -3,13 +3,15 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, fmt_money, getdate, formatdate, cstr
from frappe import _
from frappe.utils import flt, fmt_money, getdate, formatdate
from frappe.model.document import Document
from erpnext.accounts.party import validate_party_gle_currency
from erpnext.accounts.utils import get_account_currency
from erpnext.setup.doctype.company.company import get_company_currency
from erpnext.exceptions import InvalidAccountCurrency, CustomerFrozen
class CustomerFrozen(frappe.ValidationError): pass
exclude_from_linked_with = True
class GLEntry(Document):
def validate(self):
@@ -20,6 +22,7 @@ class GLEntry(Document):
self.check_pl_account()
self.validate_cost_center()
self.validate_party()
self.validate_currency()
def on_update_with_args(self, adv_adj, update_outstanding = 'Yes'):
self.validate_account_details(adv_adj)
@@ -91,7 +94,7 @@ class GLEntry(Document):
if self.cost_center and _get_cost_center_company() != self.company:
frappe.throw(_("Cost Center {0} does not belong to Company {1}").format(self.cost_center, self.company))
def validate_party(self):
if self.party_type and self.party:
frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier')
@@ -99,11 +102,25 @@ class GLEntry(Document):
if frappe.db.get_value(self.party_type, self.party, "is_frozen"):
frappe.throw("{0} {1} is frozen".format(self.party_type, self.party), CustomerFrozen)
def validate_currency(self):
company_currency = get_company_currency(self.company)
account_currency = get_account_currency(self.account)
if not self.account_currency:
self.account_currency = company_currency
if account_currency != self.account_currency:
frappe.throw(_("Accounting Entry for {0} can only be made in currency: {1}")
.format(self.account, (account_currency or company_currency)), InvalidAccountCurrency)
if self.party_type and self.party:
validate_party_gle_currency(self.party_type, self.party, self.company, self.account_currency)
def validate_balance_type(account, adv_adj=False):
if not adv_adj and account:
balance_must_be = frappe.db.get_value("Account", account, "balance_must_be")
if balance_must_be:
balance = frappe.db.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
balance = frappe.db.sql("""select sum(debit) - sum(credit)
from `tabGL Entry` where account = %s""", account)[0][0]
if (balance_must_be=="Debit" and flt(balance) < 0) or \
@@ -124,22 +141,28 @@ def check_freezing_date(posting_date, adv_adj=False):
frappe.throw(_("You are not authorized to add or update entries before {0}").format(formatdate(acc_frozen_upto)))
def update_outstanding_amt(account, party_type, party, against_voucher_type, against_voucher, on_cancel=False):
if party_type and party:
party_condition = " and party_type='{0}' and party='{1}'"\
.format(frappe.db.escape(party_type), frappe.db.escape(party))
else:
party_condition = ""
# get final outstanding amt
bal = flt(frappe.db.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
bal = flt(frappe.db.sql("""
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
from `tabGL Entry`
where against_voucher_type=%s and against_voucher=%s
and account = %s and ifnull(party_type, '')=%s and ifnull(party, '')=%s""",
(against_voucher_type, against_voucher, account, party_type, party))[0][0] or 0.0)
and account = %s {0}""".format(party_condition),
(against_voucher_type, against_voucher, account))[0][0] or 0.0)
if against_voucher_type == 'Purchase Invoice':
bal = -bal
elif against_voucher_type == "Journal Entry":
against_voucher_amount = flt(frappe.db.sql("""
select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
from `tabGL Entry` where voucher_type = 'Journal Entry' and voucher_no = %s
and account = %s and ifnull(party_type, '')=%s and ifnull(party, '')=%s
and ifnull(against_voucher, '') = ''""",
(against_voucher, account, cstr(party_type), cstr(party)))[0][0])
and account = %s and (against_voucher is null or against_voucher='') {0}"""
.format(party_condition), (against_voucher, account))[0][0])
if not against_voucher_amount:
frappe.throw(_("Against Journal Entry {0} is already adjusted against some other voucher")

View File

@@ -9,17 +9,17 @@ class TestGLEntry(unittest.TestCase):
def test_round_off_entry(self):
frappe.db.set_value("Company", "_Test Company", "round_off_account", "_Test Write Off - _TC")
frappe.db.set_value("Company", "_Test Company", "round_off_cost_center", "_Test Cost Center - _TC")
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", 100, "_Test Cost Center - _TC", submit=False)
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 100, "_Test Cost Center - _TC", submit=False)
jv.get("accounts")[0].debit = 100.01
jv.flags.ignore_validate = True
jv.submit()
round_off_entry = frappe.db.sql("""select name from `tabGL Entry`
where voucher_type='Journal Entry' and voucher_no = %s
where voucher_type='Journal Entry' and voucher_no = %s
and account='_Test Write Off - _TC' and cost_center='_Test Cost Center - _TC'
and ifnull(debit, 0) = 0 and ifnull(credit, 0) = '.01'""", jv.name)
self.assertTrue(round_off_entry)
and debit = 0 and credit = '.01'""", jv.name)
self.assertTrue(round_off_entry)

View File

@@ -2,8 +2,42 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.accounts");
frappe.provide("erpnext.journal_entry");
frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on("Journal Entry", {
refresh: function(frm) {
erpnext.toggle_naming_series();
frm.cscript.voucher_type(frm.doc);
if(frm.doc.docstatus==1) {
frm.add_custom_button(__('View Ledger'), function() {
frappe.route_options = {
"voucher_no": frm.doc.name,
"from_date": frm.doc.posting_date,
"to_date": frm.doc.posting_date,
"company": frm.doc.company,
group_by_voucher: 0
};
frappe.set_route("query-report", "General Ledger");
}, "icon-table");
}
if (frm.doc.__islocal) {
frm.add_custom_button(__('Quick Entry'), function() {
return erpnext.journal_entry.quick_entry(frm);
});
}
// hide /unhide fields based on currency
erpnext.journal_entry.toggle_fields_based_on_currency(frm);
},
multi_currency: function(frm) {
erpnext.journal_entry.toggle_fields_based_on_currency(frm);
}
})
erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
onload: function() {
this.load_defaults();
@@ -23,23 +57,24 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
}
);
if(!this.frm.doc.amended_from) this.frm.doc.posting_date = get_today();
if(!this.frm.doc.amended_from) this.frm.doc.posting_date = this.frm.posting_date || get_today();
}
},
setup_queries: function() {
var me = this;
$.each(["account", "cost_center"], function(i, fieldname) {
me.frm.set_query(fieldname, "accounts", function() {
frappe.model.validate_missing(me.frm.doc, "company");
return {
filters: {
company: me.frm.doc.company,
is_group: 0
}
};
});
me.frm.set_query("account", "accounts", function(doc, cdt, cdn) {
return erpnext.journal_entry.account_query(me.frm);
});
me.frm.set_query("cost_center", "accounts", function(doc, cdt, cdn) {
return {
filters: {
company: me.frm.doc.company,
is_group: 0
}
};
});
me.frm.set_query("party_type", "accounts", function(doc, cdt, cdn) {
@@ -59,7 +94,6 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
// journal entry
if(jvd.reference_type==="Journal Entry") {
frappe.model.validate_missing(jvd, "account");
return {
query: "erpnext.accounts.doctype.journal_entry.journal_entry.get_against_jv",
filters: {
@@ -69,24 +103,33 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
};
}
// against party
frappe.model.validate_missing(jvd, "party_type");
frappe.model.validate_missing(jvd, "party");
var out = {
filters: [
[jvd.reference_type, jvd.reference_type.indexOf("Sales")===0 ? "customer" : "supplier", "=", jvd.party],
[jvd.reference_type, "docstatus", "=", 1],
[jvd.reference_type, "docstatus", "=", 1]
]
};
if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
// account filter
frappe.model.validate_missing(jvd, "account");
party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
out.filters.push([jvd.reference_type, party_account_field, "=", jvd.account]);
} else {
// party_type and party mandatory
frappe.model.validate_missing(jvd, "party_type");
frappe.model.validate_missing(jvd, "party");
out.filters.push([jvd.reference_type, "per_billed", "<", 100]);
}
if(jvd.party_type && jvd.party) {
out.filters.push([jvd.reference_type,
(jvd.reference_type.indexOf("Sales")===0 ? "customer" : "supplier"), "=", jvd.party]);
}
return out;
});
@@ -110,32 +153,39 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
reference_name: function(doc, cdt, cdn) {
var d = frappe.get_doc(cdt, cdn);
if (d.reference_type==="Purchase Invoice" && !flt(d.debit)) {
this.get_outstanding('Purchase Invoice', d.reference_name, d);
}
if (d.reference_type==="Sales Invoice" && !flt(d.credit)) {
this.get_outstanding('Sales Invoice', d.reference_name, d);
}
if (d.reference_type==="Journal Entry" && !flt(d.credit) && !flt(d.debit)) {
this.get_outstanding('Journal Entry', d.reference_name, d);
if(d.reference_name) {
if (d.reference_type==="Purchase Invoice" && !flt(d.debit)) {
this.get_outstanding('Purchase Invoice', d.reference_name, doc.company, d);
}
if (d.reference_type==="Sales Invoice" && !flt(d.credit)) {
this.get_outstanding('Sales Invoice', d.reference_name, doc.company, d);
}
if (d.reference_type==="Journal Entry" && !flt(d.credit) && !flt(d.debit)) {
this.get_outstanding('Journal Entry', d.reference_name, doc.company, d);
}
}
},
get_outstanding: function(doctype, docname, child) {
get_outstanding: function(doctype, docname, company, child) {
var me = this;
var args = {
"doctype": doctype,
"docname": docname,
"party": child.party,
"account": child.account
"account": child.account,
"account_currency": child.account_currency,
"company": company
}
return this.frm.call({
child: child,
method: "get_outstanding",
return frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_outstanding",
args: { args: args},
callback: function(r) {
cur_frm.cscript.update_totals(me.frm.doc);
if(r.message) {
$.each(r.message, function(field, value) {
frappe.model.set_value(child.doctype, child.name, field, value);
})
}
}
});
},
@@ -153,50 +203,36 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
// set difference
if(doc.difference) {
if(doc.difference > 0) {
row.credit_in_account_currency = doc.difference;
row.credit = doc.difference;
} else {
row.debit_in_account_currency = -doc.difference;
row.debit = -doc.difference;
}
}
cur_frm.cscript.update_totals(doc);
},
});
cur_frm.script_manager.make(erpnext.accounts.JournalEntry);
cur_frm.cscript.refresh = function(doc) {
erpnext.toggle_naming_series();
cur_frm.cscript.voucher_type(doc);
if(doc.docstatus==1) {
cur_frm.add_custom_button(__('View Ledger'), function() {
frappe.route_options = {
"voucher_no": doc.name,
"from_date": doc.posting_date,
"to_date": doc.posting_date,
"company": doc.company,
group_by_voucher: 0
};
frappe.set_route("query-report", "General Ledger");
}, "icon-table");
}
}
cur_frm.cscript.company = function(doc, cdt, cdn) {
cur_frm.refresh_fields();
erpnext.get_fiscal_year(doc.company, doc.posting_date);
}
cur_frm.cscript.posting_date = function(doc, cdt, cdn){
cur_frm.posting_date = cur_frm.doc.posting_date;
erpnext.get_fiscal_year(doc.company, doc.posting_date);
}
cur_frm.cscript.update_totals = function(doc) {
var td=0.0; var tc =0.0;
var el = doc.accounts || [];
for(var i in el) {
td += flt(el[i].debit, precision("debit", el[i]));
tc += flt(el[i].credit, precision("credit", el[i]));
var accounts = doc.accounts || [];
for(var i in accounts) {
td += flt(accounts[i].debit, precision("debit", accounts[i]));
tc += flt(accounts[i].credit, precision("credit", accounts[i]));
}
var doc = locals[doc.doctype][doc.name];
doc.total_debit = td;
@@ -205,32 +241,12 @@ cur_frm.cscript.update_totals = function(doc) {
refresh_many(['total_debit','total_credit','difference']);
}
cur_frm.cscript.debit = function(doc,dt,dn) { cur_frm.cscript.update_totals(doc); }
cur_frm.cscript.credit = function(doc,dt,dn) { cur_frm.cscript.update_totals(doc); }
cur_frm.cscript.get_balance = function(doc,dt,dn) {
cur_frm.cscript.update_totals(doc);
return $c_obj(cur_frm.doc, 'get_balance', '', function(r, rt){
cur_frm.refresh();
});
}
// Get balance
// -----------
cur_frm.cscript.account = function(doc,dt,dn) {
var d = locals[dt][dn];
if(d.account) {
return frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_balance_and_party_type",
args: {account: d.account, date: doc.posting_date},
callback: function(r) {
$.extend(d, r.message);
refresh_field('balance', d.name, 'accounts');
refresh_field('party_type', d.name, 'accounts');
}
});
}
}
cur_frm.cscript.validate = function(doc,cdt,cdn) {
cur_frm.cscript.update_totals(doc);
@@ -295,18 +311,75 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
}
}
frappe.ui.form.on("Journal Entry Account", "party", function(frm, cdt, cdn) {
var d = frappe.get_doc(cdt, cdn);
if(!d.account && d.party_type && d.party) {
return frm.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_party_account_and_balance",
child: d,
args: {
company: frm.doc.company,
party_type: d.party_type,
party: d.party
}
});
frappe.ui.form.on("Journal Entry Account", {
party: function(frm, cdt, cdn) {
var d = frappe.get_doc(cdt, cdn);
if(!d.account && d.party_type && d.party) {
if(!frm.doc.company) frappe.throw(__("Please select Company"));
return frm.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_party_account_and_balance",
child: d,
args: {
company: frm.doc.company,
party_type: d.party_type,
party: d.party
}
});
}
},
account: function(frm, dt, dn) {
var d = locals[dt][dn];
if(d.account) {
if(!frm.doc.company) frappe.throw(__("Please select Company first"));
if(!frm.doc.posting_date) frappe.throw(__("Please select Posting Date first"));
return frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_balance_and_party_type",
args: {
account: d.account,
date: frm.doc.posting_date,
company: frm.doc.company,
debit: flt(d.debit_in_account_currency),
credit: flt(d.credit_in_account_currency),
exchange_rate: d.exchange_rate
},
callback: function(r) {
if(r.message) {
$.extend(d, r.message);
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, dt, dn);
refresh_field('accounts');
}
}
});
}
},
debit_in_account_currency: function(frm, cdt, cdn) {
erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
},
credit_in_account_currency: function(frm, cdt, cdn) {
erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
},
debit: function(frm, dt, dn) {
cur_frm.cscript.update_totals(frm.doc);
},
credit: function(frm, dt, dn) {
cur_frm.cscript.update_totals(frm.doc);
},
exchange_rate: function(frm, cdt, cdn) {
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
var row = locals[cdt][cdn];
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
frappe.model.set_value(cdt, cdn, "exchange_rate", 1);
}
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
}
})
@@ -314,3 +387,137 @@ frappe.ui.form.on("Journal Entry Account", "accounts_remove", function(frm) {
cur_frm.cscript.update_totals(frm.doc);
});
$.extend(erpnext.journal_entry, {
toggle_fields_based_on_currency: function(frm) {
var fields = ["currency_section", "account_currency", "exchange_rate", "debit", "credit"];
var grid = frm.get_field("accounts").grid;
if(grid) grid.set_column_disp(fields, frm.doc.multi_currency);
// dynamic label
var field_label_map = {
"debit_in_account_currency": "Debit",
"credit_in_account_currency": "Credit"
};
$.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;
})
},
set_debit_credit_in_company_currency: function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
frappe.model.set_value(cdt, cdn, "debit",
flt(flt(row.debit_in_account_currency)*row.exchange_rate), precision("debit", row));
frappe.model.set_value(cdt, cdn, "credit",
flt(flt(row.credit_in_account_currency)*row.exchange_rate), precision("credit", row));
cur_frm.cscript.update_totals(frm.doc);
},
set_exchange_rate: function(frm, cdt, cdn) {
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
var row = locals[cdt][cdn];
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
row.exchange_rate = 1;
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
} else if (!row.exchange_rate || row.exchange_rate == 1 || row.account_type == "Bank") {
frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_exchange_rate",
args: {
account: row.account,
account_currency: row.account_currency,
company: frm.doc.company,
reference_type: cstr(row.reference_type),
reference_name: cstr(row.reference_name),
debit: flt(row.debit_in_account_currency),
credit: flt(row.credit_in_account_currency),
exchange_rate: row.exchange_rate
},
callback: function(r) {
if(r.message) {
row.exchange_rate = r.message;
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
}
}
})
} else {
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
}
refresh_field("exchange_rate", cdn, "accounts");
},
quick_entry: function(frm) {
var naming_series_options = frm.fields_dict.naming_series.df.options;
var naming_series_default = frm.fields_dict.naming_series.df.default || naming_series_options.split("\n")[0];
var dialog = new frappe.ui.Dialog({
title: __("Quick Journal Entry"),
fields: [
{fieldtype: "Currency", fieldname: "debit", label: __("Amount"), reqd: 1},
{fieldtype: "Link", fieldname: "debit_account", label: __("Debit Account"), reqd: 1,
options: "Account",
get_query: function() {
return erpnext.journal_entry.account_query(frm);
}
},
{fieldtype: "Link", fieldname: "credit_account", label: __("Credit Account"), reqd: 1,
options: "Account",
get_query: function() {
return erpnext.journal_entry.account_query(frm);
}
},
{fieldtype: "Date", fieldname: "posting_date", label: __("Date"), reqd: 1,
default: frm.doc.posting_date},
{fieldtype: "Select", fieldname: "naming_series", label: __("Series"), reqd: 1,
options: naming_series_options, default: naming_series_default},
]
});
dialog.set_primary_action(__("Save"), function() {
var btn = this;
var values = dialog.get_values();
frm.set_value("posting_date", values.posting_date);
frm.set_value("naming_series", values.naming_series);
// clear table is used because there might've been an error while adding child
// and cleanup didn't happen
frm.clear_table("accounts");
// using grid.add_new_row() to add a row in UI as well as locals
// this is required because triggers try to refresh the grid
var debit_row = frm.fields_dict.accounts.grid.add_new_row();
frappe.model.set_value(debit_row.doctype, debit_row.name, "account", values.debit_account);
frappe.model.set_value(debit_row.doctype, debit_row.name, "debit_in_account_currency", values.debit);
var credit_row = frm.fields_dict.accounts.grid.add_new_row();
frappe.model.set_value(credit_row.doctype, credit_row.name, "account", values.credit_account);
frappe.model.set_value(credit_row.doctype, credit_row.name, "credit_in_account_currency", values.debit);
frm.save();
dialog.hide();
});
dialog.show();
},
account_query: function(frm) {
var filters = {
company: frm.doc.company,
is_group: 0
};
if(!frm.doc.multi_currency) {
$.extend(filters, {
account_currency: frappe.get_doc(":Company", frm.doc.company).default_currency
});
}
return { filters: filters };
}
});

View File

@@ -19,10 +19,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"options": "icon-flag",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -42,10 +44,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
"no_copy": 0,
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -65,12 +69,14 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Entry Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
"options": "Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -89,12 +95,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
"length": 0,
"no_copy": 1,
"oldfieldname": "naming_series",
"oldfieldtype": "Select",
"options": "JV-",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -112,10 +120,12 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -135,11 +145,13 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Posting Date",
"length": 0,
"no_copy": 1,
"oldfieldname": "posting_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -158,11 +170,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"options": "icon-table",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -171,7 +185,7 @@
"unique": 0
},
{
"allow_on_submit": 1,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "accounts",
@@ -181,12 +195,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Accounting Entries",
"length": 0,
"no_copy": 0,
"oldfieldname": "entries",
"oldfieldtype": "Table",
"options": "Journal Entry Account",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -204,9 +220,11 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -226,11 +244,13 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Reference Number",
"length": 0,
"no_copy": 1,
"oldfieldname": "cheque_no",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -249,11 +269,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Date",
"length": 0,
"no_copy": 1,
"oldfieldname": "cheque_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -272,11 +294,13 @@
"in_filter": 1,
"in_list_view": 0,
"label": "User Remark",
"length": 0,
"no_copy": 1,
"oldfieldname": "user_remark",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -294,9 +318,11 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -315,12 +341,14 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Total Debit",
"length": 0,
"no_copy": 1,
"oldfieldname": "total_debit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -339,12 +367,14 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Total Credit",
"length": 0,
"no_copy": 1,
"oldfieldname": "total_credit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -364,12 +394,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Difference (Dr - Cr)",
"length": 0,
"no_copy": 1,
"oldfieldname": "difference",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -389,10 +421,36 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Make Difference Entry",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Button",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "multi_currency",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Multi Currency",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -411,10 +469,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total Amount",
"length": 0,
"no_copy": 1,
"options": "Company:company:default_currency",
"options": "",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 1,
"reqd": 0,
@@ -433,9 +493,11 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total Amount in Words",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 1,
"reqd": 0,
@@ -454,10 +516,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference",
"length": 0,
"no_copy": 0,
"options": "icon-pushpin",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -476,11 +540,13 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Clearance Date",
"length": 0,
"no_copy": 1,
"oldfieldname": "clearance_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -500,11 +566,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Remark",
"length": 0,
"no_copy": 1,
"oldfieldname": "remark",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -522,9 +590,11 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -543,11 +613,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Bill No",
"length": 0,
"no_copy": 0,
"oldfieldname": "bill_no",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -566,11 +638,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Bill Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "bill_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -589,11 +663,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Due Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "due_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -613,10 +689,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Write Off",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -637,10 +715,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Write Off Based On",
"length": 0,
"no_copy": 0,
"options": "Accounts Receivable\nAccounts Payable",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 1,
"reqd": 0,
@@ -660,10 +740,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Get Outstanding Invoices",
"length": 0,
"no_copy": 0,
"options": "get_outstanding_invoices",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -681,10 +763,12 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -704,10 +788,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Write Off Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 1,
"reqd": 0,
@@ -726,10 +812,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Printing Settings",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -748,9 +836,11 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Pay To / Recd From",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 1,
"reqd": 0,
@@ -768,10 +858,12 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -790,10 +882,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Letter Head",
"length": 0,
"no_copy": 0,
"options": "Letter Head",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -812,12 +906,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Print Heading",
"length": 0,
"no_copy": 1,
"oldfieldname": "select_print_heading",
"oldfieldtype": "Link",
"options": "Print Heading",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 1,
"reqd": 0,
@@ -836,11 +932,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"options": "icon-file-text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -859,12 +957,14 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -883,12 +983,14 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Fiscal Year",
"length": 0,
"no_copy": 0,
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
"options": "Fiscal Year",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -906,10 +1008,12 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -931,12 +1035,14 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Is Opening",
"length": 0,
"no_copy": 0,
"oldfieldname": "is_opening",
"oldfieldtype": "Select",
"options": "No\nYes",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -956,11 +1062,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Stock Entry",
"length": 0,
"no_copy": 0,
"options": "Stock Entry",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -979,12 +1087,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Link",
"options": "Journal Entry",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -1002,7 +1112,9 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-08-27 03:19:18.634225",
"max_attachments": 0,
"menu_index": 0,
"modified": "2015-11-30 16:11:45.556341",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",
@@ -1010,7 +1122,7 @@
"permissions": [
{
"amend": 1,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -1050,7 +1162,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1074,5 +1186,6 @@
"search_fields": "voucher_type,posting_date, due_date, cheque_no",
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "title"
"title_field": "title",
"version": 0
}

View File

@@ -2,13 +2,13 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, fmt_money, formatdate, getdate, date_diff
import frappe, json
from frappe.utils import cstr, flt, fmt_money, formatdate
from frappe import msgprint, _, scrub
from erpnext.setup.utils import get_company_currency
from erpnext.controllers.accounts_controller import AccountsController
from erpnext.accounts.utils import get_balance_on
from erpnext.accounts.utils import get_balance_on, get_account_currency
from erpnext.setup.utils import get_company_currency
from erpnext.accounts.party import get_party_account
class JournalEntry(AccountsController):
def __init__(self, arg1, arg2=None):
@@ -26,7 +26,9 @@ class JournalEntry(AccountsController):
self.validate_party()
self.validate_cheque_info()
self.validate_entries_for_advance()
self.validate_debit_and_credit()
self.validate_multi_currency()
self.set_amounts_in_company_currency()
self.validate_total_debit_and_credit()
self.validate_against_jv()
self.validate_reference_doc()
self.set_against_account()
@@ -35,7 +37,9 @@ class JournalEntry(AccountsController):
self.validate_expense_claim()
self.validate_credit_debit_note()
self.validate_empty_accounts_table()
self.set_title()
self.set_account_and_party_balance()
if not self.title:
self.title = self.get_title()
def on_submit(self):
self.check_credit_limit()
@@ -43,8 +47,8 @@ class JournalEntry(AccountsController):
self.update_advance_paid()
self.update_expense_claim()
def set_title(self):
self.title = self.pay_to_recd_from or self.accounts[0].account
def get_title(self):
return self.pay_to_recd_from or self.accounts[0].account
def update_advance_paid(self):
advance_paid = frappe._dict()
@@ -100,6 +104,12 @@ class JournalEntry(AccountsController):
msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account))
elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes":
frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx))
if d.is_advance == "Yes":
if d.party_type == 'Customer' and flt(d.debit) > 0:
frappe.throw(_("Row {0}: Advance against Customer must be credit").format(d.idx))
elif d.party_type == 'Supplier' and flt(d.credit) > 0:
frappe.throw(_("Row {0}: Advance against Supplier must be debit").format(d.idx))
def validate_against_jv(self):
for d in self.get('accounts'):
@@ -117,7 +127,7 @@ class JournalEntry(AccountsController):
against_entries = frappe.db.sql("""select * from `tabJournal Entry Account`
where account = %s and docstatus = 1 and parent = %s
and ifnull(reference_type, '') in ("", "Sales Order", "Purchase Order")
and (reference_type is null or reference_type in ("", "Sales Order", "Purchase Order"))
""", (d.account, d.reference_name), as_dict=True)
if not against_entries:
@@ -144,6 +154,7 @@ class JournalEntry(AccountsController):
self.reference_totals = {}
self.reference_types = {}
self.reference_accounts = {}
for d in self.get("accounts"):
if not d.reference_type:
@@ -151,8 +162,8 @@ class JournalEntry(AccountsController):
if not d.reference_name:
d.reference_type = None
if d.reference_type and d.reference_name and (d.reference_type in field_dict.keys()):
dr_or_cr = "credit" if d.reference_type in ("Sales Order", "Sales Invoice") \
else "debit"
dr_or_cr = "credit_in_account_currency" \
if d.reference_type in ("Sales Order", "Sales Invoice") else "debit_in_account_currency"
# check debit or credit type Sales / Purchase Order
if d.reference_type=="Sales Order" and flt(d.debit) > 0:
@@ -166,10 +177,14 @@ class JournalEntry(AccountsController):
self.reference_totals[d.reference_name] = 0.0
self.reference_totals[d.reference_name] += flt(d.get(dr_or_cr))
self.reference_types[d.reference_name] = d.reference_type
self.reference_accounts[d.reference_name] = d.account
against_voucher = frappe.db.get_value(d.reference_type, d.reference_name,
[scrub(dt) for dt in field_dict.get(d.reference_type)])
if not against_voucher:
frappe.throw(_("Row {0}: Invalid reference {1}").format(d.idx, d.reference_name))
# check if party and account match
if d.reference_type in ("Sales Invoice", "Purchase Invoice"):
if (against_voucher[0] != d.party or against_voucher[1] != d.account):
@@ -191,23 +206,31 @@ class JournalEntry(AccountsController):
"""Validate totals, stopped and docstatus for orders"""
for reference_name, total in self.reference_totals.iteritems():
reference_type = self.reference_types[reference_name]
account = self.reference_accounts[reference_name]
if reference_type in ("Sales Order", "Purchase Order"):
voucher_properties = frappe.db.get_value(reference_type, reference_name,
["docstatus", "per_billed", "status", "advance_paid", "base_grand_total"])
order = frappe.db.get_value(reference_type, reference_name,
["docstatus", "per_billed", "status", "advance_paid",
"base_grand_total", "grand_total", "currency"], as_dict=1)
if voucher_properties[0] != 1:
if order.docstatus != 1:
frappe.throw(_("{0} {1} is not submitted").format(reference_type, reference_name))
if flt(voucher_properties[1]) >= 100:
if flt(order.per_billed) >= 100:
frappe.throw(_("{0} {1} is fully billed").format(reference_type, reference_name))
if cstr(voucher_properties[2]) == "Stopped":
if cstr(order.status) == "Stopped":
frappe.throw(_("{0} {1} is stopped").format(reference_type, reference_name))
if flt(voucher_properties[4]) < (flt(voucher_properties[3]) + total):
account_currency = get_account_currency(account)
if account_currency == self.company_currency:
voucher_total = order.base_grand_total
else:
voucher_total = order.grand_total
if flt(voucher_total) < (flt(order.advance_paid) + total):
frappe.throw(_("Advance paid against {0} {1} cannot be greater \
than Grand Total {2}").format(reference_type, reference_name, voucher_properties[4]))
than Grand Total {2}").format(reference_type, reference_name, voucher_total))
def validate_invoices(self):
"""Validate totals and docstatus for invoices"""
@@ -215,15 +238,15 @@ class JournalEntry(AccountsController):
reference_type = self.reference_types[reference_name]
if reference_type in ("Sales Invoice", "Purchase Invoice"):
voucher_properties = frappe.db.get_value(reference_type, reference_name,
["docstatus", "outstanding_amount"])
invoice = frappe.db.get_value(reference_type, reference_name,
["docstatus", "outstanding_amount"], as_dict=1)
if voucher_properties[0] != 1:
if invoice.docstatus != 1:
frappe.throw(_("{0} {1} is not submitted").format(reference_type, reference_name))
if total and flt(voucher_properties[1]) < total:
frappe.throw(_("Payment against {0} {1} cannot be greater \
than Outstanding Amount {2}").format(reference_type, reference_name, voucher_properties[1]))
if total and flt(invoice.outstanding_amount) < total:
frappe.throw(_("Payment against {0} {1} cannot be greater than Outstanding Amount {2}")
.format(reference_type, reference_name, invoice.outstanding_amount))
def set_against_account(self):
accounts_debited, accounts_credited = [], []
@@ -235,22 +258,56 @@ class JournalEntry(AccountsController):
if flt(d.debit > 0): d.against_account = ", ".join(list(set(accounts_credited)))
if flt(d.credit > 0): d.against_account = ", ".join(list(set(accounts_debited)))
def validate_debit_and_credit(self):
self.total_debit, self.total_credit, self.difference = 0, 0, 0
def validate_total_debit_and_credit(self):
self.set_total_debit_credit()
if self.difference:
frappe.throw(_("Total Debit must be equal to Total Credit. The difference is {0}")
.format(self.difference))
def set_total_debit_credit(self):
self.total_debit, self.total_credit, self.difference = 0, 0, 0
for d in self.get("accounts"):
if d.debit and d.credit:
frappe.throw(_("You cannot credit and debit same account at the same time"))
self.total_debit = flt(self.total_debit) + flt(d.debit, self.precision("debit", "accounts"))
self.total_credit = flt(self.total_credit) + flt(d.credit, self.precision("credit", "accounts"))
self.total_debit = flt(self.total_debit) + flt(d.debit, d.precision("debit"))
self.total_credit = flt(self.total_credit) + flt(d.credit, d.precision("credit"))
self.difference = flt(self.total_debit, self.precision("total_debit")) - \
flt(self.total_credit, self.precision("total_credit"))
if self.difference:
frappe.throw(_("Total Debit must be equal to Total Credit. The difference is {0}")
.format(self.difference))
def validate_multi_currency(self):
alternate_currency = []
for d in self.get("accounts"):
account = frappe.db.get_value("Account", d.account, ["account_currency", "account_type"], as_dict=1)
d.account_currency = account.account_currency or self.company_currency
d.account_type = account.account_type
if d.account_currency!=self.company_currency and d.account_currency not in alternate_currency:
alternate_currency.append(d.account_currency)
if alternate_currency:
if not self.multi_currency:
frappe.throw(_("Please check Multi Currency option to allow accounts with other currency"))
self.set_exchange_rate()
def set_amounts_in_company_currency(self):
for d in self.get("accounts"):
d.debit = flt(flt(d.debit_in_account_currency)*flt(d.exchange_rate), d.precision("debit"))
d.credit = flt(flt(d.credit_in_account_currency)*flt(d.exchange_rate), d.precision("credit"))
def set_exchange_rate(self):
for d in self.get("accounts"):
if d.account_currency == self.company_currency:
d.exchange_rate = 1
elif not d.exchange_rate or d.exchange_rate == 1 or \
(d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name):
d.exchange_rate = get_exchange_rate(d.account, d.account_currency, self.company,
d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
if not d.exchange_rate:
frappe.throw(_("Row {0}: Exchange Rate is mandatory").format(d.idx))
def create_remarks(self):
r = []
@@ -260,15 +317,13 @@ class JournalEntry(AccountsController):
else:
msgprint(_("Please enter Reference date"), raise_exception=frappe.MandatoryError)
company_currency = get_company_currency(self.company)
for d in self.get('accounts'):
if d.reference_type=="Sales Invoice" and d.credit:
r.append(_("{0} against Sales Invoice {1}").format(fmt_money(flt(d.credit), currency = company_currency), \
r.append(_("{0} against Sales Invoice {1}").format(fmt_money(flt(d.credit), currency = self.company_currency), \
d.reference_name))
if d.reference_type=="Sales Order" and d.credit:
r.append(_("{0} against Sales Order {1}").format(fmt_money(flt(d.credit), currency = company_currency), \
r.append(_("{0} against Sales Order {1}").format(fmt_money(flt(d.credit), currency = self.company_currency), \
d.reference_name))
if d.reference_type == "Purchase Invoice" and d.debit:
@@ -276,11 +331,11 @@ class JournalEntry(AccountsController):
from `tabPurchase Invoice` where name=%s""", d.reference_name)
if bill_no and bill_no[0][0] and bill_no[0][0].lower().strip() \
not in ['na', 'not applicable', 'none']:
r.append(_('{0} against Bill {1} dated {2}').format(fmt_money(flt(d.debit), currency=company_currency), bill_no[0][0],
r.append(_('{0} against Bill {1} dated {2}').format(fmt_money(flt(d.debit), currency=self.company_currency), bill_no[0][0],
bill_no[0][1] and formatdate(bill_no[0][1].strftime('%Y-%m-%d'))))
if d.reference_type == "Purchase Order" and d.debit:
r.append(_("{0} against Purchase Order {1}").format(fmt_money(flt(d.credit), currency = company_currency), \
r.append(_("{0} against Purchase Order {1}").format(fmt_money(flt(d.credit), currency = self.company_currency), \
d.reference_name))
if self.user_remark:
@@ -290,21 +345,24 @@ class JournalEntry(AccountsController):
self.remark = ("\n").join(r) #User Remarks is not mandatory
def set_print_format_fields(self):
total_amount = 0.0
bank_account_currency = None
for d in self.get('accounts'):
if d.party_type and d.party:
if not self.pay_to_recd_from:
self.pay_to_recd_from = frappe.db.get_value(d.party_type, d.party,
"customer_name" if d.party_type=="Customer" else "supplier_name")
self.set_total_amount(d.debit or d.credit)
elif frappe.db.get_value("Account", d.account, "account_type") in ["Bank", "Cash"]:
self.set_total_amount(d.debit or d.credit)
total_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
bank_account_currency = d.account_currency
def set_total_amount(self, amt):
company_currency = get_company_currency(self.company)
self.set_total_amount(total_amount, bank_account_currency)
def set_total_amount(self, amt, currency):
self.total_amount = amt
from frappe.utils import money_in_words
self.total_amount_in_words = money_in_words(amt, company_currency)
self.total_amount_in_words = money_in_words(amt, currency)
def make_gl_entries(self, cancel=0, adv_adj=0):
from erpnext.accounts.general_ledger import make_gl_entries
@@ -318,8 +376,11 @@ class JournalEntry(AccountsController):
"party_type": d.party_type,
"party": d.party,
"against": d.against_account,
"debit": flt(d.debit, self.precision("debit", "accounts")),
"credit": flt(d.credit, self.precision("credit", "accounts")),
"debit": flt(d.debit, d.precision("debit")),
"credit": flt(d.credit, d.precision("credit")),
"account_currency": d.account_currency,
"debit_in_account_currency": flt(d.debit_in_account_currency, d.precision("debit_in_account_currency")),
"credit_in_account_currency": flt(d.credit_in_account_currency, d.precision("credit_in_account_currency")),
"against_voucher_type": d.reference_type,
"against_voucher": d.reference_name,
"remarks": self.remark,
@@ -338,23 +399,24 @@ class JournalEntry(AccountsController):
diff = flt(self.difference, self.precision("difference"))
# If any row without amount, set the diff on that row
for d in self.get('accounts'):
if not d.credit and not d.debit and diff != 0:
if diff>0:
d.credit = diff
elif diff<0:
d.debit = diff
flag = 1
if diff:
blank_row = None
for d in self.get('accounts'):
if not d.credit_in_account_currency and not d.debit_in_account_currency and diff != 0:
blank_row = d
# Set the diff in a new row
if flag == 0 and diff != 0:
jd = self.append('accounts', {})
if not blank_row:
blank_row = self.append('accounts', {})
blank_row.exchange_rate = 1
if diff>0:
jd.credit = abs(diff)
blank_row.credit_in_account_currency = diff
blank_row.credit = diff
elif diff<0:
jd.debit = abs(diff)
blank_row.debit_in_account_currency = abs(diff)
blank_row.debit = abs(diff)
self.validate_debit_and_credit()
self.validate_total_debit_and_credit()
def get_outstanding_invoices(self):
self.set('accounts', [])
@@ -382,7 +444,7 @@ class JournalEntry(AccountsController):
elif self.write_off_based_on == 'Accounts Payable':
jd2.credit = total
self.validate_debit_and_credit()
self.validate_total_debit_and_credit()
def get_values(self):
@@ -427,6 +489,20 @@ class JournalEntry(AccountsController):
if not self.get('accounts'):
frappe.throw("Accounts table cannot be blank.")
def set_account_and_party_balance(self):
account_balance = {}
party_balance = {}
for d in self.get("accounts"):
if d.account not in account_balance:
account_balance[d.account] = get_balance_on(account=d.account, date=self.posting_date)
if (d.party_type, d.party) not in party_balance:
party_balance[(d.party_type, d.party)] = get_balance_on(party_type=d.party_type,
party=d.party, date=self.posting_date)
d.account_balance = account_balance[d.account]
d.party_balance = party_balance[(d.party_type, d.party)]
@frappe.whitelist()
def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None):
from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_cash_account
@@ -439,143 +515,141 @@ def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None):
if voucher_type=="Bank Entry":
account = frappe.db.get_value("Company", company, "default_bank_account")
if not account:
account = frappe.db.get_value("Account", {"company": company, "account_type": "Bank", "is_group": 0})
account = frappe.db.get_value("Account",
{"company": company, "account_type": "Bank", "is_group": 0})
elif voucher_type=="Cash Entry":
account = frappe.db.get_value("Company", company, "default_cash_account")
if not account:
account = frappe.db.get_value("Account", {"company": company, "account_type": "Cash", "is_group": 0})
account = frappe.db.get_value("Account",
{"company": company, "account_type": "Cash", "is_group": 0})
if account:
account_details = frappe.db.get_value("Account", account,
["account_currency", "account_type"], as_dict=1)
return {
"account": account,
"balance": get_balance_on(account)
"balance": get_balance_on(account),
"account_currency": account_details.account_currency,
"account_type": account_details.account_type
}
@frappe.whitelist()
def get_payment_entry_from_sales_invoice(sales_invoice):
"""Returns new Journal Entry document as dict for given Sales Invoice"""
from erpnext.accounts.utils import get_balance_on
si = frappe.get_doc("Sales Invoice", sales_invoice)
jv = get_payment_entry(si)
jv.remark = 'Payment received against Sales Invoice {0}. {1}'.format(si.name, si.remarks)
def get_payment_entry_against_order(dt, dn):
ref_doc = frappe.get_doc(dt, dn)
# credit customer
jv.get("accounts")[0].account = si.debit_to
jv.get("accounts")[0].party_type = "Customer"
jv.get("accounts")[0].party = si.customer
jv.get("accounts")[0].balance = get_balance_on(si.debit_to)
jv.get("accounts")[0].party_balance = get_balance_on(party=si.customer, party_type="Customer")
jv.get("accounts")[0].credit = si.outstanding_amount
jv.get("accounts")[0].reference_type = si.doctype
jv.get("accounts")[0].reference_name = si.name
if flt(ref_doc.per_billed, 2) > 0:
frappe.throw(_("Can only make payment against unbilled {0}").format(dt))
# debit bank
jv.get("accounts")[1].debit = si.outstanding_amount
if dt == "Sales Order":
party_type = "Customer"
amount_field_party = "credit_in_account_currency"
amount_field_bank = "debit_in_account_currency"
else:
party_type = "Supplier"
amount_field_party = "debit_in_account_currency"
amount_field_bank = "credit_in_account_currency"
return jv.as_dict()
party_account = get_party_account(party_type, ref_doc.get(party_type.lower()), ref_doc.company)
party_account_currency = get_account_currency(party_account)
if party_account_currency == ref_doc.company_currency:
amount = flt(ref_doc.base_grand_total) - flt(ref_doc.advance_paid)
else:
amount = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
return get_payment_entry(ref_doc, {
"party_type": party_type,
"party_account": party_account,
"party_account_currency": party_account_currency,
"amount_field_party": amount_field_party,
"amount_field_bank": amount_field_bank,
"amount": amount,
"remarks": 'Advance Payment received against {0} {1}'.format(dt, dn),
"is_advance": "Yes"
})
@frappe.whitelist()
def get_payment_entry_from_purchase_invoice(purchase_invoice):
"""Returns new Journal Entry document as dict for given Purchase Invoice"""
pi = frappe.get_doc("Purchase Invoice", purchase_invoice)
jv = get_payment_entry(pi)
jv.remark = 'Payment against Purchase Invoice {0}. {1}'.format(pi.name, pi.remarks)
def get_payment_entry_against_invoice(dt, dn):
ref_doc = frappe.get_doc(dt, dn)
if dt == "Sales Invoice":
party_type = "Customer"
party_account = ref_doc.debit_to
else:
party_type = "Supplier"
party_account = ref_doc.credit_to
# credit supplier
jv.get("accounts")[0].account = pi.credit_to
jv.get("accounts")[0].party_type = "Supplier"
jv.get("accounts")[0].party = pi.supplier
jv.get("accounts")[0].balance = get_balance_on(pi.credit_to)
jv.get("accounts")[0].party_balance = get_balance_on(party=pi.supplier, party_type="Supplier")
jv.get("accounts")[0].debit = pi.outstanding_amount
jv.get("accounts")[0].reference_type = pi.doctype
jv.get("accounts")[0].reference_name = pi.name
# credit bank
jv.get("accounts")[1].credit = pi.outstanding_amount
if (dt=="Sales Invoice" and ref_doc.outstanding_amount > 0) \
or (dt=="Purchase Invoice" and ref_doc.outstanding_amount < 0):
amount_field_party = "credit_in_account_currency"
amount_field_bank = "debit_in_account_currency"
else:
amount_field_party = "debit_in_account_currency"
amount_field_bank = "credit_in_account_currency"
return jv.as_dict()
return get_payment_entry(ref_doc, {
"party_type": party_type,
"party_account": party_account,
"party_account_currency": ref_doc.party_account_currency,
"amount_field_party": amount_field_party,
"amount_field_bank": amount_field_bank,
"amount": abs(ref_doc.outstanding_amount),
"remarks": 'Payment received against {0} {1}. {2}'.format(dt, dn, ref_doc.remarks),
"is_advance": "No"
})
@frappe.whitelist()
def get_payment_entry_from_sales_order(sales_order):
"""Returns new Journal Entry document as dict for given Sales Order"""
from erpnext.accounts.utils import get_balance_on
from erpnext.accounts.party import get_party_account
so = frappe.get_doc("Sales Order", sales_order)
def get_payment_entry(ref_doc, args):
cost_center = frappe.db.get_value("Company", ref_doc.company, "cost_center")
exchange_rate = get_exchange_rate(args.get("party_account"), args.get("party_account_currency"),
ref_doc.company, ref_doc.doctype, ref_doc.name)
if flt(so.per_billed, 2) != 0.0:
frappe.throw(_("Can only make payment against unbilled Sales Order"))
jv = frappe.new_doc("Journal Entry")
jv.update({
"voucher_type": "Bank Entry",
"company": ref_doc.company,
"remark": args.get("remarks")
})
jv = get_payment_entry(so)
jv.remark = 'Advance payment received against Sales Order {0}.'.format(so.name)
party_account = get_party_account(so.company, so.customer, "Customer")
amount = flt(so.base_grand_total) - flt(so.advance_paid)
# credit customer
jv.get("accounts")[0].account = party_account
jv.get("accounts")[0].party_type = "Customer"
jv.get("accounts")[0].party = so.customer
jv.get("accounts")[0].balance = get_balance_on(party_account)
jv.get("accounts")[0].party_balance = get_balance_on(party=so.customer, party_type="Customer")
jv.get("accounts")[0].credit = amount
jv.get("accounts")[0].reference_type = so.doctype
jv.get("accounts")[0].reference_name = so.name
jv.get("accounts")[0].is_advance = "Yes"
# debit bank
jv.get("accounts")[1].debit = amount
return jv.as_dict()
@frappe.whitelist()
def get_payment_entry_from_purchase_order(purchase_order):
"""Returns new Journal Entry document as dict for given Sales Order"""
from erpnext.accounts.utils import get_balance_on
from erpnext.accounts.party import get_party_account
po = frappe.get_doc("Purchase Order", purchase_order)
if flt(po.per_billed, 2) != 0.0:
frappe.throw(_("Can only make payment against unbilled Sales Order"))
jv = get_payment_entry(po)
jv.remark = 'Advance payment made against Purchase Order {0}.'.format(po.name)
party_account = get_party_account(po.company, po.supplier, "Supplier")
amount = flt(po.base_grand_total) - flt(po.advance_paid)
# credit customer
jv.get("accounts")[0].account = party_account
jv.get("accounts")[0].party_type = "Supplier"
jv.get("accounts")[0].party = po.supplier
jv.get("accounts")[0].balance = get_balance_on(party_account)
jv.get("accounts")[0].party_balance = get_balance_on(party=po.supplier, party_type="Supplier")
jv.get("accounts")[0].debit = amount
jv.get("accounts")[0].reference_type = po.doctype
jv.get("accounts")[0].reference_name = po.name
jv.get("accounts")[0].is_advance = "Yes"
# debit bank
jv.get("accounts")[1].credit = amount
return jv.as_dict()
def get_payment_entry(doc):
bank_account = get_default_bank_cash_account(doc.company, "Bank Entry")
jv = frappe.new_doc('Journal Entry')
jv.voucher_type = 'Bank Entry'
jv.company = doc.company
jv.fiscal_year = doc.fiscal_year
jv.append("accounts")
d2 = jv.append("accounts")
party_row = jv.append("accounts", {
"account": args.get("party_account"),
"party_type": args.get("party_type"),
"party": ref_doc.get(args.get("party_type").lower()),
"cost_center": cost_center,
"account_type": frappe.db.get_value("Account", args.get("party_account"), "account_type"),
"account_currency": args.get("party_account_currency") or \
get_account_currency(args.get("party_account")),
"balance": get_balance_on(args.get("party_account")),
"party_balance": get_balance_on(party=args.get("party"), party_type=args.get("party_type")),
"exchange_rate": exchange_rate,
args.get("amount_field_party"): args.get("amount"),
"is_advance": args.get("is_advance"),
"reference_type": ref_doc.doctype,
"reference_name": ref_doc.name
})
bank_row = jv.append("accounts")
bank_account = get_default_bank_cash_account(ref_doc.company, "Bank Entry")
if bank_account:
d2.account = bank_account["account"]
d2.balance = bank_account["balance"]
bank_row.update(bank_account)
bank_row.exchange_rate = get_exchange_rate(bank_account["account"],
bank_account["account_currency"], ref_doc.company)
return jv
bank_row.cost_center = cost_center
if bank_row.account_currency == args.get("party_account_currency"):
bank_row.set(args.get("amount_field_bank"), args.get("amount"))
else:
bank_row.set(args.get("amount_field_bank"), args.get("amount") * exchange_rate)
# set multi currency check
if party_row.account_currency != ref_doc.company_currency \
or (bank_row.account_currency and bank_row.account_currency != ref_doc.company_currency):
jv.multi_currency = 1
jv.set_amounts_in_company_currency()
jv.set_total_debit_credit()
return jv.as_dict()
@frappe.whitelist()
def get_opening_accounts(company):
@@ -590,36 +664,49 @@ def get_against_jv(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql("""select jv.name, jv.posting_date, jv.user_remark
from `tabJournal Entry` jv, `tabJournal Entry Account` jv_detail
where jv_detail.parent = jv.name and jv_detail.account = %s and ifnull(jv_detail.party, '') = %s
and ifnull(jv_detail.reference_type, '') = ''
and jv.docstatus = 1 and jv.{0} like %s order by jv.name desc limit %s, %s""".format(searchfield),
and (jv_detail.reference_type is null or jv_detail.reference_type = '')
and jv.docstatus = 1 and jv.`{0}` like %s order by jv.name desc limit %s, %s""".format(frappe.db.escape(searchfield)),
(filters.get("account"), cstr(filters.get("party")), "%{0}%".format(txt), start, page_len))
@frappe.whitelist()
def get_outstanding(args):
if not frappe.has_permission("Account"):
frappe.msgprint(_("No Permission"), raise_exception=1)
args = eval(args)
if isinstance(args, basestring):
args = json.loads(args)
company_currency = get_company_currency(args.get("company"))
if args.get("doctype") == "Journal Entry":
condition = " and party=%(party)s" if args.get("party") else ""
against_jv_amount = frappe.db.sql("""
select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
from `tabJournal Entry Account` where parent=%(docname)s and account=%(account)s {0}
and ifnull(reference_type, '')=''""".format(condition), args)
and (reference_type is null or reference_type = '')""".format(condition), args)
against_jv_amount = flt(against_jv_amount[0][0]) if against_jv_amount else 0
amount_field = "credit_in_account_currency" if against_jv_amount > 0 else "debit_in_account_currency"
return {
("credit" if against_jv_amount > 0 else "debit"): abs(against_jv_amount)
amount_field: abs(against_jv_amount)
}
elif args.get("doctype") == "Sales Invoice":
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", args["docname"], "outstanding_amount"))
elif args.get("doctype") in ("Sales Invoice", "Purchase Invoice"):
invoice = frappe.db.get_value(args["doctype"], args["docname"],
["outstanding_amount", "conversion_rate"], as_dict=1)
exchange_rate = invoice.conversion_rate if (args.get("account_currency") != company_currency) else 1
if args["doctype"] == "Sales Invoice":
amount_field = "credit_in_account_currency" \
if flt(invoice.outstanding_amount) > 0 else "debit_in_account_currency"
else:
amount_field = "debit_in_account_currency" \
if flt(invoice.outstanding_amount) > 0 else "credit_in_account_currency"
return {
("credit" if outstanding_amount > 0 else "debit"): abs(outstanding_amount)
}
elif args.get("doctype") == "Purchase Invoice":
outstanding_amount = flt(frappe.db.get_value("Purchase Invoice", args["docname"], "outstanding_amount"))
return {
("debit" if outstanding_amount > 0 else "credit"): abs(outstanding_amount)
amount_field: abs(flt(invoice.outstanding_amount)),
"exchange_rate": exchange_rate
}
@frappe.whitelist()
@@ -627,8 +714,7 @@ def get_party_account_and_balance(company, party_type, party):
if not frappe.has_permission("Account"):
frappe.msgprint(_("No Permission"), raise_exception=1)
from erpnext.accounts.party import get_party_account
account = get_party_account(company, party, party_type)
account = get_party_account(party_type, party, company)
account_balance = get_balance_on(account=account)
party_balance = get_balance_on(party_type=party_type, party=party)
@@ -640,14 +726,77 @@ def get_party_account_and_balance(company, party_type, party):
}
@frappe.whitelist()
def get_account_balance_and_party_type(account, date):
def get_account_balance_and_party_type(account, date, company, debit=None, credit=None, exchange_rate=None):
"""Returns dict of account balance and party type to be set in Journal Entry on selection of account."""
if not frappe.has_permission("Account"):
frappe.msgprint(_("No Permission"), raise_exception=1)
account_type = frappe.db.get_value("Account", account, "account_type")
return {
company_currency = get_company_currency(company)
account_details = frappe.db.get_value("Account", account, ["account_type", "account_currency"], as_dict=1)
if account_details.account_type == "Receivable":
party_type = "Customer"
elif account_details.account_type == "Payable":
party_type = "Supplier"
else:
party_type = ""
grid_values = {
"balance": get_balance_on(account, date),
"party_type": {"Receivable":"Customer", "Payable":"Supplier"}.get(account_type, "")
"party_type": party_type,
"account_type": account_details.account_type,
"account_currency": account_details.account_currency or company_currency,
"exchange_rate": get_exchange_rate(account, account_details.account_currency,
company, debit=debit, credit=credit, exchange_rate=exchange_rate)
}
# un-set party if not party type
if not party_type:
grid_values["party"] = ""
return grid_values
@frappe.whitelist()
def get_exchange_rate(account, account_currency=None, company=None,
reference_type=None, reference_name=None, debit=None, credit=None, exchange_rate=None):
from erpnext.setup.utils import get_exchange_rate
account_details = frappe.db.get_value("Account", account,
["account_type", "root_type", "account_currency", "company"], as_dict=1)
if not account_details:
frappe.throw(_("Please select correct account"))
if not company:
company = account_details.company
if not account_currency:
account_currency = account_details.account_currency
company_currency = get_company_currency(company)
if account_currency != company_currency:
if reference_type in ("Sales Invoice", "Purchase Invoice") and reference_name:
exchange_rate = frappe.db.get_value(reference_type, reference_name, "conversion_rate")
elif account_details and account_details.account_type == "Bank" and \
((account_details.root_type == "Asset" and flt(credit) > 0) or
(account_details.root_type == "Liability" and debit)):
exchange_rate = get_average_exchange_rate(account)
if not exchange_rate and account_currency:
exchange_rate = get_exchange_rate(account_currency, company_currency)
else:
exchange_rate = 1
# don't return None or 0 as it is multipled with a value and that value could be lost
return exchange_rate or 1
def get_average_exchange_rate(account):
exchange_rate = 0
bank_balance_in_account_currency = get_balance_on(account)
if bank_balance_in_account_currency:
bank_balance_in_company_currency = get_balance_on(account, in_account_currency=False)
exchange_rate = bank_balance_in_company_currency / bank_balance_in_account_currency
return exchange_rate

View File

@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import unittest, frappe
from frappe.utils import flt
from erpnext.accounts.utils import get_actual_expense, BudgetError, get_fiscal_year
from erpnext.exceptions import InvalidAccountCurrency
class TestJournalEntry(unittest.TestCase):
@@ -101,7 +102,7 @@ class TestJournalEntry(unittest.TestCase):
self.set_total_expense_zero("2013-02-28")
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", 40000, "_Test Cost Center - _TC", submit=True)
"_Test Bank - _TC", 40000, "_Test Cost Center - _TC", submit=True)
self.assertTrue(frappe.db.get_value("GL Entry",
{"voucher_type": "Journal Entry", "voucher_no": jv.name}))
@@ -112,7 +113,7 @@ class TestJournalEntry(unittest.TestCase):
self.set_total_expense_zero("2013-02-28")
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", 40000, "_Test Cost Center - _TC")
"_Test Bank - _TC", 40000, "_Test Cost Center - _TC")
self.assertRaises(BudgetError, jv.submit)
@@ -126,7 +127,7 @@ class TestJournalEntry(unittest.TestCase):
self.set_total_expense_zero("2013-02-28")
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", 150000, "_Test Cost Center - _TC")
"_Test Bank - _TC", 150000, "_Test Cost Center - _TC")
self.assertRaises(BudgetError, jv.submit)
@@ -136,13 +137,13 @@ class TestJournalEntry(unittest.TestCase):
self.set_total_expense_zero("2013-02-28")
jv1 = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", 20000, "_Test Cost Center - _TC", submit=True)
"_Test Bank - _TC", 20000, "_Test Cost Center - _TC", submit=True)
self.assertTrue(frappe.db.get_value("GL Entry",
{"voucher_type": "Journal Entry", "voucher_no": jv1.name}))
jv2 = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", 20000, "_Test Cost Center - _TC", submit=True)
"_Test Bank - _TC", 20000, "_Test Cost Center - _TC", submit=True)
self.assertTrue(frappe.db.get_value("GL Entry",
{"voucher_type": "Journal Entry", "voucher_no": jv2.name}))
@@ -165,32 +166,112 @@ class TestJournalEntry(unittest.TestCase):
def set_total_expense_zero(self, posting_date):
existing_expense = self.get_actual_expense(posting_date)
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", -existing_expense, "_Test Cost Center - _TC", submit=True)
"_Test Bank - _TC", -existing_expense, "_Test Cost Center - _TC", submit=True)
def make_journal_entry(account1, account2, amount, cost_center=None, submit=False):
def test_multi_currency(self):
jv = make_journal_entry("_Test Bank USD - _TC",
"_Test Bank - _TC", 100, exchange_rate=50, save=False)
jv.get("accounts")[1].credit_in_account_currency = 5000
jv.submit()
gl_entries = frappe.db.sql("""select account, account_currency, debit, credit,
debit_in_account_currency, credit_in_account_currency
from `tabGL Entry` where voucher_type='Journal Entry' and voucher_no=%s
order by account asc""", jv.name, as_dict=1)
self.assertTrue(gl_entries)
expected_values = {
"_Test Bank USD - _TC": {
"account_currency": "USD",
"debit": 5000,
"debit_in_account_currency": 100,
"credit": 0,
"credit_in_account_currency": 0
},
"_Test Bank - _TC": {
"account_currency": "INR",
"debit": 0,
"debit_in_account_currency": 0,
"credit": 5000,
"credit_in_account_currency": 5000
}
}
for field in ("account_currency", "debit", "debit_in_account_currency", "credit", "credit_in_account_currency"):
for i, gle in enumerate(gl_entries):
self.assertEquals(expected_values[gle.account][field], gle[field])
# cancel
jv.cancel()
gle = frappe.db.sql("""select name from `tabGL Entry`
where voucher_type='Sales Invoice' and voucher_no=%s""", jv.name)
self.assertFalse(gle)
def test_disallow_change_in_account_currency_for_a_party(self):
# create jv in USD
jv = make_journal_entry("_Test Bank USD - _TC",
"_Test Receivable USD - _TC", 100, save=False)
jv.accounts[1].update({
"party_type": "Customer",
"party": "_Test Customer USD"
})
jv.submit()
# create jv in USD, but account currency in INR
jv = make_journal_entry("_Test Bank - _TC",
"_Test Receivable - _TC", 100, save=False)
jv.accounts[1].update({
"party_type": "Customer",
"party": "_Test Customer USD"
})
self.assertRaises(InvalidAccountCurrency, jv.submit)
# back in USD
jv = make_journal_entry("_Test Bank USD - _TC",
"_Test Receivable USD - _TC", 100, save=False)
jv.accounts[1].update({
"party_type": "Customer",
"party": "_Test Customer USD"
})
jv.submit()
def make_journal_entry(account1, account2, amount, cost_center=None, exchange_rate=1, save=True, submit=False):
jv = frappe.new_doc("Journal Entry")
jv.posting_date = "2013-02-14"
jv.company = "_Test Company"
jv.fiscal_year = "_Test Fiscal Year 2013"
jv.user_remark = "test"
jv.multi_currency = 1
jv.set("accounts", [
{
"account": account1,
"cost_center": cost_center,
"debit": amount if amount > 0 else 0,
"credit": abs(amount) if amount < 0 else 0,
"debit_in_account_currency": amount if amount > 0 else 0,
"credit_in_account_currency": abs(amount) if amount < 0 else 0,
"exchange_rate": exchange_rate
}, {
"account": account2,
"cost_center": cost_center,
"credit": amount if amount > 0 else 0,
"debit": abs(amount) if amount < 0 else 0,
"credit_in_account_currency": amount if amount > 0 else 0,
"debit_in_account_currency": abs(amount) if amount < 0 else 0,
"exchange_rate": exchange_rate
}
])
jv.insert()
if save or submit:
jv.insert()
if submit:
jv.submit()
if submit:
jv.submit()
return jv

View File

@@ -9,15 +9,15 @@
"account": "_Test Receivable - _TC",
"party_type": "Customer",
"party": "_Test Customer",
"credit": 400.0,
"debit": 0.0,
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts"
},
{
"account": "_Test Account Bank Account - _TC",
"credit": 0.0,
"debit": 400.0,
"account": "_Test Bank - _TC",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts"
}
@@ -40,15 +40,15 @@
"account": "_Test Payable - _TC",
"party_type": "Supplier",
"party": "_Test Supplier",
"credit": 0.0,
"debit": 400.0,
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts"
},
{
"account": "_Test Account Bank Account - _TC",
"credit": 400.0,
"debit": 0.0,
"account": "_Test Bank - _TC",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts"
}
@@ -71,16 +71,16 @@
"account": "_Test Receivable - _TC",
"party_type": "Customer",
"party": "_Test Customer",
"credit": 0.0,
"debit": 400.0,
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts"
},
{
"account": "Sales - _TC",
"cost_center": "_Test Cost Center - _TC",
"credit": 400.0,
"debit": 0.0,
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts"
}

View File

@@ -10,7 +10,7 @@
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"bold": 1,
"collapsible": 0,
"fieldname": "account",
"fieldtype": "Link",
@@ -19,12 +19,14 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Account",
"length": 0,
"no_copy": 0,
"oldfieldname": "account",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "250px",
"read_only": 0,
"report_hide": 0,
@@ -34,6 +36,30 @@
"unique": 0,
"width": "250px"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "account_type",
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Account Type",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -45,12 +71,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Account Balance",
"length": 0,
"no_copy": 1,
"oldfieldname": "balance",
"oldfieldtype": "Data",
"options": "Company:company:default_currency",
"options": "account_currency",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -71,12 +99,14 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
"options": "Cost Center",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "180px",
"read_only": 0,
"report_hide": 0,
@@ -96,9 +126,11 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -117,10 +149,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Party Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -139,10 +173,12 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Party",
"length": 0,
"no_copy": 0,
"options": "party_type",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -161,11 +197,64 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Party Balance",
"length": 0,
"no_copy": 0,
"options": "account_currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "",
"depends_on": "",
"fieldname": "currency_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Currency",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "account_currency",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Account Currency",
"length": 0,
"no_copy": 1,
"options": "Currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -173,6 +262,53 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_10",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "exchange_rate",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Exchange Rate",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "6",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -184,9 +320,11 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -196,22 +334,50 @@
},
{
"allow_on_submit": 0,
"bold": 0,
"bold": 1,
"collapsible": 0,
"fieldname": "debit",
"fieldname": "debit_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Debit",
"length": 0,
"no_copy": 0,
"options": "account_currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"fieldname": "debit",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Debit in Company Currency",
"length": 0,
"no_copy": 1,
"oldfieldname": "debit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -228,9 +394,11 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -240,22 +408,50 @@
},
{
"allow_on_submit": 0,
"bold": 0,
"bold": 1,
"collapsible": 0,
"fieldname": "credit",
"fieldname": "credit_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Credit",
"length": 0,
"no_copy": 0,
"options": "account_currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"fieldname": "credit",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit in Company Currency",
"length": 0,
"no_copy": 1,
"oldfieldname": "credit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -273,9 +469,11 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -294,11 +492,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Type",
"length": 0,
"no_copy": 0,
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -317,11 +517,13 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Reference Name",
"length": 0,
"no_copy": 0,
"options": "reference_type",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -339,9 +541,11 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -360,12 +564,14 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Advance",
"length": 0,
"no_copy": 1,
"oldfieldname": "is_advance",
"oldfieldtype": "Select",
"options": "No\nYes",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -384,11 +590,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Against Account",
"length": 0,
"no_copy": 1,
"oldfieldname": "against_account",
"oldfieldtype": "Text",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -405,7 +613,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-17 02:11:33.991361",
"max_attachments": 0,
"modified": "2015-12-02 04:14:37.571883",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

View File

@@ -7,7 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Mode of Payment",
"length": 0,
"no_copy": 0,
"oldfieldname": "mode_of_payment",
"oldfieldtype": "Data",
@@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Accounts",
"length": 0,
"no_copy": 0,
"options": "Mode of Payment Account",
"permlevel": 0,
@@ -65,7 +67,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-02-05 05:11:41.346436",
"max_attachments": 0,
"modified": "2015-11-16 06:29:50.335559",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Mode of Payment",
@@ -93,7 +96,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,

View File

@@ -5,6 +5,24 @@ from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class ModeofPayment(Document):
pass
def validate(self):
self.validate_accounts()
self.validate_repeating_companies()
def validate_repeating_companies(self):
"""Error when Same Company is entered multiple times in accounts"""
accounts_list = []
for entry in self.accounts:
accounts_list.append(entry.company)
if len(accounts_list)!= len(set(accounts_list)):
frappe.throw(_("Same Company is entered more than once"))
def validate_accounts(self):
for entry in self.accounts:
"""Error when Company of Ledger account doesn't match with Company Selected"""
if frappe.db.get_value("Account", entry.default_account, "company") != entry.company:
frappe.throw(_("Account does not match with Company"))

View File

@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Mode of Payment')
class TestModeofPayment(unittest.TestCase):
pass

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
@@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Default Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
@@ -63,7 +65,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-01-06 17:26:57.053474",
"max_attachments": 0,
"modified": "2015-11-16 06:29:50.367895",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Mode of Payment Account",

View File

@@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Distribution Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "distribution_id",
"oldfieldtype": "Data",
@@ -44,6 +45,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Fiscal Year",
"length": 0,
"no_copy": 0,
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
@@ -68,6 +70,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Monthly Distribution Percentages",
"length": 0,
"no_copy": 0,
"oldfieldname": "budget_distribution_details",
"oldfieldtype": "Table",
@@ -91,7 +94,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-02-05 05:11:41.429491",
"max_attachments": 0,
"modified": "2015-11-16 06:29:50.431735",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Monthly Distribution",

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Month",
"length": 0,
"no_copy": 0,
"oldfieldname": "month",
"oldfieldtype": "Data",
@@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Percentage Allocation",
"length": 0,
"no_copy": 0,
"oldfieldname": "percentage_allocation",
"oldfieldtype": "Currency",
@@ -63,7 +65,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-02-19 01:07:00.800015",
"max_attachments": 0,
"modified": "2015-11-16 06:29:50.468982",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Monthly Distribution Percentage",

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
@@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -63,6 +65,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
@@ -82,7 +85,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-26 11:23:22.917738",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.450360",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Party Account",

View File

@@ -44,7 +44,7 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
}
});
},
refresh: function() {
this.frm.disable_save();
},
@@ -74,21 +74,7 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
doc: me.frm.doc,
method: 'get_unreconciled_entries',
callback: function(r, rt) {
var invoices = [];
$.each(me.frm.doc.invoices || [], function(i, row) {
if (row.invoice_number && !inList(invoices, row.invoice_number))
invoices.push(row.invoice_number);
});
frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number",
me.frm.doc.name).options = invoices.join("\n");
$.each(me.frm.doc.payments || [], function(i, p) {
if(!inList(invoices, cstr(p.invoice_number))) p.invoice_number = null;
});
refresh_field("payments");
me.set_invoice_options();
}
});
@@ -98,8 +84,29 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
var me = this;
return this.frm.call({
doc: me.frm.doc,
method: 'reconcile'
method: 'reconcile',
callback: function(r, rt) {
me.set_invoice_options();
}
});
},
set_invoice_options: function() {
var invoices = [];
$.each(me.frm.doc.invoices || [], function(i, row) {
if (row.invoice_number && !inList(invoices, row.invoice_number))
invoices.push(row.invoice_type + " | " + row.invoice_number);
});
frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number",
me.frm.doc.name).options = invoices.join("\n");
$.each(me.frm.doc.payments || [], function(i, p) {
if(!inList(invoices, cstr(p.invoice_number))) p.invoice_number = null;
});
refresh_field("payments");
}
});

View File

@@ -130,7 +130,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break",
"label": "",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -362,7 +362,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"modified": "2015-02-05 05:11:42.105088",
"modified": "2015-09-21 03:41:24.672227",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation",

View File

@@ -3,12 +3,10 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import msgprint, _
from frappe.model.document import Document
from erpnext.accounts.utils import get_outstanding_invoices
class PaymentReconciliation(Document):
def get_unreconciled_entries(self):
@@ -17,9 +15,10 @@ class PaymentReconciliation(Document):
def get_jv_entries(self):
self.check_mandatory_to_fetch()
dr_or_cr = "credit" if self.party_type == "Customer" else "debit"
dr_or_cr = "credit_in_account_currency" if self.party_type == "Customer" \
else "debit_in_account_currency"
cond = self.check_condition(dr_or_cr)
cond = self.check_condition()
bank_account_condition = "t2.against_account like %(bank_cash_account)s" \
if self.bank_cash_account else "1=1"
@@ -34,7 +33,7 @@ class PaymentReconciliation(Document):
t1.name = t2.parent and t1.docstatus = 1 and t2.docstatus = 1
and t2.party_type = %(party_type)s and t2.party = %(party)s
and t2.account = %(account)s and {dr_or_cr} > 0
and ifnull(t2.reference_type, '') in ('', 'Sales Order', 'Purchase Order')
and (t2.reference_type is null or t2.reference_type in ('', 'Sales Order', 'Purchase Order'))
{cond}
and (CASE
WHEN t1.voucher_type in ('Debit Note', 'Credit Note')
@@ -67,58 +66,11 @@ class PaymentReconciliation(Document):
def get_invoice_entries(self):
#Fetch JVs, Sales and Purchase Invoices for 'invoices' to reconcile against
non_reconciled_invoices = []
dr_or_cr = "debit" if self.party_type == "Customer" else "credit"
cond = self.check_condition(dr_or_cr)
invoice_list = frappe.db.sql("""
select
voucher_no, voucher_type, posting_date,
ifnull(sum({dr_or_cr}), 0) as invoice_amount
from
`tabGL Entry`
where
party_type = %(party_type)s and party = %(party)s
and account = %(account)s and {dr_or_cr} > 0 {cond}
group by voucher_type, voucher_no
""".format(**{
"cond": cond,
"dr_or_cr": dr_or_cr
}), {
"party_type": self.party_type,
"party": self.party,
"account": self.receivable_payable_account,
}, as_dict=True)
condition = self.check_condition()
for d in invoice_list:
payment_amount = frappe.db.sql("""
select
ifnull(sum(ifnull({0}, 0)), 0)
from
`tabGL Entry`
where
party_type = %(party_type)s and party = %(party)s
and account = %(account)s and {0} > 0
and against_voucher_type = %(against_voucher_type)s
and ifnull(against_voucher, '') = %(against_voucher)s
""".format("credit" if self.party_type == "Customer" else "debit"), {
"party_type": self.party_type,
"party": self.party,
"account": self.receivable_payable_account,
"against_voucher_type": d.voucher_type,
"against_voucher": d.voucher_no
})
payment_amount = payment_amount[0][0] if payment_amount else 0
if d.invoice_amount - payment_amount > 0.005:
non_reconciled_invoices.append({
'voucher_no': d.voucher_no,
'voucher_type': d.voucher_type,
'posting_date': d.posting_date,
'invoice_amount': flt(d.invoice_amount),
'outstanding_amount': flt(d.invoice_amount - payment_amount, 2)
})
non_reconciled_invoices = get_outstanding_invoices(self.party_type, self.party,
self.receivable_payable_account, condition=condition)
self.add_invoice_entries(non_reconciled_invoices)
@@ -135,12 +87,18 @@ class PaymentReconciliation(Document):
ent.outstanding_amount = e.get('outstanding_amount')
def reconcile(self, args):
for e in self.get('payments'):
e.invoice_type = None
if e.invoice_number and " | " in e.invoice_number:
e.invoice_type, e.invoice_number = e.invoice_number.split(" | ")
self.get_invoice_entries()
self.validate_invoice()
dr_or_cr = "credit" if self.party_type == "Customer" else "debit"
dr_or_cr = "credit_in_account_currency" if self.party_type == "Customer" \
else "debit_in_account_currency"
lst = []
for e in self.get('payments'):
if e.invoice_type and e.invoice_number and e.allocated_amount:
if e.invoice_number and e.allocated_amount:
lst.append({
'voucher_no' : e.journal_entry,
'voucher_detail_no' : e.voucher_detail_number,
@@ -199,13 +157,18 @@ class PaymentReconciliation(Document):
if not invoices_to_reconcile:
frappe.throw(_("Please select Allocated Amount, Invoice Type and Invoice Number in atleast one row"))
def check_condition(self, dr_or_cr):
cond = self.from_date and " and posting_date >= '" + self.from_date + "'" or ""
cond += self.to_date and " and posting_date <= '" + self.to_date + "'" or ""
def check_condition(self):
cond = " and posting_date >= {0}".format(frappe.db.escape(self.from_date)) if self.from_date else ""
cond += " and posting_date <= {0}".format(frappe.db.escape(self.to_date)) if self.to_date else ""
if self.party_type == "Customer":
dr_or_cr = "debit_in_account_currency"
else:
dr_or_cr = "credit_in_account_currency"
if self.minimum_amount:
cond += " and {0} >= %s".format(dr_or_cr) % self.minimum_amount
cond += " and `{0}` >= {1}".format(dr_or_cr, flt(self.minimum_amount))
if self.maximum_amount:
cond += " and {0} <= %s".format(dr_or_cr) % self.maximum_amount
cond += " and `{0}` <= {1}".format(dr_or_cr, flt(self.maximum_amount))
return cond

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Invoice Type",
"length": 0,
"no_copy": 0,
"options": "Sales Invoice\nPurchase Invoice\nJournal Entry",
"permlevel": 0,
@@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Invoice Number",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
@@ -63,6 +65,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Invoice Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -83,7 +86,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break",
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -105,6 +109,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -126,6 +131,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Outstanding Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -144,7 +150,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2014-07-18 12:20:51.269974",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.516537",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Invoice",

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Journal Entry",
"length": 0,
"no_copy": 0,
"options": "Journal Entry",
"permlevel": 0,
@@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Posting Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -62,6 +64,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -83,6 +86,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Advance",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -104,6 +108,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Voucher Detail Number",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -124,7 +129,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break",
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -135,51 +141,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "allocated_amount",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Allocated amount",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"default": "Sales Invoice",
"fieldname": "invoice_type",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Invoice Type",
"no_copy": 0,
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -191,6 +152,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Invoice Number",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
@@ -202,6 +164,29 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "allocated_amount",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Allocated amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -213,6 +198,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -234,6 +220,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Remark",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -243,27 +230,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "col_break2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
@@ -273,7 +239,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2014-12-25 16:26:48.345281",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.563989",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Payment",

View File

@@ -25,8 +25,14 @@ frappe.ui.form.on("Payment Tool", "onload", function(frm) {
});
frm.set_query("against_voucher_type", "vouchers", function() {
if (frm.doc.party_type=="Customer") {
var doctypes = ["Sales Order", "Sales Invoice", "Journal Entry"];
} else {
var doctypes = ["Purchase Order", "Purchase Invoice", "Journal Entry"];
}
return {
filters: {"name": ["in", ["Sales Invoice", "Purchase Invoice", "Journal Entry", "Sales Order", "Purchase Order"]]}
filters: { "name": ["in", doctypes] }
};
});
});
@@ -55,6 +61,25 @@ frappe.ui.form.on("Payment Tool", "party", function(frm) {
}
})
frappe.ui.form.on("Payment Tool", "party_account", function(frm) {
if(frm.doc.party_account) {
frm.call({
method: "frappe.client.get_value",
args: {
doctype: "Account",
fieldname: "account_currency",
filters: { name: frm.doc.party_account },
},
callback: function(r, rt) {
if(r.message) {
frm.set_value("party_account_currency", r.message.account_currency);
erpnext.payment_tool.check_mandatory_to_set_button(frm);
}
}
});
}
})
frappe.ui.form.on("Payment Tool", "company", function(frm) {
erpnext.payment_tool.check_mandatory_to_set_button(frm);
});
@@ -63,10 +88,6 @@ frappe.ui.form.on("Payment Tool", "received_or_paid", function(frm) {
erpnext.payment_tool.check_mandatory_to_set_button(frm);
});
frappe.ui.form.on("Payment Tool", "party", function(frm) {
erpnext.payment_tool.check_mandatory_to_set_button(frm);
});
// Fetch bank/cash account based on payment mode
frappe.ui.form.on("Payment Tool", "payment_mode", function(frm) {
return frappe.call({
@@ -75,7 +96,7 @@ frappe.ui.form.on("Payment Tool", "payment_mode", function(frm) {
"mode_of_payment": frm.doc.payment_mode,
"company": frm.doc.company
},
callback: function(r, rt) {
callback: function(r, rt) {
if(r.message) {
cur_frm.set_value("payment_account", r.message['account']);
}
@@ -120,6 +141,10 @@ frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) {
c.against_voucher_no = d.voucher_no;
c.total_amount = d.invoice_amount;
c.outstanding_amount = d.outstanding_amount;
if (frm.doc.set_payment_amount) {
c.payment_amount = d.outstanding_amount;
}
});
}
refresh_field("vouchers");
@@ -130,41 +155,63 @@ frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) {
});
// validate against_voucher_type
frappe.ui.form.on("Payment Tool Detail", "against_voucher_type", function(frm) {
erpnext.payment_tool.validate_against_voucher(frm);
frappe.ui.form.on("Payment Tool Detail", "against_voucher_type", function(frm, cdt, cdn) {
var row = frappe.model.get_doc(cdt, cdn);
erpnext.payment_tool.validate_against_voucher(frm, row);
});
erpnext.payment_tool.validate_against_voucher = function(frm) {
$.each(frm.doc.vouchers || [], function(i, row) {
erpnext.payment_tool.validate_against_voucher = function(frm, row) {
var _validate = function(i, row) {
if (!row.against_voucher_type) {
return;
}
if(frm.doc.party_type=="Customer"
&& !in_list(["Sales Order", "Sales Invoice", "Journal Entry"], row.against_voucher_type)) {
frappe.model.set_value(row.doctype, row.name, "against_voucher_type", "");
frappe.throw(__("Against Voucher Type must be one of Sales Order, Sales Invoice or Journal Entry"))
frappe.msgprint(__("Against Voucher Type must be one of Sales Order, Sales Invoice or Journal Entry"));
return false;
}
if(frm.doc.party_type=="Supplier"
&& !in_list(["Purchase Order", "Purchase Invoice", "Journal Entry"], row.against_voucher_type)) {
frappe.model.set_value(row.doctype, row.name, "against_voucher_type", "");
frappe.throw(__("Against Voucher Type must be one of Purchase Order, Purchase Invoice or Journal Entry"))
frappe.msgprint(__("Against Voucher Type must be one of Purchase Order, Purchase Invoice or Journal Entry"));
return false;
}
});
}
if (row) {
_validate(0, row);
} else {
$.each(frm.doc.vouchers || [], _validate);
}
}
// validate against_voucher_type
frappe.ui.form.on("Payment Tool Detail", "against_voucher_no", function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
if (!row.against_voucher_no) {
return;
}
frappe.call({
method: 'erpnext.accounts.doctype.payment_tool.payment_tool.get_against_voucher_amount',
args: {
"against_voucher_type": row.against_voucher_type,
"against_voucher_no": row.against_voucher_no
"against_voucher_no": row.against_voucher_no,
"party_account": frm.doc.party_account,
"company": frm.doc.company
},
callback: function(r) {
if(!r.exc) {
$.each(r.message, function(k, v) {
frappe.model.set_value(cdt, cdn, k, v);
});
frappe.model.set_value(cdt, cdn, "payment_amount", r.message.outstanding_amount);
}
}
});
@@ -187,7 +234,7 @@ erpnext.payment_tool.set_total_payment_amount = function(frm) {
} else {
if(row.payment_amount < 0)
msgprint(__("Row {0}: Payment amount can not be negative", [row.idx]));
else if(row.payment_amount >= row.outstanding_amount)
else if(row.payment_amount > row.outstanding_amount)
msgprint(__("Row {0}: Payment Amount cannot be greater than Outstanding Amount", [__(row.idx)]));
frappe.model.set_value(row.doctype, row.name, "payment_amount", 0.0);

View File

@@ -106,7 +106,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break 1",
"label": "",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -162,6 +162,51 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "party_account_currency",
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Party Account Currency",
"no_copy": 1,
"options": "Currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "set_payment_amount",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Set Payment Amount = Outstanding Amount",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -306,6 +351,7 @@
"in_list_view": 0,
"label": "Total Payment Amount",
"no_copy": 0,
"options": "party_account_currency",
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
@@ -450,7 +496,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"modified": "2015-06-05 11:17:33.843334",
"modified": "2015-10-01 09:43:24.199025",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Tool",

View File

@@ -3,10 +3,12 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe import _, scrub
from frappe.utils import flt
from frappe.model.document import Document
import json
from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.doctype.journal_entry.journal_entry import get_exchange_rate
class PaymentTool(Document):
def make_journal_entry(self):
@@ -18,7 +20,15 @@ class PaymentTool(Document):
jv.company = self.company
jv.cheque_no = self.reference_no
jv.cheque_date = self.reference_date
party_account_currency, party_account_type = frappe.db.get_value("Account", self.party_account,
["account_currency", "account_type"])
bank_account_currency, bank_account_type = None, None
if self.payment_account:
bank_account_currency, bank_account_type = frappe.db.get_value("Account", self.payment_account,
["account_currency", "account_type"])
if not self.total_payment_amount:
frappe.throw(_("Please enter Payment Amount in atleast one row"))
@@ -26,24 +36,56 @@ class PaymentTool(Document):
if not frappe.db.get_value(v.against_voucher_type, {"name": v.against_voucher_no}):
frappe.throw(_("Row {0}: {1} is not a valid {2}").format(v.idx, v.against_voucher_no,
v.against_voucher_type))
if v.payment_amount:
exchange_rate = get_exchange_rate(self.party_account, party_account_currency,
self.company, v.against_voucher_type, v.against_voucher_no)
d1 = jv.append("accounts")
d1.account = self.party_account
d1.party_type = self.party_type
d1.party = self.party
d1.account_currency = party_account_currency
d1.account_type = party_account_type
d1.balance = get_balance_on(self.party_account)
d1.set("debit" if self.received_or_paid=="Paid" else "credit", flt(v.payment_amount))
d1.set("reference_type", v.against_voucher_type)
d1.set("reference_name", v.against_voucher_no)
d1.set('is_advance', 'Yes' if v.against_voucher_type in ['Sales Order', 'Purchase Order'] else 'No')
total_payment_amount = flt(total_payment_amount) + flt(d1.debit) - flt(d1.credit)
d1.party_balance = get_balance_on(party=self.party, party_type=self.party_type)
d1.exchange_rate = exchange_rate
d1.set("debit_in_account_currency" if self.received_or_paid=="Paid" \
else "credit_in_account_currency", flt(v.payment_amount))
d1.reference_type = v.against_voucher_type
d1.reference_name = v.against_voucher_no
d1.is_advance = 'Yes' \
if v.against_voucher_type in ['Sales Order', 'Purchase Order'] else 'No'
amount = flt(d1.debit_in_account_currency) - flt(d1.credit_in_account_currency)
if bank_account_currency == party_account_currency:
total_payment_amount += amount
else:
total_payment_amount += amount*exchange_rate
d2 = jv.append("accounts")
d2.account = self.payment_account
d2.set('debit' if total_payment_amount < 0 else 'credit', abs(total_payment_amount))
if self.payment_account:
d2.balance = get_balance_on(self.payment_account)
bank_account_currency, bank_account_type = frappe.db.get_value("Account", self.payment_account,
["account_currency", "account_type"])
d2.account = self.payment_account
d2.account_currency = bank_account_currency
d2.account_type = bank_account_type
d2.exchange_rate = get_exchange_rate(self.payment_account, self.company)
d2.account_balance = get_balance_on(self.payment_account)
amount_field_bank = 'debit_in_account_currency' if total_payment_amount < 0 \
else 'credit_in_account_currency'
d2.set(amount_field_bank, abs(total_payment_amount))
company_currency = frappe.db.get_value("Company", self.company, "default_currency")
if party_account_currency != company_currency or \
(bank_account_currency and bank_account_currency != company_currency):
jv.multi_currency = 1
jv.set_amounts_in_company_currency()
jv.set_total_debit_credit()
return jv.as_dict()
@@ -56,39 +98,47 @@ def get_outstanding_vouchers(args):
args = json.loads(args)
if args.get("party_type") == "Customer" and args.get("received_or_paid") == "Received":
amount_query = "ifnull(debit, 0) - ifnull(credit, 0)"
elif args.get("party_type") == "Supplier" and args.get("received_or_paid") == "Paid":
amount_query = "ifnull(credit, 0) - ifnull(debit, 0)"
else:
party_account_currency = get_account_currency(args.get("party_account"))
company_currency = frappe.db.get_value("Company", args.get("company"), "default_currency")
if ((args.get("party_type") == "Customer" and args.get("received_or_paid") == "Paid")
or (args.get("party_type") == "Supplier" and args.get("received_or_paid") == "Received")):
frappe.throw(_("Please enter the Against Vouchers manually"))
# Get all outstanding sales /purchase invoices
outstanding_invoices = get_outstanding_invoices(amount_query, args.get("party_account"),
args.get("party_type"), args.get("party"))
outstanding_invoices = get_outstanding_invoices(args.get("party_type"), args.get("party"), args.get("party_account"))
# Get all SO / PO which are not fully billed or aginst which full advance not paid
orders_to_be_billed = get_orders_to_be_billed(args.get("party_type"), args.get("party"))
orders_to_be_billed = get_orders_to_be_billed(args.get("party_type"), args.get("party"),
party_account_currency, company_currency)
return outstanding_invoices + orders_to_be_billed
def get_orders_to_be_billed(party_type, party):
def get_orders_to_be_billed(party_type, party, party_account_currency, company_currency):
voucher_type = 'Sales Order' if party_type == "Customer" else 'Purchase Order'
ref_field = "base_grand_total" if party_account_currency == company_currency else "grand_total"
orders = frappe.db.sql("""
select
name as voucher_no,
ifnull(base_grand_total, 0) as invoice_amount,
(ifnull(base_grand_total, 0) - ifnull(advance_paid, 0)) as outstanding_amount,
{ref_field} as invoice_amount,
({ref_field} - advance_paid) as outstanding_amount,
transaction_date as posting_date
from
`tab%s`
`tab{voucher_type}`
where
%s = %s
{party_type} = %s
and docstatus = 1
and ifnull(status, "") != "Stopped"
and ifnull(base_grand_total, 0) > ifnull(advance_paid, 0)
and abs(100 - ifnull(per_billed, 0)) > 0.01
""" % (voucher_type, 'customer' if party_type == "Customer" else 'supplier', '%s'),
party, as_dict = True)
and {ref_field} > advance_paid
and abs(100 - per_billed) > 0.01
""".format(**{
"ref_field": ref_field,
"voucher_type": voucher_type,
"party_type": scrub(party_type)
}), party, as_dict = True)
order_list = []
for d in orders:
@@ -98,15 +148,21 @@ def get_orders_to_be_billed(party_type, party):
return order_list
@frappe.whitelist()
def get_against_voucher_amount(against_voucher_type, against_voucher_no):
def get_against_voucher_amount(against_voucher_type, against_voucher_no, party_account, company):
party_account_currency = get_account_currency(party_account)
company_currency = frappe.db.get_value("Company", company, "default_currency")
ref_field = "base_grand_total" if party_account_currency == company_currency else "grand_total"
if against_voucher_type in ["Sales Order", "Purchase Order"]:
select_cond = "base_grand_total as total_amount, ifnull(base_grand_total, 0) - ifnull(advance_paid, 0) as outstanding_amount"
select_cond = "{0} as total_amount, {0} - advance_paid as outstanding_amount"\
.format(ref_field)
elif against_voucher_type in ["Sales Invoice", "Purchase Invoice"]:
select_cond = "base_grand_total as total_amount, outstanding_amount"
select_cond = "{0} as total_amount, outstanding_amount".format(ref_field)
elif against_voucher_type == "Journal Entry":
select_cond = "total_debit as total_amount"
ref_field = "total_debit" if party_account_currency == company_currency else "total_debit/exchange_rate"
select_cond = "{0} as total_amount".format(ref_field)
details = frappe.db.sql("""select {0} from `tab{1}` where name = %s"""
.format(select_cond, against_voucher_type), against_voucher_no, as_dict=1)
.format(select_cond, frappe.db.escape(against_voucher_type)), against_voucher_no, as_dict=1)
return details[0] if details else {}

View File

@@ -39,7 +39,7 @@ class TestPaymentTool(unittest.TestCase):
"party": "_Test Customer 3",
"reference_type": "Sales Order",
"reference_name": so2.name,
"credit": 1000,
"credit_in_account_currency": 1000,
"is_advance": "Yes"
})
@@ -67,7 +67,7 @@ class TestPaymentTool(unittest.TestCase):
"party": "_Test Customer 3",
"reference_type": si2.doctype,
"reference_name": si2.name,
"credit": 561.80
"credit_in_account_currency": 561.80
})
pi = self.create_voucher(pi_test_records[0], {
@@ -91,7 +91,7 @@ class TestPaymentTool(unittest.TestCase):
"party": "_Test Customer 3",
"party_account": "_Test Receivable - _TC",
"payment_mode": "Cheque",
"payment_account": "_Test Account Bank Account - _TC",
"payment_account": "_Test Bank - _TC",
"reference_no": "123456",
"reference_date": "2013-02-14"
}
@@ -117,10 +117,10 @@ class TestPaymentTool(unittest.TestCase):
def create_against_jv(self, test_record, args):
jv = frappe.copy_doc(test_record)
jv.get("accounts")[0].update(args)
if args.get("debit"):
jv.get("accounts")[1].credit = args["debit"]
elif args.get("credit"):
jv.get("accounts")[1].debit = args["credit"]
if args.get("debit_in_account_currency"):
jv.get("accounts")[1].credit_in_account_currency = args["debit_in_account_currency"]
elif args.get("credit_in_account_currency"):
jv.get("accounts")[1].debit_in_account_currency = args["credit_in_account_currency"]
jv.insert()
jv.submit()
@@ -141,7 +141,8 @@ class TestPaymentTool(unittest.TestCase):
outstanding_entries = get_outstanding_vouchers(json.dumps(args))
for d in outstanding_entries:
self.assertEquals(flt(d.get("outstanding_amount"), 2), expected_outstanding.get(d.get("voucher_type"))[1])
self.assertEquals(flt(d.get("outstanding_amount"), 2),
expected_outstanding.get(d.get("voucher_type"))[1])
self.check_jv_entries(doc, outstanding_entries, expected_outstanding)
@@ -156,11 +157,10 @@ class TestPaymentTool(unittest.TestCase):
paytool.total_payment_amount = 300
new_jv = paytool.make_journal_entry()
for jv_entry in new_jv.get("accounts"):
if paytool.party_account == jv_entry.get("account") and paytool.party == jv_entry.get("party"):
self.assertEquals(100.00,
jv_entry.get("debit" if paytool.party_type=="Supplier" else "credit"))
self.assertEquals(100.00, jv_entry.get("debit_in_account_currency"
if paytool.party_type=="Supplier" else "credit_in_account_currency"))
self.assertEquals(jv_entry.reference_name,
expected_outstanding[jv_entry.reference_type][0])
@@ -170,4 +170,6 @@ class TestPaymentTool(unittest.TestCase):
def clear_table_entries(self):
frappe.db.sql("""delete from `tabGL Entry` where party in ("_Test Customer 3", "_Test Supplier 1")""")
frappe.db.sql("""delete from `tabSales Order` where customer = "_Test Customer 3" """)
frappe.db.sql("""delete from `tabSales Invoice` where customer = "_Test Customer 3" """)
frappe.db.sql("""delete from `tabPurchase Order` where supplier = "_Test Supplier 1" """)
frappe.db.sql("""delete from `tabPurchase Invoice` where supplier = "_Test Supplier 1" """)

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Against Voucher Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Against Voucher No",
"length": 0,
"no_copy": 0,
"options": "against_voucher_type",
"permlevel": 0,
@@ -64,6 +66,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -86,7 +89,9 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Total Amount",
"length": 0,
"no_copy": 0,
"options": "party_account_currency",
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
@@ -107,7 +112,9 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Outstanding Amount",
"length": 0,
"no_copy": 0,
"options": "party_account_currency",
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
@@ -128,7 +135,9 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Payment Amount",
"length": 0,
"no_copy": 0,
"options": "party_account_currency",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
@@ -146,7 +155,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2014-09-11 08:55:34.384017",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.626386",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Tool Detail",

View File

@@ -10,12 +10,12 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
// ***************** Get Account Head *****************
cur_frm.fields_dict['closing_account_head'].get_query = function(doc, cdt, cdn) {
return{
filters:{
"company": doc.company,
"report_type": "Balance Sheet",
"freeze_account": "No",
"is_group": 0
}
return {
filters: [
['Account', 'company', '=', doc.company],
['Account', 'is_group', '=', '0'],
['Account', 'freeze_account', '=', 'No'],
['Account', 'root_type', 'in', 'Liability, Equity']
]
}
}

View File

@@ -18,6 +18,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
@@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Transaction Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "transaction_date",
"oldfieldtype": "Date",
@@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Posting Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "posting_date",
"oldfieldtype": "Date",
@@ -87,6 +90,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Closing Fiscal Year",
"length": 0,
"no_copy": 0,
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
@@ -111,6 +115,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
@@ -135,6 +140,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Select",
@@ -158,6 +164,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
@@ -181,6 +188,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Closing Account Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "closing_account_head",
"oldfieldtype": "Link",
@@ -194,29 +202,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "coa_help",
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "CoA Help",
"no_copy": 0,
"oldfieldtype": "HTML",
"options": "<a href=\"#!Accounts Browser/Account\">To manage Account Head, click here</a>",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -228,6 +213,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Remarks",
"length": 0,
"no_copy": 0,
"oldfieldname": "remarks",
"oldfieldtype": "Small Text",
@@ -250,7 +236,8 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-02-05 05:11:42.268561",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.671436",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Period Closing Voucher",

View File

@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
from erpnext.accounts.utils import get_account_currency
from erpnext.controllers.accounts_controller import AccountsController
class PeriodClosingVoucher(AccountsController):
@@ -20,51 +21,75 @@ class PeriodClosingVoucher(AccountsController):
where voucher_type = 'Period Closing Voucher' and voucher_no=%s""", self.name)
def validate_account_head(self):
if frappe.db.get_value("Account", self.closing_account_head, "report_type") \
!= "Balance Sheet":
frappe.throw(_("Closing Account {0} must be of type 'Liability'").format(self.closing_account_head))
closing_account_type = frappe.db.get_value("Account", self.closing_account_head, "root_type")
if closing_account_type not in ["Liability", "Equity"]:
frappe.throw(_("Closing Account {0} must be of type Liability / Equity")
.format(self.closing_account_head))
account_currency = get_account_currency(self.closing_account_head)
company_currency = frappe.db.get_value("Company", self.company, "default_currency")
if account_currency != company_currency:
frappe.throw(_("Currency of the Closing Account must be {0}").format(company_currency))
def validate_posting_date(self):
from erpnext.accounts.utils import get_fiscal_year
from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year
validate_fiscal_year(self.posting_date, self.fiscal_year, label=_("Posting Date"), doc=self)
self.year_start_date = get_fiscal_year(self.posting_date, self.fiscal_year)[1]
pce = frappe.db.sql("""select name from `tabPeriod Closing Voucher`
where posting_date > %s and fiscal_year = %s and docstatus = 1""",
(self.posting_date, self.fiscal_year))
if pce and pce[0][0]:
frappe.throw(_("Another Period Closing Entry {0} has been made after {1}").format(pce[0][0], self.posting_date))
def get_pl_balances(self):
"""Get balance for pl accounts"""
return frappe.db.sql("""
select t1.account, sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) as balance
from `tabGL Entry` t1, `tabAccount` t2
where t1.account = t2.name and ifnull(t2.report_type, '') = 'Profit and Loss'
and t2.docstatus < 2 and t2.company = %s
and t1.posting_date between %s and %s
group by t1.account
""", (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)
frappe.throw(_("Another Period Closing Entry {0} has been made after {1}")
.format(pce[0][0], self.posting_date))
def make_gl_entries(self):
gl_entries = []
net_pl_balance = 0
pl_accounts = self.get_pl_balances()
for acc in pl_accounts:
if flt(acc.balance):
if flt(acc.balance_in_company_currency):
gl_entries.append(self.get_gl_dict({
"account": acc.account,
"debit": abs(flt(acc.balance)) if flt(acc.balance) < 0 else 0,
"credit": abs(flt(acc.balance)) if flt(acc.balance) > 0 else 0,
"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
}))
net_pl_balance += flt(acc.balance)
net_pl_balance += flt(acc.balance_in_company_currency)
if net_pl_balance:
gl_entries.append(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
}))
from erpnext.accounts.general_ledger import make_gl_entries
make_gl_entries(gl_entries)
def get_pl_balances(self):
"""Get balance for pl accounts"""
return frappe.db.sql("""
select
t1.account, t2.account_currency,
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
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
and t1.posting_date between %s and %s
group by t1.account
""", (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)

View File

@@ -5,47 +5,79 @@
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import flt
from frappe.utils import flt, today
from erpnext.accounts.utils import get_fiscal_year
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
class TestPeriodClosingVoucher(unittest.TestCase):
def test_closing_entry(self):
make_journal_entry("_Test Account Bank Account - _TC", "Sales - _TC", 400,
year_start_date = get_fiscal_year(today())[1]
make_journal_entry("_Test Bank - _TC", "Sales - _TC", 400,
"_Test Cost Center - _TC", submit=True)
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", 600, "_Test Cost Center - _TC", submit=True)
profit_or_loss = frappe.db.sql("""select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) as balance
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", 600, "_Test Cost Center - _TC", submit=True)
random_expense_account = frappe.db.sql("""
select t1.account,
sum(t1.debit) - sum(t1.credit) as balance,
sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) \
as balance_in_account_currency
from `tabGL Entry` t1, `tabAccount` t2
where t1.account = t2.name and ifnull(t2.report_type, '') = 'Profit and Loss'
where t1.account = t2.name and t2.root_type = 'Expense'
and t2.docstatus < 2 and t2.company = '_Test Company'
and t1.posting_date between %s and %s
group by t1.account
having sum(t1.debit) > sum(t1.credit)
limit 1""", (year_start_date, today()), as_dict=True)
profit_or_loss = frappe.db.sql("""select sum(t1.debit) - sum(t1.credit) as balance
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 = '_Test Company'
and t1.posting_date between '2013-01-01' and '2013-12-31'""")
and t1.posting_date between %s and %s""", (year_start_date, today()))
profit_or_loss = flt(profit_or_loss[0][0]) if profit_or_loss else 0
pcv = self.make_period_closing_voucher()
gle_value = frappe.db.sql("""select ifnull(debit, 0) - ifnull(credit, 0)
# Check value for closing account
gle_amount_for_closing_account = frappe.db.sql("""select debit - credit
from `tabGL Entry` where voucher_type='Period Closing Voucher' and voucher_no=%s
and account = '_Test Account Reserves and Surplus - _TC'""", pcv.name)
gle_value = flt(gle_value[0][0]) if gle_value else 0
self.assertEqual(gle_value, profit_or_loss)
gle_amount_for_closing_account = flt(gle_amount_for_closing_account[0][0]) \
if gle_amount_for_closing_account else 0
self.assertEqual(gle_amount_for_closing_account, profit_or_loss)
if random_expense_account:
# Check posted value for teh above random_expense_account
gle_for_random_expense_account = frappe.db.sql("""
select debit - credit as amount,
debit_in_account_currency - credit_in_account_currency
as amount_in_account_currency
from `tabGL Entry`
where voucher_type='Period Closing Voucher' and voucher_no=%s and account =%s""",
(pcv.name, random_expense_account[0].account), as_dict=True)
self.assertEqual(gle_for_random_expense_account[0].amount, -1*random_expense_account[0].balance)
self.assertEqual(gle_for_random_expense_account[0].amount_in_account_currency,
-1*random_expense_account[0].balance_in_account_currency)
def make_period_closing_voucher(self):
pcv = frappe.get_doc({
"doctype": "Period Closing Voucher",
"closing_account_head": "_Test Account Reserves and Surplus - _TC",
"company": "_Test Company",
"fiscal_year": "_Test Fiscal Year 2013",
"posting_date": "2013-12-31",
"fiscal_year": get_fiscal_year(today())[0],
"posting_date": today(),
"remarks": "test"
})
pcv.insert()
pcv.submit()
return pcv

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Applicable for User",
"length": 0,
"no_copy": 0,
"oldfieldname": "user",
"oldfieldtype": "Link",
@@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Series",
"length": 0,
"no_copy": 1,
"oldfieldname": "naming_series",
"oldfieldtype": "Select",
@@ -67,6 +69,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse",
"length": 0,
"no_copy": 0,
"oldfieldname": "warehouse",
"oldfieldtype": "Link",
@@ -93,6 +96,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Update Stock",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -113,6 +117,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -135,6 +140,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Customer",
"length": 0,
"no_copy": 0,
"oldfieldname": "customer_account",
"oldfieldtype": "Link",
@@ -159,6 +165,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Link",
@@ -183,6 +190,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Currency",
"length": 0,
"no_copy": 0,
"oldfieldname": "currency",
"oldfieldtype": "Select",
@@ -207,6 +215,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Mode of Payment",
"length": 0,
"no_copy": 0,
"options": "Mode of Payment",
"permlevel": 0,
@@ -229,6 +238,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -251,6 +261,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Print Format",
"length": 0,
"no_copy": 0,
"options": "Print Format",
"permlevel": 0,
@@ -274,6 +285,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Letter Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "letter_head",
"oldfieldtype": "Select",
@@ -298,6 +310,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Print Heading",
"length": 0,
"no_copy": 0,
"oldfieldname": "select_print_heading",
"oldfieldtype": "Select",
@@ -322,6 +335,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Terms and Conditions",
"length": 0,
"no_copy": 0,
"oldfieldname": "tc_name",
"oldfieldtype": "Link",
@@ -345,6 +359,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
@@ -368,6 +383,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Territory",
"length": 0,
"no_copy": 0,
"oldfieldname": "territory",
"oldfieldtype": "Link",
@@ -392,6 +408,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Price List",
"length": 0,
"no_copy": 0,
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
@@ -415,6 +432,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -437,6 +455,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Write Off Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
@@ -460,6 +479,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Write Off Cost Center",
"length": 0,
"no_copy": 0,
"options": "Cost Center",
"permlevel": 0,
@@ -483,6 +503,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Taxes and Charges",
"length": 0,
"no_copy": 0,
"oldfieldname": "charge",
"oldfieldtype": "Link",
@@ -506,6 +527,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -528,6 +550,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Cash/Bank Account",
"length": 0,
"no_copy": 0,
"oldfieldname": "cash_bank_account",
"oldfieldtype": "Link",
@@ -552,6 +575,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Income Account",
"length": 0,
"no_copy": 0,
"oldfieldname": "income_account",
"oldfieldtype": "Link",
@@ -577,6 +601,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Expense Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
@@ -599,6 +624,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
@@ -622,7 +648,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-08-18 17:49:09.098876",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.741253",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
@@ -650,7 +677,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,

View File

@@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -41,7 +42,8 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
"no_copy": 0,
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Apply On",
"length": 0,
"no_copy": 0,
"options": "\nItem Code\nItem Group\nBrand",
"permlevel": 0,
@@ -87,6 +90,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Item Code",
"length": 0,
"no_copy": 0,
"options": "Item",
"permlevel": 0,
@@ -110,6 +114,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Brand",
"length": 0,
"no_copy": 0,
"options": "Brand",
"permlevel": 0,
@@ -133,6 +138,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Item Group",
"length": 0,
"no_copy": 0,
"options": "Item Group",
"permlevel": 0,
@@ -154,6 +160,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -177,6 +184,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Priority",
"length": 0,
"no_copy": 0,
"options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20",
"permlevel": 0,
@@ -199,6 +207,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Disable",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -219,6 +228,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -241,6 +251,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Selling",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -262,6 +273,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Buying",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -282,6 +294,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -305,6 +318,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Applicable For",
"length": 0,
"no_copy": 0,
"options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type",
"permlevel": 0,
@@ -328,6 +342,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Customer",
"length": 0,
"no_copy": 0,
"options": "Customer",
"permlevel": 0,
@@ -351,6 +366,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Group",
"length": 0,
"no_copy": 0,
"options": "Customer Group",
"permlevel": 0,
@@ -374,6 +390,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Territory",
"length": 0,
"no_copy": 0,
"options": "Territory",
"permlevel": 0,
@@ -397,6 +414,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Partner",
"length": 0,
"no_copy": 0,
"options": "Sales Partner",
"permlevel": 0,
@@ -420,6 +438,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Campaign",
"length": 0,
"no_copy": 0,
"options": "Campaign",
"permlevel": 0,
@@ -443,6 +462,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier",
"length": 0,
"no_copy": 0,
"options": "Supplier",
"permlevel": 0,
@@ -466,6 +486,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier Type",
"length": 0,
"no_copy": 0,
"options": "Supplier Type",
"permlevel": 0,
@@ -487,6 +508,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -509,6 +531,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Min Qty",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -529,6 +552,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -551,6 +575,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Max Qty",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -571,6 +596,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -594,6 +620,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Valid From",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -615,6 +642,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Valid Upto",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -635,6 +663,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -656,6 +685,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
@@ -678,6 +708,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -700,6 +731,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Price or Discount",
"length": 0,
"no_copy": 0,
"options": "\nPrice\nDiscount Percentage",
"permlevel": 0,
@@ -721,6 +753,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -743,6 +776,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Price",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -765,6 +799,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Discount on Price List Rate (%)",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -787,6 +822,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "For Price List",
"length": 0,
"no_copy": 0,
"options": "Price List",
"permlevel": 0,
@@ -809,6 +845,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"options": "Simple",
"permlevel": 0,
@@ -831,6 +868,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Pricing Rule Help",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -851,7 +889,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-08-13 14:58:29.194326",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.958974",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",

View File

@@ -59,7 +59,7 @@ class PricingRule(Document):
self.set(f, None)
def validate_price_or_discount(self):
for field in ["Price", "Discount Percentage"]:
for field in ["Price"]:
if flt(self.get(frappe.scrub(field))) < 0:
throw(_("{0} can not be negative").format(field))
@@ -168,14 +168,18 @@ def get_pricing_rules(args):
field = frappe.scrub(parenttype)
condition = ""
if args.get(field):
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
try:
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
except TypeError:
frappe.throw(_("Invalid {0}").format(args[field]))
parent_groups = frappe.db.sql_list("""select name from `tab%s`
where lft<=%s and rgt>=%s""" % (parenttype, '%s', '%s'), (lft, rgt))
if parent_groups:
if allow_blank: parent_groups.append('')
condition = " ifnull("+field+", '') in ('" + \
"', '".join([d.replace("'", "\\'").replace('"', '\\"') for d in parent_groups])+"')"
"', '".join([frappe.db.escape(d) for d in parent_groups])+"')"
return condition
@@ -202,8 +206,8 @@ def get_pricing_rules(args):
return frappe.db.sql("""select * from `tabPricing Rule`
where (item_code=%(item_code)s {item_group_condition} or brand=%(brand)s)
and docstatus < 2 and ifnull(disable, 0) = 0
and ifnull({transaction_type}, 0) = 1 {conditions}
and docstatus < 2 and disable = 0
and {transaction_type} = 1 {conditions}
order by priority desc, name desc""".format(
item_group_condition=item_group_condition,
transaction_type=args.transaction_type, conditions=conditions), args, as_dict=1)

View File

@@ -24,7 +24,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
if(!doc.is_return) {
if(doc.docstatus==1) {
if(doc.outstanding_amount > 0) {
if(doc.outstanding_amount != 0) {
this.frm.add_custom_button(__('Payment'), this.make_bank_entry).addClass("btn-primary");
}
cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note);
@@ -38,7 +38,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
get_query_filters: {
supplier: cur_frm.doc.supplier || undefined,
docstatus: 1,
status: ["!=", "Stopped"],
status: ["not in", ["Stopped", "Closed"]],
per_billed: ["<", 99.99],
company: cur_frm.doc.company
}
@@ -52,6 +52,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
get_query_filters: {
supplier: cur_frm.doc.supplier || undefined,
docstatus: 1,
status: ["!=", "Closed"],
company: cur_frm.doc.company
}
})
@@ -75,8 +76,29 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
me.apply_pricing_rule();
})
},
credit_to: function() {
var me = this;
if(this.frm.doc.credit_to) {
me.frm.call({
method: "frappe.client.get_value",
args: {
doctype: "Account",
fieldname: "account_currency",
filters: { name: me.frm.doc.credit_to },
},
callback: function(r, rt) {
if(r.message) {
me.frm.set_value("party_account_currency", r.message.account_currency);
me.set_dynamic_labels();
}
}
});
}
},
write_off_amount: function() {
this.set_in_company_currency(this.frm.doc, ["write_off_amount"]);
this.calculate_outstanding_amount();
this.frm.refresh_fields();
},
@@ -114,9 +136,10 @@ cur_frm.script_manager.make(erpnext.accounts.PurchaseInvoice);
cur_frm.cscript.make_bank_entry = function() {
return frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_from_purchase_invoice",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_against_invoice",
args: {
"purchase_invoice": cur_frm.doc.name,
"dt": "Purchase Invoice",
"dn": cur_frm.doc.name
},
callback: function(r) {
var doclist = frappe.model.sync(r.message);

View File

@@ -10,6 +10,7 @@ import frappe.defaults
from erpnext.controllers.buying_controller import BuyingController
from erpnext.accounts.party import get_party_account, get_due_date
from erpnext.accounts.utils import get_account_currency
form_grid_templates = {
"items": "templates/form_grid/item_grid.html"
@@ -47,7 +48,7 @@ class PurchaseInvoice(BuyingController):
self.check_conversion_rate()
self.validate_credit_to_acc()
self.clear_unallocated_advances("Purchase Invoice Advance", "advances")
self.check_for_stopped_status()
self.check_for_stopped_or_closed_status()
self.validate_with_previous_doc()
self.validate_uom_is_integer("uom", "qty")
self.set_against_expense_account()
@@ -66,7 +67,7 @@ class PurchaseInvoice(BuyingController):
def set_missing_values(self, for_validate=False):
if not self.credit_to:
self.credit_to = get_party_account(self.company, self.supplier, "Supplier")
self.credit_to = get_party_account("Supplier", self.supplier, self.company)
if not self.due_date:
self.due_date = get_due_date(self.posting_date, "Supplier", self.supplier, self.company)
@@ -75,7 +76,7 @@ class PurchaseInvoice(BuyingController):
def get_advances(self):
if not self.is_return:
super(PurchaseInvoice, self).get_advances(self.credit_to, "Supplier", self.supplier,
"Purchase Invoice Advance", "advances", "debit", "purchase_order")
"Purchase Invoice Advance", "advances", "debit_in_account_currency", "purchase_order")
def check_active_purchase_items(self):
for d in self.get('items'):
@@ -91,7 +92,8 @@ class PurchaseInvoice(BuyingController):
throw(_("Conversion rate cannot be 0 or 1"))
def validate_credit_to_acc(self):
account = frappe.db.get_value("Account", self.credit_to, ["account_type", "report_type"], as_dict=True)
account = frappe.db.get_value("Account", self.credit_to,
["account_type", "report_type", "account_currency"], as_dict=True)
if account.report_type != "Balance Sheet":
frappe.throw(_("Credit To account must be a Balance Sheet account"))
@@ -99,14 +101,16 @@ class PurchaseInvoice(BuyingController):
if self.supplier and account.account_type != "Payable":
frappe.throw(_("Credit To account must be a Payable account"))
def check_for_stopped_status(self):
self.party_account_currency = account.account_currency
def check_for_stopped_or_closed_status(self):
check_list = []
pc_obj = frappe.get_doc('Purchase Common')
for d in self.get('items'):
if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
check_list.append(d.purchase_order)
stopped = frappe.db.sql("select name from `tabPurchase Order` where status = 'Stopped' and name = %s", d.purchase_order)
if stopped:
throw(_("Purchase Order {0} is 'Stopped'").format(d.purchase_order))
pc_obj.check_for_stopped_or_closed_status('Purchase Order', d.purchase_order)
def validate_with_previous_doc(self):
super(PurchaseInvoice, self).validate_with_previous_doc({
@@ -146,10 +150,14 @@ class PurchaseInvoice(BuyingController):
against_accounts = []
stock_items = self.get_stock_items()
for item in self.get("items"):
# in case of auto inventory accounting,
# against expense account is always "Stock Received But Not Billed"
# for a stock item and if not epening entry and not drop-ship entry
if auto_accounting_for_stock and item.item_code in stock_items \
and self.is_opening == 'No':
# in case of auto inventory accounting, against expense account is always
# Stock Received But Not Billed for a stock item
and self.is_opening == 'No' and (not item.po_detail or
not frappe.db.get_value("Purchase Order Item", item.po_detail, "delivered_by_supplier")):
item.expense_account = stock_not_billed_account
item.cost_center = None
@@ -172,9 +180,10 @@ class PurchaseInvoice(BuyingController):
throw(_("Purchse Order number required for Item {0}").format(d.item_code))
def pr_required(self):
stock_items = self.get_stock_items()
if frappe.db.get_value("Buying Settings", None, "pr_required") == 'Yes':
for d in self.get('items'):
if not d.purchase_receipt:
if not d.purchase_receipt and d.item_code in stock_items:
throw(_("Purchase Receipt number required for Item {0}").format(d.item_code))
def validate_write_off_account(self):
@@ -213,7 +222,7 @@ class PurchaseInvoice(BuyingController):
'party_type': 'Supplier',
'party': self.supplier,
'is_advance' : 'Yes',
'dr_or_cr' : 'debit',
'dr_or_cr' : 'debit_in_account_currency',
'unadjusted_amt' : flt(d.advance_amount),
'allocated_amt' : flt(d.allocated_amount)
}
@@ -257,26 +266,32 @@ class PurchaseInvoice(BuyingController):
"party_type": "Supplier",
"party": self.supplier,
"against": self.against_expense_account,
"credit": self.total_amount_to_pay,
"remarks": self.remarks,
"credit": self.base_grand_total,
"credit_in_account_currency": self.base_grand_total \
if self.party_account_currency==self.company_currency else self.grand_total,
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
})
}, self.party_account_currency)
)
# tax table gl entries
valuation_tax = {}
for tax in self.get("taxes"):
if tax.category in ("Total", "Valuation and Total") and flt(tax.base_tax_amount_after_discount_amount):
account_currency = get_account_currency(tax.account_head)
dr_or_cr = "debit" if tax.add_deduct_tax == "Add" else "credit"
gl_entries.append(
self.get_gl_dict({
"account": tax.account_head,
"against": self.supplier,
"debit": tax.add_deduct_tax == "Add" and tax.base_tax_amount_after_discount_amount or 0,
"credit": tax.add_deduct_tax == "Deduct" and tax.base_tax_amount_after_discount_amount or 0,
"remarks": self.remarks,
dr_or_cr: tax.base_tax_amount_after_discount_amount,
dr_or_cr + "_in_account_currency": tax.base_tax_amount_after_discount_amount \
if account_currency==self.company_currency \
else tax.tax_amount_after_discount_amount,
"cost_center": tax.cost_center
})
}, account_currency)
)
# accumulate valuation tax
@@ -292,36 +307,37 @@ class PurchaseInvoice(BuyingController):
stock_items = self.get_stock_items()
for item in self.get("items"):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.expense_account)
gl_entries.append(
self.get_gl_dict({
"account": item.expense_account,
"against": self.supplier,
"debit": item.base_net_amount,
"remarks": self.remarks,
"debit_in_account_currency": item.base_net_amount \
if account_currency==self.company_currency else item.net_amount,
"cost_center": item.cost_center
})
}, account_currency)
)
if auto_accounting_for_stock and self.is_opening == "No" and \
item.item_code in stock_items and item.item_tax_amount:
# Post reverse entry for Stock-Received-But-Not-Billed if it is booked in Purchase Receipt
negative_expense_booked_in_pi = None
if item.purchase_receipt:
negative_expense_booked_in_pi = frappe.db.sql("""select name from `tabGL Entry`
negative_expense_booked_in_pr = frappe.db.sql("""select name from `tabGL Entry`
where voucher_type='Purchase Receipt' and voucher_no=%s and account=%s""",
(item.purchase_receipt, expenses_included_in_valuation))
if not negative_expense_booked_in_pi:
gl_entries.append(
self.get_gl_dict({
"account": stock_received_but_not_billed,
"against": self.supplier,
"debit": flt(item.item_tax_amount, self.precision("item_tax_amount", item)),
"remarks": self.remarks or "Accounting Entry for Stock"
})
)
if not negative_expense_booked_in_pr:
gl_entries.append(
self.get_gl_dict({
"account": stock_received_but_not_billed,
"against": self.supplier,
"debit": flt(item.item_tax_amount, self.precision("item_tax_amount", item)),
"remarks": self.remarks or "Accounting Entry for Stock"
})
)
negative_expense_to_be_booked += flt(item.item_tax_amount, self.precision("item_tax_amount", item))
negative_expense_to_be_booked += flt(item.item_tax_amount, self.precision("item_tax_amount", item))
if self.is_opening == "No" and negative_expense_to_be_booked and valuation_tax:
# credit valuation tax amount in "Expenses Included In Valuation"
@@ -352,12 +368,28 @@ class PurchaseInvoice(BuyingController):
# writeoff account includes petty difference in the invoice amount
# and the amount that is paid
if self.write_off_account and flt(self.write_off_amount):
write_off_account_currency = get_account_currency(self.write_off_account)
gl_entries.append(
self.get_gl_dict({
"account": self.credit_to,
"party_type": "Supplier",
"party": self.supplier,
"against": self.write_off_account,
"debit": self.base_write_off_amount,
"debit_in_account_currency": self.base_write_off_amount \
if self.party_account_currency==self.company_currency else self.write_off_amount,
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
}, self.party_account_currency)
)
gl_entries.append(
self.get_gl_dict({
"account": self.write_off_account,
"against": self.supplier,
"credit": flt(self.write_off_amount),
"remarks": self.remarks,
"credit": flt(self.base_write_off_amount),
"credit_in_account_currency": self.base_write_off_amount \
if write_off_account_currency==self.company_currency else self.write_off_amount,
"cost_center": self.write_off_cost_center
})
)
@@ -367,6 +399,8 @@ class PurchaseInvoice(BuyingController):
make_gl_entries(gl_entries, cancel=(self.docstatus == 2))
def on_cancel(self):
self.check_for_stopped_or_closed_status()
if not self.is_return:
from erpnext.accounts.utils import remove_against_link_from_jv
remove_against_link_from_jv(self.doctype, self.name)
@@ -393,7 +427,7 @@ class PurchaseInvoice(BuyingController):
if self.bill_no:
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
pi = frappe.db.exists("Purchase Invoice", {"bill_no": self.bill_no,
"fiscal_year": self.fiscal_year, "name": ("!=", self.name)})
"fiscal_year": self.fiscal_year, "name": ("!=", self.name), "docstatus": ("<", 2)})
if pi:
frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))
@@ -409,10 +443,10 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
or tabAccount.account_type in ("Expense Account", "Fixed Asset", "Temporary"))
and tabAccount.is_group=0
and tabAccount.docstatus!=2
and tabAccount.company = '%(company)s'
and tabAccount.%(key)s LIKE '%(txt)s'
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
'txt': "%%%s%%" % frappe.db.escape(txt), 'mcond':get_match_cond(doctype)})
and tabAccount.company = %(company)s
and tabAccount.{key} LIKE %(txt)s
{mcond}""".format( key=frappe.db.escape(searchfield), mcond=get_match_cond(doctype) ),
{ 'company': filters['company'], 'txt': "%%%s%%" % frappe.db.escape(txt) })
@frappe.whitelist()
def make_debit_note(source_name, target_doc=None):

View File

@@ -10,6 +10,7 @@ from frappe.utils import cint
import frappe.defaults
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory, \
test_records as pr_test_records
from erpnext.exceptions import InvalidCurrency
test_dependencies = ["Item", "Cost Center"]
test_ignore = ["Serial No"]
@@ -48,25 +49,9 @@ class TestPurchaseInvoice(unittest.TestCase):
pi = frappe.copy_doc(test_records[1])
pi.insert()
pi.submit()
gl_entries = frappe.db.sql("""select account, debit, credit
from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s
order by account asc""", pi.name, as_dict=1)
self.assertTrue(gl_entries)
expected_values = dict((d[0], d) for d in [
["_Test Payable - _TC", 0, 720],
["Stock Received But Not Billed - _TC", 750.0, 0],
["Expenses Included In Valuation - _TC", 0.0, 250.0],
["_Test Account Shipping Charges - _TC", 100.0, 0],
["_Test Account VAT - _TC", 120.0, 0],
])
for i, gle in enumerate(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.check_gle_for_pi(pi.name)
set_perpetual_inventory(0)
def test_gl_entries_with_auto_accounting_for_stock_against_pr(self):
@@ -82,9 +67,14 @@ class TestPurchaseInvoice(unittest.TestCase):
pi.insert()
pi.submit()
self.check_gle_for_pi(pi.name)
set_perpetual_inventory(0)
def check_gle_for_pi(self, pi):
gl_entries = frappe.db.sql("""select account, debit, credit
from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s
order by account asc""", pi.name, as_dict=1)
order by account asc""", pi, as_dict=1)
self.assertTrue(gl_entries)
expected_values = dict((d[0], d) for d in [
@@ -99,8 +89,6 @@ class TestPurchaseInvoice(unittest.TestCase):
self.assertEquals(expected_values[gle.account][1], gle.debit)
self.assertEquals(expected_values[gle.account][2], gle.credit)
set_perpetual_inventory(0)
def test_gl_entries_with_aia_for_non_stock_items(self):
set_perpetual_inventory()
self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1)
@@ -218,7 +206,8 @@ class TestPurchaseInvoice(unittest.TestCase):
pi.load_from_db()
self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account`
where reference_type='Purchase Invoice' and reference_name=%s and debit=300""", pi.name))
where reference_type='Purchase Invoice'
and reference_name=%s and debit_in_account_currency=300""", pi.name))
self.assertEqual(pi.outstanding_amount, 1212.30)
@@ -232,20 +221,20 @@ class TestPurchaseInvoice(unittest.TestCase):
test_recurring_document(self, test_records)
def test_total_purchase_cost_for_project(self):
existing_purchase_cost = frappe.db.sql("""select sum(ifnull(base_net_amount, 0))
existing_purchase_cost = frappe.db.sql("""select sum(base_net_amount)
from `tabPurchase Invoice Item` where project_name = '_Test Project' and docstatus=1""")
existing_purchase_cost = existing_purchase_cost and existing_purchase_cost[0][0] or 0
pi = make_purchase_invoice(currency="USD", conversion_rate=60, project_name="_Test Project")
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"),
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"),
existing_purchase_cost + 15000)
pi1 = make_purchase_invoice(qty=10, project_name="_Test Project")
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"),
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"),
existing_purchase_cost + 15500)
pi1.cancel()
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"),
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"),
existing_purchase_cost + 15000)
pi.cancel()
@@ -277,6 +266,55 @@ class TestPurchaseInvoice(unittest.TestCase):
set_perpetual_inventory(0)
def test_multi_currency_gle(self):
set_perpetual_inventory(0)
pi = make_purchase_invoice(supplier="_Test Supplier USD", credit_to="_Test Payable USD - _TC",
currency="USD", conversion_rate=50)
gl_entries = frappe.db.sql("""select account, account_currency, debit, credit,
debit_in_account_currency, credit_in_account_currency
from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s
order by account asc""", pi.name, as_dict=1)
self.assertTrue(gl_entries)
expected_values = {
"_Test Payable USD - _TC": {
"account_currency": "USD",
"debit": 0,
"debit_in_account_currency": 0,
"credit": 12500,
"credit_in_account_currency": 250
},
"_Test Account Cost for Goods Sold - _TC": {
"account_currency": "INR",
"debit": 12500,
"debit_in_account_currency": 12500,
"credit": 0,
"credit_in_account_currency": 0
}
}
for field in ("account_currency", "debit", "debit_in_account_currency", "credit", "credit_in_account_currency"):
for i, gle in enumerate(gl_entries):
self.assertEquals(expected_values[gle.account][field], gle[field])
# Check for valid currency
pi1 = make_purchase_invoice(supplier="_Test Supplier USD", credit_to="_Test Payable USD - _TC",
do_not_save=True)
self.assertRaises(InvalidCurrency, pi1.save)
# cancel
pi.cancel()
gle = frappe.db.sql("""select name from `tabGL Entry`
where voucher_type='Sales Invoice' and voucher_no=%s""", pi.name)
self.assertFalse(gle)
def make_purchase_invoice(**args):
pi = frappe.new_doc("Purchase Invoice")
args = frappe._dict(args)

View File

@@ -141,6 +141,9 @@
"supplier": "_Test Supplier",
"supplier_name": "_Test Supplier"
},
{
"bill_no": "NA",
"buying_price_list": "_Test Price List",

View File

@@ -18,6 +18,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Journal Entry",
"length": 0,
"no_copy": 1,
"oldfieldname": "journal_voucher",
"oldfieldtype": "Link",
@@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Journal Entry Detail No",
"length": 0,
"no_copy": 1,
"oldfieldname": "jv_detail_no",
"oldfieldtype": "Date",
@@ -69,6 +71,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Remarks",
"length": 0,
"no_copy": 1,
"oldfieldname": "remarks",
"oldfieldtype": "Small Text",
@@ -93,6 +96,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -114,10 +118,11 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Advance Amount",
"length": 0,
"no_copy": 1,
"oldfieldname": "advance_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "party_account_currency",
"permlevel": 0,
"print_hide": 0,
"print_width": "100px",
@@ -140,10 +145,11 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Allocated Amount",
"length": 0,
"no_copy": 1,
"oldfieldname": "allocated_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "party_account_currency",
"permlevel": 0,
"print_hide": 0,
"print_width": "100px",
@@ -164,7 +170,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2014-12-25 16:29:15.176476",
"max_attachments": 0,
"modified": "2015-11-16 06:29:53.288895",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Advance",

View File

@@ -19,6 +19,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Item",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_code",
"oldfieldtype": "Link",
@@ -42,6 +43,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -63,6 +65,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Item Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_name",
"oldfieldtype": "Data",
@@ -86,6 +89,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -108,6 +112,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Text",
@@ -133,6 +138,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Image",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -155,6 +161,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Image View",
"length": 0,
"no_copy": 0,
"options": "image",
"permlevel": 0,
@@ -178,6 +185,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Quantity and Rate",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -199,6 +207,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Qty",
"length": 0,
"no_copy": 0,
"oldfieldname": "qty",
"oldfieldtype": "Currency",
@@ -221,6 +230,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -242,6 +252,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "UOM",
"length": 0,
"no_copy": 0,
"options": "UOM",
"permlevel": 0,
@@ -264,6 +275,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Conversion Factor",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
@@ -284,6 +296,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -305,6 +318,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Price List Rate",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -328,6 +342,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Discount on Price List Rate (%)",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -348,6 +363,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -369,6 +385,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Price List Rate (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -390,6 +407,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -411,6 +429,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Rate ",
"length": 0,
"no_copy": 0,
"oldfieldname": "import_rate",
"oldfieldtype": "Currency",
@@ -435,6 +454,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
"length": 0,
"no_copy": 0,
"oldfieldname": "import_amount",
"oldfieldtype": "Currency",
@@ -458,6 +478,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -479,6 +500,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Rate (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "rate",
"oldfieldtype": "Currency",
@@ -503,6 +525,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "amount",
"oldfieldtype": "Currency",
@@ -527,6 +550,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Pricing Rule",
"length": 0,
"no_copy": 0,
"options": "Pricing Rule",
"permlevel": 0,
@@ -548,6 +572,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -570,6 +595,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Net Rate",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -593,6 +619,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Net Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -615,6 +642,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -637,6 +665,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Net Rate (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -660,6 +689,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Net Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -683,6 +713,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Accounting",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -704,6 +735,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Expense Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "expense_head",
"oldfieldtype": "Link",
@@ -729,6 +761,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -750,6 +783,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Project Name",
"length": 0,
"no_copy": 0,
"options": "Project",
"permlevel": 0,
@@ -773,6 +807,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
@@ -799,6 +834,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -820,6 +856,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Brand",
"length": 0,
"no_copy": 0,
"oldfieldname": "brand",
"oldfieldtype": "Data",
@@ -844,6 +881,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Item Group",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_group",
"oldfieldtype": "Link",
@@ -869,6 +907,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Item Tax Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_tax_rate",
"oldfieldtype": "Small Text",
@@ -892,6 +931,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Item Tax Amount",
"length": 0,
"no_copy": 1,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -916,6 +956,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Purchase Order",
"length": 0,
"no_copy": 1,
"oldfieldname": "purchase_order",
"oldfieldtype": "Link",
@@ -939,6 +980,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -960,6 +1002,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Purchase Order Item",
"length": 0,
"no_copy": 1,
"oldfieldname": "po_detail",
"oldfieldtype": "Data",
@@ -983,6 +1026,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Purchase Receipt",
"length": 0,
"no_copy": 1,
"oldfieldname": "purchase_receipt",
"oldfieldtype": "Link",
@@ -1007,6 +1051,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Page Break",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 1,
@@ -1028,6 +1073,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "PR Detail",
"length": 0,
"no_copy": 1,
"oldfieldname": "pr_detail",
"oldfieldtype": "Data",
@@ -1051,6 +1097,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Valuation Rate",
"length": 0,
"no_copy": 1,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -1073,6 +1120,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Raw Materials Supplied Cost",
"length": 0,
"no_copy": 1,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -1093,7 +1141,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-26 12:28:16.728059",
"max_attachments": 0,
"modified": "2015-11-16 06:29:53.343792",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Consider Tax or Charge for",
"length": 0,
"no_copy": 0,
"oldfieldname": "category",
"oldfieldtype": "Select",
@@ -45,6 +46,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Add or Deduct",
"length": 0,
"no_copy": 0,
"oldfieldname": "add_deduct_tax",
"oldfieldtype": "Select",
@@ -69,6 +71,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "charge_type",
"oldfieldtype": "Select",
@@ -94,6 +97,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Row #",
"length": 0,
"no_copy": 0,
"oldfieldname": "row_id",
"oldfieldtype": "Data",
@@ -118,6 +122,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is this Tax included in Basic Rate?",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -139,6 +144,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -160,6 +166,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Account Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "account_head",
"oldfieldtype": "Link",
@@ -185,6 +192,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
@@ -209,6 +217,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
@@ -233,6 +242,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -255,6 +265,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "rate",
"oldfieldtype": "Currency",
@@ -277,6 +288,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -299,6 +311,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
"length": 0,
"no_copy": 0,
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
@@ -323,6 +336,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Tax Amount After Discount Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -346,6 +360,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total",
"length": 0,
"no_copy": 0,
"oldfieldname": "total",
"oldfieldtype": "Currency",
@@ -369,6 +384,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -391,6 +407,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -414,6 +431,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -437,6 +455,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Tax Amount After Discount Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -460,6 +479,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Item Wise Tax Detail ",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text",
@@ -483,6 +503,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Parenttype",
"length": 0,
"no_copy": 0,
"oldfieldname": "parenttype",
"oldfieldtype": "Data",
@@ -504,7 +525,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-19 12:46:32.687299",
"max_attachments": 0,
"modified": "2015-11-16 06:29:54.644704",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges",

View File

@@ -8,7 +8,7 @@
"description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -21,7 +21,8 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Title",
"no_copy": 0,
"length": 0,
"no_copy": 1,
"oldfieldname": "title",
"oldfieldtype": "Data",
"permlevel": 0,
@@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Default",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -65,6 +67,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Disabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -87,6 +90,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -109,6 +113,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
@@ -131,6 +136,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -153,6 +159,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Purchase Taxes and Charges",
"length": 0,
"no_copy": 0,
"oldfieldname": "purchase_tax_details",
"oldfieldtype": "Table",
@@ -176,7 +183,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-05-06 08:52:01.499434",
"max_attachments": 0,
"modified": "2015-11-16 06:29:54.729312",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges Template",

View File

@@ -48,8 +48,9 @@ def get_items(price_list, sales_or_purchase, item=None):
ON
(item_det.item_code=i.name or item_det.item_code=i.variant_of)
where
ifnull(i.has_variants, 0) = 0 and
i.has_variants = 0 and
{condition}
order by
{order_by}
i.name""".format(condition=condition, order_by=order_by), args, as_dict=1)
i.name
limit 24""".format(condition=condition, order_by=order_by), args, as_dict=1)

View File

@@ -36,6 +36,11 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
refresh: function(doc, dt, dn) {
this._super();
if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) {
// hide new msgbox
cur_frm.msgbox.hide();
}
cur_frm.dashboard.reset();
this.frm.toggle_reqd("due_date", !this.frm.doc.is_return);
@@ -45,6 +50,13 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
if(doc.update_stock) this.show_stock_ledger();
if(doc.docstatus==1 && !doc.is_return) {
var is_delivered_by_supplier = false;
is_delivered_by_supplier = cur_frm.doc.items.some(function(item){
return item.is_delivered_by_supplier ? true : false;
})
cur_frm.add_custom_button(doc.update_stock ? __('Sales Return') : __('Credit Note'),
this.make_sales_return);
@@ -56,7 +68,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
return item.delivery_note ? true : false;
});
if(!from_delivery_note) {
if(!from_delivery_note && !is_delivered_by_supplier) {
cur_frm.add_custom_button(__('Delivery'), cur_frm.cscript['Make Delivery Note']).addClass("btn-primary");
}
}
@@ -99,7 +111,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
source_doctype: "Sales Order",
get_query_filters: {
docstatus: 1,
status: ["!=", "Stopped"],
status: ["not in", ["Stopped", "Closed"]],
per_billed: ["<", 99.99],
customer: cur_frm.doc.customer || undefined,
company: cur_frm.doc.company
@@ -146,13 +158,18 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
method: "set_missing_values",
callback: function(r) {
if(!r.exc) {
cur_frm.pos_print_format = r.message.print_format;
if(r.message && r.message.print_format) {
cur_frm.pos_print_format = r.message.print_format;
}
cur_frm.doc.__missing_values_set = true;
me.frm.script_manager.trigger("update_stock");
frappe.model.set_default_values(me.frm.doc);
me.set_dynamic_labels();
me.calculate_taxes_and_totals();
if(callback_fn) callback_fn();
frappe.after_ajax(function() {
cur_frm.doc.__missing_values_set = false;
})
}
}
});
@@ -176,6 +193,26 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
})
},
debit_to: function() {
var me = this;
if(this.frm.doc.debit_to) {
me.frm.call({
method: "frappe.client.get_value",
args: {
doctype: "Account",
fieldname: "account_currency",
filters: { name: me.frm.doc.debit_to },
},
callback: function(r, rt) {
if(r.message) {
me.frm.set_value("party_account_currency", r.message.account_currency);
me.set_dynamic_labels();
}
}
});
}
},
allocated_amount: function() {
this.calculate_total_advance();
this.frm.refresh_fields();
@@ -183,10 +220,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
write_off_outstanding_amount_automatically: function() {
if(cint(this.frm.doc.write_off_outstanding_amount_automatically)) {
frappe.model.round_floats_in(this.frm.doc, ["base_grand_total", "paid_amount"]);
frappe.model.round_floats_in(this.frm.doc, ["grand_total", "paid_amount"]);
// this will make outstanding amount 0
this.frm.set_value("write_off_amount",
flt(this.frm.doc.base_grand_total - this.frm.doc.paid_amount - this.frm.doc.total_advance, precision("write_off_amount"))
flt(this.frm.doc.grand_total - this.frm.doc.paid_amount - this.frm.doc.total_advance, precision("write_off_amount"))
);
this.frm.toggle_enable("write_off_amount", false);
@@ -199,10 +236,12 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
},
write_off_amount: function() {
this.set_in_company_currency(this.frm.doc, ["write_off_amount"]);
this.write_off_outstanding_amount_automatically();
},
paid_amount: function() {
this.set_in_company_currency(this.frm.doc, ["paid_amount"]);
this.write_off_outstanding_amount_automatically();
},
@@ -291,9 +330,10 @@ cur_frm.cscript['Make Delivery Note'] = function() {
cur_frm.cscript.make_bank_entry = function() {
return frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_from_sales_invoice",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_against_invoice",
args: {
"sales_invoice": cur_frm.doc.name
"dt": "Sales Invoice",
"dn": cur_frm.doc.name
},
callback: function(r) {
var doclist = frappe.model.sync(r.message);
@@ -347,7 +387,7 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {
// --------------------------------
cur_frm.set_query("income_account", "items", function(doc) {
return{
query: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_income_account",
query: "erpnext.controllers.queries.get_income_account",
filters: {'company': doc.company}
}
});
@@ -395,9 +435,9 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
})
if(cur_frm.doc.is_pos) {
frappe.msgprint('<a class="btn btn-primary" \
cur_frm.msgbox = frappe.msgprint('<a class="btn btn-primary" \
onclick="cur_frm.print_preview.printit(true)" style="margin-right: 5px;">Print</a>\
<a class="btn btn-default" href="#Form/Sales Invoice/New">New</a>');
<a class="btn btn-default" href="#Form/Sales Invoice/New Sales Invoice">New</a>');
} else if(cint(frappe.boot.notification_settings.sales_invoice)) {
cur_frm.email_doc(frappe.boot.notification_settings.sales_invoice_message);

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,7 @@ from erpnext.controllers.stock_controller import update_gl_entries_after
from frappe.model.mapper import get_mapped_doc
from erpnext.controllers.selling_controller import SellingController
from erpnext.accounts.utils import get_account_currency
form_grid_templates = {
"items": "templates/form_grid/item_grid.html"
@@ -35,6 +36,15 @@ class SalesInvoice(SellingController):
'overflow_type': 'billing'
}]
def set_indicator(self):
"""Set indicator for portal"""
if self.outstanding_amount > 0:
self.indicator_color = "orange"
self.indicator_title = _("Unpaid")
else:
self.indicator_color = "green"
self.indicator_title = _("Paid")
def validate(self):
super(SalesInvoice, self).validate()
self.validate_posting_time()
@@ -42,7 +52,7 @@ class SalesInvoice(SellingController):
self.validate_proj_cust()
self.validate_with_previous_doc()
self.validate_uom_is_integer("stock_uom", "qty")
self.check_stop_sales_order("sales_order")
self.check_stop_or_close_sales_order("sales_order")
self.validate_debit_to_acc()
self.validate_fixed_asset_account()
self.clear_unallocated_advances("Sales Invoice Advance", "advances")
@@ -54,6 +64,7 @@ class SalesInvoice(SellingController):
self.validate_pos()
if cint(self.update_stock):
self.validate_dropship_item()
self.validate_item_code()
self.validate_warehouse()
self.update_current_stock()
@@ -88,13 +99,13 @@ class SalesInvoice(SellingController):
self.update_status_updater_args()
self.update_prevdoc_status()
# this sequence because outstanding may get -ve
self.make_gl_entries()
if not self.is_return:
self.update_billing_status_for_zero_amount_refdoc("Sales Order")
self.check_credit_limit()
# this sequence because outstanding may get -ve
self.make_gl_entries()
if not cint(self.is_pos) == 1 and not self.is_return:
self.update_against_document_in_jv()
@@ -107,7 +118,7 @@ class SalesInvoice(SellingController):
if cint(self.update_stock) == 1:
self.update_stock_ledger()
self.check_stop_sales_order("sales_order")
self.check_stop_or_close_sales_order("sales_order")
from erpnext.accounts.utils import remove_against_link_from_jv
remove_against_link_from_jv(self.doctype, self.name)
@@ -145,7 +156,7 @@ class SalesInvoice(SellingController):
'second_join_field': 'so_detail',
'overflow_type': 'delivery',
'extra_cond': """ and exists(select name from `tabSales Invoice`
where name=`tabSales Invoice Item`.parent and ifnull(update_stock, 0) = 1)"""
where name=`tabSales Invoice Item`.parent and update_stock = 1)"""
},
{
'source_dt': 'Sales Invoice Item',
@@ -162,11 +173,22 @@ class SalesInvoice(SellingController):
}
])
def check_credit_limit(self):
from erpnext.selling.doctype.customer.customer import check_credit_limit
validate_against_credit_limit = False
for d in self.get("items"):
if not (d.sales_order or d.delivery_note):
validate_against_credit_limit = True
break
if validate_against_credit_limit:
check_credit_limit(self.customer, self.company)
def set_missing_values(self, for_validate=False):
pos = self.set_pos_fields(for_validate)
if not self.debit_to:
self.debit_to = get_party_account(self.company, self.customer, "Customer")
self.debit_to = get_party_account("Customer", self.customer, self.company)
if not self.due_date and self.customer:
self.due_date = get_due_date(self.posting_date, "Customer", self.customer, self.company)
@@ -186,8 +208,8 @@ class SalesInvoice(SellingController):
def validate_time_logs_are_submitted(self):
for d in self.get("items"):
if d.time_log_batch:
status = frappe.db.get_value("Time Log Batch", d.time_log_batch, "status")
if status!="Submitted":
docstatus = frappe.db.get_value("Time Log Batch", d.time_log_batch, "docstatus")
if docstatus!=1:
frappe.throw(_("Time Log Batch {0} must be 'Submitted'").format(d.time_log_batch))
def set_pos_fields(self, for_validate=False):
@@ -235,7 +257,7 @@ class SalesInvoice(SellingController):
def get_advances(self):
if not self.is_return:
super(SalesInvoice, self).get_advances(self.debit_to, "Customer", self.customer,
"Sales Invoice Advance", "advances", "credit", "sales_order")
"Sales Invoice Advance", "advances", "credit_in_account_currency", "sales_order")
def get_company_abbr(self):
return frappe.db.sql("select abbr from tabCompany where name=%s", self.company)[0][0]
@@ -260,7 +282,7 @@ class SalesInvoice(SellingController):
'party_type': 'Customer',
'party': self.customer,
'is_advance' : 'Yes',
'dr_or_cr' : 'credit',
'dr_or_cr' : 'credit_in_account_currency',
'unadjusted_amt' : flt(d.advance_amount),
'allocated_amt' : flt(d.allocated_amount)
}
@@ -271,7 +293,8 @@ class SalesInvoice(SellingController):
reconcile_against_document(lst)
def validate_debit_to_acc(self):
account = frappe.db.get_value("Account", self.debit_to, ["account_type", "report_type"], as_dict=True)
account = frappe.db.get_value("Account", self.debit_to,
["account_type", "report_type", "account_currency"], as_dict=True)
if account.report_type != "Balance Sheet":
frappe.throw(_("Debit To account must be a Balance Sheet account"))
@@ -279,6 +302,8 @@ class SalesInvoice(SellingController):
if self.customer and account.account_type != "Receivable":
frappe.throw(_("Debit To account must be a Receivable account"))
self.party_account_currency = account.account_currency
def validate_fixed_asset_account(self):
"""Validate Fixed Asset and whether Income Account Entered Exists"""
for d in self.get('items'):
@@ -335,8 +360,8 @@ class SalesInvoice(SellingController):
"""check for does customer belong to same project as entered.."""
if self.project_name and self.customer:
res = frappe.db.sql("""select name from `tabProject`
where name = %s and (customer = %s or
ifnull(customer,'')='')""", (self.project_name, self.customer))
where name = %s and (customer = %s or customer is null or customer = '')""",
(self.project_name, self.customer))
if not res:
throw(_("Customer {0} does not belong to project {1}").format(self.customer,self.project_name))
@@ -355,6 +380,8 @@ class SalesInvoice(SellingController):
msgprint(_("Item Code required at Row No {0}").format(d.idx), raise_exception=True)
def validate_warehouse(self):
super(SalesInvoice, self).validate_warehouse()
for d in self.get('items'):
if not d.warehouse:
frappe.throw(_("Warehouse required at Row No {0}").format(d.idx))
@@ -383,6 +410,12 @@ class SalesInvoice(SellingController):
if self.c_form_applicable == 'Yes' and self.c_form_no:
msgprint(_("Please remove this Invoice {0} from C-Form {1}")
.format(self.name, self.c_form_no), raise_exception = 1)
def validate_dropship_item(self):
for item in self.items:
if item.sales_order:
if frappe.db.get_value("Sales Order Item", item.so_detail, "delivered_by_supplier"):
frappe.throw(_("Could not update stock, invoice contains drop shipping item."))
def update_current_stock(self):
for d in self.get('items'):
@@ -398,7 +431,7 @@ class SalesInvoice(SellingController):
def update_packing_list(self):
if cint(self.update_stock) == 1:
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
make_packing_list(self, 'items')
make_packing_list(self)
else:
self.set('packed_items', [])
@@ -410,7 +443,7 @@ class SalesInvoice(SellingController):
if not warehouse:
global_pos_profile = frappe.db.sql("""select name, warehouse from `tabPOS Profile`
where ifnull(user,'') = '' and company = %s""", self.company)
where (user is null or user = '') and company = %s""", self.company)
if global_pos_profile:
warehouse = global_pos_profile[0][1]
@@ -424,7 +457,7 @@ class SalesInvoice(SellingController):
if flt(self.paid_amount) == 0:
if self.cash_bank_account:
frappe.db.set(self, 'paid_amount',
(flt(self.base_grand_total) - flt(self.write_off_amount)))
flt(flt(self.grand_total) - flt(self.write_off_amount), self.precision("paid_amount")))
else:
# show message that the amount is not paid
frappe.db.set(self,'paid_amount',0)
@@ -432,6 +465,9 @@ class SalesInvoice(SellingController):
else:
frappe.db.set(self,'paid_amount',0)
frappe.db.set(self, 'base_paid_amount',
flt(self.paid_amount*self.conversion_rate, self.precision("base_paid_amount")))
def check_prev_docstatus(self):
for d in self.get('items'):
if d.sales_order and frappe.db.get_value("Sales Order", d.sales_order, "docstatus") != 1:
@@ -487,7 +523,7 @@ class SalesInvoice(SellingController):
return gl_entries
def make_customer_gl_entry(self, gl_entries):
if self.base_grand_total:
if self.grand_total:
gl_entries.append(
self.get_gl_dict({
"account": self.debit_to,
@@ -495,37 +531,42 @@ class SalesInvoice(SellingController):
"party": self.customer,
"against": self.against_income_account,
"debit": self.base_grand_total,
"remarks": self.remarks,
"debit_in_account_currency": self.base_grand_total \
if self.party_account_currency==self.company_currency else self.grand_total,
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype
})
}, self.party_account_currency)
)
def make_tax_gl_entries(self, gl_entries):
for tax in self.get("taxes"):
if flt(tax.base_tax_amount_after_discount_amount):
account_currency = get_account_currency(tax.account_head)
gl_entries.append(
self.get_gl_dict({
"account": tax.account_head,
"against": self.customer,
"credit": flt(tax.base_tax_amount_after_discount_amount),
"remarks": self.remarks,
"credit_in_account_currency": flt(tax.base_tax_amount_after_discount_amount) \
if account_currency==self.company_currency else flt(tax.tax_amount_after_discount_amount),
"cost_center": tax.cost_center
})
}, account_currency)
)
def make_item_gl_entries(self, gl_entries):
# income account gl entries
for item in self.get("items"):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.income_account)
gl_entries.append(
self.get_gl_dict({
"account": item.income_account,
"against": self.customer,
"credit": item.base_net_amount,
"remarks": self.remarks,
"credit_in_account_currency": item.base_net_amount \
if account_currency==self.company_currency else item.net_amount,
"cost_center": item.cost_center
})
}, account_currency)
)
# expense account gl entries
@@ -535,6 +576,7 @@ class SalesInvoice(SellingController):
def make_pos_gl_entries(self, gl_entries):
if cint(self.is_pos) and self.cash_bank_account and self.paid_amount:
bank_account_currency = get_account_currency(self.cash_bank_account)
# POS, make payment entries
gl_entries.append(
self.get_gl_dict({
@@ -542,44 +584,50 @@ class SalesInvoice(SellingController):
"party_type": "Customer",
"party": self.customer,
"against": self.cash_bank_account,
"credit": self.paid_amount,
"remarks": self.remarks,
"credit": self.base_paid_amount,
"credit_in_account_currency": self.base_paid_amount \
if self.party_account_currency==self.company_currency else self.paid_amount,
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
})
}, self.party_account_currency)
)
gl_entries.append(
self.get_gl_dict({
"account": self.cash_bank_account,
"against": self.customer,
"debit": self.paid_amount,
"remarks": self.remarks,
})
"debit": self.base_paid_amount,
"debit_in_account_currency": self.base_paid_amount \
if bank_account_currency==self.company_currency else self.paid_amount
}, bank_account_currency)
)
def make_write_off_gl_entry(self, gl_entries):
# write off entries, applicable if only pos
if self.write_off_account and self.write_off_amount:
write_off_account_currency = get_account_currency(self.write_off_account)
gl_entries.append(
self.get_gl_dict({
"account": self.debit_to,
"party_type": "Customer",
"party": self.customer,
"against": self.write_off_account,
"credit": self.write_off_amount,
"remarks": self.remarks,
"credit": self.base_write_off_amount,
"credit_in_account_currency": self.base_write_off_amount \
if self.party_account_currency==self.company_currency else self.write_off_amount,
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
})
"against_voucher_type": self.doctype
}, self.party_account_currency)
)
gl_entries.append(
self.get_gl_dict({
"account": self.write_off_account,
"against": self.customer,
"debit": self.write_off_amount,
"remarks": self.remarks,
"debit": self.base_write_off_amount,
"debit_in_account_currency": self.base_write_off_amount \
if write_off_account_currency==self.company_currency else self.write_off_amount,
"cost_center": self.write_off_cost_center
})
}, write_off_account_currency)
)
def get_list_context(context=None):
@@ -598,24 +646,6 @@ def get_bank_cash_account(mode_of_payment, company):
"account": account
}
@frappe.whitelist()
def get_income_account(doctype, txt, searchfield, start, page_len, filters):
from erpnext.controllers.queries import get_match_cond
# income account can be any Credit account,
# but can also be a Asset account with account_type='Income Account' in special circumstances.
# Hence the first condition is an "OR"
return frappe.db.sql("""select tabAccount.name from `tabAccount`
where (tabAccount.report_type = "Profit and Loss"
or tabAccount.account_type in ("Income Account", "Temporary"))
and tabAccount.is_group=0
and tabAccount.docstatus!=2
and tabAccount.company = '%(company)s'
and tabAccount.%(key)s LIKE '%(txt)s'
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
'txt': "%%%s%%" % frappe.db.escape(txt), 'mcond':get_match_cond(doctype)})
@frappe.whitelist()
def make_delivery_note(source_name, target_doc=None):
def set_missing_values(source, target):
@@ -646,7 +676,8 @@ def make_delivery_note(source_name, target_doc=None):
"sales_order": "against_sales_order",
"so_detail": "so_detail"
},
"postprocess": update_item
"postprocess": update_item,
"condition": lambda doc: doc.delivered_by_supplier!=1
},
"Sales Taxes and Charges": {
"doctype": "Sales Taxes and Charges",

View File

@@ -7,6 +7,9 @@ import unittest, copy
from frappe.utils import nowdate, add_days, flt
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry, get_qty_after_transaction
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
from erpnext.exceptions import InvalidAccountCurrency, InvalidCurrency
from erpnext.stock.doctype.serial_no.serial_no import SerialNoWarehouseError
from frappe.model.naming import make_autoname
class TestSalesInvoice(unittest.TestCase):
def make(self):
@@ -401,7 +404,7 @@ class TestSalesInvoice(unittest.TestCase):
jv.cancel()
self.assertEquals(frappe.db.get_value("Sales Invoice", w.name, "outstanding_amount"), 561.8)
def test_sales_invoice_gl_entry_without_aii(self):
def test_sales_invoice_gl_entry_without_perpetual_inventory(self):
set_perpetual_inventory(0)
si = frappe.copy_doc(test_records[1])
si.insert()
@@ -433,7 +436,7 @@ class TestSalesInvoice(unittest.TestCase):
self.assertFalse(gle)
def test_pos_gl_entry_with_aii(self):
def test_pos_gl_entry_with_perpetual_inventory(self):
set_perpetual_inventory()
self.make_pos_profile()
@@ -442,8 +445,7 @@ class TestSalesInvoice(unittest.TestCase):
pos = copy.deepcopy(test_records[1])
pos["is_pos"] = 1
pos["update_stock"] = 1
# pos["posting_time"] = "12:05"
pos["cash_bank_account"] = "_Test Account Bank Account - _TC"
pos["cash_bank_account"] = "_Test Bank - _TC"
pos["paid_amount"] = 600.0
si = frappe.copy_doc(pos)
@@ -474,7 +476,7 @@ class TestSalesInvoice(unittest.TestCase):
[stock_in_hand, 0.0, abs(sle.stock_value_difference)],
[pos["items"][0]["expense_account"], abs(sle.stock_value_difference), 0.0],
[si.debit_to, 0.0, 600.0],
["_Test Account Bank Account - _TC", 600.0, 0.0]
["_Test Bank - _TC", 600.0, 0.0]
])
for i, gle in enumerate(sorted(gl_entries, key=lambda gle: gle.account)):
@@ -494,7 +496,7 @@ class TestSalesInvoice(unittest.TestCase):
def make_pos_profile(self):
pos_profile = frappe.get_doc({
"cash_bank_account": "_Test Account Bank Account - _TC",
"cash_bank_account": "_Test Bank - _TC",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"currency": "INR",
@@ -513,7 +515,7 @@ class TestSalesInvoice(unittest.TestCase):
if not frappe.db.exists("POS Profile", "_Test POS Profile"):
pos_profile.insert()
def test_si_gl_entry_with_aii_and_update_stock_with_warehouse_but_no_account(self):
def test_si_gl_entry_with_perpetual_inventory_and_update_stock_with_warehouse_but_no_account(self):
set_perpetual_inventory()
frappe.delete_doc("Account", "_Test Warehouse No Account - _TC")
@@ -567,7 +569,7 @@ class TestSalesInvoice(unittest.TestCase):
self.assertFalse(gle)
set_perpetual_inventory(0)
def test_sales_invoice_gl_entry_with_aii_no_item_code(self):
def test_sales_invoice_gl_entry_with_perpetual_inventory_no_item_code(self):
set_perpetual_inventory()
si = frappe.get_doc(test_records[1])
@@ -593,7 +595,7 @@ class TestSalesInvoice(unittest.TestCase):
set_perpetual_inventory(0)
def test_sales_invoice_gl_entry_with_aii_non_stock_item(self):
def test_sales_invoice_gl_entry_with_perpetual_inventory_non_stock_item(self):
set_perpetual_inventory()
si = frappe.get_doc(test_records[1])
si.get("items")[0].item_code = "_Test Non Stock Item"
@@ -660,7 +662,7 @@ class TestSalesInvoice(unittest.TestCase):
where reference_name=%s""", si.name))
self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account`
where reference_name=%s and credit=300""", si.name))
where reference_name=%s and credit_in_account_currency=300""", si.name))
self.assertEqual(si.outstanding_amount, 261.8)
@@ -688,7 +690,6 @@ class TestSalesInvoice(unittest.TestCase):
si.insert()
si.submit()
self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Delivered")
self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"))
self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0],
"delivery_document_no"), si.name)
@@ -702,33 +703,26 @@ class TestSalesInvoice(unittest.TestCase):
serial_nos = get_serial_nos(si.get("items")[0].serial_no)
self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Available")
self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"), "_Test Warehouse - _TC")
self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0],
"delivery_document_no"))
def test_serialize_status(self):
from erpnext.stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos, SerialNoDuplicateError
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
se = make_serialized_item()
serial_nos = get_serial_nos(se.get("items")[0].serial_no)
sr = frappe.get_doc("Serial No", serial_nos[0])
sr.status = "Not Available"
sr.save()
serial_no = frappe.get_doc({
"doctype": "Serial No",
"item_code": "_Test Serialized Item With Series",
"serial_no": make_autoname("SR", "Serial No")
})
serial_no.save()
si = frappe.copy_doc(test_records[0])
si.update_stock = 1
si.get("items")[0].item_code = "_Test Serialized Item With Series"
si.get("items")[0].qty = 1
si.get("items")[0].serial_no = serial_nos[0]
si.get("items")[0].serial_no = serial_no.name
si.insert()
self.assertRaises(SerialNoStatusError, si.submit)
# hack! because stock ledger entires are already inserted and are not rolled back!
self.assertRaises(SerialNoDuplicateError, si.cancel)
self.assertRaises(SerialNoWarehouseError, si.submit)
def test_invoice_due_date_against_customers_credit_days(self):
# set customer's credit days
@@ -842,6 +836,79 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEquals(si.base_grand_total, 859.44)
self.assertEquals(si.grand_total, 859.44)
def test_multi_currency_gle(self):
set_perpetual_inventory(0)
si = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
currency="USD", conversion_rate=50)
gl_entries = frappe.db.sql("""select account, account_currency, debit, credit,
debit_in_account_currency, credit_in_account_currency
from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s
order by account asc""", si.name, as_dict=1)
self.assertTrue(gl_entries)
expected_values = {
"_Test Receivable USD - _TC": {
"account_currency": "USD",
"debit": 5000,
"debit_in_account_currency": 100,
"credit": 0,
"credit_in_account_currency": 0
},
"Sales - _TC": {
"account_currency": "INR",
"debit": 0,
"debit_in_account_currency": 0,
"credit": 5000,
"credit_in_account_currency": 5000
}
}
for field in ("account_currency", "debit", "debit_in_account_currency", "credit", "credit_in_account_currency"):
for i, gle in enumerate(gl_entries):
self.assertEquals(expected_values[gle.account][field], gle[field])
# cancel
si.cancel()
gle = frappe.db.sql("""select name from `tabGL Entry`
where voucher_type='Sales Invoice' and voucher_no=%s""", si.name)
self.assertFalse(gle)
def test_invalid_currency(self):
# Customer currency = USD
# Transaction currency cannot be INR
si1 = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
do_not_save=True)
self.assertRaises(InvalidCurrency, si1.save)
# Transaction currency cannot be EUR
si2 = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
currency="EUR", conversion_rate=80, do_not_save=True)
self.assertRaises(InvalidCurrency, si2.save)
# Transaction currency only allowed in USD
si3 = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
currency="USD", conversion_rate=50)
# Party Account currency must be in USD, as there is existing GLE with USD
si4 = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable - _TC",
currency="USD", conversion_rate=50, do_not_submit=True)
self.assertRaises(InvalidAccountCurrency, si4.submit)
# Party Account currency must be in USD, force customer currency as there is no GLE
si3.cancel()
si5 = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable - _TC",
currency="USD", conversion_rate=50, do_not_submit=True)
self.assertRaises(InvalidAccountCurrency, si5.submit)
def create_sales_invoice(**args):
si = frappe.new_doc("Sales Invoice")
@@ -856,14 +923,15 @@ def create_sales_invoice(**args):
si.is_pos = args.is_pos
si.is_return = args.is_return
si.return_against = args.return_against
si.currency="INR"
si.conversion_rate = 1
si.currency=args.currency or "INR"
si.conversion_rate = args.conversion_rate or 1
si.append("items", {
"item_code": args.item or args.item_code or "_Test Item",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
"qty": args.qty or 1,
"rate": args.rate or 100,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"serial_no": args.serial_no

View File

@@ -18,6 +18,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Journal Entry",
"length": 0,
"no_copy": 1,
"oldfieldname": "journal_voucher",
"oldfieldtype": "Link",
@@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Remarks",
"length": 0,
"no_copy": 1,
"oldfieldname": "remarks",
"oldfieldtype": "Small Text",
@@ -69,6 +71,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Journal Entry Detail No",
"length": 0,
"no_copy": 1,
"oldfieldname": "jv_detail_no",
"oldfieldtype": "Data",
@@ -93,6 +96,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -114,10 +118,11 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Advance amount",
"length": 0,
"no_copy": 1,
"oldfieldname": "advance_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "party_account_currency",
"permlevel": 0,
"print_hide": 0,
"print_width": "120px",
@@ -140,10 +145,11 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Allocated amount",
"length": 0,
"no_copy": 1,
"oldfieldname": "allocated_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "party_account_currency",
"permlevel": 0,
"print_hide": 0,
"print_width": "120px",
@@ -164,7 +170,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2014-12-25 16:30:19.446500",
"max_attachments": 0,
"modified": "2015-11-16 06:29:56.263776",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Advance",

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Barcode",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
@@ -40,6 +41,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Item",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_code",
"oldfieldtype": "Link",
@@ -63,6 +65,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -84,6 +87,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Item Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_name",
"oldfieldtype": "Data",
@@ -107,6 +111,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Customer's Item Code",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
@@ -128,6 +133,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Edit Description",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -150,6 +156,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Text",
@@ -174,6 +181,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -196,6 +204,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Image View",
"length": 0,
"no_copy": 0,
"options": "image",
"permlevel": 0,
@@ -219,6 +228,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Image",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -241,6 +251,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -262,6 +273,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Quantity",
"length": 0,
"no_copy": 0,
"oldfieldname": "qty",
"oldfieldtype": "Currency",
@@ -285,6 +297,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Price List Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "ref_rate",
"oldfieldtype": "Currency",
@@ -310,6 +323,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Discount on Price List Rate (%)",
"length": 0,
"no_copy": 0,
"oldfieldname": "adj_rate",
"oldfieldtype": "Float",
@@ -332,6 +346,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -353,6 +368,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "UOM",
"length": 0,
"no_copy": 0,
"options": "UOM",
"permlevel": 0,
@@ -375,6 +391,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Price List Rate (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "base_ref_rate",
"oldfieldtype": "Currency",
@@ -398,6 +415,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -419,6 +437,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "export_rate",
"oldfieldtype": "Currency",
@@ -443,6 +462,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
"length": 0,
"no_copy": 0,
"oldfieldname": "export_amount",
"oldfieldtype": "Currency",
@@ -466,6 +486,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -487,6 +508,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Rate (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "basic_rate",
"oldfieldtype": "Currency",
@@ -511,6 +533,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "amount",
"oldfieldtype": "Currency",
@@ -535,6 +558,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Pricing Rule",
"length": 0,
"no_copy": 0,
"options": "Pricing Rule",
"permlevel": 0,
@@ -556,6 +580,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -578,6 +603,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Net Rate",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -601,6 +627,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Net Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -623,6 +650,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -645,6 +673,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Net Rate (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -668,6 +697,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Net Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -680,6 +710,53 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "eval:doc.delivered_by_supplier==1",
"fieldname": "drop_ship",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Drop Ship",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "delivered_by_supplier",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Delivered By Supplier",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -691,6 +768,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Accounting Details",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -712,6 +790,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Income Account",
"length": 0,
"no_copy": 0,
"oldfieldname": "income_account",
"oldfieldtype": "Link",
@@ -738,6 +817,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Expense Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
@@ -760,6 +840,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -782,6 +863,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
@@ -809,6 +891,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Stock Details",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -830,6 +913,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Warehouse",
"length": 0,
"no_copy": 0,
"oldfieldname": "warehouse",
"oldfieldtype": "Link",
@@ -843,6 +927,30 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "target_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Target Warehouse",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -854,6 +962,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Serial No",
"length": 0,
"no_copy": 0,
"oldfieldname": "serial_no",
"oldfieldtype": "Small Text",
@@ -877,6 +986,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Batch No",
"length": 0,
"no_copy": 0,
"options": "Batch",
"permlevel": 0,
@@ -900,6 +1010,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Item Group",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_group",
"oldfieldtype": "Link",
@@ -924,6 +1035,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Brand Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "brand",
"oldfieldtype": "Data",
@@ -947,6 +1059,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Item Tax Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_tax_rate",
"oldfieldtype": "Small Text",
@@ -969,6 +1082,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -990,6 +1104,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Available Batch Qty at Warehouse",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
@@ -1014,6 +1129,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Available Qty at Warehouse",
"length": 0,
"no_copy": 0,
"oldfieldname": "actual_qty",
"oldfieldtype": "Currency",
@@ -1037,6 +1153,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "References",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -1059,6 +1176,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Time Log Batch",
"length": 0,
"no_copy": 0,
"options": "Time Log Batch",
"permlevel": 0,
@@ -1081,6 +1199,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Sales Order",
"length": 0,
"no_copy": 1,
"oldfieldname": "sales_order",
"oldfieldtype": "Link",
@@ -1105,6 +1224,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Sales Order Item",
"length": 0,
"no_copy": 1,
"oldfieldname": "so_detail",
"oldfieldtype": "Data",
@@ -1127,6 +1247,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -1149,6 +1270,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Delivery Note",
"length": 0,
"no_copy": 1,
"oldfieldname": "delivery_note",
"oldfieldtype": "Link",
@@ -1173,6 +1295,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Delivery Note Item",
"length": 0,
"no_copy": 1,
"oldfieldname": "dn_detail",
"oldfieldtype": "Data",
@@ -1196,6 +1319,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Delivered Qty",
"length": 0,
"no_copy": 0,
"oldfieldname": "delivered_qty",
"oldfieldtype": "Currency",
@@ -1218,6 +1342,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -1240,6 +1365,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Page Break",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 1,
@@ -1259,7 +1385,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-20 17:18:52.752064",
"max_attachments": 0,
"modified": "2015-11-16 06:29:56.335017",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "charge_type",
"oldfieldtype": "Select",
@@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Row #",
"length": 0,
"no_copy": 0,
"oldfieldname": "row_id",
"oldfieldtype": "Data",
@@ -67,6 +69,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Account Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "account_head",
"oldfieldtype": "Link",
@@ -92,6 +95,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center_other_charges",
"oldfieldtype": "Link",
@@ -115,6 +119,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -137,6 +142,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
@@ -163,6 +169,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is this Tax included in Basic Rate?",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
@@ -185,6 +192,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -207,6 +215,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "rate",
"oldfieldtype": "Currency",
@@ -229,6 +238,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -251,6 +261,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -274,6 +285,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -297,6 +309,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Tax Amount After Discount Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
@@ -319,6 +332,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -341,6 +355,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
@@ -365,6 +380,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Total (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "total",
"oldfieldtype": "Currency",
@@ -390,6 +406,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Tax Amount After Discount Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -412,6 +429,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Item Wise Tax Detail",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text",
@@ -435,6 +453,7 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Parenttype",
"length": 0,
"no_copy": 0,
"oldfieldname": "parenttype",
"oldfieldtype": "Data",
@@ -456,7 +475,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-19 12:46:33.165519",
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.263576",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges",

View File

@@ -5,6 +5,3 @@ cur_frm.cscript.tax_table = "Sales Taxes and Charges";
{% include "public/js/controllers/accounts.js" %}
frappe.ui.form.on("Sales Taxes and Charges Template", "onload", function(frm) {
erpnext.add_applicable_territory();
});

View File

@@ -8,7 +8,7 @@
"description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -21,7 +21,8 @@
"in_filter": 1,
"in_list_view": 0,
"label": "Title",
"no_copy": 0,
"length": 0,
"no_copy": 1,
"oldfieldname": "title",
"oldfieldtype": "Data",
"permlevel": 0,
@@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Default",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -65,6 +67,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -86,6 +89,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -107,6 +111,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Link",
@@ -130,6 +135,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -152,6 +158,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Taxes and Charges",
"length": 0,
"no_copy": 0,
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
@@ -164,29 +171,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Specify a list of Territories, for which, this Taxes Master is valid",
"fieldname": "territories",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid for Territories",
"no_copy": 0,
"options": "Applicable Territory",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
@@ -198,7 +182,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-05-06 08:51:54.662853",
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.346680",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges Template",

View File

@@ -5,7 +5,6 @@ from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from erpnext.controllers.accounts_controller import validate_taxes_and_charges, validate_inclusive_tax
from frappe.utils.nestedset import get_root_of
class SalesTaxesandChargesTemplate(Document):
def validate(self):
@@ -17,13 +16,9 @@ def valdiate_taxes_and_charges_template(doc):
if doc.is_default == 1:
frappe.db.sql("""update `tab{0}` set is_default = 0
where ifnull(is_default,0) = 1 and name != %s and company = %s""".format(doc.doctype),
where is_default = 1 and name != %s and company = %s""".format(doc.doctype),
(doc.name, doc.company))
if doc.meta.get_field("territories"):
if not doc.territories:
doc.append("territories", {"territory": get_root_of("Territory") })
for tax in doc.get("taxes"):
validate_taxes_and_charges(tax)
validate_inclusive_tax(tax, doc)

View File

@@ -20,19 +20,7 @@
"rate": 6.36
}
],
"title": "_Test Sales Taxes and Charges Template",
"territories": [
{
"doctype": "Applicable Territory",
"parentfield": "territories",
"territory": "All Territories"
},
{
"doctype": "Applicable Territory",
"parentfield": "territories",
"territory": "_Test Territory Rest Of The World"
}
]
"title": "_Test Sales Taxes and Charges Template"
},
{
"company": "_Test Company",
@@ -115,14 +103,7 @@
"row_id": 7
}
],
"title": "_Test India Tax Master",
"territories": [
{
"doctype": "Applicable Territory",
"parentfield": "territories",
"territory": "_Test Territory India"
}
]
"title": "_Test India Tax Master"
},
{
"company": "_Test Company",
@@ -145,13 +126,76 @@
"rate": 4
}
],
"title": "_Test Sales Taxes and Charges Template - Rest of the World",
"territories": [
"title": "_Test Sales Taxes and Charges Template - Rest of the World"
},
{
"company": "_Test Company",
"doctype": "Sales Taxes and Charges Template",
"taxes": [
{
"doctype": "Applicable Territory",
"parentfield": "territories",
"territory": "_Test Territory Rest Of The World"
"account_head": "_Test Account VAT - _TC",
"charge_type": "On Net Total",
"description": "VAT",
"doctype": "Sales Taxes and Charges",
"parentfield": "taxes",
"rate": 12
},
{
"account_head": "_Test Account Service Tax - _TC",
"charge_type": "On Net Total",
"description": "Service Tax",
"doctype": "Sales Taxes and Charges",
"parentfield": "taxes",
"rate": 4
}
]
],
"title": "_Test Sales Taxes and Charges Template 1"
},
{
"company": "_Test Company",
"doctype": "Sales Taxes and Charges Template",
"taxes": [
{
"account_head": "_Test Account VAT - _TC",
"charge_type": "On Net Total",
"description": "VAT",
"doctype": "Sales Taxes and Charges",
"parentfield": "taxes",
"rate": 12
},
{
"account_head": "_Test Account Service Tax - _TC",
"charge_type": "On Net Total",
"description": "Service Tax",
"doctype": "Sales Taxes and Charges",
"parentfield": "taxes",
"rate": 4
}
],
"title": "_Test Sales Taxes and Charges Template 2"
},
{
"doctype" : "Sales Taxes and Charges Template",
"title": "_Test Tax 1",
"company": "_Test Company",
"taxes":[{
"charge_type": "Actual",
"account_head": "Sales Expenses - _TC",
"cost_center": "Main - _TC",
"description": "Test Shopping cart taxes with Tax Rule",
"tax_amount": 1000
}]
},
{
"doctype" : "Sales Taxes and Charges Template",
"title": "_Test Tax 2",
"company": "_Test Company",
"taxes":[{
"charge_type": "Actual",
"account_head": "Sales Expenses - _TC",
"cost_center": "Main - _TC",
"description": "Test Shopping cart taxes with Tax Rule",
"tax_amount": 200
}]
}
]

View File

@@ -1,8 +1,3 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
$.extend(cur_frm.cscript, {
onload: function() {
erpnext.add_applicable_territory();
}
});

View File

@@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Shipping Rule Label",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -35,14 +36,17 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"fieldname": "disabled",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -63,6 +67,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Calculate Based On",
"length": 0,
"no_copy": 0,
"options": "Net Total\nNet Weight",
"permlevel": 0,
@@ -78,6 +83,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:!doc.disabled",
"fieldname": "rule_conditions_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -85,6 +91,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Shipping Rule Conditions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -106,6 +113,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Shipping Rule Conditions",
"length": 0,
"no_copy": 0,
"options": "Shipping Rule Condition",
"permlevel": 0,
@@ -121,12 +129,15 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:!doc.disabled",
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid for Countries",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -141,21 +152,21 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Specify a list of Territories, for which, this Shipping Rule is valid",
"fieldname": "territories",
"fieldtype": "Table",
"fieldname": "worldwide_shipping",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid For Territories",
"label": "Worldwide Shipping",
"length": 0,
"no_copy": 0,
"options": "Applicable Territory",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -164,12 +175,39 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_8",
"fieldtype": "Column Break",
"depends_on": "eval:!doc.worldwide_shipping",
"fieldname": "countries",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid for Countries",
"length": 0,
"no_copy": 0,
"options": "Shipping Rule Country",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:!doc.disabled",
"fieldname": "section_break_10",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -191,6 +229,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
@@ -206,12 +245,13 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "section_break_10",
"fieldtype": "Section Break",
"fieldname": "column_break_12",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -233,6 +273,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Shipping Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
@@ -244,26 +285,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_12",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -275,6 +296,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Cost Center",
"length": 0,
"no_copy": 0,
"options": "Cost Center",
"permlevel": 0,
@@ -296,7 +318,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-02-05 05:11:46.634371",
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.633071",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Shipping Rule",

View File

@@ -22,6 +22,12 @@ class ShippingRule(Document):
self.sort_shipping_rule_conditions()
self.validate_overlapping_shipping_rule_conditions()
if self.worldwide_shipping:
self.countries = []
elif not len([d.country for d in self.countries if d.country]):
frappe.throw(_("Please specify a country for this Shipping Rule or check Worldwide Shipping"))
def validate_from_to_values(self):
zero_to_values = []

View File

@@ -1,116 +1,100 @@
[
{
"account": "_Test Account Shipping Charges - _TC",
"calculate_based_on": "Net Total",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"doctype": "Shipping Rule",
"label": "_Test Shipping Rule",
"name": "_Test Shipping Rule",
"account": "_Test Account Shipping Charges - _TC",
"calculate_based_on": "Net Total",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"doctype": "Shipping Rule",
"label": "_Test Shipping Rule",
"name": "_Test Shipping Rule",
"conditions": [
{
"doctype": "Shipping Rule Condition",
"from_value": 0,
"parentfield": "conditions",
"shipping_amount": 50.0,
"doctype": "Shipping Rule Condition",
"from_value": 0,
"parentfield": "conditions",
"shipping_amount": 50.0,
"to_value": 100
},
},
{
"doctype": "Shipping Rule Condition",
"from_value": 101,
"parentfield": "conditions",
"shipping_amount": 100.0,
"doctype": "Shipping Rule Condition",
"from_value": 101,
"parentfield": "conditions",
"shipping_amount": 100.0,
"to_value": 200
},
},
{
"doctype": "Shipping Rule Condition",
"from_value": 201,
"parentfield": "conditions",
"doctype": "Shipping Rule Condition",
"from_value": 201,
"parentfield": "conditions",
"shipping_amount": 0.0
}
],
"territories": [
{
"doctype": "Applicable Territory",
"parentfield": "territories",
"territory": "_Test Territory"
}
]
},
],
"worldwide_shipping": 1
},
{
"account": "_Test Account Shipping Charges - _TC",
"calculate_based_on": "Net Total",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"doctype": "Shipping Rule",
"label": "_Test Shipping Rule - India",
"name": "_Test Shipping Rule - India",
"account": "_Test Account Shipping Charges - _TC",
"calculate_based_on": "Net Total",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"doctype": "Shipping Rule",
"label": "_Test Shipping Rule - India",
"name": "_Test Shipping Rule - India",
"conditions": [
{
"doctype": "Shipping Rule Condition",
"from_value": 0,
"parentfield": "conditions",
"shipping_amount": 50.0,
"doctype": "Shipping Rule Condition",
"from_value": 0,
"parentfield": "conditions",
"shipping_amount": 50.0,
"to_value": 100
},
},
{
"doctype": "Shipping Rule Condition",
"from_value": 101,
"parentfield": "conditions",
"shipping_amount": 100.0,
"doctype": "Shipping Rule Condition",
"from_value": 101,
"parentfield": "conditions",
"shipping_amount": 100.0,
"to_value": 200
},
},
{
"doctype": "Shipping Rule Condition",
"from_value": 201,
"parentfield": "conditions",
"doctype": "Shipping Rule Condition",
"from_value": 201,
"parentfield": "conditions",
"shipping_amount": 0.0
}
],
"territories": [
{
"doctype": "Applicable Territory",
"parentfield": "territories",
"territory": "_Test Territory India"
}
],
"countries": [
{"country": "India"}
]
},
},
{
"account": "_Test Account Shipping Charges - _TC",
"calculate_based_on": "Net Total",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"doctype": "Shipping Rule",
"label": "_Test Shipping Rule - Rest of the World",
"name": "_Test Shipping Rule - Rest of the World",
"account": "_Test Account Shipping Charges - _TC",
"calculate_based_on": "Net Total",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"doctype": "Shipping Rule",
"label": "_Test Shipping Rule - Rest of the World",
"name": "_Test Shipping Rule - Rest of the World",
"conditions": [
{
"doctype": "Shipping Rule Condition",
"from_value": 0,
"parentfield": "conditions",
"shipping_amount": 500.0,
"doctype": "Shipping Rule Condition",
"from_value": 0,
"parentfield": "conditions",
"shipping_amount": 500.0,
"to_value": 1000
},
},
{
"doctype": "Shipping Rule Condition",
"from_value": 1001,
"parentfield": "conditions",
"shipping_amount": 1000.0,
"doctype": "Shipping Rule Condition",
"from_value": 1001,
"parentfield": "conditions",
"shipping_amount": 1000.0,
"to_value": 2000
},
},
{
"doctype": "Shipping Rule Condition",
"from_value": 2001,
"parentfield": "conditions",
"doctype": "Shipping Rule Condition",
"from_value": 2001,
"parentfield": "conditions",
"shipping_amount": 1500.0
}
],
"territories": [
{
"doctype": "Applicable Territory",
"parentfield": "territories",
"territory": "_Test Territory Rest Of The World"
}
]
],
"worldwide_shipping": 1
}
]
]

View File

@@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "From Value",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -40,6 +41,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "To Value",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -61,6 +63,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Shipping Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
@@ -81,7 +84,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2013-12-20 19:21:46",
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.700694",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Shipping Rule Condition",

View File

@@ -2,26 +2,28 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2013-06-20 12:48:38",
"creation": "2015-09-17 06:43:22.767534",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Other",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "",
"fieldname": "territory",
"fieldname": "country",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Territory",
"label": "Country",
"length": 0,
"no_copy": 0,
"options": "Territory",
"options": "Country",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -33,18 +35,21 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-01-01 14:29:58.724652",
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.731755",
"modified_by": "Administrator",
"module": "Setup",
"name": "Applicable Territory",
"module": "Accounts",
"name": "Shipping Rule Country",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
"read_only_onload": 0
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}

View File

@@ -1,12 +1,10 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# -*- coding: utf-8 -*-
# Copyright (c) 2015, 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 ApplicableTerritory(Document):
pass
class ShippingRuleCountry(Document):
pass

View File

@@ -0,0 +1,67 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
cur_frm.add_fetch("customer", "customer_group", "customer_group" );
cur_frm.add_fetch("supplier", "supplier_type", "supplier_type" );
frappe.ui.form.on("Tax Rule", "tax_type", function(frm) {
frm.toggle_reqd("sales_tax_template", frm.doc.tax_type=="Sales");
frm.toggle_reqd("purchase_tax_template", frm.doc.tax_type=="Purchase");
})
frappe.ui.form.on("Tax Rule", "onload", function(frm) {
if(frm.doc.__islocal) {
frm.set_value("use_for_shopping_cart", 1);
}
})
frappe.ui.form.on("Tax Rule", "refresh", function(frm) {
frappe.ui.form.trigger("Tax Rule", "tax_type");
})
frappe.ui.form.on("Tax Rule", "use_for_shopping_cart", function(frm) {
if(!frm.doc.use_for_shopping_cart &&
(frappe.get_list("Tax Rule", {"use_for_shopping_cart":1}).length == 0)) {
frappe.model.get_value("Shopping Cart Settings", "Shopping Cart Settings",
"enabled", function(docfield) {
if(docfield.enabled){
frm.set_value("use_for_shopping_cart", 1);
frappe.throw(__("Shopping Cart is enabled"));
}
});
}
})
frappe.ui.form.on("Tax Rule", "customer", function(frm) {
frappe.call({
method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
args: {
"party": frm.doc.customer,
"party_type": "customer"
},
callback: function(r) {
if(!r.exc) {
$.each(r.message, function(k, v) {
frm.set_value(k, v);
});
}
}
});
});
frappe.ui.form.on("Tax Rule", "supplier", function(frm) {
frappe.call({
method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
args: {
"party": frm.doc.supplier,
"party_type": "supplier"
},
callback: function(r) {
if(!r.exc) {
$.each(r.message, function(k, v) {
frm.set_value(k, v);
});
}
}
});
});

View File

@@ -1,27 +1,31 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_import": 1,
"allow_rename": 0,
"creation": "2013-04-30 12:58:38",
"autoname": "TR.####",
"creation": "2015-08-07 02:33:52.670866",
"custom": 0,
"description": "System for managing Backups",
"docstatus": 0,
"doctype": "DocType",
"document_type": "System",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "setup",
"fieldtype": "Section Break",
"default": "Sales",
"fieldname": "tax_type",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Download Backups",
"in_list_view": 1,
"label": "Tax Type",
"length": 0,
"no_copy": 0,
"options": "Sales\nPurchase",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -34,13 +38,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "current_backups",
"fieldtype": "HTML",
"fieldname": "use_for_shopping_cart",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Current Backups",
"label": "Use for Shopping Cart",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -56,56 +61,13 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "",
"fieldname": "sync_with_dropbox",
"fieldtype": "Section Break",
"fieldname": "column_break_1",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sync with Dropbox",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "backup_right_now",
"fieldtype": "Button",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Backup Right Now",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "send_backups_to_dropbox",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Send Backups to Dropbox",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@@ -121,18 +83,19 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "send_backups_to_dropbox",
"description": "Note: Backups and files are not deleted from Dropbox, you will have to delete them manually.",
"fieldname": "upload_backups_to_dropbox",
"fieldtype": "Select",
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "sales_tax_template",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Upload Backups to Dropbox",
"label": "Sales Tax Template",
"length": 0,
"no_copy": 0,
"options": "Never\nWeekly\nDaily",
"options": "Sales Taxes and Charges Template",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -145,17 +108,19 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "send_backups_to_dropbox",
"description": "Email ids separated by commas.",
"fieldname": "send_notifications_to",
"fieldtype": "Data",
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "purchase_tax_template",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Send Notifications To",
"label": "Purchase Tax Template",
"length": 0,
"no_copy": 0,
"options": "Purchase Taxes and Charges Template",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -168,123 +133,17 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "dropbox_access_key",
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Dropbox Access Key",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "dropbox_access_secret",
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Dropbox Access Secret",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "dropbox_access_allowed",
"fieldtype": "Check",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Dropbox Access Allowed",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "send_backups_to_dropbox",
"fieldname": "allow_dropbox_access",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Dropbox Access",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Note: Backups and files are not deleted from Google Drive, you will have to delete them manually.",
"fieldname": "sync_with_gdrive",
"fieldname": "filters",
"fieldtype": "Section Break",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sync with Google Drive",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "upload_backups_to_gdrive",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Upload Backups to Google Drive",
"label": "Filters",
"length": 0,
"no_copy": 0,
"options": "Never\nDaily\nWeekly",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -297,15 +156,19 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "allow_gdrive_access",
"fieldtype": "Button",
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Google Drive Access",
"label": "Customer",
"length": 0,
"no_copy": 0,
"options": "Customer",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -318,15 +181,42 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "verification_code",
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier",
"length": 0,
"no_copy": 0,
"options": "Supplier",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "billing_city",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Enter Verification Code",
"label": "Billing City",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -339,15 +229,17 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "validate_gdrive",
"fieldtype": "Button",
"fieldname": "billing_state",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Validate",
"label": "Billing State",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -360,17 +252,20 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "gdrive_access_allowed",
"fieldtype": "Check",
"hidden": 1,
"fieldname": "billing_country",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Google Drive Access Allowed",
"label": "Billing Country",
"length": 0,
"no_copy": 0,
"options": "Country",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -381,17 +276,18 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "gdrive_credentials",
"fieldtype": "Text",
"hidden": 1,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credentials",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -402,17 +298,69 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "database_folder_id",
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "customer_group",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Group",
"length": 0,
"no_copy": 0,
"options": "Customer Group",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "supplier_type",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier Type",
"length": 0,
"no_copy": 0,
"options": "Supplier Type",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "shipping_city",
"fieldtype": "Data",
"hidden": 1,
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Database Folder ID",
"label": "Shipping City",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -423,17 +371,226 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "files_folder_id",
"fieldname": "shipping_state",
"fieldtype": "Data",
"hidden": 1,
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Files Folder ID",
"label": "Shipping State",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "shipping_country",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Shipping Country",
"length": 0,
"no_copy": 0,
"options": "Country",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Validity",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "from_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "From Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_7",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "to_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "To Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"default": "1",
"fieldname": "priority",
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Priority",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_20",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -443,17 +600,17 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-cloud-upload",
"idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-05-26 04:54:10.193573",
"max_attachments": 0,
"modified": "2015-11-16 06:29:59.201327",
"modified_by": "Administrator",
"module": "Setup",
"name": "Backup Manager",
"module": "Accounts",
"name": "Tax Rule",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
@@ -461,16 +618,16 @@
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"delete": 1,
"email": 1,
"export": 0,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 0,
"role": "System Manager",
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
@@ -478,5 +635,7 @@
}
],
"read_only": 0,
"read_only_onload": 0
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}

View File

@@ -0,0 +1,133 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr
class IncorrectCustomerGroup(frappe.ValidationError): pass
class IncorrectSupplierType(frappe.ValidationError): pass
class ConflictingTaxRule(frappe.ValidationError): pass
class TaxRule(Document):
def __setup__(self):
self.flags.ignore_these_exceptions_in_test = [ConflictingTaxRule]
def validate(self):
self.validate_tax_template()
self.validate_date()
self.validate_filters()
def validate_tax_template(self):
if self.tax_type== "Sales":
self.purchase_tax_template = self.supplier = self.supplier_type= None
if self.customer:
self.customer_group = None
else:
self.sales_tax_template= self.customer = self.customer_group= None
if self.supplier:
self.supplier_type = None
if not (self.sales_tax_template or self.purchase_tax_template):
frappe.throw(_("Tax Template is mandatory."))
def validate_date(self):
if self.from_date and self.to_date and self.from_date > self.to_date:
frappe.throw(_("From Date cannot be greater than To Date"))
def validate_filters(self):
filters = {
"tax_type": self.tax_type,
"customer": self.customer,
"customer_group": self.customer_group,
"supplier": self.supplier,
"supplier_type": self.supplier_type,
"billing_city": self.billing_city,
"billing_state": self.billing_state,
"billing_country": self.billing_country,
"shipping_city": self.shipping_city,
"shipping_state": self.shipping_state,
"shipping_country": self.shipping_country,
"company": self.company
}
conds=""
for d in filters:
if conds:
conds += " and "
conds += """ifnull({0}, '') = '{1}'""".format(d, frappe.db.escape(cstr(filters[d])))
if self.from_date and self.to_date:
conds += """ and ((from_date > '{from_date}' and from_date < '{to_date}') or
(to_date > '{from_date}' and to_date < '{to_date}') or
('{from_date}' > from_date and '{from_date}' < to_date) or
('{from_date}' = from_date and '{to_date}' = to_date))""".format(from_date=self.from_date, to_date=self.to_date)
elif self.from_date and not self.to_date:
conds += """ and to_date > '{from_date}'""".format(from_date = self.from_date)
elif self.to_date and not self.from_date:
conds += """ and from_date < '{to_date}'""".format(to_date = self.to_date)
tax_rule = frappe.db.sql("select name, priority \
from `tabTax Rule` where {0} and name != '{1}'".format(conds, self.name), as_dict=1)
if tax_rule:
if tax_rule[0].priority == self.priority:
frappe.throw(_("Tax Rule Conflicts with {0}".format(tax_rule[0].name)), ConflictingTaxRule)
@frappe.whitelist()
def get_party_details(party, party_type, args=None):
out = {}
if args:
billing_filters= {"name": args.get("billing_address")}
shipping_filters= {"name": args.get("shipping_address")}
else:
billing_filters= {party_type: party, "is_primary_address": 1}
shipping_filters= {party_type:party, "is_shipping_address": 1}
billing_address= frappe.get_all("Address", fields=["city", "state", "country"], filters= billing_filters)
shipping_address= frappe.get_all("Address", fields=["city", "state", "country"], filters= shipping_filters)
if billing_address:
out["billing_city"]= billing_address[0].city
out["billing_state"]= billing_address[0].state
out["billing_country"]= billing_address[0].country
if shipping_address:
out["shipping_city"]= shipping_address[0].city
out["shipping_state"]= shipping_address[0].state
out["shipping_country"]= shipping_address[0].country
return out
def get_tax_template(posting_date, args):
"""Get matching tax rule"""
args = frappe._dict(args)
conditions = ["""(from_date is null or from_date = '' or from_date <= '{0}')
and (to_date is null or to_date = '' or to_date >= '{0}')""".format(posting_date)]
for key, value in args.iteritems():
if key in "use_for_shopping_cart":
conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0))
else:
conditions.append("ifnull({0}, '') in ('', '{1}')".format(key, frappe.db.escape(cstr(value))))
tax_rule = frappe.db.sql("""select * from `tabTax Rule`
where {0}""".format(" and ".join(conditions)), as_dict = True)
if not tax_rule:
return None
for rule in tax_rule:
rule.no_of_keys_matched = 0
for key in args:
if rule.get(key): rule.no_of_keys_matched += 1
rule = sorted(tax_rule, lambda b, a: cmp(a.no_of_keys_matched, b.no_of_keys_matched) or cmp(a.priority, b.priority))[0]
return rule.sales_tax_template or rule.purchase_tax_template

View File

@@ -0,0 +1,28 @@
[
{
"doctype": "Tax Rule",
"tax_type" : "Sales",
"sales_tax_template": "_Test Tax 1",
"use_for_shopping_cart": 1,
"billing_city": "_Test City",
"billing_state": "Test State",
"billing_country": "India",
"shipping_city": "_Test City",
"shipping_country": "India",
"priority": 1,
"company": "_Test Company"
},
{
"doctype": "Tax Rule",
"tax_type" : "Sales",
"sales_tax_template": "_Test Tax 2",
"use_for_shopping_cart": 0,
"billing_city": "_Test City",
"billing_country": "India",
"shipping_city": "_Test City",
"shipping_state": "Test State",
"shipping_country": "India",
"priority": 2,
"company": "_Test Company"
}
]

View File

@@ -0,0 +1,130 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.accounts.doctype.tax_rule.tax_rule import IncorrectCustomerGroup, IncorrectSupplierType, ConflictingTaxRule, get_tax_template
test_records = frappe.get_test_records('Tax Rule')
class TestTaxRule(unittest.TestCase):
def setUp(self):
frappe.db.sql("delete from `tabTax Rule` where use_for_shopping_cart <> 1")
def test_conflict(self):
tax_rule1 = make_tax_rule(customer= "_Test Customer",
sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1)
tax_rule1.save()
tax_rule2 = make_tax_rule(customer= "_Test Customer",
sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1)
self.assertRaises(ConflictingTaxRule, tax_rule2.save)
def test_conflict_with_non_overlapping_dates(self):
tax_rule1 = make_tax_rule(customer= "_Test Customer",
sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, from_date = "2015-01-01")
tax_rule1.save()
tax_rule2 = make_tax_rule(customer= "_Test Customer",
sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, to_date = "2013-01-01")
tax_rule2.save()
self.assertTrue(tax_rule2.name)
def test_conflict_with_overlapping_dates(self):
tax_rule1 = make_tax_rule(customer= "_Test Customer",
sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, from_date = "2015-01-01", to_date = "2015-01-05")
tax_rule1.save()
tax_rule2 = make_tax_rule(customer= "_Test Customer",
sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, from_date = "2015-01-03", to_date = "2015-01-09")
self.assertRaises(ConflictingTaxRule, tax_rule2.save)
def test_tax_template(self):
tax_rule = make_tax_rule()
self.assertEquals(tax_rule.purchase_tax_template, None)
def test_select_tax_rule_based_on_customer(self):
make_tax_rule(customer= "_Test Customer",
sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
make_tax_rule(customer= "_Test Customer 1",
sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
make_tax_rule(customer= "_Test Customer 2",
sales_tax_template = "_Test Sales Taxes and Charges Template 2", save=1)
self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer 2"}),
"_Test Sales Taxes and Charges Template 2")
def test_select_tax_rule_based_on_better_match(self):
make_tax_rule(customer= "_Test Customer", billing_city = "Test City", billing_state = "Test State",
sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
make_tax_rule(customer= "_Test Customer", billing_city = "Test City1", billing_state = "Test State",
sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City", "billing_state": "Test State"}),
"_Test Sales Taxes and Charges Template")
def test_select_tax_rule_based_on_state_match(self):
make_tax_rule(customer= "_Test Customer", shipping_state = "Test State",
sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
make_tax_rule(customer= "_Test Customer", shipping_state = "Test State12",
sales_tax_template = "_Test Sales Taxes and Charges Template 1", priority=2, save=1)
self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "shipping_state": "Test State"}),
"_Test Sales Taxes and Charges Template")
def test_select_tax_rule_based_on_better_priority(self):
make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
sales_tax_template = "_Test Sales Taxes and Charges Template", priority=1, save=1)
make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
sales_tax_template = "_Test Sales Taxes and Charges Template 1", priority=2, save=1)
self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City"}),
"_Test Sales Taxes and Charges Template 1")
def test_select_tax_rule_based_cross_matching_keys(self):
make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
make_tax_rule(customer= "_Test Customer 1", billing_city = "Test City 1",
sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City 1"}),
None)
def test_select_tax_rule_based_cross_partially_keys(self):
make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
make_tax_rule(billing_city = "Test City 1",
sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City 1"}),
"_Test Sales Taxes and Charges Template 1")
def make_tax_rule(**args):
args = frappe._dict(args)
tax_rule = frappe.new_doc("Tax Rule")
for key, val in args.iteritems():
if key != "save":
tax_rule.set(key, val)
tax_rule.company = args.company or "_Test Company"
if args.save:
tax_rule.insert()
return tax_rule

View File

@@ -31,10 +31,21 @@ def process_gl_map(gl_map, merge_entries=True):
if flt(entry.debit) < 0:
entry.credit = flt(entry.credit) - flt(entry.debit)
entry.debit = 0.0
if flt(entry.debit_in_account_currency) < 0:
entry.credit_in_account_currency = \
flt(entry.credit_in_account_currency) - flt(entry.debit_in_account_currency)
entry.debit_in_account_currency = 0.0
if flt(entry.credit) < 0:
entry.debit = flt(entry.debit) - flt(entry.credit)
entry.credit = 0.0
if flt(entry.credit_in_account_currency) < 0:
entry.debit_in_account_currency = \
flt(entry.debit_in_account_currency) - flt(entry.credit_in_account_currency)
entry.credit_in_account_currency = 0.0
return gl_map
def merge_similar_entries(gl_map):
@@ -45,7 +56,11 @@ def merge_similar_entries(gl_map):
same_head = check_if_in_list(entry, merged_gl_map)
if same_head:
same_head.debit = flt(same_head.debit) + flt(entry.debit)
same_head.debit_in_account_currency = \
flt(same_head.debit_in_account_currency) + flt(entry.debit_in_account_currency)
same_head.credit = flt(same_head.credit) + flt(entry.credit)
same_head.credit_in_account_currency = \
flt(same_head.credit_in_account_currency) + flt(entry.credit_in_account_currency)
else:
merged_gl_map.append(entry)
@@ -66,7 +81,7 @@ def check_if_in_list(gle, gl_map):
def save_entries(gl_map, adv_adj, update_outstanding):
validate_account_for_auto_accounting_for_stock(gl_map)
round_off_debit_credit(gl_map)
for entry in gl_map:
make_entry(entry, adv_adj, update_outstanding)
# check against budget
@@ -84,7 +99,7 @@ def validate_account_for_auto_accounting_for_stock(gl_map):
if cint(frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock")) \
and gl_map[0].voucher_type=="Journal Entry":
aii_accounts = [d[0] for d in frappe.db.sql("""select name from tabAccount
where account_type = 'Warehouse' and ifnull(warehouse, '')!=''""")]
where account_type = 'Warehouse' and (warehouse != '' and warehouse is not null)""")]
for entry in gl_map:
if entry.account in aii_accounts:
@@ -94,36 +109,36 @@ def validate_account_for_auto_accounting_for_stock(gl_map):
def round_off_debit_credit(gl_map):
precision = get_field_precision(frappe.get_meta("GL Entry").get_field("debit"),
currency=frappe.db.get_value("Company", gl_map[0].company, "default_currency", cache=True))
debit_credit_diff = 0.0
for entry in gl_map:
entry.debit = flt(entry.debit, precision)
entry.credit = flt(entry.credit, precision)
debit_credit_diff += entry.debit - entry.credit
debit_credit_diff = flt(debit_credit_diff, precision)
if abs(debit_credit_diff) >= (5.0 / (10**precision)):
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.")
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
elif abs(debit_credit_diff) >= (1.0 / (10**precision)):
make_round_off_gle(gl_map, debit_credit_diff)
def make_round_off_gle(gl_map, debit_credit_diff):
round_off_account, round_off_cost_center = frappe.db.get_value("Company", gl_map[0].company,
round_off_account, round_off_cost_center = frappe.db.get_value("Company", gl_map[0].company,
["round_off_account", "round_off_cost_center"]) or [None, None]
if not round_off_account:
frappe.throw(_("Please mention Round Off Account in Company"))
if not round_off_cost_center:
frappe.throw(_("Please mention Round Off Cost Center in Company"))
round_off_gle = frappe._dict()
for k in ["voucher_type", "voucher_no", "company",
for k in ["voucher_type", "voucher_no", "company",
"posting_date", "remarks", "fiscal_year", "is_opening"]:
round_off_gle[k] = gl_map[0][k]
round_off_gle.update({
"account": round_off_account,
"debit": abs(debit_credit_diff) if debit_credit_diff < 0 else 0,
@@ -134,7 +149,7 @@ def make_round_off_gle(gl_map, debit_credit_diff):
"against_voucher_type": None,
"against_voucher": None
})
gl_map.append(round_off_gle)

View File

@@ -42,13 +42,13 @@ frappe.pages["Accounts Browser"].on_page_load = function(wrapper){
wrapper.page.add_menu_item(__('New Company'), function() { newdoc('Company'); }, true);
}
wrapper.page.set_secondary_action(__('Refresh'), function() {
wrapper.page.add_menu_item(__('Refresh'), function() {
wrapper.$company_select.change();
});
wrapper.page.set_primary_action(__('New'), function() {
erpnext.account_chart && erpnext.account_chart.make_new();
});
}, "octicon octicon-plus");
// company-select
wrapper.$company_select = wrapper.page.add_select("Company", [])
@@ -117,11 +117,12 @@ erpnext.AccountsChart = Class.extend({
}
},
{
condition: function(node) { return !node.root && node.expandable; },
condition: function(node) { return node.expandable; },
label: __("Add Child"),
click: function() {
me.make_new()
}
},
btnClass: "hidden-xs"
},
{
condition: function(node) {
@@ -137,17 +138,18 @@ erpnext.AccountsChart = Class.extend({
"company": me.company
};
frappe.set_route("query-report", "General Ledger");
}
},
btnClass: "hidden-xs"
},
{
condition: function(node) { return !node.root && me.can_write },
label: __("Rename"),
click: function(node) {
frappe.model.rename_doc(me.ctype, node.label, function(new_name) {
node.reload();
node.reload_parent();
});
}
},
btnClass: "hidden-xs"
},
{
condition: function(node) { return !node.root && me.can_delete },
@@ -156,14 +158,18 @@ erpnext.AccountsChart = Class.extend({
frappe.model.delete_doc(me.ctype, node.label, function() {
node.parent.remove();
});
}
},
btnClass: "hidden-xs"
}
],
onrender: function(node) {
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
if (me.ctype == 'Account' && node.data && node.data.balance!==undefined) {
$('<span class="balance-area pull-right text-muted small">'
+ format_currency(Math.abs(node.data.balance), node.data.currency)
+ (node.data.balance_in_account_currency ?
(format_currency(Math.abs(node.data.balance_in_account_currency),
node.data.account_currency) + " / ") : "")
+ format_currency(Math.abs(node.data.balance), node.data.company_currency)
+ " " + dr_or_cr
+ '</span>').insertBefore(node.$ul);
}
@@ -205,13 +211,16 @@ erpnext.AccountsChart = Class.extend({
description: __("Name of new Account. Note: Please don't create accounts for Customers and Suppliers")},
{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
description: __('Further accounts can be made under Groups, but entries can be made against non-Groups')},
{fieldtype:'Select', fieldname:'root_type', label:__('Root Type'),
options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n'),
},
{fieldtype:'Select', fieldname:'account_type', label:__('Account Type'),
options: ['', 'Bank', 'Cash', 'Warehouse', 'Receivable', 'Payable',
'Equity', 'Cost of Goods Sold', 'Fixed Asset', 'Expense Account',
'Income Account', 'Tax', 'Chargeable', 'Temporary'].join('\n'),
options: ['', 'Bank', 'Cash', 'Warehouse', 'Tax', 'Chargeable'].join('\n'),
description: __("Optional. This setting will be used to filter in various transactions.") },
{fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate')},
{fieldtype:'Link', fieldname:'warehouse', label:__('Warehouse'), options:"Warehouse"}
{fieldtype:'Link', fieldname:'warehouse', label:__('Warehouse'), options:"Warehouse"},
{fieldtype:'Link', fieldname:'account_currency', label:__('Currency'), options:"Currency",
description: __("Optional. Sets company's default currency, if not specified.")}
]
})
@@ -235,6 +244,9 @@ erpnext.AccountsChart = Class.extend({
$(fd.warehouse.wrapper).toggle(fd.account_type.get_value()==='Warehouse');
})
// root type if root
$(fd.root_type.wrapper).toggle(node.root);
// create
d.set_primary_action(__("Create New"), function() {
var btn = this;
@@ -250,6 +262,14 @@ erpnext.AccountsChart = Class.extend({
v.parent_account = node.label;
v.company = me.company;
if(node.root) {
v.is_root = true;
v.parent_account = null;
} else {
v.is_root = false;
v.root_type = null;
}
return frappe.call({
args: v,
method: 'erpnext.accounts.utils.add_ac',
@@ -258,7 +278,7 @@ erpnext.AccountsChart = Class.extend({
if(node.expanded) {
node.toggle_node();
}
node.reload();
node.load();
}
});
});
@@ -304,7 +324,7 @@ erpnext.AccountsChart = Class.extend({
if(node.expanded) {
node.toggle_node();
}
node.reload();
node.load();
}
});
});

View File

@@ -18,36 +18,40 @@ def get_companies():
def get_children():
args = frappe.local.form_dict
ctype, company = args['ctype'], args['comp']
fieldname = frappe.db.escape(ctype.lower().replace(' ','_'))
doctype = frappe.db.escape(ctype)
# root
if args['parent'] in ("Accounts", "Cost Centers"):
select_cond = ", root_type, report_type" if args["parent"]=="Accounts" else ""
fields = ", root_type, report_type, account_currency" if ctype=="Account" else ""
acc = frappe.db.sql(""" select
name as value, is_group as expandable %s
from `tab%s`
where ifnull(parent_%s,'') = ''
name as value, is_group as expandable {fields}
from `tab{doctype}`
where ifnull(`parent_{fieldname}`,'') = ''
and `company` = %s and docstatus<2
order by name""" % (select_cond, ctype, ctype.lower().replace(' ','_'), '%s'),
order by name""".format(fields=fields, fieldname = fieldname, doctype=doctype),
company, as_dict=1)
if args["parent"]=="Accounts":
sort_root_accounts(acc)
else:
# other
fields = ", account_currency" if ctype=="Account" else ""
acc = frappe.db.sql("""select
name as value, is_group as expandable
from `tab%s`
where ifnull(parent_%s,'') = %s
name as value, is_group as expandable, parent_{fieldname} as parent {fields}
from `tab{doctype}`
where ifnull(`parent_{fieldname}`,'') = %s
and docstatus<2
order by name""" % (ctype, ctype.lower().replace(' ','_'), '%s'),
order by name""".format(fields=fields, fieldname=fieldname, doctype=doctype),
args['parent'], as_dict=1)
if ctype == 'Account':
currency = frappe.db.sql("select default_currency from `tabCompany` where name = %s", company)[0][0]
company_currency = frappe.db.get_value("Company", company, "default_currency")
for each in acc:
bal = get_balance_on(each.get("value"))
each["currency"] = currency
each["balance"] = flt(bal)
each["company_currency"] = company_currency
each["balance"] = flt(get_balance_on(each.get("value"), in_account_currency=False))
if each.account_currency != company_currency:
each["balance_in_account_currency"] = flt(get_balance_on(each.get("value")))
return acc

View File

@@ -7,9 +7,12 @@ import frappe
import datetime
from frappe import _, msgprint, scrub
from frappe.defaults import get_user_permissions
from frappe.utils import add_days, getdate, formatdate, flt, get_first_day, date_diff, nowdate
from frappe.utils import add_days, getdate, formatdate, get_first_day, date_diff
from erpnext.utilities.doctype.address.address import get_address_display
from erpnext.utilities.doctype.contact.contact import get_contact_details
from erpnext.exceptions import InvalidAccountCurrency
class DuplicatePartyAccountError(frappe.ValidationError): pass
@frappe.whitelist()
def get_party_details(party=None, account=None, party_type="Customer", company=None,
@@ -17,7 +20,7 @@ def get_party_details(party=None, account=None, party_type="Customer", company=N
if not party:
return {}
if not frappe.db.exists(party_type, party):
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
@@ -26,13 +29,13 @@ def get_party_details(party=None, account=None, party_type="Customer", company=N
def _get_party_details(party=None, account=None, party_type="Customer", company=None,
posting_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False):
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, doctype))
party = out[party_type.lower()]
if not ignore_permissions and not frappe.has_permission(party_type, "read", party):
frappe.throw(_("Not permitted"), frappe.PermissionError)
frappe.throw(_("Not permitted for {0}").format(party), frappe.PermissionError)
party = frappe.get_doc(party_type, party)
@@ -40,6 +43,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
set_contact_details(out, party, party_type)
set_other_values(out, party, party_type)
set_price_list(out, party, party_type, price_list)
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_type)
if not out.get("currency"):
out["currency"] = currency
@@ -48,8 +52,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
if party_type=="Customer":
out["sales_team"] = [{
"sales_person": d.sales_person,
"sales_designation": d.sales_designation,
"allocated_percentage": d.allocated_percentage
"allocated_percentage": d.allocated_percentage or None
} for d in party.get("sales_team")]
return out
@@ -96,11 +99,24 @@ def set_other_values(out, party, party_type):
out[f] = party.get(f)
# fields prepended with default in Customer doctype
for f in ['currency', 'taxes_and_charges'] \
for f in ['currency'] \
+ (['sales_partner', 'commission_rate'] if party_type=="Customer" else []):
if party.get("default_" + f):
out[f] = party.get("default_" + f)
def get_default_price_list(party):
"""Return default price list for party (Document object)"""
if party.default_price_list:
return party.default_price_list
if party.doctype == "Customer":
price_list = frappe.db.get_value("Customer Group",
party.customer_group, "default_price_list")
if price_list:
return price_list
return None
def set_price_list(out, party, party_type, given_price_list):
# price list
price_list = filter(None, get_user_permissions().get("Price List", []))
@@ -108,11 +124,7 @@ def set_price_list(out, party, party_type, given_price_list):
price_list = price_list[0] if len(price_list)==1 else None
if not price_list:
price_list = party.default_price_list
if not price_list and party_type=="Customer":
price_list = frappe.db.get_value("Customer Group",
party.customer_group, "default_price_list")
price_list = get_default_price_list(party)
if not price_list:
price_list = given_price_list
@@ -131,7 +143,7 @@ def set_account_and_due_date(party, account, party_type, company, posting_date,
}
if party:
account = get_party_account(company, party, party_type)
account = get_party_account(party_type, party, company)
account_fieldname = "debit_to" if party_type=="Customer" else "credit_to"
@@ -142,14 +154,21 @@ def set_account_and_due_date(party, account, party_type, company, posting_date,
}
return out
def get_company_currency():
company_currency = frappe._dict()
for d in frappe.get_all("Company", fields=["name", "default_currency"]):
company_currency.setdefault(d.name, d.default_currency)
return company_currency
@frappe.whitelist()
def get_party_account(company, party, party_type):
def get_party_account(party_type, party, company):
"""Returns the account for the given `party`.
Will first search in party (Customer / Supplier) record, if not found,
will search in group (Customer Group / Supplier Type),
finally will return default."""
if not company:
frappe.throw(_("Please select company first."))
frappe.throw(_("Please select a Company"))
if party:
account = frappe.db.get_value("Party Account",
@@ -167,6 +186,51 @@ def get_party_account(company, party, party_type):
return account
def get_party_account_currency(party_type, party, company):
def generator():
party_account = get_party_account(party_type, party, company)
return frappe.db.get_value("Account", party_account, "account_currency")
return frappe.local_cache("party_account_currency", (party_type, party, company), generator)
def get_party_gle_currency(party_type, party, company):
def generator():
existing_gle_currency = frappe.db.sql("""select account_currency from `tabGL Entry`
where docstatus=1 and company=%(company)s and party_type=%(party_type)s and party=%(party)s
limit 1""", { "company": company, "party_type": party_type, "party": party })
return existing_gle_currency[0][0] if existing_gle_currency else None
return frappe.local_cache("party_gle_currency", (party_type, party, company), generator,
regenerate_if_none=True)
def validate_party_gle_currency(party_type, party, company, party_account_currency=None):
"""Validate party account currency with existing GL Entry's currency"""
if not party_account_currency:
party_account_currency = get_party_account_currency(party_type, party, company)
existing_gle_currency = get_party_gle_currency(party_type, party, company)
if existing_gle_currency and party_account_currency != existing_gle_currency:
frappe.throw(_("Accounting Entry for {0}: {1} can only be made in currency: {2}")
.format(party_type, party, existing_gle_currency), InvalidAccountCurrency)
def validate_party_accounts(doc):
companies = []
for account in doc.get("accounts"):
if account.company in companies:
frappe.throw(_("There can only be 1 Account per Company in {0} {1}")
.format(doc.doctype, doc.name), DuplicatePartyAccountError)
else:
companies.append(account.company)
party_account_currency = frappe.db.get_value("Account", account.account, "account_currency")
existing_gle_currency = get_party_gle_currency(doc.doctype, doc.name, account.company)
if existing_gle_currency and party_account_currency != existing_gle_currency:
frappe.throw(_("Accounting entries have already been made in currency {0} for company {1}. Please select a receivable or payable account with currency {0}.").format(existing_gle_currency, account.company))
@frappe.whitelist()
def get_due_date(posting_date, party_type, party, company):
"""Set Due Date = Posting Date + Credit Days"""
@@ -183,7 +247,7 @@ def get_due_date(posting_date, party_type, party, company):
credit_days = get_credit_days(party_type, party, company)
if credit_days:
due_date = add_days(posting_date, credit_days)
return due_date
def get_credit_days(party_type, party, company):
@@ -191,30 +255,60 @@ def get_credit_days(party_type, party, company):
if party_type == "Customer":
credit_days_based_on, credit_days, customer_group = \
frappe.db.get_value(party_type, party, ["credit_days_based_on", "credit_days", "customer_group"])
if not credit_days_based_on:
credit_days_based_on, credit_days = \
frappe.db.get_value("Customer Group", customer_group, ["credit_days_based_on", "credit_days"]) \
or frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"])
return credit_days_based_on, credit_days
else:
credit_days, supplier_type = frappe.db.get_value(party_type, party, ["credit_days", "supplier_type"])
if not credit_days:
credit_days = frappe.db.get_value("Supplier Type", supplier_type, "credit_days") \
or frappe.db.get_value("Company", company, "credit_days")
return credit_days
def validate_due_date(posting_date, due_date, party_type, party, company):
if getdate(due_date) < getdate(posting_date):
frappe.throw(_("Due Date cannot be before Posting Date"))
else:
default_due_date = get_due_date(posting_date, party_type, party, company)
if not default_due_date:
return
if default_due_date != posting_date and getdate(due_date) > getdate(default_due_date):
is_credit_controller = frappe.db.get_single_value("Accounts Settings", "credit_controller") in frappe.get_roles()
if is_credit_controller:
msgprint(_("Note: Due / Reference Date exceeds allowed customer credit days by {0} day(s)")
.format(date_diff(due_date, default_due_date)))
else:
frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
@frappe.whitelist()
def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None,
billing_address=None, shipping_address=None, use_for_shopping_cart=None):
from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details
args = {
party_type.lower(): party,
"customer_group": customer_group,
"supplier_type": supplier_type,
"company": company
}
if billing_address or shipping_address:
args.update(get_party_details(party, party_type, {"billing_address": billing_address, \
"shipping_address": shipping_address }))
else:
args.update(get_party_details(party, party_type))
if party_type=="Customer":
args.update({"tax_type": "Sales"})
else:
args.update({"tax_type": "Purchase"})
if use_for_shopping_cart:
args.update({"use_for_shopping_cart": use_for_shopping_cart})
return get_tax_template(posting_date, args)

View File

@@ -0,0 +1,30 @@
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
<div class="page-break">
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
and doc.set("select_print_heading", _("Payment Receipt Note")) -%}{%- endif -%}
{{ add_header(0, 1, doc, letter_head, no_letterhead) }}
{%- for label, value in (
(_("Received On"), frappe.utils.formatdate(doc.voucher_date)),
(_("Received From"), doc.pay_to_recd_from),
(_("Amount"), "<strong>" + doc.get_formatted("total_amount") + "</strong><br>" + (doc.total_amount_in_words or "") + "<br>"),
(_("Remarks"), doc.remark)
) -%}
<div class="row">
<div class="col-xs-3"><label class="text-right">{{ label }}</label></div>
<div class="col-xs-9">{{ value }}</div>
</div>
{%- endfor -%}
<hr>
<br>
<p class="strong">
{{ _("For") }} {{ doc.company }},<br>
<br>
<br>
<br>
{{ _("Authorized Signatory") }}
</p>
</div>

View File

@@ -1,15 +1,17 @@
{
"creation": "2012-05-01 12:46:31",
"doc_type": "Journal Entry",
"docstatus": 0,
"doctype": "Print Format",
"html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Receipt Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Received On\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Received From\"), doc.pay_to_recd_from),\n (_(\"Amount\"), \"<strong>\" + doc.get_formatted(\"total_amount\") + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n <div class=\"row\">\n <div class=\"col-xs-3\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-9\">{{ value }}</div>\n </div>\n\n {%- endfor -%}\n\n <hr>\n <br>\n <p class=\"strong\">\n {{ _(\"For\") }} {{ doc.company }},<br>\n <br>\n <br>\n <br>\n {{ _(\"Authorized Signatory\") }}\n </p>\n</div>\n\n",
"idx": 1,
"modified": "2015-01-16 11:03:22.893209",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Receipt Voucher",
"owner": "Administrator",
"print_format_type": "Server",
"creation": "2012-05-01 12:46:31",
"custom_format": 0,
"disabled": 0,
"doc_type": "Journal Entry",
"docstatus": 0,
"doctype": "Print Format",
"html": "",
"idx": 1,
"modified": "2015-11-25 07:06:00.668141",
"modified_by": "Administrator",
"name": "Payment Receipt Voucher",
"owner": "Administrator",
"print_format_builder": 0,
"print_format_type": "Server",
"standard": "Yes"
}
}

View File

@@ -24,25 +24,53 @@ class ReceivablePayableReport(object):
if party_naming_by == "Naming Series":
columns += [args.get("party_type") + " Name::110"]
columns += [_("Voucher Type") + "::110", _("Voucher No") + ":Dynamic Link/Voucher Type:120",
columns += [_("Voucher Type") + "::110", _("Voucher No") + ":Dynamic Link/"+_("Voucher Type")+":120",
_("Due Date") + ":Date:80"]
if args.get("party_type") == "Supplier":
columns += [_("Bill No") + "::80", _("Bill Date") + ":Date:80"]
columns += [_("Invoiced Amount") + ":Currency:100", _("Paid Amount") + ":Currency:100",
_("Outstanding Amount") + ":Currency:100", _("Age") + ":Int:50",
"0-" + str(self.filters.range1) + ":Currency:100",
str(self.filters.range1) + "-" + str(self.filters.range2) + ":Currency:100",
str(self.filters.range2) + "-" + str(self.filters.range3) + ":Currency:100",
str(self.filters.range3) + _("-Above") + ":Currency:100"
]
for label in ("Invoiced Amount", "Paid Amount", "Outstanding Amount"):
columns.append({
"label": label,
"fieldtype": "Currency",
"options": "currency",
"width": 120
})
columns += [_("Age (Days)") + ":Int:80"]
if not "range1" in self.filters:
self.filters["range1"] = "30"
if not "range2" in self.filters:
self.filters["range2"] = "60"
if not "range3" in self.filters:
self.filters["range3"] = "90"
for label in ("0-{range1}".format(**self.filters),
"{range1}-{range2}".format(**self.filters),
"{range2}-{range3}".format(**self.filters),
"{range3}-{above}".format(range3=self.filters.range3, above=_("Above"))):
columns.append({
"label": label,
"fieldtype": "Currency",
"options": "currency",
"width": 120
})
if args.get("party_type") == "Customer":
columns += [_("Territory") + ":Link/Territory:80"]
if args.get("party_type") == "Supplier":
columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
columns += [_("Remarks") + "::200"]
columns += [
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Data",
"width": 100,
},
_("Remarks") + "::200"
]
return columns
@@ -55,6 +83,8 @@ class ReceivablePayableReport(object):
future_vouchers = self.get_entries_after(self.filters.report_date, args.get("party_type"))
company_currency = frappe.db.get_value("Company", self.filters.get("company"), "default_currency")
data = []
for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")):
if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers):
@@ -91,10 +121,16 @@ class ReceivablePayableReport(object):
# customer territory / supplier type
if args.get("party_type") == "Customer":
row += [self.get_territory(gle.party), gle.remarks]
row += [self.get_territory(gle.party)]
if args.get("party_type") == "Supplier":
row += [self.get_supplier_type(gle.party), gle.remarks]
row += [self.get_supplier_type(gle.party)]
if self.filters.get(scrub(args.get("party_type"))):
row.append(gle.account_currency)
else:
row.append(company_currency)
row.append(gle.remarks)
data.append(row)
return data
@@ -155,7 +191,7 @@ class ReceivablePayableReport(object):
def get_voucher_details(self, party_type):
voucher_details = frappe._dict()
if party_type == "Customer":
for si in frappe.db.sql("""select name, due_date
from `tabSales Invoice` where docstatus=1""", as_dict=1):
@@ -171,17 +207,25 @@ class ReceivablePayableReport(object):
def get_gl_entries(self, party_type):
if not hasattr(self, "gl_entries"):
conditions, values = self.prepare_conditions(party_type)
self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party, debit, credit,
voucher_type, voucher_no, against_voucher_type, against_voucher from `tabGL Entry`
where docstatus < 2 and party_type=%s {0} order by posting_date, party"""
.format(conditions), values, as_dict=True)
if self.filters.get(scrub(party_type)):
select_fields = "debit_in_account_currency as debit, credit_in_account_currency as credit"
else:
select_fields = "debit, credit"
self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party,
voucher_type, voucher_no, against_voucher_type, against_voucher, account_currency, remarks, {0}
from `tabGL Entry`
where docstatus < 2 and party_type=%s and (party is not null and party != '') {1}
order by posting_date, party"""
.format(select_fields, conditions), values, as_dict=True)
return self.gl_entries
def prepare_conditions(self, party_type):
conditions = [""]
values = [party_type]
party_type_field = scrub(party_type)
if self.filters.company:
@@ -190,7 +234,7 @@ class ReceivablePayableReport(object):
if self.filters.get(party_type_field):
conditions.append("party=%s")
values.append(self.filters.get(party_type_field))
values.append(self.filters.get(party_type_field))
return " and ".join(conditions), values

View File

@@ -2,7 +2,7 @@
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __("Bank Reconciliation Statement") %}</h2>
<h4 class="text-center">{%= filters.account && (filters.account + ", ") || "" %} {%= filters.company %}</h4>
<h4 class="text-center">{%= filters.account %}</h4>
<hr>
<table class="table table-bordered">
<thead>
@@ -16,31 +16,31 @@
</thead>
<tbody>
{% for(var i=0, l=data.length; i<l; i++) { %}
{% if (data[i][__("Posting Date")]) { %}
{% if (data[i]["posting_date"]) { %}
<tr>
<td>{%= dateutil.str_to_user(data[i][__("Posting Date")]) %}</td>
<td>{%= data[i][__("Journal Entry")] %}</td>
<td>{%= __("Against") %}: {%= data[i][__("Against Account")] %}
{% if (data[i][__("Reference")]) { %}
<br>{%= __("Reference") %}: {%= data[i][__("Reference")] %}
{% if (data[i][__("Ref Date")]) { %}
<br>{%= __("Reference Date") %}: {%= dateutil.str_to_user(data[i][__("Ref Date")]) %}
<td>{%= dateutil.str_to_user(data[i]["posting_date"]) %}</td>
<td>{%= data[i]["journal_entry"] %}</td>
<td>{%= __("Against") %}: {%= data[i]["against_account"] %}
{% if (data[i]["reference"]) { %}
<br>{%= __("Reference") %}: {%= data[i]["reference"] %}
{% if (data[i]["ref_date"]) { %}
<br>{%= __("Reference Date") %}: {%= dateutil.str_to_user(data[i]["ref_date"]) %}
{% } %}
{% } %}
{% if (data[i][__("Clearance Date")]) { %}
<br>{%= __("Clearance Date") %}: {%= dateutil.str_to_user(data[i][__("Clearance Date")]) %}
{% if (data[i]["clearance_date"]) { %}
<br>{%= __("Clearance Date") %}: {%= dateutil.str_to_user(data[i]["clearance_date"]) %}
{% } %}
</td>
<td style="text-align: right">{%= format_currency(data[i][__("Debit")]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Credit")]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["debit"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["credit"]) %}</td>
</tr>
{% } else { %}
<tr>
<td></td>
<td></td>
<td>{%= data[i][__("Journal Entry")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Debit")]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Credit")]) %}</td>
<td>{%= data[i]["journal_entry"] %}</td>
<td style="text-align: right">{%= format_currency(data[i]["debit"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["credit"]) %}</td>
</tr>
{% } %}
{% } %}

View File

@@ -12,18 +12,21 @@ def execute(filters=None):
columns = get_columns()
if not filters.get("account"): return columns, []
account_currency = frappe.db.get_value("Account", filters.account, "account_currency")
data = get_entries(filters)
from erpnext.accounts.utils import get_balance_on
balance_as_per_system = get_balance_on(filters["account"], filters["report_date"])
total_debit, total_credit = 0,0
for d in data:
total_debit += flt(d[2])
total_credit += flt(d[3])
total_debit += flt(d.debit)
total_credit += flt(d.credit)
amounts_not_reflected_in_system = frappe.db.sql("""select sum(ifnull(jvd.debit, 0) - ifnull(jvd.credit, 0))
amounts_not_reflected_in_system = frappe.db.sql("""
select sum(jvd.debit_in_account_currency - jvd.credit_in_account_currency)
from `tabJournal Entry Account` jvd, `tabJournal Entry` jv
where jvd.parent = jv.name and jv.docstatus=1 and jvd.account=%s
and jv.posting_date > %s and jv.clearance_date <= %s and ifnull(jv.is_opening, 'No') = 'No'
@@ -36,38 +39,112 @@ def execute(filters=None):
+ amounts_not_reflected_in_system
data += [
get_balance_row(_("System Balance"), balance_as_per_system),
[""]*len(columns),
["", '"' + _("Amounts not reflected in bank") + '"', total_debit, total_credit, "", "", "", ""],
get_balance_row(_("Amounts not reflected in system"), amounts_not_reflected_in_system),
[""]*len(columns),
get_balance_row(_("Expected balance as per bank"), bank_bal)
get_balance_row(_("System Balance"), balance_as_per_system, account_currency),
{},
{
"journal_entry": '"' + _("Amounts not reflected in bank") + '"',
"debit": total_debit,
"credit": total_credit,
"account_currency": account_currency
},
get_balance_row(_("Amounts not reflected in system"), amounts_not_reflected_in_system,
account_currency),
{},
get_balance_row(_("Expected balance as per bank"), bank_bal, account_currency)
]
return columns, data
def get_columns():
return [_("Posting Date") + ":Date:100", _("Journal Entry") + ":Link/Journal Entry:220",
_("Debit") + ":Currency:120", _("Credit") + ":Currency:120",
_("Against Account") + ":Link/Account:200", _("Reference") + "::100", _("Ref Date") + ":Date:110", _("Clearance Date") + ":Date:110"
return [
{
"fieldname": "posting_date",
"label": _("Posting Date"),
"fieldtype": "Date",
"width": 100
},
{
"fieldname": "journal_entry",
"label": _("Journal Entry"),
"fieldtype": "Link",
"options": "Journal Entry",
"width": 220
},
{
"fieldname": "debit",
"label": _("Debit"),
"fieldtype": "Currency",
"options": "account_currency",
"width": 120
},
{
"fieldname": "credit",
"label": _("Credit"),
"fieldtype": "Currency",
"options": "account_currency",
"width": 120
},
{
"fieldname": "against_account",
"label": _("Against Account"),
"fieldtype": "Link",
"options": "Account",
"width": 200
},
{
"fieldname": "reference",
"label": _("Reference"),
"fieldtype": "Data",
"width": 100
},
{
"fieldname": "ref_date",
"label": _("Ref Date"),
"fieldtype": "Date",
"width": 110
},
{
"fieldname": "clearance_date",
"label": _("Clearance Date"),
"fieldtype": "Date",
"width": 110
},
{
"fieldname": "account_currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"width": 100
}
]
def get_entries(filters):
entries = frappe.db.sql("""select
jv.posting_date, jv.name, jvd.debit, jvd.credit,
jvd.against_account, jv.cheque_no, jv.cheque_date, jv.clearance_date
jv.posting_date, jv.name as journal_entry, jvd.debit_in_account_currency as debit,
jvd.credit_in_account_currency as credit, jvd.against_account,
jv.cheque_no as reference, jv.cheque_date as ref_date, jv.clearance_date, jvd.account_currency
from
`tabJournal Entry Account` jvd, `tabJournal Entry` jv
where jvd.parent = jv.name and jv.docstatus=1
and jvd.account = %(account)s and jv.posting_date <= %(report_date)s
and ifnull(jv.clearance_date, '4000-01-01') > %(report_date)s
and ifnull(jv.is_opening, 'No') = 'No'
order by jv.name DESC""", filters, as_list=1)
order by jv.name DESC""", filters, as_dict=1)
return entries
def get_balance_row(label, amount):
def get_balance_row(label, amount, account_currency):
if amount > 0:
return ["", '"' + label + '"', amount, 0, "", "", "", ""]
return {
"journal_entry": '"' + label + '"',
"debit": amount,
"credit": 0,
"account_currency": account_currency
}
else:
return ["", '"' + label + '"', 0, abs(amount), "", "", "", ""]
return {
"journal_entry": '"' + label + '"',
"debit": 0,
"credit": abs(amount),
"account_currency": account_currency
}

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