Compare commits

...

183 Commits

Author SHA1 Message Date
Pratik Vyas
6268d83173 Merge branch 'develop' 2015-06-05 15:56:49 +05:30
Pratik Vyas
4599467939 bumped to version 5.0.18 2015-06-05 16:26:49 +06:00
Nabin Hait
d3613479c6 Merge pull request #3421 from nabinhait/develop
pos link and item description
2015-06-05 15:51:03 +05:30
Nabin Hait
6bf301f53c Show item description in grid view based on 'In List View' property 2015-06-05 15:49:25 +05:30
Nabin Hait
27d7f21553 [fix] pos profile link in Start POS page 2015-06-05 15:09:44 +05:30
Nabin Hait
8f87cff4bd Merge pull request #3411 from nabinhait/develop
journal entry against expense claim and bank reco
2015-06-05 14:31:23 +05:30
Nabin Hait
8f39766924 Merge pull request #3419 from neilLasrado/time-log
operation made non mandatory in time log
2015-06-05 14:30:22 +05:30
Neil Trini Lasrado
39669f2717 operation made non mandatory in time log 2015-06-05 12:17:46 +05:30
Nabin Hait
3c1017c43b Removed deprecated page users 2015-06-05 12:15:01 +05:30
Nabin Hait
0b18a2d347 Reset values in tools like Payment Tool 2015-06-05 12:01:29 +05:30
Nabin Hait
6262496e70 [fix] item test case 2015-06-03 18:33:47 +05:30
Nabin Hait
c9963f1805 [fix] journal entry against expense claim: pending amount validation 2015-06-03 18:01:09 +05:30
Nabin Hait
8a2b1bcb97 [fix] bank reconciliation: fetch journal entry order by posting date asc 2015-06-03 18:01:09 +05:30
Pratik Vyas
b8ecf7c757 Merge branch 'develop' 2015-06-03 17:43:38 +05:30
Pratik Vyas
cf89fa2253 bumped to version 5.0.17 2015-06-03 18:13:38 +06:00
Nabin Hait
419c1eb90d Merge pull request #3410 from nabinhait/develop
[fix][patch] force reload web-form-field in portal fixes patch
2015-06-03 17:43:01 +05:30
Nabin Hait
2c214e0362 [fix][patch] force reload web-form-field in portal fixes patch 2015-06-03 17:42:12 +05:30
Nabin Hait
7d04dd0bfd Merge pull request #3408 from williamjmorenor/patch-1
Update Chart of Account for Nicaragua
2015-06-03 17:17:09 +05:30
Nabin Hait
f1371a7ee7 Merge pull request #3409 from nabinhait/develop
Multiple fixes
2015-06-03 17:15:42 +05:30
Nabin Hait
995a78421a [fix] Stock analytics report fixed for fifo stack related to stock reco 2015-06-03 16:44:26 +05:30
Nabin Hait
352187bee6 purchase register fix 2015-06-03 12:06:19 +05:30
Nabin Hait
c6d8121f4a delete fields inline description 2015-06-03 11:24:37 +05:30
Nabin Hait
030ade428b dont reset company on deleting company transactions 2015-06-03 11:24:37 +05:30
Nabin Hait
c87595b2da show item description in item grid view if marked for 'In List View' 2015-06-03 11:24:37 +05:30
Nabin Hait
42f2674cba dynamic link in quotation item 2015-06-03 11:24:37 +05:30
Nabin Hait
5359f2651a [fix] sales register report 2015-06-03 11:24:37 +05:30
William Moreno
42dcffdad4 Update Chart of Account for Nicaragua
Hi

The Law 891 reform some taxes rates, please update the Chart of Account for Nicaragua so it can reflect the new tax rates.
2015-06-02 16:48:47 -06:00
Anand Doshi
f7c1743b28 [hotfix] cart - get_address_docs 2015-06-02 15:20:25 -04:00
Anand Doshi
64aa6620be [hotfix] portal fixes patch 2015-06-02 11:53:17 -04:00
Rushabh Mehta
ed43f8015c [lang] let locale be en in setup wizard (?) 2015-06-02 12:31:03 +05:30
Rushabh Mehta
d3fe7ec858 [cleanup] customer not buying since long time report 2015-06-02 12:21:17 +05:30
Rushabh Mehta
c8b406d050 [fix] duplicate status for Submitted, Cancelled 2015-06-02 12:17:14 +05:30
Rushabh Mehta
2aa577f110 [hot] patch-fix 2015-06-02 11:12:25 +05:30
Pratik Vyas
f06d175061 Merge branch 'develop' 2015-06-02 10:45:28 +05:30
Pratik Vyas
74b2116adb bumped to version 5.0.16 2015-06-02 11:15:28 +06:00
Rushabh Mehta
2204d0af94 Merge pull request #3397 from rmehta/portal-fixes
Portal fixes
2015-06-02 10:42:59 +05:30
Pratik Vyas
b8a568765d Update translations 2015-06-01 23:49:15 +05:30
Rushabh Mehta
cf29f6468d [minor] add attachment to issue via portal: 2015-06-01 17:47:03 +05:30
Rushabh Mehta
aded46d33e [fix] product search in new block header_actions 2015-06-01 17:23:42 +05:30
Pratik Vyas
b8dd046c84 Merge branch 'develop' 2015-06-01 17:17:46 +05:30
Pratik Vyas
e5fa5e6111 bumped to version 5.0.15 2015-06-01 17:47:46 +06:00
Nabin Hait
b89cf1b3ec Merge pull request #3396 from nabinhait/develop
item table print template
2015-06-01 17:16:00 +05:30
Rushabh Mehta
a33d468d30 [fixes] portal, issues, addresses etc 2015-06-01 17:15:42 +05:30
Nabin Hait
e481a211b1 item table print template 2015-06-01 17:12:55 +05:30
Rushabh Mehta
ca23b5ecfd Merge pull request #3395 from nabinhait/develop
GL Entries for Journal Entries with multiple Party
2015-06-01 16:35:36 +05:30
Nabin Hait
11190268ab [fix][patch] GL Entries for Journal Entries with multiple Party, merge entries considering party 2015-06-01 16:21:25 +05:30
Nabin Hait
a19150ddaf default account's custom query in company 2015-06-01 15:32:57 +05:30
Nabin Hait
c17dff4b01 default account's custom query in company 2015-06-01 15:32:57 +05:30
Pratik Vyas
47fe136d15 Merge branch 'develop' 2015-06-01 14:51:17 +05:30
Pratik Vyas
8f25402dce bumped to version 5.0.14 2015-06-01 15:21:17 +06:00
Nabin Hait
a9165744e2 Merge pull request #3385 from nabinhait/develop
In standard print format, item name will now honour 'Print Hide' property
2015-06-01 14:03:11 +05:30
Nabin Hait
3ebfad7115 minor fixes 2015-06-01 14:01:56 +05:30
Nabin Hait
c7ef8dda79 [fix] Pricing Rule based on qty 2015-06-01 14:01:56 +05:30
Nabin Hait
4a6c178795 On selection of item, set default qty as 1 2015-06-01 14:01:56 +05:30
Nabin Hait
8908543a9c In standard print format, item name will now honour 'Print Hide' property 2015-06-01 14:01:56 +05:30
Rushabh Mehta
065badc54b [minor] move buttons from sales invoice to toolbar 2015-05-31 10:36:47 +05:30
Nabin Hait
cd2798368b Merge pull request #3384 from rmehta/journal-entry-ux
[minor] journal entry, copy over party details to new row and automatically set difference
2015-05-29 17:09:53 +05:30
Rushabh Mehta
2c30acdcb2 [minor] journal entry, copy over party details to new row and automatically set difference 2015-05-29 16:33:36 +05:30
Rushabh Mehta
4a4a6594d1 [minor] [refactor] 2015-05-29 15:56:40 +05:30
Pratik Vyas
e3035a593c Merge branch 'develop' 2015-05-29 14:25:23 +05:30
Pratik Vyas
587dde0044 bumped to version 5.0.13 2015-05-29 14:55:23 +06:00
Pratik Vyas
b6d13ef5b7 Add changelog 2015-05-29 14:24:39 +05:30
Rushabh Mehta
a3e9dbbcc3 Merge pull request #3374 from nabinhait/develop
Make gl entry for rounded-off amount
2015-05-29 14:20:20 +05:30
Pratik Vyas
97d2a00d91 Merge branch 'develop' 2015-05-29 14:17:15 +05:30
Pratik Vyas
1749406514 bumped to version 5.0.12 2015-05-29 14:47:15 +06:00
Rushabh Mehta
99b18224f5 [minor] remove order_by in listview, let user customize 2015-05-29 12:48:24 +05:30
Rushabh Mehta
b0b446e899 [fix] cleanup tables from description and re-sync print format 2015-05-29 12:44:33 +05:30
Nabin Hait
80069a6379 Book gl entry automatically due to rounding loss with test cases 2015-05-29 10:39:09 +05:30
Nabin Hait
98c515fe7d replace 'entries' by 'items' in custom print formats and scripts 2015-05-29 10:39:09 +05:30
Nabin Hait
6ee8c545e3 [fix] gross profit report 2015-05-29 10:39:09 +05:30
Nabin Hait
3c67146e4b Make gl entry for rounded-off amount 2015-05-29 10:39:09 +05:30
Nabin Hait
e2c200a91e Make gl entry for rounded-off amount 2015-05-29 10:39:09 +05:30
Nabin Hait
d9d5925f14 [fix] BOM item validation in lower case 2015-05-29 10:39:09 +05:30
Rushabh Mehta
148386f73e Merge pull request #3380 from anandpdoshi/anand-may-28
[fix] selenium test and changed Creation Document No to a Dynamic Link
2015-05-29 10:37:07 +05:30
Anand Doshi
1b6c3f1a39 [fix] selenium test and changed Creation Document No to a Dynamic Link 2015-05-28 23:06:38 -04:00
Pratik Vyas
618fefea73 Merge branch 'develop' 2015-05-28 14:14:58 +05:30
Pratik Vyas
31d9d9f561 bumped to version 5.0.11 2015-05-28 14:44:58 +06:00
Rushabh Mehta
e715572e7c Merge pull request #3373 from pdvyas/issue-perms
[fix] Remove guest perms from Issue
2015-05-28 14:04:21 +05:30
Pratik Vyas
d138b06c8e Add changelog for v5.0.11 release 2015-05-28 14:00:24 +05:30
Pratik Vyas
37ee57c211 [fix] Remove guest perms from Issue 2015-05-28 13:04:43 +05:30
Rushabh Mehta
95b995be6d [minor] set timezone in posting time and added help 2015-05-28 12:10:55 +05:30
Nabin Hait
86e479f908 Merge pull request #3355 from rmehta/purchase-invoice-fixes
[minor] remove letter head / terms from purchase invoice, fixes #3328, #3345
2015-05-28 11:19:22 +05:30
Nabin Hait
2a52f59b32 Merge pull request #3370 from rmehta/pos-fix
POS fixes
2015-05-28 11:18:29 +05:30
Rushabh Mehta
c185734bf3 [minor] remove letter head / terms from purchase invoice, fixes #3328, #3345 2015-05-28 11:17:22 +05:30
Rushabh Mehta
beb7c346ea [fix] [cleanup] 2015-05-28 11:12:29 +05:30
Rushabh Mehta
88655890be [fix] [refactor] pos hangs in multi-company, if company is not set 2015-05-28 11:11:25 +05:30
Nabin Hait
e7b37af525 Merge pull request #3353 from rmehta/barcode-fix
[fix] clear barcode from table, fixes #3320
2015-05-28 11:07:16 +05:30
Nabin Hait
10026ea85c Merge pull request #3354 from rmehta/discount-field-relabel
[cleanup] rename discount and reserver warehouse #3325
2015-05-28 11:02:51 +05:30
Rushabh Mehta
960118a954 Merge pull request #3369 from anandpdoshi/anand-may-27
Check if company exists in re-order item
2015-05-28 10:45:27 +05:30
Anand Doshi
8860b9d94d [fix] Check if company exists in re-order item. Fixes #3365. 2015-05-28 01:09:21 -04:00
Rushabh Mehta
f4f9be9233 Merge pull request #3364 from anandpdoshi/anand-may-27
[fix] Product Search
2015-05-28 10:19:58 +05:30
Anand Doshi
81bded1afe [fix] Product Search 2015-05-27 16:48:06 -04:00
Nabin Hait
7f1d5efd5b Merge pull request #3360 from nabinhait/develop
patch fix
2015-05-27 16:50:16 +05:30
Nabin Hait
54a10cd2af patch fix 2015-05-27 16:14:10 +05:30
Pratik Vyas
f52b5ac8af Merge pull request #3339 from rmehta/help
[help] added links in modules, added learn desktop module
2015-05-27 15:21:00 +05:30
Rushabh Mehta
2fd33a2f03 Merge pull request #3358 from nabinhait/develop
General ledger, _idx and FY in Material request
2015-05-27 15:10:51 +05:30
Rushabh Mehta
78f137890c Merge pull request #3351 from anandpdoshi/anand-may-26-production-fixes
[fix] workstation fixes related to Production Order
2015-05-27 15:09:47 +05:30
Rushabh Mehta
0d79be5628 Merge pull request #3350 from anandpdoshi/anand-may-26
Fixes in shopping cart and website route rules
2015-05-27 15:09:09 +05:30
Pratik Vyas
fa555abbd2 Merge pull request #3344 from rmehta/download-backups
Download backups
2015-05-27 15:03:45 +05:30
Nabin Hait
eb00cae86c Fiscal Year removed from Material Request 2015-05-27 13:18:09 +05:30
Nabin Hait
5b731ff73a Fix _idx property as per renamed fields 2015-05-27 13:02:59 +05:30
Nabin Hait
5b8db3729c [fix] General ledger print format 2015-05-27 13:02:59 +05:30
Rushabh Mehta
69fb13f229 [cleanup] rename discount and reserver warehouse #3325 2015-05-27 12:20:07 +05:30
Rushabh Mehta
c2acfc9828 [fix] clear barcode from table, fixes #3320 2015-05-27 12:01:03 +05:30
Anand Doshi
409843d768 [fix] workstation fixes related to Production Order 2015-05-26 19:13:45 -04:00
Anand Doshi
fb4e496b54 [fix] target variance sql 2015-05-26 18:15:55 -04:00
Anand Doshi
ff8a854b82 Fixes #3349. Thanks @abelbm for reporting. 2015-05-26 18:13:28 -04:00
Anand Doshi
438b67e8b0 [fix] shopping cart - get price list for default territory if no price list is selected 2015-05-26 17:37:39 -04:00
Anand Doshi
e440914327 [fix] allow slashes in variables of website route rules 2015-05-26 17:37:09 -04:00
Pratik Vyas
dcbc4d1a46 Merge branch 'develop' 2015-05-26 17:06:39 +05:30
Pratik Vyas
e1637c4cae bumped to version 5.0.10 2015-05-26 17:36:39 +06:00
Nabin Hait
b3fb6e1e04 Merge pull request #3342 from rmehta/item-price-import-link
[minor] add import link in item price
2015-05-26 16:51:51 +05:30
Nabin Hait
354443b073 Merge pull request #3346 from nabinhait/develop
multiple minor fixes
2015-05-26 16:50:10 +05:30
Nabin Hait
d4c8dc2915 multiple minor fixes 2015-05-26 16:32:30 +05:30
Rushabh Mehta
d51cf79fe2 [enhancement] list backups for download 2015-05-26 15:19:27 +05:30
Rushabh Mehta
306c49f8a0 [enhancement] list backups for download 2015-05-26 15:14:58 +05:30
Rushabh Mehta
c7cfa270cd [minor] add import link in item price 2015-05-26 14:07:05 +05:30
Nabin Hait
1568dc32a2 Merge pull request #3338 from rmehta/bom-multiple-add
BOM updates
2015-05-26 12:44:03 +05:30
Nabin Hait
878a18528c Added BOM Browser link in Manufacturing home page 2015-05-26 12:41:25 +05:30
Rushabh Mehta
5fa6c4ce21 [enhancement] add bom tree view 2015-05-26 12:41:25 +05:30
Nabin Hait
b8ad56f819 Merge pull request #3336 from rmehta/ask-password-before-delete
[minor] re-verify password before deleting company transactions
2015-05-26 12:20:55 +05:30
Nabin Hait
b3a142f5ab [fix] email footer and signature 2015-05-26 12:15:39 +05:30
Nabin Hait
1f5b21673c minor fix in report 2015-05-26 12:15:39 +05:30
Nabin Hait
093beecd0a minor fix 2015-05-26 12:15:39 +05:30
Rushabh Mehta
822fd7747a [email] [website] footer cleanup 2015-05-26 12:15:39 +05:30
Rushabh Mehta
f29a618b69 [email] [website] footer cleanup 2015-05-26 12:15:39 +05:30
Rushabh Mehta
314af94737 [minor] added multiple commit in bom 2015-05-26 12:15:39 +05:30
Rushabh Mehta
6771240471 [help] added links in modules, added learn desktop module 2015-05-25 18:31:08 +05:30
Pratik Vyas
1a804e2217 Merge branch 'develop' 2015-05-25 16:32:12 +05:30
Pratik Vyas
ac9c2de8b9 bumped to version 5.0.9 2015-05-25 17:02:12 +06:00
Nabin Hait
2c6705ef83 Merge pull request #3322 from nabinhait/test_case
Test case
2015-05-25 16:19:03 +05:30
Nabin Hait
5536923101 Merge pull request #3337 from nabinhait/fix1
Multiple fixes
2015-05-25 16:16:20 +05:30
Nabin Hait
63e431a219 minor fixes 2015-05-25 16:15:39 +05:30
Nabin Hait
e2787cf2ec [fix] unique employee id validation for sales person 2015-05-25 15:27:40 +05:30
Nabin Hait
c4fa74f51d sales partner field added in sms center 2015-05-25 15:17:29 +05:30
Nabin Hait
b62068f784 removed debug 2015-05-25 14:46:12 +05:30
Rushabh Mehta
f8594feb55 [enhancement] add bom tree view 2015-05-25 14:26:21 +05:30
Rushabh Mehta
6a0563f4b2 [minor] added multiple commit in bom 2015-05-25 14:26:21 +05:30
Nabin Hait
43539673cc [fix] sales person wise transaction summary 2015-05-25 14:13:03 +05:30
Nabin Hait
4809d36fbe validate fields value with reference docs 2015-05-25 14:13:03 +05:30
Nabin Hait
f61f76ba45 [fix] gross profit report 2015-05-25 14:13:03 +05:30
Nabin Hait
8d76d14614 reset item's default accounts, warehouses on deletion of company 2015-05-25 14:13:03 +05:30
Nabin Hait
adc830b712 [fix] rename company abbr 2015-05-25 14:13:03 +05:30
Rushabh Mehta
ed618f284b [minor] re-verify password before deleting company transactions 2015-05-25 12:20:44 +05:30
Rushabh Mehta
c4d38e2183 [minor] setup wizard language fix and no submit messages for gl/sl entry 2015-05-25 11:29:37 +05:30
Nabin Hait
a5c9cff38a Merge pull request #3323 from nabinhait/develop
stock entry: get item details
2015-05-22 18:05:40 +05:30
Nabin Hait
fe8d107731 stock entry: get item details 2015-05-22 18:04:44 +05:30
Nabin Hait
e2968e9893 minor fixes in test cases 2015-05-22 17:25:55 +05:30
Nabin Hait
fd4bcd855b test case fixes 2015-05-22 16:55:55 +05:30
Nabin Hait
2eba53f763 test case fixes 2015-05-22 16:55:55 +05:30
Pratik Vyas
866e9047b0 Merge branch 'develop' 2015-05-22 16:52:25 +05:30
Pratik Vyas
08e04ef01a bumped to version 5.0.8 2015-05-22 17:22:25 +06:00
Nabin Hait
bf3f944bdb Merge pull request #3318 from nabinhait/report
added total row in stock balance report
2015-05-22 16:24:00 +05:30
Nabin Hait
1d08304ba5 added total row in stock balance report 2015-05-22 11:56:13 +05:30
Nabin Hait
fc79e205f0 Merge pull request #3316 from nabinhait/develop
share permission and patch fix
2015-05-22 11:51:49 +05:30
Nabin Hait
3b0adc5246 [fix] ignore share permission while creating events on the background 2015-05-21 16:51:37 +05:30
Nabin Hait
4888a5dc0d [patch][fix] party model - create debtors and creditors only if parent account exists 2015-05-21 16:51:37 +05:30
Pratik Vyas
1686876b23 Merge branch 'develop' 2015-05-21 15:34:34 +05:30
Pratik Vyas
8c6ff9ddad bumped to version 5.0.7 2015-05-21 16:04:34 +06:00
Rushabh Mehta
3bc3384bc4 [minor] remove section headings 2015-05-21 15:06:51 +05:30
Pratik Vyas
37307215d0 Merge pull request #3315 from nabinhait/develop
update operation description patch
2015-05-21 14:58:24 +05:30
Nabin Hait
61704504e6 Merge pull request #3314 from neilLasrado/item-var-validation
validation added to item varients
2015-05-21 14:56:51 +05:30
Nabin Hait
9895aba42e update operation description patch 2015-05-21 14:43:24 +05:30
Neil Trini Lasrado
753e40b4d5 fixes in validation for item varients 2015-05-21 14:38:58 +05:30
Rushabh Mehta
71b7a52990 Merge pull request #3312 from nabinhait/develop
[fix] operations and bom
2015-05-21 14:29:14 +05:30
Nabin Hait
e372fb11ea naming series fix 2015-05-21 14:27:20 +05:30
Nabin Hait
4c924bb76c totals etc should not be clickable 2015-05-21 13:38:03 +05:30
Nabin Hait
de7b87ee3a [fix] operations and bom 2015-05-21 13:24:49 +05:30
Nabin Hait
f3ae85cc9a Merge pull request #3313 from rmehta/material-request-fix
[fix] load taxes_and_charges only if field present
2015-05-21 13:22:21 +05:30
Nabin Hait
4a929d53bc Merge pull request #3310 from neilLasrado/item-var-validation
validation added to item varients
2015-05-21 13:21:21 +05:30
Nabin Hait
7f8d6b6252 Merge pull request #3303 from rmehta/letter-head-in-stock-entry
[enhancement] letter head in stock entry #3291
2015-05-21 13:20:26 +05:30
Nabin Hait
6789680fa3 Merge pull request #3302 from rmehta/fix-report-strings
[fix] totals etc should not be clickable
2015-05-21 13:18:22 +05:30
Nabin Hait
4f3f5308e3 Merge pull request #3301 from rmehta/issue-form-layout
[usability] re-layout Issue Form #3218
2015-05-21 13:15:38 +05:30
Nabin Hait
9e38d29df7 Merge pull request #3300 from rmehta/pos-setting-rename
[rename] POS Setting > POS Profile #3271
2015-05-21 13:14:59 +05:30
Nabin Hait
15e13c0ed4 Merge pull request #3245 from neilLasrado/opportunity
fixes in quotation - from opportunity button didn't work
2015-05-21 13:03:00 +05:30
Rushabh Mehta
4984bccbc6 [fix] load taxes_and_charges only if field present 2015-05-21 12:51:07 +05:30
Neil Trini Lasrado
4258753ae8 validation added to item varients 2015-05-21 12:22:33 +05:30
Neil Trini Lasrado
68a6d61589 filter added for closed oppurtunity 2015-05-20 19:01:37 +05:30
Neil Trini Lasrado
c55edf18ad fixes in quotation - from opportunity 2015-05-20 18:51:38 +05:30
Rushabh Mehta
a60984866c [enhancement] letter head in stock entry #3291 2015-05-20 17:45:18 +05:30
Rushabh Mehta
555fa4fbc2 [fix] totals etc should not be clickable 2015-05-20 17:21:53 +05:30
Rushabh Mehta
43c885868f [usability] re-layout Issue Form 2015-05-20 16:47:45 +05:30
Rushabh Mehta
a27cca97b5 [rename] POS Setting > POS Profile #3271 2015-05-20 15:43:17 +05:30
228 changed files with 9666 additions and 9066 deletions

View File

@@ -6,6 +6,10 @@ python:
services:
- mysql
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
install:
- sudo apt-get purge -y mysql-common
- wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
@@ -22,7 +26,9 @@ script:
- bench use test_site
- bench reinstall
- bench build-website
- bench --verbose run-tests
- bench serve &
- sleep 10
- bench --verbose run-tests --driver Firefox
before_script:
- mysql -e 'create database test_frappe'
@@ -33,6 +39,6 @@ notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/92b3bea86d8c5397beef
on_success: always
on_failure: always
on_success: always
on_failure: always
on_start: never

View File

@@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '5.0.6'
__version__ = '5.0.18'

View File

@@ -101,7 +101,7 @@
"label": "Account Type",
"oldfieldname": "account_type",
"oldfieldtype": "Select",
"options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary",
"options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nRound Off\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary",
"permlevel": 0,
"search_index": 0
},
@@ -171,7 +171,7 @@
"icon": "icon-money",
"idx": 1,
"in_create": 0,
"modified": "2015-04-27 20:07:37.147184",
"modified": "2015-05-28 14:10:40.606010",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",

View File

@@ -1,6 +1,6 @@
{
"country_code": "ni",
"name": "Catalogo de Cuentas",
"name": "Catalogo de Cuentas Nicaragua",
"is_active": "Yes",
"tree": {
"Activo": {
@@ -72,7 +72,7 @@
"IVA Acreditable por Importaciones": {
"account_type": "Tax"
},
"IVA Acreditable por Prestacion de Servicios": {
"IVA Acreditable por Prestacion de Servicios y Uso y Goce de Bienes": {
"account_type": "Tax"
},
"Acreditacion Proporcional": {}
@@ -229,11 +229,19 @@
"Impuesto al Valor Agregado por Pagar": {
"account_type": "Tax"
},
"Impuesto sobre la Renta": {
"Impuesto sobre la Renta por Actividades Economicas": {
"account_type": "Tax"
},
"Impuestos Municipales": {
"account_type": "Tax"
"Impuesto Municipal Sobre Ingresos": {
"account_type": "Tax"
},
"Recoleccion Basura": {
"account_type": "Tax"
},
"Matricula Municipal": {
"account_type": "Tax"
}
}
},
"Retenciones por Pagar": {
@@ -241,7 +249,13 @@
"Retencion Rentas del Trabajo Tarifa Progresiva": {
"account_type": "Tax"
},
"Retencion Definitiva por Rentas del Trabajo": {
"Retencion Definitiva 10% por Rentas del Trabajo - Indemnizacion Adicional": {
"account_type": "Tax"
},
"Retencion Definitiva 12.5% por Rentas del Trabajo - Dietas": {
"account_type": "Tax"
},
"Retencion Definitiva 15% por Rentas del Trabajo - No Residentes": {
"account_type": "Tax"
}
},
@@ -258,11 +272,26 @@
"Retencion 5% compra Madera en Rollo": {
"account_type": "Tax"
},
"Retencion Definitiva 1.5% Actividades Economicas No Residentes": {
"account_type": "Tax"
},
"Retencion Definitiva 3% Actividades Economicas No Residentes": {
"account_type": "Tax"
},
"Retencion Definitiva 10% Actividades Economicas No Residentes": {
"account_type": "Tax"
},
"Retencion Definitiva 15% Actividades Economicas No Residentes": {
"account_type": "Tax"
},
"Otras Retenciones 10%": {
"account_type": "Tax"
}
},
"Rentas y Ganancias de Capital": {
"Retencion Defintiva 15% por Rentas de Capital": {
"account_type": "Tax"
},
"Retencion Defintiva 10% por Rentas de Capital": {
"account_type": "Tax"
},
@@ -272,10 +301,16 @@
"Retencion Definitiva 10% por Ganancia de Capital": {
"account_type": "Tax"
},
"Retencion Definitiva Actividades Economicas No Residentes": {
"Retencion Definitiva 0.25% Transacciones Bursatiles": {
"account_type": "Tax"
},
"Retencion Definitiva Transacciones Bursatiles": {
"Retencion Definitiva 1% Transacciones Bursatiles": {
"account_type": "Tax"
},
"Retencion Definitiva 1.5% Transacciones Bursatiles": {
"account_type": "Tax"
},
"Retencion Definitiva 2% Transacciones Bursatiles": {
"account_type": "Tax"
},
"Retenciones Defintiva 5% Fondos de Inversion": {

View File

@@ -117,8 +117,8 @@ def get():
_("Print and Stationary"): {
"account_type": "Expense Account"
},
_("Rounded Off"): {
"account_type": "Expense Account"
_("Round Off"): {
"account_type": "Round Off"
},
_("Salary"): {
"account_type": "Expense Account"

View File

@@ -2,6 +2,10 @@
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Bank Reconciliation", {
refresh: function(frm) {
frm.disable_save();
},
update_clearance_date: function(frm) {
return frappe.call({
method: "update_details",
@@ -33,5 +37,4 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.set_value("from_date", frappe.datetime.month_start());
cur_frm.set_value("to_date", frappe.datetime.month_end());
}
}

View File

@@ -25,7 +25,8 @@ class BankReconciliation(Document):
where
t2.parent = t1.name and t2.account = %s
and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1
and ifnull(t1.is_opening, 'No') = 'No' %s""" %
and ifnull(t1.is_opening, 'No') = 'No' %s
order by t1.posting_date""" %
('%s', '%s', '%s', condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
self.set('journal_entries', [])

View File

@@ -10,8 +10,8 @@ from frappe import _
from frappe.model.document import Document
class GLEntry(Document):
def validate(self):
self.flags.ignore_submit_comment = True
self.check_mandatory()
self.pl_must_have_cost_center()
self.validate_posting_date()

View File

@@ -0,0 +1,25 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, unittest
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
class TestGLEntry(unittest.TestCase):
def test_round_off_entry(self):
frappe.db.set_value("Company", "_Test Company", "round_off_account", "_Test Write Off - _TC")
frappe.db.set_value("Company", "_Test Company", "round_off_cost_center", "_Test Cost Center - _TC")
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Account Bank Account - _TC", 100, "_Test Cost Center - _TC", submit=False)
jv.get("accounts")[0].debit = 100.01
jv.flags.ignore_validate = True
jv.submit()
round_off_entry = frappe.db.sql("""select name from `tabGL Entry`
where voucher_type='Journal Entry' and voucher_no = %s
and account='_Test Write Off - _TC' and cost_center='_Test Cost Center - _TC'
and ifnull(debit, 0) = 0 and ifnull(credit, 0) = '.01'""", jv.name)
self.assertTrue(round_off_entry)

View File

@@ -4,7 +4,7 @@
frappe.provide("erpnext.accounts");
frappe.require("assets/erpnext/js/utils.js");
erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
onload: function() {
this.load_defaults();
this.setup_queries();
@@ -130,10 +130,31 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
cur_frm.cscript.update_totals(me.frm.doc);
}
});
}
},
accounts_add: function(doc, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn);
$.each(doc.accounts, function(i, d) {
if(d.account && d.party && d.party_type) {
row.account = d.account;
row.party = d.party;
row.party_type = d.party_type;
}
});
// set difference
if(doc.difference) {
if(doc.difference > 0) {
row.credit = doc.difference;
} else {
row.debit = -doc.difference;
}
}
},
});
cur_frm.script_manager.make(erpnext.accounts.JournalVoucher);
cur_frm.script_manager.make(erpnext.accounts.JournalEntry);
cur_frm.cscript.refresh = function(doc) {
erpnext.toggle_naming_series();

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, fmt_money, formatdate, getdate, cint
from frappe.utils import cstr, flt, fmt_money, formatdate, getdate
from frappe import msgprint, _, scrub
from erpnext.setup.utils import get_company_currency
from erpnext.controllers.accounts_controller import AccountsController
@@ -76,12 +76,13 @@ class JournalEntry(AccountsController):
account_type = frappe.db.get_value("Account", d.account, "account_type")
if account_type in ["Receivable", "Payable"]:
if not (d.party_type and d.party):
frappe.throw(_("Row{0}: Party Type and Party is required for Receivable / Payable account {1}").format(d.idx, d.account))
frappe.throw(_("Row {0}: Party Type and Party is required for Receivable / Payable account {1}").format(d.idx, d.account))
elif d.party_type and d.party:
frappe.throw(_("Row{0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx))
frappe.throw(_("Row {0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx))
def check_credit_limit(self):
customers = list(set([d.party for d in self.get("accounts") if d.party_type=="Customer" and flt(d.debit) > 0]))
customers = list(set([d.party for d in self.get("accounts")
if d.party_type=="Customer" and d.party and flt(d.debit) > 0]))
if customers:
from erpnext.selling.doctype.customer.customer import check_credit_limit
for customer in customers:
@@ -427,18 +428,17 @@ class JournalEntry(AccountsController):
def validate_expense_claim(self):
for d in self.accounts:
if d.against_expense_claim:
sanctioned_amount, reimbursed_amount = frappe.db.get_value("Expense Claim", d.against_expense_claim,
("total_sanctioned_amount", "total_amount_reimbursed"))
pending_amount = cint(sanctioned_amount) - cint(reimbursed_amount)
sanctioned_amount, reimbursed_amount = frappe.db.get_value("Expense Claim",
d.against_expense_claim, ("total_sanctioned_amount", "total_amount_reimbursed"))
pending_amount = flt(sanctioned_amount) - flt(reimbursed_amount)
if d.debit > pending_amount:
frappe.throw(_("Row No {0}: Amount cannot be greater than Pending Amount against Expense Claim {1}. \
Pending Amount is {2}".format(d.idx, d.against_expense_claim, pending_amount)))
frappe.throw(_("Row No {0}: Amount cannot be greater than Pending Amount against Expense Claim {1}. Pending Amount is {2}".format(d.idx, d.against_expense_claim, pending_amount)))
def validate_credit_debit_note(self):
if self.stock_entry:
if frappe.db.get_value("Stock Entry", self.stock_entry, "docstatus") != 1:
frappe.throw(_("Stock Entry {0} is not submitted").format(self.stock_entry))
if frappe.db.exists({"doctype": "Journal Entry", "stock_entry": self.stock_entry, "docstatus":1}):
frappe.msgprint(_("Warning: Another {0} # {1} exists against stock entry {2}".format(self.voucher_type, self.name, self.stock_entry)))

View File

@@ -44,6 +44,10 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
}
});
},
refresh: function() {
this.frm.disable_save();
},
party: function() {
var me = this

View File

@@ -32,6 +32,7 @@ frappe.ui.form.on("Payment Tool", "onload", function(frm) {
});
frappe.ui.form.on("Payment Tool", "refresh", function(frm) {
frm.disable_save();
frappe.ui.form.trigger("Payment Tool", "party_type");
});

View File

@@ -312,7 +312,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"modified": "2015-02-21 03:59:08.154966",
"modified": "2015-06-05 11:17:33.843334",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Tool",

View File

@@ -1,13 +1,13 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("POS Setting", "onload", function(frm) {
frappe.ui.form.on("POS Profile", "onload", function(frm) {
frm.set_query("selling_price_list", function() {
return { filter: { selling: 1 } };
});
frm.call({
method: "erpnext.accounts.doctype.pos_setting.pos_setting.get_series",
method: "erpnext.accounts.doctype.pos_profile.pos_profile.get_series",
callback: function(r) {
if(!r.exc) {
set_field_options("naming_series", r.message);

View File

@@ -0,0 +1,263 @@
{
"allow_rename": 0,
"autoname": "hash",
"creation": "2013-05-24 12:15:51",
"docstatus": 0,
"doctype": "DocType",
"fields": [
{
"fieldname": "user",
"fieldtype": "Link",
"in_list_view": 1,
"label": "User",
"oldfieldname": "user",
"oldfieldtype": "Link",
"options": "User",
"permlevel": 0,
"read_only": 0
},
{
"description": "",
"fieldname": "territory",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Territory",
"oldfieldname": "territory",
"oldfieldtype": "Link",
"options": "Territory",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "naming_series",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Series",
"no_copy": 1,
"oldfieldname": "naming_series",
"oldfieldtype": "Select",
"options": "[Select]",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "currency",
"fieldtype": "Link",
"in_list_view": 0,
"label": "Currency",
"oldfieldname": "currency",
"oldfieldtype": "Select",
"options": "Currency",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "selling_price_list",
"fieldtype": "Link",
"label": "Price List",
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
"options": "Price List",
"permlevel": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "column_break0",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break",
"permlevel": 0,
"read_only": 0
},
{
"default": "1",
"description": "Create Stock Ledger Entries when you submit a Sales Invoice",
"fieldname": "update_stock",
"fieldtype": "Check",
"label": "Update Stock",
"permlevel": 0,
"reqd": 0
},
{
"fieldname": "customer",
"fieldtype": "Link",
"in_list_view": 0,
"label": "Customer",
"oldfieldname": "customer_account",
"oldfieldtype": "Link",
"options": "Customer",
"permlevel": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "cash_bank_account",
"fieldtype": "Link",
"label": "Cash/Bank Account",
"oldfieldname": "cash_bank_account",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "income_account",
"fieldtype": "Link",
"label": "Income Account",
"oldfieldname": "income_account",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
"fieldname": "expense_account",
"fieldtype": "Link",
"hidden": 0,
"label": "Expense Account",
"options": "Account",
"permlevel": 0,
"print_hide": 1,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "warehouse",
"fieldtype": "Link",
"label": "Warehouse",
"oldfieldname": "warehouse",
"oldfieldtype": "Link",
"options": "Warehouse",
"permlevel": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "cost_center",
"fieldtype": "Link",
"label": "Cost Center",
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
"options": "Cost Center",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
"label": "Taxes and Charges",
"oldfieldname": "charge",
"oldfieldtype": "Link",
"options": "Sales Taxes and Charges Template",
"permlevel": 0,
"read_only": 0
},
{
"fieldname": "write_off_account",
"fieldtype": "Link",
"label": "Write Off Account",
"options": "Account",
"permlevel": 0,
"precision": "",
"reqd": 1
},
{
"fieldname": "write_off_cost_center",
"fieldtype": "Link",
"label": "Write Off Cost Center",
"options": "Cost Center",
"permlevel": 0,
"precision": "",
"reqd": 1
},
{
"allow_on_submit": 1,
"fieldname": "letter_head",
"fieldtype": "Link",
"label": "Letter Head",
"oldfieldname": "letter_head",
"oldfieldtype": "Select",
"options": "Letter Head",
"permlevel": 0,
"print_hide": 1,
"read_only": 0
},
{
"fieldname": "tc_name",
"fieldtype": "Link",
"label": "Terms and Conditions",
"oldfieldname": "tc_name",
"oldfieldtype": "Link",
"options": "Terms and Conditions",
"permlevel": 0,
"read_only": 0
},
{
"allow_on_submit": 1,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"in_filter": 0,
"label": "Print Heading",
"oldfieldname": "select_print_heading",
"oldfieldtype": "Select",
"options": "Print Heading",
"permlevel": 0,
"read_only": 0
}
],
"icon": "icon-cog",
"idx": 1,
"modified": "2015-05-20 05:38:44.482696",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 0,
"write": 1
},
{
"apply_user_permissions": 1,
"delete": 0,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"submit": 0
}
],
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "user"
}

View File

@@ -8,22 +8,22 @@ from frappe.utils import cint
from frappe.model.document import Document
class POSSetting(Document):
class POSProfile(Document):
def validate(self):
self.check_for_duplicate()
self.validate_expense_account()
self.validate_all_link_fields()
def check_for_duplicate(self):
res = frappe.db.sql("""select name, user from `tabPOS Setting`
res = frappe.db.sql("""select name, user from `tabPOS Profile`
where ifnull(user, '') = %s and name != %s and company = %s""",
(self.user, self.name, self.company))
if res:
if res[0][1]:
msgprint(_("POS Setting {0} already created for user: {1} and company {2}").format(res[0][0],
msgprint(_("POS Profile {0} already created for user: {1} and company {2}").format(res[0][0],
res[0][1], self.company), raise_exception=1)
else:
msgprint(_("Global POS Setting {0} already created for company {1}").format(res[0][0],
msgprint(_("Global POS Profile {0} already created for company {1}").format(res[0][0],
self.company), raise_exception=1)
def validate_expense_account(self):
@@ -57,7 +57,7 @@ class POSSetting(Document):
condition = ""
pos_view_users = frappe.db.sql_list("""select user
from `tabPOS Setting` {0}""".format(condition))
from `tabPOS Profile` {0}""".format(condition))
for user in pos_view_users:
if user:

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
@@ -5,7 +6,7 @@ from __future__ import unicode_literals
import frappe
import unittest
test_records = frappe.get_test_records('POS Setting')
# test_records = frappe.get_test_records('POS Profile')
class TestPOSSetting(unittest.TestCase):
class TestPOSProfile(unittest.TestCase):
pass

View File

@@ -1 +0,0 @@
Standard settings for Point of Sales (POS) type of Sales Invoice.

View File

@@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@@ -1,263 +0,0 @@
{
"allow_rename": 0,
"autoname": "hash",
"creation": "2013-05-24 12:15:51",
"docstatus": 0,
"doctype": "DocType",
"fields": [
{
"fieldname": "user",
"fieldtype": "Link",
"in_list_view": 1,
"label": "User",
"oldfieldname": "user",
"oldfieldtype": "Link",
"options": "User",
"permlevel": 0,
"read_only": 0
},
{
"description": "",
"fieldname": "territory",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Territory",
"oldfieldname": "territory",
"oldfieldtype": "Link",
"options": "Territory",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "naming_series",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Series",
"no_copy": 1,
"oldfieldname": "naming_series",
"oldfieldtype": "Select",
"options": "[Select]",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "currency",
"fieldtype": "Link",
"in_list_view": 0,
"label": "Currency",
"oldfieldname": "currency",
"oldfieldtype": "Select",
"options": "Currency",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "selling_price_list",
"fieldtype": "Link",
"label": "Price List",
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
"options": "Price List",
"permlevel": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "column_break0",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break",
"permlevel": 0,
"read_only": 0
},
{
"default": "1",
"description": "Create Stock Ledger Entries when you submit a Sales Invoice",
"fieldname": "update_stock",
"fieldtype": "Check",
"label": "Update Stock",
"permlevel": 0,
"reqd": 0
},
{
"fieldname": "customer",
"fieldtype": "Link",
"in_list_view": 0,
"label": "Customer",
"oldfieldname": "customer_account",
"oldfieldtype": "Link",
"options": "Customer",
"permlevel": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "cash_bank_account",
"fieldtype": "Link",
"label": "Cash/Bank Account",
"oldfieldname": "cash_bank_account",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "income_account",
"fieldtype": "Link",
"label": "Income Account",
"oldfieldname": "income_account",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
"fieldname": "expense_account",
"fieldtype": "Link",
"hidden": 0,
"label": "Expense Account",
"options": "Account",
"permlevel": 0,
"print_hide": 1,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "warehouse",
"fieldtype": "Link",
"label": "Warehouse",
"oldfieldname": "warehouse",
"oldfieldtype": "Link",
"options": "Warehouse",
"permlevel": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "cost_center",
"fieldtype": "Link",
"label": "Cost Center",
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
"options": "Cost Center",
"permlevel": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
"label": "Taxes and Charges",
"oldfieldname": "charge",
"oldfieldtype": "Link",
"options": "Sales Taxes and Charges Template",
"permlevel": 0,
"read_only": 0
},
{
"fieldname": "write_off_account",
"fieldtype": "Link",
"label": "Write Off Account",
"options": "Account",
"permlevel": 0,
"precision": "",
"reqd": 1
},
{
"fieldname": "write_off_cost_center",
"fieldtype": "Link",
"label": "Write Off Cost Center",
"options": "Cost Center",
"permlevel": 0,
"precision": "",
"reqd": 1
},
{
"allow_on_submit": 1,
"fieldname": "letter_head",
"fieldtype": "Link",
"label": "Letter Head",
"oldfieldname": "letter_head",
"oldfieldtype": "Select",
"options": "Letter Head",
"permlevel": 0,
"print_hide": 1,
"read_only": 0
},
{
"fieldname": "tc_name",
"fieldtype": "Link",
"label": "Terms and Conditions",
"oldfieldname": "tc_name",
"oldfieldtype": "Link",
"options": "Terms and Conditions",
"permlevel": 0,
"read_only": 0
},
{
"allow_on_submit": 1,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"in_filter": 0,
"label": "Print Heading",
"oldfieldname": "select_print_heading",
"oldfieldtype": "Select",
"options": "Print Heading",
"permlevel": 0,
"read_only": 0
}
],
"icon": "icon-cog",
"idx": 1,
"modified": "2015-02-05 05:11:42.344181",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Setting",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 0,
"write": 1
},
{
"apply_user_permissions": 1,
"delete": 0,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"submit": 0
}
],
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "user"
}

View File

@@ -217,7 +217,7 @@
"depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
"fieldname": "discount_percentage",
"fieldtype": "Float",
"label": "Discount Percentage",
"label": "Discount on Price List Rate (%)",
"permlevel": 0
},
{
@@ -245,7 +245,7 @@
"icon": "icon-gift",
"idx": 1,
"istable": 0,
"modified": "2015-02-26 04:26:13.240166",
"modified": "2015-05-27 02:47:16.777466",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",

View File

@@ -205,9 +205,9 @@ def get_pricing_rules(args):
def filter_pricing_rules(args, pricing_rules):
# filter for qty
if pricing_rules and args.get("qty"):
pricing_rules = filter(lambda x: (args.qty>=flt(x.min_qty)
and (args.qty<=x.max_qty if x.max_qty else True)), pricing_rules)
if pricing_rules:
pricing_rules = filter(lambda x: (flt(args.get("qty"))>=flt(x.min_qty)
and (flt(args.get("qty"))<=x.max_qty if x.max_qty else True)), pricing_rules)
# find pricing rule with highest priority
if pricing_rules:

File diff suppressed because it is too large Load Diff

View File

@@ -40,7 +40,7 @@
{
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
"in_list_view": 0,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Text",
@@ -105,10 +105,11 @@
"read_only": 0
},
{
"depends_on": "price_list_rate",
"fieldname": "discount_percentage",
"fieldtype": "Percent",
"in_list_view": 1,
"label": "Discount %",
"label": "Discount on Price List Rate (%)",
"permlevel": 0,
"print_hide": 0,
"read_only": 0
@@ -451,7 +452,7 @@
],
"idx": 1,
"istable": 1,
"modified": "2015-02-23 15:35:32.895515",
"modified": "2015-06-02 14:18:56.294949",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -23,7 +23,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
this.frm.set_value("is_pos", 1);
this.is_pos(function() {
if (cint(frappe.defaults.get_user_defaults("fs_pos_view"))===1)
erpnext.pos.toggle(me.frm);
erpnext.pos.toggle(me.frm, true);
});
}
}
@@ -65,7 +65,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
});
if(!from_delivery_note) {
cur_frm.page.add_menu_item(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck")
cur_frm.add_custom_button(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck")
}
}
@@ -75,14 +75,14 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
}
// Show buttons only when pos view is active
if (doc.docstatus===0 && !this.pos_active) {
if (cint(doc.docstatus==0) && cur_frm.page.current_view_name!=="pos") {
cur_frm.cscript.sales_order_btn();
cur_frm.cscript.delivery_note_btn();
}
},
sales_order_btn: function() {
this.$sales_order_btn = cur_frm.page.add_menu_item(__('From Sales Order'),
this.$sales_order_btn = cur_frm.add_custom_button(__('From Sales Order'),
function() {
frappe.model.map_current_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
@@ -99,7 +99,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
},
delivery_note_btn: function() {
this.$delivery_note_btn = cur_frm.page.add_menu_item(__('From Delivery Note'),
this.$delivery_note_btn = cur_frm.add_custom_button(__('From Delivery Note'),
function() {
frappe.model.map_current_doc({
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
@@ -253,7 +253,7 @@ cur_frm.cscript.mode_of_payment = function(doc) {
if(r.message) {
cur_frm.set_value("cash_bank_account", r.message["account"]);
}
}
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -160,12 +160,12 @@ class SalesInvoice(SellingController):
frappe.throw(_("Time Log Batch {0} must be 'Submitted'").format(d.time_log_batch))
def set_pos_fields(self, for_validate=False):
"""Set retail related fields from pos settings"""
"""Set retail related fields from POS Profiles"""
if cint(self.is_pos) != 1:
return
from erpnext.stock.get_item_details import get_pos_settings_item_details, get_pos_settings
pos = get_pos_settings(self.company)
from erpnext.stock.get_item_details import get_pos_profiles_item_details, get_pos_profiles
pos = get_pos_profiles(self.company)
if pos:
if not for_validate and not self.customer:
@@ -184,7 +184,7 @@ class SalesInvoice(SellingController):
# set pos values in items
for item in self.get("items"):
if item.get('item_code'):
for fname, val in get_pos_settings_item_details(pos,
for fname, val in get_pos_profiles_item_details(pos,
frappe._dict(item.as_dict()), pos).items():
if (not for_validate) or (for_validate and not item.get(fname)):
@@ -371,24 +371,24 @@ class SalesInvoice(SellingController):
def get_warehouse(self):
user_pos_setting = frappe.db.sql("""select name, warehouse from `tabPOS Setting`
user_pos_profile = frappe.db.sql("""select name, warehouse from `tabPOS Profile`
where ifnull(user,'') = %s and company = %s""", (frappe.session['user'], self.company))
warehouse = user_pos_setting[0][1] if user_pos_setting else None
warehouse = user_pos_profile[0][1] if user_pos_profile else None
if not warehouse:
global_pos_setting = frappe.db.sql("""select name, warehouse from `tabPOS Setting`
global_pos_profile = frappe.db.sql("""select name, warehouse from `tabPOS Profile`
where ifnull(user,'') = '' and company = %s""", self.company)
if global_pos_setting:
warehouse = global_pos_setting[0][1]
elif not user_pos_setting:
msgprint(_("POS Setting required to make POS Entry"), raise_exception=True)
if global_pos_profile:
warehouse = global_pos_profile[0][1]
elif not user_pos_profile:
msgprint(_("POS Profile required to make POS Entry"), raise_exception=True)
return warehouse
def on_update(self):
if cint(self.update_stock) == 1:
# Set default warehouse from pos setting
# Set default warehouse from POS Profile
if cint(self.is_pos) == 1:
w = self.get_warehouse()
if w:

View File

@@ -462,7 +462,7 @@ class TestSalesInvoice(unittest.TestCase):
def test_pos_gl_entry_with_aii(self):
set_perpetual_inventory()
self.make_pos_setting()
self.make_pos_profile()
self._insert_purchase_receipt()
@@ -517,19 +517,19 @@ class TestSalesInvoice(unittest.TestCase):
set_perpetual_inventory(0)
frappe.db.sql("delete from `tabPOS Setting`")
frappe.db.sql("delete from `tabPOS Profile`")
def make_pos_setting(self):
pos_setting = frappe.get_doc({
def make_pos_profile(self):
pos_profile = frappe.get_doc({
"cash_bank_account": "_Test Account Bank Account - _TC",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"currency": "INR",
"doctype": "POS Setting",
"doctype": "POS Profile",
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"income_account": "Sales - _TC",
"name": "_Test POS Setting",
"naming_series": "_T-POS Setting-",
"name": "_Test POS Profile",
"naming_series": "_T-POS Profile-",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
"warehouse": "_Test Warehouse - _TC",
@@ -537,8 +537,8 @@ class TestSalesInvoice(unittest.TestCase):
"write_off_cost_center": "_Test Write Off Cost Center - _TC"
})
if not frappe.db.exists("POS Setting", "_Test POS Setting"):
pos_setting.insert()
if not frappe.db.exists("POS Profile", "_Test POS Profile"):
pos_profile.insert()
def test_si_gl_entry_with_aii_and_update_stock_with_warehouse_but_no_account(self):
set_perpetual_inventory()

View File

@@ -58,7 +58,7 @@
{
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
"in_list_view": 0,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Text",
@@ -98,10 +98,11 @@
"reqd": 0
},
{
"depends_on": "price_list_rate",
"fieldname": "discount_percentage",
"fieldtype": "Percent",
"in_list_view": 1,
"label": "Discount (%)",
"label": "Discount on Price List Rate (%)",
"oldfieldname": "adj_rate",
"oldfieldtype": "Float",
"permlevel": 0,
@@ -504,7 +505,7 @@
],
"idx": 1,
"istable": 1,
"modified": "2015-03-23 14:56:45.641026",
"modified": "2015-06-02 14:18:45.176726",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cstr
from frappe import _
from frappe.model.meta import get_field_precision
from erpnext.accounts.utils import validate_expense_against_budget
@@ -55,28 +56,23 @@ def merge_similar_entries(gl_map):
def check_if_in_list(gle, gl_map):
for e in gl_map:
if e.account == gle.account and \
cstr(e.get('against_voucher'))==cstr(gle.get('against_voucher')) \
and cstr(e.get('against_voucher_type')) == \
cstr(gle.get('against_voucher_type')) \
and cstr(e.get('cost_center')) == cstr(gle.get('cost_center')):
return e
if e.account == gle.account \
and cstr(e.get('party_type'))==cstr(gle.get('party_type')) \
and cstr(e.get('party'))==cstr(gle.get('party')) \
and cstr(e.get('against_voucher'))==cstr(gle.get('against_voucher')) \
and cstr(e.get('against_voucher_type')) == cstr(gle.get('against_voucher_type')) \
and cstr(e.get('cost_center')) == cstr(gle.get('cost_center')):
return e
def save_entries(gl_map, adv_adj, update_outstanding):
validate_account_for_auto_accounting_for_stock(gl_map)
total_debit = total_credit = 0.0
round_off_debit_credit(gl_map)
for entry in gl_map:
make_entry(entry, adv_adj, update_outstanding)
# check against budget
validate_expense_against_budget(entry)
# update total debit / credit
total_debit += flt(entry.debit)
total_credit += flt(entry.credit)
validate_total_debit_credit(total_debit, total_credit, gl_map)
def make_entry(args, adv_adj, update_outstanding):
args.update({"doctype": "GL Entry"})
gle = frappe.get_doc(args)
@@ -85,10 +81,6 @@ def make_entry(args, adv_adj, update_outstanding):
gle.run_method("on_update_with_args", adv_adj, update_outstanding)
gle.submit()
def validate_total_debit_credit(total_debit, total_credit, gl_map):
if abs(total_debit - total_credit) > 0.005:
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.").format(gl_map[0].voucher_type, gl_map[0].voucher_no, total_debit - total_credit))
def validate_account_for_auto_accounting_for_stock(gl_map):
if gl_map[0].voucher_type=="Journal Entry":
aii_accounts = [d[0] for d in frappe.db.sql("""select name from tabAccount
@@ -96,7 +88,54 @@ def validate_account_for_auto_accounting_for_stock(gl_map):
for entry in gl_map:
if entry.account in aii_accounts:
frappe.throw(_("Account: {0} can only be updated via Stock Transactions").format(entry.account), StockAccountInvalidTransaction)
frappe.throw(_("Account: {0} can only be updated via Stock Transactions")
.format(entry.account), StockAccountInvalidTransaction)
def round_off_debit_credit(gl_map):
precision = get_field_precision(frappe.get_meta("GL Entry").get_field("debit"),
currency=frappe.db.get_value("Company", gl_map[0].company, "default_currency", cache=True))
debit_credit_diff = 0.0
for entry in gl_map:
entry.debit = flt(entry.debit, precision)
entry.credit = flt(entry.credit, precision)
debit_credit_diff += entry.debit - entry.credit
debit_credit_diff = flt(debit_credit_diff, precision)
if abs(debit_credit_diff) >= (2.0 / (10**precision)):
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.")
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
elif abs(debit_credit_diff) >= (1.0 / (10**precision)):
make_round_off_gle(gl_map, debit_credit_diff)
def make_round_off_gle(gl_map, debit_credit_diff):
round_off_account, round_off_cost_center = frappe.db.get_value("Company", gl_map[0].company,
["round_off_account", "round_off_cost_center"]) or [None, None]
if not round_off_account:
frappe.throw(_("Please mention Round Off Account in Company"))
if not round_off_cost_center:
frappe.throw(_("Please mention Round Off Cost Center in Company"))
round_off_gle = frappe._dict()
for k in ["voucher_type", "voucher_no", "company",
"posting_date", "remarks", "fiscal_year", "is_opening"]:
round_off_gle[k] = gl_map[0][k]
round_off_gle.update({
"account": round_off_account,
"debit": abs(debit_credit_diff) if debit_credit_diff < 0 else 0,
"credit": debit_credit_diff if debit_credit_diff > 0 else 0,
"cost_center": round_off_cost_center,
"party_type": None,
"party": None,
"against_voucher_type": None,
"against_voucher": None
})
gl_map.append(round_off_gle)
def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None,

View File

@@ -55,7 +55,7 @@ frappe.pages["Accounts Browser"].on_page_load = function(wrapper){
.change(function() {
var ctype = frappe.get_route()[1] || 'Account';
erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(),
chart_area.get(0));
chart_area.get(0), wrapper.page);
})
// load up companies
@@ -75,19 +75,23 @@ frappe.pages["Accounts Browser"].on_page_show = function(wrapper){
// set route
var ctype = frappe.get_route()[1] || 'Account';
if(erpnext.account_chart && erpnext.account_chart.ctype != ctype) {
wrapper.$company_select.change();
}
}
erpnext.AccountsChart = Class.extend({
init: function(ctype, company, wrapper) {
init: function(ctype, company, wrapper, page) {
$(wrapper).empty();
var me = this;
me.ctype = ctype;
me.can_create = frappe.model.can_create(this.ctype);
me.can_delete = frappe.model.can_delete(this.ctype);
me.can_write = frappe.model.can_write(this.ctype);
me.page = page;
me.set_title();
// __("Accounts"), __("Cost Centers")
@@ -169,9 +173,9 @@ erpnext.AccountsChart = Class.extend({
set_title: function(val) {
var chart_str = this.ctype=="Account" ? __("Chart of Accounts") : __("Chart of Cost Centers");
if(val) {
wrapper.page.set_title(chart_str + " - " + cstr(val));
this.page.set_title(chart_str + " - " + cstr(val));
} else {
wrapper.page.set_title(chart_str);
this.page.set_title(chart_str);
}
},

View File

@@ -35,7 +35,7 @@ frappe.pages['pos'].on_page_load = function(wrapper) {
});
$.ajax({
url: "/api/resource/POS Setting",
url: "/api/resource/POS Profile",
success: function(data) {
if(!data.data.length) {
page.main.find(".pos-setting-message").removeClass('hide');

View File

@@ -9,7 +9,7 @@
<button class="btn btn-primary btn-lg">{%= __("Start") %}</button>
</p>
<p class="pos-setting-message hide">
<a class="btn btn-default btn-sm" href="#Form/POS Setting/New POS Setting">
{%= __("Make new POS Setting") %}</a>
<a class="btn btn-default btn-sm" href="#Form/POS Profile/New POS Profile">
{%= __("Make new POS Profile") %}</a>
</p>
</div>

View File

@@ -1,15 +1,15 @@
{
"creation": "2012-04-11 13:16:56",
"doc_type": "Journal Entry",
"docstatus": 0,
"doctype": "Print Format",
"html": "<div style=\"position: relative\">\n\n\t{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Advice\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n{%- for label, value in (\n (_(\"Voucher Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Reference / Cheque No.\"), doc.cheque_no),\n (_(\"Reference / Cheque Date\"), frappe.utils.formatdate(doc.cheque_date))\n ) -%}\n <div class=\"row\">\n <div class=\"col-xs-4\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-8\">{{ value }}</div>\n </div>\n{%- endfor -%}\n\t<hr>\n\t<p>{{ _(\"This amount is in full / part settlement of the listed bills\") }}:</p>\n{%- for label, value in (\n (_(\"Amount\"), \"<strong>\" + doc.get_formatted(\"total_amount\") + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"References\"), doc.remark)\n ) -%}\n <div class=\"row\">\n <div class=\"col-xs-4\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-8\">{{ value }}</div>\n </div>\n {%- endfor -%}\n <hr>\n\t<div style=\"position: absolute; top: 14cm; left: 0cm;\">\n\t\tPrepared By</div>\n\t<div style=\"position: absolute; top: 14cm; left: 5.5cm;\">\n\t\tAuthorised Signatory</div>\n\t<div style=\"position: absolute; top: 14cm; left: 11cm;\">\n\t\tReceived Payment as Above</div>\n\t<div style=\"position: absolute; top: 16.4cm; left: 5.9cm;\">\n\t\t<strong>_____________</strong></div>\n\t<div style=\"position: absolute; top: 16.7cm; left: 6cm;\">\n\t\t<strong>A/C Payee</strong></div>\n\t<div style=\"position: absolute; top: 16.7cm; left: 5.9cm;\">\n\t\t<strong>_____________</strong></div>\n\t<div style=\"position: absolute; top: 16.9cm; left: 12cm;\">\n\t\t{{ frappe.utils.formatdate(doc.cheque_date) }}</div>\n\t<div style=\"position: absolute; top: 17.9cm; left: 1cm;\">\n\t\t{{ doc.pay_to_recd_from }}</div>\n\t<div style=\"position: absolute; top: 18.6cm; left: 1cm; width: 7cm;\">\n\t\t{{ doc.total_amount_in_words }}</div>\n\t<div style=\"position: absolute; top: 19.7cm; left: 12cm;\">\n\t\t{{ doc.total_amount }}</div>\n</div>",
"idx": 1,
"modified": "2015-01-12 11:03:17.032512",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cheque Printing Format",
"owner": "Administrator",
"print_format_type": "Server",
"creation": "2012-04-11 13:16:56",
"custom_format": 1,
"doc_type": "Journal Entry",
"docstatus": 0,
"doctype": "Print Format",
"html": "<div style=\"position: relative\">\n\n\t{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Advice\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n{%- for label, value in (\n (_(\"Voucher Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Reference / Cheque No.\"), doc.cheque_no),\n (_(\"Reference / Cheque Date\"), frappe.utils.formatdate(doc.cheque_date))\n ) -%}\n <div class=\"row\">\n <div class=\"col-xs-4\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-8\">{{ value }}</div>\n </div>\n{%- endfor -%}\n\t<hr>\n\t<p>{{ _(\"This amount is in full / part settlement of the listed bills\") }}:</p>\n{%- for label, value in (\n (_(\"Amount\"), \"<strong>\" + doc.get_formatted(\"total_amount\") + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"References\"), doc.remark)\n ) -%}\n <div class=\"row\">\n <div class=\"col-xs-4\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-xs-8\">{{ value }}</div>\n </div>\n {%- endfor -%}\n <hr>\n\t<div style=\"position: absolute; top: 14cm; left: 0cm;\">\n\t\tPrepared By</div>\n\t<div style=\"position: absolute; top: 14cm; left: 5.5cm;\">\n\t\tAuthorised Signatory</div>\n\t<div style=\"position: absolute; top: 14cm; left: 11cm;\">\n\t\tReceived Payment as Above</div>\n\t<div style=\"position: absolute; top: 16.4cm; left: 5.9cm;\">\n\t\t<strong>_____________</strong></div>\n\t<div style=\"position: absolute; top: 16.7cm; left: 6cm;\">\n\t\t<strong>A/C Payee</strong></div>\n\t<div style=\"position: absolute; top: 16.7cm; left: 5.9cm;\">\n\t\t<strong>_____________</strong></div>\n\t<div style=\"position: absolute; top: 16.9cm; left: 12cm;\">\n\t\t{{ frappe.utils.formatdate(doc.cheque_date) }}</div>\n\t<div style=\"position: absolute; top: 17.9cm; left: 1cm;\">\n\t\t{{ doc.pay_to_recd_from }}</div>\n\t<div style=\"position: absolute; top: 18.6cm; left: 1cm; width: 7cm;\">\n\t\t{{ doc.total_amount_in_words }}</div>\n\t<div style=\"position: absolute; top: 19.7cm; left: 12cm;\">\n\t\t{{ doc.get_formatted(\"total_amount\") }}</div>\n</div>",
"idx": 1,
"modified": "2015-05-29 01:57:51.203850",
"modified_by": "Administrator",
"name": "Cheque Printing Format",
"owner": "Administrator",
"print_format_type": "Server",
"standard": "Yes"
}
}

View File

@@ -29,7 +29,7 @@ def execute(filters=None):
def get_provisional_profit_loss(asset, liability, equity, period_list):
if asset and (liability or equity):
provisional_profit_loss = {
"account_name": _("Provisional Profit / Loss (Credit)"),
"account_name": "'" + _("Provisional Profit / Loss (Credit)") + "'",
"account": None,
"warn_if_negative": True
}

View File

@@ -38,7 +38,7 @@ def execute(filters=None):
data += [
get_balance_row(_("System Balance"), balance_as_per_system),
[""]*len(columns),
["", _("Amounts not reflected in bank"), total_debit, total_credit, "", "", "", ""],
["", '"' + _("Amounts not reflected in bank") + '"', total_debit, total_credit, "", "", "", ""],
get_balance_row(_("Amounts not reflected in system"), amounts_not_reflected_in_system),
[""]*len(columns),
get_balance_row(_("Expected balance as per bank"), bank_bal)
@@ -68,6 +68,6 @@ def get_entries(filters):
def get_balance_row(label, amount):
if amount > 0:
return ["", label, amount, 0, "", "", "", ""]
return ["", '"' + label + '"', amount, 0, "", "", "", ""]
else:
return ["", label, 0, abs(amount), "", "", "", ""]
return ["", '"' + label + '"', 0, abs(amount), "", "", "", ""]

View File

@@ -146,7 +146,7 @@ def prepare_data(accounts, balance_must_be, period_list):
def add_total_row(out, balance_must_be, period_list):
row = {
"account_name": _("Total ({0})").format(balance_must_be),
"account_name": "'" + _("Total ({0})").format(balance_must_be) + "'",
"account": None
}
for period in period_list:
@@ -207,7 +207,7 @@ def filter_accounts(accounts, depth=10):
add_to_list(None, 0)
return filtered_accounts, accounts_by_name
def sort_root_accounts(roots):
"""Sort root types as Asset, Liability, Equity, Income, Expense"""

View File

@@ -2,7 +2,7 @@
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __("Statement of Account") %}</h2>
<h4 class="text-center">{%= filters.account && (filters.account + ", ") || "" %} {%= filters.company %}</h4>
<h4 class="text-center">{%= (filters.party || filters.account) && ((filters.party || filters.account) + ", ") || "" %} {%= filters.company %}</h4>
<h5 class="text-center">
{%= dateutil.str_to_user(filters.from_date) %}
{%= __("to") %}
@@ -26,15 +26,20 @@
<td>{%= dateutil.str_to_user(data[i][__("Posting Date")]) %}</td>
<td>{%= data[i][__("Voucher Type")] %}
<br>{%= data[i][__("Voucher No")] %}</td>
<td>{%= data[i][__("Account")] %}
<br>{%= __("Against") %}: {%= data[i][__("Against Account")] %}
<td>
{% if(!(filters.party || filters.account)) { %}
{%= data[i][__("Party")] || data[i][__("Account")] %}
<br>
{% } %}
{{ __("Against") }}: {%= data[i][__("Against Account")] %}
<br>{%= __("Remarks") %}: {%= data[i][__("Remarks")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Debit")]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Credit")]) %}</td>
{% } else { %}
<td></td>
<td></td>
<td><b>{%= data[i][__("Account")] || "&nbsp;" %}</b></td>
<td><b>{%= frappe.format(data[i][__("Account")], {fieldtype: "Link"}) || "&nbsp;" %}</b></td>
<td style="text-align: right">
{%= data[i][__("Account")] && format_currency(data[i][__("Debit")]) %}</td>
<td style="text-align: right">

View File

@@ -9,7 +9,7 @@ from frappe import _
def execute(filters=None):
account_details = {}
for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1):
account_details.setdefault(acc.name, acc)
account_details.setdefault(acc.name, acc)
validate_filters(filters, account_details)
validate_party(filters)
@@ -82,8 +82,6 @@ def get_conditions(filters):
lft, rgt = frappe.db.get_value("Account", filters["account"], ["lft", "rgt"])
conditions.append("""account in (select name from tabAccount
where lft>=%s and rgt<=%s and docstatus<2)""" % (lft, rgt))
else:
conditions.append("posting_date between %(from_date)s and %(to_date)s")
if filters.get("voucher_no"):
conditions.append("voucher_no=%(voucher_no)s")
@@ -107,31 +105,31 @@ def get_data_with_opening_closing(filters, account_details, gl_entries):
opening, total_debit, total_credit, gle_map = get_accountwise_gle(filters, gl_entries, gle_map)
# Opening for filtered account
if filters.get("account"):
data += [get_balance_row("Opening", opening), {}]
if filters.get("account") or filters.get("party"):
data += [get_balance_row(_("Opening"), opening), {}]
for acc, acc_dict in gle_map.items():
if acc_dict.entries:
# Opening for individual ledger, if grouped by account
if filters.get("group_by_account"):
data.append(get_balance_row("Opening", acc_dict.opening))
data.append(get_balance_row(_("Opening"), acc_dict.opening))
data += acc_dict.entries
# Totals and closing for individual ledger, if grouped by account
if filters.get("group_by_account"):
data += [{"account": "Totals", "debit": acc_dict.total_debit,
data += [{"account": "'" + _("Totals") + "'", "debit": acc_dict.total_debit,
"credit": acc_dict.total_credit},
get_balance_row("Closing (Opening + Totals)",
get_balance_row(_("Closing (Opening + Totals)"),
(acc_dict.opening + acc_dict.total_debit - acc_dict.total_credit)), {}]
# Total debit and credit between from and to date
if total_debit or total_credit:
data.append({"account": "Totals", "debit": total_debit, "credit": total_credit})
data.append({"account": "'" + _("Totals") + "'", "debit": total_debit, "credit": total_credit})
# Closing for filtered account
if filters.get("account"):
data.append(get_balance_row("Closing (Opening + Totals)",
if filters.get("account") or filters.get("party"):
data.append(get_balance_row(_("Closing (Opening + Totals)"),
(opening + total_debit - total_credit)))
return data
@@ -153,9 +151,10 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
for gle in gl_entries:
amount = flt(gle.debit, 3) - flt(gle.credit, 3)
if filters.get("account") and gle.posting_date < getdate(filters.from_date):
if gle.posting_date < getdate(filters.from_date):
gle_map[gle.account].opening += amount
opening += amount
if filters.get("account") or filters.get("party"):
opening += amount
elif gle.posting_date <= getdate(filters.to_date):
gle_map[gle.account].entries.append(gle)
gle_map[gle.account].total_debit += flt(gle.debit, 3)
@@ -168,7 +167,7 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
def get_balance_row(label, balance):
return {
"account": label,
"account": "'" + label + "'",
"debit": balance if balance > 0 else 0,
"credit": -1*balance if balance < 0 else 0,
}

View File

@@ -14,7 +14,7 @@ def execute(filters=None):
source = gross_profit_data.grouped_data if filters.get("group_by") != "Invoice" else gross_profit_data.data
group_wise_columns = frappe._dict({
"invoice": ["name", "posting_date", "posting_time", "item_code", "item_name", "brand", "description", \
"invoice": ["parent", "customer", "posting_date", "posting_time", "item_code", "item_name", "brand", "description", \
"warehouse", "qty", "base_rate", "buying_rate", "base_amount",
"buying_amount", "gross_profit", "gross_profit_percent", "project"],
"item_code": ["item_code", "item_name", "brand", "description", "warehouse", "qty", "base_rate",
@@ -50,7 +50,7 @@ def execute(filters=None):
def get_columns(group_wise_columns, filters):
columns = []
column_map = frappe._dict({
"name": _("Sales Invoice") + ":Link/Sales Invoice:120",
"parent": _("Sales Invoice") + ":Link/Sales Invoice:120",
"posting_date": _("Posting Date") + ":Date",
"posting_time": _("Posting Time"),
"item_code": _("Item Code") + ":Link/Item",
@@ -98,7 +98,7 @@ class GrossProfitGenerator(object):
row.base_amount = flt(row.base_net_amount)
sales_boms = self.sales_boms.get(row.parenttype, {}).get(row.name, frappe._dict())
sales_boms = self.sales_boms.get(row.parenttype, {}).get(row.parent, frappe._dict())
# get buying amount
if row.item_code in sales_boms:
@@ -158,7 +158,7 @@ class GrossProfitGenerator(object):
def get_buying_amount_from_sales_bom(self, row, sales_bom):
buying_amount = 0.0
for bom_item in sales_bom[row.item_code]:
for bom_item in sales_bom:
if bom_item.get("parent_detail_docname")==row.item_row:
buying_amount += self.get_buying_amount(row, bom_item.item_code)
@@ -174,10 +174,11 @@ class GrossProfitGenerator(object):
return flt(row.qty) * item_rate
else:
if row.dn_detail:
row.parenttype = "Delivery Note"
row.parent = row.delivery_note
row.item_row = row.dn_detail
if row.update_stock or row.dn_detail:
if row.dn_detail:
row.parenttype = "Delivery Note"
row.parent = row.delivery_note
row.item_row = row.dn_detail
my_sle = self.sle.get((item_code, row.warehouse))
for i, sle in enumerate(my_sle):
@@ -215,7 +216,7 @@ class GrossProfitGenerator(object):
if self.filters.to_date:
conditions += " and posting_date <= %(to_date)s"
self.si_list = frappe.db.sql("""select item.parenttype, si.name,
self.si_list = frappe.db.sql("""select item.parenttype, item.parent,
si.posting_date, si.posting_time, si.project_name, si.update_stock,
si.customer, si.customer_group, si.territory,
item.item_code, item.item_name, item.description, item.warehouse,

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe import _
from frappe.utils import flt
def execute(filters=None):
@@ -23,7 +23,7 @@ def execute(filters=None):
purchase_receipt = d.purchase_receipt
elif d.po_detail:
purchase_receipt = ", ".join(frappe.db.sql_list("""select distinct parent
from `tabPurchase Receipt Item` where docstatus=1 and po_detail=%s""", d.po_detail))
from `tabPurchase Receipt Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail))
expense_account = d.expense_account or aii_account_map.get(d.company)
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,

View File

@@ -27,7 +27,7 @@ def execute(filters=None):
def get_net_profit_loss(income, expense, period_list):
if income and expense:
net_profit_loss = {
"account_name": _("Net Profit / Loss"),
"account_name": "'" + _("Net Profit / Loss") + "'",
"account": None,
"warn_if_negative": True
}

View File

@@ -12,7 +12,6 @@ def execute(filters=None):
invoice_list = get_invoices(filters)
columns, expense_accounts, tax_accounts = get_columns(invoice_list)
if not invoice_list:
msgprint(_("No record found"))
return columns, invoice_list
@@ -30,7 +29,8 @@ def execute(filters=None):
purchase_receipt = list(set(invoice_po_pr_map.get(inv.name, {}).get("purchase_receipt", [])))
project_name = list(set(invoice_po_pr_map.get(inv.name, {}).get("project_name", [])))
row = [inv.name, inv.posting_date, inv.supplier, inv.supplier_name, supplier_details.get(inv.supplier),
row = [inv.name, inv.posting_date, inv.supplier, inv.supplier_name,
supplier_details.get(inv.supplier),
inv.credit_to, ", ".join(project_name), inv.bill_no, inv.bill_date, inv.remarks,
", ".join(purchase_order), ", ".join(purchase_receipt)]
@@ -54,8 +54,7 @@ def execute(filters=None):
# total tax, grand total, outstanding amount & rounded total
row += [total_tax, inv.base_grand_total, flt(inv.base_grand_total, 2), inv.outstanding_amount]
data.append(row)
# raise Exception
data.append(row)
return columns, data
@@ -107,7 +106,7 @@ def get_conditions(filters):
def get_invoices(filters):
conditions = get_conditions(filters)
return frappe.db.sql("""select name, posting_date, credit_to, supplier, supplier_name
return frappe.db.sql("""select name, posting_date, credit_to, supplier, supplier_name,
bill_no, bill_date, remarks, base_net_total, base_grand_total, outstanding_amount
from `tabPurchase Invoice` where docstatus = 1 %s
order by posting_date desc, name desc""" % conditions, filters, as_dict=1)
@@ -144,7 +143,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
return invoice_expense_map, invoice_tax_map
def get_invoice_po_pr_map(invoice_list):
pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail
pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail,
project_name from `tabPurchase Invoice Item` where parent in (%s)
and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')""" %
', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
@@ -160,7 +159,7 @@ def get_invoice_po_pr_map(invoice_list):
pr_list = [d.purchase_receipt]
elif d.po_detail:
pr_list = frappe.db.sql_list("""select distinct parent from `tabPurchase Receipt Item`
where docstatus=1 and po_detail=%s""", d.pr_detail)
where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail)
if pr_list:
invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list)

View File

@@ -30,7 +30,8 @@ def execute(filters=None):
delivery_note = list(set(invoice_so_dn_map.get(inv.name, {}).get("delivery_note", [])))
row = [inv.name, inv.posting_date, inv.customer, inv.customer_name,
customer_map.get(inv.customer)["customer_group"], customer_map.get(inv.customer)["territory"],
customer_map.get(inv.customer, {}).get("customer_group"),
customer_map.get(inv.customer, {}).get("territory"),
inv.debit_to, inv.project_name, inv.remarks, ", ".join(sales_order), ", ".join(delivery_note)]
# map income values

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,6 @@ frappe.listview_settings['Purchase Order'] = {
return [__("Completed"), "green", "per_received,=,100|per_billed,=,100|status,!=,Stopped"];
}
},
order_by: "per_received asc, modified desc",
onload: function(listview) {
var method = "erpnext.buying.doctype.purchase_order.purchase_order.stop_or_unstop_purchase_orders";

View File

@@ -80,6 +80,8 @@ def create_purchase_order(**args):
po.company = args.company or "_Test Company"
po.supplier = args.customer or "_Test Supplier"
po.is_subcontracted = args.is_subcontracted or "No"
po.currency = args.currency or frappe.db.get_value("Company", po.company, "default_currency")
po.conversion_factor = args.conversion_factor or 1
po.append("items", {
"item_code": args.item or args.item_code or "_Test Item",

View File

@@ -75,7 +75,7 @@
{
"fieldname": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
"in_list_view": 0,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Small Text",
@@ -192,10 +192,11 @@
"read_only": 0
},
{
"depends_on": "price_list_rate",
"fieldname": "discount_percentage",
"fieldtype": "Percent",
"in_list_view": 1,
"label": "Discount %",
"label": "Discount on Price List Rate (%)",
"permlevel": 0,
"print_hide": 0,
"read_only": 0
@@ -537,7 +538,7 @@
],
"idx": 1,
"istable": 1,
"modified": "2015-05-14 14:54:16.899713",
"modified": "2015-06-02 14:19:21.459032",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Item",

View File

@@ -59,7 +59,7 @@
{
"fieldname": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
"in_list_view": 0,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Small Text",
@@ -121,10 +121,11 @@
"read_only": 0
},
{
"depends_on": "price_list_rate",
"fieldname": "discount_percentage",
"fieldtype": "Percent",
"in_list_view": 1,
"label": "Discount %",
"label": "Discount on Price List Rate (%)",
"permlevel": 0,
"print_hide": 0,
"read_only": 0
@@ -412,7 +413,7 @@
],
"idx": 1,
"istable": 1,
"modified": "2015-05-14 14:54:36.253819",
"modified": "2015-06-02 14:19:33.922968",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation Item",

View File

@@ -0,0 +1,8 @@
- Watch help videos in new module "Learn"
- Letter head and Terms removed from Purchase Invoice
- Renaming Discount fields to "Discount on Price List Rate"
- Backup manager: You you can choose which backup to download
- "Reserved Warehouse" is renamed "Delivery Warehouse" in Sales Order
- Timezone fixes: See all time-stamps in Events etc in your timezone, if you are not in the system timezone.
- POS Setting is renamed to POS Profile
- Fixes to POS

View File

@@ -0,0 +1,2 @@
- Introduced `Round Off` account to book rounding loss automatically
- Added 2 new fields 'Round Off Account' and 'Round Off Cost Center' in Company

View File

@@ -113,8 +113,8 @@ def get_data():
},
{
"type": "doctype",
"name": "POS Setting",
"label": _("Point-of-Sale Setting"),
"name": "POS Profile",
"label": _("Point-of-Sale Profile"),
"description": _("Rules to calculate shipping amount for a sale")
},
{
@@ -329,4 +329,25 @@ def get_data():
},
]
},
{
"label": _("Help"),
"icon": "icon-facetime-video",
"items": [
{
"type": "help",
"label": _("Chart of Accounts"),
"youtube_id": "DyR-DST-PyA"
},
{
"type": "help",
"label": _("Opening Accounting Balance"),
"youtube_id": "kdgM20Q-q68"
},
{
"type": "help",
"label": _("Setting up Taxes"),
"youtube_id": "nQ1zZdPgdaQ"
}
]
}
]

View File

@@ -156,4 +156,14 @@ def get_data():
}
]
},
{
"label": _("Help"),
"items": [
{
"type": "help",
"label": _("Customer and Supplier"),
"youtube_id": "anoGi_RpQ20"
},
]
},
]

View File

@@ -128,4 +128,14 @@ def get_data():
},
]
},
{
"label": _("Help"),
"items": [
{
"type": "help",
"label": _("Lead to Quotation"),
"youtube_id": "TxYX4r4JAKA"
},
]
},
]

View File

@@ -62,5 +62,12 @@ def get_data():
"icon": "icon-phone",
"icon": "octicon octicon-issue-opened",
"type": "module"
},
"Learn": {
"color": "#7272FF",
"force_show": True,
"icon": "icon-facetime-video",
"type": "module",
"is_help": True
}
}

138
erpnext/config/learn.py Normal file
View File

@@ -0,0 +1,138 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("General"),
"items": [
{
"type": "help",
"label": _("Navigating"),
"youtube_id": "YDoI2DF4Lmc"
},
{
"type": "help",
"label": _("Setup Wizard"),
"youtube_id": "oIOf_zCFWKQ"
}
]
},
{
"label": _("Setup"),
"items": [
{
"type": "help",
"label": _("Data Import and Export"),
"youtube_id": "6wiriRKPhmg"
},
{
"type": "help",
"label": _("Opening Stock Balance"),
"youtube_id": "0yPgrtfeCTs"
},
{
"type": "help",
"label": _("Setting up Email"),
"youtube_id": "YFYe0DrB95o"
},
{
"type": "help",
"label": _("Printing and Branding"),
"youtube_id": "cKZHcx1znMc"
},
{
"type": "help",
"label": _("Users and Permissions"),
"youtube_id": "fnBoRhBrwR4"
},
{
"type": "help",
"label": _("Workflow"),
"youtube_id": "yObJUg9FxFs"
},
]
},
{
"label": _("Accounts"),
"items": [
{
"type": "help",
"label": _("Chart of Accounts"),
"youtube_id": "DyR-DST-PyA"
},
{
"type": "help",
"label": _("Setting up Taxes"),
"youtube_id": "nQ1zZdPgdaQ"
},
{
"type": "help",
"label": _("Opening Accounting Balance"),
"youtube_id": "kdgM20Q-q68"
}
]
},
{
"label": _("CRM"),
"items": [
{
"type": "help",
"label": _("Lead to Quotation"),
"youtube_id": "TxYX4r4JAKA"
},
]
},
{
"label": _("Selling"),
"items": [
{
"type": "help",
"label": _("Customer and Supplier"),
"youtube_id": "anoGi_RpQ20"
},
]
},
{
"label": _("Stock"),
"items": [
{
"type": "help",
"label": _("Items and Pricing"),
"youtube_id": "qXaEwld4_Ps"
},
{
"type": "help",
"label": _("Opening Stock Balance"),
"youtube_id": "0yPgrtfeCTs"
},
{
"type": "help",
"label": _("Item Variants"),
"youtube_id": "OGBETlCzU5o"
},
]
},
{
"label": _("Buying"),
"items": [
{
"type": "help",
"label": _("Customer and Supplier"),
"youtube_id": "anoGi_RpQ20"
},
]
},
{
"label": _("Manufacturing"),
"items": [
{
"type": "help",
"label": _("Bill of Materials"),
"youtube_id": "hDV0c1OeWLo"
},
]
}
]

View File

@@ -55,6 +55,14 @@ def get_data():
"name": "BOM Replace Tool",
"description": _("Replace Item / BOM in all BOMs"),
},
{
"type": "page",
"name": "bom-browser",
"icon": "icon-sitemap",
"label": _("BOM Browser"),
"description": _("Tree of Bill of Materials"),
"doctype": "BOM"
}
]
},
{
@@ -97,4 +105,15 @@ def get_data():
},
]
},
{
"label": _("Help"),
"icon": "icon-facetime-video",
"items": [
{
"type": "help",
"label": _("Bill of Materials"),
"youtube_id": "hDV0c1OeWLo"
},
]
}
]

View File

@@ -275,4 +275,14 @@ def get_data():
},
]
},
{
"label": _("Help"),
"items": [
{
"type": "help",
"label": _("Customer and Supplier"),
"youtube_id": "anoGi_RpQ20"
},
]
},
]

View File

@@ -43,6 +43,36 @@ def get_data():
},
]
},
{
"label": _("Help"),
"items": [
{
"type": "help",
"name": _("Data Import and Export"),
"youtube_id": "6wiriRKPhmg"
},
{
"type": "help",
"label": _("Setting up Email"),
"youtube_id": "YFYe0DrB95o"
},
{
"type": "help",
"label": _("Printing and Branding"),
"youtube_id": "cKZHcx1znMc"
},
{
"type": "help",
"label": _("Users and Permissions"),
"youtube_id": "fnBoRhBrwR4"
},
{
"type": "help",
"label": _("Workflow"),
"youtube_id": "yObJUg9FxFs"
},
]
},
{
"label": _("Customize"),
"icon": "icon-glass",

View File

@@ -254,4 +254,25 @@ def get_data():
},
]
},
{
"label": _("Help"),
"icon": "icon-facetime-video",
"items": [
{
"type": "help",
"label": _("Items and Pricing"),
"youtube_id": "qXaEwld4_Ps"
},
{
"type": "help",
"label": _("Opening Stock Balance"),
"youtube_id": "0yPgrtfeCTs"
},
{
"type": "help",
"label": _("Item Variants"),
"youtube_id": "OGBETlCzU5o"
},
]
}
]

View File

@@ -334,7 +334,7 @@ class AccountsController(TransactionBase):
@frappe.whitelist()
def get_tax_rate(account_head):
return frappe.db.get_value("Account", account_head, "tax_rate")
@frappe.whitelist()
def get_default_taxes_and_charges(master_doctype):
default_tax = frappe.db.get_value(master_doctype, {"is_default": 1})

View File

@@ -279,7 +279,7 @@ class BuyingController(StockController):
def set_qty_as_per_stock_uom(self):
for d in self.get("items"):
if d.meta.get_field("stock_qty") and not d.stock_qty:
if d.meta.get_field("stock_qty"):
if not d.conversion_factor:
frappe.throw(_("Row {0}: Conversion Factor is mandatory").format(d.idx))
d.stock_qty = flt(d.qty) * flt(d.conversion_factor)

View File

@@ -85,9 +85,9 @@ class SellingController(StockController):
existing_shipping_charge = self.get("taxes", filters=shipping_charge)
if existing_shipping_charge:
# take the last record found
existing_shipping_charge[-1].rate = shipping_amount
existing_shipping_charge[-1].tax_amount = shipping_amount
else:
shipping_charge["rate"] = shipping_amount
shipping_charge["tax_amount"] = shipping_amount
shipping_charge["description"] = shipping_rule.label
self.append("taxes", shipping_charge)

View File

@@ -78,7 +78,7 @@ class StatusUpdater(Document):
self.status = s[0]
break
if self.status != _status:
if self.status != _status and self.status not in ("Submitted", "Cancelled"):
self.add_comment("Label", _(self.status))
if update:

View File

@@ -8,7 +8,9 @@ import frappe.utils
from frappe import throw, _
from frappe.model.document import Document
from frappe.email.bulk import check_bulk_limit
from frappe.utils.verified_command import get_signed_params, verify_request
import erpnext.tasks
from erpnext.crm.doctype.newsletter_list.newsletter_list import add_subscribers
class Newsletter(Document):
def onload(self):
@@ -87,12 +89,11 @@ def get_lead_options():
@frappe.whitelist(allow_guest=True)
def unsubscribe(email, name):
from frappe.utils.verified_command import verify_request
if not verify_request():
return
subs_id = frappe.db.get_value("Newsletter List Subscriber", {"email": email, "newsletter_list": name})
if name:
if subs_id:
subscriber = frappe.get_doc("Newsletter List Subscriber", subs_id)
subscriber.unsubscribed = 1
subscriber.save(ignore_permissions=True)
@@ -123,3 +124,47 @@ def create_lead(email_id):
"source": "Email"
})
lead.insert()
@frappe.whitelist(allow_guest=True)
def subscribe(email):
url = frappe.utils.get_url("/api/method/erpnext.crm.doctype.newsletter.newsletter.confirm_subscription") +\
"?" + get_signed_params({"email": email})
messages = (
_("Thank you for your interest in subscribing to our updates"),
_("Please verify your email id"),
url,
_("Click here to verify")
)
print url
content = """
<p>{0}. {1}.</p>
<p><a href="{2}">{3}</a></p>
"""
frappe.sendmail(email, subject=_("Confirm Your Email"), content=content.format(*messages), bulk=True)
@frappe.whitelist(allow_guest=True)
def confirm_subscription(email):
if not verify_request():
return
if not frappe.db.exists("Newsletter List", _("Website")):
frappe.get_doc({
"doctype": "Newsletter List",
"title": _("Website")
}).insert(ignore_permissions=True)
frappe.flags.ignore_permissions = True
add_subscribers(_("Website"), email)
frappe.db.commit()
frappe.respond_as_web_page(_("Confirmed"), _("{0} has been successfully added to our Newsletter list.").format(email))

View File

@@ -9,7 +9,16 @@ from urllib import unquote
class TestNewsletter(unittest.TestCase):
def setUp(self):
frappe.db.sql("update `tabNewsletter List Subscriber` set unsubscribed = 0")
if not frappe.get_all("Newsletter List Subscriber"):
for email in ["test_subscriber1@example.com", "test_subscriber2@example.com",
"test_subscriber3@example.com"]:
frappe.get_doc({
"doctype": "Newsletter List Subscriber",
"email": email,
"newsletter_list": "_Test Newsletter List"
}).insert()
else:
frappe.db.sql("update `tabNewsletter List Subscriber` set unsubscribed = 0")
def test_send(self):
self.send_newsletter()
@@ -39,6 +48,4 @@ class TestNewsletter(unittest.TestCase):
newsletter.send_emails()
test_dependencies = ["Newsletter List"]

View File

@@ -5,7 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import validate_email_add, strip
from frappe.utils import validate_email_add
from frappe import _
from email.utils import parseaddr
@@ -44,11 +44,14 @@ class NewsletterList(Document):
return self.update_total_subscribers()
def update_total_subscribers(self):
self.total_subscribers = frappe.db.sql("""select count(*) from `tabNewsletter List Subscriber`
where newsletter_list=%s""", self.name)[0][0]
self.total_subscribers = self.get_total_subscribers()
self.db_update()
return self.total_subscribers
def get_total_subscribers(self):
return frappe.db.sql("""select count(*) from `tabNewsletter List Subscriber`
where newsletter_list=%s""", self.name)[0][0]
def on_trash(self):
for d in frappe.get_all("Newsletter List Subscriber", "name", {"newsletter_list": self.name}):
frappe.delete_doc("Newsletter List Subscriber", d.name)
@@ -75,7 +78,7 @@ def add_subscribers(name, email_list):
"doctype": "Newsletter List Subscriber",
"newsletter_list": name,
"email": email
}).insert()
}).insert(ignore_permissions = frappe.flags.ignore_permissions)
count += 1
else:

View File

@@ -6,8 +6,6 @@ from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Newletter List')
class TestNewletterList(unittest.TestCase):
def test_import(self):
new_list = frappe.get_doc({
@@ -15,13 +13,13 @@ class TestNewletterList(unittest.TestCase):
"title": "_Test Newsletter List 1"
}).insert()
n_leads = frappe.db.count("Lead")
n_leads = frappe.db.sql("select count(distinct email_id) from `tabLead`")[0][0]
added = new_list.import_from("Lead")
self.assertEquals(added, n_leads)
frappe.delete_doc("Newsletter List", new_list.name)
def tearDown(self):
frappe.delete_doc("Newsletter List", "_Test Newsletter List 1")
test_dependencies = ["Lead"]

View File

@@ -2,20 +2,5 @@
{
"doctype": "Newsletter List",
"title": "_Test Newsletter List"
},
{
"doctype": "Newsletter List Subscriber",
"email": "test_subscriber1@example.com",
"newsletter_list": "_Test Newsletter List"
},
{
"doctype": "Newsletter List Subscriber",
"email": "test_subscriber2@example.com",
"newsletter_list": "_Test Newsletter List"
},
{
"doctype": "Newsletter List Subscriber",
"email": "test_subscriber3@example.com",
"newsletter_list": "_Test Newsletter List"
}
]

View File

@@ -10,4 +10,4 @@ class NewsletterListSubscriber(Document):
pass
def after_doctype_insert():
frappe.db.add_unique("Newsletter List Subscriber", ("name", "email"))
frappe.db.add_unique("Newsletter List Subscriber", ("newsletter_list", "email"))

View File

@@ -85,7 +85,7 @@
{
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
"in_list_view": 0,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Text",
@@ -134,7 +134,7 @@
],
"idx": 1,
"istable": 1,
"modified": "2015-05-14 14:55:18.325286",
"modified": "2015-06-02 14:18:16.622288",
"modified_by": "Administrator",
"module": "CRM",
"name": "Opportunity Item",

View File

@@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "5.0.6"
app_version = "5.0.18"
error_report_email = "support@erpnext.com"
@@ -34,20 +34,18 @@ website_context = {
website_route_rules = [
{"from_route": "/orders", "to_route": "Sales Order"},
{"from_route": "/orders/<name>", "to_route": "print", "defaults": {"doctype": "Sales Order"}},
{"from_route": "/orders/<path:name>", "to_route": "print", "defaults": {"doctype": "Sales Order"}},
{"from_route": "/invoices", "to_route": "Sales Invoice"},
{"from_route": "/invoices/<name>", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}},
{"from_route": "/invoices/<path:name>", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}},
{"from_route": "/shipments", "to_route": "Delivery Note"},
{"from_route": "/shipments/<name>", "to_route": "print", "defaults": {"doctype": "Delivery Note"}},
{"from_route": "/issues", "to_route": "Issue"},
{"from_route": "/issues/<name>", "to_route": "print", "defaults": {"doctype": "Issue"}},
{"from_route": "/addresses", "to_route": "Address"},
{"from_route": "/shipments/<path:name>", "to_route": "print", "defaults": {"doctype": "Delivery Note"}}
]
has_website_permission = {
"Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
"Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
"Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission"
"Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission",
"Issue": "erpnext.support.doctype.issue.issue.has_website_permission"
}
dump_report_map = "erpnext.startup.report_data_map.data_map"
@@ -96,8 +94,8 @@ scheduler_events = {
]
}
default_mail_footer = """<div style="padding: 7px; margin-top: 7px;">
<a style="color: #8D99A6; font-size: 85%; text-decoration: none;" href="https://erpnext.com" target="_blank">
default_mail_footer = """<div style="padding: 15px; text-align: center;">
<a href="https://erpnext.com?source=via_email_footer" target="_blank" style="color: #8d99a6;">
Sent via ERPNext
</a>
</div>"""

View File

@@ -23,9 +23,6 @@ class LeaveAllocation(Document):
def on_update(self):
self.get_total_allocated_leaves()
def on_cancel(self):
self.check_for_leave_application()
def validate_new_leaves_allocated_value(self):
"""validate that leave allocation is in multiples of 0.5"""
if flt(self.new_leaves_allocated) % 0.5:

View File

@@ -130,6 +130,7 @@
"description": "",
"fieldname": "leave_approver",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Leave Approver",
"options": "User",
"permlevel": 0
@@ -216,7 +217,7 @@
"idx": 1,
"is_submittable": 1,
"max_attachments": 3,
"modified": "2015-04-30 02:19:39.330689",
"modified": "2015-05-27 18:44:36.708614",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Application",

View File

@@ -24,4 +24,8 @@ cur_frm.cscript.to_date = function(doc, cdt, cdn) {
cur_frm.cscript.allocation_type = function (doc, cdt, cdn){
doc.no_of_days = '';
refresh_field('no_of_days');
}
}
frappe.ui.form.on("Leave Control Panel", "refresh", function(frm) {
frm.disable_save();
});

View File

@@ -94,11 +94,11 @@
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"hide_toolbar": 1,
"icon": "icon-cog",
"idx": 1,
"issingle": 1,
"modified": "2015-02-05 05:11:40.791976",
"modified": "2015-06-05 11:38:19.994852",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Control Panel",
@@ -110,7 +110,7 @@
"read": 1,
"report": 0,
"role": "HR User",
"share": 1,
"share": 0,
"submit": 0,
"write": 1
}

View File

@@ -43,3 +43,8 @@ cur_frm.cscript.make_jv = function(doc, dt, dn) {
frappe.set_route("Form", doc.doctype, doc.name);
});
}
frappe.ui.form.on("Salary Manager", "refresh", function(frm) {
frm.disable_save();
});

View File

@@ -150,10 +150,11 @@
"permlevel": 0
}
],
"hide_toolbar": 1,
"icon": "icon-cog",
"idx": 1,
"issingle": 1,
"modified": "2015-02-25 07:21:04.778082",
"modified": "2015-06-05 11:33:00.152362",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Manager",

View File

@@ -12,6 +12,9 @@ class TestSalarySlip(unittest.TestCase):
def setUp(self):
frappe.db.sql("""delete from `tabLeave Application`""")
frappe.db.sql("""delete from `tabSalary Slip`""")
frappe.db.set_value("Holiday List", "_Test Holiday List", "is_default", 1)
from erpnext.hr.doctype.leave_application.test_leave_application import _test_records as leave_applications
la = frappe.copy_doc(leave_applications[2])
la.insert()
@@ -26,6 +29,7 @@ class TestSalarySlip(unittest.TestCase):
frappe.db.set_value("HR Settings", "HR Settings", "include_holidays_in_total_working_days", 1)
ss = frappe.copy_doc(test_records[0])
ss.insert()
self.assertEquals(ss.total_days_in_month, 31)
self.assertEquals(ss.payment_days, 30)
self.assertEquals(ss.earnings[0].e_modified_amount, 14516.13)
@@ -36,8 +40,10 @@ class TestSalarySlip(unittest.TestCase):
self.assertEquals(ss.net_pay, 14867.74)
def test_salary_slip_with_holidays_excluded(self):
frappe.db.set_value("HR Settings", "HR Settings", "include_holidays_in_total_working_days", 0)
ss = frappe.copy_doc(test_records[0])
ss.insert()
self.assertEquals(ss.total_days_in_month, 30)
self.assertEquals(ss.payment_days, 29)
self.assertEquals(ss.earnings[0].e_modified_amount, 14500)
@@ -102,6 +108,6 @@ class TestSalarySlip(unittest.TestCase):
return salary_slip
test_dependencies = ["Leave Application"]
test_dependencies = ["Leave Application", "Holiday List"]
test_records = frappe.get_test_records('Salary Slip')

View File

@@ -12,6 +12,7 @@ erpnext.hr.AttendanceControlPanel = frappe.ui.form.Controller.extend({
},
refresh: function() {
this.frm.disable_save();
this.show_upload();
},

View File

@@ -1,4 +1,5 @@
{
"allow_copy": 1,
"creation": "2013-01-25 11:34:53",
"docstatus": 0,
"doctype": "DocType",
@@ -53,11 +54,13 @@
"permlevel": 0
}
],
"hide_heading": 0,
"hide_toolbar": 1,
"icon": "icon-upload-alt",
"idx": 1,
"issingle": 1,
"max_attachments": 1,
"modified": "2015-02-05 05:11:48.540845",
"modified": "2015-06-05 11:37:04.348120",
"modified_by": "Administrator",
"module": "HR",
"name": "Upload Attendance",
@@ -65,25 +68,25 @@
"permissions": [
{
"create": 1,
"email": 1,
"email": 0,
"permlevel": 0,
"print": 1,
"print": 0,
"read": 1,
"report": 0,
"role": "HR User",
"share": 1,
"share": 0,
"submit": 0,
"write": 1
},
{
"create": 1,
"email": 1,
"email": 0,
"permlevel": 0,
"print": 1,
"print": 0,
"read": 1,
"report": 0,
"role": "HR Manager",
"share": 1,
"share": 0,
"submit": 0,
"write": 1
}

View File

@@ -1,27 +1,36 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
// On REFRESH
frappe.provide("erpnext.bom");
cur_frm.cscript.refresh = function(doc,dt,dn){
cur_frm.toggle_enable("item", doc.__islocal);
toggle_operations(cur_frm);
if (!doc.__islocal && doc.docstatus<2) {
cur_frm.add_custom_button(__("Update Cost"), cur_frm.cscript.update_cost);
}
}
frappe.ui.form.on("BOM", {
onload_post_render: function(frm) {
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
},
refresh: function(frm) {
frm.toggle_enable("item", frm.doc.__islocal);
toggle_operations(frm);
cur_frm.cscript.update_cost = function() {
return frappe.call({
doc: cur_frm.doc,
method: "update_cost",
freeze: true,
callback: function(r) {
if(!r.exc) cur_frm.refresh_fields();
if (!frm.doc.__islocal && frm.doc.docstatus<2) {
frm.add_custom_button(__("Update Cost"), function() {
frm.events.update_cost(frm);
});
frm.add_custom_button(__("Browse BOM"), function() {
frappe.set_route("bom-browser", frm.doc.name);
});
}
})
}
},
update_cost: function(frm) {
return frappe.call({
doc: frm.doc,
method: "update_cost",
freeze: true,
callback: function(r) {
if(!r.exc) frm.refresh_fields();
}
})
}
});
cur_frm.add_fetch("item", "description", "description");
cur_frm.add_fetch("item", "image", "image");
@@ -35,7 +44,6 @@ cur_frm.cscript.hour_rate = function(doc, dt, dn) {
}
cur_frm.cscript.time_in_mins = cur_frm.cscript.hour_rate;
cur_frm.cscript.fixed_cycle_cost = cur_frm.cscript.hour_rate;
cur_frm.cscript.item_code = function(doc, cdt, cdn) {
get_bom_material_detail(doc, cdt, cdn);

View File

@@ -424,6 +424,6 @@ def validate_bom_no(item, bom_no):
if bom.docstatus != 1:
if not getattr(frappe.flags, "in_test", False):
frappe.throw(_("BOM {0} must be submitted").format(bom_no))
if item and not (bom.item == item or \
bom.item == frappe.db.get_value("Item", item, "variant_of")):
if item and not (bom.item.lower() == item.lower() or \
bom.item.lower() == cstr(frappe.db.get_value("Item", item, "variant_of")).lower()):
frappe.throw(_("BOM {0} does not belong to Item {1}").format(bom_no, item))

View File

@@ -10,3 +10,5 @@ frappe.listview_settings['BOM'] = {
}
}
};
frappe.help.youtube_id["BOM"] = "hDV0c1OeWLo";

View File

@@ -35,18 +35,20 @@ frappe.ui.form.on("Production Order", "additional_operating_cost", function(frm)
frappe.ui.form.on("Production Order Operation", "workstation", function(frm, cdt, cdn) {
var d = locals[cdt][cdn];
frappe.call({
"method": "frappe.client.get",
args: {
doctype: "Workstation",
name: d.workstation
},
callback: function (data) {
frappe.model.set_value(d.doctype, d.name, "hour_rate", data.message.hour_rate);
erpnext.production_order.calculate_cost(frm.doc);
erpnext.production_order.calculate_total_cost(frm);
}
})
if (d.workstation) {
frappe.call({
"method": "frappe.client.get",
args: {
doctype: "Workstation",
name: d.workstation
},
callback: function (data) {
frappe.model.set_value(d.doctype, d.name, "hour_rate", data.message.hour_rate);
erpnext.production_order.calculate_cost(frm.doc);
erpnext.production_order.calculate_total_cost(frm);
}
})
}
});
frappe.ui.form.on("Production Order Operation", "time_in_mins", function(frm, cdt, cdn) {

View File

@@ -176,18 +176,18 @@ class ProductionOrder(Document):
self.set('operations', [])
operations = frappe.db.sql("""select operation, description, workstation, idx,
hour_rate, time_in_mins, "Pending" as status from `tabBOM Operation`
hour_rate, time_in_mins, "Pending" as status from `tabBOM Operation`
where parent = %s order by idx""", self.bom_no, as_dict=1)
self.set('operations', operations)
self.calculate_time()
def calculate_time(self):
bom_qty = frappe.db.get_value("BOM", self.bom_no, "quantity")
for d in self.get("operations"):
d.time_in_mins = flt(d.time_in_mins) / flt(bom_qty) * flt(self.qty)
self.calculate_operating_cost()
def get_holidays(self, workstation):
@@ -220,7 +220,9 @@ class ProductionOrder(Document):
time_log = make_time_log(self.name, d.operation, d.planned_start_time, d.planned_end_time,
flt(self.qty) - flt(d.completed_qty), self.project_name, d.workstation, operation_id=d.name)
self.check_operation_fits_in_working_hours(d)
if d.workstation:
# validate operating hours if workstation [not mandatory] is specified
self.check_operation_fits_in_working_hours(d)
original_start_time = time_log.from_time
while True:

View File

@@ -130,10 +130,9 @@ class TestProductionOrder(unittest.TestCase):
prod_order = make_prod_order_test_record(item="_Test FG Item 2",
planned_start_date="2014-11-25 00:00:00", qty=1, do_not_save=True)
prod_order.set_production_order_operations()
prod_order.save()
cost = prod_order.planned_operating_cost
prod_order.qty = 2
prod_order.save()
prod_order.set_production_order_operations()
self.assertEqual(prod_order.planned_operating_cost, cost*2)
def make_prod_order_test_record(**args):

View File

@@ -33,7 +33,7 @@
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -293,7 +293,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-04-22 03:25:18.542350",
"modified": "2015-05-21 13:46:27.730392",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order Operation",

View File

@@ -1,4 +1,5 @@
{
"allow_copy": 1,
"creation": "2013-01-21 12:03:47",
"default_print_format": "Standard",
"docstatus": 0,
@@ -154,11 +155,12 @@
"permlevel": 0
}
],
"hide_toolbar": 1,
"icon": "icon-calendar",
"idx": 1,
"in_create": 1,
"issingle": 1,
"modified": "2015-02-05 05:11:43.010625",
"modified": "2015-06-05 11:44:31.629114",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Planning Tool",

View File

@@ -359,10 +359,7 @@ class ProductionPlanningTool(Document):
def insert_purchase_request(self):
items_to_be_requested = self.get_requested_items()
from erpnext.accounts.utils import get_fiscal_year
fiscal_year = get_fiscal_year(nowdate())[0]
purchase_request_list = []
if items_to_be_requested:
for item in items_to_be_requested:
@@ -372,7 +369,6 @@ class ProductionPlanningTool(Document):
"transaction_date": nowdate(),
"status": "Draft",
"company": self.company,
"fiscal_year": fiscal_year,
"requested_by": frappe.session.user,
"material_request_type": "Purchase"
})

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, cint, getdate, formatdate, comma_and, time_diff_in_seconds, get_datetime
from frappe.utils import flt, cint, getdate, formatdate, comma_and, time_diff_in_seconds, to_timedelta
from frappe.model.document import Document
from dateutil.parser import parse
@@ -60,7 +60,7 @@ def is_within_operating_hours(workstation, operation, from_datetime, to_datetime
workstation = frappe.get_doc("Workstation", workstation)
for working_hour in workstation.working_hours:
slot_length = (get_datetime(working_hour.end_time) - get_datetime(working_hour.start_time)).total_seconds()
slot_length = (to_timedelta(working_hour.end_time or "") - to_timedelta(working_hour.start_time or "")).total_seconds()
if slot_length >= operation_length:
return

View File

View File

@@ -0,0 +1,90 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.pages['bom-browser'].on_page_load = function(wrapper) {
var page = frappe.ui.make_app_page({
parent: wrapper,
title: 'BOM Browser',
single_column: true
});
page.main.css({
"min-height": "300px",
"padding-bottom": "25px"
});
page.tree_area = $('<div class="padding"><p class="text-muted">'+
__("Select BOM to start")
+'</p></div>').appendTo(page.main);
frappe.breadcrumbs.add(frappe.breadcrumbs.last_module || "Manufacturing");
var make_tree = function() {
erpnext.bom_tree = new erpnext.BOMTree(page.$bom_select.val(), page, page.tree_area);
}
page.$bom_select = wrapper.page.add_field({fieldname: "bom",
fieldtype:"Link", options: "BOM", label: __("BOM")}).$input
.change(function() {
make_tree();
});
page.set_secondary_action(__('Refresh'), function() {
make_tree();
});
}
frappe.pages['bom-browser'].on_page_show = function(wrapper){
// set from route
var bom = null;
if(frappe.get_route()[1]) {
var bom = frappe.get_route().splice(1).join("/");
}
if(frappe.route_options && frappe.route_options.bom) {
var bom = frappe.route_options.bom;
}
if(bom) {
wrapper.page.$bom_select.val(bom).trigger("change");
}
};
erpnext.BOMTree = Class.extend({
init: function(root, page, parent) {
$(parent).empty();
var me = this;
me.page = page;
me.bom = page.$bom_select.val();
me.can_read = frappe.model.can_read("BOM");
me.can_create = frappe.boot.user.can_create.indexOf("BOM") !== -1 ||
frappe.boot.user.in_create.indexOf("BOM") !== -1;
me.can_write = frappe.model.can_write("BOM");
me.can_delete = frappe.model.can_delete("BOM");
this.tree = new frappe.ui.Tree({
parent: $(parent),
label: me.bom,
args: {parent: me.bom},
method: 'erpnext.manufacturing.page.bom_browser.bom_browser.get_children',
toolbar: [
{toggle_btn: true},
{
label:__("Edit"),
condition: function(node) {
return node.expandable;
},
click: function(node) {
frappe.set_route("Form", "BOM", node.data.parent);
}
}
],
get_label: function(node) {
if(node.data.qty) {
return node.data.qty + " x " + node.data.value;
} else {
return node.data.value;
}
}
});
}
});

View File

@@ -0,0 +1,21 @@
{
"content": null,
"creation": "2015-05-25 02:57:33.472044",
"docstatus": 0,
"doctype": "Page",
"modified": "2015-05-25 02:57:33.472044",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "bom-browser",
"owner": "Administrator",
"page_name": "bom-browser",
"roles": [
{
"role": "Manufacturing User"
}
],
"script": null,
"standard": "Yes",
"style": null,
"title": "BOM Browser"
}

View File

@@ -0,0 +1,15 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def get_children(parent):
return frappe.db.sql("""select item_code as value,
bom_no as parent, qty,
if(ifnull(bom_no, "")!="", 1, 0) as expandable
from `tabBOM Item`
where parent=%s
order by idx
""", parent, as_dict=True)

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