Compare commits

...

380 Commits

Author SHA1 Message Date
Nabin Hait
50e363b24e Merge branch 'develop' 2015-07-02 15:28:49 +05:30
Nabin Hait
bc176b6bf8 bumped to version 5.1.0 2015-07-02 15:58:49 +06:00
Nabin Hait
784b49e54e change log 2015-07-02 15:28:15 +05:30
Nabin Hait
04fb6e1a45 Merge pull request #3558 from nabinhait/develop
Change log
2015-07-02 15:22:20 +05:30
Nabin Hait
dffd7c3889 Change log 2015-07-02 15:21:25 +05:30
Nabin Hait
0c7594e5ed Merge pull request #3557 from rmehta/item-description-in-form
[fix] show item description in form grid based on in_list_view
2015-07-02 15:19:24 +05:30
Rushabh Mehta
5105f909d6 [fix] show item description in form grid based on in_list_view 2015-07-02 15:09:18 +05:30
Nabin Hait
2ab9d6e92c Merge pull request #3552 from nabinhait/develop
Recurring docs should not consider Stopped documents and should be scheduled for hourly
2015-07-02 14:42:57 +05:30
Nabin Hait
7580723ab3 Recurring docs should not consider Stopped documents and should be scheduled for hourly 2015-07-02 14:41:27 +05:30
Nabin Hait
52fef71c14 Merge pull request #3543 from rmehta/against-account-fix
Fix against account to show party instead of account
2015-07-02 14:28:11 +05:30
Rushabh Mehta
2cd02af80a [fix] patch date 2015-07-02 14:25:51 +05:30
Rushabh Mehta
0b0ec3536c [change-log] added 2015-07-02 14:25:51 +05:30
Rushabh Mehta
6b35ea873b [fix] against account in general ledger will show party 2015-07-02 14:25:51 +05:30
Nabin Hait
ecf220a721 Merge pull request #3549 from neilLasrado/item-varients
Validation changed for Item Template cannot have Stock
2015-07-02 14:18:31 +05:30
Nabin Hait
04fb1c7fe4 Merge pull request #3550 from neilLasrado/item-desc
Image feild added to Sales Invoice & Purchase Invoice
2015-07-02 14:17:52 +05:30
Neil Trini Lasrado
53bd62eafc Validation changed for Item Template cannot have Stock 2015-07-02 14:15:23 +05:30
Nabin Hait
ff68bf2609 Merge pull request #3551 from nabinhait/develop
Fixes
2015-07-02 14:10:58 +05:30
Nabin Hait
fdd0db3459 Update project completion percentage and costing after syncing task 2015-07-02 14:09:49 +05:30
Nabin Hait
f92465981c datetime issue fixed in maintenance schedule 2015-07-02 14:09:49 +05:30
Nabin Hait
885c70984d [fix] Always show Sales invoice in Gross profit report 2015-07-02 14:09:49 +05:30
Neil Trini Lasrado
9c15ef903d Image feild added to Sales Invoice & Purchase Invoice 2015-07-02 13:09:57 +05:30
Rushabh Mehta
bc799885d0 [fix] bom client script 2015-07-02 12:44:16 +05:30
Nabin Hait
cb129264cb Merge pull request #3386 from neilLasrado/item-varients
[redesign] Manage Item varients
2015-07-01 18:29:04 +05:30
Neil Trini Lasrado
fe9cd1d875 More Fixes in Manage Varients 2015-07-01 14:41:30 +05:30
Neil Trini Lasrado
64fbe955c7 Modified Date changed for Item Doctype 2015-07-01 14:04:00 +05:30
Neil Trini Lasrado
0988440fd9 Fixes for Manage Variants 2015-07-01 13:17:15 +05:30
Neil Trini Lasrado
274dd4ada0 Fixed Manage Variants Attribute autocomplete appearance. 2015-07-01 12:51:40 +05:30
Neil Trini Lasrado
724fd82419 Fixes in Manage Variants 2015-07-01 12:51:40 +05:30
Neil Trini Lasrado
3f2604eff6 Patch for Item Variants 2015-07-01 12:51:40 +05:30
Neil Trini Lasrado
c761fefb78 more fixes in test records 2015-07-01 12:51:11 +05:30
Neil Trini Lasrado
203cb10ef7 fixes in test cases 2015-07-01 12:51:11 +05:30
Neil Trini Lasrado
90c66b1998 test cases added 2015-07-01 12:51:11 +05:30
Neil Trini Lasrado
fed431f908 Code Fixes in Manage Variants 2015-07-01 12:51:11 +05:30
Neil Trini Lasrado
bd9745ba72 Rename Item Variant from Manage Variants feature Added. 2015-07-01 12:51:11 +05:30
Neil Trini Lasrado
8fb123b20e item variants, creation, deleation and update logic added.
logic added to copy changes in template to variants
2015-07-01 12:51:11 +05:30
Neil Trini Lasrado
333ccd212b variants combination generation logic added 2015-07-01 12:51:10 +05:30
Neil Trini Lasrado
c8cc8b7115 manage variants new doctype created 2015-07-01 12:51:10 +05:30
Nabin Hait
ec44fa95ce Merge pull request #3537 from neilLasrado/project
Fixed Issues in Project Task
2015-06-30 17:29:19 +05:30
Neil Trini Lasrado
a25e8ea0bc Fixed Issues in Project Task 2015-06-30 17:15:13 +05:30
Rushabh Mehta
ea02b9a5c3 Merge pull request #3530 from anandpdoshi/anand-june-29
[fix] Item Variant Attribute autocomplete appearance. Fixes #3488, #3515, #3525
2015-06-30 13:05:19 +05:30
Rushabh Mehta
74a63bf003 Merge pull request #3531 from pdvyas/exchange-rate-api
Change currency exchange rate api to fixer.io
2015-06-30 12:46:52 +05:30
Pratik Vyas
a0f2510b01 Change currency exchange rate api to fixer.io 2015-06-30 12:36:17 +05:30
Anand Doshi
0820161157 [fix] Item Variant Attribute autocomplete appearance. Fixes #3488, #3515, #3525 2015-06-29 20:57:06 -07:00
Nabin Hait
56bc215855 Merge pull request #3505 from neilLasrado/print-format
Recurring Invoice Print Format
2015-06-29 18:54:24 +05:30
Nabin Hait
8687d25f7e Merge pull request #3526 from neilLasrado/minor-fixes
Minor fixes
2015-06-29 18:53:10 +05:30
Nabin Hait
9cea01fa8b Merge pull request #3527 from nabinhait/develop
Journal Entry list view and delete events via query
2015-06-29 18:39:43 +05:30
Nabin Hait
e06d01e3ed Delete events via query instead of delete_doc function, to save time 2015-06-29 18:38:38 +05:30
Nabin Hait
11243a4fb4 Show amount in Journal Entry list view 2015-06-29 18:38:38 +05:30
Neil Trini Lasrado
b9e5cd0df4 Fixed lead status not updating on Creation of oppurtunity issue 2015-06-29 17:01:32 +05:30
Neil Trini Lasrado
a1f1edc786 Typo fixes in Sales Person 2015-06-29 16:04:12 +05:30
Neil Trini Lasrado
e2d8dd0663 added recurring print format to sales/purchase invoice and order 2015-06-29 12:50:41 +05:30
Nabin Hait
d1605c5cb2 Merge branch 'develop' 2015-06-27 13:09:05 +05:30
Nabin Hait
64ca52fb77 bumped to version 5.0.29 2015-06-27 13:39:05 +06:00
Nabin Hait
2f11a3bdaf Merge pull request #3523 from nabinhait/develop
Multiple fixes
2015-06-27 13:07:44 +05:30
Nabin Hait
943dc1f59c Merge branch 'develop' 2015-06-27 13:07:01 +05:30
Nabin Hait
6d1c994bc9 bumped to version 5.0.28 2015-06-27 13:37:01 +06:00
Nabin Hait
93cdee4503 [fix] Escape values in queries 2015-06-27 12:51:00 +05:30
Nabin Hait
dfac6848cc In list view property added in BOM 2015-06-26 14:42:51 +05:30
Nabin Hait
8ad0b4e0b9 Show Issue id in list view from customer login 2015-06-26 14:42:51 +05:30
Nabin Hait
b8cd92f1aa Merge pull request #3517 from neilLasrado/batch
Added validation to prevent transfer of raw material from an expired …
2015-06-25 18:20:46 +05:30
Nabin Hait
1fe48cb820 Merge pull request #3514 from anandpdoshi/anand-june-24
[fix] Use per_billed instead of per_delivered and per_received for open notification
2015-06-25 18:04:26 +05:30
Anand Doshi
723b046c5b [fix] Use per_billed instead of per_delivered and per_received for open notification 2015-06-24 19:21:52 -04:00
Neil Trini Lasrado
035160c9a6 Added validation to prevent transfer of raw material from an expired batch for manufacturing 2015-06-24 15:25:57 +05:30
Nabin Hait
01c7ce1da3 Merge pull request #3508 from nabinhait/develop
[fix] validate items in stock entry for subcontracting against PO
2015-06-23 11:12:23 +05:30
Nabin Hait
9cf2910ba1 [fix] validate items in stock entry for subcontracting against purchase order 2015-06-23 11:07:34 +05:30
Nabin Hait
c8da7b7d32 Merge branch 'develop' 2015-06-23 10:27:59 +05:30
Nabin Hait
9679d31397 bumped to version 5.0.27 2015-06-23 10:57:59 +06:00
Nabin Hait
38bebe1b83 Merge pull request #3503 from neilLasrado/leave-application
Fixed bugs in Calender View for Leave Application
2015-06-22 19:32:16 +05:30
Nabin Hait
ffbc11e8de Merge pull request #3504 from nabinhait/develop
Multiple fixes
2015-06-22 19:29:32 +05:30
Nabin Hait
818d9674d9 [fix] Update outstanding amount function fixed if party not mentioned 2015-06-22 18:21:38 +05:30
Neil Trini Lasrado
086f8942eb Fixed bugs in Calender View for Leave Application 2015-06-22 13:51:56 +05:30
Nabin Hait
c3b492b237 [fix] Auto remarks in Journal Entry based on company currency 2015-06-22 07:52:38 +05:30
Nabin Hait
9d0dd5066a Removed 'Root Type' validation for receivable/payable account in sales/purchase invoice 2015-06-22 07:32:46 +05:30
Nabin Hait
e7f479b26a Validate accounting entry agaist Stock account if perpetual inventory enabled 2015-06-22 07:31:49 +05:30
Nabin Hait
7ee45b4af2 [fix] Batch-wise balance history: show records only with batch-id 2015-06-18 15:29:14 +05:30
Nabin Hait
5cce1e0929 Merge pull request #3489 from nabinhait/develop
Opening balance
2015-06-18 10:34:31 +05:30
Nabin Hait
be496bc91c [fix] Trial Balance opening 2015-06-18 10:33:20 +05:30
Nabin Hait
59f063e5c3 [fix] opening balance in general ledger report 2015-06-18 10:33:20 +05:30
Nabin Hait
af5820874c Merge branch 'develop' 2015-06-17 15:51:00 +05:30
Nabin Hait
495db99719 bumped to version 5.0.26 2015-06-17 16:21:00 +06:00
Nabin Hait
123beb5a07 Merge pull request #3484 from rmehta/bom-search-report
[report] BOM Search
2015-06-17 15:38:39 +05:30
Nabin Hait
7ed4e080a2 Merge pull request #3486 from nabinhait/develop
Opening balance
2015-06-17 15:36:06 +05:30
Nabin Hait
e91025c0aa [fix] Opening balance in trial balance and general ledger based on is_opening 2015-06-17 15:35:06 +05:30
Nabin Hait
1ac9f2f50d [fix] Opening balance in trial balance and general ledger based on is_opening 2015-06-17 15:09:40 +05:30
Nabin Hait
bd9aa13db3 Minor issue in naming series 2015-06-17 15:09:40 +05:30
Rushabh Mehta
ed9d5cfdaf [minor] cleanup 2015-06-17 02:13:03 +05:30
Rushabh Mehta
bf4547ca5f [fix] dynamic link in BOM Search report 2015-06-17 02:12:06 +05:30
Rushabh Mehta
b45a6bcb88 [report] BOM Search 2015-06-17 01:54:56 +05:30
Anand Doshi
ac59c2b300 [minor] clear Item's introduction section on refresh 2015-06-16 13:06:48 -04:00
Nabin Hait
6a8d7a1b91 Merge branch 'develop' 2015-06-16 16:50:49 +05:30
Nabin Hait
5d71a28e97 bumped to version 5.0.25 2015-06-16 17:20:49 +06:00
Nabin Hait
7d100a1ee7 Merge pull request #3480 from nabinhait/develop
Indexes
2015-06-16 16:49:26 +05:30
Nabin Hait
81dca110eb Change log added 2015-06-16 16:48:47 +05:30
Nabin Hait
9c852108d0 Added index in sales/purchase invoice and fix in index patch 2015-06-16 16:48:47 +05:30
Nabin Hait
e3ac032696 Merge pull request #3472 from neilLasrado/po
Multiple Fixes
2015-06-16 15:52:48 +05:30
Neil Trini Lasrado
64cacfb077 Fixes in Activity Cost 2015-06-16 15:42:40 +05:30
Neil Trini Lasrado
ae4cc078ea Activity Cost - Mandatory removed for Employee. 2015-06-16 15:30:08 +05:30
Nabin Hait
0ee543e932 Merge pull request #3479 from nabinhait/develop
[fix][report] Payment period based on invoice date
2015-06-16 15:29:14 +05:30
Nabin Hait
a123638d37 [fix][report] Payment period based on invoice date 2015-06-16 15:21:00 +05:30
Nabin Hait
58996985ed Merge pull request #3476 from nabinhait/develop
Expense Approver Query and discount label
2015-06-16 15:01:08 +05:30
Nabin Hait
5d0ce7939f Show only users with Expense Approver role in Expense Claim Approver field 2015-06-15 17:59:37 +05:30
Neil Trini Lasrado
4abf552d7b Over Production Allowance Percentage Setting added to Manufacturing Settings 2015-06-15 15:58:45 +05:30
Nabin Hait
7c5ba957ac Label changed for discount amount in base currency 2015-06-15 15:47:07 +05:30
Nabin Hait
77f04e293a Merge branch 'develop' 2015-06-15 10:35:39 +05:30
Nabin Hait
d1d3237784 bumped to version 5.0.24 2015-06-15 11:05:39 +06:00
Nabin Hait
76f0d26f1e Merge pull request #3471 from nabinhait/develop
Hotfix
2015-06-15 10:32:23 +05:30
Nabin Hait
65922d3079 [fix] supplier invoice date can not be after posting date 2015-06-15 10:23:53 +05:30
Nabin Hait
810041cbe3 [fix] Fixed error due to performance upgrade cleanup 2015-06-15 10:20:11 +05:30
Nabin Hait
b9626659ea Merge pull request #3465 from neilLasrado/po
Po
2015-06-15 10:04:36 +05:30
Nabin Hait
e3d13bee36 Merge pull request #3467 from anandpdoshi/anand-june-12
Fixes
2015-06-15 10:03:20 +05:30
Nabin Hait
13bd538aca Merge branch 'develop' 2015-06-14 22:04:51 +05:30
Nabin Hait
d72a24965b bumped to version 5.0.23 2015-06-14 22:34:51 +06:00
Nabin Hait
dc633fe360 Merge pull request #3470 from nabinhait/develop
Performance upgrade in reports and indexing
2015-06-14 22:01:30 +05:30
Nabin Hait
39046d663d [patch] Add index on Account and GL Entry table 2015-06-14 20:59:28 +05:30
Nabin Hait
6b01abe9ad [report][performance] Speed increased by approx 10 times in Trial Balance, General Ledger, AR/AP, Balance Sheet and P&L Statement 2015-06-14 20:59:28 +05:30
Anand Doshi
63e4d31aa6 [fix] Task should be mandatory in Time Log only when Project is mentioned but Production Order is not 2015-06-12 18:59:18 -04:00
Anand Doshi
f2a0161709 [fix] Don't create Time Logs against Production Order if Workstation is not specified in Operations 2015-06-12 18:58:36 -04:00
Neil Trini Lasrado
3c1a4a0b9b percent_complete made no-copy in Project 2015-06-12 18:34:08 +05:30
Neil Trini Lasrado
82cc2921d1 Validation added to prevent user from creating salary structure with 'From Date' before employee 'Date of joining' 2015-06-12 18:34:08 +05:30
Nabin Hait
87edd86854 Merge branch 'develop' 2015-06-12 18:06:21 +05:30
Nabin Hait
e37dd77923 bumped to version 5.0.22 2015-06-12 18:36:21 +06:00
Nabin Hait
e4f689184f Merge pull request #3459 from neilLasrado/po
Multiple Fixes.
2015-06-12 17:55:23 +05:30
Nabin Hait
85f825e98c Merge pull request #3463 from nabinhait/develop
multiple issues
2015-06-12 17:48:54 +05:30
Nabin Hait
89592c5180 Load tasks in project for printing purpose 2015-06-12 17:37:28 +05:30
Neil Trini Lasrado
587bd144d5 Added Customers Not Buying Since Long Time against Sales Invoice 2015-06-11 18:36:52 +05:30
Neil Trini Lasrado
1f048b2426 Fixes in Activity Cost 2015-06-11 18:36:52 +05:30
Neil Trini Lasrado
1792ff3be7 Validation added in Purchase Invoice to check if Supplier Invoice Date is greater than Posting Date
Check Supplier Invoice Number Uniqueness setting added to Accounts Settings
Validation added in Purchase Invoice to check Supplier Invoice Number Uniqueness if Check Supplier Invoice Number Uniqueness is enabled in Accounts Settings
2015-06-11 18:36:52 +05:30
Neil Trini Lasrado
fc595064e0 validation added to prevent Delivery Date in Porduction Order to be lesser than Planned Start Date 2015-06-11 18:36:52 +05:30
Nabin Hait
804b4acb9b [fix] Issue fixed in C-Form related to field renaming 2015-06-11 16:56:36 +05:30
Nabin Hait
5c7557914b Removed BOM No from mandatory from Stock Entry against Production Order 2015-06-11 16:50:35 +05:30
Nabin Hait
381a9377d9 Merge branch 'develop' 2015-06-11 16:14:48 +05:30
Nabin Hait
9bdd1aa1ed bumped to version 5.0.21 2015-06-11 16:44:48 +06:00
Nabin Hait
d0df28bfa0 Merge pull request #3458 from nabinhait/develop
[fix] load tasks in project via __setup__ instead of onload function, to return tasks via get_doc
2015-06-11 16:12:05 +05:30
Nabin Hait
1966225450 [fix] load tasks in project via __setup__ instead of onload function, to return tasks via get_doc 2015-06-11 15:31:47 +05:30
Nabin Hait
4cee27eec0 Merge pull request #3446 from anandpdoshi/anand-june-9
POS - search by Item Group
2015-06-10 18:42:14 +05:30
Nabin Hait
c7d4eaee79 Merge pull request #3442 from nabinhait/develop
fixes in stock entry and report
2015-06-10 18:40:42 +05:30
Nabin Hait
43c1a9b502 [fix] Quote url for item image in product listing page 2015-06-10 18:23:17 +05:30
Nabin Hait
b937fac3ce [report] Warehouse column added in 'Ordered Items to be Delivered' report 2015-06-10 18:21:57 +05:30
Nabin Hait
53d94996ad [fix] Query for Against Journal Entry 2015-06-10 18:20:18 +05:30
Anand Doshi
26f6752c1e POS - search by Item Group 2015-06-09 16:33:46 -04:00
Nabin Hait
bb429745c0 [fix] Blank option in naming series 2015-06-09 18:59:51 +05:30
Nabin Hait
909f0c38f1 [report][enhancement] Payment period based on invoice date: show party columns and filter based on party 2015-06-09 18:42:52 +05:30
Nabin Hait
a790ba05f4 [fix] Item name, description should not be overwritten on saving of stock entry 2015-06-09 18:42:52 +05:30
Nabin Hait
11fc4f85d0 Merge branch 'develop' 2015-06-09 15:56:20 +05:30
Nabin Hait
17452a1695 bumped to version 5.0.20 2015-06-09 16:26:20 +06:00
Nabin Hait
7c3d48e353 Merge pull request #3434 from neilLasrado/material-request
Status Indicators fixed in Material Request List
2015-06-09 15:47:46 +05:30
Neil Trini Lasrado
5d288e407c item variants patch removed 2015-06-09 15:46:57 +05:30
Neil Trini Lasrado
f64fae752f fixes 2015-06-09 15:46:57 +05:30
Neil Trini Lasrado
82763f052f Status Indicators fixed in Material Request List 2015-06-09 15:46:57 +05:30
Nabin Hait
bafc73568a Merge pull request #3435 from neilLasrado/barcode
Barcode added to Purchase Receipt
2015-06-09 15:44:09 +05:30
Neil Trini Lasrado
d015195617 fixes in barcode 2015-06-09 15:21:50 +05:30
Neil Trini Lasrado
b2f550ccb3 Barcode added to Purchase Receipt 2015-06-09 15:18:58 +05:30
Nabin Hait
41413af42d Merge pull request #3437 from anandpdoshi/task-close-assignment
[fix] Close assignment (ToDo) when Task status is changed to Closed
2015-06-09 15:00:06 +05:30
Anand Doshi
ec60ebde6f [fix] Close assignment (ToDo) when Task status is changed to Closed 2015-06-08 12:48:11 -04:00
Nabin Hait
ce81a61fe7 Merge branch 'develop' 2015-06-08 14:45:13 +05:30
Nabin Hait
dc76b3fa20 bumped to version 5.0.19 2015-06-08 15:15:13 +06:00
Nabin Hait
828cbee12a Merge pull request #3429 from neilLasrado/quality-inspection
Get Item Details in Quality Inspection.
2015-06-08 14:24:11 +05:30
Nabin Hait
5f5ef16b91 Merge pull request #3430 from nabinhait/develop
Multiple fixes
2015-06-08 14:23:52 +05:30
Nabin Hait
686ef8308a Show item name in item grid view based 'In List View' property 2015-06-08 14:22:56 +05:30
Nabin Hait
b63ad44b10 Book in round-off account upto max 0.05 2015-06-08 14:15:12 +05:30
Nabin Hait
5ef121bc10 get party details only if party exists 2015-06-08 14:15:11 +05:30
Neil Trini Lasrado
42c1836db5 function changed to add fetch 2015-06-08 13:09:11 +05:30
Neil Trini Lasrado
9dbdef3bd5 added code to fetch item name and desc on change of item code 2015-06-08 12:29:12 +05:30
Nabin Hait
9fd42ed2f7 Merge pull request #3428 from nabinhait/develop
[fix] Fiscal year issue due to missing field in Material Request
2015-06-08 12:27:27 +05:30
Nabin Hait
000835c454 [fix] Fiscal year issue due to missing field in Material Request 2015-06-08 12:10:43 +05:30
Nabin Hait
de1f934e22 Merge pull request #3422 from nabinhait/develop
Manufactured qty in Stock Entry
2015-06-08 12:07:47 +05:30
Nabin Hait
7cbd916b00 [fix] Fiscal year issue due to missing field in Material Request 2015-06-08 12:06:33 +05:30
Nabin Hait
56fcf30cb9 [Patch] Update material transferred for manufacturing for existing entries 2015-06-05 18:21:35 +05:30
Nabin Hait
ebbdd772a9 [fix] Validate and update manufactured qty in Stock Entry 2015-06-05 18:21:35 +05:30
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
Pratik Vyas
815cb8959a Merge branch 'develop' 2015-05-20 16:35:40 +05:30
Pratik Vyas
38937ecd3c bumped to version 5.0.6 2015-05-20 17:05:40 +06:00
Rushabh Mehta
a27cca97b5 [rename] POS Setting > POS Profile #3271 2015-05-20 15:43:17 +05:30
Nabin Hait
521aa2e94a Update party_model.py 2015-05-20 14:39:39 +05:30
Nabin Hait
390df6626b Merge pull request #3298 from nabinhait/develop
party model patch fix
2015-05-20 14:34:42 +05:30
Nabin Hait
a2d8585b07 party model patch fix 2015-05-20 14:32:54 +05:30
Pratik Vyas
84e658058b Merge branch 'develop' 2015-05-20 12:54:52 +05:30
Pratik Vyas
10e813b010 bumped to version 5.0.5 2015-05-20 13:24:52 +06:00
Nabin Hait
a7bd8ee34b Update utils.py 2015-05-20 12:53:04 +05:30
Pratik Vyas
90a51225a4 Merge branch 'develop' 2015-05-20 12:27:47 +05:30
Pratik Vyas
8980ce6052 bumped to version 5.0.4 2015-05-20 12:57:47 +06:00
Nabin Hait
c0f56de971 Merge pull request #3297 from nabinhait/develop
validate diabled fiscal year
2015-05-20 12:26:44 +05:30
Nabin Hait
8d50eb32c1 validate diabled fiscal year 2015-05-20 12:26:21 +05:30
Nabin Hait
50bbc99889 Merge pull request #3296 from nabinhait/develop
validate disabled fiscal year
2015-05-20 12:21:51 +05:30
Nabin Hait
0cf9469f86 validate disabled fiscal year 2015-05-19 18:44:02 +05:30
Pratik Vyas
d13db9cd84 Merge branch 'develop' 2015-05-19 17:33:00 +05:30
Pratik Vyas
07b3bf6417 bumped to version 5.0.3 2015-05-19 18:03:00 +06:00
Nabin Hait
25ea307b9f Merge pull request #3289 from nabinhait/develop
Multiple fixes
2015-05-19 17:10:54 +05:30
Nabin Hait
8252117fe5 set tax amount also in base currency after manipulation 2015-05-19 16:30:17 +05:30
Nabin Hait
c602396366 validation message improved 2015-05-19 16:30:16 +05:30
Nabin Hait
f59d3a4e07 conversion rate fixes 2015-05-19 16:30:16 +05:30
Pratik Vyas
1a1ba38e95 Merge branch 'develop' 2015-05-19 15:45:57 +05:30
Pratik Vyas
80a116ab19 bumped to version 5.0.2 2015-05-19 16:15:57 +06:00
Nabin Hait
6684c470c5 Merge pull request #3287 from rmehta/customer-fix
Customer fix
2015-05-19 15:33:06 +05:30
Pratik Vyas
b8252bca00 bumped to version 5.0.1 2015-05-19 13:47:43 +06:00
Pratik Vyas
129a0a4cae Fix merge mistakes 2015-05-19 13:12:00 +05:30
Pratik Vyas
803e998e9d Fix merge mistakes 2015-05-19 13:08:54 +05:30
Rushabh Mehta
476019a930 [fix] throw name error for duplicate group 2015-05-19 13:03:01 +05:30
Rushabh Mehta
5495bc54a5 [enhancement] default terms in company, fixes #3231 2015-05-19 13:03:01 +05:30
309 changed files with 10797 additions and 9200 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__ = 'v5.0.0'
__version__ = '5.1.0'

View File

@@ -35,7 +35,7 @@
"permlevel": 0,
"read_only": 1,
"reqd": 1,
"search_index": 1
"search_index": 0
},
{
"default": "0",
@@ -44,7 +44,7 @@
"label": "Is Group",
"permlevel": 0,
"precision": "",
"search_index": 1
"search_index": 0
},
{
"fieldname": "company",
@@ -57,7 +57,7 @@
"permlevel": 0,
"read_only": 1,
"reqd": 1,
"search_index": 1
"search_index": 0
},
{
"fieldname": "root_type",
@@ -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
},
@@ -147,7 +147,8 @@
"label": "Lft",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "rgt",
@@ -156,7 +157,8 @@
"label": "Rgt",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "old_parent",
@@ -171,7 +173,7 @@
"icon": "icon-money",
"idx": 1,
"in_create": 0,
"modified": "2015-04-27 20:07:37.147184",
"modified": "2015-06-14 20:57:55.471334",
"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

@@ -4,6 +4,13 @@
"docstatus": 0,
"doctype": "DocType",
"fields": [
{
"fieldname": "check_supplier_invoice_uniqueness",
"fieldtype": "Check",
"label": "Check Supplier Invoice Number Uniqueness",
"permlevel": 0,
"precision": ""
},
{
"default": "1",
"description": "If enabled, the system will post accounting entries for inventory automatically.",
@@ -43,7 +50,7 @@
"icon": "icon-cog",
"idx": 1,
"issingle": 1,
"modified": "2015-02-05 05:11:34.163902",
"modified": "2015-06-11 06:06:34.047890",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

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

@@ -54,7 +54,7 @@ class CForm(Document):
frappe.throw(_("Please enter atleast 1 invoice in the table"))
def set_total_invoiced_amount(self):
total = sum([flt(d.base_grand_total) for d in self.get('invoices')])
total = sum([flt(d.grand_total) for d in self.get('invoices')])
frappe.db.set(self, 'total_invoiced_amount', total)
def get_invoice_details(self, invoice_no):

View File

@@ -48,7 +48,8 @@
"fieldtype": "Dynamic Link",
"label": "Party",
"options": "party_type",
"permlevel": 0
"permlevel": 0,
"search_index": 1
},
{
"fieldname": "cost_center",
@@ -192,7 +193,7 @@
"icon": "icon-list",
"idx": 1,
"in_create": 1,
"modified": "2015-04-27 20:32:48.246818",
"modified": "2015-06-14 20:57:19.800276",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",

View File

@@ -4,14 +4,14 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, fmt_money, getdate, formatdate
from frappe.utils import flt, fmt_money, getdate, formatdate, cstr
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()
@@ -118,7 +118,7 @@ def update_outstanding_amt(account, party_type, party, against_voucher_type, aga
bal = flt(frappe.db.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
from `tabGL Entry`
where against_voucher_type=%s and against_voucher=%s
and account = %s and party_type=%s and party=%s""",
and account = %s and ifnull(party_type, '')=%s and ifnull(party, '')=%s""",
(against_voucher_type, against_voucher, account, party_type, party))[0][0] or 0.0)
if against_voucher_type == 'Purchase Invoice':
@@ -127,8 +127,9 @@ def update_outstanding_amt(account, party_type, party, against_voucher_type, aga
against_voucher_amount = flt(frappe.db.sql("""
select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
from `tabGL Entry` where voucher_type = 'Journal Entry' and voucher_no = %s
and account = %s and party_type=%s and party=%s and ifnull(against_voucher, '') = ''""",
(against_voucher, account, party_type, party))[0][0])
and account = %s and ifnull(party_type, '')=%s and ifnull(party, '')=%s
and ifnull(against_voucher, '') = ''""",
(against_voucher, account, cstr(party_type), cstr(party)))[0][0])
if not against_voucher_amount:
frappe.throw(_("Against Journal Entry {0} is already adjusted against some other voucher")
@@ -157,3 +158,22 @@ def validate_frozen_account(account, adv_adj=None):
frappe.throw(_("Account {0} is frozen").format(account))
elif frozen_accounts_modifier not in frappe.get_roles():
frappe.throw(_("Not authorized to edit frozen Account {0}").format(account))
def update_against_account(voucher_type, voucher_no):
entries = frappe.db.get_all("GL Entry",
filters={"voucher_type": voucher_type, "voucher_no": voucher_no},
fields=["name", "party", "against", "debit", "credit", "account"])
accounts_debited, accounts_credited = [], []
for d in entries:
if flt(d.debit > 0): accounts_debited.append(d.party or d.account)
if flt(d.credit) > 0: accounts_credited.append(d.party or d.account)
for d in entries:
if flt(d.debit > 0):
new_against = ", ".join(list(set(accounts_credited)))
if flt(d.credit > 0):
new_against = ", ".join(list(set(accounts_debited)))
if d.against != new_against:
frappe.db.set_value("GL Entry", d.name, "against", new_against)

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

@@ -53,7 +53,7 @@
"fieldname": "posting_date",
"fieldtype": "Date",
"in_filter": 1,
"in_list_view": 1,
"in_list_view": 0,
"label": "Posting Date",
"no_copy": 1,
"oldfieldname": "posting_date",
@@ -445,7 +445,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
"modified": "2015-04-27 20:32:31.655580",
"modified": "2015-06-29 15:28:12.529019",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",

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:
@@ -242,8 +243,8 @@ class JournalEntry(AccountsController):
def set_against_account(self):
accounts_debited, accounts_credited = [], []
for d in self.get("accounts"):
if flt(d.debit > 0): accounts_debited.append(d.account)
if flt(d.credit) > 0: accounts_credited.append(d.account)
if flt(d.debit > 0): accounts_debited.append(d.party or d.account)
if flt(d.credit) > 0: accounts_credited.append(d.party or d.account)
for d in self.get("accounts"):
if flt(d.debit > 0): d.against_account = ", ".join(list(set(accounts_credited)))
@@ -274,29 +275,27 @@ class JournalEntry(AccountsController):
else:
msgprint(_("Please enter Reference date"), raise_exception=frappe.MandatoryError)
company_currency = get_company_currency(self.company)
for d in self.get('accounts'):
if d.against_invoice and d.credit:
currency = frappe.db.get_value("Sales Invoice", d.against_invoice, "currency")
r.append(_("{0} against Sales Invoice {1}").format(fmt_money(flt(d.credit), currency = currency), \
r.append(_("{0} against Sales Invoice {1}").format(fmt_money(flt(d.credit), currency = company_currency), \
d.against_invoice))
if d.against_sales_order and d.credit:
currency = frappe.db.get_value("Sales Order", d.against_sales_order, "currency")
r.append(_("{0} against Sales Order {1}").format(fmt_money(flt(d.credit), currency = currency), \
r.append(_("{0} against Sales Order {1}").format(fmt_money(flt(d.credit), currency = company_currency), \
d.against_sales_order))
if d.against_voucher and d.debit:
bill_no = frappe.db.sql("""select bill_no, bill_date, currency
bill_no = frappe.db.sql("""select bill_no, bill_date
from `tabPurchase Invoice` where name=%s""", d.against_voucher)
if bill_no and bill_no[0][0] and bill_no[0][0].lower().strip() \
not in ['na', 'not applicable', 'none']:
r.append(_('{0} against Bill {1} dated {2}').format(fmt_money(flt(d.debit), currency=bill_no[0][2]), bill_no[0][0],
r.append(_('{0} against Bill {1} dated {2}').format(fmt_money(flt(d.debit), currency=company_currency), bill_no[0][0],
bill_no[0][1] and formatdate(bill_no[0][1].strftime('%Y-%m-%d'))))
if d.against_purchase_order and d.debit:
currency = frappe.db.get_value("Purchase Order", d.against_purchase_order, "currency")
r.append(_("{0} against Purchase Order {1}").format(fmt_money(flt(d.credit), currency = currency), \
r.append(_("{0} against Purchase Order {1}").format(fmt_money(flt(d.credit), currency = company_currency), \
d.against_purchase_order))
if self.user_remark:
@@ -427,18 +426,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)))
@@ -458,11 +456,11 @@ def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None):
if voucher_type=="Bank Entry":
account = frappe.db.get_value("Company", company, "default_bank_account")
if not account:
account = frappe.db.get_value("Account", {"company": company, "account_type": "Bank"})
account = frappe.db.get_value("Account", {"company": company, "account_type": "Bank", "is_group": 0})
elif voucher_type=="Cash Entry":
account = frappe.db.get_value("Company", company, "default_cash_account")
if not account:
account = frappe.db.get_value("Account", {"company": company, "account_type": "Cash"})
account = frappe.db.get_value("Account", {"company": company, "account_type": "Cash", "is_group": 0})
if account:
return {
@@ -538,15 +536,13 @@ def get_opening_accounts(company):
def get_against_jv(doctype, txt, searchfield, start, page_len, filters):
if not filters.get("party"):
return []
return frappe.db.sql("""select jv.name, jv.posting_date, jv.user_remark
from `tabJournal Entry` jv, `tabJournal Entry Account` jv_detail
where jv_detail.parent = jv.name and jv_detail.account = %s and jv_detail.party = %s
where jv_detail.parent = jv.name and jv_detail.account = %s and ifnull(jv_detail.party, '') = %s
and (ifnull(jv_detail.against_invoice, '') = '' and ifnull(jv_detail.against_voucher, '') = ''
and ifnull(jv_detail.against_jv, '') = '' )
and jv.docstatus = 1 and jv.{0} like %s order by jv.name desc limit %s, %s""".format(searchfield),
(filters["account"], filters["party"], "%{0}%".format(txt), start, page_len))
(filters.get("account"), cstr(filters.get("party")), "%{0}%".format(txt), start, page_len))
@frappe.whitelist()
def get_outstanding(args):

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:

View File

@@ -224,3 +224,4 @@ cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
else
cur_frm.pformat.print_heading = __("Purchase Invoice");
}

View File

@@ -29,7 +29,8 @@
"options": "Supplier",
"permlevel": 0,
"print_hide": 1,
"read_only": 0
"read_only": 0,
"search_index": 1
},
{
"depends_on": "supplier",
@@ -112,7 +113,7 @@
"print_hide": 1,
"read_only": 0,
"reqd": 0,
"search_index": 1
"search_index": 0
},
{
"fieldname": "bill_date",
@@ -125,7 +126,7 @@
"print_hide": 1,
"read_only": 0,
"reqd": 0,
"search_index": 1
"search_index": 0
},
{
"fieldname": "amended_from",
@@ -151,7 +152,7 @@
"permlevel": 0,
"print_hide": 1,
"read_only": 0,
"search_index": 1
"search_index": 0
},
{
"fieldname": "currency_and_price_list",
@@ -428,7 +429,7 @@
"default": "Grand Total",
"fieldname": "apply_discount_on",
"fieldtype": "Select",
"label": "Apply Discount On",
"label": "Apply Additional Discount On",
"options": "\nGrand Total\nNet Total",
"permlevel": 0,
"precision": "",
@@ -443,7 +444,7 @@
{
"fieldname": "discount_amount",
"fieldtype": "Currency",
"label": "Discount Amount",
"label": "Additional Discount Amount",
"options": "currency",
"permlevel": 0,
"precision": "",
@@ -452,7 +453,7 @@
{
"fieldname": "base_discount_amount",
"fieldtype": "Currency",
"label": "Discount Amount (Company Currency)",
"label": "Additional Discount Amount (Company Currency)",
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
@@ -556,7 +557,7 @@
"permlevel": 0,
"print_hide": 1,
"read_only": 1,
"search_index": 1
"search_index": 0
},
{
"fieldname": "write_off_amount",
@@ -611,7 +612,7 @@
{
"fieldname": "advances_section",
"fieldtype": "Section Break",
"label": "Advances",
"label": "",
"oldfieldtype": "Section Break",
"options": "icon-money",
"permlevel": 0,
@@ -665,7 +666,7 @@
"depends_on": "supplier",
"fieldname": "contact_section",
"fieldtype": "Section Break",
"label": "Contact Info",
"label": "",
"options": "icon-bullhorn",
"permlevel": 0,
"read_only": 0
@@ -733,7 +734,7 @@
"permlevel": 0,
"print_hide": 1,
"read_only": 0,
"search_index": 1
"search_index": 0
},
{
"allow_on_submit": 1,
@@ -760,7 +761,7 @@
"permlevel": 0,
"print_hide": 1,
"read_only": 0,
"search_index": 1
"search_index": 0
},
{
"fieldname": "mode_of_payment",
@@ -778,15 +779,6 @@
"permlevel": 0,
"read_only": 0
},
{
"allow_on_submit": 1,
"fieldname": "letter_head",
"fieldtype": "Link",
"label": "Letter Head",
"options": "Letter Head",
"permlevel": 0,
"print_hide": 1
},
{
"fieldname": "fiscal_year",
"fieldtype": "Link",
@@ -798,7 +790,7 @@
"permlevel": 0,
"print_hide": 1,
"read_only": 0,
"search_index": 1
"search_index": 0
},
{
"fieldname": "remarks",
@@ -934,12 +926,21 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 1
},
{
"depends_on": "eval:doc.is_recurring==1",
"fieldname": "recurring_print_format",
"fieldtype": "Link",
"label": "Recurring Print Format",
"options": "Print Format",
"permlevel": 0,
"precision": ""
}
],
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
"modified": "2015-05-15 14:20:47.718194",
"modified": "2015-06-22 07:30:06.743438",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, formatdate, flt
from frappe.utils import cint, formatdate, flt, getdate
from frappe import msgprint, _, throw
from erpnext.setup.utils import get_company_currency
import frappe.defaults
@@ -39,6 +39,7 @@ class PurchaseInvoice(BuyingController):
self.po_required()
self.pr_required()
self.validate_supplier_invoice()
self.check_active_purchase_items()
self.check_conversion_rate()
self.validate_credit_to_acc()
@@ -87,9 +88,7 @@ class PurchaseInvoice(BuyingController):
throw(_("Conversion rate cannot be 0 or 1"))
def validate_credit_to_acc(self):
root_type, account_type = frappe.db.get_value("Account", self.credit_to, ["root_type", "account_type"])
if root_type != "Liability":
frappe.throw(_("Credit To account must be a liability account"))
account_type = frappe.db.get_value("Account", self.credit_to, "account_type")
if account_type != "Payable":
frappe.throw(_("Credit To account must be a Payable account"))
@@ -165,7 +164,7 @@ class PurchaseInvoice(BuyingController):
elif item.expense_account not in against_accounts:
# if no auto_accounting_for_stock or not a stock item
against_accounts.append(item.expense_account)
self.against_expense_account = ",".join(against_accounts)
def po_required(self):
@@ -272,7 +271,7 @@ class PurchaseInvoice(BuyingController):
gl_entries.append(
self.get_gl_dict({
"account": tax.account_head,
"against": self.credit_to,
"against": self.supplier,
"debit": tax.add_deduct_tax == "Add" and tax.base_tax_amount_after_discount_amount or 0,
"credit": tax.add_deduct_tax == "Deduct" and tax.base_tax_amount_after_discount_amount or 0,
"remarks": self.remarks,
@@ -296,7 +295,7 @@ class PurchaseInvoice(BuyingController):
gl_entries.append(
self.get_gl_dict({
"account": item.expense_account,
"against": self.credit_to,
"against": self.supplier,
"debit": item.base_net_amount,
"remarks": self.remarks,
"cost_center": item.cost_center
@@ -316,7 +315,7 @@ class PurchaseInvoice(BuyingController):
gl_entries.append(
self.get_gl_dict({
"account": stock_received_but_not_billed,
"against": self.credit_to,
"against": self.supplier,
"debit": flt(item.item_tax_amount, self.precision("item_tax_amount", item)),
"remarks": self.remarks or "Accounting Entry for Stock"
})
@@ -342,7 +341,7 @@ class PurchaseInvoice(BuyingController):
self.get_gl_dict({
"account": expenses_included_in_valuation,
"cost_center": cost_center,
"against": self.credit_to,
"against": self.supplier,
"credit": applicable_amount,
"remarks": self.remarks or "Accounting Entry for Stock"
})
@@ -356,7 +355,7 @@ class PurchaseInvoice(BuyingController):
gl_entries.append(
self.get_gl_dict({
"account": self.write_off_account,
"against": self.credit_to,
"against": self.supplier,
"credit": flt(self.write_off_amount),
"remarks": self.remarks,
"cost_center": self.write_off_cost_center
@@ -375,7 +374,7 @@ class PurchaseInvoice(BuyingController):
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
self.make_gl_entries_on_cancel()
self.update_project()
def update_project(self):
project_list = []
for d in self.items:
@@ -386,6 +385,16 @@ class PurchaseInvoice(BuyingController):
project.save()
project_list.append(d.project_name)
def validate_supplier_invoice(self):
if self.bill_date:
if getdate(self.bill_date) > getdate(self.posting_date):
frappe.throw("Supplier Invoice Date cannot be greater than Posting Date")
if self.bill_no:
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
pi = frappe.db.exists("Purchase Invoice", {"bill_no": self.bill_no, "fiscal_year": self.fiscal_year})
if pi:
frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))
@frappe.whitelist()
def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
from erpnext.controllers.queries import get_match_cond
@@ -401,4 +410,4 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
and tabAccount.company = '%(company)s'
and tabAccount.%(key)s LIKE '%(txt)s'
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype)})
'txt': "%%%s%%" % frappe.db.escape(txt), 'mcond':get_match_cond(doctype)})

View File

@@ -40,7 +40,7 @@
{
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
"in_list_view": 0,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Text",
@@ -49,6 +49,23 @@
"read_only": 0,
"width": "300px"
},
{
"fieldname": "image",
"fieldtype": "Attach",
"hidden": 1,
"label": "Image",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "image_view",
"fieldtype": "Image",
"label": "Image View",
"options": "image",
"permlevel": 0,
"precision": "",
"print_hide": 1
},
{
"fieldname": "quantity_and_rate",
"fieldtype": "Section Break",
@@ -105,10 +122,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 +469,7 @@
],
"idx": 1,
"istable": 1,
"modified": "2015-02-23 15:35:32.895515",
"modified": "2015-07-02 03:00:44.496683",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -7,6 +7,7 @@ import frappe
@frappe.whitelist()
def get_items(price_list, sales_or_purchase, item=None):
condition = ""
order_by = ""
args = {"price_list": price_list}
if sales_or_purchase == "Sales":
@@ -30,16 +31,25 @@ def get_items(price_list, sales_or_purchase, item=None):
item_code[0]["barcode"] = item
return item_code
condition += " and (CONCAT(i.name, i.item_name) like %(name)s or (i.variant_of like %(name)s))"
args["name"] = "%%%s%%" % item
condition += " and ((CONCAT(i.name, i.item_name) like %(name)s) or (i.variant_of like %(name)s) or (i.item_group like %(name)s))"
order_by = """if(locate(%(_name)s, i.name), locate(%(_name)s, i.name), 99999),
if(locate(%(_name)s, i.item_name), locate(%(_name)s, i.item_name), 99999),
if(locate(%(_name)s, i.variant_of), locate(%(_name)s, i.variant_of), 99999),
if(locate(%(_name)s, i.item_group), locate(%(_name)s, i.item_group), 99999),"""
args["name"] = "%%%s%%" % frappe.db.escape(item)
args["_name"] = item.replace("%", "")
# locate function is used to sort by closest match from the beginning of the value
return frappe.db.sql("""select i.name, i.item_name, i.image,
item_det.price_list_rate, item_det.currency
from `tabItem` i LEFT JOIN
(select item_code, price_list_rate, currency from
`tabItem Price` where price_list=%s) item_det
`tabItem Price` where price_list=%(price_list)s) item_det
ON
(item_det.item_code=i.name or item_det.item_code=i.variant_of)
where
ifnull(i.has_variants, 0) = 0 and
%s""" % ('%(price_list)s', condition), args, as_dict=1)
{condition}
order by
{order_by}
i.name""".format(condition=condition, order_by=order_by), args, as_dict=1)

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"]);
}
}
});
}
@@ -392,8 +392,6 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
}
}
cur_frm.set_query("debit_to", function(doc) {
return{
filters: [

File diff suppressed because it is too large Load Diff

View File

@@ -65,8 +65,7 @@ class SalesInvoice(SellingController):
self.set_against_income_account()
self.validate_c_form()
self.validate_time_logs_are_submitted()
self.validate_multiple_billing("Delivery Note", "dn_detail", "amount",
"items")
self.validate_multiple_billing("Delivery Note", "dn_detail", "amount", "items")
def on_submit(self):
super(SalesInvoice, self).on_submit()
@@ -160,12 +159,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 +183,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)):
@@ -236,9 +235,7 @@ class SalesInvoice(SellingController):
reconcile_against_document(lst)
def validate_debit_to_acc(self):
root_type, account_type = frappe.db.get_value("Account", self.debit_to, ["root_type", "account_type"])
if root_type != "Asset":
frappe.throw(_("Debit To account must be a liability account"))
account_type = frappe.db.get_value("Account", self.debit_to, "account_type")
if account_type != "Receivable":
frappe.throw(_("Debit To account must be a Receivable account"))
@@ -371,24 +368,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:
@@ -506,7 +503,7 @@ class SalesInvoice(SellingController):
gl_entries.append(
self.get_gl_dict({
"account": tax.account_head,
"against": self.debit_to,
"against": self.customer,
"credit": flt(tax.base_tax_amount_after_discount_amount),
"remarks": self.remarks,
"cost_center": tax.cost_center
@@ -520,7 +517,7 @@ class SalesInvoice(SellingController):
gl_entries.append(
self.get_gl_dict({
"account": item.income_account,
"against": self.debit_to,
"against": self.customer,
"credit": item.base_net_amount,
"remarks": self.remarks,
"cost_center": item.cost_center
@@ -551,7 +548,7 @@ class SalesInvoice(SellingController):
gl_entries.append(
self.get_gl_dict({
"account": self.cash_bank_account,
"against": self.debit_to,
"against": self.customer,
"debit": self.paid_amount,
"remarks": self.remarks,
})
@@ -575,7 +572,7 @@ class SalesInvoice(SellingController):
gl_entries.append(
self.get_gl_dict({
"account": self.write_off_account,
"against": self.debit_to,
"against": self.customer,
"debit": self.write_off_amount,
"remarks": self.remarks,
"cost_center": self.write_off_cost_center
@@ -590,7 +587,7 @@ def get_list_context(context=None):
@frappe.whitelist()
def get_bank_cash_account(mode_of_payment, company):
account = frappe.db.get_value("Mode of Payment Account",
account = frappe.db.get_value("Mode of Payment Account",
{"parent": mode_of_payment, "company": company}, "default_account")
if not account:
frappe.msgprint(_("Please set default Cash or Bank account in Mode of Payment {0}").format(mode_of_payment))
@@ -614,7 +611,7 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters):
and tabAccount.company = '%(company)s'
and tabAccount.%(key)s LIKE '%(txt)s'
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype)})
'txt': "%%%s%%" % frappe.db.escape(txt), 'mcond':get_match_cond(doctype)})
@frappe.whitelist()
def make_delivery_note(source_name, target_doc=None):

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",
@@ -68,6 +68,23 @@
"reqd": 1,
"width": "200px"
},
{
"fieldname": "image",
"fieldtype": "Attach",
"hidden": 1,
"label": "Image",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "image_view",
"fieldtype": "Image",
"label": "Image View",
"options": "image",
"permlevel": 0,
"precision": "",
"print_hide": 1
},
{
"fieldname": "quantity_and_rate",
"fieldtype": "Section Break",
@@ -98,10 +115,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 +522,7 @@
],
"idx": 1,
"istable": 1,
"modified": "2015-03-23 14:56:45.641026",
"modified": "2015-07-02 02:59:08.413213",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -3,8 +3,9 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cstr
from frappe.utils import flt, cstr, cint
from frappe import _
from frappe.model.meta import get_field_precision
from erpnext.accounts.utils import validate_expense_against_budget
@@ -55,29 +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)
def make_entry(args, adv_adj, update_outstanding):
args.update({"doctype": "GL Entry"})
gle = frappe.get_doc(args)
@@ -86,18 +81,62 @@ 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):
if abs(total_debit - total_credit) > 0.005:
frappe.throw(_("Debit and Credit not equal for this voucher. Difference is {0}.").format(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
where account_type = 'Warehouse' and ifnull(warehouse, '')!=''""")]
if cint(frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock")) \
and gl_map[0].voucher_type=="Journal Entry":
aii_accounts = [d[0] for d in frappe.db.sql("""select name from tabAccount
where account_type = 'Warehouse' and ifnull(warehouse, '')!=''""")]
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)
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)
def round_off_debit_credit(gl_map):
precision = get_field_precision(frappe.get_meta("GL Entry").get_field("debit"),
currency=frappe.db.get_value("Company", gl_map[0].company, "default_currency", cache=True))
debit_credit_diff = 0.0
for entry in gl_map:
entry.debit = flt(entry.debit, precision)
entry.credit = flt(entry.credit, precision)
debit_credit_diff += entry.debit - entry.credit
debit_credit_diff = flt(debit_credit_diff, precision)
if abs(debit_credit_diff) >= (5.0 / (10**precision)):
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.")
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
elif abs(debit_credit_diff) >= (1.0 / (10**precision)):
make_round_off_gle(gl_map, debit_credit_diff)
def make_round_off_gle(gl_map, debit_credit_diff):
round_off_account, round_off_cost_center = frappe.db.get_value("Company", gl_map[0].company,
["round_off_account", "round_off_cost_center"]) 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

@@ -16,12 +16,16 @@ def get_party_details(party=None, account=None, party_type="Customer", company=N
if not party:
return {}
if not frappe.db.exists(party_type, party):
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
return _get_party_details(party, account, party_type,
company, posting_date, price_list, currency, doctype)
def _get_party_details(party=None, account=None, party_type="Customer", company=None,
posting_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False):
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, doctype))
party = out[party_type.lower()]

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

@@ -51,7 +51,7 @@ class ReceivablePayableReport(object):
currency_precision = get_currency_precision() or 2
dr_or_cr = "debit" if args.get("party_type") == "Customer" else "credit"
voucher_details = self.get_voucher_details()
voucher_details = self.get_voucher_details(args.get("party_type"))
future_vouchers = self.get_entries_after(self.filters.report_date, args.get("party_type"))
@@ -153,23 +153,26 @@ class ReceivablePayableReport(object):
return self.party_map
def get_voucher_details(self):
def get_voucher_details(self, party_type):
voucher_details = frappe._dict()
if party_type == "Customer":
for si in frappe.db.sql("""select name, due_date
from `tabSales Invoice` where docstatus=1""", as_dict=1):
voucher_details.setdefault(si.name, si)
for si in frappe.db.sql("""select name, due_date
from `tabSales Invoice` where docstatus=1""", as_dict=1):
voucher_details.setdefault(si.name, si)
for pi in frappe.db.sql("""select name, due_date, bill_no, bill_date
from `tabPurchase Invoice` where docstatus=1""", as_dict=1):
voucher_details.setdefault(pi.name, pi)
if party_type == "Supplier":
for pi in frappe.db.sql("""select name, due_date, bill_no, bill_date
from `tabPurchase Invoice` where docstatus=1""", as_dict=1):
voucher_details.setdefault(pi.name, pi)
return voucher_details
def get_gl_entries(self, party_type):
if not hasattr(self, "gl_entries"):
conditions, values = self.prepare_conditions(party_type)
self.gl_entries = frappe.db.sql("""select * from `tabGL Entry`
self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party, debit, credit,
voucher_type, voucher_no, against_voucher_type, against_voucher from `tabGL Entry`
where docstatus < 2 and party_type=%s {0} order by posting_date, party"""
.format(conditions), values, as_dict=True)
@@ -187,7 +190,7 @@ class ReceivablePayableReport(object):
if self.filters.get(party_type_field):
conditions.append("party=%s")
values.append(self.filters.get(party_type_field))
values.append(self.filters.get(party_type_field))
return " and ".join(conditions), values

View File

@@ -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

@@ -83,7 +83,7 @@ def get_data(company, root_type, balance_must_be, period_list, ignore_closing_en
gl_entries_by_account = get_gl_entries(company, period_list[0]["from_date"], period_list[-1]["to_date"],
accounts[0].lft, accounts[0].rgt, ignore_closing_entries=ignore_closing_entries)
calculate_values(accounts, gl_entries_by_account, period_list)
calculate_values(accounts_by_name, gl_entries_by_account, period_list)
accumulate_values_into_parents(accounts, accounts_by_name, period_list)
out = prepare_data(accounts, balance_must_be, period_list)
@@ -92,16 +92,14 @@ def get_data(company, root_type, balance_must_be, period_list, ignore_closing_en
return out
def calculate_values(accounts, gl_entries_by_account, period_list):
for d in accounts:
for name in ([d.name] + (d.collapsed_children or [])):
for entry in gl_entries_by_account.get(name, []):
for period in period_list:
entry.posting_date = getdate(entry.posting_date)
# check if posting date is within the period
if entry.posting_date <= period.to_date:
d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
def calculate_values(accounts_by_name, gl_entries_by_account, period_list):
for entries in gl_entries_by_account.values():
for entry in entries:
d = accounts_by_name.get(entry.account)
for period in period_list:
# check if posting date is within the period
if entry.posting_date <= period.to_date:
d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
def accumulate_values_into_parents(accounts, accounts_by_name, period_list):
@@ -146,7 +144,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:
@@ -159,22 +157,8 @@ def add_total_row(out, balance_must_be, period_list):
out.append({})
def get_accounts(company, root_type):
# root lft, rgt
root_account = frappe.db.sql("""select lft, rgt from `tabAccount`
where company=%s and root_type=%s and ifnull(parent_account, '') = ''
order by lft limit 1""",
(company, root_type), as_dict=True)
if not root_account:
return None
lft, rgt = root_account[0].lft, root_account[0].rgt
accounts = frappe.db.sql("""select * from `tabAccount`
where company=%(company)s and lft >= %(lft)s and rgt <= %(rgt)s order by lft""",
{ "company": company, "lft": lft, "rgt": rgt }, as_dict=True)
return accounts
return frappe.db.sql("""select name, parent_account, lft, rgt, root_type, report_type, account_name from `tabAccount`
where company=%s and root_type=%s order by lft""", (company, root_type), as_dict=True)
def filter_accounts(accounts, depth=10):
parent_children_map = {}
@@ -196,18 +180,10 @@ def filter_accounts(accounts, depth=10):
filtered_accounts.append(child)
add_to_list(child.name, level + 1)
else:
# include all children at level lower than the depth
parent_account = accounts_by_name[parent]
parent_account["collapsed_children"] = []
for d in accounts:
if d.lft > parent_account.lft and d.rgt < parent_account.rgt:
parent_account["collapsed_children"].append(d.name)
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"""
@@ -224,20 +200,6 @@ def sort_root_accounts(roots):
roots.sort(compare_roots)
def sort_root_accounts(roots):
"""Sort root types as Asset, Liability, Equity, Income, Expense"""
def compare_roots(a, b):
if a.report_type != b.report_type and a.report_type == "Balance Sheet":
return -1
if a.root_type != b.root_type and a.root_type == "Asset":
return -1
if a.root_type == "Liability" and b.root_type == "Equity":
return -1
return 1
roots.sort(compare_roots)
def get_gl_entries(company, from_date, to_date, root_lft, root_rgt, ignore_closing_entries=False):
"""Returns a dict like { "account": [gl entries], ... }"""
additional_conditions = []
@@ -248,7 +210,7 @@ def get_gl_entries(company, from_date, to_date, root_lft, root_rgt, ignore_closi
if from_date:
additional_conditions.append("and posting_date >= %(from_date)s")
gl_entries = frappe.db.sql("""select * from `tabGL Entry`
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening from `tabGL Entry`
where company=%(company)s
{additional_conditions}
and posting_date <= %(to_date)s

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

@@ -3,13 +3,13 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, getdate
from frappe.utils import flt, getdate, cstr
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)
@@ -66,7 +66,7 @@ def get_gl_entries(filters):
gl_entries = frappe.db.sql("""select posting_date, account, party_type, party,
sum(ifnull(debit, 0)) as debit, sum(ifnull(credit, 0)) as credit,
voucher_type, voucher_no, cost_center, remarks, is_opening, against
voucher_type, voucher_no, cost_center, remarks, against, is_opening
from `tabGL Entry`
where company=%(company)s {conditions}
{group_by_condition}
@@ -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")
@@ -93,6 +91,9 @@ def get_conditions(filters):
if filters.get("party"):
conditions.append("party=%(party)s")
if not (filters.get("account") or filters.get("party") or filters.get("group_by_account")):
conditions.append("posting_date >=%(from_date)s")
from frappe.desk.reportview import build_match_conditions
match_conditions = build_match_conditions("GL Entry")
@@ -107,31 +108,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
@@ -150,13 +151,15 @@ def initialize_gle_map(gl_entries):
def get_accountwise_gle(filters, gl_entries, gle_map):
opening, total_debit, total_credit = 0, 0, 0
from_date, to_date = getdate(filters.from_date), getdate(filters.to_date)
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 (filters.get("account") or filters.get("party") or filters.get("group_by_account")) \
and (gle.posting_date < from_date or cstr(gle.is_opening) == "Yes"):
gle_map[gle.account].opening += amount
opening += amount
elif gle.posting_date <= getdate(filters.to_date):
if filters.get("account") or filters.get("party"):
opening += amount
elif gle.posting_date <= to_date:
gle_map[gle.account].entries.append(gle)
gle_map[gle.account].total_debit += flt(gle.debit, 3)
gle_map[gle.account].total_credit += flt(gle.credit, 3)
@@ -168,7 +171,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,16 +174,16 @@ 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:
parenttype, parent, item_row = row.parenttype, row.parent, row.item_row
if row.dn_detail:
parenttype, parent, item_row = "Delivery Note", row.delivery_note, row.dn_detail
my_sle = self.sle.get((item_code, row.warehouse))
for i, sle in enumerate(my_sle):
# find the stock valution rate from stock ledger entry
if sle.voucher_type == row.parenttype and row.parent == sle.voucher_no and \
sle.voucher_detail_no == row.item_row:
if sle.voucher_type == parenttype and parent == sle.voucher_no and \
sle.voucher_detail_no == item_row:
previous_stock_value = len(my_sle) > i+1 and \
flt(my_sle[i+1].stock_value) or 0.0
return previous_stock_value - flt(sle.stock_value)
@@ -215,7 +215,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

@@ -3,6 +3,14 @@
frappe.query_reports["Payment Period Based On Invoice Date"] = {
"filters": [
{
fieldname:"company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
reqd: 1,
default: frappe.defaults.get_user_default("company")
},
{
fieldname: "from_date",
label: __("From Date"),
@@ -23,27 +31,28 @@ frappe.query_reports["Payment Period Based On Invoice Date"] = {
default: "Incoming"
},
{
fieldname:"account",
label: __("Account"),
fieldtype: "Link",
options: "Account",
get_query: function() {
"fieldname":"party_type",
"label": __("Party Type"),
"fieldtype": "Link",
"options": "DocType",
"get_query": function() {
return {
query: "erpnext.controllers.queries.get_account_list",
filters: {
"report_type": "Balance Sheet",
company: frappe.query_report.filters_by_name.company.get_value()
}
filters: {"name": ["in", ["Customer", "Supplier"]]}
}
}
},
{
fieldname:"company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
reqd: 1,
default: frappe.defaults.get_user_default("company")
"fieldname":"party",
"label": __("Party"),
"fieldtype": "Dynamic Link",
"get_options": function() {
var party_type = frappe.query_report.filters_by_name.party_type.get_value();
var party = frappe.query_report.filters_by_name.party.get_value();
if(party && !party_type) {
frappe.throw(__("Please select Party Type first"));
}
return party_type;
}
},
]
}

View File

@@ -9,8 +9,9 @@ from frappe.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
validate_filters(filters)
columns = get_columns(filters)
entries = get_entries(filters)
invoice_posting_date_map = get_invoice_posting_date_map(filters)
against_date = ""
@@ -20,67 +21,72 @@ def execute(filters=None):
for d in entries:
if d.against_voucher:
against_date = d.against_voucher and invoice_posting_date_map[d.against_voucher] or ""
outstanding_amount = flt(d.debit) or -1 * flt(d.credit)
payment_amount = flt(d.debit) or -1 * flt(d.credit)
else:
against_date = d.against_invoice and invoice_posting_date_map[d.against_invoice] or ""
outstanding_amount = flt(d.credit) or -1 * flt(d.debit)
payment_amount = flt(d.credit) or -1 * flt(d.debit)
row = [d.name, d.account, d.posting_date, d.against_voucher or d.against_invoice,
row = [d.name, d.party_type, d.party, d.posting_date, d.against_voucher or d.against_invoice,
against_date, d.debit, d.credit, d.cheque_no, d.cheque_date, d.remark]
if d.against_voucher or d.against_invoice:
row += get_ageing_data(30, 60, 90, d.posting_date, against_date, outstanding_amount)
row += get_ageing_data(30, 60, 90, d.posting_date, against_date, payment_amount)
else:
row += ["", "", "", "", ""]
data.append(row)
return columns, data
def validate_filters(filters):
if (filters.get("payment_type") == "Incoming" and filters.get("party_type") == "Supplier") or \
(filters.get("payment_type") == "Outgoing" and filters.get("party_type") == "Customer"):
frappe.throw(_("{0} payment entries can not be filtered by {1}")\
.format(filters.payment_type, filters.party_type))
def get_columns():
return [_("Journal Entry") + ":Link/Journal Entry:140", _("Account") + ":Link/Account:140",
_("Posting Date") + ":Date:100", _("Against Invoice") + ":Link/Purchase Invoice:130",
def get_columns(filters):
return [_("Journal Entry") + ":Link/Journal Entry:140",
_("Party Type") + ":Link/DocType:100", _("Party") + ":Dynamic Link/Party Type:140",
_("Posting Date") + ":Date:100",
_("Against Invoice") + (":Link/Purchase Invoice:130" if filters.get("payment_type") == "Outgoing" else ":Link/Sales Invoice:130"),
_("Against Invoice Posting Date") + ":Date:130", _("Debit") + ":Currency:120", _("Credit") + ":Currency:120",
_("Reference No") + "::100", _("Reference Date") + ":Date:100", _("Remarks") + "::150", _("Age") +":Int:40",
"0-30:Currency:100", "30-60:Currency:100", "60-90:Currency:100", _("90-Above") + ":Currency:100"
]
def get_conditions(filters):
conditions = ""
party = None
conditions = []
if filters.get("account"):
party = filters["account"]
else:
conditions += " and company = '%s'" % frappe.db.escape(filters["company"])
if not filters.get("party_type"):
if filters.get("payment_type") == "Outgoing":
filters["party_type"] = "Supplier"
else:
filters["party_type"] = "Customer"
if filters.get("party_type"):
conditions.append("jvd.party_type=%(party_type)s")
account_type = "Receivable" if filters.get("payment_type") == "Incoming" else "Payable"
if filters.get("party"):
conditions.append("jvd.party=%(party)s")
conditions += """ and account in
(select name from tabAccount
where account_type = '{0}'
and company='{1}')""".format(account_type, frappe.db.escape(filters["company"]))
if party:
conditions += " and jvd.party = '%s'" % frappe.db.escape(party)
else:
conditions += " and ifnull(jvd.party, '') != ''"
if filters.get("company"):
conditions.append("jv.company=%(company)s")
if filters.get("from_date"):
conditions += " and jv.posting_date >= '%s'" % filters["from_date"]
conditions.append("jv.posting_date >= %(from_date)s")
if filters.get("to_date"):
conditions += " and jv.posting_date <= '%s'" % filters["to_date"]
conditions.append("jv.posting_date <= %(to_date)s")
return conditions
return "and {}".format(" and ".join(conditions)) if conditions else ""
def get_entries(filters):
conditions = get_conditions(filters)
entries = frappe.db.sql("""select jv.name, jvd.account, jv.posting_date,
entries = frappe.db.sql("""select jv.name, jvd.party_type, jvd.party, jv.posting_date,
jvd.against_voucher, jvd.against_invoice, jvd.debit, jvd.credit,
jv.cheque_no, jv.cheque_date, jv.remark
from `tabJournal Entry Account` jvd, `tabJournal Entry` jv
where jvd.parent = jv.name and jv.docstatus=1 %s order by jv.name DESC""" %
conditions, as_dict=1, debug=1)
conditions, filters, as_dict=1)
return entries

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

View File

@@ -4,12 +4,12 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint, flt, getdate, formatdate
from frappe.utils import cint, flt, getdate, formatdate, cstr
from erpnext.accounts.report.financial_statements import filter_accounts, get_gl_entries
value_fields = ("opening_debit", "opening_credit", "debit", "credit", "closing_debit", "closing_credit")
def execute(filters):
def execute(filters=None):
validate_filters(filters)
data = get_data(filters)
columns = get_columns()
@@ -45,8 +45,8 @@ def validate_filters(filters):
filters.to_date = filters.year_end_date
def get_data(filters):
accounts = frappe.db.sql("""select * from `tabAccount` where company=%s order by lft""",
filters.company, as_dict=True)
accounts = frappe.db.sql("""select name, parent_account, account_name, root_type, report_type, lft, rgt
from `tabAccount` where company=%s order by lft""", filters.company, as_dict=True)
if not accounts:
return None
@@ -56,17 +56,58 @@ def get_data(filters):
min_lft, max_rgt = frappe.db.sql("""select min(lft), max(rgt) from `tabAccount`
where company=%s""", (filters.company,))[0]
gl_entries_by_account = get_gl_entries(filters.company, None, filters.to_date, min_lft, max_rgt,
gl_entries_by_account = get_gl_entries(filters.company, filters.from_date, filters.to_date, min_lft, max_rgt,
ignore_closing_entries=not flt(filters.with_period_closing_entry))
total_row = calculate_values(accounts, gl_entries_by_account, filters)
opening_balances = get_opening_balances(filters)
total_row = calculate_values(accounts, gl_entries_by_account, opening_balances, filters)
accumulate_values_into_parents(accounts, accounts_by_name)
data = prepare_data(accounts, filters, total_row)
return data
def get_opening_balances(filters):
balance_sheet_opening = get_rootwise_opening_balances(filters, "Balance Sheet")
pl_opening = get_rootwise_opening_balances(filters, "Profit and Loss")
balance_sheet_opening.update(pl_opening)
return balance_sheet_opening
def get_rootwise_opening_balances(filters, report_type):
additional_conditions = " and posting_date >= %(year_start_date)s" \
if report_type == "Profit and Loss" else ""
if not flt(filters.with_period_closing_entry):
additional_conditions += " and ifnull(voucher_type, '')!='Period Closing Voucher'"
gle = frappe.db.sql("""
select
account, sum(ifnull(debit, 0)) as opening_debit, sum(ifnull(credit, 0)) as opening_credit
from `tabGL Entry`
where
company=%(company)s
{additional_conditions}
and (posting_date < %(from_date)s or ifnull(is_opening, 'No') = 'Yes')
and account in (select name from `tabAccount` where report_type=%(report_type)s)
group by account""".format(additional_conditions=additional_conditions),
{
"company": filters.company,
"from_date": filters.from_date,
"report_type": report_type,
"year_start_date": filters.year_start_date
},
as_dict=True)
opening = frappe._dict()
for d in gle:
opening.setdefault(d.account, d)
return opening
def calculate_values(accounts, gl_entries_by_account, filters):
def calculate_values(accounts, gl_entries_by_account, opening_balances, filters):
init = {
"opening_debit": 0.0,
"opening_credit": 0.0,
@@ -87,30 +128,18 @@ def calculate_values(accounts, gl_entries_by_account, filters):
for d in accounts:
d.update(init.copy())
# add opening
d["opening_debit"] = opening_balances.get(d.name, {}).get("opening_debit", 0)
d["opening_credit"] = opening_balances.get(d.name, {}).get("opening_credit", 0)
for entry in gl_entries_by_account.get(d.name, []):
posting_date = getdate(entry.posting_date)
# opening
if posting_date < filters.from_date:
is_valid_opening = (d.root_type in ("Asset", "Liability", "Equity") or
(filters.year_start_date <= posting_date < filters.from_date))
if is_valid_opening:
d["opening_debit"] += flt(entry.debit)
d["opening_credit"] += flt(entry.credit)
elif posting_date <= filters.to_date:
if entry.is_opening == "Yes" and d.root_type in ("Asset", "Liability", "Equity"):
d["opening_debit"] += flt(entry.debit)
d["opening_credit"] += flt(entry.credit)
else:
d["debit"] += flt(entry.debit)
d["credit"] += flt(entry.credit)
if cstr(entry.is_opening) != "Yes":
d["debit"] += flt(entry.debit)
d["credit"] += flt(entry.credit)
total_row["debit"] += d["debit"]
total_row["credit"] += d["credit"]
return total_row

View File

@@ -18,11 +18,11 @@ def get_fiscal_year(date=None, fiscal_year=None, label="Date", verbose=1, compan
def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verbose=1, company=None):
# if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate)
cond = ""
cond = " ifnull(disabled, 0) = 0"
if fiscal_year:
cond = "fy.name = %(fiscal_year)s"
cond += " and fy.name = %(fiscal_year)s"
else:
cond = "%(transaction_date)s >= fy.year_start_date and %(transaction_date)s <= fy.year_end_date"
cond += " and %(transaction_date)s >= fy.year_start_date and %(transaction_date)s <= fy.year_end_date"
if company:
cond += """ and (not exists(select name from `tabFiscal Year Company` fyc where fyc.parent = fy.name)
@@ -36,7 +36,7 @@ def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verb
})
if not fy:
error_msg = _("""{0} {1} not in any Fiscal Year. For more details check {2}.""").format(label, formatdate(transaction_date), "https://erpnext.com/kb/accounts/fiscal-year-error")
error_msg = _("""{0} {1} not in any active Fiscal Year. For more details check {2}.""").format(label, formatdate(transaction_date), "https://erpnext.com/kb/accounts/fiscal-year-error")
if verbose==1: frappe.msgprint(error_msg)
raise FiscalYearError, error_msg
return fy
@@ -91,7 +91,7 @@ def get_balance_on(account=None, date=None, party_type=None, party=None):
# different filter for group and ledger - improved performance
if acc.is_group:
cond.append("""exists (
select * from `tabAccount` ac where ac.name = gle.account
select name from `tabAccount` ac where ac.name = gle.account
and ac.lft >= %s and ac.rgt <= %s
)""" % (acc.lft, acc.rgt))
else:
@@ -397,7 +397,7 @@ def get_outstanding_invoices(amount_query, account, party_type, party):
for d in outstanding_voucher_list:
payment_amount = frappe.db.sql("""
select ifnull(sum(ifnull({amount_query}, 0)), 0)
select ifnull(sum({amount_query}), 0)
from
`tabGL Entry`
where
@@ -421,8 +421,3 @@ def get_outstanding_invoices(amount_query, account, party_type, party):
})
return all_outstanding_vouchers
@frappe.whitelist()
def get_letter_head(company):
return frappe.db.get_value("Company",company,"default_letter_head")

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

@@ -57,3 +57,7 @@ cur_frm.fields_dict['item_serial_no'].get_query = function(doc, cdt, cdn) {
return { filters: filter }
}
cur_frm.add_fetch('item_code', 'item_name', 'item_name');
cur_frm.add_fetch('item_code', 'description', 'description');

View File

@@ -127,6 +127,14 @@
"permlevel": 0,
"width": "50%"
},
{
"fieldname": "item_name",
"fieldtype": "Data",
"label": "Item Name",
"permlevel": 0,
"precision": "",
"read_only": 1
},
{
"fieldname": "description",
"fieldtype": "Small Text",
@@ -219,7 +227,7 @@
"icon": "icon-search",
"idx": 1,
"is_submittable": 1,
"modified": "2015-04-14 07:37:07.331291",
"modified": "2015-06-08 02:40:25.121948",
"modified_by": "Administrator",
"module": "Buying",
"name": "Quality Inspection",

View File

@@ -31,7 +31,6 @@ class QualityInspection(Document):
(self.name, self.modified, self.purchase_receipt_no,
self.item_code))
def on_cancel(self):
if self.purchase_receipt_no:
frappe.db.sql("""update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2
@@ -39,7 +38,6 @@ class QualityInspection(Document):
where t1.parent = %s and t1.item_code = %s and t1.parent = t2.name""",
(self.modified, self.purchase_receipt_no, self.item_code))
def item_query(doctype, txt, searchfield, start, page_len, filters):
if filters.get("from"):
from frappe.desk.reportview import get_match_cond

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

@@ -0,0 +1,17 @@
- Performance upgrade in Trial Balance, General Ledger, AR/AP, Balance Sheet and P&L Statement reports
- Add index on Account and GL Entry, Sales Invoice and Purchase Invoice table
- Don't create Time Logs against Production Order if Workstation is not specified in Operations
- Task should be mandatory in Time Log only when Project is mentioned but Production Order is not
- Supplier invoice no unique validation and supplier invoice date can not be after posting date
- Removed BOM No from mandatory from Stock Entry against Production Order
- Load tasks in project for printing purpose
- Added Customers Not Buying Since Long Time against Sales Invoice
- POS - search by Item Group
- Payment period based on invoice date: show party columns and filter based on party
- Barcode added to Purchase Receipt
- Fetch item name and desc on change of item code in Quality Inspection
- Show item name in item grid view based 'In List View' property
- Validate and update manufactured qty in Stock Entry
- Show only users with Expense Approver role in Expense Claim Approver field
- Over Production Allowance Percentage Setting added to Manufacturing Settings
- Activity Cost - Mandatory removed for Employee

View File

@@ -0,0 +1 @@
- Open notification of Sales Order and Purchase Order based on whether Invoice is created against them. For eg. If a Sales Order is not Invoiced, it will be considered as open. Previously it was considered open if Delivery Note was created against Sales Order.

View File

@@ -0,0 +1,8 @@
- Item variants is now manageable via dedicated tool **Manage Variants**. To learn about it, check https://manual.erpnext.com/contents/stock/item/item-variants
- Against account in General Ledger will show Party instead of Account (which is not useful)
- Print format for recurring documents can be set by the users
- Recurring documents won't be created for Stopped Sales / Purchase Orders.
- Lead status will be changed to 'Opportunity' when Lead converted to Opportunity
- Amount in Journal Entry list view
- Currency exchange rate is now automatically fetched from fixer.io, instead of jsonrates.com
- Item image is now available in Sales / Purchase Invoice

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"
}
]
},
{
@@ -95,6 +103,23 @@ def get_data():
"name": "Completed Production Orders",
"doctype": "Production Order"
},
{
"type": "report",
"is_query_report": True,
"name": "BOM Search",
"doctype": "BOM"
},
]
},
{
"label": _("Help"),
"icon": "icon-facetime-video",
"items": [
{
"type": "help",
"label": _("Bill of Materials"),
"youtube_id": "hDV0c1OeWLo"
},
]
}
]

View File

@@ -237,6 +237,12 @@ def get_data():
"route": "query-report/Sales Person Target Variance Item Group-Wise",
"doctype": "Sales Person",
},
{
"type": "report",
"is_query_report": True,
"name": "BOM Search",
"doctype": "BOM"
},
{
"type": "report",
"is_query_report": True,
@@ -275,4 +281,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

@@ -38,7 +38,8 @@ class AccountsController(TransactionBase):
convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))
def before_recurring(self):
self.fiscal_year = None
if self.meta.get_field("fiscal_year"):
self.fiscal_year = None
if self.meta.get_field("due_date"):
self.due_date = None
@@ -46,7 +47,7 @@ class AccountsController(TransactionBase):
for fieldname in ["posting_date", "transaction_date"]:
if not self.get(fieldname) and self.meta.get_field(fieldname):
self.set(fieldname, today())
if not self.fiscal_year:
if self.meta.get_field("fiscal_year") and not self.fiscal_year:
self.fiscal_year = get_fiscal_year(self.get(fieldname))[0]
break
@@ -334,7 +335,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

@@ -194,7 +194,7 @@ def bom(doctype, txt, searchfield, start, page_len, filters):
and tabBOM.is_active=1
and tabBOM.%(key)s like "%(txt)s"
%(fcond)s %(mcond)s
limit %(start)s, %(page_len)s """ % {'key': searchfield, 'txt': "%%%s%%" % txt,
limit %(start)s, %(page_len)s """ % {'key': searchfield, 'txt': "%%%s%%" % frappe.db.escape(txt),
'fcond': get_filters_cond(doctype, filters, conditions),
'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len})
@@ -207,7 +207,7 @@ def get_project_name(doctype, txt, searchfield, start, page_len, filters):
where `tabProject`.status not in ("Completed", "Cancelled")
and %(cond)s `tabProject`.name like "%(txt)s" %(mcond)s
order by `tabProject`.name asc
limit %(start)s, %(page_len)s """ % {'cond': cond,'txt': "%%%s%%" % txt,
limit %(start)s, %(page_len)s """ % {'cond': cond,'txt': "%%%s%%" % frappe.db.escape(txt),
'mcond':get_match_cond(doctype),'start': start, 'page_len': page_len})
def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, filters):

View File

@@ -33,11 +33,13 @@ def manage_recurring_documents(doctype, next_date=None, commit=True):
next_date = next_date or nowdate()
date_field = date_field_map[doctype]
condition = " and ifnull(status, '') != 'Stopped'" if doctype in ("Sales Order", "Purchase Order") else ""
recurring_documents = frappe.db.sql("""select name, recurring_id
from `tab{}` where ifnull(is_recurring, 0)=1
and docstatus=1 and next_date='{}'
and next_date <= ifnull(end_date, '2199-12-31')""".format(doctype, next_date))
from `tab{0}` where ifnull(is_recurring, 0)=1
and docstatus=1 and next_date=%s
and next_date <= ifnull(end_date, '2199-12-31') {1}""".format(doctype, condition), next_date)
exception_list = []
for ref_document, recurring_id in recurring_documents:
@@ -124,7 +126,7 @@ def send_notification(new_rv):
frappe.sendmail(new_rv.notification_email_address,
subject= _("New {0}: #{1}").format(new_rv.doctype, new_rv.name),
message = _("Please find attached {0} #{1}").format(new_rv.doctype, new_rv.name),
attachments = [frappe.attach_print(new_rv.doctype, new_rv.name, file_name=new_rv.name)])
attachments = [frappe.attach_print(new_rv.doctype, new_rv.name, file_name=new_rv.name, print_format=new_rv.recurring_print_format)])
def notify_errors(doc, doctype, party, owner):
from frappe.utils.user import get_system_managers

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

@@ -282,6 +282,9 @@ class calculate_taxes_and_totals(object):
last_tax.tax_amount += diff
last_tax.tax_amount_after_discount_amount += diff
last_tax.total += diff
self._set_in_company_currency(last_tax,
["total", "tax_amount", "tax_amount_after_discount_amount"])
def calculate_totals(self):
self.doc.grand_total = flt(self.doc.get("taxes")[-1].total

View File

@@ -75,8 +75,7 @@ class Lead(SellingController):
return frappe.db.get_value("Customer", {"lead_name": self.name})
def has_opportunity(self):
return frappe.db.get_value("Opportunity", {"lead": self.name, "docstatus": 1,
"status": ["!=", "Lost"]})
return frappe.db.get_value("Opportunity", {"lead": self.name, "status": ["!=", "Lost"]})
@frappe.whitelist()
def make_customer(source_name, target_doc=None):

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 = "v5.0.0"
app_version = "5.1.0"
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"
@@ -80,8 +78,10 @@ doc_events = {
}
scheduler_events = {
"hourly": [
"erpnext.controllers.recurring_document.create_recurring_documents"
],
"daily": [
"erpnext.controllers.recurring_document.create_recurring_documents",
"erpnext.stock.reorder_item.reorder_item",
"erpnext.setup.doctype.email_digest.email_digest.send",
"erpnext.support.doctype.issue.issue.auto_close_tickets",
@@ -96,8 +96,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

@@ -63,7 +63,7 @@ cur_frm.cscript.onload = function(doc,cdt,cdn) {
cur_frm.set_query("exp_approver", function() {
return {
filters: [["UserRole", "role", "=", "Expense Approver"]]
query: "erpnext.hr.doctype.expense_claim.expense_claim.get_expense_approver"
};
});
}

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