Compare commits

..

225 Commits

Author SHA1 Message Date
Pratik Vyas
da0a23e635 remove print in patch, booboo 2014-02-17 14:56:00 +05:30
Pratik Vyas
31affc0e67 bump modified dates for purchase receipt and purchase invoice 2014-02-17 11:36:10 +05:30
Pratik Vyas
d4f9af3498 Delete install_erpnext.py 2014-02-15 15:29:29 +05:30
Pratik Vyas
ad9b4faa47 Update README.md 2014-02-15 15:23:25 +05:30
Pratik Vyas
0240dc53ae 4.change version to 4.0.0-beta 2014-02-14 16:10:55 +05:30
Pratik Vyas
ed20b68a3a Update .travis.yml 2014-02-14 16:10:03 +05:30
Rushabh Mehta
86903e5f5b fixed travis 2014-02-14 15:54:43 +05:30
Rushabh Mehta
793ba6bd37 -webnotes +frappe 💥 2014-02-14 15:47:51 +05:30
Nabin Hait
8ae051cb39 fixed conflict 2014-02-14 13:42:41 +05:30
Nabin Hait
adeff27f28 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0.0-wip 2014-02-14 13:41:00 +05:30
Nabin Hait
9ea461638e minor fix 2014-02-14 13:40:41 +05:30
Rushabh Mehta
989b60ae52 removed setup from desktop: 2014-02-14 13:16:39 +05:30
Pratik Vyas
fc274e29ec Merge branch 'develop' 2014-02-14 10:36:23 +05:30
Pratik Vyas
d45f7d60c3 bumped to version 3.8.6 2014-02-14 11:06:23 +06:00
Nabin Hait
c1611abebf Merge pull request #1418 from nabinhait/hotfix
minor fixes in account receivable/payable
2014-02-13 18:44:15 +05:30
Nabin Hait
e0f6b3edbe minor fixes in account receivable/payable 2014-02-13 18:43:18 +05:30
Nabin Hait
a038831c45 validate item of item_price record 2014-02-13 15:54:51 +05:30
Nabin Hait
36028bfb56 minor 2014-02-12 19:09:28 +05:30
Nabin Hait
a87121c6da Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0.0-wip 2014-02-12 17:09:08 +05:30
Nabin Hait
e219d61ed4 patch included in patches txt 2014-02-12 17:08:35 +05:30
Nabin Hait
66b2717c54 Merge pull request #1414 from akhileshdarjee/4.0-hotfix
Customer and Supplier dashboard set to company currency
2014-02-12 16:55:17 +05:30
Nabin Hait
eba1bdbcca minor fixes 2014-02-12 16:04:17 +05:30
Nabin Hait
139dc7b9b2 minor fixes 2014-02-12 14:54:16 +05:30
Nabin Hait
0aa71a5c41 minor fixes 2014-02-12 14:54:15 +05:30
Nabin Hait
5aecc538dd Letter Head field added in purchase receipt and invoice 2014-02-12 14:54:15 +05:30
Nabin Hait
5f59726903 Rename fields: replaced in html and txt files 2014-02-12 14:54:15 +05:30
Nabin Hait
1eb560130a Rename fields: amount related fields 2014-02-12 14:54:14 +05:30
Nabin Hait
7979f7ed21 Field Rename: rate field mass replacement 2014-02-12 14:54:14 +05:30
Nabin Hait
a7f757a3f4 Rename fields: initial commit 2014-02-12 14:54:13 +05:30
Nabin Hait
777397489e Fields renamed in schema 2014-02-12 14:54:13 +05:30
Nabin Hait
436f526102 commonify get_item_details and rename fields to sync selling and purchase 2014-02-12 14:54:12 +05:30
Nabin Hait
c28c86dfd8 Validate duplicate serial nos entry 2014-02-12 14:54:11 +05:30
Nabin Hait
9beffb646d Validate duplicate serial nos entry 2014-02-12 14:54:11 +05:30
Nabin Hait
f0d29be1d5 Removed on_trash function from support ticket 2014-02-12 14:54:11 +05:30
Akhilesh Darjee
f2b7cd65a9 customer and supplier dashboard set to company currency 2014-02-12 11:29:08 +05:30
Anand Doshi
2735733d1f Minor fix in setup import 2014-02-11 20:28:11 +05:30
Anand Doshi
93fdc670fe Fixes in Test Cases 2014-02-11 14:40:21 +05:30
Nabin Hait
40c5174aa0 Merge pull request #1410 from nabinhait/hotfix
Hotfix
2014-02-11 12:03:11 +05:30
Nabin Hait
0799b28e46 Letter Head field added in purchase receipt and invoice 2014-02-11 12:02:46 +05:30
Pratik Vyas
89a3ee7f57 Merge branch 'develop' 2014-02-10 20:57:25 +05:30
Pratik Vyas
347bf93b4f bumped to version 3.8.5 2014-02-10 21:27:25 +06:00
Anand Doshi
d7cc47e3ac Do not validate Material Request against Sales Order, Moved Setup page to Framework 2014-02-10 17:39:12 +05:30
Anand Doshi
1d7e933590 Fix in Get Job Applications 2014-02-07 20:26:56 +05:30
Anand Doshi
080b64a98f Fixes in Sales Partner and Support Mails 2014-02-07 19:14:21 +05:30
Rushabh Mehta
c4ec534b06 added config.setup 2014-02-07 19:04:19 +05:30
Rushabh Mehta
22ababbec1 configs 2014-02-07 18:16:11 +05:30
Pratik Vyas
17cb5b7799 Merge branch 'develop' 2014-02-07 16:03:09 +05:30
Pratik Vyas
e0c9dd3d23 bumped to version 3.8.4 2014-02-07 16:33:09 +06:00
Nabin Hait
41891ec95c Merge pull request #1405 from nabinhait/hotfix
Serial No duplicate entry fix
2014-02-07 15:54:57 +05:30
Nabin Hait
dfc0072929 Merge branch 'develop' of github.com:webnotes/erpnext into hotfix 2014-02-07 15:45:39 +05:30
Nabin Hait
e1e5d675ac Validate duplicate serial nos entry 2014-02-07 15:33:34 +05:30
Nabin Hait
c4e92c6416 Validate duplicate serial nos entry 2014-02-07 15:22:50 +05:30
Anand Doshi
7c34f1c472 Test Item Group 2014-02-07 14:52:14 +05:30
Nabin Hait
2c832addca Merge pull request #1404 from nabinhait/hotfix
Hotfix
2014-02-07 11:51:54 +05:30
Nabin Hait
c095cfa224 Merge branch 'develop' of github.com:webnotes/erpnext into hotfix 2014-02-07 11:49:45 +05:30
Nabin Hait
fbb10d37d3 Removed on_trash function from support ticket 2014-02-07 11:49:26 +05:30
Anand Doshi
7bb9c3f125 Nested Set Test using Test Item group 2014-02-06 17:51:18 +05:30
Nabin Hait
a03f654446 Merge pull request #1382 from akhileshdarjee/4.0-hotfix
Newsletter can also be sent to employees
2014-02-06 16:02:39 +05:30
Nabin Hait
574c7e7c63 item related cleanup 2014-02-06 15:51:01 +05:30
Pratik Vyas
9294fc8e7e Merge branch 'develop' 2014-02-06 15:27:11 +05:30
Pratik Vyas
07d4c373f3 bumped to version 3.8.3 2014-02-06 15:57:11 +06:00
Pratik Vyas
79499e3615 fix syntax error in material request, merge booboo 2014-02-06 15:25:17 +05:30
Pratik Vyas
cc9bc95b25 fix language typo in build script 2014-02-06 14:59:05 +05:30
Pratik Vyas
ae763d7afa Merge pull request #1394 from pdvyas/testing-develop3
fix travis build script typo
2014-02-06 14:54:13 +05:30
Pratik Vyas
70e2a50f0f fix travis build script typo 2014-02-06 14:07:58 +05:30
Pratik Vyas
c22ff12951 Merge pull request #1390 from pdvyas/testing4
fix webnotes url in travis build script
2014-02-06 13:37:41 +05:30
Pratik Vyas
1b8c158fdc Merge pull request #1393 from pdvyas/testing-develop2
add travis build script
2014-02-06 13:37:21 +05:30
Pratik Vyas
4078ef8ef5 add travis build script 2014-02-06 13:36:26 +05:30
Akhilesh Darjee
462740f72b sales funnel fix 2014-02-06 13:14:15 +05:30
Pratik Vyas
c055ea6465 fix webnotes url in travis build script 2014-02-06 12:54:52 +05:30
Anand Doshi
3decf4dbc5 Fixes related website hierarchy 2014-02-06 12:50:35 +05:30
Rushabh Mehta
4b41e420c0 cleaned up splash: 2014-02-06 11:02:53 +05:30
Rushabh Mehta
2c545ef1ad bugfix to feed 2014-02-06 10:38:45 +05:30
Pratik Vyas
c6b59ef082 Merge branch 'develop' 2014-02-05 18:49:29 +05:30
Pratik Vyas
dbbba659a8 bumped to version 3.8.2 2014-02-05 19:19:29 +06:00
Nabin Hait
3c3719fa9c Merge pull request #1388 from nabinhait/hotfix
Hotfix
2014-02-05 18:46:54 +05:30
Nabin Hait
a7af1d619e Fix in accounts receivable report 2014-02-05 18:15:12 +05:30
Rushabh Mehta
307fac8b78 hooks fixes 2014-02-05 17:04:49 +05:30
Nabin Hait
18eb8c5f68 fixed unicode and null issue in sms center 2014-02-05 15:06:09 +05:30
Akhilesh Darjee
602fdc0000 patch reloading employee form 2014-02-03 19:32:59 +05:30
Akhilesh Darjee
f1c3537924 webnotes/erpnext#869 newsletter to send to employees 2014-02-03 19:28:36 +05:30
Akhilesh Darjee
81578d2e77 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0-hotfix 2014-02-03 17:48:46 +05:30
Akhilesh Darjee
8f674fe0fb minor changes 2014-02-03 17:47:50 +05:30
Akhilesh Darjee
abb3af7b30 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0-hotfix 2014-02-03 16:44:14 +05:30
Rushabh Mehta
cc008cc109 commonified get_party_details 2014-02-03 16:14:56 +05:30
Rushabh Mehta
347889b233 merge 2014-02-03 14:49:53 +05:30
Rushabh Mehta
8ed0268b9d fix to SalesInvoice format 2014-02-03 14:40:01 +05:30
Rushabh Mehta
fa799f7d81 Merge branch '4.0.0-cleanup' of github.com:webnotes/erpnext into 4.0.0-cleanup 2014-02-03 14:38:52 +05:30
Nabin Hait
23c28704d2 Field arrangement in child table 2014-02-03 14:36:59 +05:30
Akhilesh Darjee
dd905fcaba Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0-hotfix 2014-02-03 13:56:10 +05:30
Akhilesh Darjee
53593c9c47 Newsletter allow delete 2014-02-03 13:40:27 +05:30
Rushabh Mehta
8612778136 style fix 2014-02-03 10:45:21 +05:30
Rushabh Mehta
9adcf85a14 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0.0-wip 2014-02-03 10:44:34 +05:30
Akhilesh Darjee
d6d2193f91 newsletter reload 2014-01-31 19:59:25 +05:30
Nabin Hait
bec11fa86e Newsletter permissions 2014-01-31 17:33:23 +05:30
Nabin Hait
dfae0ea570 minor fix in patch 2014-01-31 17:25:09 +05:30
Nabin Hait
d7fb6dce89 Stock reconciliation: cost center filters 2014-01-31 17:05:09 +05:30
Nabin Hait
759f9ee973 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0.0-wip 2014-01-31 16:28:31 +05:30
Nabin Hait
646d06ee9f Merge branch 'develop' of github.com:webnotes/erpnext into 4.0.0-wip
Conflicts:
	config.json
2014-01-31 16:28:05 +05:30
Nabin Hait
7f80485070 Merge pull request #1374 from akhileshdarjee/sms-center
SMS center character count
2014-01-31 02:57:35 -08:00
Nabin Hait
45f0c25a6d Merge pull request #1365 from akhileshdarjee/4.0-hotfix
Stay Updated button in website fixed
2014-01-31 02:44:35 -08:00
Nabin Hait
c3211ab394 Merge pull request #1368 from akhileshdarjee/default-tax
Default tax for customer and supplier
2014-01-31 02:40:51 -08:00
Akhilesh Darjee
dc45153430 webnotes/erpnext#1221 dont allow duplicate user id in employee 2014-01-31 12:23:13 +05:30
Akhilesh Darjee
4e3b601990 webnotes/erpnext#1188 sms center character count 2014-01-30 19:13:25 +05:30
Nabin Hait
b5be7bab9b Stock Return: fetch customer and supplier details 2014-01-30 18:47:12 +05:30
Nabin Hait
8dc2c6a16c Default accounts in company should not be copied 2014-01-30 17:00:09 +05:30
Pratik Vyas
fe977289eb Merge branch 'develop' 2014-01-30 16:00:29 +05:30
Pratik Vyas
45b5b6d11f bumped to version 3.8.1 2014-01-30 16:30:29 +06:00
Nabin Hait
ec43e4dd33 Merged with develop 2014-01-30 15:22:10 +05:30
Nabin Hait
c58b330673 Merge pull request #1372 from nabinhait/hotfix
Hotfix
2014-01-30 01:49:29 -08:00
Nabin Hait
5d976ca3ac recurring invoice test fix 2014-01-30 15:12:39 +05:30
Rushabh Mehta
fcb6b01e4e cleaned up email 2014-01-30 15:09:05 +05:30
Nabin Hait
f2f17959ab Serial no fix 2014-01-30 14:54:25 +05:30
Akhilesh Darjee
e0a1039756 merge conflict fixed 2014-01-30 14:44:35 +05:30
Akhilesh Darjee
4cdb79941b map charge to taxes and charges in transactions 2014-01-30 13:56:57 +05:30
Nabin Hait
0ff32e73ba Merged with 4.0.0-wip 2014-01-30 12:41:52 +05:30
Nabin Hait
fe8db590a1 Fixed conflict while merging with develop 2014-01-30 12:32:47 +05:30
Nabin Hait
53f7ba26f6 Merge branch 'develop' of github.com:webnotes/erpnext into hotfix 2014-01-30 12:12:50 +05:30
Nabin Hait
1969f9e1ac Merge branch 'develop' of github.com:webnotes/erpnext into hotfix 2014-01-30 12:11:04 +05:30
Nabin Hait
60fcce66f7 Minor fix in accounts receivable report 2014-01-30 12:08:44 +05:30
Nabin Hait
b87e9f2651 Fixes in fetching party details 2014-01-29 19:51:36 +05:30
Akhilesh Darjee
b665d86292 patch to reload all sales and purchase doctypes and print formats 2014-01-29 17:40:34 +05:30
Akhilesh Darjee
4f7215662d webnotes/erpnext#1090 set default tax type in customer and supplier 2014-01-29 16:31:38 +05:30
Akhilesh Darjee
db22657d93 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into default-tax 2014-01-29 16:00:33 +05:30
Rushabh Mehta
24da761a17 more updates to party 2014-01-29 15:26:04 +05:30
Akhilesh Darjee
2ced3b07d4 changed fieldname from charge to taxes 2014-01-28 19:16:05 +05:30
Rushabh Mehta
49dd7bee87 added get_supplier_details and commonified invoice functions 2014-01-28 17:43:10 +05:30
Rushabh Mehta
3b432dce88 added listviews 2014-01-28 16:10:15 +05:30
Nabin Hait
21d324c597 Merged with 4.0-wip 2014-01-28 15:52:25 +05:30
Akhilesh Darjee
a7ab20ec78 webnotes/erpnext#912 Stay Updated button in website fixed 2014-01-28 15:50:28 +05:30
Nabin Hait
4b97811941 Merge pull request #1359 from akhileshdarjee/4.0-hotfix
POS Invoice print format showing inclusive taxes and discount amount
2014-01-27 04:09:36 -08:00
Akhilesh Darjee
ffa4769b51 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0-hotfix 2014-01-27 17:32:32 +05:30
Akhilesh Darjee
db4304914c POS Invoice print format showing inclusive taxes and discount amount 2014-01-27 17:27:39 +05:30
Nabin Hait
db7901ec49 Merge pull request #1261 from akhileshdarjee/maintenance2
Fixed Maintenance Schedule
2014-01-27 03:57:15 -08:00
Akhilesh Darjee
86894f3bbf merge conflict fixed 2014-01-27 15:42:02 +05:30
Rushabh Mehta
1230e3a28b don't hide customer / supplier links, webnotes/erpenxt#796 2014-01-27 11:02:27 +05:30
Anand Doshi
3f8f4ff6cd BugFix: Production Planning Tool - get_raw_materials 2014-01-24 21:47:01 +05:30
Anand Doshi
cb39e0878e Merge remote-tracking branch 'webnotes/develop' into 4.0.0-wip
Conflicts:
	config.json
	erpnext/accounts/utils.py
	erpnext/patches/patch_list.py
	erpnext/stock/doctype/price_list/price_list.txt
	erpnext/stock/doctype/warehouse/warehouse.py
	portal/templates/sale.html
	portal/utils.py
	selling/doctype/sales_order/templates/pages/order.py
	selling/utils/cart.py
	selling/utils/product.py
	utilities/demo/demo_docs/Fiscal_Year.csv
	utilities/demo/make_demo.py
2014-01-24 21:44:36 +05:30
Akhilesh Darjee
a4e0a1c061 minor changes 2014-01-24 19:57:52 +05:30
Rushabh Mehta
2fa914b410 Merge pull request #1347 from akhileshdarjee/4.0-hotfix
method name fixing
2014-01-24 02:07:22 -08:00
Rushabh Mehta
e288e5238a added title_fields for Task, Newsletter 2014-01-24 15:33:42 +05:30
Akhilesh Darjee
7cbf5b4e67 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0-hotfix 2014-01-24 11:12:50 +05:30
Akhilesh Darjee
44edfb7231 method name fixing 2014-01-24 11:10:46 +05:30
Rushabh Mehta
1cd96a136f updates for restriction 2014-01-24 11:10:24 +05:30
Nabin Hait
93eab5521c Minor fix in path 2014-01-23 17:58:03 +05:30
Nabin Hait
4ba95d0b7a Fix in testcases 2014-01-23 16:45:22 +05:30
Nabin Hait
5ae6a61c4d Fixes related to appifing shopping cart 2014-01-23 15:33:30 +05:30
Nabin Hait
6a23cfa5cd Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0.0-wip 2014-01-22 15:57:32 +05:30
Rushabh Mehta
7460dcf406 updated Bootstrap 2014-01-22 12:44:46 +05:30
Rushabh Mehta
f96bcf943b added explicit delete perimssions 2014-01-20 17:52:13 +05:30
Nabin Hait
9e056ec1ce Auto closing of tickets through schedulers 2014-01-20 17:46:37 +05:30
Rushabh Mehta
cef681942f merge fix 2014-01-20 17:41:13 +05:30
Nabin Hait
5c6d13a0df Fixed conflict while merging with develop branch 2014-01-20 17:18:16 +05:30
Nabin Hait
719f2803b3 Fixed conflict while merging with develop branch 2014-01-20 17:01:28 +05:30
Nabin Hait
dc15b4fa8a Fixed conflict while merging with develop brnach 2014-01-20 16:48:49 +05:30
Akhilesh Darjee
2a79b00700 minor fix 2014-01-15 11:54:05 +05:30
Akhilesh Darjee
6a749e3a8e removed while loop 2014-01-15 11:43:47 +05:30
Anand Doshi
b9b6a6cea5 Moved webnotes scheduler event hooks 2014-01-13 21:22:23 +05:30
Nabin Hait
95e45574cb Merge pull request #1239 from akhileshdarjee/flat-discount
Flat Discount on Sales Cycle
2014-01-09 03:43:35 -08:00
Nabin Hait
f6cf5e0f43 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0.0-cleanup 2014-01-06 17:36:04 +05:30
Akhilesh Darjee
5dd92fd5d6 reload doc in maintenance schedule 2014-01-03 19:14:01 +05:30
Akhilesh Darjee
e27717261d merge conflict fixed 2014-01-03 18:18:31 +05:30
Akhilesh Darjee
57738a0ff3 flat discount replaced to discount amount 2014-01-03 18:15:07 +05:30
Akhilesh Darjee
5c96b75a68 fixed maintenance schedule 2014-01-02 17:54:12 +05:30
Akhilesh Darjee
064d2ba16a fixed sr no in maintenance schedule 2014-01-02 17:47:32 +05:30
Rushabh Mehta
b09d9dabc5 started cleanup of address / contact calls - partly fixed for customer, to fix shipping_address, get_pos_values, for all supplier transactions 2014-01-02 11:47:23 +05:30
Nabin Hait
06720dfb90 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into 4.0.0-wip 2014-01-01 10:47:18 +05:30
Nabin Hait
a2e0a9b05f Fliend rearrangemet in tables 2014-01-01 10:45:42 +05:30
Rushabh Mehta
3f7e2729bb removed demo hooks 2014-01-01 10:45:26 +05:30
Nabin Hait
6260b58a0a Merge pull request #1253 from nabinhait/4.0.0-wip
4.0.0 wip
2013-12-31 21:13:45 -08:00
Anand Doshi
2511aa2b14 Merge pull request #1254 from anandpdoshi/4.0.0-shopping-cart-wip
Moved Portal and Shopping Cart to Shopping Cart app, and some minor fixe...
2013-12-31 04:14:15 -08:00
Anand Doshi
9a4a13cb73 Moved Portal and Shopping Cart to Shopping Cart app, and some minor fixes 2013-12-31 17:38:21 +05:30
Nabin Hait
139aa71666 Fixed conflict while merging with master 2013-12-31 16:09:22 +05:30
Nabin Hait
d3f04d754a General ledger path fixed 2013-12-31 16:04:48 +05:30
Nabin Hait
432b86344e Validate account with reference voucher if against voucher mentioned 2013-12-31 15:07:58 +05:30
Akhilesh Darjee
829eda47a8 Merge branch '4.0.0-wip' of github.com:webnotes/erpnext into flat-discount 2013-12-30 12:31:07 +05:30
Anand Doshi
0663ec4a9c Merge fixes: removed patches, removed Warehouse User 2013-12-27 18:00:28 +05:30
Rushabh Mehta
61bf425935 deleted moves 2013-12-27 17:58:39 +05:30
Akhilesh Darjee
d203aea7c2 [flat discount] flat discount implemented on sales cycle 2013-12-27 17:49:57 +05:30
Rushabh Mehta
c4a0ed63ef Moved demo to separate app, moved patches folder 2013-12-27 17:30:24 +05:30
Akhilesh Darjee
31ccf9a80b [flat discount] fixed test cases for stock entry 2013-12-27 14:21:39 +05:30
Rushabh Mehta
4ac68952e8 Moved patches and fixed method routing in pages 2013-12-27 13:43:40 +05:30
Anand Doshi
e7fc25d6a8 Fixes after permissions merge 2013-12-27 10:49:28 +05:30
Rushabh Mehta
0527a393aa Merge pull request #1236 from anandpdoshi/permissions
Permissions
2013-12-26 21:07:54 -08:00
Akhilesh Darjee
2b1d8854d5 [flat discount] added flat discount in pos 2013-12-26 20:31:42 +05:30
Anand Doshi
8e332ffd16 Merge remote-tracking branch 'webnotes/4.0.0-wip' into permissions
Conflicts:
	erpnext/accounts/page/accounts_browser/accounts_browser.css
	erpnext/controllers/buying_controller.py
	erpnext/manufacturing/doctype/production_order/production_order.py
	erpnext/patches/patch_list.py
	erpnext/selling/doctype/customer/customer.txt
	erpnext/selling/doctype/sales_order/sales_order.py
	erpnext/selling/doctype/sales_order/test_sales_order.py
	erpnext/setup/doctype/features_setup/features_setup.txt
	erpnext/stock/doctype/stock_entry/test_stock_entry.py
	erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
	startup/query_handlers.py
2013-12-26 19:12:51 +05:30
Akhilesh Darjee
3ab9f24a12 Merge branch 'master' of github.com:webnotes/erpnext into flat_discount 2013-12-26 18:15:14 +05:30
Akhilesh Darjee
13fa595282 [flat discount] pos print format fixed 2013-12-26 18:14:44 +05:30
Akhilesh Darjee
aebb844da9 [flat discount] added flat discount in print format and all selling doctypes 2013-12-26 18:05:41 +05:30
Rushabh Mehta
7334bea3c2 fixed languages, moved framework strings to framework 2013-12-26 14:44:08 +05:30
Rushabh Mehta
caa4380d49 Merge with 3.3.8 2013-12-26 11:07:58 +05:30
Rushabh Mehta
54047780fc Merge with 3.3.8 2013-12-26 11:07:46 +05:30
Akhilesh Darjee
c53dbc7cdf [flat discount] implemented flat discount on client side 2013-12-25 19:46:20 +05:30
Rushabh Mehta
4b6b377134 Removed config.json 2013-12-25 17:38:12 +05:30
Rushabh Mehta
df200f305b Redesigned templates. Now all templates must be inside templates/pages templates/generators 2013-12-25 15:19:22 +05:30
Akhilesh Darjee
63aa5fd673 [flat discount] implemented flat discount on server side 2013-12-24 20:30:03 +05:30
Rushabh Mehta
3c68488873 Fixes to setup wizard 2013-12-24 18:51:49 +05:30
Rushabh Mehta
30fb30cffb Merge pull request #1 from pdvyas/testing
add travis ci
2013-12-24 05:21:21 -08:00
Pratik Vyas
f437e867fd add travis ci 2013-12-24 12:17:59 +05:30
Anand Doshi
2926651e1c Restrict Employee and Leave Approver to relevant Employee and Leave Application records 2013-12-23 20:01:20 +05:30
Anand Doshi
9b67f4344b Patch to migrate allow_print and allow_email to print and email rights of DocPerm 2013-12-23 20:01:20 +05:30
Anand Doshi
68852f25b5 Added rights for print and email in DocPerm 2013-12-23 20:01:20 +05:30
Anand Doshi
8a436500f0 [refactor] Client-side permission handling 2013-12-23 20:01:19 +05:30
Anand Doshi
2298d59b8b [patch] new permission system 2013-12-23 20:01:19 +05:30
Anand Doshi
620145c59a [minor] patches for restriction 2013-12-23 20:01:19 +05:30
Anand Doshi
bcf2422848 [minor] user properties and leave application 2013-12-23 20:01:19 +05:30
Anand Doshi
83638b5f05 [minor] move warehouse user to restrictions 2013-12-23 20:01:18 +05:30
Rushabh Mehta
57518fc5f1 [cleanup] [minor] default+cache related 2013-12-23 20:01:18 +05:30
Rushabh Mehta
fea93d0f65 [cleanup] [minor] added webnotes.model.delete_doc (module) 2013-12-23 20:01:18 +05:30
Rushabh Mehta
b1ea6b1f66 [permissions] Added Test Cases 2013-12-23 20:01:18 +05:30
Rushabh Mehta
497d363fc1 [permission model] Redesign
Conflicts:

	patches/patch_list.py
2013-12-23 20:01:18 +05:30
Rushabh Mehta
b63d550a70 Added Applications page and fixed issues in translations and hooks 2013-12-23 16:09:00 +05:30
Akhilesh Darjee
b09dc46e68 [flat discount] first commit 2013-12-23 15:49:08 +05:30
Rushabh Mehta
2b08985e16 Translations redesigned webnotes/wnframework#351 2013-12-19 18:27:48 +05:30
Rushabh Mehta
91e9822f65 fixed test cases webnotes/wnframework#351 2013-12-16 18:43:42 +05:30
Rushabh Mehta
c652a6254f Rewrote hooks for scheduler, notifications, boot, session, login, webpage webnotes/wnframework#351 2013-12-16 12:48:38 +05:30
Rushabh Mehta
30430796c7 notifications via hooks webnotes/wnframework#351 2013-12-13 15:33:40 +05:30
Rushabh Mehta
6de403f2be added manifest, hooks and fixed requires webnotes/wnframework#351 2013-12-13 14:10:14 +05:30
Rushabh Mehta
1f84799f2d install, web serving, session booting webnotes/wnframework#351 2013-12-12 19:12:19 +05:30
Rushabh Mehta
d2dd83c3a3 fixed template loader webnotes/wnframework#351 2013-12-12 13:57:58 +05:30
Pratik Vyas
1b23208779 [minor] get bundle working, almost 2013-12-12 10:44:38 +05:30
Rushabh Mehta
39bb8e2ed4 step 0: install 2013-12-11 15:32:14 +05:30
Rushabh Mehta
e460aa277b added setup.py 2013-12-11 11:32:21 +05:30
Rushabh Mehta
b234a3545a moved config.json inside erpnext 2013-12-11 10:55:55 +05:30
Rushabh Mehta
afea58b7a1 moved modules inside erpnext folder 2013-12-11 10:43:52 +05:30
1884 changed files with 25857 additions and 40899 deletions

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@ conf.py
locale
latest_updates.json
.wnf-lang-status
*.egg-info
dist/

22
.travis.yml Normal file
View File

@@ -0,0 +1,22 @@
language: python
python:
- "2.7"
services:
- mysql
install:
- CFLAGS=-O0 pip install git+https://github.com/frappe/frappe.git@develop &&
- pip install --editable .
script:
cd ./test_sites/ &&
frappe --reinstall -v test_site &&
frappe --install_app erpnext -v test_site &&
frappe --run_tests -v test_site --app erpnext
before_script:
- mysql -e 'create database travis' &&
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('travis') WHERE user='travis';\nFLUSH PRIVILEGES;\n" | mysql -u root

18
MANIFEST.in Normal file
View File

@@ -0,0 +1,18 @@
include MANIFEST.in
include requirements.txt
include *.json
include *.md
include *.py
include *.txt
recursive-include erpnext *.css
recursive-include erpnext *.csv
recursive-include erpnext *.html
recursive-include erpnext *.ico
recursive-include erpnext *.js
recursive-include erpnext *.json
recursive-include erpnext *.md
recursive-include erpnext *.png
recursive-include erpnext *.py
recursive-include erpnext *.svg
recursive-include erpnext *.txt
recursive-exclude * *.pyc

View File

@@ -4,7 +4,7 @@
Includes Accounting, Inventory, CRM, Sales, Purchase, Projects, HRMS. Built on Python / MySQL.
ERPNext is built on [wnframework](https://github.com/webnotes/wnframework)
ERPNext is built on [frappe](https://github.com/frappe/frappe)
- [User Guide](http://erpnext.org/user-guide.html)
- [Getting Help](http://erpnext.org/getting-help.html)
@@ -13,29 +13,74 @@ ERPNext is built on [wnframework](https://github.com/webnotes/wnframework)
---
### Development install
#### Pre-requisites
1. MySQL
1. Python-2.7
1. Python Setuptools (Python Package Manager)
1. Memcache
1. libxslt
#### Steps
1. Start MySQL and memcache
1. Setup Python Virtualenv (optional - only if you are running multiple python projects requiring different versions of libraries)
1. Install pip: `sudo easy_install pip`
1. Create a `bench` directory
1. Clone `frappe` in the `bench` : `git clone https://github.com/frappe/frappe`
1. Install python libraries `sudo pip install webnotes/requirements.txt`
1. Clone `erpnext` in the `bench`: `git clone https://github.com/frappe/erpnext.git`
1. Clone `shopping-cart` in the `bench`: `git clone https://github.com/frappe/shopping-cart.git`
1. Install the packages: `pip install -e frappe/ erpnext/ shopping-cart/`
1. Create `sites` directory
1. Create `apps.txt`: `echo erpnext\nshopping_cart >> sites/apps.txt`
1. Change to `sites` directory
1. Setup a site: `frappe erpnext.local --install erpnext`
1. Install erpnext app: `frappe erpnext.local --install_app erpnext`
1. Start serving: `frappe erpnext.local --serve`
1. Start a browser and go to `http://localhost:8000`
Putting it all together:
```
sudo easy_install pip
mkdir bench
cd bench
git clone https://github.com/frappe/frappe.git
git clone https://github.com/frappe/erpnext.git
git clone https://github.com/frappe/shopping-cart.git
sudo pip install -e frappe/ erpnext/ shopping-cart/
mkdir sites
echo erpnext\nshopping_cart >> sites/apps.txt
cd sites
frappe erpnext.local --install erpnext
frappe erpnext.local --install_app erpnext
frappe erpnext.local --install_app shopping-cart
frappe erpnext.local --serve
```
#### Pulling Latest Updates
1. Update your git repositories
1. Go to `bench/sites` directory
1. Run `frappe erpnext.local --latest`
1. Run `frappe erpnext.local --build`
1. Run `frappe erpnext.local --flush`
#### Admin Login
1. go to "/login"
1. Administrator user name: "Administrator"
1. Administrator passowrd "admin"
### Download and Install
##### Virtual Image:
- [ERPNext Download](http://erpnext.com/erpnext-download)
##### On Linux:
1. Switch to root user using `sudo su`
1. create a folder where you want to install erpnext
1. go to the new folder
1. `wget https://raw.github.com/webnotes/erpnext/master/install_erpnext.py`
1. `python install_erpnext.py`
[See installation notes](https://github.com/webnotes/erpnext/wiki/How-to-Install-ERPNext)
##### Patch and update
To patch and update from the latest git repository the erpnext folder and run.
You will have to set your origin in git remote
$ lib/wnf.py --update origin master
---
## License

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,182 +0,0 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//
//--------- ONLOAD -------------
wn.require("app/js/controllers/accounts.js");
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.set_footnote(wn.markdown(cur_frm.meta.description));
}
// For customizing print
cur_frm.pformat.net_total_import = function(doc) {
return '';
}
cur_frm.pformat.grand_total_import = function(doc) {
return '';
}
cur_frm.pformat.in_words_import = function(doc) {
return '';
}
cur_frm.pformat.purchase_tax_details= function(doc){
//function to make row of table
var make_row = function(title,val,bold){
var bstart = '<b>'; var bend = '</b>';
return '<tr><td style="width:50%;">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'
+'<td style="width:25%;text-align:right;"></td>'
+'<td style="width:25%;text-align:right;">'+format_currency(val, doc.currency)+'</td>'
+'</tr>'
}
function convert_rate(val){
var new_val = flt(val)/flt(doc.conversion_rate);
return new_val;
}
function print_hide(fieldname) {
var doc_field = wn.meta.get_docfield(doc.doctype, fieldname, doc.name);
return doc_field.print_hide;
}
var cl = getchildren('Purchase Taxes and Charges',doc.name,'purchase_tax_details');
// outer table
var out='<div><table class="noborder" style="width:100%">\
<tr><td style="width: 60%"></td><td>';
// main table
out +='<table class="noborder" style="width:100%">';
if(!print_hide('net_total_import')) {
out += make_row('Net Total', doc.net_total_import, 1);
}
// add rows
if(cl.length){
for(var i=0;i<cl.length;i++){
out += make_row(cl[i].description,convert_rate(cl[i].tax_amount),0);
}
}
// grand total
if(!print_hide('grand_total_import')) {
out += make_row('Grand Total', doc.grand_total_import, 1);
}
if(doc.in_words_import && !print_hide('in_words_import')){
out +='</table></td></tr>';
out += '<tr><td colspan = "2">';
out += '<table><tr><td style="width:25%;"><b>In Words</b></td>';
out+= '<td style="width:50%;">'+doc.in_words_import+'</td></tr>';
}
out +='</table></td></tr></table></div>';
return out;
}
cur_frm.cscript.add_deduct_tax = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.category && d.add_deduct_tax){
alert(wn._("Please select Category first"));
d.add_deduct_tax = '';
}
else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
console.log([d.category, d.add_deduct_tax]);
msgprint(wn._("You cannot deduct when category is for 'Valuation' or 'Valuation and Total'"));
d.add_deduct_tax = '';
}
}
cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.category && d.charge_type){
alert(wn._("Please select Category first"));
d.charge_type = '';
}
else if(d.idx == 1 && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
alert(wn._("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
d.charge_type = '';
}
else if((d.category == 'Valuation' || d.category == 'Valuation and Total') && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
alert(wn._("You cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for valuation. You can select only 'Total' option for previous row amount or previous row total"))
d.charge_type = '';
}
validated = false;
refresh_field('charge_type',d.name,'purchase_tax_details');
cur_frm.cscript.row_id(doc, cdt, cdn);
cur_frm.cscript.rate(doc, cdt, cdn);
cur_frm.cscript.tax_amount(doc, cdt, cdn);
}
cur_frm.cscript.row_id = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.row_id){
alert(wn._("Please select Charge Type first"));
d.row_id = '';
}
else if((d.charge_type == 'Actual' || d.charge_type == 'On Net Total') && d.row_id) {
alert(wn._("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'"));
d.row_id = '';
}
else if((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id){
if(d.row_id >= d.idx){
alert(wn._("You cannot Enter Row no. greater than or equal to current row no. for this Charge type"));
d.row_id = '';
}
}
validated = false;
refresh_field('row_id',d.name,'purchase_tax_details');
}
cur_frm.set_query("account_head", "purchase_tax_details", function(doc) {
return {
query: "controllers.queries.tax_account_query",
filters: {
"account_type": ["Tax", "Chargeable", "Expense Account"],
"debit_or_credit": "Debit",
"company": doc.company
}
}
});
cur_frm.fields_dict['purchase_tax_details'].grid.get_field("cost_center").get_query = function(doc) {
return {
filters: {
'company': doc.company,
'group_or_ledger': "Ledger"
}
}
}
cur_frm.cscript.rate = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.rate) {
alert(wn._("Please select Charge Type first"));
d.rate = '';
}
validated = false;
refresh_field('rate',d.name,'purchase_tax_details');
}
cur_frm.cscript.tax_amount = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.tax_amount){
alert(wn._("Please select Charge Type first"));
d.tax_amount = '';
}
else if(d.charge_type && d.tax_amount) {
alert(wn._("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate"));
d.tax_amount = '';
}
validated = false;
refresh_field('tax_amount',d.name,'purchase_tax_details');
}

View File

@@ -1,5 +0,0 @@
{% extends "app/portal/templates/sale.html" %}
{% block status -%}
{% if doc.status %}{{ doc.status }}{% endif %}
{%- endblock %}

View File

@@ -1,30 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _
from webnotes.utils import flt, fmt_money
no_cache = True
def get_context():
from portal.utils import get_transaction_context
context = get_transaction_context("Sales Invoice", webnotes.form_dict.name)
modify_status(context.get("doc"))
context.update({
"parent_link": "invoices",
"parent_title": "Invoices"
})
return context
def modify_status(doc):
doc.status = ""
if flt(doc.outstanding_amount):
doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
("label-warning", "icon-exclamation-sign",
_("To Pay") + " = " + fmt_money(doc.outstanding_amount, currency=doc.currency))
else:
doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
("label-success", "icon-ok", _("Paid"))

View File

@@ -1 +0,0 @@
{% extends "app/portal/templates/sales_transactions.html" %}

View File

@@ -1,28 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
no_cache = True
def get_context():
from portal.utils import get_currency_context
context = get_currency_context()
context.update({
"title": "Invoices",
"method": "accounts.doctype.sales_invoice.templates.pages.invoices.get_invoices",
"icon": "icon-file-text",
"empty_list_message": "No Invoices Found",
"page": "invoice"
})
return context
@webnotes.whitelist()
def get_invoices(start=0):
from portal.utils import get_transaction_list
from accounts.doctype.sales_invoice.templates.pages.invoice import modify_status
invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
for d in invoices:
modify_status(d)
return invoices

View File

@@ -1,22 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint
from webnotes.model.controller import DocListController
class DocType(DocListController):
def validate(self):
if self.doc.is_default == 1:
webnotes.conn.sql("""update `tabSales Taxes and Charges Master` set is_default = 0
where ifnull(is_default,0) = 1 and name != %s and company = %s""",
(self.doc.name, self.doc.company))
# at least one territory
self.validate_table_has_rows("valid_for_territories")
def on_update(self):
cart_settings = webnotes.get_obj("Shopping Cart Settings")
if cint(cart_settings.doc.enabled):
cart_settings.validate_tax_masters()

View File

@@ -1,70 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
import unittest
from accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, OverlappingConditionError
class TestShippingRule(unittest.TestCase):
def test_from_greater_than_to(self):
shipping_rule = webnotes.bean(copy=test_records[0])
shipping_rule.doclist[1].from_value = 101
self.assertRaises(FromGreaterThanToError, shipping_rule.insert)
def test_many_zero_to_values(self):
shipping_rule = webnotes.bean(copy=test_records[0])
shipping_rule.doclist[1].to_value = 0
self.assertRaises(ManyBlankToValuesError, shipping_rule.insert)
def test_overlapping_conditions(self):
for range_a, range_b in [
((50, 150), (0, 100)),
((50, 150), (100, 200)),
((50, 150), (75, 125)),
((50, 150), (25, 175)),
((50, 150), (50, 150)),
]:
shipping_rule = webnotes.bean(copy=test_records[0])
shipping_rule.doclist[1].from_value = range_a[0]
shipping_rule.doclist[1].to_value = range_a[1]
shipping_rule.doclist[2].from_value = range_b[0]
shipping_rule.doclist[2].to_value = range_b[1]
self.assertRaises(OverlappingConditionError, shipping_rule.insert)
test_records = [
[
{
"doctype": "Shipping Rule",
"label": "_Test Shipping Rule",
"calculate_based_on": "Net Total",
"company": "_Test Company",
"account": "_Test Account Shipping Charges - _TC",
"cost_center": "_Test Cost Center - _TC"
},
{
"doctype": "Shipping Rule Condition",
"parentfield": "shipping_rule_conditions",
"from_value": 0,
"to_value": 100,
"shipping_amount": 50.0
},
{
"doctype": "Shipping Rule Condition",
"parentfield": "shipping_rule_conditions",
"from_value": 101,
"to_value": 200,
"shipping_amount": 100.0
},
{
"doctype": "Shipping Rule Condition",
"parentfield": "shipping_rule_conditions",
"from_value": 201,
"shipping_amount": 0.0
},
{
"doctype": "Applicable Territory",
"parentfield": "valid_for_territories",
"territory": "_Test Territory"
}
]
]

View File

@@ -1,29 +0,0 @@
select.accbrowser-company-select {
width: 200px;
margin-top: 2px;
margin-left: 10px;
}
span.tree-node-toolbar {
padding: 2px;
margin-left: 15px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: #ddd;
}
.tree-area a.selected {
font-weight: bold;
text-decoration: underline;
}
span.balance-area {
float: right;
height: 13px;
}
span.balance-bold {
font-weight: bold;
}

View File

@@ -1,22 +0,0 @@
[
{
"creation": "2013-07-30 17:28:49",
"docstatus": 0,
"modified": "2013-09-05 12:40:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
"name": "__common__",
"query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project_name` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`qty` - ifnull((select sum(qty) from `tabSales Invoice Item` \n\t where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n\t `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabDelivery Note Item`.`amount` - ifnull((select sum(amount) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note`.docstatus = 1 and\n\t`tabDelivery Note`.`status` != \"Stopped\" and\n `tabDelivery Note`.name = `tabDelivery Note Item`.parent and\n (`tabDelivery Note Item`.qty > ifnull((select sum(qty) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\norder by `tabDelivery Note`.`name` desc",
"ref_doctype": "Sales Invoice",
"report_name": "Delivered Items To Be Billed",
"report_type": "Query Report"
},
{
"doctype": "Report",
"name": "Delivered Items To Be Billed"
}
]

View File

@@ -1,22 +0,0 @@
[
{
"creation": "2013-02-21 14:26:44",
"docstatus": 0,
"modified": "2013-02-22 15:53:01",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
"name": "__common__",
"query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project_name` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.amount, 0) - (ifnull(`tabSales Order Item`.billed_amt, 0) * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Stopped\"\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.export_amount,0)\norder by `tabSales Order`.transaction_date asc",
"ref_doctype": "Sales Invoice",
"report_name": "Ordered Items To Be Billed",
"report_type": "Query Report"
},
{
"doctype": "Report",
"name": "Ordered Items To Be Billed"
}
]

View File

@@ -1,22 +0,0 @@
[
{
"creation": "2013-07-30 18:35:10",
"docstatus": 0,
"modified": "2013-07-31 11:46:57",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
"name": "__common__",
"query": "select\n `tabPurchase Receipt`.`name` as \"Purchase Receipt:Link/Purchase Receipt:120\",\n `tabPurchase Receipt`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Receipt`.`posting_date` as \"Date:Date\",\n\t`tabPurchase Receipt Item`.`project_name` as \"Project\",\n\t`tabPurchase Receipt Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabPurchase Receipt Item`.`qty` - ifnull((select sum(qty) from `tabPurchase Invoice Item` \n\t where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n\t `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabPurchase Receipt Item`.`amount` - ifnull((select sum(amount) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabPurchase Receipt Item`.`item_name` as \"Item Name::150\",\n\t`tabPurchase Receipt Item`.`description` as \"Description::200\"\nfrom `tabPurchase Receipt`, `tabPurchase Receipt Item`\nwhere\n `tabPurchase Receipt`.docstatus = 1 and\n\t`tabPurchase Receipt`.`status` != \"Stopped\" and\n `tabPurchase Receipt`.name = `tabPurchase Receipt Item`.parent and\n (`tabPurchase Receipt Item`.qty > ifnull((select sum(qty) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\norder by `tabPurchase Receipt`.`name` desc",
"ref_doctype": "Purchase Invoice",
"report_name": "Received Items To Be Billed",
"report_type": "Query Report"
},
{
"doctype": "Report",
"name": "Received Items To Be Billed"
}
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,198 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import webnotes.defaults
from webnotes.utils import cint
from webnotes import msgprint, _
from webnotes.model.doc import make_autoname
from utilities.transaction_base import TransactionBase
class DocType(TransactionBase):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def autoname(self):
supp_master_name = webnotes.defaults.get_global_default('supp_master_name')
if supp_master_name == 'Supplier Name':
if webnotes.conn.exists("Customer", self.doc.supplier_name):
webnotes.msgprint(_("A Customer exists with same name"), raise_exception=1)
self.doc.name = self.doc.supplier_name
else:
self.doc.name = make_autoname(self.doc.naming_series + '.#####')
def update_address(self):
webnotes.conn.sql("""update `tabAddress` set supplier_name=%s, modified=NOW()
where supplier=%s""", (self.doc.supplier_name, self.doc.name))
def update_contact(self):
webnotes.conn.sql("""update `tabContact` set supplier_name=%s, modified=NOW()
where supplier=%s""", (self.doc.supplier_name, self.doc.name))
def update_credit_days_limit(self):
webnotes.conn.sql("""update tabAccount set credit_days = %s where name = %s""",
(cint(self.doc.credit_days), self.doc.name + " - " + self.get_company_abbr()))
def on_update(self):
if not self.doc.naming_series:
self.doc.naming_series = ''
self.update_address()
self.update_contact()
# create account head
self.create_account_head()
# update credit days and limit in account
self.update_credit_days_limit()
def get_payables_group(self):
g = webnotes.conn.sql("select payables_group from tabCompany where name=%s", self.doc.company)
g = g and g[0][0] or ''
if not g:
msgprint("Update Company master, assign a default group for Payables")
raise Exception
return g
def add_account(self, ac, par, abbr):
ac_bean = webnotes.bean({
"doctype": "Account",
'account_name':ac,
'parent_account':par,
'group_or_ledger':'Group',
'company':self.doc.company,
"freeze_account": "No",
})
ac_bean.ignore_permissions = True
ac_bean.insert()
msgprint(_("Created Group ") + ac)
def get_company_abbr(self):
return webnotes.conn.sql("select abbr from tabCompany where name=%s", self.doc.company)[0][0]
def get_parent_account(self, abbr):
if (not self.doc.supplier_type):
msgprint("Supplier Type is mandatory")
raise Exception
if not webnotes.conn.sql("select name from tabAccount where name=%s and debit_or_credit = 'Credit' and ifnull(is_pl_account, 'No') = 'No'", (self.doc.supplier_type + " - " + abbr)):
# if not group created , create it
self.add_account(self.doc.supplier_type, self.get_payables_group(), abbr)
return self.doc.supplier_type + " - " + abbr
def validate(self):
#validation for Naming Series mandatory field...
if webnotes.defaults.get_global_default('supp_master_name') == 'Naming Series':
if not self.doc.naming_series:
msgprint("Series is Mandatory.", raise_exception=1)
def create_account_head(self):
if self.doc.company :
abbr = self.get_company_abbr()
parent_account = self.get_parent_account(abbr)
if not webnotes.conn.sql("select name from tabAccount where name=%s", (self.doc.name + " - " + abbr)):
ac_bean = webnotes.bean({
"doctype": "Account",
'account_name': self.doc.name,
'parent_account': parent_account,
'group_or_ledger':'Ledger',
'company': self.doc.company,
'account_type': '',
'tax_rate': '0',
'master_type': 'Supplier',
'master_name': self.doc.name,
"freeze_account": "No"
})
ac_bean.ignore_permissions = True
ac_bean.insert()
msgprint(_("Created Account Head: ") + ac_bean.doc.name)
else:
self.check_parent_account(parent_account, abbr)
else :
msgprint("Please select Company under which you want to create account head")
def check_parent_account(self, parent_account, abbr):
if webnotes.conn.get_value("Account", self.doc.name + " - " + abbr,
"parent_account") != parent_account:
ac = webnotes.bean("Account", self.doc.name + " - " + abbr)
ac.doc.parent_account = parent_account
ac.save()
def get_contacts(self,nm):
if nm:
contact_details =webnotes.conn.convert_to_lists(webnotes.conn.sql("select name, CONCAT(IFNULL(first_name,''),' ',IFNULL(last_name,'')),contact_no,email_id from `tabContact` where supplier = '%s'"%nm))
return contact_details
else:
return ''
def delete_supplier_address(self):
for rec in webnotes.conn.sql("select * from `tabAddress` where supplier=%s", (self.doc.name,), as_dict=1):
webnotes.conn.sql("delete from `tabAddress` where name=%s",(rec['name']))
def delete_supplier_contact(self):
for contact in webnotes.conn.sql_list("""select name from `tabContact`
where supplier=%s""", self.doc.name):
webnotes.delete_doc("Contact", contact)
def delete_supplier_account(self):
"""delete supplier's ledger if exist and check balance before deletion"""
acc = webnotes.conn.sql("select name from `tabAccount` where master_type = 'Supplier' \
and master_name = %s and docstatus < 2", self.doc.name)
if acc:
from webnotes.model import delete_doc
delete_doc('Account', acc[0][0])
def on_trash(self):
self.delete_supplier_address()
self.delete_supplier_contact()
self.delete_supplier_account()
def before_rename(self, olddn, newdn, merge=False):
from accounts.utils import rename_account_for
rename_account_for("Supplier", olddn, newdn, merge)
def after_rename(self, olddn, newdn, merge=False):
set_field = ''
if webnotes.defaults.get_global_default('supp_master_name') == 'Supplier Name':
webnotes.conn.set(self.doc, "supplier_name", newdn)
self.update_contact()
set_field = ", supplier_name=%(newdn)s"
self.update_supplier_address(newdn, set_field)
def update_supplier_address(self, newdn, set_field):
webnotes.conn.sql("""update `tabAddress` set address_title=%(newdn)s
{set_field} where supplier=%(newdn)s"""\
.format(set_field=set_field), ({"newdn": newdn}))
@webnotes.whitelist()
def get_dashboard_info(supplier):
if not webnotes.has_permission("Supplier", "read", supplier):
webnotes.msgprint("No Permission", raise_exception=True)
out = {}
for doctype in ["Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"]:
out[doctype] = webnotes.conn.get_value(doctype,
{"supplier": supplier, "docstatus": ["!=", 2] }, "count(*)")
billing = webnotes.conn.sql("""select sum(grand_total), sum(outstanding_amount)
from `tabPurchase Invoice`
where supplier=%s
and docstatus = 1
and fiscal_year = %s""", (supplier, webnotes.conn.get_default("fiscal_year")))
out["total_billing"] = billing[0][0]
out["total_unpaid"] = billing[0][1]
return out

View File

@@ -1,169 +0,0 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt"
wn.module_page["Buying"] = [
{
title: wn._("Documents"),
top: true,
icon: "icon-copy",
items: [
{
label: wn._("Supplier"),
description: wn._("Supplier database."),
doctype:"Supplier"
},
{
label: wn._("Material Request"),
description: wn._("Request for purchase."),
doctype:"Material Request"
},
{
label: wn._("Supplier Quotation"),
description: wn._("Quotations received from Suppliers."),
doctype:"Supplier Quotation"
},
{
label: wn._("Purchase Order"),
description: wn._("Purchase Orders given to Suppliers."),
doctype:"Purchase Order"
},
]
},
{
title: wn._("Masters"),
icon: "icon-book",
items: [
{
label: wn._("Contact"),
description: wn._("All Contacts."),
doctype:"Contact"
},
{
label: wn._("Address"),
description: wn._("All Addresses."),
doctype:"Address"
},
{
label: wn._("Item"),
description: wn._("All Products or Services."),
doctype:"Item"
},
]
},
{
title: wn._("Setup"),
icon: "icon-cog",
items: [
{
"label": wn._("Buying Settings"),
"route": "Form/Buying Settings",
"doctype":"Buying Settings",
"description": wn._("Settings for Buying Module")
},
{
"label": wn._("Purchase Taxes and Charges Master"),
"doctype":"Purchase Taxes and Charges Master",
"description": wn._("Tax Template for Purchase")
},
{
label: wn._("Price List"),
description: wn._("Multiple Price list."),
doctype:"Price List"
},
{
label: wn._("Item Price"),
description: wn._("Multiple Item prices."),
doctype:"Item Price"
},
{
"doctype":"Supplier Type",
"label": wn._("Supplier Type"),
"description": wn._("Supplier classification.")
},
{
"route":"Sales Browser/Item Group",
"label":wn._("Item Group"),
"description": wn._("Tree of item classification"),
doctype:"Item Group"
},
{
label: wn._("Terms and Conditions"),
description: wn._("Template of terms or contract."),
doctype:"Terms and Conditions"
},
]
},
{
title: wn._("Tools"),
icon: "icon-wrench",
items: [
]
},
{
title: wn._("Analytics"),
right: true,
icon: "icon-bar-chart",
items: [
{
"label":wn._("Purchase Analytics"),
page: "purchase-analytics"
},
]
},
{
title: wn._("Reports"),
right: true,
icon: "icon-list",
items: [
{
"label":wn._("Items To Be Requested"),
route: "query-report/Items To Be Requested",
doctype: "Item"
},
{
"label":wn._("Requested Items To Be Ordered"),
route: "query-report/Requested Items To Be Ordered",
doctype: "Material Request"
},
{
"label":wn._("Material Requests for which Supplier Quotations are not created"),
route: "query-report/Material Requests for which Supplier Quotations are not created",
doctype: "Material Request"
},
{
"label":wn._("Purchase In Transit"),
route: "query-report/Purchase In Transit",
doctype: "Purchase Order"
},
{
"label":wn._("Item-wise Purchase History"),
route: "query-report/Item-wise Purchase History",
doctype: "Item"
},
{
"label":wn._("Item-wise Last Purchase Rate"),
route: "query-report/Item-wise Last Purchase Rate",
doctype: "Item"
},
{
"label":wn._("Purchase Order Trends"),
route: "query-report/Purchase Order Trends",
doctype: "Purchase Order"
},
{
"label":wn._("Supplier Addresses And Contacts"),
route: "query-report/Supplier Addresses and Contacts",
doctype: "Supplier"
},
{
"label":wn._("Supplier-Wise Sales Analytics"),
route: "query-report/Supplier-Wise Sales Analytics",
doctype: "Stock Ledger Entry"
}
]
}
]
pscript['onload_buying-home'] = function(wrapper) {
wn.views.moduleview.make(wrapper, "Buying");
}

View File

@@ -1,203 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint, _, throw
from webnotes.utils import getdate, flt, add_days, cstr
import json
@webnotes.whitelist()
def get_item_details(args):
"""
args = {
"doctype": "",
"docname": "",
"item_code": "",
"warehouse": None,
"supplier": None,
"transaction_date": None,
"conversion_rate": 1.0,
"buying_price_list": None,
"price_list_currency": None,
"plc_conversion_rate": 1.0,
"is_subcontracted": "Yes" / "No"
}
"""
if isinstance(args, basestring):
args = json.loads(args)
args = webnotes._dict(args)
item_bean = webnotes.bean("Item", args.item_code)
item = item_bean.doc
_validate_item_details(args, item)
out = _get_basic_details(args, item_bean)
out.supplier_part_no = _get_supplier_part_no(args, item_bean)
if not out.warehouse:
out.warehouse = item_bean.doc.default_warehouse
if out.warehouse:
out.projected_qty = get_projected_qty(item.name, out.warehouse)
if args.transaction_date and item.lead_time_days:
out.schedule_date = out.lead_time_date = add_days(args.transaction_date,
item.lead_time_days)
meta = webnotes.get_doctype(args.doctype)
if meta.get_field("currency"):
out.purchase_ref_rate = out.discount_rate = out.purchase_rate = \
out.import_ref_rate = out.import_rate = 0.0
out.update(_get_price_list_rate(args, item_bean, meta))
if args.doctype == "Material Request":
out.min_order_qty = flt(item.min_order_qty)
return out
def _get_basic_details(args, item_bean):
item = item_bean.doc
out = webnotes._dict({
"description": item.description_html or item.description,
"qty": 1.0,
"uom": item.stock_uom,
"conversion_factor": 1.0,
"warehouse": args.warehouse or item.default_warehouse,
"item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in
item_bean.doclist.get({"parentfield": "item_tax"})))),
"batch_no": None,
"expense_head": item.purchase_account \
or webnotes.conn.get_value("Company", args.company, "default_expense_account"),
"cost_center": item.cost_center
})
for fieldname in ("item_name", "item_group", "brand", "stock_uom"):
out[fieldname] = item.fields.get(fieldname)
return out
def _get_price_list_rate(args, item_bean, meta):
from utilities.transaction_base import validate_currency
item = item_bean.doc
out = webnotes._dict()
# try fetching from price list
if args.buying_price_list and args.price_list_currency:
price_list_rate = webnotes.conn.sql("""select ip.ref_rate from
`tabItem Price` ip, `tabPrice List` pl
where ip.price_list=pl.name and ip.price_list=%s and
ip.item_code=%s and ip.buying=1 and pl.enabled=1""",
(args.buying_price_list, args.item_code), as_dict=1)
if price_list_rate:
validate_currency(args, item_bean.doc, meta)
out.import_ref_rate = flt(price_list_rate[0].ref_rate) * \
flt(args.plc_conversion_rate) / flt(args.conversion_rate)
# if not found, fetch from last purchase transaction
if not out.import_ref_rate:
last_purchase = get_last_purchase_details(item.name, args.docname, args.conversion_rate)
if last_purchase:
out.update(last_purchase)
if out.import_ref_rate or out.import_rate:
validate_currency(args, item, meta)
return out
def _get_supplier_part_no(args, item_bean):
item_supplier = item_bean.doclist.get({"parentfield": "item_supplier_details",
"supplier": args.supplier})
return item_supplier and item_supplier[0].supplier_part_no or None
def _validate_item_details(args, item):
from utilities.transaction_base import validate_item_fetch
validate_item_fetch(args, item)
# validate if purchase item or subcontracted item
if item.is_purchase_item != "Yes":
throw(_("Item") + (" %s: " % item.name) + _("not a purchase item"))
if args.is_subcontracted == "Yes" and item.is_sub_contracted_item != "Yes":
throw(_("Item") + (" %s: " % item.name) +
_("not a sub-contracted item.") +
_("Please select a sub-contracted item or do not sub-contract the transaction."))
def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0):
"""returns last purchase details in stock uom"""
# get last purchase order item details
last_purchase_order = webnotes.conn.sql("""\
select po.name, po.transaction_date, po.conversion_rate,
po_item.conversion_factor, po_item.purchase_ref_rate,
po_item.discount_rate, po_item.purchase_rate
from `tabPurchase Order` po, `tabPurchase Order Item` po_item
where po.docstatus = 1 and po_item.item_code = %s and po.name != %s and
po.name = po_item.parent
order by po.transaction_date desc, po.name desc
limit 1""", (item_code, cstr(doc_name)), as_dict=1)
# get last purchase receipt item details
last_purchase_receipt = webnotes.conn.sql("""\
select pr.name, pr.posting_date, pr.posting_time, pr.conversion_rate,
pr_item.conversion_factor, pr_item.purchase_ref_rate, pr_item.discount_rate,
pr_item.purchase_rate
from `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item
where pr.docstatus = 1 and pr_item.item_code = %s and pr.name != %s and
pr.name = pr_item.parent
order by pr.posting_date desc, pr.posting_time desc, pr.name desc
limit 1""", (item_code, cstr(doc_name)), as_dict=1)
purchase_order_date = getdate(last_purchase_order and last_purchase_order[0].transaction_date \
or "1900-01-01")
purchase_receipt_date = getdate(last_purchase_receipt and \
last_purchase_receipt[0].posting_date or "1900-01-01")
if (purchase_order_date > purchase_receipt_date) or \
(last_purchase_order and not last_purchase_receipt):
# use purchase order
last_purchase = last_purchase_order[0]
purchase_date = purchase_order_date
elif (purchase_receipt_date > purchase_order_date) or \
(last_purchase_receipt and not last_purchase_order):
# use purchase receipt
last_purchase = last_purchase_receipt[0]
purchase_date = purchase_receipt_date
else:
return webnotes._dict()
conversion_factor = flt(last_purchase.conversion_factor)
out = webnotes._dict({
"purchase_ref_rate": flt(last_purchase.purchase_ref_rate) / conversion_factor,
"purchase_rate": flt(last_purchase.purchase_rate) / conversion_factor,
"discount_rate": flt(last_purchase.discount_rate),
"purchase_date": purchase_date
})
conversion_rate = flt(conversion_rate) or 1.0
out.update({
"import_ref_rate": out.purchase_ref_rate / conversion_rate,
"import_rate": out.purchase_rate / conversion_rate,
"rate": out.purchase_rate
})
return out
@webnotes.whitelist()
def get_conversion_factor(item_code, uom):
return {"conversion_factor": webnotes.conn.get_value("UOM Conversion Detail",
{"parent": item_code, "uom": uom}, "conversion_factor")}
@webnotes.whitelist()
def get_projected_qty(item_code, warehouse):
return webnotes.conn.get_value("Bin", {"item_code": item_code,
"warehouse": warehouse}, "projected_qty")

View File

@@ -1,78 +0,0 @@
{
"app_name": "ERPNext",
"app_version": "3.8.0",
"base_template": "app/portal/templates/base.html",
"modules": {
"Accounts": {
"color": "#3498db",
"icon": "icon-money",
"link": "accounts-home",
"type": "module"
},
"Activity": {
"color": "#e67e22",
"icon": "icon-play",
"label": "Activity",
"link": "activity",
"type": "page"
},
"Buying": {
"color": "#c0392b",
"icon": "icon-shopping-cart",
"link": "buying-home",
"type": "module"
},
"HR": {
"color": "#2ecc71",
"icon": "icon-group",
"label": "Human Resources",
"link": "hr-home",
"type": "module"
},
"Manufacturing": {
"color": "#7f8c8d",
"icon": "icon-cogs",
"link": "manufacturing-home",
"type": "module"
},
"Notes": {
"color": "#95a5a6",
"doctype": "Note",
"icon": "icon-file-alt",
"label": "Notes",
"link": "List/Note",
"type": "list"
},
"Projects": {
"color": "#8e44ad",
"icon": "icon-puzzle-piece",
"link": "projects-home",
"type": "module"
},
"Selling": {
"color": "#1abc9c",
"icon": "icon-tag",
"link": "selling-home",
"type": "module"
},
"Setup": {
"color": "#bdc3c7",
"icon": "icon-wrench",
"link": "Setup",
"type": "setup"
},
"Stock": {
"color": "#f39c12",
"icon": "icon-truck",
"link": "stock-home",
"type": "module"
},
"Support": {
"color": "#2c3e50",
"icon": "icon-phone",
"link": "support-home",
"type": "module"
}
},
"requires_framework_version": "==3.9.0"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,9 @@
{%- if doc.letter_head -%}
{{ webnotes.conn.get_value("Letter Head", doc.letter_head, "content") }}
{{ frappe.conn.get_value("Letter Head", doc.letter_head, "content") }}
{%- endif -%}
<!-- Page Layout Settings -->
<div class='common page-header'>
<table class='header-table' cellspacing=0>
<table class='header-table' cellspacing=0 style="width: 100%">
<thead>
<tr><td colspan="2"><h1>{{ doc.select_print_heading or 'Invoice' }}</h1></td></tr>
<tr><td colspan="2"><h3>{{ doc.name }}</h3></td></tr>
@@ -28,18 +28,18 @@
<tr>
<td width=40%><b>Invoice Date</b></td>
<td>{{ utils.formatdate(doc.posting_date) }}</td>
<tr>
</tr>
{%- if doc.convert_into_recurring_invoice and doc.recurring_id -%}
<tr>
<td width=40%><b>Invoice Period</b></td>
<td>{{ (utils.formatdate(doc.invoice_period_from_date)) +
' to ' + utils.formatdate(doc.invoice_period_to_date) }}</td>
<tr>
</tr>
{%- endif -%}
<tr>
<td><b>Due Date</b></td>
<td>{{ utils.formatdate(doc.due_date) }}</td>
<tr>
</tr>
</tbody></table></td>
</tr>
</tbody>
@@ -72,8 +72,8 @@
<td style="width: 37%;">{{ row.description }}</td>
<td style="width: 5%; text-align: right;">{{ row.qty }}</td>
<td style="width: 5%;">{{ row.stock_uom }}</td>
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_rate, currency=doc.currency) }}</td>
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_amount, currency=doc.currency) }}</td>
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.rate, currency=doc.currency) }}</td>
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.amount, currency=doc.currency) }}</td>
</tr>
{% endfor -%}
</tbody>

View File

@@ -11,7 +11,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
// -----------------------------------------
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(doc.__islocal) {
msgprint(wn._("Please create new account from Chart of Accounts."));
msgprint(frappe._("Please create new account from Chart of Accounts."));
throw "cannot create";
}
@@ -26,8 +26,8 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
'is_pl_account', 'company'], false);
if(doc.group_or_ledger=='Ledger') {
wn.model.with_doc("Accounts Settings", "Accounts Settings", function (name) {
var accounts_settings = wn.model.get_doc("Accounts Settings", name);
frappe.model.with_doc("Accounts Settings", "Accounts Settings", function (name) {
var accounts_settings = frappe.model.get_doc("Accounts Settings", name);
var display = accounts_settings["frozen_accounts_modifier"]
&& in_list(user_roles, accounts_settings["frozen_accounts_modifier"]);
@@ -37,8 +37,8 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
// read-only for root accounts
if(!doc.parent_account) {
cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_intro(wn._("This is a root account and cannot be edited."));
cur_frm.set_read_only();
cur_frm.set_intro(frappe._("This is a root account and cannot be edited."));
} else {
// credit days and type if customer or supplier
cur_frm.set_intro(null);
@@ -81,24 +81,24 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) {
// Hide/unhide group or ledger
// -----------------------------------------
cur_frm.cscript.add_toolbar_buttons = function(doc) {
cur_frm.appframe.add_button(wn._('Chart of Accounts'),
function() { wn.set_route("Accounts Browser", "Account"); }, 'icon-sitemap')
cur_frm.appframe.add_button(frappe._('Chart of Accounts'),
function() { frappe.set_route("Accounts Browser", "Account"); }, 'icon-sitemap')
if (cstr(doc.group_or_ledger) == 'Group') {
cur_frm.add_custom_button(wn._('Convert to Ledger'),
cur_frm.add_custom_button(frappe._('Convert to Ledger'),
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet')
} else if (cstr(doc.group_or_ledger) == 'Ledger') {
cur_frm.add_custom_button(wn._('Convert to Group'),
cur_frm.add_custom_button(frappe._('Convert to Group'),
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
cur_frm.appframe.add_button(wn._('View Ledger'), function() {
wn.route_options = {
cur_frm.appframe.add_button(frappe._('View Ledger'), function() {
frappe.route_options = {
"account": doc.name,
"from_date": sys_defaults.year_start_date,
"to_date": sys_defaults.year_end_date,
"company": doc.company
};
wn.set_route("query-report", "General Ledger");
frappe.set_route("query-report", "General Ledger");
}, "icon-table");
}
}

View File

@@ -2,12 +2,12 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
from webnotes.utils import flt, fmt_money, cstr, cint
from webnotes import msgprint, _
from frappe.utils import flt, fmt_money, cstr, cint
from frappe import msgprint, throw, _
get_value = webnotes.conn.get_value
get_value = frappe.conn.get_value
class DocType:
def __init__(self,d,dl):
@@ -16,11 +16,11 @@ class DocType:
def autoname(self):
self.doc.name = self.doc.account_name.strip() + ' - ' + \
webnotes.conn.get_value("Company", self.doc.company, "abbr")
frappe.conn.get_value("Company", self.doc.company, "abbr")
def get_address(self):
return {
'address': webnotes.conn.get_value(self.doc.master_type,
'address': frappe.conn.get_value(self.doc.master_type,
self.doc.master_name, "address")
}
@@ -41,24 +41,29 @@ class DocType:
if self.doc.master_type in ('Customer', 'Supplier') or self.doc.account_type == "Warehouse":
if not self.doc.master_name:
msgprint(_("Please enter Master Name once the account is created."))
elif not webnotes.conn.exists(self.doc.master_type or self.doc.account_type,
elif not frappe.conn.exists(self.doc.master_type or self.doc.account_type,
self.doc.master_name):
webnotes.throw(_("Invalid Master Name"))
throw(_("Invalid Master Name"))
def validate_parent(self):
"""Fetch Parent Details and validation for account not to be created under ledger"""
if self.doc.parent_account:
par = webnotes.conn.sql("""select name, group_or_ledger, is_pl_account, debit_or_credit
par = frappe.conn.sql("""select name, group_or_ledger, is_pl_account, debit_or_credit
from tabAccount where name =%s""", self.doc.parent_account)
if not par:
msgprint("Parent account does not exists", raise_exception=1)
throw(_("Parent account does not exists"))
elif par[0][0] == self.doc.name:
msgprint("You can not assign itself as parent account", raise_exception=1)
throw(_("You can not assign itself as parent account"))
elif par[0][1] != 'Group':
msgprint("Parent account can not be a ledger", raise_exception=1)
throw(_("Parent account can not be a ledger"))
elif self.doc.debit_or_credit and par[0][3] != self.doc.debit_or_credit:
msgprint("You can not move a %s account under %s account" %
(self.doc.debit_or_credit, par[0][3]), raise_exception=1)
throw("{msg} {debit_or_credit} {under} {account} {acc}".format(**{
"msg": _("You cannot move a"),
"debit_or_credit": self.doc.debit_or_credit,
"under": _("account under"),
"account": par[0][3],
"acc": _("account")
}))
if not self.doc.is_pl_account:
self.doc.is_pl_account = par[0][2]
@@ -67,42 +72,48 @@ class DocType:
def validate_max_root_accounts(self):
"""Raise exception if there are more than 4 root accounts"""
if webnotes.conn.sql("""select count(*) from tabAccount where
if frappe.conn.sql("""select count(*) from tabAccount where
company=%s and ifnull(parent_account,'')='' and docstatus != 2""",
self.doc.company)[0][0] > 4:
webnotes.msgprint("One company cannot have more than 4 root Accounts",
raise_exception=1)
throw(_("One company cannot have more than 4 root Accounts"))
def validate_duplicate_account(self):
if self.doc.fields.get('__islocal') or not self.doc.name:
company_abbr = webnotes.conn.get_value("Company", self.doc.company, "abbr")
if webnotes.conn.sql("""select name from tabAccount where name=%s""",
company_abbr = frappe.conn.get_value("Company", self.doc.company, "abbr")
if frappe.conn.sql("""select name from tabAccount where name=%s""",
(self.doc.account_name + " - " + company_abbr)):
msgprint("Account Name: %s already exists, please rename"
% self.doc.account_name, raise_exception=1)
throw("{name}: {acc_name} {exist}, {rename}".format(**{
"name": _("Account Name"),
"acc_name": self.doc.account_name,
"exist": _("already exists"),
"rename": _("please rename")
}))
def validate_root_details(self):
#does not exists parent
if webnotes.conn.exists("Account", self.doc.name):
if not webnotes.conn.get_value("Account", self.doc.name, "parent_account"):
webnotes.msgprint("Root cannot be edited.", raise_exception=1)
if frappe.conn.exists("Account", self.doc.name):
if not frappe.conn.get_value("Account", self.doc.name, "parent_account"):
throw(_("Root cannot be edited."))
def validate_frozen_accounts_modifier(self):
old_value = webnotes.conn.get_value("Account", self.doc.name, "freeze_account")
old_value = frappe.conn.get_value("Account", self.doc.name, "freeze_account")
if old_value and old_value != self.doc.freeze_account:
frozen_accounts_modifier = webnotes.conn.get_value( 'Accounts Settings', None,
frozen_accounts_modifier = frappe.conn.get_value( 'Accounts Settings', None,
'frozen_accounts_modifier')
if not frozen_accounts_modifier or \
frozen_accounts_modifier not in webnotes.user.get_roles():
webnotes.throw(_("You are not authorized to set Frozen value"))
frozen_accounts_modifier not in frappe.user.get_roles():
throw(_("You are not authorized to set Frozen value"))
def convert_group_to_ledger(self):
if self.check_if_child_exists():
msgprint("Account: %s has existing child. You can not convert this account to ledger" %
(self.doc.name), raise_exception=1)
throw("{acc}: {account_name} {child}. {msg}".format(**{
"acc": _("Account"),
"account_name": self.doc.name,
"child": _("has existing child"),
"msg": _("You can not convert this account to ledger")
}))
elif self.check_gle_exists():
msgprint("Account with existing transaction can not be converted to ledger.",
raise_exception=1)
throw(_("Account with existing transaction can not be converted to ledger."))
else:
self.doc.group_or_ledger = 'Ledger'
self.doc.save()
@@ -110,11 +121,9 @@ class DocType:
def convert_ledger_to_group(self):
if self.check_gle_exists():
msgprint("Account with existing transaction can not be converted to group.",
raise_exception=1)
throw(_("Account with existing transaction can not be converted to group."))
elif self.doc.master_type or self.doc.account_type:
msgprint("Cannot covert to Group because Master Type or Account Type is selected.",
raise_exception=1)
throw(_("Cannot covert to Group because Master Type or Account Type is selected."))
else:
self.doc.group_or_ledger = 'Group'
self.doc.save()
@@ -122,42 +131,42 @@ class DocType:
# Check if any previous balance exists
def check_gle_exists(self):
return webnotes.conn.get_value("GL Entry", {"account": self.doc.name})
return frappe.conn.get_value("GL Entry", {"account": self.doc.name})
def check_if_child_exists(self):
return webnotes.conn.sql("""select name from `tabAccount` where parent_account = %s
return frappe.conn.sql("""select name from `tabAccount` where parent_account = %s
and docstatus != 2""", self.doc.name)
def validate_mandatory(self):
if not self.doc.debit_or_credit:
msgprint("Debit or Credit field is mandatory", raise_exception=1)
throw(_("Debit or Credit field is mandatory"))
if not self.doc.is_pl_account:
msgprint("Is PL Account field is mandatory", raise_exception=1)
throw(_("Is PL Account field is mandatory"))
def validate_warehouse_account(self):
if not cint(webnotes.defaults.get_global_default("auto_accounting_for_stock")):
if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
return
if self.doc.account_type == "Warehouse":
old_warehouse = cstr(webnotes.conn.get_value("Account", self.doc.name, "master_name"))
old_warehouse = cstr(frappe.conn.get_value("Account", self.doc.name, "master_name"))
if old_warehouse != cstr(self.doc.master_name):
if old_warehouse:
self.validate_warehouse(old_warehouse)
if self.doc.master_name:
self.validate_warehouse(self.doc.master_name)
else:
webnotes.throw(_("Master Name is mandatory if account type is Warehouse"))
throw(_("Master Name is mandatory if account type is Warehouse"))
def validate_warehouse(self, warehouse):
if webnotes.conn.get_value("Stock Ledger Entry", {"warehouse": warehouse}):
webnotes.throw(_("Stock transactions exist against warehouse ") + warehouse +
if frappe.conn.get_value("Stock Ledger Entry", {"warehouse": warehouse}):
throw(_("Stock transactions exist against warehouse ") + warehouse +
_(" .You can not assign / modify / remove Master Name"))
def update_nsm_model(self):
"""update lft, rgt indices for nested set model"""
import webnotes
import webnotes.utils.nestedset
webnotes.utils.nestedset.update_nsm(self)
import frappe
import frappe.utils.nestedset
frappe.utils.nestedset.update_nsm(self)
def on_update(self):
self.validate_max_root_accounts()
@@ -165,40 +174,39 @@ class DocType:
def get_authorized_user(self):
# Check logged-in user is authorized
if webnotes.conn.get_value('Accounts Settings', None, 'credit_controller') \
in webnotes.user.get_roles():
if frappe.conn.get_value('Accounts Settings', None, 'credit_controller') \
in frappe.user.get_roles():
return 1
def check_credit_limit(self, total_outstanding):
# Get credit limit
credit_limit_from = 'Customer'
cr_limit = webnotes.conn.sql("""select t1.credit_limit from tabCustomer t1, `tabAccount` t2
cr_limit = frappe.conn.sql("""select t1.credit_limit from tabCustomer t1, `tabAccount` t2
where t2.name=%s and t1.name = t2.master_name""", self.doc.name)
credit_limit = cr_limit and flt(cr_limit[0][0]) or 0
if not credit_limit:
credit_limit = webnotes.conn.get_value('Company', self.doc.company, 'credit_limit')
credit_limit = frappe.conn.get_value('Company', self.doc.company, 'credit_limit')
credit_limit_from = 'Company'
# If outstanding greater than credit limit and not authorized person raise exception
if credit_limit > 0 and flt(total_outstanding) > credit_limit \
and not self.get_authorized_user():
msgprint("""Total Outstanding amount (%s) for <b>%s</b> can not be \
throw("""Total Outstanding amount (%s) for <b>%s</b> can not be \
greater than credit limit (%s). To change your credit limit settings, \
please update in the <b>%s</b> master""" % (fmt_money(total_outstanding),
self.doc.name, fmt_money(credit_limit), credit_limit_from), raise_exception=1)
self.doc.name, fmt_money(credit_limit), credit_limit_from))
def validate_trash(self):
"""checks gl entries and if child exists"""
if not self.doc.parent_account:
msgprint("Root account can not be deleted", raise_exception=1)
throw(_("Root account can not be deleted"))
if self.check_gle_exists():
msgprint("""Account with existing transaction (Sales Invoice / Purchase Invoice / \
Journal Voucher) can not be deleted""", raise_exception=1)
throw("""Account with existing transaction (Sales Invoice / Purchase Invoice / \
Journal Voucher) can not be deleted""")
if self.check_if_child_exists():
msgprint("Child account exists for this account. You can not delete this account.",
raise_exception=1)
throw(_("Child account exists for this account. You can not delete this account."))
def on_trash(self):
self.validate_trash()
@@ -206,19 +214,19 @@ class DocType:
def before_rename(self, old, new, merge=False):
# Add company abbr if not provided
from setup.doctype.company.company import get_name_with_abbr
from erpnext.setup.doctype.company.company import get_name_with_abbr
new_account = get_name_with_abbr(new, self.doc.company)
# Validate properties before merging
if merge:
if not webnotes.conn.exists("Account", new):
webnotes.throw(_("Account ") + new +_(" does not exists"))
if not frappe.conn.exists("Account", new):
throw(_("Account ") + new +_(" does not exists"))
val = list(webnotes.conn.get_value("Account", new_account,
["group_or_ledger", "debit_or_credit", "is_pl_account"]))
val = list(frappe.conn.get_value("Account", new_account,
["group_or_ledger", "debit_or_credit", "is_pl_account", "company"]))
if val != [self.doc.group_or_ledger, self.doc.debit_or_credit, self.doc.is_pl_account]:
webnotes.throw(_("""Merging is only possible if following \
if val != [self.doc.group_or_ledger, self.doc.debit_or_credit, self.doc.is_pl_account, self.doc.company]:
throw(_("""Merging is only possible if following \
properties are same in both records.
Group or Ledger, Debit or Credit, Is PL Account"""))
@@ -226,22 +234,22 @@ class DocType:
def after_rename(self, old, new, merge=False):
if not merge:
webnotes.conn.set_value("Account", new, "account_name",
frappe.conn.set_value("Account", new, "account_name",
" - ".join(new.split(" - ")[:-1]))
else:
from webnotes.utils.nestedset import rebuild_tree
from frappe.utils.nestedset import rebuild_tree
rebuild_tree("Account", "parent_account")
def get_master_name(doctype, txt, searchfield, start, page_len, filters):
conditions = (" and company='%s'"% filters["company"]) if doctype == "Warehouse" else ""
return webnotes.conn.sql("""select name from `tab%s` where %s like %s %s
return frappe.conn.sql("""select name from `tab%s` where %s like %s %s
order by name limit %s, %s""" %
(filters["master_type"], searchfield, "%s", conditions, "%s", "%s"),
("%%%s%%" % txt, start, page_len), as_list=1)
def get_parent_account(doctype, txt, searchfield, start, page_len, filters):
return webnotes.conn.sql("""select name from tabAccount
return frappe.conn.sql("""select name from tabAccount
where group_or_ledger = 'Group' and docstatus != 2 and company = %s
and %s like %s order by name limit %s, %s""" %
("%s", searchfield, "%s", "%s", "%s"),

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-30 12:49:46",
"docstatus": 0,
"modified": "2013-09-24 11:22:18",
"modified": "2014-01-20 17:48:20",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,6 +28,7 @@
},
{
"amend": 0,
"cancel": 0,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Account",
@@ -138,6 +139,7 @@
"doctype": "DocField",
"fieldname": "parent_account",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Parent Account",
"oldfieldname": "parent_account",
"oldfieldtype": "Link",
@@ -154,7 +156,6 @@
"oldfieldname": "account_type",
"oldfieldtype": "Select",
"options": "\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable\nWarehouse",
"permlevel": 0,
"search_index": 0
},
{
@@ -254,64 +255,77 @@
"read_only": 1
},
{
"cancel": 1,
"create": 1,
"delete": 1,
"doctype": "DocPerm",
"email": 1,
"permlevel": 0,
"print": 1,
"role": "Accounts User",
"write": 1
},
{
"cancel": 0,
"create": 0,
"delete": 0,
"doctype": "DocPerm",
"email": 1,
"permlevel": 0,
"print": 1,
"role": "Auditor",
"write": 0
},
{
"cancel": 0,
"create": 0,
"delete": 0,
"doctype": "DocPerm",
"email": 1,
"permlevel": 0,
"print": 1,
"role": "Sales User",
"write": 0
},
{
"cancel": 0,
"create": 0,
"delete": 0,
"doctype": "DocPerm",
"email": 1,
"permlevel": 0,
"print": 1,
"role": "Purchase User",
"write": 0
},
{
"cancel": 0,
"create": 0,
"delete": 0,
"doctype": "DocPerm",
"permlevel": 2,
"role": "Auditor",
"write": 0
},
{
"cancel": 1,
"create": 1,
"delete": 1,
"doctype": "DocPerm",
"email": 1,
"export": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"restrict": 1,
"role": "Accounts Manager",
"write": 1
},
{
"cancel": 0,
"create": 0,
"delete": 0,
"doctype": "DocPerm",
"permlevel": 2,
"role": "Accounts Manager",
"write": 1
},
{
"cancel": 0,
"create": 0,
"delete": 0,
"doctype": "DocPerm",
"permlevel": 2,
"role": "Accounts User",

View File

@@ -2,10 +2,10 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
def make_test_records(verbose):
from webnotes.test_runner import make_test_objects
def _make_test_records(verbose):
from frappe.test_runner import make_test_objects
accounts = [
# [account_name, parent_account, group_or_ledger]

View File

@@ -4,28 +4,28 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _
from webnotes.utils import cint
import frappe
from frappe import _
from frappe.utils import cint
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def on_update(self):
webnotes.conn.set_default("auto_accounting_for_stock", self.doc.auto_accounting_for_stock)
frappe.conn.set_default("auto_accounting_for_stock", self.doc.auto_accounting_for_stock)
if cint(self.doc.auto_accounting_for_stock):
# set default perpetual account in company
for company in webnotes.conn.sql("select name from tabCompany"):
webnotes.bean("Company", company[0]).save()
for company in frappe.conn.sql("select name from tabCompany"):
frappe.bean("Company", company[0]).save()
# Create account head for warehouses
warehouse_list = webnotes.conn.sql("select name, company from tabWarehouse", as_dict=1)
warehouse_list = frappe.conn.sql("select name, company from tabWarehouse", as_dict=1)
warehouse_with_no_company = [d.name for d in warehouse_list if not d.company]
if warehouse_with_no_company:
webnotes.throw(_("Company is missing in following warehouses") + ": \n" +
frappe.throw(_("Company is missing in following warehouses") + ": \n" +
"\n".join(warehouse_with_no_company))
for wh in warehouse_list:
wh_bean = webnotes.bean("Warehouse", wh.name)
wh_bean = frappe.bean("Warehouse", wh.name)
wh_bean.save()

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-06-24 15:49:57",
"docstatus": 0,
"modified": "2013-09-24 11:52:58",
"modified": "2013-12-20 19:22:52",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,11 +25,13 @@
{
"create": 1,
"doctype": "DocPerm",
"email": 1,
"name": "__common__",
"parent": "Accounts Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"print": 1,
"read": 1,
"role": "Accounts Manager",
"write": 1

View File

@@ -1,9 +1,8 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
cur_frm.add_fetch("bank_account", "company", "company");
cur_frm.cscript.onload = function(doc, cdt, cdn){
cur_frm.set_intro('<i class="icon-question" /> ' +
wn._("Update clearance date of Journal Entries marked as 'Bank Vouchers'"))
}
frappe._("Update clearance date of Journal Entries marked as 'Bank Vouchers'"))
}

View File

@@ -2,13 +2,13 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
from webnotes.utils import cstr, flt, getdate, now, nowdate
from webnotes.model import db_exists
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist, copy_doclist
from webnotes import msgprint
from frappe.utils import cstr, flt, getdate, now, nowdate
from frappe.model import db_exists
from frappe.model.doc import addchild
from frappe.model.bean import getlist, copy_doclist
from frappe import msgprint
@@ -22,7 +22,7 @@ class DocType:
msgprint("Bank Account, From Date and To Date are Mandatory")
return
dl = webnotes.conn.sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date))
dl = frappe.conn.sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date))
self.doclist = self.doc.clear_table(self.doclist, 'entries')
self.doc.total_amount = 0.0
@@ -46,7 +46,7 @@ class DocType:
msgprint("Clearance Date can not be before Cheque Date (Row #%s)" %
d.idx, raise_exception=1)
webnotes.conn.sql("""update `tabJournal Voucher`
frappe.conn.sql("""update `tabJournal Voucher`
set clearance_date = %s, modified = %s where name=%s""",
(d.clearance_date, nowdate(), d.voucher_id))
vouchers.append(d.voucher_id)

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
class DocType:
def __init__(self, d, dl):

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:37",
"docstatus": 0,
"modified": "2013-11-03 14:11:31",
"modified": "2013-12-20 19:22:55",
"modified_by": "Administrator",
"owner": "Administrator"
},

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
class DocType:
def __init__(self, d, dl):

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:55:04",
"docstatus": 0,
"modified": "2013-08-22 17:27:59",
"modified": "2013-12-20 19:22:59",
"modified_by": "Administrator",
"owner": "Administrator"
},

View File

@@ -8,7 +8,7 @@ cur_frm.cscript.onload = function(doc,cdt,cdn){
}
return $c('runserverobj',args={'method' : 'get_months', 'docs' :
wn.model.compress(make_doclist(doc.doctype, doc.name))},callback1);
frappe.model.compress(make_doclist(doc.doctype, doc.name))},callback1);
}
}

View File

@@ -2,12 +2,12 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
from webnotes.utils import flt
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
from webnotes import msgprint, _
from frappe.utils import flt
from frappe.model.doc import addchild
from frappe.model.bean import getlist
from frappe import msgprint, _
class DocType:
def __init__(self,doc,doclist=[]):

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:05",
"docstatus": 0,
"modified": "2013-07-22 15:30:37",
"modified": "2014-01-20 17:48:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -24,6 +24,7 @@
"permlevel": 0
},
{
"cancel": 0,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Budget Distribution",
@@ -79,13 +80,16 @@
},
{
"amend": 0,
"cancel": 1,
"create": 1,
"delete": 1,
"doctype": "DocPerm",
"email": 1,
"permlevel": 0,
"print": 1,
"write": 1
},
{
"delete": 0,
"doctype": "DocPerm",
"permlevel": 2
}

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
class DocType:
def __init__(self, d, dl):

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:38",
"docstatus": 0,
"modified": "2013-07-10 14:54:06",
"modified": "2013-12-20 19:22:59",
"modified_by": "Administrator",
"owner": "Administrator"
},

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt, getdate
from webnotes.model.bean import getlist
import frappe
from frappe.utils import flt, getdate
from frappe.model.bean import getlist
class DocType:
def __init__(self,d,dl):
@@ -16,19 +16,19 @@ class DocType:
for d in getlist(self.doclist, 'invoice_details'):
if d.invoice_no:
inv = webnotes.conn.sql("""select c_form_applicable, c_form_no from
inv = frappe.conn.sql("""select c_form_applicable, c_form_no from
`tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no)
if not inv:
webnotes.msgprint("""Invoice: %s is not exists in the system or
frappe.msgprint("""Invoice: %s is not exists in the system or
is not submitted, please check.""" % d.invoice_no, raise_exception=1)
elif inv[0][0] != 'Yes':
webnotes.msgprint("C-form is not applicable for Invoice: %s" %
frappe.msgprint("C-form is not applicable for Invoice: %s" %
d.invoice_no, raise_exception=1)
elif inv[0][1] and inv[0][1] != self.doc.name:
webnotes.msgprint("""Invoice %s is tagged in another C-form: %s.
frappe.msgprint("""Invoice %s is tagged in another C-form: %s.
If you want to change C-form no for this invoice,
please remove invoice no from the previous c-form and then try again""" %
(d.invoice_no, inv[0][1]), raise_exception=1)
@@ -42,31 +42,31 @@ class DocType:
def before_cancel(self):
# remove cform reference
webnotes.conn.sql("""update `tabSales Invoice` set c_form_no=null
frappe.conn.sql("""update `tabSales Invoice` set c_form_no=null
where c_form_no=%s""", self.doc.name)
def set_cform_in_sales_invoices(self):
inv = [d.invoice_no for d in getlist(self.doclist, 'invoice_details')]
if inv:
webnotes.conn.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s
frappe.conn.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s
where name in (%s)""" % ('%s', '%s', ', '.join(['%s'] * len(inv))),
tuple([self.doc.name, self.doc.modified] + inv))
webnotes.conn.sql("""update `tabSales Invoice` set c_form_no = null, modified = %s
frappe.conn.sql("""update `tabSales Invoice` set c_form_no = null, modified = %s
where name not in (%s) and ifnull(c_form_no, '') = %s""" %
('%s', ', '.join(['%s']*len(inv)), '%s'),
tuple([self.doc.modified] + inv + [self.doc.name]))
else:
webnotes.msgprint("Please enter atleast 1 invoice in the table", raise_exception=1)
frappe.msgprint("Please enter atleast 1 invoice in the table", raise_exception=1)
def set_total_invoiced_amount(self):
total = sum([flt(d.grand_total) for d in getlist(self.doclist, 'invoice_details')])
webnotes.conn.set(self.doc, 'total_invoiced_amount', total)
frappe.conn.set(self.doc, 'total_invoiced_amount', total)
def get_invoice_details(self, invoice_no):
""" Pull details from invoices for referrence """
inv = webnotes.conn.sql("""select posting_date, territory, net_total, grand_total
inv = frappe.conn.sql("""select posting_date, territory, net_total, grand_total
from `tabSales Invoice` where name = %s""", invoice_no)
return {
'invoice_date' : inv and getdate(inv[0][0]).strftime('%Y-%m-%d') or '',
@@ -76,10 +76,10 @@ class DocType:
}
def get_invoice_nos(doctype, txt, searchfield, start, page_len, filters):
from utilities import build_filter_conditions
from erpnext.utilities import build_filter_conditions
conditions, filter_values = build_filter_conditions(filters)
return webnotes.conn.sql("""select name from `tabSales Invoice` where docstatus = 1
return frappe.conn.sql("""select name from `tabSales Invoice` where docstatus = 1
and c_form_applicable = 'Yes' and ifnull(c_form_no, '') = '' %s
and %s like %s order by name limit %s, %s""" %
(conditions, searchfield, "%s", "%s", "%s"),

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:55:06",
"docstatus": 0,
"modified": "2013-11-02 14:05:25",
"modified": "2013-12-20 19:23:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -157,6 +157,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "C-Form",
@@ -166,14 +167,18 @@
{
"create": 1,
"doctype": "DocPerm",
"email": 1,
"permlevel": 0,
"print": 1,
"role": "Accounts User",
"write": 1
},
{
"create": 1,
"doctype": "DocPerm",
"email": 1,
"permlevel": 0,
"print": 1,
"role": "Accounts Manager",
"write": 1
},

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
class DocType:
def __init__(self, d, dl):

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:38",
"docstatus": 0,
"modified": "2013-11-02 16:58:31",
"modified": "2013-12-20 19:23:00",
"modified_by": "Administrator",
"owner": "Administrator"
},

View File

@@ -1,8 +1,8 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
wn.provide("erpnext.accounts");
erpnext.accounts.CostCenterController = wn.ui.form.Controller.extend({
frappe.provide("erpnext.accounts");
erpnext.accounts.CostCenterController = frappe.ui.form.Controller.extend({
onload: function() {
this.setup_queries();
},
@@ -41,8 +41,8 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.toggle_enable(['group_or_ledger', 'company'], doc.__islocal);
if(!doc.__islocal && doc.group_or_ledger=='Group') {
intro_txt += '<p><b>'+wn._('Note:')+'</b>'+ wn._('This Cost Center is a')+ '<i>'+wn._('Group')+'</i>, '+
wn._('Accounting Entries are not allowed against groups.')+'</p>';
intro_txt += '<p><b>'+frappe._('Note:')+'</b>'+ frappe._('This Cost Center is a')+ '<i>'+frappe._('Group')+'</i>, '+
frappe._('Accounting Entries are not allowed against groups.')+'</p>';
}
cur_frm.cscript.hide_unhide_group_ledger(doc);
@@ -50,22 +50,22 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.toggle_display('sb1', doc.group_or_ledger=='Ledger')
cur_frm.set_intro(intro_txt);
cur_frm.appframe.add_button(wn._('Chart of Cost Centers'),
function() { wn.set_route("Accounts Browser", "Cost Center"); }, 'icon-sitemap')
cur_frm.appframe.add_button(frappe._('Chart of Cost Centers'),
function() { frappe.set_route("Accounts Browser", "Cost Center"); }, 'icon-sitemap')
}
cur_frm.cscript.parent_cost_center = function(doc,cdt,cdn){
cur_frm.cscript.parent_cost_center = function(doc, cdt, cdn) {
if(!doc.company){
alert(wn._('Please enter company name first'));
msgprint(frappe._('Please enter company name first'));
}
}
cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
if (cstr(doc.group_or_ledger) == 'Group') {
cur_frm.add_custom_button(wn._('Convert to Ledger'),
cur_frm.add_custom_button(frappe._('Convert to Ledger'),
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet')
} else if (cstr(doc.group_or_ledger) == 'Ledger') {
cur_frm.add_custom_button(wn._('Convert to Group'),
cur_frm.add_custom_button(frappe._('Convert to Group'),
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
}
}

View File

@@ -2,11 +2,11 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.model.bean import getlist
from webnotes import msgprint, _
import frappe
from frappe.model.bean import getlist
from frappe import msgprint, _
from webnotes.utils.nestedset import DocTypeNestedSet
from frappe.utils.nestedset import DocTypeNestedSet
class DocType(DocTypeNestedSet):
def __init__(self,d,dl):
@@ -14,7 +14,7 @@ class DocType(DocTypeNestedSet):
self.nsm_parent_field = 'parent_cost_center'
def autoname(self):
company_abbr = webnotes.conn.sql("select abbr from tabCompany where name=%s",
company_abbr = frappe.conn.sql("select abbr from tabCompany where name=%s",
self.doc.company)[0][0]
self.doc.name = self.doc.cost_center_name.strip() + ' - ' + company_abbr
@@ -46,10 +46,10 @@ class DocType(DocTypeNestedSet):
return 1
def check_gle_exists(self):
return webnotes.conn.get_value("GL Entry", {"cost_center": self.doc.name})
return frappe.conn.get_value("GL Entry", {"cost_center": self.doc.name})
def check_if_child_exists(self):
return webnotes.conn.sql("select name from `tabCost Center` where \
return frappe.conn.sql("select name from `tabCost Center` where \
parent_cost_center = %s and docstatus != 2", self.doc.name)
def validate_budget_details(self):
@@ -67,7 +67,7 @@ class DocType(DocTypeNestedSet):
"""
Cost Center name must be unique
"""
if (self.doc.fields.get("__islocal") or not self.doc.name) and webnotes.conn.sql("select name from `tabCost Center` where cost_center_name = %s and company=%s", (self.doc.cost_center_name, self.doc.company)):
if (self.doc.fields.get("__islocal") or not self.doc.name) and frappe.conn.sql("select name from `tabCost Center` where cost_center_name = %s and company=%s", (self.doc.cost_center_name, self.doc.company)):
msgprint("Cost Center Name already exists, please rename", raise_exception=1)
self.validate_mandatory()
@@ -75,7 +75,7 @@ class DocType(DocTypeNestedSet):
def before_rename(self, olddn, newdn, merge=False):
# Add company abbr if not provided
from setup.doctype.company.company import get_name_with_abbr
from erpnext.setup.doctype.company.company import get_name_with_abbr
new_cost_center = get_name_with_abbr(newdn, self.doc.company)
# Validate properties before merging
@@ -85,7 +85,7 @@ class DocType(DocTypeNestedSet):
def after_rename(self, olddn, newdn, merge=False):
if not merge:
webnotes.conn.set_value("Cost Center", newdn, "cost_center_name",
frappe.conn.set_value("Cost Center", newdn, "cost_center_name",
" - ".join(newdn.split(" - ")[:-1]))
else:
super(DocType, self).after_rename(olddn, newdn, merge)

View File

@@ -2,12 +2,13 @@
{
"creation": "2013-01-23 19:57:17",
"docstatus": 0,
"modified": "2013-07-22 15:23:10",
"modified": "2014-01-20 17:48:30",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_copy": 1,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:cost_center_name",
"description": "Track separate Income and Expense for product verticals or divisions.",
@@ -29,12 +30,15 @@
},
{
"amend": 0,
"cancel": 0,
"doctype": "DocPerm",
"email": 1,
"name": "__common__",
"parent": "Cost Center",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"submit": 0
@@ -74,6 +78,7 @@
"doctype": "DocField",
"fieldname": "parent_cost_center",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Parent Cost Center",
"oldfieldname": "parent_cost_center",
"oldfieldtype": "Link",
@@ -171,6 +176,7 @@
"fieldname": "old_parent",
"fieldtype": "Link",
"hidden": 1,
"ignore_restrictions": 1,
"label": "old_parent",
"no_copy": 1,
"oldfieldname": "old_parent",
@@ -180,15 +186,15 @@
"report_hide": 1
},
{
"cancel": 1,
"create": 1,
"delete": 1,
"doctype": "DocPerm",
"role": "Accounts Manager",
"write": 1
},
{
"cancel": 0,
"create": 0,
"delete": 0,
"doctype": "DocPerm",
"role": "Accounts User",
"write": 0

View File

@@ -8,12 +8,12 @@ $.extend(cur_frm.cscript, {
this.frm.toggle_enable('year_end_date', doc.__islocal)
if (!doc.__islocal && (doc.name != sys_defaults.fiscal_year)) {
this.frm.add_custom_button(wn._("Set as Default"), this.frm.cscript.set_as_default);
this.frm.set_intro(wn._("To set this Fiscal Year as Default, click on 'Set as Default'"));
this.frm.add_custom_button(frappe._("Set as Default"), this.frm.cscript.set_as_default);
this.frm.set_intro(frappe._("To set this Fiscal Year as Default, click on 'Set as Default'"));
} else this.frm.set_intro("");
},
set_as_default: function() {
return wn.call({
return frappe.call({
doc: cur_frm.doc,
method: "set_as_default"
});
@@ -22,7 +22,7 @@ $.extend(cur_frm.cscript, {
var me = this;
year_end_date =
wn.datetime.add_days(wn.datetime.add_months(this.frm.doc.year_start_date, 12), -1);
frappe.datetime.add_days(frappe.datetime.add_months(this.frm.doc.year_start_date, 12), -1);
this.frm.set_value("year_end_date", year_end_date);
},
});

View File

@@ -2,46 +2,44 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint, _
from webnotes.utils import getdate
import frappe
from frappe import msgprint, _
from frappe.utils import getdate
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def set_as_default(self):
webnotes.conn.set_value("Global Defaults", None, "current_fiscal_year", self.doc.name)
webnotes.get_obj("Global Defaults").on_update()
frappe.conn.set_value("Global Defaults", None, "current_fiscal_year", self.doc.name)
frappe.get_obj("Global Defaults").on_update()
# clear cache
webnotes.clear_cache()
frappe.clear_cache()
msgprint(self.doc.name + _(""" is now the default Fiscal Year. \
Please refresh your browser for the change to take effect."""))
def validate(self):
year_start_end_dates = webnotes.conn.sql("""select year_start_date, year_end_date
year_start_end_dates = frappe.conn.sql("""select year_start_date, year_end_date
from `tabFiscal Year` where name=%s""", (self.doc.name))
if year_start_end_dates:
if getdate(self.doc.year_start_date) != year_start_end_dates[0][0] or getdate(self.doc.year_end_date) != year_start_end_dates[0][1]:
webnotes.throw(_("Cannot change Year Start Date and Year End Date \
once the Fiscal Year is saved."))
frappe.throw(_("Cannot change Year Start Date and Year End Date once the Fiscal Year is saved."))
def on_update(self):
# validate year start date and year end date
if getdate(self.doc.year_start_date) > getdate(self.doc.year_end_date):
webnotes.throw(_("Year Start Date should not be greater than Year End Date"))
frappe.throw(_("Year Start Date should not be greater than Year End Date"))
if (getdate(self.doc.year_end_date) - getdate(self.doc.year_start_date)).days > 366:
webnotes.throw(_("Year Start Date and Year End Date are not within Fiscal Year."))
frappe.throw(_("Year Start Date and Year End Date are not within Fiscal Year."))
year_start_end_dates = webnotes.conn.sql("""select name, year_start_date, year_end_date
year_start_end_dates = frappe.conn.sql("""select name, year_start_date, year_end_date
from `tabFiscal Year` where name!=%s""", (self.doc.name))
for fiscal_year, ysd, yed in year_start_end_dates:
if (getdate(self.doc.year_start_date) == ysd and getdate(self.doc.year_end_date) == yed) \
and (not webnotes.flags.in_test):
webnotes.throw(_("Year Start Date and Year End Date are already \
set in Fiscal Year: ") + fiscal_year)
and (not frappe.flags.in_test):
frappe.throw(_("Year Start Date and Year End Date are already set in Fiscal Year: ") + fiscal_year)

View File

@@ -2,11 +2,12 @@
{
"creation": "2013-01-22 16:50:25",
"docstatus": 0,
"modified": "2013-11-25 11:40:02",
"modified": "2014-01-20 17:48:46",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_import": 1,
"autoname": "field:year",
"description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
"doctype": "DocType",
@@ -25,11 +26,13 @@
},
{
"doctype": "DocPerm",
"email": 1,
"name": "__common__",
"parent": "Fiscal Year",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"print": 1,
"read": 1
},
{
@@ -78,8 +81,9 @@
"reqd": 0
},
{
"cancel": 1,
"cancel": 0,
"create": 1,
"delete": 1,
"doctype": "DocPerm",
"report": 1,
"role": "System Manager",
@@ -87,6 +91,7 @@
"write": 1
},
{
"delete": 0,
"doctype": "DocPerm",
"role": "All"
}

View File

@@ -2,10 +2,10 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
from webnotes.utils import flt, fmt_money, getdate
from webnotes import _
from frappe.utils import flt, fmt_money, getdate
from frappe import _
class DocType:
def __init__(self,d,dl):
@@ -34,44 +34,44 @@ class DocType:
mandatory = ['account','remarks','voucher_type','voucher_no','fiscal_year','company']
for k in mandatory:
if not self.doc.fields.get(k):
webnotes.throw(k + _(" is mandatory for GL Entry"))
frappe.throw(k + _(" is mandatory for GL Entry"))
# Zero value transaction is not allowed
if not (flt(self.doc.debit) or flt(self.doc.credit)):
webnotes.throw(_("GL Entry: Debit or Credit amount is mandatory for ") +
frappe.throw(_("GL Entry: Debit or Credit amount is mandatory for ") +
self.doc.account)
def pl_must_have_cost_center(self):
if webnotes.conn.get_value("Account", self.doc.account, "is_pl_account") == "Yes":
if frappe.conn.get_value("Account", self.doc.account, "is_pl_account") == "Yes":
if not self.doc.cost_center and self.doc.voucher_type != 'Period Closing Voucher':
webnotes.throw(_("Cost Center must be specified for PL Account: ") +
frappe.throw(_("Cost Center must be specified for PL Account: ") +
self.doc.account)
elif self.doc.cost_center:
self.doc.cost_center = None
def validate_posting_date(self):
from accounts.utils import validate_fiscal_year
from erpnext.accounts.utils import validate_fiscal_year
validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date")
def check_pl_account(self):
if self.doc.is_opening=='Yes' and \
webnotes.conn.get_value("Account", self.doc.account, "is_pl_account") == "Yes":
webnotes.throw(_("For opening balance entry account can not be a PL account"))
frappe.conn.get_value("Account", self.doc.account, "is_pl_account") == "Yes":
frappe.throw(_("For opening balance entry account can not be a PL account"))
def validate_account_details(self, adv_adj):
"""Account must be ledger, active and not freezed"""
ret = webnotes.conn.sql("""select group_or_ledger, docstatus, company
ret = frappe.conn.sql("""select group_or_ledger, docstatus, company
from tabAccount where name=%s""", self.doc.account, as_dict=1)[0]
if ret.group_or_ledger=='Group':
webnotes.throw(_("Account") + ": " + self.doc.account + _(" is not a ledger"))
frappe.throw(_("Account") + ": " + self.doc.account + _(" is not a ledger"))
if ret.docstatus==2:
webnotes.throw(_("Account") + ": " + self.doc.account + _(" is not active"))
frappe.throw(_("Account") + ": " + self.doc.account + _(" is not active"))
if ret.company != self.doc.company:
webnotes.throw(_("Account") + ": " + self.doc.account +
frappe.throw(_("Account") + ": " + self.doc.account +
_(" does not belong to the company") + ": " + self.doc.company)
def validate_cost_center(self):
@@ -80,27 +80,27 @@ class DocType:
def _get_cost_center_company():
if not self.cost_center_company.get(self.doc.cost_center):
self.cost_center_company[self.doc.cost_center] = webnotes.conn.get_value(
self.cost_center_company[self.doc.cost_center] = frappe.conn.get_value(
"Cost Center", self.doc.cost_center, "company")
return self.cost_center_company[self.doc.cost_center]
if self.doc.cost_center and _get_cost_center_company() != self.doc.company:
webnotes.throw(_("Cost Center") + ": " + self.doc.cost_center +
frappe.throw(_("Cost Center") + ": " + self.doc.cost_center +
_(" does not belong to the company") + ": " + self.doc.company)
def check_negative_balance(account, adv_adj=False):
if not adv_adj and account:
account_details = webnotes.conn.get_value("Account", account,
account_details = frappe.conn.get_value("Account", account,
["allow_negative_balance", "debit_or_credit"], as_dict=True)
if not account_details["allow_negative_balance"]:
balance = webnotes.conn.sql("""select sum(debit) - sum(credit) from `tabGL Entry`
balance = frappe.conn.sql("""select sum(debit) - sum(credit) from `tabGL Entry`
where account = %s""", account)
balance = account_details["debit_or_credit"] == "Debit" and \
flt(balance[0][0]) or -1*flt(balance[0][0])
if flt(balance) < 0:
webnotes.throw(_("Negative balance is not allowed for account ") + account)
frappe.throw(_("Negative balance is not allowed for account ") + account)
def check_freezing_date(posting_date, adv_adj=False):
"""
@@ -108,17 +108,17 @@ def check_freezing_date(posting_date, adv_adj=False):
except authorized person
"""
if not adv_adj:
acc_frozen_upto = webnotes.conn.get_value('Accounts Settings', None, 'acc_frozen_upto')
acc_frozen_upto = frappe.conn.get_value('Accounts Settings', None, 'acc_frozen_upto')
if acc_frozen_upto:
bde_auth_role = webnotes.conn.get_value( 'Accounts Settings', None,'bde_auth_role')
bde_auth_role = frappe.conn.get_value( 'Accounts Settings', None,'bde_auth_role')
if getdate(posting_date) <= getdate(acc_frozen_upto) \
and not bde_auth_role in webnotes.user.get_roles():
webnotes.throw(_("You are not authorized to do/modify back dated entries before ")
and not bde_auth_role in frappe.user.get_roles():
frappe.throw(_("You are not authorized to do/modify back dated entries before ")
+ getdate(acc_frozen_upto).strftime('%d-%m-%Y'))
def update_outstanding_amt(account, against_voucher_type, against_voucher, on_cancel=False):
# get final outstanding amt
bal = flt(webnotes.conn.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
bal = flt(frappe.conn.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
from `tabGL Entry`
where against_voucher_type=%s and against_voucher=%s and account = %s""",
(against_voucher_type, against_voucher, account))[0][0] or 0.0)
@@ -126,7 +126,7 @@ def update_outstanding_amt(account, against_voucher_type, against_voucher, on_ca
if against_voucher_type == 'Purchase Invoice':
bal = -bal
elif against_voucher_type == "Journal Voucher":
against_voucher_amount = flt(webnotes.conn.sql("""
against_voucher_amount = flt(frappe.conn.sql("""
select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
from `tabGL Entry` where voucher_type = 'Journal Voucher' and voucher_no = %s
and account = %s and ifnull(against_voucher, '') = ''""",
@@ -137,26 +137,23 @@ def update_outstanding_amt(account, against_voucher_type, against_voucher, on_ca
# Validation : Outstanding can not be negative
if bal < 0 and not on_cancel:
webnotes.throw(_("Outstanding for Voucher ") + against_voucher + _(" will become ") +
frappe.throw(_("Outstanding for Voucher ") + against_voucher + _(" will become ") +
fmt_money(bal) + _(". Outstanding cannot be less than zero. \
Please match exact outstanding."))
# Update outstanding amt on against voucher
if against_voucher_type in ["Sales Invoice", "Purchase Invoice"]:
webnotes.conn.sql("update `tab%s` set outstanding_amount=%s where name='%s'" %
frappe.conn.sql("update `tab%s` set outstanding_amount=%s where name='%s'" %
(against_voucher_type, bal, against_voucher))
def validate_frozen_account(account, adv_adj=None):
frozen_account = webnotes.conn.get_value("Account", account, "freeze_account")
frozen_account = frappe.conn.get_value("Account", account, "freeze_account")
if frozen_account == 'Yes' and not adv_adj:
frozen_accounts_modifier = webnotes.conn.get_value( 'Accounts Settings', None,
frozen_accounts_modifier = frappe.conn.get_value( 'Accounts Settings', None,
'frozen_accounts_modifier')
if not frozen_accounts_modifier:
webnotes.throw(account + _(" is a frozen account. \
Either make the account active or assign role in Accounts Settings \
who can create / modify entries against this account"))
elif frozen_accounts_modifier not in webnotes.user.get_roles():
webnotes.throw(account + _(" is a frozen account. ") +
_("To create / edit transactions against this account, you need role") + ": " +
frozen_accounts_modifier)
frappe.throw(account + _(" is a frozen account. Either make the account active or assign role in Accounts Settings who can create / modify entries against this account"))
elif frozen_accounts_modifier not in frappe.user.get_roles():
frappe.throw(account + _(" is a frozen account. To create / edit transactions against this account, you need role") \
+ ": " + frozen_accounts_modifier)

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:06",
"docstatus": 0,
"modified": "2013-11-03 14:14:09",
"modified": "2013-12-20 19:24:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
{
"create": 0,
"doctype": "DocPerm",
"email": 1,
"name": "__common__",
"parent": "GL Entry",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"submit": 0,

View File

@@ -1,9 +1,9 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
wn.provide("erpnext.accounts");
frappe.provide("erpnext.accounts");
erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
onload: function() {
this.load_defaults();
this.setup_queries();
@@ -11,10 +11,10 @@ erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
load_defaults: function() {
if(this.frm.doc.__islocal && this.frm.doc.company) {
wn.model.set_default_values(this.frm.doc);
$.each(wn.model.get_doclist(this.frm.doc.doctype,
frappe.model.set_default_values(this.frm.doc);
$.each(frappe.model.get_doclist(this.frm.doc.doctype,
this.frm.doc.name, {parentfield: "entries"}), function(i, jvd) {
wn.model.set_default_values(jvd);
frappe.model.set_default_values(jvd);
}
);
@@ -27,7 +27,7 @@ erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
$.each(["account", "cost_center"], function(i, fieldname) {
me.frm.set_query(fieldname, "entries", function() {
wn.model.validate_missing(me.frm.doc, "company");
frappe.model.validate_missing(me.frm.doc, "company");
return {
filters: {
company: me.frm.doc.company,
@@ -40,8 +40,8 @@ erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
$.each([["against_voucher", "Purchase Invoice", "credit_to"],
["against_invoice", "Sales Invoice", "debit_to"]], function(i, opts) {
me.frm.set_query(opts[0], "entries", function(doc, cdt, cdn) {
var jvd = wn.model.get_doc(cdt, cdn);
wn.model.validate_missing(jvd, "account");
var jvd = frappe.model.get_doc(cdt, cdn);
frappe.model.validate_missing(jvd, "account");
return {
filters: [
[opts[1], opts[2], "=", jvd.account],
@@ -53,8 +53,8 @@ erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
});
this.frm.set_query("against_jv", "entries", function(doc, cdt, cdn) {
var jvd = wn.model.get_doc(cdt, cdn);
wn.model.validate_missing(jvd, "account");
var jvd = frappe.model.get_doc(cdt, cdn);
frappe.model.validate_missing(jvd, "account");
return {
query: "accounts.doctype.journal_voucher.journal_voucher.get_against_jv",
@@ -64,7 +64,7 @@ erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
},
against_voucher: function(doc, cdt, cdn) {
var d = wn.model.get_doc(cdt, cdn);
var d = frappe.model.get_doc(cdt, cdn);
if (d.against_voucher && !flt(d.debit)) {
this.get_outstanding({
'doctype': 'Purchase Invoice',
@@ -74,7 +74,7 @@ erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
},
against_invoice: function(doc, cdt, cdn) {
var d = wn.model.get_doc(cdt, cdn);
var d = frappe.model.get_doc(cdt, cdn);
if (d.against_invoice && !flt(d.credit)) {
this.get_outstanding({
'doctype': 'Sales Invoice',
@@ -84,7 +84,7 @@ erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
},
against_jv: function(doc, cdt, cdn) {
var d = wn.model.get_doc(cdt, cdn);
var d = frappe.model.get_doc(cdt, cdn);
if (d.against_jv && !flt(d.credit) && !flt(d.debit)) {
this.get_outstanding({
'doctype': 'Journal Voucher',
@@ -115,15 +115,15 @@ cur_frm.cscript.refresh = function(doc) {
erpnext.hide_naming_series();
cur_frm.cscript.voucher_type(doc);
if(doc.docstatus==1) {
cur_frm.appframe.add_button(wn._('View Ledger'), function() {
wn.route_options = {
cur_frm.appframe.add_button(frappe._('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
};
wn.set_route("query-report", "General Ledger");
frappe.set_route("query-report", "General Ledger");
}, "icon-table");
}
}
@@ -166,8 +166,8 @@ cur_frm.cscript.get_balance = function(doc,dt,dn) {
cur_frm.cscript.account = function(doc,dt,dn) {
var d = locals[dt][dn];
if(d.account) {
return wn.call({
method: "accounts.utils.get_balance_on",
return frappe.call({
method: "erpnext.accounts.utils.get_balance_on",
args: {account: d.account, date: doc.posting_date},
callback: function(r) {
d.balance = r.message;
@@ -187,20 +187,20 @@ cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
cur_frm.pformat.print_heading = doc.select_print_heading;
}
else
cur_frm.pformat.print_heading = wn._("Journal Voucher");
cur_frm.pformat.print_heading = frappe._("Journal Voucher");
}
cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
cur_frm.set_df_property("cheque_no", "reqd", doc.voucher_type=="Bank Voucher");
cur_frm.set_df_property("cheque_date", "reqd", doc.voucher_type=="Bank Voucher");
if(wn.model.get("Journal Voucher Detail", {"parent":doc.name}).length!==0 // too late
if(frappe.model.get("Journal Voucher Detail", {"parent":doc.name}).length!==0 // too late
|| !doc.company) // too early
return;
var update_jv_details = function(doc, r) {
$.each(r.message, function(i, d) {
var jvdetail = wn.model.add_child(doc, "Journal Voucher Detail", "entries");
var jvdetail = frappe.model.add_child(doc, "Journal Voucher Detail", "entries");
jvdetail.account = d.account;
jvdetail.balance = d.balance;
});
@@ -208,9 +208,9 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
}
if(in_list(["Bank Voucher", "Cash Voucher"], doc.voucher_type)) {
return wn.call({
return frappe.call({
type: "GET",
method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
args: {
"voucher_type": doc.voucher_type,
"company": doc.company
@@ -222,14 +222,14 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
}
})
} else if(doc.voucher_type=="Opening Entry") {
return wn.call({
return frappe.call({
type:"GET",
method: "accounts.doctype.journal_voucher.journal_voucher.get_opening_accounts",
method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_opening_accounts",
args: {
"company": doc.company
},
callback: function(r) {
wn.model.clear_table("Journal Voucher Detail", "Journal Voucher",
frappe.model.clear_table("Journal Voucher Detail", "Journal Voucher",
doc.name, "entries");
if(r.message) {
update_jv_details(doc, r);

View File

@@ -2,15 +2,15 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import frappe
from webnotes.utils import cint, cstr, flt, fmt_money, formatdate, getdate
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
from webnotes import msgprint, _
from setup.utils import get_company_currency
from frappe.utils import cint, cstr, flt, fmt_money, formatdate, getdate
from frappe.model.doc import addchild
from frappe.model.bean import getlist
from frappe import msgprint, _
from erpnext.setup.utils import get_company_currency
from controllers.accounts_controller import AccountsController
from erpnext.controllers.accounts_controller import AccountsController
class DocType(AccountsController):
def __init__(self,d,dl):
@@ -42,12 +42,11 @@ class DocType(AccountsController):
def on_submit(self):
if self.doc.voucher_type in ['Bank Voucher', 'Contra Voucher', 'Journal Entry']:
self.check_credit_days()
self.check_account_against_entries()
self.make_gl_entries()
self.check_credit_limit()
def on_cancel(self):
from accounts.utils import remove_against_link_from_jv
from erpnext.accounts.utils import remove_against_link_from_jv
remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_jv")
self.make_gl_entries(1)
@@ -55,7 +54,7 @@ class DocType(AccountsController):
def on_trash(self):
pass
#if self.doc.amended_from:
# webnotes.delete_doc("Journal Voucher", self.doc.amended_from)
# frappe.delete_doc("Journal Voucher", self.doc.amended_from)
def validate_debit_credit(self):
for d in getlist(self.doclist, 'entries'):
@@ -76,7 +75,7 @@ class DocType(AccountsController):
for d in getlist(self.doclist,'entries'):
if not d.is_advance and not d.against_voucher and \
not d.against_invoice and not d.against_jv:
master_type = webnotes.conn.get_value("Account", d.account, "master_type")
master_type = frappe.conn.get_value("Account", d.account, "master_type")
if (master_type == 'Customer' and flt(d.credit) > 0) or \
(master_type == 'Supplier' and flt(d.debit) > 0):
msgprint("Message: Please check Is Advance as 'Yes' against \
@@ -88,7 +87,7 @@ class DocType(AccountsController):
if d.against_jv == self.doc.name:
msgprint("You can not enter current voucher in 'Against JV' column",
raise_exception=1)
elif not webnotes.conn.sql("""select name from `tabJournal Voucher Detail`
elif not frappe.conn.sql("""select name from `tabJournal Voucher Detail`
where account = '%s' and docstatus = 1 and parent = '%s'""" %
(d.account, d.against_jv)):
msgprint("Against JV: %s is not valid." % d.against_jv, raise_exception=1)
@@ -126,12 +125,12 @@ class DocType(AccountsController):
for d in getlist(self.doclist, 'entries'):
if d.against_invoice and d.credit:
currency = webnotes.conn.get_value("Sales Invoice", d.against_invoice, "currency")
currency = frappe.conn.get_value("Sales Invoice", d.against_invoice, "currency")
r.append('%s %s against Invoice: %s' %
(cstr(currency), fmt_money(flt(d.credit)), d.against_invoice))
if d.against_voucher and d.debit:
bill_no = webnotes.conn.sql("""select bill_no, bill_date, currency
bill_no = frappe.conn.sql("""select bill_no, bill_date, currency
from `tabPurchase Invoice` where name=%s""", d.against_voucher)
if bill_no and bill_no[0][0] and bill_no[0][0].lower().strip() \
not in ['na', 'not applicable', 'none']:
@@ -145,7 +144,7 @@ class DocType(AccountsController):
if r:
self.doc.remark = ("\n").join(r)
else:
webnotes.msgprint("User Remarks is mandatory", raise_exception=1)
frappe.msgprint("User Remarks is mandatory", raise_exception=1)
def set_aging_date(self):
if self.doc.is_opening != 'Yes':
@@ -154,7 +153,7 @@ class DocType(AccountsController):
# check account type whether supplier or customer
exists = False
for d in getlist(self.doclist, 'entries'):
account_type = webnotes.conn.get_value("Account", d.account, "account_type")
account_type = frappe.conn.get_value("Account", d.account, "account_type")
if account_type in ["Supplier", "Customer"]:
exists = True
break
@@ -167,12 +166,12 @@ class DocType(AccountsController):
def set_print_format_fields(self):
for d in getlist(self.doclist, 'entries'):
account_type, master_type = webnotes.conn.get_value("Account", d.account,
account_type, master_type = frappe.conn.get_value("Account", d.account,
["account_type", "master_type"])
if master_type in ['Supplier', 'Customer']:
if not self.doc.pay_to_recd_from:
self.doc.pay_to_recd_from = webnotes.conn.get_value(master_type,
self.doc.pay_to_recd_from = frappe.conn.get_value(master_type,
' - '.join(d.account.split(' - ')[:-1]),
master_type == 'Customer' and 'customer_name' or 'supplier_name')
@@ -180,7 +179,7 @@ class DocType(AccountsController):
company_currency = get_company_currency(self.doc.company)
amt = flt(d.debit) and d.debit or d.credit
self.doc.total_amount = company_currency + ' ' + cstr(amt)
from webnotes.utils import money_in_words
from frappe.utils import money_in_words
self.doc.total_amount_in_words = money_in_words(amt, company_currency)
def check_credit_days(self):
@@ -191,7 +190,7 @@ class DocType(AccountsController):
if date_diff <= 0: return
# Get List of Customer Account
acc_list = filter(lambda d: webnotes.conn.get_value("Account", d.account,
acc_list = filter(lambda d: frappe.conn.get_value("Account", d.account,
"master_type")=='Customer', getlist(self.doclist,'entries'))
for d in acc_list:
@@ -203,11 +202,11 @@ class DocType(AccountsController):
def get_credit_days_for(self, ac):
if not self.credit_days_for.has_key(ac):
self.credit_days_for[ac] = cint(webnotes.conn.get_value("Account", ac, "credit_days"))
self.credit_days_for[ac] = cint(frappe.conn.get_value("Account", ac, "credit_days"))
if not self.credit_days_for[ac]:
if self.credit_days_global==-1:
self.credit_days_global = cint(webnotes.conn.get_value("Company",
self.credit_days_global = cint(frappe.conn.get_value("Company",
self.doc.company, "credit_days"))
return self.credit_days_global
@@ -219,28 +218,33 @@ class DocType(AccountsController):
self.is_approving_authority = 0
# Fetch credit controller role
approving_authority = webnotes.conn.get_value("Global Defaults", None,
approving_authority = frappe.conn.get_value("Global Defaults", None,
"credit_controller")
# Check logged-in user is authorized
if approving_authority in webnotes.user.get_roles():
if approving_authority in frappe.user.get_roles():
self.is_approving_authority = 1
return self.is_approving_authority
def check_account_against_entries(self):
for d in self.doclist.get({"parentfield": "entries"}):
if d.against_invoice and webnotes.conn.get_value("Sales Invoice",
if d.against_invoice and frappe.conn.get_value("Sales Invoice",
d.against_invoice, "debit_to") != d.account:
webnotes.throw(_("Credited account (Customer) is not matching with Sales Invoice"))
frappe.throw(_("Row #") + cstr(d.idx) + ": " +
_("Account is not matching with Debit To account of Sales Invoice"))
if d.against_voucher and webnotes.conn.get_value("Purchase Invoice",
d.against_voucher, "credit_to") != d.account:
webnotes.throw(_("Debited account (Supplier) is not matching with \
Purchase Invoice"))
if d.against_voucher and frappe.conn.get_value("Purchase Invoice",
d.against_voucher, "credit_to") != d.account:
frappe.throw(_("Row #") + cstr(d.idx) + ": " +
_("Account is not matching with Credit To account of Purchase Invoice"))
def make_gl_entries(self, cancel=0, adv_adj=0):
from accounts.general_ledger import make_gl_entries
from erpnext.accounts.general_ledger import make_gl_entries
if not cancel:
self.check_account_against_entries()
gl_map = []
for d in self.doclist.get({"parentfield": "entries"}):
if d.debit or d.credit:
@@ -263,7 +267,7 @@ class DocType(AccountsController):
def check_credit_limit(self):
for d in self.doclist.get({"parentfield": "entries"}):
master_type, master_name = webnotes.conn.get_value("Account", d.account,
master_type, master_name = frappe.conn.get_value("Account", d.account,
["master_type", "master_name"])
if master_type == "Customer" and master_name:
super(DocType, self).check_credit_limit(d.account)
@@ -324,18 +328,18 @@ class DocType(AccountsController):
cond = (flt(self.doc.write_off_amount) > 0) and \
' and outstanding_amount <= '+ self.doc.write_off_amount or ''
if self.doc.write_off_based_on == 'Accounts Receivable':
return webnotes.conn.sql("""select name, debit_to, outstanding_amount
return frappe.conn.sql("""select name, debit_to, outstanding_amount
from `tabSales Invoice` where docstatus = 1 and company = %s
and outstanding_amount > 0 %s""" % ('%s', cond), self.doc.company)
elif self.doc.write_off_based_on == 'Accounts Payable':
return webnotes.conn.sql("""select name, credit_to, outstanding_amount
return frappe.conn.sql("""select name, credit_to, outstanding_amount
from `tabPurchase Invoice` where docstatus = 1 and company = %s
and outstanding_amount > 0 %s""" % ('%s', cond), self.doc.company)
@webnotes.whitelist()
@frappe.whitelist()
def get_default_bank_cash_account(company, voucher_type):
from accounts.utils import get_balance_on
account = webnotes.conn.get_value("Company", company,
from erpnext.accounts.utils import get_balance_on
account = frappe.conn.get_value("Company", company,
voucher_type=="Bank Voucher" and "default_bank_account" or "default_cash_account")
if account:
return {
@@ -343,10 +347,10 @@ def get_default_bank_cash_account(company, voucher_type):
"balance": get_balance_on(account)
}
@webnotes.whitelist()
@frappe.whitelist()
def get_payment_entry_from_sales_invoice(sales_invoice):
from accounts.utils import get_balance_on
si = webnotes.bean("Sales Invoice", sales_invoice)
from erpnext.accounts.utils import get_balance_on
si = frappe.bean("Sales Invoice", sales_invoice)
jv = get_payment_entry(si.doc)
jv.doc.remark = 'Payment received against Sales Invoice %(name)s. %(remarks)s' % si.doc.fields
@@ -361,10 +365,10 @@ def get_payment_entry_from_sales_invoice(sales_invoice):
return [d.fields for d in jv.doclist]
@webnotes.whitelist()
@frappe.whitelist()
def get_payment_entry_from_purchase_invoice(purchase_invoice):
from accounts.utils import get_balance_on
pi = webnotes.bean("Purchase Invoice", purchase_invoice)
from erpnext.accounts.utils import get_balance_on
pi = frappe.bean("Purchase Invoice", purchase_invoice)
jv = get_payment_entry(pi.doc)
jv.doc.remark = 'Payment against Purchase Invoice %(name)s. %(remarks)s' % pi.doc.fields
@@ -382,7 +386,7 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice):
def get_payment_entry(doc):
bank_account = get_default_bank_cash_account(doc.company, "Bank Voucher")
jv = webnotes.new_bean('Journal Voucher')
jv = frappe.new_bean('Journal Voucher')
jv.doc.voucher_type = 'Bank Voucher'
jv.doc.company = doc.company
@@ -404,42 +408,42 @@ def get_payment_entry(doc):
return jv
@webnotes.whitelist()
@frappe.whitelist()
def get_opening_accounts(company):
"""get all balance sheet accounts for opening entry"""
from accounts.utils import get_balance_on
accounts = webnotes.conn.sql_list("""select name from tabAccount
from erpnext.accounts.utils import get_balance_on
accounts = frappe.conn.sql_list("""select name from tabAccount
where group_or_ledger='Ledger' and is_pl_account='No' and company=%s""", company)
return [{"account": a, "balance": get_balance_on(a)} for a in accounts]
def get_against_purchase_invoice(doctype, txt, searchfield, start, page_len, filters):
return webnotes.conn.sql("""select name, credit_to, outstanding_amount, bill_no, bill_date
return frappe.conn.sql("""select name, credit_to, outstanding_amount, bill_no, bill_date
from `tabPurchase Invoice` where credit_to = %s and docstatus = 1
and outstanding_amount > 0 and %s like %s order by name desc limit %s, %s""" %
("%s", searchfield, "%s", "%s", "%s"),
(filters["account"], "%%%s%%" % txt, start, page_len))
def get_against_sales_invoice(doctype, txt, searchfield, start, page_len, filters):
return webnotes.conn.sql("""select name, debit_to, outstanding_amount
return frappe.conn.sql("""select name, debit_to, outstanding_amount
from `tabSales Invoice` where debit_to = %s and docstatus = 1
and outstanding_amount > 0 and `%s` like %s order by name desc limit %s, %s""" %
("%s", searchfield, "%s", "%s", "%s"),
(filters["account"], "%%%s%%" % txt, start, page_len))
def get_against_jv(doctype, txt, searchfield, start, page_len, filters):
return webnotes.conn.sql("""select jv.name, jv.posting_date, jv.user_remark
return frappe.conn.sql("""select jv.name, jv.posting_date, jv.user_remark
from `tabJournal Voucher` jv, `tabJournal Voucher Detail` jv_detail
where jv_detail.parent = jv.name and jv_detail.account = %s and jv.docstatus = 1
and jv.%s like %s order by jv.name desc limit %s, %s""" %
("%s", searchfield, "%s", "%s", "%s"),
(filters["account"], "%%%s%%" % txt, start, page_len))
@webnotes.whitelist()
@frappe.whitelist()
def get_outstanding(args):
args = eval(args)
if args.get("doctype") == "Journal Voucher" and args.get("account"):
against_jv_amount = webnotes.conn.sql("""
against_jv_amount = frappe.conn.sql("""
select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
from `tabJournal Voucher Detail` where parent=%s and account=%s
and ifnull(against_invoice, '')='' and ifnull(against_voucher, '')=''
@@ -453,11 +457,11 @@ def get_outstanding(args):
elif args.get("doctype") == "Sales Invoice":
return {
"credit": flt(webnotes.conn.get_value("Sales Invoice", args["docname"],
"credit": flt(frappe.conn.get_value("Sales Invoice", args["docname"],
"outstanding_amount"))
}
elif args.get("doctype") == "Purchase Invoice":
return {
"debit": flt(webnotes.conn.get_value("Purchase Invoice", args["docname"],
"debit": flt(frappe.conn.get_value("Purchase Invoice", args["docname"],
"outstanding_amount"))
}

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-25 10:53:52",
"docstatus": 0,
"modified": "2013-11-03 14:11:33",
"modified": "2014-01-20 17:48:51",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -27,11 +27,13 @@
},
{
"doctype": "DocPerm",
"email": 1,
"name": "__common__",
"parent": "Journal Voucher",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1
},
@@ -459,6 +461,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -471,6 +474,7 @@
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"doctype": "DocPerm",
"role": "Accounts User",
"submit": 1,
@@ -480,6 +484,7 @@
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"doctype": "DocPerm",
"role": "Accounts Manager",
"submit": 1,
@@ -489,6 +494,7 @@
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"doctype": "DocPerm",
"role": "Auditor",
"submit": 0,

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