Compare commits

..

529 Commits

Author SHA1 Message Date
Frappe Bot
67db77cfa8 Merge branch 'staging-fixes' into staging 2018-12-06 09:50:24 +00:00
Frappe Bot
4f1c659050 bumped to version 11.0.3-beta.26 2018-12-06 09:50:24 +00:00
Frappe Bot
ee5d7e6d0f Merge branch 'master' into staging-fixes 2018-12-06 09:26:42 +00:00
Frappe Bot
efb2712d14 Merge branch 'hotfix' 2018-12-06 09:14:35 +00:00
Frappe Bot
be0a349a52 bumped to version 10.1.74 2018-12-06 09:14:35 +00:00
Nabin Hait
32c95c3292 Merge pull request #16113 from nabinhait/travis-fix
fix(test): Fixed tests for discount with margin and period closing voucher
2018-12-06 11:58:56 +05:30
rohitwaghchaure
f85856d9f8 Merge pull request #16155 from rohitwaghchaure/changed_parent_for_item_attribute_value
[Fix] Permissions issue
2018-12-04 18:45:07 +05:30
Rohit Waghchaure
675567419b [Fix] Permissions issue 2018-12-04 18:43:52 +05:30
Nabin Hait
3ecb995485 Merge pull request #16006 from gbm001/gbm001-item-barcodes-pull
fix/feat: Allow extension of barcode types (without validation)
2018-12-03 14:39:14 +05:30
Nabin Hait
94eafb6674 Merge pull request #16005 from ESS-LLP/pr_staging_fixes
[Feature][Fix] Healthcare - Patient Appointment
2018-12-03 14:38:32 +05:30
Nabin Hait
999dfda37b Merge pull request #16065 from deepeshgarg007/supplier-customer-dashboard-fix
Customer/Supplier dashboard fix for multi company setup
2018-12-03 14:37:05 +05:30
Nabin Hait
046a99acf8 Merge branch 'staging-fixes' into supplier-customer-dashboard-fix 2018-12-03 14:36:38 +05:30
Nabin Hait
02aad03e74 Merge pull request #16022 from ESS-LLP/fix-patch
fix: healthcare patch
2018-12-03 14:36:02 +05:30
Nabin Hait
6b93f2fe0a Merge pull request #16139 from Zlash65/fix-assess
[Minor] Assessment Result fix
2018-12-03 14:33:01 +05:30
Nabin Hait
0b4ea25f83 Merge pull request #16138 from rohitwaghchaure/user_permissions_issue_item
[Fix] Permissions issue while making item variants
2018-12-03 14:32:40 +05:30
Nabin Hait
dd7b020b01 fix(test): Fixed tests for period closing voucher 2018-12-03 14:24:41 +05:30
Nabin Hait
dce68422a7 Merge pull request #16133 from rohitwaghchaure/fixed_stock_value_diifference_calculation_for_stock_reco
[Fix] Stock value difference calculation for stock reconciliation
2018-12-03 14:20:40 +05:30
Nabin Hait
b60deebaa9 Merge pull request #16118 from deepeshgarg007/analytics-fix
Bug fixes for analytics report
2018-12-03 14:19:24 +05:30
Zlash65
db43c3af68 display message if details to fetch grade isnt filled up 2018-12-03 12:15:10 +05:30
Rohit Waghchaure
a8003c1af7 [Fix] Permissions issue while making item variants 2018-12-03 11:49:52 +05:30
deepeshgarg007
4c79274054 Fixed patch and deprecated grid reports 2018-11-30 18:01:22 +05:30
deepeshgarg007
ec5bbe351c Row check fix for purchase analytics 2018-11-30 16:25:16 +05:30
rohitwaghchaure
ce72d26e95 Merge pull request #16125 from frappe/revert-16112-accounts_receivable_summary_print_issue
Revert "[Fix] Accounts receivable summary print is not working"
2018-11-30 16:21:53 +05:30
Rohit Waghchaure
16b8ecbe05 [Fix] Stock value difference calculation for stock reconciliation 2018-11-30 16:20:52 +05:30
deepeshgarg007
94a3539015 Row check fix in stock analytics 2018-11-30 16:20:48 +05:30
deepeshgarg007
37b6a2ca0b row check bug fix 2018-11-30 16:15:43 +05:30
Nabin Hait
eda0a6eb33 fix(test): Fixed tests for period closing voucher 2018-11-30 15:15:17 +05:30
rohitwaghchaure
ca332bdcdb Revert "[Fix] Accounts receivable summary print is not working" 2018-11-29 18:15:29 +05:30
deepeshgarg007
ee05e358d1 Rewrote query using orm 2018-11-29 16:24:28 +05:30
deepeshgarg007
c981fb389b Merge branch 'staging-fixes' of https://github.com/frappe/erpnext into supplier-customer-dashboard-fix 2018-11-29 14:57:50 +05:30
deepeshgarg007
3c7c4a61be Test case fix 2018-11-29 14:28:01 +05:30
deepeshgarg007
3eef6411dd Removed print statement 2018-11-29 13:10:02 +05:30
deepeshgarg007
9ed13f4a90 Merge branch 'staging-fixes' of https://github.com/frappe/erpnext into analytics-fix 2018-11-29 12:52:44 +05:30
deepeshgarg007
1a1c013b2a Analytics report bug fixes and code cleaning 2018-11-29 08:34:47 +05:30
Ameya Shenoy
5780e865b7 bumped to version 11.0.3-beta.25 2018-11-28 08:28:36 +00:00
Ameya Shenoy
2806d83362 Merge branch 'master' into staging-fixes 2018-11-28 08:12:48 +00:00
Ameya Shenoy
e3136c38e1 bumped to version 10.1.73 2018-11-28 07:57:27 +00:00
deepeshgarg007
ebe1e12a82 Codacy issue fixes 2018-11-28 08:21:54 +05:30
Nabin Hait
305c8b1fba Merge pull request #16110 from shreyashah115/fix-timer
[Timesheet] Element selector in Timer
2018-11-27 17:57:46 +05:30
Nabin Hait
ce870316c5 Merge pull request #16112 from rohitwaghchaure/accounts_receivable_summary_print_issue
[Fix] Accounts receivable summary print is not working
2018-11-27 17:57:17 +05:30
Nabin Hait
f642f86982 Merge branch 'hotfix' into accounts_receivable_summary_print_issue 2018-11-27 17:56:49 +05:30
Nabin Hait
96598936ad fix(test): Fixed tests for discount with margin and period closing voucher 2018-11-27 17:48:13 +05:30
deepeshgarg007
c1a3c72b49 final dashboard design 2018-11-27 17:09:12 +05:30
Rohit Waghchaure
10bcd5113c [Fix] Accounts receivable summary print is not working 2018-11-27 16:25:35 +05:30
deepeshgarg007
f31caffa74 Changes in get_dashboard_info 2018-11-27 15:04:12 +05:30
Nabin Hait
3b16dd7377 Merge branch 'staging-fixes' into pr_staging_fixes 2018-11-27 14:19:49 +05:30
Nabin Hait
dfd79b0349 Merge branch 'staging-fixes' into gbm001-item-barcodes-pull 2018-11-27 14:19:20 +05:30
Nabin Hait
15ca2f438f Merge pull request #16029 from Alchez/hotfix-child-task-error
Fix error when trying to convert a task into a group even if no child tasks exist
2018-11-27 14:17:32 +05:30
Nabin Hait
676a2fbc8a Merge branch 'staging-fixes' into hotfix-child-task-error 2018-11-27 14:17:23 +05:30
deepeshgarg007
6372fbba54 Merge branch 'staging-fixes' of https://github.com/frappe/erpnext into supplier-customer-dashboard-fix 2018-11-27 14:06:58 +05:30
Nabin Hait
3854940e42 Merge branch 'staging-fixes' into fix-patch 2018-11-27 13:26:05 +05:30
Nabin Hait
e4cc062cf1 Merge pull request #16109 from rohitwaghchaure/while_pulling_advanced_entry_system_uses_grand_total
[Fix] System allocated grand total amount instead of non zero rounded total for advanced entry in the sales invoice
2018-11-27 13:22:50 +05:30
Nabin Hait
b98d08a2cb Merge pull request #16049 from rohitwaghchaure/incorrect_stock_value_difference_calculation
[Fix] Incorrect stock value difference because of negative stock
2018-11-27 13:21:43 +05:30
Nabin Hait
ccb03fb255 Merge pull request #16073 from deepeshgarg007/receivable-summary
Accounts receivable summary print fix
2018-11-27 13:11:37 +05:30
shreyashah115@gmail.com
5281fe8e50 fix: Element selector 2018-11-27 13:11:30 +05:30
Nabin Hait
72fc1b57be Merge pull request #16083 from Anurag810/new-fix-branch
[fix] delivery note with quantity equal 0 #14211
2018-11-27 13:10:31 +05:30
Nabin Hait
3c31e4ad4b Merge pull request #16088 from rohitwaghchaure/fixed_pos_profile_packing_items
If is pos is enabled and no pos profile then use the item's default warehouse for packing materials
2018-11-27 13:10:14 +05:30
Nabin Hait
6743219dc2 Merge pull request #16094 from rohitwaghchaure/validate_due_date_for_purchase_invoice
[Fix] Due Date cannot be before Posting Date should consider supplier invoice date for purchase invoice
2018-11-27 13:09:16 +05:30
Nabin Hait
5f7b37ee11 Merge pull request #16093 from rohitwaghchaure/manufacturing_settings_permissions_issue
[Fix] No permission for Manufacturing Settings
2018-11-27 13:07:44 +05:30
Rohit Waghchaure
6cc2f52fa4 [Fix] System allocated grand total amount instead of non zero rounded total for advanced entry in the sales invoice 2018-11-27 12:07:03 +05:30
Nabin Hait
dde952d591 Merge pull request #16092 from deepeshgarg007/salary_slip
Salary slip earnings and deductions table bug fix
2018-11-27 11:39:10 +05:30
Nabin Hait
a9f72bd3ce Merge pull request #16108 from KanchanChauhan/indicators-in-leave-applications
[Minor] Indicators in Leave Application
2018-11-27 11:38:44 +05:30
Nabin Hait
9a06543453 Merge branch 'staging-fixes' into indicators-in-leave-applications 2018-11-27 11:38:29 +05:30
Nabin Hait
9a4cf4dce9 Merge pull request #16100 from deepeshgarg007/test-fix
Removed total label from graph
2018-11-27 11:37:30 +05:30
Nabin Hait
f48cf001ed Merge branch 'staging-fixes' into test-fix 2018-11-27 11:37:22 +05:30
Nabin Hait
be65af5dfe Merge pull request #16101 from SaiFi0102/patch-1
Company rename abbr to consider more DocTypes
2018-11-27 11:36:46 +05:30
Nabin Hait
57fa8759ee Merge pull request #16102 from deepeshgarg007/fees
Paid Amount not showing for fees in web portal fix
2018-11-27 11:36:27 +05:30
Nabin Hait
df8fb59511 Merge pull request #16099 from SaiFi0102/SO-Validate-Set-GrossProfit
Set Gross Profit on server-side validation of Sales Order
2018-11-27 11:19:15 +05:30
Nabin Hait
f806cfecaa Merge branch 'staging-fixes' into SO-Validate-Set-GrossProfit 2018-11-27 11:18:54 +05:30
Kanchan Chauhan
2d0b788105 [Minor] Indicators in Leave Application 2018-11-27 10:37:23 +05:30
deepeshgarg007
bc513a8828 Removed paid amount form Fees doctype 2018-11-26 20:43:39 +05:30
deepeshgarg007
a9525de0da paid amount fix in fees 2018-11-26 20:34:32 +05:30
Saif
6a9d9d76ef Company rename abbr to consider more DocTypes 2018-11-26 19:56:13 +05:00
Nabin Hait
78d9fac0ce Merge branch 'staging-fixes' into pr_staging_fixes 2018-11-26 20:25:34 +05:30
Nabin Hait
15951e6e93 Merge branch 'staging-fixes' into gbm001-item-barcodes-pull 2018-11-26 20:25:29 +05:30
Nabin Hait
93595fa60a Merge branch 'staging-fixes' into hotfix-child-task-error 2018-11-26 20:24:47 +05:30
Nabin Hait
91c811f170 Merge branch 'staging-fixes' into new-fix-branch 2018-11-26 20:23:37 +05:30
Nabin Hait
c5064069c7 Merge branch 'staging-fixes' into manufacturing_settings_permissions_issue 2018-11-26 20:23:11 +05:30
Nabin Hait
218fa51dba Merge branch 'staging-fixes' into validate_due_date_for_purchase_invoice 2018-11-26 20:23:00 +05:30
Nabin Hait
9fba32a917 Merge pull request #16098 from rohitwaghchaure/on_uncheck_is_return_clear_reference_number
On disabled is return field clear the reference field
2018-11-26 20:20:30 +05:30
Nabin Hait
73e3138a5b Merge branch 'staging-fixes' into on_uncheck_is_return_clear_reference_number 2018-11-26 20:20:22 +05:30
deepeshgarg007
05c2989698 removed total from graph 2018-11-26 20:19:57 +05:30
Nabin Hait
0ccc05bdf7 Merge pull request #15997 from rohitwaghchaure/address_not_set_from_api
[Fix] Address not set from the API
2018-11-26 20:17:03 +05:30
Nabin Hait
7f02659425 Merge branch 'hotfix' into address_not_set_from_api 2018-11-26 20:16:54 +05:30
Nabin Hait
9170c2daab Merge pull request #15989 from deepeshgarg007/bug-fixes
Minor issue fixes
2018-11-26 20:05:25 +05:30
Nabin Hait
b32abde2ac Merge branch 'staging-fixes' into bug-fixes 2018-11-26 20:05:09 +05:30
Nabin Hait
2598c475ed Merge pull request #15999 from codingCoffee/css
css: build files in v10
2018-11-26 20:02:18 +05:30
Saif Ur Rehman
5fdbc68ca3 Set Gross Profit on server-side validation of Sales Order 2018-11-26 19:32:16 +05:00
Rohit Waghchaure
b4a5993ece On uncheck is return field clear the reference field 2018-11-26 20:02:01 +05:30
Nabin Hait
21983b8432 Merge pull request #16001 from jsukrut/staging-fixes
[FIX][#15018][PATIENT Relation should be unique]
2018-11-26 20:01:19 +05:30
Nabin Hait
bcd0ba0d69 Merge pull request #16041 from surajshetty3416/pos-profile-fix
fix: Add additional condition to get_pos_profile
2018-11-26 19:59:17 +05:30
Nabin Hait
56dc5c1be3 Merge branch 'staging-fixes' into pos-profile-fix 2018-11-26 19:59:07 +05:30
Nabin Hait
212a29ae2c Merge pull request #16028 from rohitwaghchaure/not_able_to_view_general_ledger
[Fix] Not able to view general ledger for purchase invoice
2018-11-26 19:57:24 +05:30
Nabin Hait
25e60f3934 Merge pull request #16044 from ESS-LLP/fix-trial-balance
fix: Trial Balance print
2018-11-26 19:56:27 +05:30
Nabin Hait
4191d7eb52 Merge pull request #16045 from SaiFi0102/GrossProfit-Fix-Buying-Amount-Multiple-Invoice
Fixed get_buying_amount in Gross Profit report:
2018-11-26 19:55:06 +05:30
Nabin Hait
d0af0887be Merge pull request #16051 from SaiFi0102/patch-1
Remove "Test" Letter Head
2018-11-26 19:47:07 +05:30
Nabin Hait
70642a0ae4 Merge pull request #16055 from rohitwaghchaure/fixed_holiday_list_not_working
[Fix] New holiday list form is not working
2018-11-26 19:44:19 +05:30
Nabin Hait
36f266355d Merge branch 'staging-fixes' into fixed_holiday_list_not_working 2018-11-26 19:44:11 +05:30
Nabin Hait
736ce9a176 Merge pull request #16095 from SaiFi0102/BugFix-Rate-Calculation
Fixed error due to incorrect use of 'this' while calculating rate
2018-11-26 19:31:25 +05:30
Saif Ur Rehman
147fa73d3f Fixed incorrect use of 'this' causing errors calculating rate 2018-11-26 18:14:06 +05:00
Rohit Waghchaure
d1a85a3637 [Fix] Due date can not be greter than posting date validation should consider supplier invoice date for purchase invoice 2018-11-26 18:42:29 +05:30
Rohit Waghchaure
15ed7a6351 [Fix] No permission for Manufacturing Settings 2018-11-26 17:31:18 +05:30
Anurag Mishra
e5248b6933 Merge branch 'new-fix-branch' of https://github.com/anurag810/erpnext into new-fix-branch 2018-11-26 17:25:28 +05:30
Anurag Mishra
5b6dd58b3e fixed ZeroDivisionError in sales_order.py 2018-11-26 17:22:50 +05:30
Nabin Hait
fc6194e640 Merge branch 'staging-fixes' into new-fix-branch 2018-11-26 17:16:06 +05:30
Nabin Hait
d5fc05c10b Merge pull request #16090 from frappe/update-stale-bot-1-2
Update stale.yml
2018-11-26 17:15:19 +05:30
Nabin Hait
e8469daf0c Merge branch 'staging-fixes' into update-stale-bot-1-2 2018-11-26 17:14:59 +05:30
deepeshgarg007
bd87903b56 Added condition for default amount 2018-11-26 17:13:59 +05:30
Anurag Mishra
e657fe84b8 making validation generic for sales order,sales invoice,purchase order etc. 2018-11-26 17:13:10 +05:30
Anurag mishra
6ddb15b3df fix(validate): Qty is mandatory in delivery note 2018-11-26 17:13:10 +05:30
Anurag mishra
7b2c445707 Delivery Note fixes 2018-11-26 17:13:10 +05:30
Nabin Hait
059c6f8da5 Merge pull request #16070 from nabinhait/travis-fix-1
Travis fixes
2018-11-26 17:00:10 +05:30
Nabin Hait
73ca3cfca6 fix(test): removed test print 2018-11-26 16:16:42 +05:30
Anurag Mishra
42d3af3bbb making validation generic for sales order,sales invoice,purchase order etc. 2018-11-26 15:19:17 +05:30
deepeshgarg007
533066eb87 Salary slip bug fix 2018-11-26 15:04:21 +05:30
Prateeksha Singh
758ca946fa Update stale.yml 2018-11-26 14:45:54 +05:30
Rohit Waghchaure
3893ba302c If is pos and no pos profile use the item's default warehouse for packing materials 2018-11-26 14:13:24 +05:30
Anurag mishra
66bd5810c5 fix(validate): Qty is mandatory in delivery note 2018-11-26 11:36:57 +05:30
Anurag mishra
bc4574b59d Delivery Note fixes 2018-11-26 11:33:22 +05:30
Nabin Hait
2665c37f38 temp(travis): Print statement to fix travis 2018-11-26 11:05:28 +05:30
Nabin Hait
48e0e19b03 fix(test): Fixed salary slip and sales analytics test cases 2018-11-26 11:05:28 +05:30
Nabin Hait
2508d11097 fix(test): Test cases fixed 2018-11-26 11:05:28 +05:30
Nabin Hait
f77cd54a6c fix(tds): Create tds payable under correct parent 2018-11-26 11:05:28 +05:30
deepeshgarg007
9cdece4ca2 Test case fix and other minor bug fix 2018-11-26 11:05:28 +05:30
deepeshgarg007
5dbb9f5312 Accounts receivable summary print fix 2018-11-23 19:54:08 +05:30
deepeshgarg007
a1cffc3490 minor changes in dashboard 2018-11-23 16:51:35 +05:30
deepeshgarg007
0e8c36473a Added colspan to indicators 2018-11-23 11:22:24 +05:30
deepeshgarg007
920dc1400f Customer/Supplier dashboard fix for multi company setup 2018-11-23 10:17:28 +05:30
Rohit Waghchaure
037a151ef5 [Fix] New holiday list form is not working 2018-11-22 12:57:34 +05:30
Saif
2a2f2742eb Remove "Test" Letter Head 2018-11-21 23:29:09 +05:00
Rohit Waghchaure
6424f47f3b [Fix] Incorrect stock value difference because of negative stock 2018-11-21 23:18:41 +05:30
Ranjith
1879e91148 fix: Trial Balance 2018-11-21 16:04:05 +05:30
Saif Ur Rehman
23eef11cf5 Fixed get_buying_amount in Gross Profit report:
To handle the case where there may be multiple invoices for a single delivery
2018-11-21 15:32:37 +05:00
Suraj Shetty
1eb098caf9 Add additional condition condition to get_pos_profile
- If we have any POS Profile related to the user,
that profile should be used
2018-11-21 14:36:58 +05:30
Rohan Bansal
f838597b5f fix(task): Fix error when trying to convert a task into a group even if no child tasks exist 2018-11-20 13:18:05 +05:30
Rohit Waghchaure
770a13ebc3 [Fix] Not able to view general ledger for purchase invoice 2018-11-20 13:01:52 +05:30
Ranjith
5d2e52c4ef fix: healthcare patch 2018-11-19 20:03:25 +05:30
Jamsheer
64e42e1e88 fix: Patient Appointment - update list view 2018-11-19 13:00:49 +05:30
Jamsheer
ee6b317ab5 fix: Patient Appointment - Code standards 2018-11-19 13:00:49 +05:30
Jamsheer
45695c9bcb fix: Realign Patient Appointment fields 2018-11-19 13:00:49 +05:30
Jamsheer
dc3ae114cd feat: Reschedule - Patient Appointment 2018-11-19 13:00:49 +05:30
Andrew McLeod
f99a68a695 feat: Added unit testing for Item Barcodes in item.py
Adds three different barcodes and barcodes types to a test item and
checks that they are added correctly.
Adds a barcode that already exists, and checks a DuplicateEntryError
is raised.
Adds an invalid EAN barcode and checks InvalidBarcode (a subclass of
ValidationError) is raised.
2018-11-16 13:55:55 +00:00
Andrew McLeod
5607762c0f fix/feat: Allow extension of barcode types (without validation)
Currently, it is difficult to add new custom barcode types for two reasons, both of which relate to validate_barcode in item.py:
- There is a bug where barcode types with a space in, such as Code 128, are split in two (so barcode_type is checked against 'Code' and '128' rather than 'Code 128'). This is fixed by splitting the Options field against a newline, instead of spaces.
- All barcodes are validated against the stdnum.ean library. This only handles EAN-8, EAN-13 and UPC-12 barcodes and any other barcode will fail. Barcodes with no type will continue to not be checked. Barcodes with the default barcode_types of EAN, UPC will continue to be checked. The non-default barcode_types of EAN-13 and EAN-8 will also be checked. The barcode_type is cast to upper case before this check is made so ean, upc, ean-13 and ean-8 will also be validated.
This allows people to add their own barcode types, such as Code 128 and QR codes. Users can add custom validation of these barcodes using the usual hooks, but they cannot remove the standard validation.
2018-11-16 11:08:39 +00:00
Jsukrut
b9a95e29b7 [FIX][#15018][PATIENT Relation should be unique] 2018-11-16 11:30:12 +05:30
Ameya Shenoy
27a0c37963 css: build files in v10 2018-11-15 19:21:30 +00:00
Rohit Waghchaure
f4dc71661d [Fix] Address not set from the API 2018-11-15 17:04:02 +05:30
deepeshgarg007
795686d1cc Merge branch 'staging-fixes' of https://github.com/frappe/erpnext into bug-fixes 2018-11-15 16:30:48 +05:30
Frappe Bot
64b4d98778 Merge branch 'staging-fixes' into staging 2018-11-15 09:43:08 +00:00
Frappe Bot
d9dccaefba bumped to version 11.0.3-beta.24 2018-11-15 09:42:35 +00:00
Frappe Bot
ef745b0197 bumped to version 11.0.3-beta.23 2018-11-15 09:37:17 +00:00
Nabin Hait
0aca5aad14 Merge pull request #15976 from deepeshgarg007/summary
[Fix] Accounts receivable summary print format showing zero values
2018-11-15 14:52:16 +05:30
Nabin Hait
a0a2f58a21 Merge pull request #15985 from adityahase/perf-patch
perf(patch): Use INSERT with ON DUPLICATE KEY UPDATE
2018-11-15 14:50:58 +05:30
Frappe Bot
6647ea270c Merge branch 'staging-fixes' into staging 2018-11-15 09:19:18 +00:00
Frappe Bot
a4fe912382 bumped to version 11.0.3-beta.23 2018-11-15 09:19:18 +00:00
Frappe Bot
98b4a1bc81 Merge branch 'master' into staging-fixes 2018-11-15 09:12:04 +00:00
Frappe Bot
0b697c5298 Merge branch 'hotfix' 2018-11-15 09:04:14 +00:00
Frappe Bot
2426d00dd6 bumped to version 10.1.72 2018-11-15 09:04:14 +00:00
rohitwaghchaure
cc907559d0 Merge pull request #15992 from rohitwaghchaure/code_optimization_for_consolidated_report
Code optimization for consolidated financial statement report
2018-11-15 13:48:17 +05:30
Rohit Waghchaure
704796b1cb Code optimization for consolidated financial statement report 2018-11-15 13:46:18 +05:30
rohitwaghchaure
02a7f8f0b2 Merge pull request #15991 from rohitwaghchaure/fixed_consolidated_conversion_issue
[Fix] Consolidated financial statement report currency conversion issue
2018-11-15 12:56:11 +05:30
Rohit Waghchaure
9d0f90975b [Fix] Consolidated financial statement report currency conversion issue 2018-11-15 12:55:20 +05:30
rohitwaghchaure
93f358778b Merge pull request #15990 from rohitwaghchaure/patch_code_refactor
[Minor] Patch fixes
2018-11-15 12:21:46 +05:30
Rohit Waghchaure
43920530a1 [Minor] Patch fixes 2018-11-15 12:20:27 +05:30
deepeshgarg007
4c366eed23 Minor issue fixes 2018-11-15 12:02:07 +05:30
Deepesh Garg
3b8c84fa75 Merge pull request #15975 from nabinhait/staging-fixes
fix(test): Fixed item discount amount calculation and test cases related to pricing rule
2018-11-15 12:01:09 +05:30
rohitwaghchaure
e907c0d15c Merge pull request #15986 from rohitwaghchaure/added_currency_filter_in_consolidated_report
Added currency filter in consolidated financial statement report
2018-11-15 10:53:02 +05:30
Rohit Waghchaure
a95697f506 Added currency filter in consolidated financial statement report 2018-11-14 19:55:44 +05:30
Aditya Hase
d168a71cfb perf(patch): Use INSERT with ON DUPLICATE KEY UPDATE
update_total_qty_field patch was using UPDATE statement with CASE

Now use INSERT INTO with ON DUPLICATE KEY UPDATE clause which
allows this query to use indexes and update multiple rows per query.
2018-11-14 19:09:07 +05:30
Frappe Bot
e4193030b1 Merge branch 'staging-fixes' into staging 2018-11-14 11:33:03 +00:00
Frappe Bot
fac49983a0 bumped to version 11.0.3-beta.22 2018-11-14 11:32:34 +00:00
rohitwaghchaure
ba97b9b2d8 Merge pull request #15980 from rohitwaghchaure/on_save_allow_transfer_for_manufatured_changed
[Fix] On save Allow Transfer for Manufacture reset to default value even if user has changed manually
2018-11-14 15:12:45 +05:30
rohitwaghchaure
593f3f1756 Merge pull request #15978 from nabinhait/fetch_from_fix
fix(patch): Fetch missing gst hsn code in transactions and set hsn-wise taxes
2018-11-14 15:11:26 +05:30
rohitwaghchaure
5395b164cd Merge pull request #15983 from rohitwaghchaure/fixed_claimed_amount_issue
Claimed amount is not reset on cancel of employee advance
2018-11-14 13:21:11 +05:30
Rohit Waghchaure
047a7123eb Claimed amount is not reset on cancel 2018-11-14 13:20:00 +05:30
Rohit Waghchaure
917dda1b76 [Fix] On save Allow Transfer for Manufacture reset to default value even if user has changed manually 2018-11-14 01:18:41 +05:30
Nabin Hait
367a076fa4 fix(discount): Fixed item discount amount calculation 2018-11-13 18:41:58 +05:30
Nabin Hait
d34bfa8c2c fix(patch): Fetch missing gst hsn code in transactions and set hsn-wise taxes 2018-11-13 18:21:22 +05:30
Frappe Bot
fe62024824 bumped to version 11.0.3-beta.21 2018-11-13 11:41:27 +00:00
Nabin Hait
3409e55d24 Merge pull request #15974 from Alsum/assign-sa
assign-sa-to-group-of-employees
2018-11-13 16:55:17 +05:30
deepeshgarg007
7bc6f3843a Fix for accounts Receivable Summary Showing zero values 2018-11-13 16:54:54 +05:30
Frappe Bot
25a74b8283 Merge branch 'staging-fixes' into staging 2018-11-13 11:23:06 +00:00
Frappe Bot
a29237beeb bumped to version 11.0.3-beta.21 2018-11-13 11:23:06 +00:00
Nabin Hait
7fe4124bb8 fix(field property): Made barcode field non-mandatory in item 2018-11-13 16:48:59 +05:30
Frappe Bot
88c88d6e7c Merge branch 'master' into staging-fixes 2018-11-13 10:59:05 +00:00
Frappe Bot
cb1726d6ec Merge branch 'hotfix' 2018-11-13 10:55:31 +00:00
Frappe Bot
6b78e520d2 bumped to version 10.1.71 2018-11-13 10:55:31 +00:00
Nabin Hait
688758a56f fix(test): Fixed item discount amount calculation and test cases related to pricing rule 2018-11-13 16:13:16 +05:30
alsum
e04a753d53 assign-sa-to-group-of-employees 2018-11-13 11:43:58 +02:00
Nabin Hait
ee887f4db7 Merge pull request #15796 from Alsum/set_current_asset_value
trigger set_current_asset_value when make asset_value_adjustment from asset form
2018-11-13 12:42:28 +05:30
Nabin Hait
ee190e34c2 Update asset_value_adjustment.js 2018-11-13 12:41:36 +05:30
Saif
60ec88bcc8 Added Default Warehouse field that sets all item's warehouse (#15462)
* -Added field def_warehouse that sets warehouse of all items
-Grouped warehouse fields together and put raw materies supplied before items table, it will only show if there are any items supplied

* Set def_warehouse in test_sales_order.py

* Changed from def_warehouse to set_warehouse

* Rest of def_warehouse to set_warehouse
2018-11-13 12:37:53 +05:30
Alchez
ce3340903d Update Delivery Trip status based on visited stops (#15723)
* feat(delivery_trip_status): Update Delivery Trip status based on visited stops

* feat(delivery_trip_status): Fix tests

* feat(delivery_trip_status): Fix allow on submit for status

* feat(delivery_trip_status): Change status mapping

* feat(delivery_trip_status): Fix patch

* Update update_delivery_trip_status.py
2018-11-13 12:22:17 +05:30
Alchez
9f87c441b0 feat(delivery_trip): Create a Delivery Trip by selecting multiple Delivery Notes in list view (#15706) 2018-11-13 12:20:05 +05:30
khushalti
fad08e1bcb [fix] - GL entry not creating on PR if rejected qty mentoned (#15815) 2018-11-13 12:09:32 +05:30
Alchez
6f1fd193eb fix(production_plan): Allow work orders to be cancelled (#15955) 2018-11-13 11:47:23 +05:30
rohitwaghchaure
849169e82b Merge pull request #15969 from rohitwaghchaure/fix_company_dashbord_sales_count
[Fix] Company dashboard sales count condition
2018-11-13 11:37:26 +05:30
Britlog
7d9689cc92 [Fix] Website Conversion factor query (#15866)
* [Fix] Conversion factor query

* Update product.py
2018-11-13 11:36:41 +05:30
Rohit Waghchaure
14ffe8b935 [Fix] Company dashboard sales count condition 2018-11-13 11:35:38 +05:30
Britlog
9e9e37d39b [Fix] Conversion factor in offline POS (#15867) 2018-11-13 11:34:27 +05:30
Deepesh Garg
b65bb5df2e Function renaming, code cleaning and minor fixes (#15938) 2018-11-13 11:28:58 +05:30
Stavros Anastasiadis
a695dad525 Upgrade BOM Stock Report base with Qty to Produce (#15939) 2018-11-13 11:17:41 +05:30
Shreya Shah
89974b221d [Feature] Create Raw Material Request from Sales Order (#15452)
* Add new button to Sales Order form - Request for Raw Materials

* Modify get_work_order_items function

* Commonify functions in Production Plan to make it compatible with new feature

* Create and submit Material Request from Sales Order

* Link Sales Order with Material Request

* Minor

* Rename label

* Fix Codacy

* Modify as per review suggestions

- Move dialog to a new function
- Move checkboxes below other fields

* Minor changes

* Check for permissions

* Add common checkboxes for all items

* Fix codacy

* fix: Travis

* fix: Use variable to store query result

* fix: Add comment before fetching exploded items

* refactor: Break into multiple functions

* test: Add test case
2018-11-13 11:15:03 +05:30
Zarrar
6922415d1b [New Feature]Scan Item Barcode label to quick create/update records in items child table (#15731)
* Update transaction.js

* setup barcode scan

stock entry controller not inherited from transaction.js, need to call setup barcode scan from transaction.js

* fix bug of item_code change always reset qty to 0

when calling frappe.model.set_value(dt,dn,'item_code',xxx), even qty is set, system always reset qty to 0.

* Update transaction.js

* Update transaction.js

* Update transaction.js

* Update transaction.js

* Update transaction.js

* Update transaction.js

* clean up barcode logic for transactions

* call scan_barcode method for stock entry

* separate out logic for searching serial, batch or barcode number

* added scan barcode field in transactions doctype

* search barcode-serial-batch sequence, code rectify

* hide all barcode related field if disabled from settings

* remove print statement

* Update stock_entry.py
2018-11-13 11:11:32 +05:30
Ameya Shenoy
42928f978b fix: work order item sorting (#15967) 2018-11-13 11:04:17 +05:30
Ameya Shenoy
e8d3aa9cc9 Merge pull request #15966 from codingCoffee/frankfurter
fix: changed currency exchange API to frankfurter
2018-11-12 18:35:36 +05:30
Ameya Shenoy
3d58576797 Merge pull request #15963 from codingCoffee/frankfurter
fix: changed currency exchange API to frankfurter
2018-11-12 17:55:48 +05:30
Deepesh Garg
84483ff776 Stock analytics script report (#15630)
* Stock analytics script report

* Codacy Issue Fixes

* Codacy Issue Fixes

* Removed Trailing Whitespaces

* Code cleaning and optimization

* Minor Changes

* Code cleaning and spacing

* Added link for stock analytics in stock.py

* Refactoring and code cleaning

* Codacy issue fixes
2018-11-12 17:05:31 +05:30
Deepesh Garg
a057f4c2a0 Script report for purchase analytics (#15612)
* Purchase Analytics Query Report

* Minor Changes

* Codacy Issue Fixes

* Codacy Issues Fixed

* Code cleaning and optimization

* Indentation Issue Fix

* Code cleaning and better function naming

* Added link for purchase analytics in buying.py

* Added link for production analytics in manufacturing.py

* Commonified purchase-analytics using Analytics class

* Codacy issue fix
2018-11-12 17:01:02 +05:30
rohitwaghchaure
ab76ff0836 Added new option group by voucher(consolidated) in the general ledger report (#15957) 2018-11-12 16:58:24 +05:30
Nabin Hait
5e85ab3b67 Update setup.py 2018-11-12 16:46:12 +05:30
JodeQ
1b8e9cd3bb Permission error for new Sales invoice (#15952)
In version
```
Installed Apps
ERPNext: v11.0.3-beta.20 () (staging)
Frappe Framework: v11.0.3-beta.25 () (staging)
```

When creating a new Sales invoice without healthcare active we have this error
```
Not permitted
Insufficient Permission for Patient
```
Console log
```
Traceback (most recent call last):
  File "/home/frappe/auroraone-v11/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/frappe/auroraone-v11/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/auroraone-v11/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/auroraone-v11/apps/frappe/frappe/__init__.py", line 1007, in call
    return fn(*args, **newargs)
  File "/home/frappe/auroraone-v11/apps/frappe/frappe/desk/search.py", line 53, in search_link
    search_widget(doctype, txt, query, searchfield=searchfield, page_length=page_length, filters=filters, ignore_user_permissions=ignore_user_permissions)
  File "/home/frappe/auroraone-v11/apps/frappe/frappe/desk/search.py", line 149, in search_widget
    as_list=not as_dict)
  File "/home/frappe/auroraone-v11/apps/frappe/frappe/__init__.py", line 1235, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
  File "/home/frappe/auroraone-v11/apps/frappe/frappe/model/db_query.py", line 40, in execute
    raise frappe.PermissionError(self.doctype)
PermissionError: Patient
```
2018-11-12 16:42:05 +05:30
Pawan Mehta
aa0bed16f6 [fix] #14038-Std hours at company level to calculate timesheet hours (#15819)
* [fix] #14038

* codacy fixes

* add end time calc method

* test case and rename function

* Update timesheet.py
2018-11-12 16:40:07 +05:30
Deepesh Garg
6714214951 Server side script report for sales analytics (#15589)
* Sales Analytics Report

* Codacy issue fixes and  name column addition

* Minor Fixes

* Minor Changes

* Codacy Issue Fixes

* Codacy Issue Fixes

* Bug Fixes

* Code cleaning and optimization

* Deleted Duplicate code

* Indentation Issue Fixes

* Added Supplier Condition

* Cleaned code and better function naming

* Added report link for sales analytics in selling.py

* fix(patch): Patch to delete old analytics reports

* feat(refactor): Created class and refactored code using object oriented paradigm

* Column condition fix

* Minor condition fix

* Minor fix

* parent child map for purchase analytics

* Minor Fixes in get_periodic_data

* Used dots for filters instead of brackets

* Minor Bug fix in get_period_date_ranges

* Test Cases for Analytics Report
2018-11-12 16:15:54 +05:30
Ameya Shenoy
438490fd29 fix: changed currency exchange API to frankfurter
- Switched to Frankfurter's public API (frankfurter.app) from
self hosted API (frankfurter.erpnext.org)
2018-11-12 15:15:06 +05:30
Frappe Bot
35ec2469e9 Merge branch 'staging-fixes' into staging 2018-11-09 10:19:21 +00:00
Frappe Bot
9159ee83ca bumped to version 11.0.3-beta.20 2018-11-09 10:19:21 +00:00
Frappe Bot
4df671585b Merge branch 'master' into staging-fixes 2018-11-09 10:11:27 +00:00
Frappe Bot
f001a9eb4f Merge branch 'hotfix' 2018-11-09 10:09:04 +00:00
Frappe Bot
f8a5cfe8d8 bumped to version 10.1.70 2018-11-09 10:09:04 +00:00
alsum
852bd76a58 add set_current_asset_value to onload func 2018-11-08 11:12:33 +02:00
rohitwaghchaure
a88eaa6e20 [Fix] User able to change discount if pricing rule has discount value as zero (#15921) 2018-11-08 13:05:08 +05:30
Alchez
bf20be53ef fix(bom): Display item name in new BOM form (#15783) 2018-11-08 12:54:20 +05:30
Shreya Shah
9e484fbc12 fix(payment-entry): Take default value None for paid_from (#15777) 2018-11-08 12:52:14 +05:30
patilsangram
667f0fbd6d [fix] Invoice/Delivery note customer po_no overwritten by Sales order null po_no (#15785) 2018-11-08 12:51:41 +05:30
Ameya Shenoy
49647bfecc fix: develop version should be 12 (#15928) 2018-11-08 12:48:35 +05:30
Nabin Hait
6ff2f395f5 fix(gle): Post gl entry for booking COGS from Sales Invoice even if grand_total is zero (#15825) 2018-11-08 12:30:44 +05:30
Zarrar
5be6d19f4d [Minor] Display Discount Amount when Tax table is empty (#15812)
* show discount amount even when tax table is empty

* negate the value for discount while printing
2018-11-08 12:16:26 +05:30
Alchez
068ba191e7 [Feature] Route optimization for Delivery Trip stops (#15566)
* Minor improvements

* [Feature] Route optimization for Delivery Trip stops

* Process and optimize the entire route, with or without locks

* Form sets of routes for optimization based on applied lock positions

* Re-arrange stops based on the optimized routes and lock positions

* Set delay times between stops - offset estimation times by delays cumulatively

* Fix codacy errors

* Fix travis

* feat(route_optimization): Set estimated route distance from Google Maps

* feat(route_optimization): Add tests for route lists

* feat(route_optimization): Fix tests
2018-11-08 11:57:05 +05:30
Shreya Shah
3f6eb6b393 fix: If party type is Shareholder, set appropriate name field (#15916) 2018-11-08 11:51:13 +05:30
Frappe Bot
823e754565 Merge branch 'master' into staging-fixes 2018-11-07 11:26:11 +00:00
Frappe Bot
ccff3e2aec Merge branch 'hotfix' 2018-11-07 11:26:10 +00:00
Frappe Bot
7f37d26f05 bumped to version 10.1.69 2018-11-07 11:26:10 +00:00
Shreya Shah
c704630d5f fix: Return default if company not found (#15915) 2018-11-06 17:24:45 +05:30
Ameya Shenoy
96a2f00c07 Merge branch 'staging-fixes' into staging 2018-11-06 11:13:36 +00:00
Ameya Shenoy
675636cd03 bumped to version 11.0.3-beta.19 2018-11-06 11:13:36 +00:00
Ameya Shenoy
0c42f99b6f Merge pull request #15920 from rohitwaghchaure/fix_patch_ascii_code_error
[Fix] Patch, ascii codec error
2018-11-06 16:35:21 +05:30
Rohit Waghchaure
56bf39bfea [Fix] Patch 2018-11-06 16:32:29 +05:30
Ameya Shenoy
65797bca64 Merge branch 'master' into staging-fixes 2018-11-06 11:02:08 +00:00
Ameya Shenoy
1a41929c6b Merge branch 'hotfix' 2018-11-06 11:02:04 +00:00
Ameya Shenoy
a97a520aa8 bumped to version 10.1.68 2018-11-06 11:02:04 +00:00
rohitwaghchaure
b5ba867b3f Merge pull request #15917 from nabinhait/encoding-issue
fix(encoding): Fixed encoding issue in financial statements
2018-11-06 15:37:23 +05:30
rohitwaghchaure
9eafe8c23e Update financial_statements.py 2018-11-06 13:28:18 +05:30
Nabin Hait
614b042ed3 fix(encoding): Fixed encoding issue in financial statements 2018-11-06 11:48:51 +05:30
Faris Ansari
0fb943181e Merge pull request #15910 from netchampfaris/marketplace-fixes-3
Hub fixes
2018-11-05 19:19:23 +05:30
Faris Ansari
d6b664f7ee fix(hub): Prevent registered actions 2018-11-05 19:18:48 +05:30
rohitwaghchaure
1b2ceadc93 [Fix] Asset date validation (#15887)
* [Fix] Asset date validation

* Update asset.py
2018-11-05 16:04:04 +05:30
Faris Ansari
0d08da50c6 fix: Refresh PageContainer component based on current route 2018-11-05 15:47:26 +05:30
Nabin Hait
3e6663d47e fix(serial no): Set supplier info based on pur invoice if serial no is created from Purchase Invoice (#15820) 2018-11-05 14:01:59 +05:30
Faris Ansari
a22e16dbe3 Merge pull request #15892 from netchampfaris/marketplace-fixes-1
fix: Use frappe.utils.make_event_emitter
2018-11-05 13:48:16 +05:30
Ameya Shenoy
4a6768791b Merge branch 'staging-fixes' into staging 2018-11-05 06:50:34 +00:00
Ameya Shenoy
5ed0257ce2 bumped to version 11.0.3-beta.18 2018-11-05 06:50:33 +00:00
Ameya Shenoy
4a75d58d89 Merge branch 'master' into staging-fixes 2018-11-05 06:45:04 +00:00
Ameya Shenoy
eeb66dfc8e Merge branch 'hotfix' 2018-11-05 06:40:25 +00:00
Ameya Shenoy
59f16bc942 bumped to version 10.1.67 2018-11-05 06:40:25 +00:00
Shreya Shah
6a206225cb Merge pull request #15902 from agritheory/agritheory-restrict_to_domain
Doctypes in domains that are in beta are now restricted to that domain
2018-11-05 10:56:39 +05:30
Tyler Matteson
d14e46ef02 Doctypes in domains that are in beta are now restricted to that domain
non-profit, agriculture, healthcare, hospitality, education

Please enter the commit message for your changes. Lines starting
2018-11-04 08:39:52 -05:00
rohitwaghchaure
e77f38e7e2 Merge pull request #15894 from rohitwaghchaure/fix_update_claimed_amount
Column ‘claimed_amount’ cannot be null
2018-11-02 18:14:08 +05:30
Rohit Waghchaure
598d34445f [Fix] Column ‘claimed_amount’ cannot be null 2018-11-02 16:02:33 +05:30
Faris Ansari
68dbf7f99c fix: Use frappe.utils.make_event_emitter 2018-11-02 13:30:51 +05:30
rohitwaghchaure
c1d255e7bc Merge pull request #15882 from Zlash65/fixtds
[Minor] TDS not calculated properly fix
2018-11-02 13:18:09 +05:30
Zarrar
16d45c8e2e safe encode non ascii characters (#15755) 2018-11-02 13:17:24 +05:30
Navdeep Ghai
768513f2f9 fixed divided by zero error (#15885) 2018-11-02 12:19:05 +05:30
rohitwaghchaure
dcb71a61ad [Fix] Payment entry not able to submit (#15859) 2018-11-02 12:12:42 +05:30
Charles-Henri Decultot
a89bce0b6e Encoding correction (#15877) 2018-11-01 13:18:49 +05:30
Zlash65
ab9852d31a tds not calculated appropriately 2018-11-01 11:40:15 +05:30
Shreya Shah
9f931780a2 Merge pull request #15868 from ESS-LLP/fix-membership
fix: Membership - allow system users to create membership
2018-11-01 10:54:32 +05:30
Zarrar
92a4ff4e81 Merge pull request #15874 from shreyashah115/portal-fixes
Add overdue status for sales order
2018-11-01 10:46:08 +05:30
Ameya Shenoy
46e618bc6e Merge branch 'staging-fixes' into staging 2018-10-31 13:51:24 +00:00
Ameya Shenoy
9f20f777b2 bumped to version 11.0.3-beta.17 2018-10-31 13:51:24 +00:00
Ameya Shenoy
961849beb4 Merge branch 'master' into staging-fixes 2018-10-31 13:43:12 +00:00
Ameya Shenoy
3f32218bc0 Merge branch 'hotfix' 2018-10-31 13:35:59 +00:00
Ameya Shenoy
b4bff7e298 bumped to version 10.1.66 2018-10-31 13:35:58 +00:00
deepeshgarg007
78b273af43 [Bug-Fix] Cannot Save Bank Statement Transaction Entry (#15793)
* Create bank settings only if bank name is available

* Minor bug-fix in validate_overlap
2018-10-31 18:12:03 +05:30
Shreya Shah
41c5fda196 fix(sms-center): Fix db query (#15774) 2018-10-31 18:04:30 +05:30
Shreya Shah
305c82bd8d fix(medical-record): Remove z-index property (#15790) 2018-10-31 18:02:55 +05:30
rohitwaghchaure
cd11bdfdbb [Fix] Supplier wise sales analytics report not showing item details which is added in purchase invoice with update stock (#15869) 2018-10-31 18:02:00 +05:30
Shreya Shah
0c0e49a421 fix: Fix fieldnames in template (#15860) 2018-10-31 18:00:09 +05:30
rohitwaghchaure
3f398d24f3 [Fix] Precision issue, not able to submit the stock entry (#15863) 2018-10-31 17:58:26 +05:30
Shreya
e3a7c68d4f fix(portal): Add overdue status for sales order 2018-10-31 16:00:27 +05:30
Ranjith
f01bf9048d fix: Membership - allow system users to create membership for existing Members 2018-10-31 14:33:28 +05:30
Ameya Shenoy
71ede099ea Merge branch 'staging-fixes' into staging 2018-10-30 12:53:35 +00:00
Ameya Shenoy
d45fef5423 bumped to version 11.0.3-beta.16 2018-10-30 12:53:35 +00:00
Ameya Shenoy
6178b79555 Merge branch 'master' into staging-fixes 2018-10-30 12:48:45 +00:00
Ameya Shenoy
d9a82738d0 Merge branch 'hotfix' 2018-10-30 12:48:42 +00:00
Ameya Shenoy
1f7a5dcd07 bumped to version 10.1.65 2018-10-30 12:48:42 +00:00
Shreya Shah
452619c668 fix(report): Return if not list (#15849) 2018-10-30 11:26:01 +05:30
rohitwaghchaure
dca4b294bd Merge pull request #15853 from rohitwaghchaure/delete_button_not_working_for_print_in_mobile
[Fix] Delete button not working in POS for mobile
2018-10-29 16:52:34 +05:30
Rohit Waghchaure
152a0c86b0 [Fix] Delete button not working in POS for Ipad 2018-10-29 16:50:18 +05:30
Shreya Shah
85a9b52dfa Merge pull request #15789 from deepeshgarg007/production-analytics
[Bug-fix]Production analytics
2018-10-29 15:49:19 +05:30
Shreya Shah
69bbe1995c Update production_analytics.py 2018-10-29 15:38:21 +05:30
rohitwaghchaure
9d0dba5569 Merge pull request #15851 from frappe/pos-delete-fix
fix: Delete button in POS mobile
2018-10-29 15:19:11 +05:30
deepeshgarg007
7b91f9fa0c Bug Fixes 2018-10-29 15:16:25 +05:30
Faris Ansari
3df1327b94 fix: Delete button in POS mobile
Delete button was covered by page-actions container
2018-10-29 15:15:10 +05:30
Shreya Shah
81cdd967d7 Merge pull request #15794 from ashish-greycube/patch-1
Update employee_advance.py
2018-10-29 14:38:21 +05:30
alsum
27e7c15c16 trigger set_current_asset_value when make asset_value_adjustment from asset form 2018-10-24 13:23:34 +02:00
ashish-greycube
4d47c63db1 Update employee_advance.py
https://github.com/frappe/erpnext/issues/13694
Cancel of  already paid "Expense Claim" gives error IntegrityError: (1048, u"Column 'claimed_amount' cannot be null")
Sol: claimed_amount should be flt
2018-10-24 16:35:31 +05:30
Ameya Shenoy
9750d5c184 Merge branch 'staging-fixes' into staging 2018-10-23 12:56:51 +00:00
Ameya Shenoy
6adcfa6032 bumped to version 11.0.3-beta.15 2018-10-23 12:56:51 +00:00
Ameya Shenoy
3643e7b1b4 Merge branch 'master' into staging-fixes 2018-10-23 12:52:48 +00:00
Ameya Shenoy
38eaaade89 Merge branch 'hotfix' 2018-10-23 12:52:46 +00:00
Ameya Shenoy
2a98e59bd4 bumped to version 10.1.64 2018-10-23 12:52:46 +00:00
Ameya Shenoy
03348364e9 Merge pull request #15739 from kennethsequeira/hotfix
Fix for "Improve this page" incorrect link generated in v10 sites
2018-10-23 18:05:25 +05:30
Ameya Shenoy
881bb4646b Merge branch 'staging-fixes' into staging 2018-10-23 08:05:33 +00:00
Ameya Shenoy
4293d17602 bumped to version 11.0.3-beta.14 2018-10-23 08:05:33 +00:00
Ameya Shenoy
ca66c7ba14 Merge branch 'master' into staging-fixes 2018-10-23 08:01:13 +00:00
Ameya Shenoy
83fd31973f Merge branch 'hotfix' 2018-10-23 07:58:12 +00:00
Ameya Shenoy
ac64b39562 bumped to version 10.1.63 2018-10-23 07:58:11 +00:00
Ameya Shenoy
c73c576536 Merge pull request #15759 from codingCoffee/salesperson
fix(): fetch correct warehouse for item in report
2018-10-23 13:25:42 +05:30
Shreya Shah
669c5d0298 Merge pull request #15724 from shreyashah115/fix-leave
Do not consider current leave application while submitting leave
2018-10-23 12:31:02 +05:30
Faris Ansari
d3e3c1ba72 Merge pull request #15768 from rohitwaghchaure/market_place_settings_error
[Fix] Marketplace settings permission error
2018-10-23 12:07:21 +05:30
Rohit Waghchaure
55416e08f1 [Fix] Marketplace setting permission error 2018-10-23 11:52:06 +05:30
Shreya
1b105e2575 Add test case 2018-10-23 11:45:57 +05:30
Shreya
60d8a0da1e fix(leave-status): Do not consider current leave application while submitting 2018-10-23 11:45:57 +05:30
Shreya Shah
9db75ecde2 Merge pull request #15766 from Zlash65/fix-mod
[Minor] Travis fix
2018-10-23 11:44:33 +05:30
Zlash65
635d4dbebe subscriber deprecated test case fixes 2018-10-23 11:00:19 +05:30
rohitwaghchaure
cf076f4692 Merge pull request #15753 from Zlash65/fix-mod
[Minor] Field name fix to fetch Supplier
2018-10-23 09:45:39 +05:30
rohitwaghchaure
034429b34d Merge pull request #15756 from rohitwaghchaure/fixed_allow_edit_rate
[Fix] User able to edit the rate in offline POS even if it has no permissions
2018-10-23 09:43:57 +05:30
Ameya Shenoy
a0e533ede5 Merge branch 'master' into staging-fixes 2018-10-22 10:37:14 +00:00
Ameya Shenoy
874866e9f9 Merge branch 'hotfix' 2018-10-22 10:34:35 +00:00
Ameya Shenoy
c365ce8f21 bumped to version 10.1.62 2018-10-22 10:34:35 +00:00
Ameya Shenoy
3a11f34355 fix(): fetch correct warehouse for item in report
Fix 'Sales Person-wise Transaction Summary' Report by fetching the
correct Warehouse for the Item fron the respective, Sales Order/Sales
Invoice/ Delivery Note
2018-10-22 10:15:07 +00:00
Nabin Hait
91eac5a7cf fix(report): Optimization for financial statements 2018-10-22 15:05:40 +05:30
Rohit Waghchaure
aef7a6ec44 [Fix] User able to edit the rate in offline POS even if it has no permissions 2018-10-22 13:51:32 +05:30
Ranjith Kurungadam
ac6e3a69f9 fix: Serial No- allow editing SO, track changes (#15741) 2018-10-22 12:06:54 +05:30
Zlash65
473437931c field name fix 2018-10-22 11:22:12 +05:30
Ameya Shenoy
4215b85e46 Merge branch 'staging-fixes' into staging 2018-10-19 12:56:48 +00:00
Ameya Shenoy
7e97230c92 bumped to version 11.0.3-beta.13 2018-10-19 12:56:48 +00:00
Ameya Shenoy
bbfdc13ab7 Merge branch 'master' into staging-fixes 2018-10-19 12:48:18 +00:00
Ameya Shenoy
6192d24235 Merge branch 'hotfix' 2018-10-19 12:48:17 +00:00
Ameya Shenoy
24fe7286fc bumped to version 10.1.61 2018-10-19 12:48:16 +00:00
Nabin Hait
5d1171678e fix(perpetual inventory): Get warehouse account map only if perpetual inventory enabled (#15743)
* fix(perpetual inventory): Get warehouse account map only if perpetual inventory enabled

* fix(perpetual inventory): Get warehouse account map only if perpetual inventory enabled
2018-10-19 18:03:13 +05:30
Kenneth Sequeira
991c121b57 added source link for ERPNext docs 2018-10-19 14:31:21 +05:30
Kenneth Sequeira
23ec18e3e4 added docs_app variable to point docs to foundation app 2018-10-19 03:28:12 +05:30
Saif
b4cf72c770 Adding "Include UOM" in Reports with Qty and Rates (#15541)
* Added Include UOM field for Stock Balane, Stock Ledger and Stock Projected Qty

* Add columns in result list-of-lists instead of converting reports to list-of-dicts

* For requested changes
-Merged conversion factor query with item detail queries
-Ensuring snail_case
-Made columns consistently list-of-dicts
2018-10-18 17:59:47 +05:30
Saif
3c9155e406 [Minor Fix] Force toggle display Net Total field when default taxes are fetched (#15532)
* Minor fix for the problem that Net Total, Net Rate, Net Amount field would not be shown when default taxes were fetched

* Prevent net_rate from becoming NaN

* -Fixed problem that party_account_currency was not set in mapped document
-Fixed problem that discount amount was not recalculated (in mapped document)
-Fixed problem that set_dynamic_fields would work only on certain condition that led to showing Total (Company Currency) field even when using company currency
2018-10-18 17:57:56 +05:30
deepeshgarg007
25edac451d Production Analytics Query Report (#15673)
* Production Analytics Query Report

* Changes in production analytics report

* Updated json file and other changes
2018-10-18 17:43:41 +05:30
Raffael Meyer
25e9db5e81 Do not display gender for companies (#15728) 2018-10-18 16:49:49 +05:30
Nabin Hait
500ddc94c7 fix(gle): GL Entry for invoices before introduction of rounding_adjustment (#15732) 2018-10-18 16:48:28 +05:30
Charles-Henri Decultot
7a7615ed66 Safe encode payer name (#15726) 2018-10-18 12:28:06 +05:30
Aditya Hase
007fbfbfb7 [Feature] ERPNext Quickbooks Migrator (#15718)
* Create QuickBooks Connector Single DocType

* Create interface for user authorization and obtaining authorization code

* Obtain Access token using authorization code

* Fetch a random customer

* Schedule fetching as a background job

* Save fetched customer

* Fetch all customers, take care of pagination

* Save fetched customers

* Create a custom field for storing Quickbooks ID

* Don't save already saved customers

* Commit every successful insert

* No need of allow_guest=True

* Fetch Items as well

* Store Customer Addresses as well.

* Remove redundant custom field creation code

* Stupid refactoring

* Some more refactoring

* Fetch and Save Suppliers as well

* Save accounts. Really a hack as of now.

* Fetch and save invoices, Take care of child items as well

* Fetch Taxes as well

* Set currency on Sales Invoice

* Correctly Link Items, Handle markups

* Don't enqueue, Need to wait forever for testing sometimes

* Set margin rate correctly

* Correct fieldname is tax_amount not amount

* Fetch with maximum possible batch size

* Don't print unnecessary info

* Fetch Journal Entries

* Fetch Purchase Invoices (Bill)

* Don't perform reauthentication if you already have an access_token

* Don't need those print statements anymore

* Refresh access_token if request fails

* Fetch Payment Entry(Payment)

* Map QB items to ERPNext rather than other way around

* Don't need a huge comment block as of now

* Fetch Payment Entries against Purchase Invoices (BillPayment)

* Rename Quickbooks Connector to Migrator

* Make oauth settings configurable

* Make company configurable

* Make default accounts configurable

* Fetch accounts and other masters separately

* Show realtime progress

* Check if entries exist before attempting insert

* Suppress other annoying messages

* Tracebacks are good for health

* Don't want rounded total

* Don't call fetch after authorization (Need to somehow separate these)

* Make credit_to account payable

* When generating payment entry mention bank_account as well

* Cleanup

* Add custom buttons and reflect current state in form ui

* Show necessary fields on form depending on the current state

* Cleanup

* Minor fixes

* Set income and expense account on items.

* Set currency for Account.

* Stupid VSCode

* Remove redundant code

* Check for existing Payment and BillPayment correctly

* Cache API response for faster development

* Don't maintain stock for now, Seems to solve the issue with 'Stock Received but not billed'

* Cleanup

* Add methods to remove inserted data completely (Development)

* Don't commit in every iteration

* Set account head based on TaxRate in Sales Invoice

* Fetch and cache TaxCode

* Add methods to fetch TaxCode and TaxRate from cache

* Set item wise tax breakup, Don't use Actual Tax

* Use both TaxRateLists

* Set Itemwise tax on Purchase Invoice as well

* Set bank_amount, while creating payment entries

* Remove print statements

* Add Shipping in taxes child table of Sales Invoice

* Set posting date on Payment Entries against Invoices

* Fetch and save expenses as Journal Entries

* Fetch and save Deposits as Journal Entries

* Fetch and Save Credit and Debit Notes

* Fetch and save SalesReceipt

* Record Shipping as Item instead of Tax

* Minor Fixes

* Fetch Advance Payments

* Set account_type during Account creation

* Choose receivable account in Invoice based on currency

* Remove receivable_account field

* Account type is already set during account creation

* Set receivable account based on currency in Sales Receipt and Credit Memo

* Set receivable account on Customer

* Save Company Preferences

* Set shipping_account based on company preferences

* Set cost center in Sales Invoice Items and Taxes

* Make Account name unique in case of duplicate account name

* Fetch and Save TaxPayment as Journal Entry

* Record UndepositedFunds Account in cache if found

* Credit UndepositedFunds account when mentioned in Deposit

* Debit Cashback account as well if mentioned in Deposit

* Set currency conversion rate

* Set is_group field correctly for accounts

* Preserve account hierarchy

* Use quickbooks_id and company together for filtering

* Make new custom field 'company' on Supplier Customer and Item

* Use comapny field for filtering Customer, Item, Supplier

* Shipping Account is only available if shipping is enabled for comapny

* Invoice might not have TxnTaxDetail.TaxLine

* Lookup TaxRate account correctly

* TaxCode might not have SalesTaxRateList PurchaseTaxRateList or Both

* TaxCode might not have SalesTaxRateList and PurchaseTaxRateList

* Remove unnecessary UI elements

* Allow multiple companies to have customers with same name

* Refactor account_type

* Create a leaf an account for every group account

* Item and Tax list creation needs more information

* Supports discount in Invoice

* Save Invoice as Journal Entry when itemwise details are unavailable

* Credit=True represents a refund rather than charge

* Mode of Payment not synced, setting as Cash for now

* Tax code may also be set for an entire invoice

* Fetch General Ledger Report correctly

* Refactor fetching entries from General Ledger Report

* Tax Payment is the same as Sales Tax Payment and Purchase Tax Payment

* append_number_if_name_exists is stupid, Reimplementing

* Don't guess credit/debit for Tax Payment and Advanced Payment

* Bill Payment shouldn't assume full payment

* Save Payment as Journal Entry

* Make Client ID and Client Secret Default

* Remove unused python imports

* removed are_accounts_synced()

* Don't store translated values in database

* Endpoints as a field

* Major refactor - functions to methods

* Major Refactor Functions to Methods

* Major Refactor Fix Stuff

* Minor Changes

* Save Refund As well

* Minor Refactor (SI varations to SI, PI variations to PI)

* Record Inventory Qty Adjust Entries

* QBM Final Touches

* Make changes suggested in review
2018-10-17 17:50:00 +05:30
rohitwaghchaure
e2afbb7abe Merge pull request #15703 from SaiFi0102/AR-AP-PDC-Fix
[For staging-fixes] Fixed PDC data in AR/AP report
2018-10-17 15:57:28 +05:30
Ameya Shenoy
961b7dee9d Merge branch 'staging-fixes' into staging 2018-10-17 09:44:11 +00:00
Ameya Shenoy
a7a32d7400 bumped to version 11.0.3-beta.12 2018-10-17 09:44:11 +00:00
Ameya Shenoy
77b60928bf Merge branch 'master' into staging-fixes 2018-10-17 09:39:31 +00:00
Ameya Shenoy
bbd8b04012 Merge branch 'hotfix' 2018-10-17 09:04:11 +00:00
Ameya Shenoy
bb1b6b42e2 bumped to version 10.1.60 2018-10-17 09:04:11 +00:00
Ameya Shenoy
4fdbff7456 Merge pull request #15547 from Zlash65/demo-refactor
Demo data refactor
2018-10-16 17:34:09 +05:30
deepeshgarg007
0cbb9b54fa Deprecating subscriber doctype (#15695)
* Depricating subscriber doctype

* Removed naming series
2018-10-16 14:39:16 +05:30
Shreya Shah
8e71074e1c fix(report): Add column for Item Name (#15702) 2018-10-16 14:36:49 +05:30
Shreya Shah
e45868a3c6 fix(discount-amount): Print hide discount_amount if print without amount (#15705) 2018-10-16 14:34:56 +05:30
Shreya Shah
ff0deedca9 fix(discount-amount): Print hide discount_amount if print without amount (#15704) 2018-10-16 14:34:30 +05:30
Shreya Shah
22731e39ba Merge pull request #15376 from jodeq/show_project-attachments-in-portal
[Proposal] Show project attachments in portal view
2018-10-16 14:29:51 +05:30
Shreya Shah
bfb88f7839 Merge pull request #15701 from shreyashah115/item-stock
Add column for Item Name in Item Price Stock report
2018-10-16 14:22:46 +05:30
Shreya
82660913a5 fix(report): Add column for Item Name 2018-10-16 12:15:56 +05:30
Shreya
8aca56836b fix(margin): Make user avatar display in line 2018-10-16 12:00:46 +05:30
rohitwaghchaure
19be730b9c Merge pull request #15700 from joeirimpan/staging-fixes
feat: Add provision for prebilled subscription invoices
2018-10-16 11:36:29 +05:30
rohitwaghchaure
a5a926967b Update accounts_receivable.py 2018-10-16 11:27:23 +05:30
Joe Paul
666e6e665b feat: Add provision for prebilled subscription invoices
(cherry picked from commit db33e6304d)
2018-10-16 10:17:40 +05:30
deepeshgarg007
4bb90add1d Currency symbol bug fix (#15698) 2018-10-15 19:07:49 +05:30
Nabin Hait
44ec05f79b fix(bom): deadlock issue via bom replace tool (#15694) 2018-10-15 18:56:16 +05:30
Charles-Henri Decultot
615571dd21 Add safe decode for payer name (#15692) 2018-10-15 18:26:02 +05:30
Bibin
7844b79274 [Bug-Fix] accounts_receivable.html (#15688)
* Update accounts_receivable.html

In the print format and PDF the total was showing as 0 (Zero) , when I made these changes it fixed the issue

* Update accounts_receivable.html
2018-10-15 18:25:26 +05:30
deepeshgarg007
7c443264a4 Currency symbol bug fix (#15690) 2018-10-15 18:22:28 +05:30
JodeQ
10dfd4a48f Show project attachments in portal view 2018-10-15 14:28:27 +02:00
Ameya Shenoy
3185b37360 Merge branch 'staging-fixes' into staging 2018-10-15 12:24:12 +00:00
Ameya Shenoy
8d0195246d bumped to version 11.0.3-beta.11 2018-10-15 12:24:12 +00:00
Ameya Shenoy
4fa58359c8 Merge pull request #15689 from codingCoffee/pat
fix(patch): reload patient
2018-10-15 17:49:42 +05:30
Ameya Shenoy
102eb998ac fix(patch): reload healthacre doctypes
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
2018-10-15 17:40:02 +05:30
Nabin Hait
3c29967d27 Fixed merge conflict 2018-10-15 15:43:21 +05:30
Nabin Hait
ea75295bb3 Merge branch 'hotfix' 2018-10-15 15:41:25 +05:30
Nabin Hait
d2c643eb0b bumped to version 10.1.59 2018-10-15 16:11:25 +06:00
rohitwaghchaure
94fcb0e9f9 [Enhance] Add user image in the employee from the user (#15680) 2018-10-15 14:57:46 +05:30
Jamsheer
2a966f26af fix: patch - change healthcare desktop icons (#15683) 2018-10-15 14:54:29 +05:30
Ranjith Kurungadam
741bd29b74 fix: Patient Appointment Calendar (#15684) 2018-10-15 14:52:38 +05:30
rohitwaghchaure
0d2a4c6a59 [Fix] TDS Payable Monthly report is not working (#15666) 2018-10-15 11:09:17 +05:30
deepeshgarg007
42510a411f [Bug-Fix]V11 Accounts Receivable print showing zero values (#15667)
* Bug Fix

* Print report bug fixes
2018-10-15 11:08:04 +05:30
rohitwaghchaure
3362d6b948 [Fix] Precision issue in the expense claim (#15678) 2018-10-15 11:07:13 +05:30
Mangesh-Khairnar
8c62ab4af0 [Enhancement] Email birthday reminder (#15559)
* Update hooks.py

* modified date for reload_doc (#15027)

* Single email for multiple birthdays and test
2018-10-11 17:06:10 +05:30
Shreya Shah
314c97cbf1 Fix for supplier quotation (#15659) 2018-10-11 16:59:40 +05:30
Alchez
a16f0f4423 fix(item_defaults): handle multiple item defaults for a company (#15634) 2018-10-11 16:56:46 +05:30
Charles-Henri Decultot
64b6421fce Add event in transaction base correction (#15631) 2018-10-11 16:54:26 +05:30
Charles-Henri Decultot
6c743bebf2 Check for prefix before return EcritureNum (#15629) 2018-10-11 16:51:29 +05:30
Charles-Henri Decultot
50447b195d Compatibility with Py2 (#15653) 2018-10-11 16:48:38 +05:30
Shreya Shah
e9890a3ec8 fix(patch): Check if meta object has naming_series field (#15651) 2018-10-11 16:28:59 +05:30
Faris Ansari
4833b4c274 fix: Default Series in naming series patch (#15656) 2018-10-11 16:27:05 +05:30
Stavros Anastasiadis
a398d6bf4f Allow Same Item Multiple Items (#15657) 2018-10-11 16:25:37 +05:30
Ameya Shenoy
dc279ded15 Merge branch 'staging-fixes' into staging 2018-10-11 06:58:13 +00:00
Ameya Shenoy
d791af8331 bumped to version 11.0.3-beta.10 2018-10-11 06:58:13 +00:00
rohitwaghchaure
b1241caf48 Merge pull request #15650 from rohitwaghchaure/fix_gst_state_issue
[Fix] Nontype object has no attribute gst_state
2018-10-11 10:53:46 +05:30
Rohit Waghchaure
b6a735e021 [Fix] Nontype object has no attribute gst_state 2018-10-11 10:40:34 +05:30
Shreya Shah
785f1aa96d fix(print): Update idx if grouping same items (#15647) 2018-10-11 10:14:25 +05:30
Shreya Shah
2291323c65 fix(shipping-address-display): Fetch shipping address display as per the shipping address (#15643) 2018-10-11 10:13:27 +05:30
deepeshgarg007
1cb1074f6b Bug Fix (#15640) 2018-10-10 16:15:30 +05:30
Sagar Vora
d92f3ac480 Fix 'transporter info' section in Delivery Note (#15565)
- create is_transporter checkbox in supplier doctype
- new field transporter (supplier with is_transporter checked)
- created fields driver and driver_name
- removed GST India fields from core doctype
- removed readonly & allow_on_submit from fields (delivery trip applicable only for in-house delivery)
- read_only transporter_name field (kept for backwards compatibility)
- made necessary changes in delivery_trip implementation
- hidden section's fields from print (preserving v10 convention)
- added transporter field to 'Driver' doctype
- added queries for transporter and driver fields
- GST India fields in regional module
- Fix e-waybill report
2018-10-10 14:51:26 +05:30
Shreya Shah
dd87e0f1e2 fix(leave-type): Drop column max_days_allowed (#15642) 2018-10-10 14:48:49 +05:30
rohitwaghchaure
4cfff7829b Added validation to check duplicate student leave application (#15636) 2018-10-10 14:47:48 +05:30
Shreya Shah
3855156b7d fix(project): If Project has no Tasks, let the status be set as Completed (#15639) 2018-10-10 14:45:40 +05:30
Jamsheer
14c6ab0ee9 [fix] Healthcare field and desktop icon (#15638)
* Test Inpatient Record - Fix

* Test Inpatient Record - Fix

* Healthcare - Patch rename_healthcare_doctype_and_fields - Updated

* Healthcare - Desktop Icons - Updated

* Healthcare - Patch change  in healthcare desktop icons

* Healthcare Util - fix - appointments valid in fee validity

* Healthcare Settings - field label change

* Patient allow rename

* fix: remove unused variable
2018-10-10 14:44:36 +05:30
Zlash65
6a8957b430 item data updated with retail data 2018-10-10 14:28:17 +05:30
Zlash65
62592d3c44 setup data for retail added 2018-10-10 14:28:17 +05:30
Zlash65
fd9c451909 company name picked up dynamically, domainification 2018-10-10 14:28:17 +05:30
Zlash65
d1fbaf8f32 custom field added for item - domainification, password changed 2018-10-10 14:28:17 +05:30
Zlash65
275ef826a4 codacy fixes 2018-10-10 14:28:17 +05:30
Zlash65
8b1133cb24 item data fix for default supplier, exception handling for purchase order 2018-10-10 14:28:17 +05:30
Zlash65
d080a17961 minor random trigger changes and exception handling 2018-10-10 14:28:16 +05:30
Zlash65
e64dcfc2f9 timesheet logic changed to job card 2018-10-10 14:28:16 +05:30
Zlash65
e895845ae1 import fix 2018-10-10 14:28:16 +05:30
Zlash65
523f77e82b make_rm_stock_entry fix 2018-10-10 14:28:16 +05:30
Zlash65
dcf7401104 random time fix and other minor fixes 2018-10-10 14:28:16 +05:30
Zlash65
143d4da901 Production Plan fix 2018-10-10 14:28:16 +05:30
Zlash65
c24d2fdf6c setup leave & expense approver for each department
- assign approver in expense claim
2018-10-10 14:28:16 +05:30
Zlash65
a259466643 add relevant department to employees 2018-10-10 14:28:16 +05:30
Zlash65
0309bbee30 function call requires company as parameter 2018-10-10 14:28:16 +05:30
Zlash65
796bffbee1 fix payroll and stock related data 2018-10-10 14:28:16 +05:30
Zlash65
4c07970545 remove user permission from HR Manager user 2018-10-10 14:28:16 +05:30
Zlash65
fa7c8a9f8b update employee and user records 2018-10-10 14:28:16 +05:30
Saurabh
99c064305f Merge branch 'master' into staging-fixes 2018-10-09 17:55:33 +05:30
Saurabh
75c1682e61 Merge branch 'hotfix' 2018-10-09 17:55:32 +05:30
Saurabh
2dc8972794 bumped to version 10.1.58 2018-10-09 18:25:32 +06:00
Saurabh
f786eccdf9 Merge pull request #15633 from Zlash65/setup-fix
[Minor] Setup Wizard failing fix
2018-10-09 17:49:54 +05:30
Zlash65
a1036ad50b setup wizard failing fix 2018-10-09 17:38:28 +05:30
Shreya Shah
8a4bcefec4 fix(accounts-receivable): Column values in Print and PDF (#15621) 2018-10-08 18:34:01 +05:30
Shreya Shah
5b34d00bc0 fix(accounts-receivable): Column values in Print and PDF (#15622) 2018-10-08 18:20:51 +05:30
Nabin Hait
d2c5b50842 fix(warehouse-account): get warehouse account map fallback handling (#15625)
* fix(warehouse-account): get warehouse account map fallback handling

* fix: import issue
2018-10-08 18:19:53 +05:30
Ameya Shenoy
cf91f34ffa Merge branch 'staging-fixes' into staging 2018-10-08 09:43:48 +00:00
Ameya Shenoy
563b1d153b bumped to version 11.0.3-beta.9 2018-10-08 09:43:48 +00:00
Ameya Shenoy
ecba14e6cf Merge branch 'master' into staging-fixes 2018-10-08 09:39:49 +00:00
Ameya Shenoy
ee3b788024 Merge branch 'hotfix' 2018-10-08 09:37:37 +00:00
Ameya Shenoy
b509b06edf bumped to version 10.1.57 2018-10-08 09:37:37 +00:00
Zarrar
87441bf62e columns without fieldname's data not shown (#15618) 2018-10-08 14:34:34 +05:30
Zarrar
5fcccda883 [Minor] Supplier Quotation (#15578)
* throw meaningful error if RFQ does not have selected supplier

* Update supplier_quotation.py

* codacy fix
2018-10-08 14:30:53 +05:30
Shreya Shah
4fb9230d16 Add missing method link_to_mrs to buying.js (#15613) 2018-10-08 14:18:03 +05:30
Shreya Shah
95d93913ce fix(link_to_mr): Add missing method to buying.js (#15616) 2018-10-08 14:17:37 +05:30
Shreya Shah
37d3686372 fix(setup_taxes): Pop if frappe.message_log (#15615) 2018-10-08 14:17:16 +05:30
Ameya Shenoy
8cafb5fbbb Merge branch 'staging-fixes' into staging 2018-10-08 07:27:35 +00:00
Ameya Shenoy
0bd254b02b bumped to version 11.0.3-beta.8 2018-10-08 07:27:35 +00:00
rohitwaghchaure
5e466bace4 Removed update_job_card_reference method (#15614) 2018-10-08 12:36:45 +05:30
Shreya Shah
c2857fd2cc fix(setup_taxes): Pop if frappe.message_log (#15611) 2018-10-08 12:35:18 +05:30
Jamsheer
063cf9c582 Jam staging fixes (#15608)
* Test Inpatient Record - Fix

* Test Inpatient Record - Fix
2018-10-08 10:48:42 +05:30
Ameya Shenoy
36be62b927 Merge branch 'staging-fixes' into staging 2018-10-07 07:59:34 +00:00
Ameya Shenoy
cfdd629fd7 bumped to version 11.0.3-beta.7 2018-10-07 07:59:34 +00:00
Ameya Shenoy
272956980d Merge pull request #15606 from codingCoffee/abc
fix: make location from warehouse patch
2018-10-07 13:25:05 +05:30
Ameya Shenoy
f7b5b7beb4 fix: make location from warehouse patch
- optimization by preventing patch execution if Asset doesn't exist
2018-10-07 13:08:00 +05:30
Ameya Shenoy
39903647ae Merge branch 'staging-fixes' into staging 2018-10-07 06:23:22 +00:00
Ameya Shenoy
cd9be8f0a6 bumped to version 11.0.3-beta.6 2018-10-07 06:23:22 +00:00
Shreya Shah
5615cb4735 Set default only if customer_address not found (#15605)
* Set default only if customer_address not found

* Similar fix for Purchase Invoice and shipping_address
2018-10-07 11:42:07 +05:30
Shreya Shah
e7e269d4a4 [Error] Display appropriate msg if company is different for TDS (#15601)
* fix(tds): Display appropriate msg if company is different

* Update tax_withholding_category.py
2018-10-06 17:56:21 +05:30
Ameya Shenoy
b8c1897a80 Merge pull request #15603 from Zlash65/rectify
[Minor] Deferred Expense
2018-10-06 16:43:22 +05:30
Zlash65
58a080a1b1 add voucher detail no while creating gl entry 2018-10-06 16:34:58 +05:30
Ameya Shenoy
29fe8ce114 Merge branch 'staging-fixes' into staging 2018-10-05 09:09:53 +00:00
Ameya Shenoy
538678afc4 bumped to version 11.0.3-beta.5 2018-10-05 09:09:53 +00:00
Ameya Shenoy
ad908779be Merge branch 'master' into staging-fixes 2018-10-05 08:54:58 +00:00
Ameya Shenoy
5eafa5a487 Merge branch 'hotfix' 2018-10-05 08:54:46 +00:00
Ameya Shenoy
97dbb4d125 bumped to version 10.1.56 2018-10-05 08:54:46 +00:00
Shreya Shah
5cff01634e Merge pull request #15593 from Zlash65/fix-mod
[Minor] Item master - get_query for deferred accounts
2018-10-05 14:14:46 +05:30
Shreya Shah
32206029ac Fix Codacy 2018-10-05 14:14:33 +05:30
Shreya Shah
deb9f0e03c Merge pull request #15594 from shreyashah115/tds-report
Handle IndexError if no data found
2018-10-05 14:11:43 +05:30
Shreya Shah
db5ffce742 Merge pull request #15592 from shreyashah115/jv
Allow Reverse JV for all submitted docs
2018-10-05 13:33:11 +05:30
Shreya
0d7bd43367 Handle IndexError if no data found 2018-10-05 13:22:09 +05:30
Zlash65
2123b97d31 add get_query for revenue and expense account 2018-10-05 12:26:32 +05:30
Shreya
4f5214a136 Allow reverse jv for all submitted docs 2018-10-05 12:19:09 +05:30
Saif
00a16a9337 set_item_default was referencing a variable company of "company" (#15576) 2018-10-05 11:54:03 +05:30
Shreya Shah
17ac38ff29 Enable save before saving to update form after save (#15579) 2018-10-05 11:51:13 +05:30
Jamsheer
be6e426fe0 Healthcare Service Unit - added company abbr as suffix (#15590) 2018-10-05 11:38:15 +05:30
Ranjith Kurungadam
dc2bab2b72 fix healthcare patch (#15584) 2018-10-05 11:36:58 +05:30
Valmik
4c61861163 Add Delivery Trip to Delivery Note dashboard (#15587) 2018-10-05 11:36:31 +05:30
Saif
4faea037bb Remove Test Letter Head from GSTR-1 (#15591) 2018-10-05 11:35:01 +05:30
Ameya Shenoy
c4ebbd1322 Merge branch 'staging-fixes' into staging 2018-10-04 13:14:29 +00:00
Ameya Shenoy
2291558c5f bumped to version 11.0.3-beta.4 2018-10-04 13:14:29 +00:00
rohitwaghchaure
d69dc954c7 Merge pull request #15580 from sagarvora/fix-TabError
fix TabError in install_fixtures.py
2018-10-04 17:22:44 +05:30
Ameya Shenoy
c6eac7c60b Merge branch 'staging-fixes' into staging 2018-10-04 11:42:56 +00:00
Ameya Shenoy
5ae344593e bumped to version 11.0.3-beta.3 2018-10-04 11:42:56 +00:00
Ameya Shenoy
6dc4cdca3a Merge pull request #15585 from rohitwaghchaure/fix_asset_depreciation_ledger_report
Fix issue after merging hotfix into staging-fixes
2018-10-04 16:47:43 +05:30
Rohit Waghchaure
18678696db Fix issue after merging hotfix into staging-fixes 2018-10-04 16:33:43 +05:30
Ameya Shenoy
7d929c508f Merge branch 'master' into staging-fixes 2018-10-04 09:25:07 +00:00
Ameya Shenoy
65652071ff Merge branch 'hotfix' 2018-10-04 09:11:50 +00:00
Ameya Shenoy
79dc8ac9cc bumped to version 10.1.55 2018-10-04 09:11:50 +00:00
rohitwaghchaure
8b42bf57cd Merge pull request #15581 from rohitwaghchaure/work_order_item_has_no
[Fix] WorkOrderItem object has no attribute operation
2018-10-04 13:27:00 +05:30
Rohit Waghchaure
9f2859701e [Fix] WorkOrderItem object has no attribute operation 2018-10-04 13:25:49 +05:30
Sagar Vora
b13b9b4ed3 fix TabError in install_fixtures.py 2018-10-04 11:39:20 +05:30
Zarrar
897d1baf74 Merge pull request #15577 from Zlash65/min-min
[Minor] Purchase Invoice - stop date editable after submit
2018-10-04 09:31:50 +05:30
Zlash65
6e3b1a58a1 service_stop_date should be editable after submit 2018-10-04 09:30:27 +05:30
rohitwaghchaure
f9930ff2a4 Merge pull request #15573 from rohitwaghchaure/cost_center_issue_while_saving
[Fix] Cost center issue
2018-10-03 18:47:28 +05:30
Shreya Shah
3204c94fdd Merge pull request #15570 from shreyashah115/fix-filter-error
[Bug] Item wise sales register filters
2018-10-03 17:38:41 +05:30
Shreya
cbb112f2db Fix filter error 2018-10-03 17:37:40 +05:30
rohitwaghchaure
15e7646edd Merge pull request #15569 from rohitwaghchaure/stock_adjustment_to_cost_of_goods_sold
Book cost of goods sold instead of stock adjustment
2018-10-03 17:36:29 +05:30
Rohit Waghchaure
8bf9f377dd [Fix] Cost center issue 2018-10-03 16:59:43 +05:30
Rohit Waghchaure
d1b87ba41c Book cost of goods sold instead of stock adjustment 2018-10-03 16:29:43 +05:30
rohitwaghchaure
d6cacbe565 Merge pull request #15567 from rohitwaghchaure/fix_payment_request
[Fix] Payment request not working
2018-10-03 16:03:48 +05:30
Rohit Waghchaure
210f4984f7 [Fix] Payment request not working 2018-10-03 15:55:51 +05:30
Charles-Henri Decultot
75fa6b3ee8 [Enhancement] Improvement to the sales pipeline (#15524)
* Additions to sales pipeline

* Codacy corrections

* Codacy corrections

* Codacy corrections

* Replace _ with dummy for unused variable

* Performance + dates corrections

* Itertuples modification

* Removing trailing whitespaces

* Sales stage doctype

* Divide sales stages fixtures in separate functions

* Remove duplicate fixtures

* Add newline after method

* Missing requirement
2018-10-03 10:41:40 +05:30
Charles-Henri Decultot
efd776da46 Events in timeline (#15485)
* Events in timeline

* Namespace correction

* Codacy correction

* Addition of sales partners in participants

* Correct json indent
2018-10-03 10:41:26 +05:30
rohitwaghchaure
a5576f5b21 [Fix] Stock difference between gl entry and stock ledger entry booked in stock adjustment (#15374) 2018-10-03 10:39:50 +05:30
deepeshgarg007
719701f2a4 Enhancement in Budget Variance and other reports (#15455)
* Enhanced Budget Variance report and added filters and columns in other reports

* Update budget_variance_report.js

* Changes in budget variance report

* Spacing in column names
2018-10-02 12:52:13 +05:30
Shreya Shah
7d115183e4 Improvise and fix indicators in Portal list (#15552) 2018-10-02 12:46:26 +05:30
Charles-Henri Decultot
3b11debcd2 Gocardless correction (#15554) 2018-10-02 12:46:15 +05:30
Charles-Henri Decultot
b2281cc1fd Lead to customer UX enhancement (#15525)
* Lead to customer UX enhancement

* Market segment

* Market Segment to DocType

* Specific function for fixtures

* Merge issue correction

* Doctype merge correction
2018-10-02 11:25:00 +05:30
Shreya Shah
5a2aced586 Merge pull request #15551 from Zlash65/minor-fix
[Minor] Delivery trip test fix
2018-10-02 11:12:51 +05:30
Rushabh Mehta
11e2119670 style(icon): revert to old icon 2018-10-02 11:06:55 +05:30
Zlash65
6a5e6ed2ff delivery trip notification to customer fix 2018-10-01 17:28:42 +05:30
Zlash65
9e67b8ec4d fix driver name selection 2018-10-01 17:27:12 +05:30
Zlash65
622bd10946 add date data [mandatory] 2018-10-01 15:37:31 +05:30
rohitwaghchaure
8976ad5ca1 Merge pull request #15523 from rohitwaghchaure/fix_attendance_tool_issue
[Fix] Attendance tool
2018-10-01 15:07:49 +05:30
Rohit Waghchaure
c7f8b82fff [Fix] Attendance tool 2018-10-01 12:30:58 +05:30
rohitwaghchaure
6b62b86bbf Merge pull request #15545 from rohitwaghchaure/salary_slip_not_creating_because_of_the_date_issue
[Fix] Salary slip
2018-10-01 12:03:26 +05:30
Rohit Waghchaure
8fbf856618 [Fix] Salary slip 2018-10-01 12:00:45 +05:30
Saif
90cf2ddc01 Make pricing rule from Supplier and Customer Doc (#15533)
* Make pricing rule from Supplier and Customer Doc

* Make sure the "+" button also works the same way as the "Make" button
2018-09-30 22:16:31 +05:30
Alchez
6ecb2556b7 Add Delivery Settings + improve 'Notify Customers' functionality (#15322)
* Add Delivery Settings + improve 'Notify Customers' functionality

* Minor improvements

* Add patch to create a default dispatch notification template

* Fix travis errors
2018-09-30 21:38:47 +05:30
Charles-Henri Decultot
4fd7a4e0d7 Lead notes (#15510)
* Notes field in Lead

* Add notes to lead details report
2018-09-30 21:20:55 +05:30
Zarrar
e4c9ac3961 [Minor] Cash Flow report - custom (#15522)
* python 2-3 fix for filter

* pass filters while fetching data to financial statement report
2018-09-30 21:19:01 +05:30
rohitwaghchaure
90f9f9d3d8 Code optimization for deferred revenue (#15527) 2018-09-30 21:12:50 +05:30
Faris Ansari
6575e52942 fix: Refactor Review Area according to new Text Editor (#15536)
- depends on https://github.com/frappe/frappe/pull/6159
2018-09-30 21:08:46 +05:30
rohitwaghchaure
1cf71d96b1 Merge pull request #15530 from rohitwaghchaure/consolidated_report_issue_v11
[Fix] Consolidated Financial Statement report
2018-09-28 17:06:57 +05:30
Rohit Waghchaure
ea0ef95539 [Fix] Consolidated Financial Statement report 2018-09-28 17:05:55 +05:30
Saif
c2dd9ab778 Fix the problem that naming series would remove trailing '-' from series prefix if ##### was not entered (#15514) 2018-09-27 15:48:04 +05:30
Shreya Shah
0fc4917d81 Merge pull request #15516 from shreyashah115/product-page
Fetch Item Group's name and image on website
2018-09-27 15:12:42 +05:30
Shreya
5c335550e3 Fetch item_group's name and image on website if children 2018-09-27 13:55:59 +05:30
Nabin Hait
7d6d678e8d purchase receipt return entry in dashboard 2018-09-26 19:04:11 +05:30
Nabin Hait
c22ba2ec26 fix(sales return): validation message fix 2018-09-26 18:56:45 +05:30
Nabin Hait
183972f58f fix(stock_entry): allow creating stock entry against work order even if item rate is zero 2018-09-26 18:34:07 +05:30
Nabin Hait
1e7c32b909 Payroll fixes and more (#15475)
* fix(payroll): multiple minor fixes related to salary structure

* Added GSTR-1 and GSTR-2 report in Accounts module page

* delete asset movement records on cancellation of Purchase Receipt

* Update consolidated_financial_statement.py

* minor fix

* minor fix

* add filters on item prices report (#15495)
2018-09-26 18:01:00 +05:30
deepeshgarg007
c3772f1ac4 minor fix (#15503) 2018-09-26 15:55:43 +05:30
Aditya Hase
e20b7cc47d fix(python3): super() backwards compatibility fix (#15498) 2018-09-26 15:39:02 +05:30
Shreya Shah
352e6494f3 Contact and email fields in Payment Entry (#15490)
* Add contact_person and contact_email fields to Payment Entry

* Minor fix

* Map contact details while making Payment Entry

* Update payment_entry.py
2018-09-26 15:38:34 +05:30
rohitwaghchaure
0cf0ebf08b [Refactored] Asset Depreciation Ledger report based on GL entries (#15415)
* [Refactored] Asset Depreciation Ledger report is based on GL entries

* Provision to make manual JV from the asset if Calculate Depreciation is disabled
2018-09-26 15:24:49 +05:30
Saif Ur Rehman
423549e084 Fixed PDC data in AR/AP report:
-Get PDC date from posting_date instead of reference date since posting_date is the date at which the post dated cheque can be cleared
-Get PDC data from submitted documents only
2018-09-08 15:48:55 +05:00
Nabin Hait
65bb91d1c7 Merge branch 'develop' into staging-fixes 2018-07-31 15:13:30 +05:30
Ameya Shenoy
b8a59547f0 modified date for reload_doc (#15027) 2018-07-30 10:58:19 +05:30
Saurabh
63f87441c8 Update hooks.py 2018-07-19 13:13:15 +05:30
399 changed files with 30382 additions and 21489 deletions

2
.github/stale.yml vendored
View File

@@ -1,7 +1,7 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 10
daysUntilStale: 30
# Number of days of inactivity before a stale Issue or Pull Request is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.

View File

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

View File

@@ -35,8 +35,8 @@ def validate_service_stop_date(doc):
def convert_deferred_expense_to_expense(start_date=None, end_date=None):
# check for the purchase invoice for which GL entries has to be done
invoices = frappe.db.sql_list('''
select parent from `tabPurchase Invoice Item` where service_start_date<=%s and service_end_date>=%s
and enable_deferred_expense = 1 and docstatus = 1
select distinct parent from `tabPurchase Invoice Item` where service_start_date<=%s and service_end_date>=%s
and enable_deferred_expense = 1 and docstatus = 1 and ifnull(amount, 0) > 0
''', (end_date or today(), start_date or add_months(today(), -1)))
# For each invoice, book deferred expense
@@ -47,8 +47,8 @@ def convert_deferred_expense_to_expense(start_date=None, end_date=None):
def convert_deferred_revenue_to_income(start_date=None, end_date=None):
# check for the sales invoice for which GL entries has to be done
invoices = frappe.db.sql_list('''
select parent from `tabSales Invoice Item` where service_start_date<=%s and service_end_date>=%s
and enable_deferred_revenue = 1 and docstatus = 1
select distinct parent from `tabSales Invoice Item` where service_start_date<=%s and service_end_date>=%s
and enable_deferred_revenue = 1 and docstatus = 1 and ifnull(amount, 0) > 0
''', (end_date or today(), start_date or add_months(today(), -1)))
# For each invoice, book deferred revenue
@@ -157,6 +157,7 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None):
"credit": base_amount,
"credit_in_account_currency": amount,
"cost_center": item.cost_center,
"voucher_detail_no": item.name,
'posting_date': booking_end_date,
'project': project
}, account_currency)

View File

@@ -16,10 +16,11 @@ import copy
class BankStatementTransactionEntry(Document):
def autoname(self):
self.name = self.bank_account + "-" + self.from_date + "-" + self.to_date
mapper_name = self.bank + "-Statement-Settings"
if not frappe.db.exists("Bank Statement Settings", mapper_name):
self.create_settings(self.bank)
self.bank_settings = mapper_name
if self.bank:
mapper_name = self.bank + "-Statement-Settings"
if not frappe.db.exists("Bank Statement Settings", mapper_name):
self.create_settings(self.bank)
self.bank_settings = mapper_name
def create_settings(self, bank):
mapper = frappe.new_doc("Bank Statement Settings")

View File

@@ -58,7 +58,6 @@ class CostCenter(NestedSet):
# Validate properties before merging
super(CostCenter, self).before_rename(olddn, new_cost_center, merge, "is_group")
if not merge:
from erpnext.accounts.doctype.account.account import get_name_with_number
new_cost_center = get_name_with_number(new_cost_center, self.cost_center_number)
return new_cost_center
@@ -89,3 +88,8 @@ class CostCenter(NestedSet):
def on_doctype_update():
frappe.db.add_index("Cost Center", ["lft", "rgt"])
def get_name_with_number(new_account, account_number):
if account_number and not new_account[0].isdigit():
new_account = account_number + " - " + new_account
return new_account

View File

@@ -24,7 +24,7 @@ frappe.ui.form.on("Journal Entry", {
}, "fa fa-table");
}
if(frm.doc.docstatus==1 && frm.doc.naming_series=="JV-") {
if(frm.doc.docstatus==1) {
frm.add_custom_button(__('Reverse Journal Entry'), function() {
return erpnext.journal_entry.reverse_journal_entry(frm);
});

View File

@@ -23,7 +23,6 @@ frappe.ui.form.on('Payment Entry', {
}
}
});
frm.set_query("party_type", function() {
return{
"filters": {
@@ -31,7 +30,17 @@ frappe.ui.form.on('Payment Entry', {
}
}
});
frm.set_query("contact_person", function() {
if (frm.doc.party) {
return {
query: 'frappe.contacts.doctype.contact.contact.contact_query',
filters: {
link_doctype: frm.doc.party_type,
link_name: frm.doc.party
}
};
}
});
frm.set_query("paid_to", function() {
var account_types = in_list(["Receive", "Internal Transfer"], frm.doc.payment_type) ?
["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]];
@@ -114,6 +123,11 @@ frappe.ui.form.on('Payment Entry', {
frm.events.set_dynamic_labels(frm);
},
contact_person: function(frm) {
frm.set_value("contact_email", "");
erpnext.utils.get_contact_details(frm);
},
hide_unhide_fields: function(frm) {
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
@@ -146,7 +160,7 @@ frappe.ui.form.on('Payment Entry', {
frm.toggle_display("set_exchange_gain_loss",
(frm.doc.paid_amount && frm.doc.received_amount && frm.doc.difference_amount &&
((frm.doc.paid_from_account_currency != company_currency ||
frm.doc.paid_to_account_currency != company_currency) &&
frm.doc.paid_to_account_currency != company_currency) &&
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency)));
frm.refresh_fields();
@@ -208,7 +222,7 @@ frappe.ui.form.on('Payment Entry', {
});
} else {
if(frm.doc.party) {
frm.events.party(frm);
frm.events.party(frm);
}
if(frm.doc.mode_of_payment) {
@@ -230,13 +244,16 @@ frappe.ui.form.on('Payment Entry', {
},
party: function(frm) {
if (frm.doc.contact_email || frm.doc.contact_person) {
frm.set_value("contact_email", "");
frm.set_value("contact_person", "");
}
if(frm.doc.payment_type && frm.doc.party_type && frm.doc.party) {
if(!frm.doc.posting_date) {
frappe.msgprint(__("Please select Posting Date before selecting Party"))
frm.set_value("party", "");
return ;
}
frm.set_party_account_based_on_party = true;
return frappe.call({
@@ -302,7 +319,7 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
}
frm.set_value("received_amount", frm.doc.paid_amount);
} else {
frm.events.received_amount(frm);
}
@@ -350,7 +367,7 @@ frappe.ui.form.on('Payment Entry', {
]);
}
}
});
});
}
},
@@ -402,7 +419,7 @@ frappe.ui.form.on('Payment Entry', {
}
})
},
posting_date: function(frm) {
frm.events.paid_from_account_currency(frm);
},
@@ -415,7 +432,7 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
frm.set_value("base_received_amount", frm.doc.base_paid_amount);
}
frm.events.set_unallocated_amount(frm);
}
@@ -425,17 +442,17 @@ frappe.ui.form.on('Payment Entry', {
target_exchange_rate: function(frm) {
frm.set_paid_amount_based_on_received_amount = true;
if (frm.doc.received_amount) {
frm.set_value("base_received_amount",
flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate));
if(!frm.doc.source_exchange_rate &&
if(!frm.doc.source_exchange_rate &&
(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency)) {
frm.set_value("source_exchange_rate", frm.doc.target_exchange_rate);
frm.set_value("base_paid_amount", frm.doc.base_received_amount);
}
frm.events.set_unallocated_amount(frm);
}
frm.set_paid_amount_based_on_received_amount = false;
@@ -468,14 +485,14 @@ frappe.ui.form.on('Payment Entry', {
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
else
frm.events.set_unallocated_amount(frm);
frm.set_paid_amount_based_on_received_amount = false;
},
reset_received_amount: function(frm) {
if(!frm.set_paid_amount_based_on_received_amount &&
(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency)) {
frm.set_value("received_amount", frm.doc.paid_amount);
if(frm.doc.source_exchange_rate) {
@@ -483,7 +500,7 @@ frappe.ui.form.on('Payment Entry', {
}
frm.set_value("base_received_amount", frm.doc.base_paid_amount);
}
if(frm.doc.payment_type == "Receive")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount);
else
@@ -549,7 +566,7 @@ frappe.ui.form.on('Payment Entry', {
(frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") ||
(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Supplier") ||
(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Employee") ||
(frm.doc.payment_type=="Receive" && frm.doc.party_type=="Student")
(frm.doc.payment_type=="Receive" && frm.doc.party_type=="Student")
) {
if(total_positive_outstanding > total_negative_outstanding)
frm.set_value("paid_amount",
@@ -694,7 +711,7 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("unallocated_amount", unallocated_amount);
frm.trigger("set_difference_amount");
},
set_difference_amount: function(frm) {
var difference_amount = 0;
var base_unallocated_amount = flt(frm.doc.unallocated_amount) *
@@ -753,7 +770,7 @@ frappe.ui.form.on('Payment Entry', {
frappe.msgprint(__("Row #{0}: Reference Document Type must be one of Purchase Order, Purchase Invoice or Journal Entry", [row.idx]));
return false;
}
if(frm.doc.party_type=="Employee" &&
!in_list(["Expense Claim", "Journal Entry"], row.reference_doctype)
) {
@@ -790,15 +807,25 @@ frappe.ui.form.on('Payment Entry', {
var write_off_row = $.map(frm.doc["deductions"] || [], function(t) {
return t.account==r.message[account] ? t : null; });
if (!write_off_row.length) {
var row = frm.add_child("deductions");
var row = [];
var difference_amount = flt(frm.doc.difference_amount,
precision("difference_amount"));
if (!write_off_row.length && difference_amount) {
row = frm.add_child("deductions");
row.account = r.message[account];
row.cost_center = r.message["cost_center"];
} else {
var row = write_off_row[0];
row = write_off_row[0];
}
if (row) {
row.amount = flt(row.amount) + difference_amount;
} else {
frappe.msgprint(__("No gain or loss in the exchange rate"))
}
row.amount = flt(row.amount) + flt(frm.doc.difference_amount);
refresh_field("deductions");
frm.events.set_unallocated_amount(frm);

View File

@@ -376,6 +376,40 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "party",
"fieldname": "contact_person",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Contact",
"length": 0,
"no_copy": 0,
"options": "Contact",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -441,6 +475,40 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "contact_person",
"fieldname": "contact_email",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email",
"length": 0,
"no_copy": 0,
"options": "Email",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -1972,7 +2040,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-09-11 15:44:28.647566",
"modified": "2018-09-25 14:38:48.312629",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",

View File

@@ -299,12 +299,12 @@ class PaymentEntry(AccountsController):
if self.payment_type == "Receive" \
and self.base_total_allocated_amount < self.base_received_amount + total_deductions \
and self.total_allocated_amount < self.paid_amount + (total_deductions / self.source_exchange_rate):
self.unallocated_amount = (self.base_received_amount + total_deductions -
self.unallocated_amount = (self.base_received_amount + total_deductions -
self.base_total_allocated_amount) / self.source_exchange_rate
elif self.payment_type == "Pay" \
and self.base_total_allocated_amount < (self.base_paid_amount - total_deductions) \
and self.total_allocated_amount < self.received_amount + (total_deductions / self.target_exchange_rate):
self.unallocated_amount = (self.base_paid_amount - (total_deductions +
self.unallocated_amount = (self.base_paid_amount - (total_deductions +
self.base_total_allocated_amount)) / self.target_exchange_rate
def set_difference_amount(self):
@@ -790,7 +790,6 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
@frappe.whitelist()
def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=None):
doc = frappe.get_doc(dt, dn)
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) > 0:
frappe.throw(_("Can only make payment against unbilled {0}").format(dt))
@@ -877,7 +876,8 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.mode_of_payment = doc.get("mode_of_payment")
pe.party_type = party_type
pe.party = doc.get(scrub(party_type))
pe.contact_person = doc.get("contact_person")
pe.contact_email = doc.get("contact_email")
pe.ensure_supplier_is_not_blocked()
pe.paid_from = party_account if payment_type=="Receive" else bank.account
@@ -933,7 +933,7 @@ def get_paid_amount(dt, dn, party_type, party, account, due_date):
return paid_amount[0][0] if paid_amount else 0
@frappe.whitelist()
def get_party_and_account_balance(company, date, paid_from, paid_to=None, ptype=None, pty=None, cost_center=None):
def get_party_and_account_balance(company, date, paid_from=None, paid_to=None, ptype=None, pty=None, cost_center=None):
return frappe._dict({
"party_balance": get_balance_on(party_type=ptype, party=pty, cost_center=cost_center),
"paid_from_account_balance": get_balance_on(paid_from, date, cost_center=cost_center),

View File

@@ -123,7 +123,7 @@ class PaymentRequest(Document):
"reference_doctype": "Payment Request",
"reference_docname": self.name,
"payer_email": self.email_to or frappe.session.user,
"payer_name": data.customer_name,
"payer_name": frappe.safe_encode(data.customer_name),
"order_id": self.name,
"currency": self.currency
})

View File

@@ -70,12 +70,14 @@ class PeriodClosingVoucher(AccountsController):
net_pl_balance += flt(acc.balance_in_company_currency)
if net_pl_balance:
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entries.append(self.get_gl_dict({
"account": self.closing_account_head,
"debit_in_account_currency": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"debit": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"credit_in_account_currency": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"cost_center": cost_center
}))
from erpnext.accounts.general_ledger import make_gl_entries

View File

@@ -72,6 +72,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
"company": "_Test Company",
"fiscal_year": get_fiscal_year(today(), company="_Test Company")[0],
"posting_date": today(),
"cost_center": "_Test Cost Center - _TC",
"remarks": "test"
})
pcv.insert()

View File

@@ -116,6 +116,18 @@ frappe.ui.form.on('Pricing Rule', {
};
},
onload: function(frm) {
if(frm.doc.__islocal && !frm.doc.applicable_for && (frm.doc.customer || frm.doc.supplier)) {
if(frm.doc.customer) {
frm.doc.applicable_for = "Customer";
frm.doc.selling = 1
} else {
frm.doc.applicable_for = "Supplier";
frm.doc.buying = 1
}
}
},
refresh: function(frm) {
var help_content =
`<table class="table table-bordered" style="background-color: #f9f9f9;">

View File

@@ -201,8 +201,8 @@ def get_pricing_rule_for_item(args):
"discount_percentage": 0.0
})
else:
item_details.discount_percentage = pricing_rule.discount_percentage or args.discount_percentage
item_details.discount_percentage = (pricing_rule.get('discount_percentage', 0)
if pricing_rule else args.discount_percentage)
elif args.get('pricing_rule'):
item_details = remove_pricing_rule_for_item(args.get("pricing_rule"), item_details)
@@ -384,3 +384,13 @@ def set_transaction_type(args):
args.transaction_type = "selling"
else:
args.transaction_type = "buying"
@frappe.whitelist()
def make_pricing_rule(doctype, docname):
doc = frappe.new_doc("Pricing Rule")
doc.applicable_for = doctype
doc.set(frappe.scrub(doctype), docname)
doc.selling = 1 if doctype == "Customer" else 0
doc.buying = 1 if doctype == "Supplier" else 0
return doc

View File

@@ -11,12 +11,16 @@ from erpnext.stock.get_item_details import get_item_details
from frappe import MandatoryError
class TestPricingRule(unittest.TestCase):
def setUp(self):
frappe.db.sql("delete from `tabPricing Rule`")
def tearDown(self):
frappe.db.sql("delete from `tabPricing Rule`")
def test_pricing_rule_for_discount(self):
from erpnext.stock.get_item_details import get_item_details
from frappe import MandatoryError
frappe.db.sql("delete from `tabPricing Rule`")
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
@@ -87,16 +91,12 @@ class TestPricingRule(unittest.TestCase):
args.item_code = "_Test Item 2"
details = get_item_details(args)
self.assertEqual(details.get("discount_percentage"), 15)
frappe.db.sql("delete from `tabPricing Rule`")
self.assertEquals(details.get("discount_percentage"), 15)
def test_pricing_rule_for_margin(self):
from erpnext.stock.get_item_details import get_item_details
from frappe import MandatoryError
frappe.db.sql("delete from `tabPricing Rule`")
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
@@ -111,14 +111,14 @@ class TestPricingRule(unittest.TestCase):
"company": "_Test Company"
}
frappe.get_doc(test_record.copy()).insert()
item_price = frappe.get_doc({
"doctype": "Item Price",
"price_list": "_Test Price List 2",
"item_code": "_Test FG Item 2",
"price_list_rate": 100
})
item_price.insert(ignore_permissions=True)
args = frappe._dict({
@@ -135,17 +135,13 @@ class TestPricingRule(unittest.TestCase):
"name": None
})
details = get_item_details(args)
self.assertEqual(details.get("margin_type"), "Percentage")
self.assertEqual(details.get("margin_rate_or_amount"), 10)
frappe.db.sql("delete from `tabPricing Rule`")
self.assertEquals(details.get("margin_type"), "Percentage")
self.assertEquals(details.get("margin_rate_or_amount"), 10)
def test_pricing_rule_for_variants(self):
from erpnext.stock.get_item_details import get_item_details
from frappe import MandatoryError
frappe.db.sql("delete from `tabPricing Rule`")
if not frappe.db.exists("Item", "Test Variant PRT"):
frappe.get_doc({
"doctype": "Item",
@@ -213,8 +209,6 @@ class TestPricingRule(unittest.TestCase):
self.assertEqual(details.get("discount_percentage"), 17.5)
def test_pricing_rule_for_stock_qty(self):
frappe.db.sql("delete from `tabPricing Rule`")
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
@@ -258,24 +252,18 @@ class TestPricingRule(unittest.TestCase):
def test_pricing_rule_with_margin_and_discount(self):
frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule')
make_pricing_rule(selling=1, margin_type="Percentage", margin_rate_or_amount=10)
make_pricing_rule(selling=1, margin_type="Percentage", margin_rate_or_amount=10, discount_percentage=10)
si = create_sales_invoice(do_not_save=True)
si.items[0].price_list_rate = 1000
si.payment_schedule = []
si.insert(ignore_permissions=True)
item = si.items[0]
self.assertEqual(item.rate, 1100)
self.assertEqual(item.margin_rate_or_amount, 10)
# With discount
item.discount_percentage = 10
si.payment_schedule = []
si.save()
item = si.items[0]
self.assertEqual(item.rate, 990)
self.assertEquals(item.margin_rate_or_amount, 10)
self.assertEquals(item.rate_with_margin, 1100)
self.assertEqual(item.discount_percentage, 10)
frappe.db.sql("delete from `tabPricing Rule`")
self.assertEquals(item.discount_amount, 110)
self.assertEquals(item.rate, 990)
def make_pricing_rule(**args):
args = frappe._dict(args)
@@ -305,4 +293,4 @@ def make_pricing_rule(**args):
applicable_for = doc.applicable_for.replace(' ', '_').lower()
if args.get(applicable_for):
doc.db_set(applicable_for, args.get(applicable_for))
doc.db_set(applicable_for, args.get(applicable_for))

View File

@@ -77,8 +77,9 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
}
if (doc.outstanding_amount > 0 && !cint(doc.is_return)) {
cur_frm.add_custom_button(__('Payment Request'),
this.make_payment_request, __("Make"));
cur_frm.add_custom_button(__('Payment Request'), function() {
me.make_payment_request()
}, __("Make"));
}
if(doc.docstatus===0) {
@@ -513,25 +514,9 @@ frappe.ui.form.on("Purchase Invoice", {
me.frm.set_df_property("apply_tds", "read_only", 1);
}
$.each(["warehouse", "rejected_warehouse"], function(i, field) {
frm.set_query(field, "items", function() {
return {
filters: [
["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
["Warehouse", "is_group", "=", 0]
]
}
})
})
frm.set_query("supplier_warehouse", function() {
return {
filters: [
["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
["Warehouse", "is_group", "=", 0]
]
}
})
erpnext.queries.setup_queries(frm, "Warehouse", function() {
return erpnext.queries.warehouse(frm.doc);
});
},
is_subcontracted: function(frm) {

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@@ -1485,6 +1486,207 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sec_warehouse",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "update_stock",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Set Accepted Warehouse",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "update_stock",
"description": "Warehouse where you are maintaining stock of rejected items",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Rejected Warehouse",
"length": 0,
"no_copy": 1,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break_warehouse",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"fieldname": "is_subcontracted",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Raw Materials Supplied",
"length": 0,
"no_copy": 0,
"options": "No\nYes",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_subcontracted==\"Yes\"",
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplier Warehouse",
"length": 0,
"no_copy": 1,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "50px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "50px"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -1551,6 +1753,38 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "scan_barcode",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Scan Barcode",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 1,
"allow_in_quick_entry": 0,
@@ -1585,6 +1819,73 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "supplied_items",
"columns": 0,
"depends_on": "",
"fieldname": "raw_materials_supplied",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Raw Materials Supplied",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplied_items",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplied Items",
"length": 0,
"no_copy": 0,
"options": "Purchase Receipt Item Supplied",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -3723,140 +4024,6 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "raw_materials_supplied",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Raw Materials Supplied",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"fieldname": "is_subcontracted",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Raw Materials Supplied",
"length": 0,
"no_copy": 0,
"options": "No\nYes",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplier Warehouse",
"length": 0,
"no_copy": 1,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "50px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "50px"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplied_items",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplied Items",
"length": 0,
"no_copy": 0,
"options": "Purchase Receipt Item Supplied",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -4351,40 +4518,6 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Warehouse where you are maintaining stock of rejected items",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Rejected Warehouse",
"length": 0,
"no_copy": 1,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -4593,7 +4726,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2018-09-11 14:44:31.220376",
"modified": "2018-11-13 19:55:58.018816",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -61,11 +61,11 @@ class PurchaseInvoice(BuyingController):
self.validate_posting_time()
super(PurchaseInvoice, self).validate()
# apply tax withholding only if checked and applicable
self.set_tax_withholding()
super(PurchaseInvoice, self).validate()
if not self.is_return:
self.po_required()
self.pr_required()
@@ -123,6 +123,7 @@ class PurchaseInvoice(BuyingController):
def set_missing_values(self, for_validate=False):
if not self.credit_to:
self.credit_to = get_party_account("Supplier", self.supplier, self.company)
self.party_account_currency = frappe.db.get_value("Account", self.credit_to, "account_currency", cache=True)
if not self.due_date:
self.due_date = get_due_date(self.posting_date, "Supplier", self.supplier, self.company, self.bill_date)
@@ -208,7 +209,8 @@ class PurchaseInvoice(BuyingController):
if self.update_stock:
self.validate_item_code()
self.validate_warehouse()
warehouse_account = get_warehouse_account_map()
if auto_accounting_for_stock:
warehouse_account = get_warehouse_account_map()
for item in self.get("items"):
# in case of auto inventory accounting,
@@ -224,7 +226,7 @@ class PurchaseInvoice(BuyingController):
item.expense_account = warehouse_account[item.warehouse]["account"]
else:
item.expense_account = stock_not_billed_account
elif not item.expense_account and for_validate:
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
@@ -377,7 +379,10 @@ class PurchaseInvoice(BuyingController):
return gl_entries
def make_supplier_gl_entry(self, gl_entries):
grand_total = self.rounded_total or self.grand_total
# Checked both rounding_adjustment and rounded_total
# because rounded_total had value even before introcution of posting GLE based on rounded total
grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
if grand_total:
# Didnot use base_grand_total to book rounding loss gle
grand_total_in_company_currency = flt(grand_total * self.conversion_rate,
@@ -401,18 +406,23 @@ class PurchaseInvoice(BuyingController):
# item gl entries
stock_items = self.get_stock_items()
expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
warehouse_account = get_warehouse_account_map()
if self.update_stock and self.auto_accounting_for_stock:
warehouse_account = get_warehouse_account_map()
voucher_wise_stock_value = {}
if self.update_stock:
for d in frappe.get_all('Stock Ledger Entry',
fields = ["voucher_detail_no", "stock_value_difference"], filters={'voucher_no': self.name}):
voucher_wise_stock_value.setdefault(d.voucher_detail_no, d.stock_value_difference)
for item in self.get("items"):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.expense_account)
if self.update_stock and self.auto_accounting_for_stock and item.item_code in stock_items:
val_rate_db_precision = 6 if cint(item.precision("valuation_rate")) <= 6 else 9
# warehouse account
warehouse_debit_amount = flt(flt(item.valuation_rate, val_rate_db_precision)
* flt(item.qty) * flt(item.conversion_factor), item.precision("base_net_amount"))
warehouse_debit_amount = self.make_stock_adjustment_entry(gl_entries,
item, voucher_wise_stock_value, account_currency)
gl_entries.append(
self.get_gl_dict({
@@ -552,6 +562,36 @@ class PurchaseInvoice(BuyingController):
return gl_entries
def make_stock_adjustment_entry(self, gl_entries, item, voucher_wise_stock_value, account_currency):
net_amt_precision = item.precision("base_net_amount")
val_rate_db_precision = 6 if cint(item.precision("valuation_rate")) <= 6 else 9
warehouse_debit_amount = flt(flt(item.valuation_rate, val_rate_db_precision)
* flt(item.qty) * flt(item.conversion_factor), net_amt_precision)
# Stock ledger value is not matching with the warehouse amount
if (self.update_stock and voucher_wise_stock_value.get(item.name) and
warehouse_debit_amount != flt(voucher_wise_stock_value.get(item.name), net_amt_precision)):
cost_of_goods_sold_account = self.get_company_default("default_expense_account")
stock_amount = flt(voucher_wise_stock_value.get(item.name), net_amt_precision)
stock_adjustment_amt = warehouse_debit_amount - stock_amount
gl_entries.append(
self.get_gl_dict({
"account": cost_of_goods_sold_account,
"against": item.expense_account,
"debit": stock_adjustment_amt,
"remarks": self.get("remarks") or _("Stock Adjustment"),
"cost_center": item.cost_center,
"project": item.project
}, account_currency)
)
warehouse_debit_amount = stock_amount
return warehouse_debit_amount
def make_tax_gl_entries(self, gl_entries):
# tax table gl entries
valuation_tax = {}
@@ -799,6 +839,9 @@ class PurchaseInvoice(BuyingController):
if not accounts or tax_withholding_details.get("account_head") not in accounts:
self.append("taxes", tax_withholding_details)
# calculate totals again after applying TDS
self.calculate_taxes_and_totals()
@frappe.whitelist()
def make_debit_note(source_name, target_doc=None):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
@@ -816,7 +859,8 @@ def make_stock_entry(source_name, target_doc=None):
"Purchase Invoice Item": {
"doctype": "Stock Entry Detail",
"field_map": {
"stock_qty": "transfer_qty"
"stock_qty": "transfer_qty",
"batch_no": "batch_no"
},
}
}, target_doc)

View File

@@ -1742,7 +1742,7 @@
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -2544,7 +2544,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-09-04 10:11:28.246395",
"modified": "2018-10-04 09:05:43.166721",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -165,9 +165,12 @@ def get_items_list(pos_profile, company):
select
i.name, i.item_code, i.item_name, i.description, i.item_group, i.has_batch_no,
i.has_serial_no, i.is_stock_item, i.brand, i.stock_uom, i.image,
id.expense_account, id.selling_cost_center, id.default_warehouse
id.expense_account, id.selling_cost_center, id.default_warehouse,
i.sales_uom, c.conversion_factor
from
`tabItem` i LEFT JOIN `tabItem Default` id ON id.parent = i.name and id.company = %s
`tabItem` i
left join `tabItem Default` id on id.parent = i.name and id.company = %s
left join `tabUOM Conversion Detail` c on i.name = c.parent and i.sales_uom = c.uom
where
i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
{cond}
@@ -534,6 +537,7 @@ def validate_item(doc):
item_doc.item_name = item.get('item_name')
item_doc.description = item.get('description')
item_doc.stock_uom = item.get('stock_uom')
item_doc.uom = item.get('uom')
item_doc.item_group = item.get('item_group')
item_doc.append('item_defaults', {
"company": doc.get("company"),

View File

@@ -35,6 +35,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
},
refresh: function(doc, dt, dn) {
const me = this;
this._super();
if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) {
// hide new msgbox
@@ -82,9 +83,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
}
}
if(doc.outstanding_amount>0 && !cint(doc.is_return)) {
cur_frm.add_custom_button(__('Payment Request'),
this.make_payment_request, __("Make"));
if (doc.outstanding_amount>0 && !cint(doc.is_return)) {
cur_frm.add_custom_button(__('Payment Request'), function() {
me.make_payment_request();
}, __("Make"));
}
if(!doc.auto_repeat) {
@@ -102,7 +104,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
}
this.set_default_print_format();
var me = this;
if (doc.docstatus == 1 && !doc.inter_company_invoice_reference) {
frappe.model.with_doc("Customer", me.frm.doc.customer, function() {
var customer = frappe.model.get_doc("Customer", me.frm.doc.customer);
@@ -938,7 +939,9 @@ var set_primary_action= function(frm, dialog, $results, invoice_healthcare_servi
dialog.set_primary_action(__('Add'), function() {
let checked_values = get_checked_values($results);
if(checked_values.length > 0){
frm.set_value("patient", dialog.fields_dict.patient.input.value);
if(invoice_healthcare_services) {
frm.set_value("patient", dialog.fields_dict.patient.input.value);
}
frm.set_value("items", []);
add_to_item_line(frm, checked_values, invoice_healthcare_services);
dialog.hide();

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@@ -1585,6 +1586,71 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sec_warehouse",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "update_stock",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Set Source Warehouse",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -1651,6 +1717,38 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "scan_barcode",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Scan Barcode",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 1,
"allow_in_quick_entry": 0,
@@ -5546,7 +5644,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2018-09-07 14:24:58.854289",
"modified": "2018-11-12 20:01:21.289303",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe, erpnext
import frappe.defaults
from frappe.utils import cint, flt, add_months, today, date_diff, getdate, add_days, cstr
from frappe.utils import cint, flt, add_months, today, date_diff, getdate, add_days, cstr, nowdate
from frappe import _, msgprint, throw
from erpnext.accounts.party import get_party_account, get_due_date
from erpnext.controllers.stock_controller import update_gl_entries_after
@@ -54,9 +54,18 @@ class SalesInvoice(SellingController):
def set_indicator(self):
"""Set indicator for portal"""
if self.outstanding_amount > 0:
if cint(self.is_return) == 1:
self.indicator_title = _("Return")
self.indicator_color = "darkgrey"
elif self.outstanding_amount > 0 and getdate(self.due_date) >= getdate(nowdate()):
self.indicator_color = "orange"
self.indicator_title = _("Unpaid")
elif self.outstanding_amount > 0 and getdate(self.due_date) < getdate(nowdate()):
self.indicator_color = "red"
self.indicator_title = _("Overdue")
elif self.outstanding_amount < 0:
self.indicator_title = _("Credit Note Issued")
self.indicator_color = "darkgrey"
else:
self.indicator_color = "green"
self.indicator_title = _("Paid")
@@ -301,6 +310,7 @@ class SalesInvoice(SellingController):
if not self.debit_to:
self.debit_to = get_party_account("Customer", self.customer, self.company)
self.party_account_currency = frappe.db.get_value("Account", self.debit_to, "account_currency", cache=True)
if not self.due_date and self.customer:
self.due_date = get_due_date(self.posting_date, "Customer", self.customer, self.company)
@@ -652,9 +662,6 @@ class SalesInvoice(SellingController):
def make_gl_entries(self, gl_entries=None, repost_future_gle=True, from_repost=False):
auto_accounting_for_stock = erpnext.is_perpetual_inventory_enabled(self.company)
if not self.grand_total:
return
if not gl_entries:
gl_entries = self.get_gl_entries()
@@ -706,7 +713,9 @@ class SalesInvoice(SellingController):
return gl_entries
def make_customer_gl_entry(self, gl_entries):
grand_total = self.rounded_total or self.grand_total
# Checked both rounding_adjustment and rounded_total
# because rounded_total had value even before introcution of posting GLE based on rounded total
grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
if grand_total:
# Didnot use base_grand_total to book rounding loss gle
grand_total_in_company_currency = flt(grand_total * self.conversion_rate,
@@ -735,9 +744,11 @@ class SalesInvoice(SellingController):
self.get_gl_dict({
"account": tax.account_head,
"against": self.customer,
"credit": flt(tax.base_tax_amount_after_discount_amount),
"credit_in_account_currency": flt(tax.base_tax_amount_after_discount_amount) \
if account_currency==self.company_currency else flt(tax.tax_amount_after_discount_amount),
"credit": flt(tax.base_tax_amount_after_discount_amount,
tax.precision("tax_amount_after_discount_amount")),
"credit_in_account_currency": (flt(tax.base_tax_amount_after_discount_amount,
tax.precision("base_tax_amount_after_discount_amount")) if account_currency==self.company_currency else
flt(tax.tax_amount_after_discount_amount, tax.precision("tax_amount_after_discount_amount"))),
"cost_center": tax.cost_center
}, account_currency)
)
@@ -745,7 +756,7 @@ class SalesInvoice(SellingController):
def make_item_gl_entries(self, gl_entries):
# income account gl entries
for item in self.get("items"):
if flt(item.base_net_amount):
if flt(item.base_net_amount, item.precision("base_net_amount")):
if item.is_fixed_asset:
asset = frappe.get_doc("Asset", item.asset)
@@ -762,9 +773,10 @@ class SalesInvoice(SellingController):
self.get_gl_dict({
"account": item.income_account if not item.enable_deferred_revenue else item.deferred_revenue_account,
"against": self.customer,
"credit": item.base_net_amount,
"credit_in_account_currency": item.base_net_amount \
if account_currency==self.company_currency else item.net_amount,
"credit": flt(item.base_net_amount, item.precision("base_net_amount")),
"credit_in_account_currency": (flt(item.base_net_amount, item.precision("base_net_amount"))
if account_currency==self.company_currency
else flt(item.net_amount, item.precision("net_amount"))),
"cost_center": item.cost_center
}, account_currency)
)
@@ -863,7 +875,7 @@ class SalesInvoice(SellingController):
def make_write_off_gl_entry(self, gl_entries):
# write off entries, applicable if only pos
if self.write_off_account and self.write_off_amount:
if self.write_off_account and flt(self.write_off_amount, self.precision("write_off_amount")):
write_off_account_currency = get_account_currency(self.write_off_account)
default_cost_center = frappe.get_cached_value('Company', self.company, 'cost_center')
@@ -873,10 +885,11 @@ class SalesInvoice(SellingController):
"party_type": "Customer",
"party": self.customer,
"against": self.write_off_account,
"credit": self.base_write_off_amount,
"credit_in_account_currency": self.base_write_off_amount \
if self.party_account_currency==self.company_currency else self.write_off_amount,
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
"credit": flt(self.base_write_off_amount, self.precision("base_write_off_amount")),
"credit_in_account_currency": (flt(self.base_write_off_amount,
self.precision("base_write_off_amount")) if self.party_account_currency==self.company_currency
else flt(self.write_off_amount, self.precision("write_off_amount"))),
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
}, self.party_account_currency)
@@ -885,15 +898,16 @@ class SalesInvoice(SellingController):
self.get_gl_dict({
"account": self.write_off_account,
"against": self.customer,
"debit": self.base_write_off_amount,
"debit_in_account_currency": self.base_write_off_amount \
if write_off_account_currency==self.company_currency else self.write_off_amount,
"debit": flt(self.base_write_off_amount, self.precision("base_write_off_amount")),
"debit_in_account_currency": (flt(self.base_write_off_amount,
self.precision("base_write_off_amount")) if write_off_account_currency==self.company_currency
else flt(self.write_off_amount, self.precision("write_off_amount"))),
"cost_center": self.cost_center or self.write_off_cost_center or default_cost_center
}, write_off_account_currency)
)
def make_gle_for_rounding_adjustment(self, gl_entries):
if self.rounding_adjustment:
if flt(self.rounding_adjustment, self.precision("rounding_adjustment")):
round_off_account, round_off_cost_center = \
get_round_off_account_and_cost_center(self.company)
@@ -901,8 +915,10 @@ class SalesInvoice(SellingController):
self.get_gl_dict({
"account": round_off_account,
"against": self.customer,
"credit_in_account_currency": self.base_rounding_adjustment,
"credit": self.base_rounding_adjustment,
"credit_in_account_currency": flt(self.rounding_adjustment,
self.precision("rounding_adjustment")),
"credit": flt(self.base_rounding_adjustment,
self.precision("base_rounding_adjustment")),
"cost_center": self.cost_center or round_off_cost_center,
}
))

View File

@@ -189,7 +189,7 @@ class ShareTransfer(Document):
if (shareholder == 'from_shareholder') else self.to_folio_no;
doc.save()
else:
if doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no):
if doc.folio_no and doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no):
frappe.throw(_('The folio numbers are not matching'))
def autoname_folio(self, shareholder, is_company=False):

View File

@@ -79,7 +79,8 @@ class TestShareTransfer(unittest.TestCase):
}
]
for d in share_transfers:
frappe.get_doc(d).submit()
st = frappe.get_doc(d)
st.submit()
def test_invalid_share_transfer(self):
doc = frappe.get_doc({

View File

@@ -1,14 +0,0 @@
from frappe import _
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on transactions against this Subscriber. See timeline below for details'),
'fieldname': 'subscriber',
'transactions': [
{
'label': _('Subscriptions'),
'items': ['Subscription']
}
]
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -20,7 +21,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "subscriber",
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -29,10 +30,10 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Subscriber",
"label": "Customer",
"length": 0,
"no_copy": 0,
"options": "Subscriber",
"options": "Customer",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -437,6 +438,38 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "generate_invoice_at_period_start",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Generate Invoice At Beginning Of Period",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -814,7 +847,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:44.533482",
"modified": "2018-10-14 10:38:55.545540",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription",
@@ -890,4 +923,4 @@
"track_changes": 1,
"track_seen": 0,
"track_views": 0
}
}

View File

@@ -239,7 +239,7 @@ class Subscription(Document):
invoice = frappe.new_doc('Sales Invoice')
invoice.set_posting_time = 1
invoice.posting_date = self.current_invoice_start
invoice.customer = self.get_customer(self.subscriber)
invoice.customer = self.customer
# Subscription is better suited for service items. I won't update `update_stock`
# for that reason
@@ -282,13 +282,6 @@ class Subscription(Document):
return invoice
@staticmethod
def get_customer(subscriber_name):
"""
Returns the `Customer` linked to the `Subscriber`
"""
return frappe.db.get_value('Subscriber', subscriber_name, 'customer')
def get_items_from_plans(self, plans, prorate=0):
"""
Returns the `Item`s linked to `Subscription Plan`
@@ -297,7 +290,7 @@ class Subscription(Document):
prorate_factor = get_prorata_factor(self.current_invoice_end, self.current_invoice_start)
items = []
customer = self.get_customer(self.subscriber)
customer = self.customer
for plan in plans:
item_code = frappe.db.get_value("Subscription Plan", plan.plan, "item")
if not prorate:
@@ -321,6 +314,23 @@ class Subscription(Document):
self.save()
@property
def is_postpaid_to_invoice(self):
return getdate(nowdate()) > getdate(self.current_invoice_end) or \
(getdate(nowdate()) >= getdate(self.current_invoice_end) and getdate(self.current_invoice_end) == getdate(self.current_invoice_start)) and \
not self.has_outstanding_invoice()
@property
def is_prepaid_to_invoice(self):
if not self.generate_invoice_at_period_start:
return False
if self.is_new_subscription():
return True
# Check invoice dates and make sure it doesn't have outstanding invoices
return getdate(nowdate()) >= getdate(self.current_invoice_start) and not self.has_outstanding_invoice()
def process_for_active(self):
"""
Called by `process` if the status of the `Subscription` is 'Active'.
@@ -330,7 +340,7 @@ class Subscription(Document):
2. Change the `Subscription` status to 'Past Due Date'
3. Change the `Subscription` status to 'Cancelled'
"""
if getdate(nowdate()) > getdate(self.current_invoice_end) or (getdate(nowdate()) >= getdate(self.current_invoice_end) and getdate(self.current_invoice_end) == getdate(self.current_invoice_start)) and not self.has_outstanding_invoice():
if self.is_postpaid_to_invoice or self.is_prepaid_to_invoice:
self.generate_invoice()
if self.current_invoice_is_past_due():
self.status = 'Past Due Date'
@@ -338,7 +348,7 @@ class Subscription(Document):
if self.current_invoice_is_past_due() and getdate(nowdate()) > getdate(self.current_invoice_end):
self.status = 'Past Due Date'
if self.cancel_at_period_end and getdate(nowdate()) > self.current_invoice_end:
if self.cancel_at_period_end and getdate(nowdate()) > getdate(self.current_invoice_end):
self.cancel_subscription_at_period_end()
def cancel_subscription_at_period_end(self):

View File

@@ -41,24 +41,14 @@ def create_plan():
plan.billing_interval_count = 14
plan.insert()
def create_subscriber():
if not frappe.db.exists('Subscriber', '_Test Customer'):
subscriber = frappe.new_doc('Subscriber')
subscriber.subscriber_name = '_Test Customer'
subscriber.customer = '_Test Customer'
subscriber.insert()
class TestSubscription(unittest.TestCase):
def setUp(self):
create_plan()
create_subscriber()
def test_create_subscription_with_trial_with_correct_period(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.trial_period_start = nowdate()
subscription.trial_period_end = add_days(nowdate(), 30)
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
@@ -75,7 +65,7 @@ class TestSubscription(unittest.TestCase):
def test_create_subscription_without_trial_with_correct_period(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
@@ -91,7 +81,7 @@ class TestSubscription(unittest.TestCase):
def test_create_subscription_trial_with_wrong_dates(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.trial_period_end = nowdate()
subscription.trial_period_start = add_days(nowdate(), 30)
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
@@ -101,7 +91,7 @@ class TestSubscription(unittest.TestCase):
def test_create_subscription_multi_with_different_billing_fails(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.trial_period_end = nowdate()
subscription.trial_period_start = add_days(nowdate(), 30)
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
@@ -112,7 +102,7 @@ class TestSubscription(unittest.TestCase):
def test_invoice_is_generated_at_end_of_billing_period(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.start = '2018-01-01'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.insert()
@@ -129,7 +119,7 @@ class TestSubscription(unittest.TestCase):
def test_status_goes_back_to_active_after_invoice_is_paid(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.start = '2018-01-01'
subscription.insert()
@@ -159,7 +149,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.start = '2018-01-01'
subscription.insert()
@@ -182,7 +172,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.start = '2018-01-01'
subscription.insert()
@@ -200,7 +190,7 @@ class TestSubscription(unittest.TestCase):
def test_subscription_invoice_days_until_due(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.days_until_due = 10
subscription.start = add_months(nowdate(), -1)
@@ -218,7 +208,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.start = '2018-01-01'
subscription.insert()
@@ -242,7 +232,7 @@ class TestSubscription(unittest.TestCase):
def test_subscription_remains_active_during_invoice_period(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
subscription.process() # no changes expected
@@ -268,7 +258,7 @@ class TestSubscription(unittest.TestCase):
def test_subscription_cancelation(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
subscription.cancel_subscription()
@@ -284,7 +274,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
@@ -319,7 +309,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
subscription.cancel_subscription()
@@ -339,7 +329,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
subscription.cancel_subscription()
@@ -363,7 +353,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.start = '2018-01-01'
subscription.insert()
@@ -397,7 +387,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.start = '2018-01-01'
subscription.insert()
@@ -434,7 +424,7 @@ class TestSubscription(unittest.TestCase):
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.start = '2018-01-01'
subscription.insert()
@@ -463,7 +453,7 @@ class TestSubscription(unittest.TestCase):
def test_restart_active_subscription(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
@@ -473,7 +463,7 @@ class TestSubscription(unittest.TestCase):
def test_subscription_invoice_discount_percentage(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.additional_discount_percentage = 10
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
@@ -488,7 +478,7 @@ class TestSubscription(unittest.TestCase):
def test_subscription_invoice_discount_amount(self):
subscription = frappe.new_doc('Subscription')
subscription.subscriber = '_Test Customer'
subscription.customer = '_Test Customer'
subscription.additional_discount_amount = 11
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
@@ -500,3 +490,51 @@ class TestSubscription(unittest.TestCase):
self.assertEqual(invoice.apply_discount_on, 'Grand Total')
subscription.delete()
def test_prepaid_subscriptions(self):
# Create a non pre-billed subscription, processing should not create
# invoices.
subscription = frappe.new_doc('Subscription')
subscription.customer = '_Test Customer'
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
subscription.process()
self.assertEqual(len(subscription.invoices), 0)
# Change the subscription type to prebilled and process it.
# Prepaid invoice should be generated
subscription.generate_invoice_at_period_start = True
subscription.save()
subscription.process()
self.assertEqual(len(subscription.invoices), 1)
def test_prepaid_subscriptions_with_prorate_true(self):
settings = frappe.get_single('Subscription Settings')
to_prorate = settings.prorate
settings.prorate = 1
settings.save()
subscription = frappe.new_doc('Subscription')
subscription.customer = '_Test Customer'
subscription.generate_invoice_at_period_start = True
subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1})
subscription.save()
subscription.cancel_subscription()
self.assertEqual(len(subscription.invoices), 1)
current_inv = subscription.get_current_invoice()
self.assertEqual(current_inv.status, "Unpaid")
diff = flt(date_diff(nowdate(), subscription.current_invoice_start) + 1)
plan_days = flt(date_diff(subscription.current_invoice_end, subscription.current_invoice_start) + 1)
prorate_factor = flt(diff / plan_days)
self.assertEqual(flt(current_inv.grand_total, 2), flt(prorate_factor * 900, 2))
settings.prorate = to_prorate
settings.save()
subscription.delete()

View File

@@ -19,6 +19,9 @@ def get_party_tax_withholding_details(ref_doc):
fy = get_fiscal_year(ref_doc.posting_date, company=ref_doc.company)
tax_details = get_tax_withholding_details(tax_withholding_category, fy[0], ref_doc.company)
if not tax_details:
frappe.throw(_('Please set associated account in Tax Withholding Category {0} against Company {1}')
.format(tax_withholding_category, ref_doc.company))
tds_amount = get_tds_amount(ref_doc, tax_details, fy)
tax_row = get_tax_row(tax_details, tds_amount)
return tax_row

View File

@@ -1407,6 +1407,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.child.item_code = this.items[0].item_code;
this.child.item_name = this.items[0].item_name;
this.child.stock_uom = this.items[0].stock_uom;
this.child.uom = this.items[0].sales_uom || this.items[0].stock_uom;
this.child.conversion_factor = this.items[0].conversion_factor || 1;
this.child.brand = this.items[0].brand;
this.child.description = this.items[0].description || this.items[0].item_name;
this.child.discount_percentage = 0.0;
@@ -1416,8 +1418,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.child.income_account = this.pos_profile_data['income_account'] || this.items[0].income_account;
this.child.warehouse = (this.item_serial_no[this.child.item_code]
? this.item_serial_no[this.child.item_code][1] : (this.pos_profile_data['warehouse'] || this.items[0].default_warehouse));
this.child.price_list_rate = flt(this.price_list_data[this.child.item_code], 9) / flt(this.frm.doc.conversion_rate, 9);
this.child.rate = flt(this.price_list_data[this.child.item_code], 9) / flt(this.frm.doc.conversion_rate, 9);
this.child.price_list_rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
this.child.rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
this.child.actual_qty = me.get_actual_qty(this.items[0]);
this.child.amount = flt(this.child.qty) * flt(this.child.rate);
this.child.batch_no = this.item_batch_no[this.child.item_code];
@@ -1573,15 +1575,16 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
style="margin-right: 5px;">${__('Print')}</a>
<a class="btn btn-default new_doc">${__('New')}</a>`);
$('.print_doc').click(function () {
var html = frappe.render(me.print_template_data, me.frm.doc)
me.print_document(html)
this.msgprint.msg_area.find('.print_doc').on('click', function() {
var html = frappe.render(me.print_template_data, me.frm.doc);
me.print_document(html);
})
$('.new_doc').click(function () {
me.msgprint.hide()
me.make_new_cart()
this.msgprint.msg_area.find('.new_doc').on('click', function() {
me.msgprint.hide();
me.make_new_cart();
})
},
print_document: function (html) {

View File

@@ -22,17 +22,18 @@ class DuplicatePartyAccountError(frappe.ValidationError): pass
@frappe.whitelist()
def get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True):
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True, party_address=None, shipping_address=None):
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, bill_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template)
company, posting_date, bill_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template, party_address, shipping_address)
def _get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True):
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False,
fetch_payment_terms_template=True, party_address=None, shipping_address=None):
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, bill_date, doctype))
party = out[party_type.lower()]
@@ -45,7 +46,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_group)
out["payment_terms_template"] = get_pyt_term_template(party.name, party_type, company)
set_address_details(out, party, party_type, doctype, company)
set_address_details(out, party, party_type, doctype, company, party_address, shipping_address)
set_contact_details(out, party, party_type)
set_other_values(out, party, party_type)
set_price_list(out, party, party_type, price_list)
@@ -71,19 +72,17 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
return out
def set_address_details(out, party, party_type, doctype=None, company=None):
def set_address_details(out, party, party_type, doctype=None, company=None, party_address=None, shipping_address=None):
billing_address_field = "customer_address" if party_type == "Lead" \
else party_type.lower() + "_address"
out[billing_address_field] = get_default_address(party_type, party.name)
out[billing_address_field] = party_address or get_default_address(party_type, party.name)
if doctype:
out.update(get_fetch_values(doctype, billing_address_field, out[billing_address_field]))
# address display
out.address_display = get_address_display(out[billing_address_field])
# shipping address
if party_type in ["Customer", "Lead"]:
out.shipping_address_name = get_party_shipping_address(party_type, party.name)
out.shipping_address_name = shipping_address or get_party_shipping_address(party_type, party.name)
out.shipping_address = get_address_display(out["shipping_address_name"])
if doctype:
out.update(get_fetch_values(doctype, 'shipping_address_name', out.shipping_address_name))
@@ -97,7 +96,8 @@ def set_address_details(out, party, party_type, doctype=None, company=None):
elif doctype and doctype == "Purchase Invoice":
out.update(get_company_address(company))
if out.company_address:
out["shipping_address"] = out["company_address"]
out["shipping_address"] = shipping_address or out["company_address"]
out.shipping_address_display = get_address_display(out["shipping_address"])
out.update(get_fetch_values(doctype, 'shipping_address', out.shipping_address))
get_regional_address_details(out, doctype, company)
@@ -335,7 +335,7 @@ def get_due_date_from_template(template_name, posting_date, bill_date):
def validate_due_date(posting_date, due_date, party_type, party, company=None, bill_date=None, template_name=None):
if getdate(due_date) < getdate(posting_date):
frappe.throw(_("Due Date cannot be before Posting Date"))
frappe.throw(_("Due Date cannot be before Posting / Supplier Invoice Date"))
else:
if not template_name: return
@@ -459,38 +459,65 @@ def get_timeline_data(doctype, name):
def get_dashboard_info(party_type, party):
current_fiscal_year = get_fiscal_year(nowdate(), as_dict=True)
company = frappe.db.get_default("company") or frappe.get_all("Company")[0].name
party_account_currency = get_party_account_currency(party_type, party, company)
company_default_currency = get_default_currency() \
or frappe.get_cached_value('Company', company, 'default_currency')
if party_account_currency==company_default_currency:
total_field = "base_grand_total"
else:
total_field = "grand_total"
doctype = "Sales Invoice" if party_type=="Customer" else "Purchase Invoice"
billing_this_year = frappe.db.sql("""
select sum({0})
from `tab{1}`
where {2}=%s and docstatus=1 and posting_date between %s and %s
""".format(total_field, doctype, party_type.lower()),
(party, current_fiscal_year.year_start_date, current_fiscal_year.year_end_date))
companies = frappe.get_all(doctype, filters={
'docstatus': 1,
party_type.lower(): party
}, distinct=1, fields=['company'])
total_unpaid = frappe.db.sql("""
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
company_wise_info = []
company_wise_grand_total = frappe.get_all(doctype,
filters={
'docstatus': 1,
party_type.lower(): party,
'posting_date': ('between', [current_fiscal_year.year_start_date, current_fiscal_year.year_end_date])
},
group_by="company",
fields=["company", "sum(grand_total) as grand_total", "sum(base_grand_total) as base_grand_total"]
)
company_wise_billing_this_year = frappe._dict()
for d in company_wise_grand_total:
company_wise_billing_this_year.setdefault(
d.company,{
"grand_total": d.grand_total,
"base_grand_total": d.base_grand_total
})
company_wise_total_unpaid = frappe._dict(frappe.db.sql("""
select company, sum(debit_in_account_currency) - sum(credit_in_account_currency)
from `tabGL Entry`
where party_type = %s and party=%s""", (party_type, party))
where party_type = %s and party=%s
group by company""", (party_type, party)))
info = {}
info["billing_this_year"] = flt(billing_this_year[0][0]) if billing_this_year else 0
info["currency"] = party_account_currency
info["total_unpaid"] = flt(total_unpaid[0][0]) if total_unpaid else 0
if party_type == "Supplier":
info["total_unpaid"] = -1 * info["total_unpaid"]
for d in companies:
company_default_currency = frappe.db.get_value("Company", d.company, 'default_currency')
party_account_currency = get_party_account_currency(party_type, party, d.company)
return info
if party_account_currency==company_default_currency:
billing_this_year = flt(company_wise_billing_this_year.get(d.company,{}).get("base_grand_total"))
else:
billing_this_year = flt(company_wise_billing_this_year.get(d.company,{}).get("grand_total"))
total_unpaid = flt(company_wise_total_unpaid.get(d.company))
info = {}
info["billing_this_year"] = flt(billing_this_year) if billing_this_year else 0
info["currency"] = party_account_currency
info["total_unpaid"] = flt(total_unpaid) if total_unpaid else 0
info["company"] = d.company
if party_type == "Supplier":
info["total_unpaid"] = -1 * info["total_unpaid"]
company_wise_info.append(info)
return company_wise_info
def get_party_shipping_address(doctype, name):
"""

View File

@@ -75,7 +75,7 @@
<td class="text-right">{%= format_currency(balance_row[range3]) %}</td>
<td class="text-right">{%= format_currency(balance_row[range4]) %}</td>
<td class="text-right">
{%= format_currency(flt(balance_row[__("Outstanding Amount")]), data[data.length-1]["currency"]) %}
{%= format_currency(flt(balance_row[("outstanding_amount")]), data[data.length-1]["currency"]) %}
</td>
</tr>
<td>{%= __("PDC/LC") %}</td>
@@ -84,7 +84,7 @@
<td></td>
<td></td>
<td class="text-right">
{%= format_currency(flt(balance_row[__("PDC/LC Amount")]), data[data.length-1]["currency"]) %}
{%= format_currency(flt(balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %}
</td>
<tr class="cvs-footer">
<th class="text-left">{%= __("Cheques Required") %}</th>
@@ -93,7 +93,7 @@
<th></th>
<th></th>
<th class="text-right">
{%= format_currency(flt(balance_row[__("Outstanding Amount")]-balance_row[__("PDC/LC Amount")]), data[data.length-1]["currency"]) %}</th>
{%= format_currency(flt(balance_row[("outstanding_amount")]-balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %}</th>
</tr>
</tbody>
@@ -161,26 +161,26 @@
</td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i]["Invoiced Amount"], data[i]["currency"]) %}</td>
{%= format_currency(data[i]["invoiced_amount"], data[i]["currency"]) %}</td>
{% if(!filters.show_pdc_in_print) { %}
<td style="text-align: right">
{%= format_currency(data[i]["Paid Amount"], data[i]["currency"]) %}</td>
{%= format_currency(data[i]["paid_amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">
{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["Credit Note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %}</td>
{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["debit_note"], data[i]["currency"]) %}</td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i]["Outstanding Amount"], data[i]["currency"]) %}</td>
{%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %}</td>
{% if(filters.show_pdc_in_print) { %}
{% if(report.report_name === "Accounts Receivable") { %}
<td style="text-align: right">
{%= data[i][__("Customer LPO")] %}</td>
{%= data[i]["po_no"] %}</td>
{% } %}
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][__("PDC/LC Date")]) %}</td>
<td style="text-align: right">{%= data[i][__("PDC/LC Ref")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("PDC/LC Amount")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Remaining Balance")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][("pdc/lc_date")]) %}</td>
<td style="text-align: right">{%= data[i][("pdc/lc_ref")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][("pdc/lc_amount")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][("remaining_balance")], data[i]["currency"]) %}</td>
{% } %}
{% } else { %}
<td></td>
@@ -189,15 +189,15 @@
{% } %}
<td><b>{%= __("Total") %}</b></td>
<td style="text-align: right">
{%= format_currency(data[i]["Invoiced Amount"], data[i]["currency"] ) %}</td>
{%= format_currency(data[i]["invoiced_amount"], data[i]["currency"] ) %}</td>
{% if(!filters.show_pdc_in_print) { %}
<td style="text-align: right">
{%= format_currency(data[i]["Paid Amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["Credit Note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %} </td>
{%= format_currency(data[i]["paid_amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["debit_note"], data[i]["currency"]) %} </td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i]["Outstanding Amount"], data[i]["currency"]) %}</td>
{%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %}</td>
{% if(filters.show_pdc_in_print) { %}
{% if(report.report_name === "Accounts Receivable") { %}
@@ -205,9 +205,9 @@
{%= data[i][__("Customer LPO")] %}</td>
{% } %}
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][__("PDC/LC Date")]) %}</td>
<td style="text-align: right">{%= data[i][__("PDC/LC Ref")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("PDC/LC Amount")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Remaining Balance")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= data[i][("pdc/lc_ref")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][("pdc/lc_amount")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][("remaining_balance")], data[i]["currency"]) %}</td>
{% } %}
{% } %}
{% } else { %}
@@ -228,14 +228,14 @@
{% } else { %}
<td><b>{%= __("Total") %}</b></td>
{% } %}
<td style="text-align: right">{%= format_currency(data[i][__("Total Invoiced Amt")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Total Paid Amt")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("Credit Note Amt")], data[i]["currency"]) : format_currency(data[i][__("Debit Note Amt")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Total Outstanding Amt")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][("total_invoiced_amt")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][("total_paid_amt")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("credit_note_amt")], data[i]["currency"]) : format_currency(data[i][__("debit_note_amt")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][("total_outstanding_amt")], data[i]["currency"]) %}</td>
{% } %}
{% } %}
</tr>
{% } %}
</tbody>
</table>
<p class="text-right text-muted">{{ __("Printed On ") }}{%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>
<p class="text-right text-muted">{{ __("Printed On ") }}{%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>

View File

@@ -83,30 +83,55 @@ class ReceivablePayableReport(object):
"{range3}-{above}".format(range3=cint(self.filters["range3"])+ 1, above=_("Above"))):
columns.append({
"label": label,
"fieldname":label,
"fieldtype": "Currency",
"options": "currency",
"width": 120
})
columns.append({
columns += [
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"width": 100
})
columns += [
_("PDC/LC Date") + ":Date:110",
_("PDC/LC Ref") + ":Data:110",
_("PDC/LC Amount") + ":Currency/currency:130",
_("Remaining Balance") + ":Currency/currency:130"
]
},
{
"fieldname": "pdc/lc_date",
"label": _("PDC/LC Date"),
"fieldtype": "Date",
"width": 110
},
{
"fieldname": "pdc/lc_ref",
"label": _("PDC/LC Ref"),
"fieldtype": "Data",
"width": 110
},
{
"fieldname": "pdc/lc_amount",
"label": _("PDC/LC Amount"),
"fieldtype": "Currency",
"options": "Currency",
"width": 130
},
{
"fieldname": "remaining_balance",
"label": _("Remaining Balance"),
"fieldtype": "Currency",
"options": "Currency",
"width": 130
}]
if args.get('party_type') == 'Customer':
columns += [_("Customer LPO") + ":Data:100"]
columns.append({
"label": _("Customer LPO"),
"fieldtype": "Data",
"fieldname": "po_no",
"width": 100,
})
columns += [_("Delivery Note") + ":Data:100"]
if args.get("party_type") == "Customer":
columns += [
_("Territory") + ":Link/Territory:80",
@@ -135,7 +160,6 @@ class ReceivablePayableReport(object):
data = []
pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date)
gl_entries_data = self.get_entries_till(self.filters.report_date, args.get("party_type"))
if gl_entries_data:
@@ -448,18 +472,17 @@ def get_pdc_details(party_type, report_date):
for pdc in frappe.db.sql("""
select
pref.reference_name as invoice_no, pent.party, pent.party_type,
max(pent.reference_date) as pdc_date, sum(ifnull(pref.allocated_amount,0)) as pdc_amount,
max(pent.posting_date) as pdc_date, sum(ifnull(pref.allocated_amount,0)) as pdc_amount,
GROUP_CONCAT(pent.reference_no SEPARATOR ', ') as pdc_ref
from
`tabPayment Entry` as pent inner join `tabPayment Entry Reference` as pref
on
(pref.parent = pent.name)
where
pent.docstatus < 2 and pent.reference_date >= %s
pent.docstatus < 2 and pent.posting_date > %s
and pent.party_type = %s
group by pent.party, pref.reference_name""", (report_date, party_type), as_dict=1):
pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc)
if scrub(party_type):
amount_field = ("jea.debit_in_account_currency"
if party_type == 'Supplier' else "jea.credit_in_account_currency")
@@ -469,18 +492,23 @@ def get_pdc_details(party_type, report_date):
for pdc in frappe.db.sql("""
select
jea.reference_name as invoice_no, jea.party, jea.party_type,
max(je.cheque_date) as pdc_date, sum(ifnull({0},0)) as pdc_amount,
max(je.posting_date) as pdc_date, sum(ifnull({0},0)) as pdc_amount,
GROUP_CONCAT(je.cheque_no SEPARATOR ', ') as pdc_ref
from
`tabJournal Entry` as je inner join `tabJournal Entry Account` as jea
on
(jea.parent = je.name)
where
je.docstatus < 2 and je.cheque_date >= %s
je.docstatus < 2 and je.posting_date > %s
and jea.party_type = %s
group by jea.party, jea.reference_name""".format(amount_field), (report_date, party_type), as_dict=1):
if (pdc.invoice_no, pdc.party) in pdc_details:
pdc_details[(pdc.invoice_no, pdc.party)]["pdc_amount"] += pdc.pdc_amount
key = (pdc.invoice_no, pdc.party)
pdc_details[key]["pdc_amount"] += pdc.pdc_amount
if pdc.pdc_ref:
pdc_details[key]["pdc_ref"] += ", " + pdc.pdc_ref
if pdc.pdc_date:
pdc_details[key]["pdc_date"] = max(pdc_details[key]["pdc_date"], pdc.pdc_date)
else:
pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc)

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe import _, scrub
from frappe.utils import flt
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
@@ -21,25 +21,93 @@ class AccountsReceivableSummary(ReceivablePayableReport):
if party_naming_by == "Naming Series":
columns += [ args.get("party_type") + " Name::140"]
credit_debit_label = _("Credit Note Amt") if args.get('party_type') == 'Customer' else _("Debit Note Amt")
credit_debit_label = "Credit Note Amt" if args.get('party_type') == 'Customer' else "Debit Note Amt"
columns += [{
"label": _("Total Invoiced Amt"),
"fieldname": "total_invoiced_amt",
"fieldtype": "Currency",
"options": "currency",
"width": 100
},
{
"label": _("Total Paid Amt"),
"fieldname": "total_paid_amt",
"fieldtype": "Currency",
"options": "currency",
"width": 100
}]
columns += [
_("Total Invoiced Amt") + ":Currency/currency:140",
_("Total Paid Amt") + ":Currency/currency:140",
credit_debit_label + ":Currency/currency:140",
_("Total Outstanding Amt") + ":Currency/currency:160",
"0-" + str(self.filters.range1) + ":Currency/currency:100",
str(self.filters.range1) + "-" + str(self.filters.range2) + ":Currency/currency:100",
str(self.filters.range2) + "-" + str(self.filters.range3) + ":Currency/currency:100",
str(self.filters.range3) + _("-Above") + ":Currency/currency:100"]
{
"label": _(credit_debit_label),
"fieldname": scrub(credit_debit_label),
"fieldtype": "Currency",
"options": "currency",
"width": 140
},
{
"label": _("Total Outstanding Amt"),
"fieldname": "total_outstanding_amt",
"fieldtype": "Currency",
"options": "currency",
"width": 160
},
{
"label": _("0-" + str(self.filters.range1)),
"fieldname": scrub("0-" + str(self.filters.range1)),
"fieldtype": "Currency",
"options": "currency",
"width": 160
},
{
"label": _(str(self.filters.range1) + "-" + str(self.filters.range2)),
"fieldname": scrub(str(self.filters.range1) + "-" + str(self.filters.range2)),
"fieldtype": "Currency",
"options": "currency",
"width": 160
},
{
"label": _(str(self.filters.range2) + "-" + str(self.filters.range3)),
"fieldname": scrub(str(self.filters.range2) + "-" + str(self.filters.range3)),
"fieldtype": "Currency",
"options": "currency",
"width": 160
},
{
"label": _(str(self.filters.range3) + _("-Above")),
"fieldname": scrub(str(self.filters.range3) + _("-Above")),
"fieldtype": "Currency",
"options": "currency",
"width": 160
}
]
if args.get("party_type") == "Customer":
columns += [
_("Territory") + ":Link/Territory:80",
_("Customer Group") + ":Link/Customer Group:120"
]
columns += [{
"label": _("Territory"),
"fieldname": "territory",
"fieldtype": "Link",
"options": "Territory",
"width": 80
},
{
"label": _("Customer Group"),
"fieldname": "customer_group",
"fieldtype": "Link",
"options": "Customer Group",
"width": 80
}]
if args.get("party_type") == "Supplier":
columns += [_("Supplier Group") + ":Link/Supplier Group:80"]
columns += [{
"label": _("Supplier Group"),
"fieldname": "supplier_group",
"fieldtype": "Link",
"options": "Supplier Group",
"width": 80
}]
columns.append({
"fieldname": "currency",
"label": _("Currency"),
@@ -70,7 +138,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
row += [self.get_territory(party), self.get_customer_group(party)]
if args.get("party_type") == "Supplier":
row += [self.get_supplier_group(party)]
row.append(party_dict.currency)
data.append(row)
@@ -94,7 +162,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
for k in list(party_total[d.party]):
if k != "currency":
party_total[d.party][k] += flt(d.get(k, 0))
party_total[d.party].currency = d.currency
return party_total

View File

@@ -3,55 +3,82 @@
from __future__ import unicode_literals
import frappe, erpnext
from frappe.utils import flt
from frappe import _
def execute(filters=None):
columns, data = get_columns(), get_data(filters)
return columns, data
def get_data(filters):
data = frappe.db.sql("""
select
a.name as asset, a.asset_category, a.status,
ds.depreciation_method, a.purchase_date, a.gross_purchase_amount,
ds.schedule_date as depreciation_date, ds.depreciation_amount,
ds.accumulated_depreciation_amount,
(a.gross_purchase_amount - ds.accumulated_depreciation_amount) as amount_after_depreciation,
ds.journal_entry as depreciation_entry
from
`tabAsset` a, `tabDepreciation Schedule` ds
where
a.name = ds.parent
and a.docstatus=1
and ifnull(ds.journal_entry, '') != ''
and ds.schedule_date between %(from_date)s and %(to_date)s
and a.company = %(company)s
{conditions}
order by
a.name asc, ds.schedule_date asc
""".format(conditions=get_filter_conditions(filters)), filters, as_dict=1)
data = []
depreciation_accounts = frappe.db.sql_list(""" select name from tabAccount
where ifnull(account_type, '') = 'Depreciation' """)
filters_data = [["company", "=", filters.get('company')],
["posting_date", ">=", filters.get('from_date')],
["posting_date", "<=", filters.get('to_date')],
["against_voucher_type", "=", "Asset"],
["account", "in", depreciation_accounts]]
if filters.get("asset"):
filters_data.append(["against_voucher", "=", filters.get("asset")])
if filters.get("asset_category"):
assets = frappe.db.sql_list("""select name from tabAsset
where asset_category = %s and docstatus=1""", filters.get("asset_category"))
filters_data.append(["against_voucher", "in", assets])
company_finance_book = erpnext.get_default_finance_book(filters.get("company"))
if (not filters.get('finance_book') or (filters.get('finance_book') == company_finance_book)):
filters_data.append(["finance_book", "in", ['', filters.get('finance_book')]])
elif filters.get("finance_book"):
filters_data.append(["finance_book", "=", filters.get('finance_book')])
gl_entries = frappe.get_all('GL Entry',
filters= filters_data,
fields = ["against_voucher", "debit_in_account_currency as debit", "voucher_no", "posting_date"],
order_by= "against_voucher, posting_date")
if not gl_entries:
return data
assets = [d.against_voucher for d in gl_entries]
assets_details = get_assets_details(assets)
for d in gl_entries:
asset_data = assets_details.get(d.against_voucher)
if not asset_data.get("accumulated_depreciation_amount"):
asset_data.accumulated_depreciation_amount = d.debit
else:
asset_data.accumulated_depreciation_amount += d.debit
row = frappe._dict(asset_data)
row.update({
"depreciation_amount": d.debit,
"depreciation_date": d.posting_date,
"amount_after_depreciation": (flt(row.gross_purchase_amount) -
flt(row.accumulated_depreciation_amount)),
"depreciation_entry": d.voucher_no
})
data.append(row)
return data
def get_filter_conditions(filters):
conditions = ""
if filters.get("asset"):
conditions += " and a.name = %(asset)s"
if filters.get("asset_category"):
conditions += " and a.asset_category = %(asset_category)s"
company_finance_book = erpnext.get_default_finance_book(filters.get("company"))
def get_assets_details(assets):
assets_details = {}
if (not filters.get('finance_book') or (filters.get('finance_book') == company_finance_book)):
filters['finance_book'] = company_finance_book
conditions += " and ifnull(ds.finance_book, '') in (%(finance_book)s, '') "
elif filters.get("finance_book"):
conditions += " and ifnull(ds.finance_book, '') = %(finance_book)s"
fields = ["name as asset", "gross_purchase_amount",
"asset_category", "status", "depreciation_method", "purchase_date"]
for d in frappe.get_all("Asset", fields = fields, filters = {'name': ('in', assets)}):
assets_details.setdefault(d.asset, d)
return assets_details
return conditions
def get_columns():
return [
{

View File

@@ -4,8 +4,16 @@
frappe.query_reports["Budget Variance Report"] = {
"filters": [
{
fieldname: "fiscal_year",
label: __("Fiscal Year"),
fieldname: "from_fiscal_year",
label: __("From Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
default: frappe.sys_defaults.fiscal_year,
reqd: 1
},
{
fieldname: "to_fiscal_year",
label: __("To Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
default: frappe.sys_defaults.fiscal_year,
@@ -21,7 +29,7 @@ frappe.query_reports["Budget Variance Report"] = {
{ "value": "Half-Yearly", "label": __("Half-Yearly") },
{ "value": "Yearly", "label": __("Yearly") }
],
default: "Monthly",
default: "Yearly",
reqd: 1
},
{
@@ -46,5 +54,11 @@ frappe.query_reports["Budget Variance Report"] = {
fieldtype: "Link",
options: "Cost Center"
},
{
fieldname:"show_cumulative",
label: __("Show Cumulative Amount"),
fieldtype: "Check",
default: 0,
},
]
}

View File

@@ -9,7 +9,7 @@ from frappe.utils import formatdate
from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges
from six import iteritems
from pprint import pprint
def execute(filters=None):
if not filters: filters = {}
validate_filters(filters)
@@ -19,7 +19,7 @@ def execute(filters=None):
else:
cost_centers = get_cost_centers(filters)
period_month_ranges = get_period_month_ranges(filters["period"], filters["fiscal_year"])
period_month_ranges = get_period_month_ranges(filters["period"], filters["from_fiscal_year"])
cam_map = get_cost_center_account_month_map(filters)
data = []
@@ -29,18 +29,28 @@ def execute(filters=None):
for account, monthwise_data in iteritems(cost_center_items):
row = [cost_center, account]
totals = [0, 0, 0]
for relevant_months in period_month_ranges:
period_data = [0, 0, 0]
for month in relevant_months:
month_data = monthwise_data.get(month, {})
for i, fieldname in enumerate(["target", "actual", "variance"]):
value = flt(month_data.get(fieldname))
period_data[i] += value
totals[i] += value
period_data[2] = period_data[0] - period_data[1]
row += period_data
for year in get_fiscal_years(filters):
last_total = 0
for relevant_months in period_month_ranges:
period_data = [0, 0, 0]
for month in relevant_months:
if monthwise_data.get(year[0]):
month_data = monthwise_data.get(year[0]).get(month, {})
for i, fieldname in enumerate(["target", "actual", "variance"]):
value = flt(month_data.get(fieldname))
period_data[i] += value
totals[i] += value
period_data[0] += last_total
if(filters.get("show_cumulative")):
last_total = period_data[0] - period_data[1]
period_data[2] = period_data[0] - period_data[1]
row += period_data
totals[2] = totals[0] - totals[1]
row += totals
if filters["period"] != "Yearly" :
row += totals
data.append(row)
return columns, data
@@ -50,21 +60,32 @@ def validate_filters(filters):
frappe.throw(_("Filter based on Cost Center is only applicable if Budget Against is selected as Cost Center"))
def get_columns(filters):
columns = [_(filters.get("budget_against")) + ":Link/%s:120"%(filters.get("budget_against")), _("Account") + ":Link/Account:120"]
columns = [_(filters.get("budget_against")) + ":Link/%s:80"%(filters.get("budget_against")), _("Account") + ":Link/Account:80"]
group_months = False if filters["period"] == "Monthly" else True
for from_date, to_date in get_period_date_ranges(filters["period"], filters["fiscal_year"]):
for label in [_("Target") + " (%s)", _("Actual") + " (%s)", _("Variance") + " (%s)"]:
if group_months:
label = label % (formatdate(from_date, format_string="MMM") + " - " + formatdate(to_date, format_string="MMM"))
fiscal_year = get_fiscal_years(filters)
for year in fiscal_year:
for from_date, to_date in get_period_date_ranges(filters["period"], year[0]):
if filters["period"] == "Yearly":
labels = [_("Budget") + " " + str(year[0]), _("Actual ") + " " + str(year[0]), _("Varaiance ") + " " + str(year[0])]
for label in labels:
columns.append(label+":Float:80")
else:
label = label % formatdate(from_date, format_string="MMM")
for label in [_("Budget") + " (%s)" + " " + str(year[0]), _("Actual") + " (%s)" + " " + str(year[0]), _("Variance") + " (%s)" + " " + str(year[0])]:
if group_months:
label = label % (formatdate(from_date, format_string="MMM") + "-" + formatdate(to_date, format_string="MMM"))
else:
label = label % formatdate(from_date, format_string="MMM")
columns.append(label+":Float:120")
columns.append(label+":Float:80")
return columns + [_("Total Target") + ":Float:120", _("Total Actual") + ":Float:120",
_("Total Variance") + ":Float:120"]
if filters["period"] != "Yearly" :
return columns + [_("Total Budget") + ":Float:80", _("Total Actual") + ":Float:80",
_("Total Variance") + ":Float:80"]
else:
return columns
def get_cost_centers(filters):
cond = "and 1=1"
@@ -81,21 +102,23 @@ def get_cost_center_target_details(filters):
cond += " and b.cost_center='%s'" % frappe.db.escape(filters.get("cost_center"))
return frappe.db.sql("""
select b.{budget_against} as budget_against, b.monthly_distribution, ba.account, ba.budget_amount
select b.{budget_against} as budget_against, b.monthly_distribution, ba.account, ba.budget_amount,b.fiscal_year
from `tabBudget` b, `tabBudget Account` ba
where b.name=ba.parent and b.docstatus = 1 and b.fiscal_year=%s
and b.budget_against = %s and b.company=%s {cond}
where b.name=ba.parent and b.docstatus = 1 and b.fiscal_year between %s and %s
and b.budget_against = %s and b.company=%s {cond} order by b.fiscal_year
""".format(budget_against=filters.get("budget_against").replace(" ", "_").lower(), cond=cond),
(filters.fiscal_year, filters.budget_against, filters.company), as_dict=True)
(filters.from_fiscal_year,filters.to_fiscal_year,filters.budget_against, filters.company), as_dict=True)
#Get target distribution details of accounts of cost center
def get_target_distribution_details(filters):
target_details = {}
for d in frappe.db.sql("""select md.name, mdp.month, mdp.percentage_allocation
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
where mdp.parent=md.name and md.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
where mdp.parent=md.name and md.fiscal_year between %s and %s order by md.fiscal_year""",(filters.from_fiscal_year, filters.to_fiscal_year), as_dict=1):
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
return target_details
#Get actual details from gl entry
@@ -107,7 +130,7 @@ def get_actual_details(name, filters):
cc_lft, cc_rgt = frappe.db.get_value("Cost Center", name, ["lft", "rgt"])
cond = "lft>='{lft}' and rgt<='{rgt}'".format(lft = cc_lft, rgt=cc_rgt)
ac_details = frappe.db.sql("""select gl.account, gl.debit, gl.credit,
ac_details = frappe.db.sql("""select gl.account, gl.debit, gl.credit,gl.fiscal_year,
MONTHNAME(gl.posting_date) as month_name, b.{budget_against} as budget_against
from `tabGL Entry` gl, `tabBudget Account` ba, `tabBudget` b
where
@@ -115,11 +138,11 @@ def get_actual_details(name, filters):
and b.docstatus = 1
and ba.account=gl.account
and b.{budget_against} = gl.{budget_against}
and gl.fiscal_year=%s
and gl.fiscal_year between %s and %s
and b.{budget_against}=%s
and exists(select name from `tab{tab}` where name=gl.{budget_against} and {cond}) group by gl.name
""".format(tab = filters.budget_against, budget_against = budget_against, cond = cond),
(filters.fiscal_year, name), as_dict=1)
and exists(select name from `tab{tab}` where name=gl.{budget_against} and {cond}) group by gl.name order by gl.fiscal_year
""".format(tab = filters.budget_against, budget_against = budget_against, cond = cond,from_year=filters.from_fiscal_year,to_year=filters.to_fiscal_year),
(filters.from_fiscal_year, filters.to_fiscal_year, name), as_dict=1)
cc_actual_details = {}
for d in ac_details:
@@ -139,13 +162,12 @@ def get_cost_center_account_month_map(filters):
for month_id in range(1, 13):
month = datetime.date(2013, month_id, 1).strftime('%B')
cam_map.setdefault(ccd.budget_against, {}).setdefault(ccd.account, {})\
cam_map.setdefault(ccd.budget_against, {}).setdefault(ccd.account, {}).setdefault(ccd.fiscal_year,{})\
.setdefault(month, frappe._dict({
"target": 0.0, "actual": 0.0
}))
tav_dict = cam_map[ccd.budget_against][ccd.account][month]
tav_dict = cam_map[ccd.budget_against][ccd.account][ccd.fiscal_year][month]
month_percentage = tdd.get(ccd.monthly_distribution, {}).get(month, 0) \
if ccd.monthly_distribution else 100.0/12
@@ -156,3 +178,11 @@ def get_cost_center_account_month_map(filters):
tav_dict.actual += flt(ad.debit) - flt(ad.credit)
return cam_map
def get_fiscal_years(filters):
fiscal_year = frappe.db.sql("""select name from `tabFiscal Year` where
name between %(from_fiscal_year)s and %(to_fiscal_year)s""",
{'from_fiscal_year': filters["from_fiscal_year"], 'to_fiscal_year': filters["to_fiscal_year"]})
return fiscal_year

View File

@@ -10,7 +10,7 @@ from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement
def get_mapper_for(mappers, position):
mapper_list = filter(lambda x: x['position'] == position, mappers)
mapper_list = list(filter(lambda x: x['position'] == position, mappers))
return mapper_list[0] if mapper_list else []
@@ -345,13 +345,13 @@ def execute(filters=None):
# compute net profit / loss
income = get_data(
filters.company, "Income", "Credit", period_list,
filters.company, "Income", "Credit", period_list, filters=filters,
accumulated_values=filters.accumulated_values, ignore_closing_entries=True,
ignore_accumulated_values_for_fy=True
)
expense = get_data(
filters.company, "Expense", "Debit", period_list,
filters.company, "Expense", "Debit", period_list, filters=filters,
accumulated_values=filters.accumulated_values, ignore_closing_entries=True,
ignore_accumulated_values_for_fy=True
)

View File

@@ -42,6 +42,13 @@ frappe.query_reports["Consolidated Financial Statement"] = {
"default": "Balance Sheet",
"reqd": 1
},
{
"fieldname": "presentation_currency",
"label": __("Currency"),
"fieldtype": "Select",
"options": erpnext.get_presentation_currency_list(),
"default": frappe.defaults.get_user_default("Currency")
},
{
"fieldname":"accumulated_in_group_company",
"label": __("Accumulated Values in Group Company"),

View File

@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
from frappe.utils import flt, cint
from erpnext.accounts.report.utils import get_currency, convert_to_presentation_currency
from erpnext.accounts.report.financial_statements import get_fiscal_year_data, sort_accounts
from erpnext.accounts.report.balance_sheet.balance_sheet import (get_provisional_profit_loss,
check_opening_balance, get_chart_data)
@@ -48,7 +49,7 @@ def get_balance_sheet_data(fiscal_year, companies, columns, filters):
data.extend(liability or [])
data.extend(equity or [])
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
company_currency = get_company_currency(filters)
provisional_profit_loss, total_credit = get_provisional_profit_loss(asset, liability, equity,
companies, filters.get('company'), company_currency, True)
@@ -59,7 +60,7 @@ def get_balance_sheet_data(fiscal_year, companies, columns, filters):
"account_name": "'" + _("Unclosed Fiscal Years Profit / Loss (Credit)") + "'",
"account": "'" + _("Unclosed Fiscal Years Profit / Loss (Credit)") + "'",
"warn_if_negative": True,
"currency": frappe.get_cached_value('Company', filters.company, "default_currency")
"currency": company_currency
}
for company in companies:
unclosed[company] = opening_balance
@@ -92,7 +93,7 @@ def get_profit_loss_data(fiscal_year, companies, columns, filters):
return data, None, chart
def get_income_expense_data(companies, fiscal_year, filters):
company_currency = frappe.get_cached_value('Company', filters.company, "default_currency")
company_currency = get_company_currency(filters)
income = get_data(companies, "Income", "Credit", fiscal_year, filters, True)
expense = get_data(companies, "Expense", "Debit", fiscal_year, filters, True)
@@ -107,7 +108,7 @@ def get_cash_flow_data(fiscal_year, companies, filters):
income, expense, net_profit_loss = get_income_expense_data(companies, fiscal_year, filters)
data = []
company_currency = frappe.get_cached_value('Company', filters.company, "default_currency")
company_currency = get_company_currency(filters)
for cash_flow_account in cash_flow_accounts:
section_data = []
@@ -185,6 +186,7 @@ def get_columns(companies):
"fieldname": company,
"label": company,
"fieldtype": "Currency",
"options": "currency",
"width": 150
})
@@ -216,7 +218,8 @@ def get_data(companies, root_type, balance_must_be, fiscal_year, filters=None, i
return out
def get_company_currency(filters=None):
return frappe.get_cached_value('Company', filters.get('company'), "default_currency")
return (filters.get('presentation_currency')
or frappe.get_cached_value('Company', filters.company, "default_currency"))
def calculate_values(accounts_by_name, gl_entries_by_account, companies, fiscal_year, filters):
for entries in gl_entries_by_account.values():
@@ -238,6 +241,9 @@ def accumulate_values_into_parents(accounts, accounts_by_name, companies):
for d in reversed(accounts):
if d.parent_account:
account = d.parent_account.split('-')[0].strip()
if not accounts_by_name.get(account):
continue
for company in companies:
accounts_by_name[account][company] = \
accounts_by_name[account].get(company, 0.0) + d.get(company, 0.0)
@@ -268,8 +274,7 @@ def get_companies(filters):
return all_companies, companies
def get_subsidiary_companies(company):
lft, rgt = frappe.get_cached_value('Company',
company, ["lft", "rgt"])
lft, rgt = frappe.db.get_value('Company', company, ["lft", "rgt"])
return frappe.db.sql_list("""select name from `tabCompany`
where lft >= {0} and rgt <= {1} order by lft, rgt""".format(lft, rgt))
@@ -326,28 +331,42 @@ def set_gl_entries_by_account(from_date, to_date, root_lft, root_rgt, filters, g
filters.get('company'), ["lft", "rgt"])
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters)
gl_entries = frappe.db.sql("""select gl.posting_date, gl.account, gl.debit, gl.credit, gl.is_opening, gl.company,
gl.fiscal_year, gl.debit_in_account_currency, gl.credit_in_account_currency, gl.account_currency,
acc.account_name, acc.account_number
from `tabGL Entry` gl, `tabAccount` acc where acc.name = gl.account and gl.company in
(select name from `tabCompany` where lft >= %(company_lft)s and rgt <= %(company_rgt)s)
{additional_conditions} and gl.posting_date <= %(to_date)s and acc.lft >= %(lft)s and acc.rgt <= %(rgt)s
order by gl.account, gl.posting_date""".format(additional_conditions=additional_conditions),
{
"from_date": from_date,
"to_date": to_date,
"lft": root_lft,
"rgt": root_rgt,
companies = frappe.db.sql(""" select name, default_currency from `tabCompany`
where lft >= %(company_lft)s and rgt <= %(company_rgt)s""", {
"company_lft": company_lft,
"company_rgt": company_rgt,
},
as_dict=True)
}, as_dict=1)
for entry in gl_entries:
key = entry.account_number or entry.account_name
validate_entries(key, entry, accounts_by_name)
gl_entries_by_account.setdefault(key, []).append(entry)
currency_info = frappe._dict({
'report_date': to_date,
'presentation_currency': filters.get('presentation_currency')
})
for d in companies:
gl_entries = frappe.db.sql("""select gl.posting_date, gl.account, gl.debit, gl.credit, gl.is_opening, gl.company,
gl.fiscal_year, gl.debit_in_account_currency, gl.credit_in_account_currency, gl.account_currency,
acc.account_name, acc.account_number
from `tabGL Entry` gl, `tabAccount` acc where acc.name = gl.account and gl.company = %(company)s
{additional_conditions} and gl.posting_date <= %(to_date)s and acc.lft >= %(lft)s and acc.rgt <= %(rgt)s
order by gl.account, gl.posting_date""".format(additional_conditions=additional_conditions),
{
"from_date": from_date,
"to_date": to_date,
"lft": root_lft,
"rgt": root_rgt,
"company": d.name
},
as_dict=True)
if filters and filters.get('presentation_currency') != d.default_currency:
currency_info['company'] = d.name
currency_info['company_currency'] = d.default_currency
convert_to_presentation_currency(gl_entries, currency_info)
for entry in gl_entries:
key = entry.account_number or entry.account_name
validate_entries(key, entry, accounts_by_name)
gl_entries_by_account.setdefault(key, []).append(entry)
return gl_entries_by_account

View File

@@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import re
from past.builtins import cmp
@@ -339,19 +341,20 @@ def set_gl_entries_by_account(
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters)
accounts = frappe.db.sql_list("""select name from `tabAccount`
where lft >= %s and rgt <= %s""", (root_lft, root_rgt))
additional_conditions += " and account in ('{}')"\
.format("', '".join([frappe.db.escape(d) for d in accounts]))
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry`
where company=%(company)s
{additional_conditions}
and posting_date <= %(to_date)s
and account in (select name from `tabAccount`
where lft >= %(lft)s and rgt <= %(rgt)s)
order by account, posting_date""".format(additional_conditions=additional_conditions),
{
"company": company,
"from_date": from_date,
"to_date": to_date,
"lft": root_lft,
"rgt": root_rgt,
"cost_center": filters.cost_center,
"project": filters.project
},
@@ -378,8 +381,8 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters):
if filters:
if filters.get("project"):
if not isinstance(filters.get("project"), list):
projects = str(filters.get("project")).strip()
filters.project = [d.strip() for d in projects.split(',') if d]
projects = frappe.safe_encode(filters.get("project"))
filters.project = [d.strip() for d in projects.strip().split(',') if d]
additional_conditions.append("project in %(project)s")
if filters.get("cost_center"):
@@ -399,7 +402,7 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters):
def get_cost_centers_with_children(cost_centers):
if not isinstance(cost_centers, list):
cost_centers = [d.strip() for d in str(cost_centers).strip().split(',') if d]
cost_centers = [d.strip() for d in cost_centers.strip().split(',') if d]
all_cost_centers = []
for d in cost_centers:

View File

@@ -196,8 +196,9 @@ frappe.query_reports["General Ledger"] = {
"fieldname":"group_by",
"label": __("Group by"),
"fieldtype": "Select",
"options": ["", "Group by Voucher", "Group by Account", "Group by Party"],
"default": "Group by Voucher"
"options": ["", __("Group by Voucher"), __("Group by Voucher (Consolidated)"),
__("Group by Account"), __("Group by Party")],
"default": __("Group by Voucher (Consolidated)")
},
{
"fieldname":"tax_id",

View File

@@ -48,11 +48,12 @@ def validate_filters(filters, account_details):
if filters.get("account") and not account_details.get(filters.account):
frappe.throw(_("Account {0} does not exists").format(filters.account))
if (filters.get("account") and filters.get("group_by") == 'Group by Account'
if (filters.get("account") and filters.get("group_by") == _('Group by Account')
and account_details[filters.account].is_group == 0):
frappe.throw(_("Can not filter based on Account, if grouped by Account"))
if (filters.get("voucher_no") and filters.get("group_by") == 'Group by Voucher'):
if (filters.get("voucher_no")
and filters.get("group_by") in [_('Group by Voucher'), _('Group by Voucher (Consolidated)')]):
frappe.throw(_("Can not filter based on Voucher No, if grouped by Voucher"))
if filters.from_date > filters.to_date:
@@ -114,30 +115,37 @@ def get_result(filters, account_details):
return result
def get_gl_entries(filters):
currency_map = get_currency(filters)
select_fields = """, debit_in_account_currency,
credit_in_account_currency""" \
select_fields = """, debit, credit, debit_in_account_currency,
credit_in_account_currency """
order_by_fields = "posting_date, account"
if filters.get("group_by") == "Group by Voucher":
order_by_fields = "posting_date, voucher_type, voucher_no"
group_by_statement = ''
order_by_statement = "order by posting_date, account"
if filters.get("group_by") == _("Group by Voucher"):
order_by_statement = "order by posting_date, voucher_type, voucher_no"
if filters.get("group_by") == _("Group by Voucher (Consolidated)"):
group_by_statement = "group by voucher_type, voucher_no, account, cost_center"
select_fields = """, sum(debit) as debit, sum(credit) as credit,
sum(debit_in_account_currency) as debit_in_account_currency,
sum(credit_in_account_currency) as credit_in_account_currency"""
gl_entries = frappe.db.sql(
"""
select
posting_date, account, party_type, party,
debit, credit,
voucher_type, voucher_no, cost_center, project,
against_voucher_type, against_voucher, account_currency,
remarks, against, is_opening {select_fields}
from `tabGL Entry`
where company=%(company)s {conditions}
order by {order_by_fields}
where company=%(company)s {conditions} {group_by_statement}
{order_by_statement}
""".format(
select_fields=select_fields, conditions=get_conditions(filters),
order_by_fields=order_by_fields
group_by_statement=group_by_statement,
order_by_statement=order_by_statement
),
filters, as_dict=1)
@@ -204,13 +212,13 @@ def get_data_with_opening_closing(filters, account_details, gl_entries):
# Opening for filtered account
data.append(totals.opening)
if filters.get("group_by"):
if filters.get("group_by") != _('Group by Voucher (Consolidated)'):
for acc, acc_dict in iteritems(gle_map):
# acc
if acc_dict.entries:
# opening
data.append({})
if filters.get("group_by") != "Group by Voucher":
if filters.get("group_by") != _("Group by Voucher"):
data.append(acc_dict.totals.opening)
data += acc_dict.entries
@@ -219,10 +227,9 @@ def get_data_with_opening_closing(filters, account_details, gl_entries):
data.append(acc_dict.totals.total)
# closing
if filters.get("group_by") != "Group by Voucher":
if filters.get("group_by") != _("Group by Voucher"):
data.append(acc_dict.totals.closing)
data.append({})
else:
data += entries
@@ -234,7 +241,6 @@ def get_data_with_opening_closing(filters, account_details, gl_entries):
return data
def get_totals_dict():
def _get_debit_credit_dict(label):
return _dict(
@@ -251,12 +257,12 @@ def get_totals_dict():
)
def group_by_field(group_by):
if group_by == 'Group by Party':
if group_by == _('Group by Party'):
return 'party'
elif group_by == 'Group by Voucher':
return 'voucher_no'
else:
elif group_by in [_('Group by Voucher (Consolidated)'), _('Group by Account')]:
return 'account'
else:
return 'voucher_no'
def initialize_gle_map(gl_entries, filters):
gle_map = frappe._dict()
@@ -291,7 +297,7 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
elif gle.posting_date <= to_date:
update_value_in_dict(gle_map[gle.get(group_by)].totals, 'total', gle)
update_value_in_dict(totals, 'total', gle)
if filters.get("group_by"):
if filters.get("group_by") != _('Group by Voucher (Consolidated)'):
gle_map[gle.get(group_by)].entries.append(gle)
else:
entries.append(gle)
@@ -301,7 +307,6 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
return totals, entries
def get_result_as_list(data, filters):
balance, balance_in_account_currency = 0, 0
inv_details = get_supplier_invoice_details()

View File

@@ -236,7 +236,7 @@ class GrossProfitGenerator(object):
previous_stock_value = len(my_sle) > i+1 and \
flt(my_sle[i+1].stock_value) or 0.0
if previous_stock_value:
return previous_stock_value - flt(sle.stock_value)
return (previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
else:
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
else:

View File

@@ -28,6 +28,24 @@ frappe.query_reports["Item-wise Sales Register"] = {
"label": __("Mode of Payment"),
"fieldtype": "Link",
"options": "Mode of Payment"
},
{
"fieldname":"warehouse",
"label": __("Warehouse"),
"fieldtype": "Link",
"options": "Warehouse"
},
{
"fieldname":"brand",
"label": __("Brand"),
"fieldtype": "Link",
"options": "Brand"
},
{
"fieldname":"item_group",
"label": __("Item Group"),
"fieldtype": "Link",
"options": "Item Group"
}
]
}

View File

@@ -14,10 +14,10 @@ def execute(filters=None):
def _execute(filters=None, additional_table_columns=None, additional_query_columns=None):
if not filters: filters = {}
filters.update({"from_date": filters.get("date_range")[0], "to_date": filters.get("date_range")[1]})
filters.update({"from_date": filters.get("date_range") and filters.get("date_range")[0], "to_date": filters.get("date_range") and filters.get("date_range")[1]})
columns = get_columns(additional_table_columns)
company_currency = erpnext.get_company_currency(filters.company)
company_currency = erpnext.get_company_currency(filters.get('company'))
item_list = get_items(filters, additional_query_columns)
if item_list:
@@ -55,7 +55,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
]
row += [(d.base_net_rate * d.qty)/d.stock_qty, d.base_net_amount] \
if d.stock_uom != d.uom else [d.base_net_rate, d.base_net_amount]
if d.stock_uom != d.uom and d.stock_qty != 0 else [d.base_net_rate, d.base_net_amount]
total_tax = 0
for tax in tax_columns:
@@ -108,6 +108,23 @@ def get_conditions(filters):
conditions += """ and exists(select name from `tabSales Invoice Payment`
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
if filters.get("warehouse"):
conditions += """ and exists(select name from `tabSales Invoice Item`
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Item`.warehouse, '') = %(warehouse)s)"""
if filters.get("brand"):
conditions += """ and exists(select name from `tabSales Invoice Item`
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Item`.brand, '') = %(brand)s)"""
if filters.get("item_group"):
conditions += """ and exists(select name from `tabSales Invoice Item`
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Item`.item_group, '') = %(item_group)s)"""
return conditions

View File

@@ -52,6 +52,18 @@ frappe.query_reports["Sales Register"] = {
"label": __("Warehouse"),
"fieldtype": "Link",
"options": "Warehouse"
},
{
"fieldname":"brand",
"label": __("Brand"),
"fieldtype": "Link",
"options": "Brand"
},
{
"fieldname":"item_group",
"label": __("Item Group"),
"fieldtype": "Link",
"options": "Item Group"
}
]
}

View File

@@ -153,6 +153,16 @@ def get_conditions(filters):
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Item`.warehouse, '') = %(warehouse)s)"""
if filters.get("brand"):
conditions += """ and exists(select name from `tabSales Invoice Item`
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Item`.brand, '') = %(brand)s)"""
if filters.get("item_group"):
conditions += """ and exists(select name from `tabSales Invoice Item`
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Item`.item_group, '') = %(item_group)s)"""
return conditions
def get_invoices(filters, additional_query_columns):

View File

@@ -8,6 +8,7 @@ frappe.query_reports["TDS Computation Summary"] = {
"fieldname":"company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default('company')
},
{

View File

@@ -41,8 +41,10 @@ def get_result(filters):
for supplier in filters.supplier:
tds = frappe.get_doc("Tax Withholding Category", supplier.tax_withholding_category)
rate = [d.tax_withholding_rate for d in tds.rates if d.fiscal_year == filters.fiscal_year][0]
account = [d.account for d in tds.accounts if d.company == filters.company][0]
try:
account = [d.account for d in tds.accounts if d.company == filters.company][0]
except IndexError:
account = []
total_invoiced_amount, tds_deducted = get_invoice_and_tds_amount(supplier.name, account,
filters.company, filters.from_date, filters.to_date)

View File

@@ -8,6 +8,7 @@ frappe.query_reports["TDS Payable Monthly"] = {
"fieldname":"company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default('company')
},
{

View File

@@ -64,13 +64,16 @@ def get_result(filters):
total_amount_credited += k.credit
rate = [i.tax_withholding_rate for i in tds_doc.rates
if i.fiscal_year == gle_map[d][0].fiscal_year][0]
if i.fiscal_year == gle_map[d][0].fiscal_year]
if getdate(filters.from_date) <= gle_map[d][0].posting_date \
and getdate(filters.to_date) >= gle_map[d][0].posting_date:
out.append([supplier.pan, supplier.name, tds_doc.name,
supplier.supplier_type, rate, total_amount_credited, tds_deducted,
gle_map[d][0].posting_date, "Purchase Invoice", d])
if rate and len(rate) > 0:
rate = rate[0]
if getdate(filters.from_date) <= gle_map[d][0].posting_date \
and getdate(filters.to_date) >= gle_map[d][0].posting_date:
out.append([supplier.pan, supplier.name, tds_doc.name,
supplier.supplier_type, rate, total_amount_credited, tds_deducted,
gle_map[d][0].posting_date, "Purchase Invoice", d])
return out

View File

@@ -231,6 +231,13 @@ def get_columns():
"options": "Account",
"width": 300
},
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"hidden": 1
},
{
"fieldname": "opening_debit",
"label": _("Opening (Dr)"),
@@ -272,13 +279,6 @@ def get_columns():
"fieldtype": "Currency",
"options": "currency",
"width": 120
},
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"hidden": 1
}
]

View File

@@ -21,6 +21,8 @@ def get_data(filters, show_party_name):
party_name_field = "{0}_name".format(frappe.scrub(filters.get('party_type')))
if filters.get('party_type') == 'Student':
party_name_field = 'first_name'
elif filters.get('party_type') == 'Shareholder':
party_name_field = 'title'
party_filters = {"name": filters.get("party")} if filters.get("party") else {}
parties = frappe.get_all(filters.get("party_type"), fields = ["name", party_name_field],

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -15,6 +16,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"translatable": 0,
"unique": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -102,6 +108,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -115,7 +122,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-25 22:26:28.797375",
"modified": "2018-11-04 03:27:36.678832",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Agriculture Analysis Criteria",
@@ -124,7 +131,6 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -144,7 +150,6 @@
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -166,10 +171,12 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "",
"track_changes": 1,
"track_seen": 0
}
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -191,7 +192,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-08-21 16:15:48.528845",
"modified": "2018-11-04 03:28:08.679157",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Agriculture Task",
@@ -201,6 +202,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -15,6 +16,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"translatable": 0,
"unique": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -70,10 +74,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -100,10 +106,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -129,10 +137,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -159,10 +169,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -190,10 +202,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -221,10 +235,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -252,10 +268,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -281,10 +299,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -311,10 +331,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -342,10 +364,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -371,10 +395,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -401,10 +427,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -432,10 +460,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -461,10 +491,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -492,10 +524,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -521,10 +555,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -551,10 +587,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -580,10 +618,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -611,10 +651,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -640,10 +682,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -671,10 +715,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -701,10 +747,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -730,10 +778,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -761,10 +811,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -790,10 +842,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -820,10 +874,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -851,10 +907,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -881,10 +939,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -912,10 +972,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -942,10 +1004,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -973,6 +1037,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -986,7 +1051,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-06 11:00:06.333894",
"modified": "2018-11-04 03:27:10.651075",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Crop",
@@ -995,7 +1060,6 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -1015,7 +1079,6 @@
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1037,9 +1100,11 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -844,7 +845,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-06-20 04:41:36.148829",
"modified": "2018-11-04 03:31:47.602312",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Crop Cycle",
@@ -893,9 +894,11 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -121,7 +122,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-06-06 02:24:52.131482",
"modified": "2018-11-04 03:27:47.463994",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Detected Disease",
@@ -131,9 +132,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -15,6 +16,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"translatable": 0,
"unique": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -100,10 +106,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -131,10 +139,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -161,10 +171,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -191,10 +203,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -221,6 +235,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -234,7 +249,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-07 16:24:22.923154",
"modified": "2018-11-04 03:27:25.076490",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Disease",
@@ -243,7 +258,6 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -263,7 +277,6 @@
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -285,9 +298,11 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -15,6 +16,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"translatable": 0,
"unique": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -72,10 +76,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -101,10 +107,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -131,10 +139,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -160,10 +170,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -190,10 +202,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -220,6 +234,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -233,7 +248,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-05 19:13:42.471667",
"modified": "2018-11-04 03:26:29.211792",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Fertilizer",
@@ -242,7 +257,6 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -262,7 +276,6 @@
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -284,9 +297,11 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -56,7 +57,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-06-20 04:35:51.675244",
"modified": "2018-11-04 03:27:58.120962",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Linked Location",
@@ -66,9 +67,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,6 +43,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -54,7 +57,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-04 13:25:30.437597",
"modified": "2018-11-04 03:25:15.359130",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Linked Plant Analysis",
@@ -64,9 +67,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,6 +43,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -54,7 +57,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-04 13:26:18.682109",
"modified": "2018-11-04 03:25:27.670079",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Linked Soil Analysis",
@@ -64,9 +67,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,6 +43,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -54,7 +57,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-04 13:26:07.773314",
"modified": "2018-11-04 03:26:17.877616",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Linked Soil Texture",
@@ -64,9 +67,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -312,7 +313,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:40.027967",
"modified": "2018-11-04 03:28:48.087828",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Plant Analysis",
@@ -361,6 +362,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -101,10 +107,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -131,6 +139,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -144,7 +153,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-05 19:37:02.289320",
"modified": "2018-11-04 03:25:43.714882",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Plant Analysis Criteria",
@@ -154,9 +163,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -533,7 +534,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:56.754373",
"modified": "2018-11-04 03:28:58.403760",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Soil Analysis",
@@ -582,6 +583,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -101,10 +107,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -131,6 +139,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -144,7 +153,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-05 23:35:34.569482",
"modified": "2018-11-04 03:25:54.359008",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Soil Analysis Criteria",
@@ -154,9 +163,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -473,7 +474,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:41.823722",
"modified": "2018-11-04 03:29:18.221173",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Soil Texture",
@@ -522,6 +523,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -101,10 +107,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -131,6 +139,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -144,7 +153,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-05 23:45:17.419610",
"modified": "2018-11-04 03:26:46.178377",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Soil Texture Criteria",
@@ -154,9 +163,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -534,7 +535,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:52.416815",
"modified": "2018-11-04 03:29:08.325644",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Water Analysis",
@@ -583,6 +584,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -101,10 +107,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -131,6 +139,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -144,7 +153,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-05 23:36:45.836858",
"modified": "2018-11-04 03:26:07.026834",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Water Analysis Criteria",
@@ -154,9 +163,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,9 +1,10 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:date",
"autoname": "format:WEA-{date}-{location}",
"beta": 0,
"creation": "2017-10-17 19:01:05.095598",
"custom": 0,
@@ -15,12 +16,13 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "source",
"fieldtype": "Data",
"fieldname": "location",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -28,9 +30,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Source",
"label": "Location",
"length": 0,
"no_copy": 0,
"options": "Location",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -41,10 +44,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -70,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -100,10 +107,44 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "source",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Source",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -129,10 +170,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -159,10 +202,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -189,6 +234,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -202,7 +248,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-06 11:04:36.977755",
"modified": "2018-11-04 03:31:36.839743",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Weather",
@@ -211,7 +257,6 @@
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -231,7 +276,6 @@
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -253,9 +297,11 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -101,10 +107,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -131,6 +139,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -144,7 +153,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-06 00:26:48.887975",
"modified": "2018-11-04 03:26:58.794373",
"modified_by": "Administrator",
"module": "Agriculture",
"name": "Weather Parameter",
@@ -154,9 +163,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Agriculture",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@@ -94,6 +94,12 @@ frappe.ui.form.on('Asset', {
}, __("Make"));
}
if (!frm.doc.calculate_depreciation) {
frm.add_custom_button(__("Depreciation Entry"), function() {
frm.trigger("make_journal_entry");
}, __("Make"));
}
frm.page.set_inner_btn_group_as_primary(__("Make"));
frm.trigger("setup_chart");
}
@@ -103,6 +109,21 @@ frappe.ui.form.on('Asset', {
}
},
make_journal_entry: function(frm) {
frappe.call({
method: "erpnext.assets.doctype.asset.asset.make_journal_entry",
args: {
asset_name: frm.doc.name
},
callback: function(r) {
if (r.message) {
var doclist = frappe.model.sync(r.message);
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
}
}
})
},
setup_chart: function(frm) {
var x_intervals = [frm.doc.purchase_date];
var asset_values = [frm.doc.gross_purchase_amount];

View File

@@ -85,8 +85,17 @@ class Asset(AccountsController):
elif not self.finance_books:
frappe.throw(_("Enter depreciation details"))
if self.available_for_use_date and getdate(self.available_for_use_date) < getdate(nowdate()):
frappe.throw(_("Available-for-use Date is entered as past date"))
if self.is_existing_asset:
return
date = nowdate()
docname = self.purchase_receipt or self.purchase_invoice
if docname:
doctype = 'Purchase Receipt' if self.purchase_receipt else 'Purchase Invoice'
date = frappe.db.get_value(doctype, docname, 'posting_date')
if self.available_for_use_date and getdate(self.available_for_use_date) < getdate(date):
frappe.throw(_("Available-for-use Date should be after purchase date"))
def make_depreciation_schedule(self):
if self.depreciation_method != 'Manual':
@@ -511,3 +520,34 @@ def get_asset_account(account_name, asset=None, asset_category=None, company=Non
.format(account_name.replace('_', ' ').title(), asset_category, company))
return account
@frappe.whitelist()
def make_journal_entry(asset_name):
asset = frappe.get_doc("Asset", asset_name)
fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account = \
get_depreciation_accounts(asset)
depreciation_cost_center, depreciation_series = frappe.db.get_value("Company", asset.company,
["depreciation_cost_center", "series_for_depreciation_entry"])
depreciation_cost_center = asset.cost_center or depreciation_cost_center
je = frappe.new_doc("Journal Entry")
je.voucher_type = "Depreciation Entry"
je.naming_series = depreciation_series
je.company = asset.company
je.remark = "Depreciation Entry against asset {0}".format(asset_name)
je.append("accounts", {
"account": depreciation_expense_account,
"reference_type": "Asset",
"reference_name": asset.name,
"cost_center": depreciation_cost_center
})
je.append("accounts", {
"account": accumulated_depreciation_account,
"reference_type": "Asset",
"reference_name": asset.name
})
return je

View File

@@ -9,8 +9,9 @@ from frappe.utils import flt, today, getdate, cint
def post_depreciation_entries(date=None):
# Return if automatic booking of asset depreciation is disabled
if not frappe.db.get_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically"):
if not cint(frappe.db.get_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically")):
return
if not date:
date = today()
for asset in get_depreciable_assets(date):
@@ -197,4 +198,4 @@ def get_disposal_account_and_cost_center(company):
if not depreciation_cost_center:
frappe.throw(_("Please set 'Asset Depreciation Cost Center' in Company {0}").format(company))
return disposal_account, depreciation_cost_center
return disposal_account, depreciation_cost_center

View File

@@ -13,7 +13,11 @@ frappe.ui.form.on('Asset Value Adjustment', {
}
});
},
onload: function(frm) {
if(frm.is_new() && frm.doc.asset) {
frm.trigger("set_current_asset_value");
}
},
asset: function(frm) {
frm.trigger("set_current_asset_value");
},

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@@ -180,39 +181,6 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"fieldname": "is_subcontracted",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Supply Raw Materials",
"length": 0,
"no_copy": 0,
"options": "No\nYes",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -246,40 +214,6 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_subcontracted==\"Yes\"",
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplier Warehouse",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -1353,6 +1287,168 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sec_warehouse",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "set_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Set Target Warehouse",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break_warehouse",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"fieldname": "is_subcontracted",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Supply Raw Materials",
"length": 0,
"no_copy": 0,
"options": "No\nYes",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_subcontracted==\"Yes\"",
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplier Warehouse",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -1386,6 +1482,38 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "scan_barcode",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Scan Barcode",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 1,
"allow_in_quick_entry": 0,
@@ -1420,6 +1548,74 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "supplied_items",
"columns": 0,
"fieldname": "raw_material_details",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Raw Materials Supplied",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "supplied_items",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplied Items",
"length": 0,
"no_copy": 0,
"oldfieldname": "po_raw_material_details",
"oldfieldtype": "Table",
"options": "Purchase Order Item Supplied",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -3428,107 +3624,6 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "supplied_items",
"columns": 0,
"fieldname": "raw_material_details",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Raw Materials Supplied",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_subcontracted",
"fieldname": "supplied_items_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplied Items",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "supplied_items",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Supplied Items",
"length": 0,
"no_copy": 0,
"oldfieldname": "po_raw_material_details",
"oldfieldtype": "Table",
"options": "Purchase Order Item Supplied",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -3736,8 +3831,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-29 12:16:12.886021",
"modified_by": "nabinhait@gmail.com",
"modified": "2018-11-12 19:59:49.211145",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
"owner": "Administrator",

View File

@@ -128,7 +128,7 @@ frappe.ui.form.on("Request for Quotation",{
doctype: "Supplier",
order_by: "name",
fields: ["name"],
filters: [["Supplier", "supplier_group_name", "=", args.supplier_group]]
filters: [["Supplier", "supplier_group", "=", args.supplier_group]]
},
callback: load_suppliers

View File

@@ -49,6 +49,10 @@ frappe.ui.form.on("Supplier", {
erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name);
}, __("Make"));
frm.add_custom_button(__('Pricing Rule'), function () {
erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name);
}, __("Make"));
// indicators
erpnext.utils.set_party_dashboard_indicators(frm);
}

View File

@@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 1,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
@@ -213,6 +214,38 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_transporter",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Transporter",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -1430,7 +1463,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-09-07 08:48:57.719713",
"modified": "2018-10-06 14:31:46.378758",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",

View File

@@ -13,6 +13,10 @@ def get_data():
{
'label': _('Orders'),
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
},
{
'label': _('Pricing'),
'items': ['Pricing Rule']
}
]
}

View File

@@ -60,7 +60,12 @@ class SupplierQuotation(BuyingController):
for rfq in rfq_list:
doc = frappe.get_doc('Request for Quotation', rfq)
doc_sup = frappe.get_all('Request for Quotation Supplier', filters=
{'parent': doc.name, 'supplier': self.supplier}, fields=['name', 'quote_status'])[0]
{'parent': doc.name, 'supplier': self.supplier}, fields=['name', 'quote_status'])
doc_sup = doc_sup[0] if doc_sup else None
if not doc_sup:
frappe.throw(_("Supplier {0} not found in {1}").format(self.supplier,
"<a href='desk#Form/Request for Quotation/{0}'> Request for Quotation {0} </a>".format(doc.name)))
quote_status = _('Received')
for item in doc.items:
@@ -152,4 +157,4 @@ def make_quotation(source_name, target_doc=None):
}
}, target_doc)
return doclist
return doclist

View File

@@ -1 +0,0 @@
Trends of purchases across Items, Item Groups, Suppliers.

View File

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

View File

@@ -1,231 +0,0 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.pages['purchase-analytics'].on_page_load = function(wrapper) {
frappe.ui.make_app_page({
parent: wrapper,
title: __('Purchase Analytics'),
single_column: true
});
new erpnext.PurchaseAnalytics(wrapper);
frappe.breadcrumbs.add("Buying");
}
erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
init: function(wrapper) {
this._super({
title: __("Purchase Analytics"),
parent: $(wrapper).find('.layout-main'),
page: wrapper.page,
doctypes: ["Item", "Item Group", "Supplier", "Supplier Group", "Company", "Fiscal Year",
"Purchase Invoice", "Purchase Invoice Item",
"Purchase Order", "Purchase Order Item[Purchase Analytics]",
"Purchase Receipt", "Purchase Receipt Item[Purchase Analytics]"],
tree_grid: { show: true }
});
this.tree_grids = {
"Supplier Group": {
label: __("Supplier Group / Supplier"),
show: true,
item_key: "supplier",
parent_field: "parent_supplier_group",
formatter: function(item) {
return item.supplier_name ? item.supplier_name + " (" + item.name + ")" : item.name;
}
},
"Supplier": {
label: __("Supplier"),
show: false,
item_key: "supplier",
formatter: function(item) {
return item.supplier_name ? item.supplier_name + " (" + item.name + ")" : item.name;
}
},
"Item Group": {
label: "Item",
show: true,
parent_field: "parent_item_group",
item_key: "item_code",
formatter: function(item) {
return item.name;
}
},
"Item": {
label: "Item",
show: false,
item_key: "item_code",
formatter: function(item) {
return item.name;
}
},
}
},
setup_columns: function() {
this.tree_grid = this.tree_grids[this.tree_type];
var std_columns = [
{id: "name", name: this.tree_grid.label, field: "name", width: 300},
{id: "total", name: "Total", field: "total", plot: false,
formatter: this.currency_formatter}
];
this.make_date_range_columns();
this.columns = std_columns.concat(this.columns);
},
filters: [
{fieldtype:"Select", label: __("Tree Type"), fieldname: "tree_type",
options:["Supplier Group", "Supplier", "Item Group", "Item"],
filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}},
{fieldtype:"Select", label: __("Based On"), fieldname: "based_on",
options:["Purchase Invoice", "Purchase Order", "Purchase Receipt"]},
{fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
options:["Value", "Quantity"]},
{fieldtype:"Select", label: __("Company"), link:"Company", fieldname: "company",
default_value: __("Select Company...")},
{fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
{fieldtype:"Select", label: __("Range"), fieldname: "range",
options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"},
{label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"},
{label: __("Yearly"), value: "Yearly"}]}
],
setup_filters: function() {
var me = this;
this._super();
this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]);
this.show_zero_check();
},
init_filter_values: function() {
this._super();
this.filter_inputs.range.val('Monthly');
},
prepare_data: function() {
var me = this;
if (!this.tl) {
// add 'Not Set' Supplier & Item
// (Supplier / Item are not mandatory!!)
frappe.report_dump.data["Supplier"].push({
name: __("Not Set"),
parent_supplier_group: __("All Supplier Groups"),
id: "Not Set",
});
frappe.report_dump.data["Item"].push({
name: __("Not Set"),
parent_item_group: "All Item Groups",
id: "Not Set",
});
}
if (!this.tl || !this.tl[this.based_on]) {
this.make_transaction_list(this.based_on, this.based_on + " Item");
}
if(!this.data || me.item_type != me.tree_type) {
var items;
if(me.tree_type=='Supplier') {
items = frappe.report_dump.data["Supplier"];
} else if(me.tree_type=='Supplier Group') {
items = this.prepare_tree("Supplier", "Supplier Group");
} else if(me.tree_type=="Item Group") {
items = this.prepare_tree("Item", "Item Group");
} else if(me.tree_type=="Item") {
items = frappe.report_dump.data["Item"];
}
me.item_type = me.tree_type
me.parent_map = {};
me.item_by_name = {};
me.data = [];
$.each(items, function(i, v) {
var d = copy_dict(v);
me.data.push(d);
me.item_by_name[d.name] = d;
if(d[me.tree_grid.parent_field]) {
me.parent_map[d.name] = d[me.tree_grid.parent_field];
}
me.reset_item_values(d);
});
this.set_indent();
} else {
// otherwise, only reset values
$.each(this.data, function(i, d) {
me.reset_item_values(d);
});
}
this.prepare_balances();
if(me.tree_grid.show) {
this.set_totals(false);
this.update_groups();
} else {
this.set_totals(true);
}
},
prepare_balances: function() {
var me = this;
var from_date = frappe.datetime.str_to_obj(this.from_date);
var to_date = frappe.datetime.str_to_obj(this.to_date);
var is_val = this.value_or_qty == 'Value';
$.each(this.tl[this.based_on], function(i, tl) {
if (me.is_default('company') ? true : tl.company === me.company) {
var posting_date = frappe.datetime.str_to_obj(tl.posting_date);
if (posting_date >= from_date && posting_date <= to_date) {
var item = me.item_by_name[tl[me.tree_grid.item_key]] ||
me.item_by_name['Not Set'];
item[me.column_map[tl.posting_date].field] += (is_val ? tl.base_net_amount : tl.qty);
}
}
});
},
update_groups: function() {
var me = this;
$.each(this.data, function(i, item) {
var parent = me.parent_map[item.name];
while(parent) {
var parent_group = me.item_by_name[parent];
$.each(me.columns, function(c, col) {
if (col.formatter == me.currency_formatter) {
parent_group[col.field] =
flt(parent_group[col.field])
+ flt(item[col.field]);
}
});
parent = me.parent_map[parent];
}
});
},
set_totals: function(sort) {
var me = this;
var checked = false;
$.each(this.data, function(i, d) {
d.total = 0.0;
$.each(me.columns, function(i, col) {
if(col.formatter==me.currency_formatter && !col.hidden && col.field!="total")
d.total += d[col.field];
if(d.checked) checked = true;
})
});
if(sort)this.data = this.data.sort(function(a, b) { return b.total - a.total; });
if(!this.checked) {
this.data[0].checked = true;
}
}
});

View File

@@ -1,23 +0,0 @@
{
"creation": "2012-09-21 20:15:16.000000",
"docstatus": 0,
"doctype": "Page",
"icon": "fa fa-bar-chart",
"idx": 1,
"modified": "2013-07-11 14:43:52.000000",
"modified_by": "Administrator",
"module": "Buying",
"name": "purchase-analytics",
"owner": "Administrator",
"page_name": "purchase-analytics",
"roles": [
{
"role": "Analytics"
},
{
"role": "Purchase Manager"
}
],
"standard": "Yes",
"title": "Purchase Analytics"
}

View File

@@ -0,0 +1,125 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Purchase Analytics"] = {
"filters": [
{
fieldname: "tree_type",
label: __("Tree Type"),
fieldtype: "Select",
options: ["Supplier Group","Supplier","Item Group","Item"],
default: "Supplier",
reqd: 1
},
{
fieldname: "doc_type",
label: __("based_on"),
fieldtype: "Select",
options: ["Purchase Order","Purchase Receipt","Purchase Invoice"],
default: "Purchase Invoice",
reqd: 1
},
{
fieldname: "value_quantity",
label: __("Value Or Qty"),
fieldtype: "Select",
options: [
{ "value": "Value", "label": __("Value") },
{ "value": "Quantity", "label": __("Quantity") },
],
default: "Value",
reqd: 1
},
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
default: frappe.defaults.get_user_default("year_start_date"),
reqd: 1
},
{
fieldname:"to_date",
label: __("To Date"),
fieldtype: "Date",
default: frappe.defaults.get_user_default("year_end_date"),
reqd: 1
},
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
default: frappe.defaults.get_user_default("Company"),
reqd: 1
},
{
fieldname: "range",
label: __("Range"),
fieldtype: "Select",
options: [
{ "value": "Weekly", "label": __("Weekly") },
{ "value": "Monthly", "label": __("Monthly") },
{ "value": "Quarterly", "label": __("Quarterly") },
{ "value": "Yearly", "label": __("Yearly") }
],
default: "Monthly",
reqd: 1
}
],
after_datatable_render: function(datatable_obj) {
$(datatable_obj.wrapper).find(".dt-row-0").find('input[type=checkbox]').click();
},
get_datatable_options(options) {
return Object.assign(options, {
checkboxColumn: true,
events: {
onCheckRow: function(data) {
row_name = data[2].content;
row_values = data.slice(5).map(function (column) {
return column.content;
})
entry = {
'name':row_name,
'values':row_values
}
let raw_data = frappe.query_report.chart.data;
let new_datasets = raw_data.datasets;
var found = false;
for(var i=0; i < new_datasets.length;i++){
if(new_datasets[i].name == row_name){
found = true;
new_datasets.splice(i,1);
break;
}
}
if(!found){
new_datasets.push(entry);
}
let new_data = {
labels: raw_data.labels,
datasets: new_datasets
}
setTimeout(() => {
frappe.query_report.chart.update(new_data)
},500)
setTimeout(() => {
frappe.query_report.chart.draw(true);
}, 1000)
frappe.query_report.raw_chart_data = new_data;
},
}
});
}
}

View File

@@ -0,0 +1,26 @@
{
"add_total_row": 0,
"creation": "2018-10-05 16:08:24.156448",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"modified": "2018-10-05 16:08:33.272201",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Analytics",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Purchase Order",
"report_name": "Purchase Analytics",
"report_type": "Script Report",
"roles": [
{
"role": "Purchase Manager"
},
{
"role": "Purchase User"
}
]
}

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from erpnext.selling.report.sales_analytics.sales_analytics import Analytics
def execute(filters=None):
return Analytics(filters).run()

View File

@@ -235,6 +235,16 @@ def get_data():
"type": "doctype",
"name": "GST HSN Code",
},
{
"type": "report",
"name": "GSTR-1",
"is_query_report": True
},
{
"type": "report",
"name": "GSTR-2",
"is_query_report": True
},
{
"type": "report",
"name": "GST Sales Register",

View File

@@ -122,10 +122,10 @@ def get_data():
"icon": "fa fa-table",
"items": [
{
"type": "page",
"name": "purchase-analytics",
"label": _("Purchase Analytics"),
"icon": "fa fa-bar-chart",
"type": "report",
"is_query_report": True,
"name": "Purchase Analytics",
"doctype": "Purchase Order"
},
{
"type": "report",

View File

@@ -293,6 +293,16 @@ def get_data():
"label": _("Patient"),
"hidden": 1
},
{
"module_name": "Healthcare Practitioner",
"color": "#2ecc71",
"icon": "fa fa-user-md",
"doctype": "Healthcare Practitioner",
"type": "link",
"link": "List/Healthcare Practitioner",
"label": _("Healthcare Practitioner"),
"hidden": 1
},
{
"module_name": "Patient Appointment",
"color": "#934F92",
@@ -322,6 +332,36 @@ def get_data():
"link": "List/Lab Test",
"label": _("Lab Test"),
"hidden": 1
},
{
"module_name": "Vital Signs",
"color": "#2ecc71",
"icon": "fa fa-thermometer-empty",
"doctype": "Vital Signs",
"type": "list",
"link": "List/Vital Signs",
"label": _("Vital Signs"),
"hidden": 1
},
{
"module_name": "Clinical Procedure",
"color": "#FF888B",
"icon": "fa fa-medkit",
"doctype": "Clinical Procedure",
"type": "list",
"link": "List/Clinical Procedure",
"label": _("Clinical Procedure"),
"hidden": 1
},
{
"module_name": "Inpatient Record",
"color": "#7578f6",
"icon": "fa fa-list-alt",
"doctype": "Inpatient Record",
"type": "list",
"link": "List/Inpatient Record",
"label": _("Inpatient Record"),
"hidden": 1
},
{
"module_name": "Hub",

View File

@@ -1,3 +1,3 @@
from __future__ import unicode_literals
source_link = "https://github.com/frappe/erpnext"
source_link = "https://github.com/erpnext/foundation"

View File

@@ -112,11 +112,12 @@ def get_data():
"is_query_report": True,
"name": "Completed Work Orders",
"doctype": "Work Order"
},{
"type": "page",
"name": "production-analytics",
"label": _("Production Analytics"),
"icon": "fa fa-bar-chart",
},
{
"type": "report",
"is_query_report": True,
"name": "Production Analytics",
"doctype": "Work Order"
},
{
"type": "report",

View File

@@ -185,10 +185,10 @@ def get_data():
"icon": "fa fa-table",
"items": [
{
"type": "page",
"name": "sales-analytics",
"label": _("Sales Analytics"),
"icon": "fa fa-bar-chart",
"type": "report",
"is_query_report": True,
"name": "Sales Analytics",
"doctype": "Sales Order"
},
{
"type": "page",

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