Compare commits

...

208 Commits

Author SHA1 Message Date
Nabin Hait
a558683e40 Merge pull request #6868 from frappe/pos_payments_base_amount
[patch] Set base amount in Sales Invoice Payment table
2016-11-08 17:43:54 +05:30
Nabin Hait
03a3c852c3 [patch] Set base amount in Sales Invoice Payment table 2016-11-08 17:25:14 +05:30
Nabin Hait
13bd69c27d Update gl_entry.py 2016-11-08 15:33:36 +05:30
rohitwaghchaure
27affe4c5e Merge pull request #6849 from rohitwaghchaure/v7.0.x
[POS] Pricing rule discount issue
2016-11-08 12:04:22 +05:30
Rohit Waghchaure
d85f149b5e pricing rule discount issue 2016-11-07 19:44:52 +05:30
Nabin Hait
d275f0ec7f [fix] Get data in opportunity dashboard 2016-11-03 15:33:12 +05:30
Nabin Hait
1b4e9898ce Merge pull request #6810 from nabinhait/v7.0.x
set item rate on first selection  of item
2016-11-03 15:10:41 +05:30
Nabin Hait
37b1b613f5 set item rate on first selection of item 2016-11-03 14:46:13 +05:30
Nabin Hait
594642441b Merge pull request #6781 from rohitwaghchaure/so_float_fieldtype_issue
Change fieldtype from float to currency
2016-11-03 10:48:52 +05:30
Rohit Waghchaure
e803adc4e3 Change fieldtype from float to currency 2016-11-01 16:36:00 +05:30
Nabin Hait
f7ac1236ed repost gle for Purchase Invoice with update stock 2016-11-01 11:28:05 +05:30
Nabin Hait
9600b29399 Merge pull request #6767 from nabinhait/v7.0.x
repost gle for Purchase Invoice with update stock
2016-10-31 16:50:06 +05:30
Nabin Hait
9f6a09e661 repost gle for Purchase Invoice with update stock 2016-10-31 16:31:46 +05:30
Nabin Hait
ab5e7fecb0 Merge pull request #6740 from rohitwaghchaure/multi_currency_issue
[Fix] Account currency not fetched on selection of party in Journal Entry Account
2016-10-29 14:39:51 +05:30
Nabin Hait
6f4e1ed96c Merge pull request #6741 from rohitwaghchaure/pos_minor_issue
Minor fix
2016-10-29 14:39:37 +05:30
Rohit Waghchaure
b337b7208d minor issue 2016-10-28 13:40:13 +05:30
Rohit Waghchaure
6996bb0826 [Fix] Account currency not fetched on selection of party in journale entry 2016-10-28 13:32:05 +05:30
Nabin Hait
4c0a9f420f Merge branch 'hotfix' 2016-10-26 16:40:45 +05:30
Nabin Hait
f3882d2699 bumped to version 7.0.63 2016-10-26 17:10:44 +06:00
Nabin Hait
fe86debf5d [fix] Duplicate salary components 2016-10-24 17:47:18 +05:30
Nabin Hait
7d977a243a Merge pull request #6690 from rohitwaghchaure/v7_pricing_rule_issue
[Fix] Pricing rule discount issue
2016-10-24 16:47:33 +05:30
Rohit Waghchaure
43b508089e [Fix] Pricing rule discount issue 2016-10-24 16:16:24 +05:30
Nabin Hait
d5e52bc251 Merge branch 'hotfix' 2016-10-19 16:48:05 +05:30
Nabin Hait
13a07c2029 bumped to version 7.0.62 2016-10-19 17:18:04 +06:00
Nabin Hait
9ef4f0dc30 Merge pull request #6640 from rohitwaghchaure/item_projected_qty_issue
[Fix] total projected qty in item master
2016-10-19 16:45:28 +05:30
Rohit Waghchaure
aa8abfa5b3 Test cases added in sales order to check total projected qty 2016-10-19 15:26:10 +05:30
Rohit Waghchaure
ac9172f6df [Fix] total projected qty 2016-10-19 15:06:30 +05:30
Nabin Hait
44b4e5eef3 Merge pull request #6648 from saurabh6790/hotfix
[fix] calculate variance only for submitted budgets
2016-10-19 15:05:11 +05:30
Nabin Hait
ff183eedb9 Fixes for testcases 2016-10-19 14:23:02 +05:30
Nabin Hait
184f6d42cc Merge pull request #6647 from netchampfaris/hotfix
[hotfix] print format image size
2016-10-19 13:05:04 +05:30
Saurabh
afceac620c [fix] calculate variance only for submitted budgets 2016-10-19 12:49:48 +05:30
Faris Ansari
2acbb11923 [fix] print format image size 2016-10-19 12:08:00 +05:30
Nabin Hait
b33695138c Merge branch 'hotfix' 2016-10-18 18:35:18 +05:30
Nabin Hait
8872842edf bumped to version 7.0.61 2016-10-18 19:05:18 +06:00
Rushabh Mehta
7791ed845f [hot] [fix] student_dashboard.py 2016-10-18 18:33:19 +05:30
Nabin Hait
498cc1b7e1 Merge branch 'hotfix' 2016-10-18 16:18:17 +05:30
Nabin Hait
170b0cc83c bumped to version 7.0.60 2016-10-18 16:48:17 +06:00
Nabin Hait
d5c4a5c802 Hotfix 2016-10-18 16:17:37 +05:30
Nabin Hait
a1099d28b8 Merge branch 'hotfix' 2016-10-18 15:25:31 +05:30
Nabin Hait
7b9e8368ea bumped to version 7.0.59 2016-10-18 15:55:31 +06:00
Nabin Hait
f32547a414 Merge pull request #6637 from nabinhait/cost_center_fix
Set cost center while creating invoice from SO/PO
2016-10-18 15:18:16 +05:30
Rushabh Mehta
17f6874450 [minor] [fix] doctype_dasboard.py files, move data to get_data 2016-10-18 14:54:39 +05:30
Nabin Hait
55a8797919 Set cost center while creating invoice from SO/PO 2016-10-18 14:54:17 +05:30
Nabin Hait
401be3f49b Merge pull request #6577 from PawanMeh/fixes_6566
[fix #6566]
2016-10-16 14:28:26 +05:30
Nabin Hait
a9ce406c48 Merge pull request #6579 from PawanMeh/fixes_6567
[fix] #6567
2016-10-16 14:28:00 +05:30
Nabin Hait
0b1b8afc3c Merge pull request #6611 from nabinhait/hotfix
Always calculate additional discount amount if percentage is mentioned
2016-10-16 14:25:28 +05:30
Nabin Hait
e040510545 Always calculate additional discount amount if percentage is mentioned 2016-10-13 12:14:47 +05:30
Nabin Hait
efd7c3e22b Merge pull request #6592 from rohitwaghchaure/production_planning_issue
[Fix] making of production order from material request with sales order, restirct validation validate_production_order_against_so in production order
2016-10-10 17:10:49 +05:30
Rohit Waghchaure
8e881cc7b9 [Fix] making of production order from material request with sales order, restirct validation validate_production_order_against_so in production order 2016-10-10 14:58:33 +05:30
Nabin Hait
fc90758932 Merge pull request #6589 from rohitwaghchaure/purchase_invoice_validation_issue
[Fix] Purchase invoice validation issue
2016-10-10 11:51:00 +05:30
Nabin Hait
1ca7a27b2f Merge pull request #6587 from rohitwaghchaure/pos_wildcard_search_issue
[Fix] wildcard search for pos not working
2016-10-10 11:50:01 +05:30
Rohit Waghchaure
3485d2467a [Fix] Purchase invoice validation issue 2016-10-09 18:05:17 +05:30
Rohit Waghchaure
6f33dfbc56 [Fix] wildcard search for pos not working 2016-10-09 15:32:56 +05:30
Pawan Mehta
8d62af627a Update fiscal-year.md 2016-10-09 09:20:12 +05:30
pawan
1c0ecede06 [fix] #6567 2016-10-09 09:06:49 +05:30
pawan
896c731a46 [fix] #6566 2016-10-09 08:44:40 +05:30
pawan
05790d1b38 [fix] #6566 2016-10-09 08:30:29 +05:30
pawan
5655ce936b [fix] #6567 2016-10-08 08:02:08 +05:30
pawan
361739ffb6 [fix #6566] 2016-10-07 19:00:30 +05:30
Nabin Hait
8fa2a04024 Merge branch 'hotfix' 2016-10-07 17:08:57 +05:30
Nabin Hait
89326b366d bumped to version 7.0.58 2016-10-07 17:38:57 +06:00
Nabin Hait
6aaa7d7742 Added missing file extension 2016-10-07 17:08:03 +05:30
Nabin Hait
05ba967a45 Merge branch 'hotfix' 2016-10-07 17:04:36 +05:30
Nabin Hait
d17bbdeb4d bumped to version 7.0.57 2016-10-07 17:34:35 +06:00
Nabin Hait
2f3a68b8d6 Added missing file extension 2016-10-07 17:03:37 +05:30
Nabin Hait
f69edb3fa3 Merge branch 'hotfix' 2016-10-07 16:47:17 +05:30
Nabin Hait
06195de812 bumped to version 7.0.56 2016-10-07 17:17:17 +06:00
Nabin Hait
ad8218e5ac minor fix 2016-10-07 16:39:30 +05:30
Nabin Hait
9bfef84545 Merge branch 'notification-center' of https://github.com/shreyasp/erpnext into shreyasp-notification-center 2016-10-07 16:37:10 +05:30
Nabin Hait
81754954cb Update update_timesheet_communications 2016-10-07 16:08:44 +05:30
Nabin Hait
2907881dfb Update update_timesheet_communications 2016-10-07 16:07:11 +05:30
Nabin Hait
0799969063 Update set_portal_settings.py 2016-10-07 14:55:17 +05:30
shreyas
c1b7104126 [Fix] Minor changes to logic 2016-10-07 14:20:51 +05:30
Nabin Hait
ee25cf7ead Merge branch 'rohitwaghchaure-sales_order_status_issue' into hotfix 2016-10-07 14:16:36 +05:30
Nabin Hait
2f75b7b42e Fixed merge conflict 2016-10-07 14:16:17 +05:30
Nabin Hait
1915214518 Merge pull request #6576 from rohitwaghchaure/item_rename_issue
[Fix] Issue in merging duplicate item
2016-10-07 14:11:49 +05:30
Rohit Waghchaure
770d04e633 [Fix] sales order status showing completed, while it's status was to bill 2016-10-07 13:55:48 +05:30
Rohit Waghchaure
022d87969d [Fix] Issue in merging duplicate item 2016-10-07 13:40:45 +05:30
shreyas
a1d7646e70 [Fix] Allow user to save Notification Control without selecting transaction 2016-10-07 12:58:58 +05:30
Nabin Hait
bd2a1c3553 Merge pull request #6572 from RobertSchouten/patch-33
[fix] update timestamps and relink communication for timesheet
2016-10-07 12:54:54 +05:30
Nabin Hait
16f3f378f6 Update patches.txt 2016-10-07 12:54:27 +05:30
Nabin Hait
1885207eca Update and rename update_timesheet_modified_created to update_timesheet_communications 2016-10-07 12:54:04 +05:30
RobertSchouten
e0a636c081 [fix] update timestamps and relink communication for timesheet 2016-10-07 11:03:04 +08:00
RobertSchouten
ef4e41380b [fix] update timestamps and relink communication for timesheet 2016-10-07 11:01:12 +08:00
Nabin Hait
77ede941b0 Merge pull request #6550 from rohitwaghchaure/make_payment_using_journal_entry
[Enhancement] Option to make payment via Journal Entry
2016-10-06 17:07:11 +05:30
Rohit Waghchaure
7d5298997b Documentation for payments 2016-10-06 16:49:39 +05:30
Nabin Hait
1397159bc1 Merge pull request #6561 from rohitwaghchaure/remove_sales_invoice_from_scheduler_log
removed sales invoice from scheduler log
2016-10-06 15:32:55 +05:30
Nabin Hait
ec08a50af1 Merge pull request #6564 from rohitwaghchaure/expense_claim_issue
[Fix] Expense Claim, sanctioned amount not auto-populated from claim amount
2016-10-06 15:32:37 +05:30
Nabin Hait
4eb196905b Merge pull request #6562 from saurabh6790/hotfix
[fix] sales order translation for language code: fr
2016-10-06 15:28:41 +05:30
Rohit Waghchaure
370e711f48 [Fix] Expense Claim, sanctioned amount not auto-populated from claim amount 2016-10-06 15:19:53 +05:30
Saurabh
3ae5672e27 [fix] sales order translation for language code: fr 2016-10-06 12:57:21 +05:30
Rohit Waghchaure
297fbcd388 removed sales invoice from scheduler log 2016-10-06 12:40:09 +05:30
Rohit Waghchaure
b7a5502b97 [Enhancement] Option to make payment via Journal Entry 2016-10-06 12:04:52 +05:30
Nabin Hait
7dcab89321 Merge branch 'hotfix' 2016-10-05 17:18:11 +05:30
Nabin Hait
a162b3f0cd bumped to version 7.0.55 2016-10-05 17:48:11 +06:00
Nabin Hait
2f163ef360 Merge pull request #6552 from nabinhait/hotfix
Don't throw expense account validation on fetching item details
2016-10-05 17:17:05 +05:30
Nabin Hait
cccc45edc5 Don't throw expense account validation on fetching item details 2016-10-05 17:15:53 +05:30
Nabin Hait
7b9638c93a Merge pull request #6551 from nabinhait/hotfix
Set warranty claim resolution date as today only if it is not set
2016-10-05 16:45:25 +05:30
Nabin Hait
33fafb7728 Set warranty claim resolution date as today only if it is not set 2016-10-05 16:43:20 +05:30
Nabin Hait
2704a4a8fc Update production_order.py 2016-10-05 16:14:42 +05:30
Nabin Hait
55c328348f Merge pull request #6547 from rohitwaghchaure/pos_issue_for_wildcard_seacrh
[Fix] POS wildcard search for customers, items.
2016-10-05 15:43:45 +05:30
Rohit Waghchaure
e86eaf543c removed sync master data onload of the pos page 2016-10-05 14:45:15 +05:30
Rohit Waghchaure
163e3598c7 [Fix] POS wildcard search for customers, items 2016-10-05 13:52:17 +05:30
Nabin Hait
7229b64128 Merge pull request #6516 from bcornwellmott/patch-6
Update request_for_quotation.html
2016-10-05 13:12:09 +05:30
Nabin Hait
9501b38e8b Update remove_doctypes_and_reports.py 2016-10-05 12:35:11 +05:30
Nabin Hait
09adc10543 Merge pull request #6544 from nabinhait/hotfix
Sales Personwise transaction summary - total row
2016-10-05 12:27:21 +05:30
Nabin Hait
219148d23d Sales Personwise transaction summary - total row 2016-10-05 12:26:51 +05:30
Nabin Hait
9ac2fc932d Validate dates, fixes #6542 2016-10-05 12:20:25 +05:30
Nabin Hait
86da020dcd Merge pull request #6543 from nabinhait/rate_precision
Fixed precision of rate field
2016-10-05 11:59:20 +05:30
Nabin Hait
6c49fa20b5 Fixed precision of rate field 2016-10-05 11:28:02 +05:30
Nabin Hait
9e64f07540 Merge branch 'hotfix' 2016-10-04 17:26:33 +05:30
Nabin Hait
d5cebd7bb4 bumped to version 7.0.54 2016-10-04 17:56:33 +06:00
Nabin Hait
80de91776d Merge pull request #6539 from rohitwaghchaure/stock_entry_grid_issue
[Fix] Source / Target warehouse does not toggle properly, if we change the purpose after saving a stock entry record
2016-10-04 16:20:47 +05:30
Nabin Hait
cf87027422 Merge pull request #6537 from rohitwaghchaure/pos_multi_company_issue
[Fix] Multi company issue for POS
2016-10-04 16:20:24 +05:30
Rohit Waghchaure
661db8ba71 [Fix] Source / Target warehouse does not toggle properly, if we change the purpose after saving a stock entry record 2016-10-04 14:46:34 +05:30
Rohit Waghchaure
82be020ae9 sync offline sales invoices from the POS 2016-10-04 12:58:48 +05:30
Rohit Waghchaure
6f1d012b65 [Fix] Multi company issue for POS 2016-10-04 12:18:59 +05:30
Nabin Hait
112827ee86 Merge branch 'hotfix' 2016-10-03 18:05:11 +05:30
Nabin Hait
e2b8ae56e1 bumped to version 7.0.53 2016-10-03 18:35:10 +06:00
Nabin Hait
a65c223428 Merge pull request #6533 from nabinhait/hotfix
GL Entries for Purchase Invoices with Update Stock option checked and having non-stock items
2016-10-03 18:03:33 +05:30
Nabin Hait
d114aca20d GL Entries for Purchase Invoices with Update Stock option checked and having non-stock items 2016-10-03 17:36:28 +05:30
Nabin Hait
5a431127c5 Merge pull request #6532 from netchampfaris/hotfix
print format fix
2016-10-03 17:32:55 +05:30
Faris Ansari
69ca382529 [fix] image size fix in print format 2016-10-03 17:15:42 +05:30
Nabin Hait
c9fc091289 Merge branch 'hotfix' 2016-10-03 14:12:54 +05:30
Nabin Hait
e7e920b487 bumped to version 7.0.52 2016-10-03 14:42:53 +06:00
Nabin Hait
e8519938e0 Merge pull request #6525 from rohitwaghchaure/minor_pos
[Fix] disable apply discount on pos
2016-10-03 14:10:44 +05:30
Nabin Hait
10a48ea5e9 Merge pull request #6527 from rohitwaghchaure/budget_issue
[Fix] company key error during cancellation of stock entry
2016-10-03 14:05:10 +05:30
Nabin Hait
0b7b109c0b Merge pull request #6528 from saurabh6790/hotfix
[minor][fix] for condition maker
2016-10-03 14:04:50 +05:30
Saurabh
4f62c4cf2d [minor][fix] for condition maker 2016-10-03 12:48:25 +05:30
Rohit Waghchaure
b1391ca635 [Fix] company key error during cancellation of stock entry 2016-10-03 12:25:04 +05:30
Rohit Waghchaure
6f3d04caf7 [Fix] Disable apply discount on 2016-10-03 11:46:04 +05:30
Nabin Hait
c158ccd884 Merge pull request #6518 from nabinhait/ar_ap_fix
Minor fix AR/AP
2016-10-01 17:03:09 +05:30
Nabin Hait
b498eb5f9e Minor fix AR/AP 2016-10-01 15:51:59 +05:30
bcornwellmott
47863a3049 Update request_for_quotation.html
Fixing spelling mistakes
2016-09-30 15:45:20 -07:00
Nabin Hait
e1aee56e85 Merge pull request #6515 from rohitwaghchaure/purchase_receipt_title_issue
[Fix] Purchase receipt title issue
2016-09-30 21:24:03 +05:30
Nabin Hait
a7b0ffca1c Merge pull request #6508 from rohitwaghchaure/account_payble_issue
[Fixed] Accounts receivable concat issue
2016-09-30 21:13:54 +05:30
Rohit Waghchaure
74bf022273 [Fix] Purchase receipt title issue 2016-09-30 18:35:48 +05:30
Rohit Waghchaure
c1a3e379d8 [Fixed] Accounts receivable concat issue 2016-09-30 13:18:06 +05:30
Nabin Hait
6870e45276 Merge pull request #6495 from frappe/umairsy-patch-2
Update sales_partner.js
2016-09-29 20:44:59 +05:30
Nabin Hait
7652d5db93 Merge pull request #6501 from rohitwaghchaure/minor_fix_warranty_claim
[Fix] Minor changes in warranty claim
2016-09-29 20:44:03 +05:30
Rohit Waghchaure
1d0b18661e [Fix] Minor changes in warranty claim 2016-09-29 18:55:45 +05:30
Umair Sayed
29a0b31ca6 Update sales_partner.js 2016-09-29 16:25:04 +05:30
Nabin Hait
773d93b628 Merge branch 'hotfix' 2016-09-29 14:16:43 +05:30
Nabin Hait
626fcd5199 bumped to version 7.0.51 2016-09-29 14:46:42 +06:00
Nabin Hait
2c452a6881 Merge pull request #6485 from rohitwaghchaure/enhancement_payment_entry
[Enhancement] Added allocate payment amount checkbox in Payment Entry
2016-09-29 13:57:48 +05:30
Nabin Hait
d0a25f72c7 Merge pull request #6488 from rohitwaghchaure/timesheet_delete_transaction_issue
[Fix] Timesheet detail records not deleted with company transactions deletion
2016-09-29 13:55:38 +05:30
Nabin Hait
424bffc98b Merge pull request #6486 from nabinhait/stock_trans_repost
Reposting of GLE and SLE for all stock transactions
2016-09-29 13:51:51 +05:30
Nabin Hait
473ccc410b Merge pull request #6489 from nabinhait/leave_application_fix
[fix] Validate leave application period with salary slip only if leave type is LWP
2016-09-29 13:49:31 +05:30
Nabin Hait
b81a7538b9 Merge pull request #6492 from rohitwaghchaure/patch_for_change_amount_account
[Fix] added account for missing change amount account in the sales invoice
2016-09-29 13:41:50 +05:30
Nabin Hait
a3ffe530f0 Merge pull request #6493 from nabinhait/ar_issue
[fix] Accounts Receivable report if negative write off in invoice
2016-09-29 13:39:16 +05:30
Nabin Hait
f1d2fd2436 [fix] Accounts Receivable report if negative write off in invoice 2016-09-29 13:03:10 +05:30
Rohit Waghchaure
4b24683c27 [Fix] added account for missing change amount account in the sales invoice 2016-09-29 12:55:48 +05:30
Nabin Hait
2e31d7c7bf [fix] Validate leave application period with salary slip only if leave type is LWP 2016-09-29 10:59:46 +05:30
Rohit Waghchaure
17adb970f1 [Fix] Timesheet detail records not deleted with company transactions deletion 2016-09-29 01:07:28 +05:30
Rohit Waghchaure
f21f1af0c9 [Enhancement] Added allocate payment amount checkbox in Payment Entry 2016-09-28 18:24:17 +05:30
Nabin Hait
b3bc41131e Reposting of GLE and SLE for all stock transactions 2016-09-28 18:17:52 +05:30
Nabin Hait
f1ad32059f Merge pull request #6481 from rohitwaghchaure/fix_homepage
Fixed view button functionality in homepage
2016-09-28 16:57:21 +05:30
Nabin Hait
eba0d83541 Merge pull request #6482 from rohitwaghchaure/cash_flow_fix
[Fix] sub-heading is missing in the excel sheet of the cash flow
2016-09-28 16:57:03 +05:30
Rohit Waghchaure
7441a93a10 [Fix] sub-heading is missing in the excel sheet of the cash flow 2016-09-28 14:57:57 +05:30
Rohit Waghchaure
d63bfaa5f2 Fixed view button functionality in homepage 2016-09-28 14:08:47 +05:30
Nabin Hait
a82358bb98 Merge pull request #6480 from rohitwaghchaure/patch_fix_timesheet
Remove time log, time log batch from Doc Field.
2016-09-28 13:21:08 +05:30
Rohit Waghchaure
0a6529a643 Remove time log, time log batch from Doc Field. 2016-09-28 13:03:42 +05:30
Nabin Hait
63552166be Merge branch 'hotfix' 2016-09-28 10:46:36 +05:30
Nabin Hait
147ecab6b0 bumped to version 7.0.50 2016-09-28 11:16:36 +06:00
Nabin Hait
45f05d2c9b Merge pull request #6465 from saurabh6790/hotfix
[fix] ledger view from coa
2016-09-28 10:44:40 +05:30
Nabin Hait
2b6cacc799 Merge branch 'hotfix' 2016-09-26 18:02:19 +05:30
Nabin Hait
577aa9cb33 bumped to version 7.0.49 2016-09-26 18:32:19 +06:00
Nabin Hait
ad3e213b41 minor patch fixes 2016-09-26 18:00:13 +05:30
Nabin Hait
7faa4b5fdf Merge pull request #6455 from rohitwaghchaure/retun_field_duplicate_issue
[Fix] Allow renaming for UOM, When Duplicate Is Return field should not be copied #5510 #6288
2016-09-26 17:57:28 +05:30
Nabin Hait
f04721ee79 Update naming_series.py 2016-09-26 17:55:34 +05:30
Saurabh
5874a76eac [fix] ledger view from coa 2016-09-26 16:14:15 +05:30
Pawan Mehta
4f72480045 Merge pull request #6453 from PawanMeh/hotfix
[fix]-Ageing buckets should not have amounts if due date is not reached
2016-09-23 22:52:00 +05:30
Rohit Waghchaure
d728f5a429 [Fix] Allow renaming for UOM, When Duplicate Is Return field should not be copied #5510 #6288 2016-09-23 18:06:24 +05:30
Nabin Hait
5f0aceab19 Merge branch 'hotfix' 2016-09-23 17:23:28 +05:30
Nabin Hait
aec28a2c88 bumped to version 7.0.48 2016-09-23 17:53:28 +06:00
pawan
09f1ee637e [fix] #6371 2016-09-23 17:19:54 +05:30
Nabin Hait
3720045eb9 Update patches.txt 2016-09-23 16:31:43 +05:30
Nabin Hait
147b288d66 Update repost_gle_for_pos_sales_return.py 2016-09-23 13:11:05 +05:30
Nabin Hait
d4321ec18b Merge branch 'hotfix' 2016-09-23 12:16:02 +05:30
Nabin Hait
84fa3dfac8 bumped to version 7.0.47 2016-09-23 12:46:01 +06:00
Nabin Hait
aca857e708 Merge pull request #6447 from nabinhait/patch_fix_legacy_migration
Patch fixed for legacy migration
2016-09-23 12:15:06 +05:30
Nabin Hait
d03087d3ab Patch fixed for legacy migration 2016-09-23 11:08:02 +05:30
Nabin Hait
4ed0653c7f Merge pull request #6444 from rohitwaghchaure/supplier_status_issue
[fix] Supplier status stuck at Open forever
2016-09-22 18:52:26 +05:30
Rohit Waghchaure
b2382c0b8e [fix] Supplier status stuck at Open forever 2016-09-22 18:45:24 +05:30
Nabin Hait
f79b3f8c3c Merge pull request #6443 from rohitwaghchaure/pos_discount_issue
[POS] minor fix
2016-09-22 18:00:55 +05:30
Rohit Waghchaure
481ca832b0 minor fix 2016-09-22 17:21:37 +05:30
Nabin Hait
22e1665244 Merge pull request #6440 from rohitwaghchaure/additional_discount_amount_issue
[Fix] Additional Discount Amount can't be refresh automatically #6199
2016-09-22 16:03:00 +05:30
Rohit Waghchaure
deaee7c08b [Fix] Additional Discount Amount can't be refresh automatically #6199 2016-09-22 14:02:53 +05:30
Nabin Hait
0d36862917 Merge pull request #6434 from rohitwaghchaure/net_rate_issue
[Fix] Discount copied during making of PO from SO
2016-09-22 12:34:08 +05:30
Rohit Waghchaure
bd599b0169 [Fix] Discount copied during making of PO from SO 2016-09-22 11:47:17 +05:30
Nabin Hait
0967b17320 Merge branch 'hotfix' 2016-09-22 11:33:32 +05:30
Nabin Hait
b1041072a2 bumped to version 7.0.46 2016-09-22 12:03:32 +06:00
Nabin Hait
a58a65457f Sales Register report minor fix 2016-09-22 11:31:42 +05:30
Nabin Hait
993d7ca630 Merge pull request #6424 from rohitwaghchaure/daily_timesheet_summary_permission_issue
[Fix] Daily timesheet summary permission issue
2016-09-21 18:41:54 +05:30
Nabin Hait
7108991039 Patch order changed 2016-09-21 16:34:44 +05:30
Rohit Waghchaure
342ec18b83 [Fix] Daily timesheet summary permission issue 2016-09-21 13:22:15 +05:30
Nabin Hait
6835a6fb49 Merge branch 'hotfix' 2016-09-21 13:05:26 +05:30
Nabin Hait
4fead63419 bumped to version 7.0.45 2016-09-21 13:35:26 +06:00
Nabin Hait
06131dd0b1 Merge pull request #6420 from nabinhait/sales_reg_fix
Fix in Sales Register for multiple mode of payments
2016-09-21 12:54:25 +05:30
Nabin Hait
aac32d644d Fix in Sales Register for multiple mode of payments 2016-09-21 11:46:07 +05:30
Nabin Hait
d12990ff57 Update update_home_page.py 2016-09-20 18:20:58 +05:30
Nabin Hait
429a38f90b Merge pull request #6415 from rmehta/hotfix
[minor] bring back old grid style in material request
2016-09-20 18:05:32 +05:30
Rushabh Mehta
57a1905576 [minor] bring back old grid style in material request 2016-09-20 17:22:54 +05:30
Nabin Hait
30a25e11f7 Merge branch 'hotfix' 2016-09-20 16:52:10 +05:30
Nabin Hait
1f912f67ae bumped to version 7.0.44 2016-09-20 17:22:10 +06:00
Nabin Hait
af03de3d00 Merge pull request #6399 from rohitwaghchaure/pos_payment_mode_type_missing_issue
[Fix] POS, mode of payment issue
2016-09-20 10:56:54 +05:30
Rohit Waghchaure
414199a5db [Fix] Mode of payment issue 2016-09-19 23:43:47 +05:30
Nabin Hait
759ef4c00d Allowed past dates in next depreciation date 2016-09-15 12:24:33 +05:30
118 changed files with 1511 additions and 608 deletions

View File

@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '7.0.43'
__version__ = '7.0.63'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -171,7 +171,7 @@ class Account(Document):
old_warehouse = cstr(frappe.db.get_value("Account", self.name, "warehouse"))
if old_warehouse != cstr(self.warehouse):
if old_warehouse:
if old_warehouse and frappe.db.exists("Warehouse", old_warehouse):
self.validate_warehouse(old_warehouse)
if self.warehouse:
self.validate_warehouse(self.warehouse)

View File

@@ -48,5 +48,24 @@ frappe.treeview_settings["Account"] = {
+ " " + dr_or_cr
+ '</span>').insertBefore(node.$ul);
}
}
},
toolbar: [
{
condition: function(node) {
return !node.root && frappe.boot.user.can_read.indexOf("GL Entry") !== -1
},
label: __("View Ledger"),
click: function(node, btn) {
frappe.route_options = {
"account": node.label,
"from_date": sys_defaults.year_start_date,
"to_date": sys_defaults.year_end_date,
"company": frappe.defaults.get_default('company') ? frappe.defaults.get_default('company'): ""
};
frappe.set_route("query-report", "General Ledger");
},
btnClass: "hidden-xs"
}
],
extend_toolbar: true
}

View File

@@ -15,6 +15,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"description": "If enabled, the system will post accounting entries for inventory automatically.",
"fieldname": "auto_accounting_for_stock",
@@ -41,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
"fieldname": "acc_frozen_upto",
"fieldtype": "Date",
@@ -66,6 +68,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
"fieldname": "frozen_accounts_modifier",
"fieldtype": "Link",
@@ -92,6 +95,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -116,6 +120,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Role that is allowed to submit transactions that exceed credit limits set.",
"fieldname": "credit_controller",
"fieldtype": "Link",
@@ -142,6 +147,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "check_supplier_invoice_uniqueness",
"fieldtype": "Check",
"hidden": 0,
@@ -162,6 +168,32 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "make_payment_via_journal_entry",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Make Payment via Journal Entry",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
@@ -175,8 +207,8 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-14 14:32:06.056888",
"modified_by": "Administrator",
"modified": "2016-10-05 16:13:10.978208",
"modified_by": "rohitw1991@gmail.com",
"module": "Accounts",
"name": "Accounts Settings",
"owner": "Administrator",
@@ -191,6 +223,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -80,7 +80,7 @@ class Asset(Document):
frappe.throw(_("Number of Depreciations Booked cannot be greater than Total Number of Depreciations"))
if self.next_depreciation_date and getdate(self.next_depreciation_date) < getdate(nowdate()):
frappe.throw(_("Next Depreciation Date must be on or after today"))
frappe.msgprint(_("Next Depreciation Date is entered as past date"))
if (flt(self.value_after_depreciation) > flt(self.expected_value_after_useful_life)
and not self.next_depreciation_date):

View File

@@ -51,6 +51,9 @@ class Budget(Document):
def validate_expense_against_budget(args):
args = frappe._dict(args)
if not args.cost_center:
return
if frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"}):
cc_lft, cc_rgt = frappe.db.get_value("Cost Center", args.cost_center, ["lft", "rgt"])

View File

@@ -10,6 +10,7 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
@@ -249,14 +250,15 @@
"hide_toolbar": 0,
"icon": "icon-money",
"idx": 1,
"in_create": 0,
"image_view": 0,
"in_create": 1,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-05-16 15:23:14.770933",
"modified": "2016-10-18 14:22:00.207907",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cost Center",
@@ -368,6 +370,5 @@
"read_only_onload": 0,
"search_fields": "parent_cost_center, is_group",
"sort_order": "ASC",
"track_seen": 0,
"version": 0
"track_seen": 0
}

View File

@@ -44,18 +44,25 @@ class GLEntry(Document):
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
account_type = frappe.db.get_value("Account", self.account, "account_type")
if account_type in ["Receivable", "Payable"] and not (self.party_type and self.party):
frappe.throw(_("Party Type and Party is required for Receivable / Payable account {0}").format(self.account))
if not (self.party_type and self.party):
if account_type == "Receivable":
frappe.throw(_("{0} {1}: Customer is required against Receivable account {2}")
.format(self.voucher_type, self.voucher_no, self.account))
elif account_type == "Payable":
frappe.throw(_("{0} {1}: Supplier is required against Payable account {2}")
.format(self.voucher_type, self.voucher_no, self.account))
# Zero value transaction is not allowed
if not (flt(self.debit) or flt(self.credit)):
frappe.throw(_("Either debit or credit amount is required for {0}").format(self.account))
frappe.throw(_("{0} {1}: Either debit or credit amount is required for {2}")
.format(self.voucher_type, self.voucher_no, self.account))
def pl_must_have_cost_center(self):
if frappe.db.get_value("Account", self.account, "report_type") == "Profit and Loss":
if not self.cost_center and self.voucher_type != 'Period Closing Voucher':
frappe.throw(_("Cost Center is required for 'Profit and Loss' account {0}")
.format(self.account))
frappe.throw(_("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}. Please set up a default Cost Center for the Company.")
.format(self.voucher_type, self.voucher_no, self.account))
else:
if self.cost_center:
self.cost_center = None
@@ -65,7 +72,8 @@ class GLEntry(Document):
def check_pl_account(self):
if self.is_opening=='Yes' and \
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss":
frappe.throw(_("'Profit and Loss' type account {0} not allowed in Opening Entry").format(self.account))
frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry")
.format(self.voucher_type, self.voucher_no, self.account))
def validate_account_details(self, adv_adj):
"""Account must be ledger, active and not freezed"""
@@ -74,13 +82,16 @@ class GLEntry(Document):
from tabAccount where name=%s""", self.account, as_dict=1)[0]
if ret.is_group==1:
frappe.throw(_("Account {0} cannot be a Group").format(self.account))
frappe.throw(_("{0} {1}: Account {2} cannot be a Group")
.format(self.voucher_type, self.voucher_no, self.account))
if ret.docstatus==2:
frappe.throw(_("Account {0} is inactive").format(self.account))
frappe.throw(_("{0} {1}: Account {2} is inactive")
.format(self.voucher_type, self.voucher_no, self.account))
if ret.company != self.company:
frappe.throw(_("Account {0} does not belong to Company {1}").format(self.account, self.company))
frappe.throw(_("{0} {1}: Account {2} does not belong to Company {3}")
.format(self.voucher_type, self.voucher_no, self.account, self.company))
def validate_cost_center(self):
if not hasattr(self, "cost_center_company"):
@@ -94,7 +105,8 @@ class GLEntry(Document):
return self.cost_center_company[self.cost_center]
if self.cost_center and _get_cost_center_company() != self.company:
frappe.throw(_("Cost Center {0} does not belong to Company {1}").format(self.cost_center, self.company))
frappe.throw(_("{0} {1}: Cost Center {2} does not belong to Company {3}")
.format(self.voucher_type, self.voucher_no, self.cost_center, self.company))
def validate_party(self):
validate_party_frozen_disabled(self.party_type, self.party)
@@ -107,8 +119,9 @@ class GLEntry(Document):
self.account_currency = company_currency
if account_currency != self.account_currency:
frappe.throw(_("Accounting Entry for {0} can only be made in currency: {1}")
.format(self.account, (account_currency or company_currency)), InvalidAccountCurrency)
frappe.throw(_("{0} {1}: Accounting Entry for {2} can only be made in currency: {3}")
.format(self.voucher_type, self.voucher_no, self.account,
(account_currency or company_currency)), InvalidAccountCurrency)
if self.party_type and self.party:
validate_party_gle_currency(self.party_type, self.party, self.company, self.account_currency)

View File

@@ -760,7 +760,8 @@ def get_party_account_and_balance(company, party_type, party):
return {
"account": account,
"balance": account_balance,
"party_balance": party_balance
"party_balance": party_balance,
"account_currency": frappe.db.get_value("Account", account, "account_currency")
}
@frappe.whitelist()

View File

@@ -511,6 +511,18 @@ frappe.ui.form.on('Payment Entry', {
});
},
allocate_payment_amount: function(frm) {
if(frm.doc.payment_type == 'Internal Transfer'){
return
}
if(frm.doc.references.length == 0){
frm.events.get_outstanding_documents(frm);
}
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
},
allocate_party_amount_against_ref_docs: function(frm, paid_amount) {
var total_positive_outstanding_including_order = 0;
var total_negative_outstanding = 0;
@@ -552,22 +564,24 @@ frappe.ui.form.on('Payment Entry', {
}
$.each(frm.doc.references || [], function(i, row) {
row.allocated_amount = 0
row.allocated_amount = 0 //If allocate payment amount checkbox is unchecked, set zero to allocate amount
if(frm.doc.allocate_payment_amount){
if(row.outstanding_amount > 0 && allocated_positive_outstanding > 0) {
if(row.outstanding_amount >= allocated_positive_outstanding)
row.allocated_amount = allocated_positive_outstanding;
else row.allocated_amount = row.outstanding_amount;
if(row.outstanding_amount > 0 && allocated_positive_outstanding > 0) {
if(row.outstanding_amount >= allocated_positive_outstanding)
row.allocated_amount = allocated_positive_outstanding;
else row.allocated_amount = row.outstanding_amount;
allocated_positive_outstanding -= flt(row.allocated_amount);
} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
if(Math.abs(row.outstanding_amount) >= allocated_negative_outstanding)
row.allocated_amount = -1*allocated_negative_outstanding;
else row.allocated_amount = row.outstanding_amount;
allocated_positive_outstanding -= flt(row.allocated_amount);
} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
if(Math.abs(row.outstanding_amount) >= allocated_negative_outstanding)
row.allocated_amount = -1*allocated_negative_outstanding;
else row.allocated_amount = row.outstanding_amount;
allocated_negative_outstanding -= Math.abs(flt(row.allocated_amount));
allocated_negative_outstanding -= Math.abs(flt(row.allocated_amount));
}
}
})
frm.refresh_fields()
frm.events.set_total_allocated_amount(frm);
},

View File

@@ -772,6 +772,34 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"depends_on": "eval:in_list(['Pay', 'Receive'], doc.payment_type)",
"fieldname": "allocate_payment_amount",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allocate Payment Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -1426,7 +1454,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-09-05 11:06:18.183458",
"modified": "2016-09-28 18:20:47.625383",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",

View File

@@ -669,6 +669,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.paid_to_account_currency = party_account_currency if payment_type=="Pay" else bank.account_currency
pe.paid_amount = paid_amount
pe.received_amount = received_amount
pe.allocate_payment_amount = 1
pe.append("references", {
"reference_doctype": dt,

View File

@@ -165,6 +165,13 @@ def get_pricing_rule_for_item(args):
})
else:
item_details.discount_percentage = pricing_rule.discount_percentage
elif args.get('pricing_rule'):
if frappe.db.get_value('Pricing Rule', args.get('pricing_rule'), 'price_or_discount') == 'Discount Percentage':
item_details.discount_percentage = 0.0
item_details.margin_rate_or_amount = 0.0
item_details.margin_type = None
return item_details
def get_pricing_rules(args):

View File

@@ -15,6 +15,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "{supplier_name}",
"fieldname": "title",
"fieldtype": "Data",
@@ -41,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -68,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
@@ -95,6 +98,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "supplier",
"fieldname": "supplier_name",
"fieldtype": "Data",
@@ -122,6 +126,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "bill_no",
"fieldtype": "Data",
@@ -149,6 +154,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_paid",
"fieldtype": "Check",
"hidden": 0,
@@ -174,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "is_return",
"fieldtype": "Check",
@@ -184,7 +191,7 @@
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -200,6 +207,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -225,6 +233,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
@@ -252,6 +261,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "due_date",
"fieldtype": "Date",
"hidden": 0,
@@ -278,6 +288,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "bill_date",
"fieldtype": "Date",
"hidden": 0,
@@ -304,6 +315,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -331,6 +343,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -356,6 +369,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_return",
"fieldname": "return_against",
"fieldtype": "Link",
@@ -366,7 +380,7 @@
"in_list_view": 0,
"label": "Return Against Purchase Invoice",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Purchase Invoice",
"permlevel": 0,
"precision": "",
@@ -383,6 +397,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
"hidden": 0,
@@ -408,6 +423,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier_address",
"fieldtype": "Link",
"hidden": 0,
@@ -433,6 +449,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_person",
"fieldtype": "Link",
"hidden": 0,
@@ -458,6 +475,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "address_display",
"fieldtype": "Small Text",
@@ -483,6 +501,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -507,6 +526,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_mobile",
"fieldtype": "Small Text",
"hidden": 0,
@@ -531,6 +551,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_email",
"fieldtype": "Small Text",
"hidden": 0,
@@ -555,6 +576,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break_address",
"fieldtype": "Column Break",
"hidden": 0,
@@ -579,6 +601,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "shipping_address",
"fieldtype": "Link",
@@ -606,6 +629,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_address_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -631,6 +655,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -656,6 +681,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 0,
@@ -683,6 +709,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "conversion_rate",
"fieldtype": "Float",
@@ -711,6 +738,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -734,6 +762,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "buying_price_list",
"fieldtype": "Link",
"hidden": 0,
@@ -759,6 +788,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "price_list_currency",
"fieldtype": "Link",
"hidden": 0,
@@ -784,6 +814,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "plc_conversion_rate",
"fieldtype": "Float",
"hidden": 0,
@@ -809,6 +840,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"hidden": 0,
@@ -833,6 +865,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -859,6 +892,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "update_stock",
"fieldtype": "Check",
@@ -885,6 +919,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items",
"fieldtype": "Table",
"hidden": 0,
@@ -912,6 +947,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_26",
"fieldtype": "Section Break",
"hidden": 0,
@@ -935,6 +971,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -961,6 +998,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "base_net_total",
"fieldtype": "Currency",
@@ -989,6 +1027,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_28",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1012,6 +1051,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1038,6 +1078,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1065,6 +1106,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1091,6 +1133,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
"hidden": 0,
@@ -1118,6 +1161,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
@@ -1145,6 +1189,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "other_charges_calculation",
"fieldtype": "HTML",
"hidden": 0,
@@ -1170,6 +1215,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "totals",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1196,6 +1242,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_taxes_and_charges_added",
"fieldtype": "Currency",
"hidden": 0,
@@ -1223,6 +1270,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_taxes_and_charges_deducted",
"fieldtype": "Currency",
"hidden": 0,
@@ -1250,6 +1298,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1277,6 +1326,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_40",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1301,6 +1351,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges_added",
"fieldtype": "Currency",
"hidden": 0,
@@ -1328,6 +1379,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges_deducted",
"fieldtype": "Currency",
"hidden": 0,
@@ -1355,6 +1407,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1382,6 +1435,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "discount_amount",
"columns": 0,
"fieldname": "section_break_44",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1407,6 +1461,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Grand Total",
"fieldname": "apply_discount_on",
"fieldtype": "Select",
@@ -1434,6 +1489,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1460,6 +1516,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_46",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1484,6 +1541,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "additional_discount_percentage",
"fieldtype": "Float",
"hidden": 0,
@@ -1509,6 +1567,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1535,6 +1594,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1559,6 +1619,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1586,6 +1647,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "base_in_words",
"fieldtype": "Data",
@@ -1613,6 +1675,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break8",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1638,6 +1701,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1665,6 +1729,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "in_words",
"fieldtype": "Data",
"hidden": 0,
@@ -1691,6 +1756,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_advance",
"fieldtype": "Currency",
"hidden": 0,
@@ -1718,6 +1784,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1746,6 +1813,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "paid_amount",
"columns": 0,
"depends_on": "eval:doc.is_paid===1||(doc.advances && doc.advances.length>0)",
"fieldname": "payments_section",
"fieldtype": "Section Break",
@@ -1772,6 +1840,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "mode_of_payment",
"fieldtype": "Link",
"hidden": 0,
@@ -1798,6 +1867,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cash_bank_account",
"fieldtype": "Link",
"hidden": 0,
@@ -1824,6 +1894,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_br_payments",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1848,6 +1919,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_paid",
"fieldname": "paid_amount",
"fieldtype": "Currency",
@@ -1875,6 +1947,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_paid_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1902,6 +1975,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "write_off_amount",
"columns": 0,
"depends_on": "grand_total",
"fieldname": "write_off",
"fieldtype": "Section Break",
@@ -1928,6 +2002,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "write_off_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1953,6 +2028,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_write_off_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1979,6 +2055,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_61",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2003,6 +2080,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:flt(doc.write_off_amount)!=0",
"fieldname": "write_off_account",
"fieldtype": "Link",
@@ -2029,6 +2107,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:flt(doc.write_off_amount)!=0",
"fieldname": "write_off_cost_center",
"fieldtype": "Link",
@@ -2056,6 +2135,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "advances",
"columns": 0,
"fieldname": "advances_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2082,6 +2162,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "get_advances",
"fieldtype": "Button",
"hidden": 0,
@@ -2108,6 +2189,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "advances",
"fieldtype": "Table",
"hidden": 0,
@@ -2136,6 +2218,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "terms",
"columns": 0,
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2161,6 +2244,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "tc_name",
"fieldtype": "Link",
"hidden": 0,
@@ -2186,6 +2270,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "terms",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -2210,6 +2295,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "raw_materials_supplied",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2235,6 +2321,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"fieldname": "is_subcontracted",
"fieldtype": "Select",
@@ -2262,6 +2349,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -2290,6 +2378,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplied_items",
"fieldtype": "Table",
"hidden": 0,
@@ -2316,6 +2405,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "printing_settings",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2341,6 +2431,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "letter_head",
"fieldtype": "Link",
"hidden": 0,
@@ -2367,6 +2458,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -2394,6 +2486,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "language",
"fieldtype": "Data",
"hidden": 0,
@@ -2419,6 +2512,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "more_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2445,6 +2539,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "credit_to",
"fieldtype": "Link",
@@ -2473,6 +2568,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "party_account_currency",
"fieldtype": "Link",
"hidden": 1,
@@ -2499,6 +2595,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"description": "",
"fieldname": "is_opening",
@@ -2528,6 +2625,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "against_expense_account",
"fieldtype": "Small Text",
"hidden": 1,
@@ -2554,6 +2652,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_63",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2577,6 +2676,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "posting_time",
"fieldtype": "Time",
"hidden": 0,
@@ -2604,6 +2704,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "remarks",
"fieldtype": "Small Text",
"hidden": 0,
@@ -2630,6 +2731,7 @@
"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",
@@ -2658,6 +2760,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "is_recurring",
"columns": 0,
"depends_on": "eval:doc.docstatus<2",
"fieldname": "recurring_invoice",
"fieldtype": "Section Break",
@@ -2684,6 +2787,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.docstatus<2",
"description": "",
"fieldname": "is_recurring",
@@ -2710,6 +2814,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "Select the period when the invoice will be generated automatically",
"fieldname": "recurring_type",
@@ -2737,6 +2842,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "Start date of current invoice's period",
"fieldname": "from_date",
@@ -2763,6 +2869,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "End date of current invoice's period",
"fieldname": "to_date",
@@ -2789,6 +2896,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
"fieldname": "submit_on_creation",
"fieldtype": "Check",
@@ -2815,6 +2923,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
"description": "",
"fieldname": "notify_by_email",
@@ -2842,6 +2951,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc",
"fieldname": "repeat_on_day_of_month",
@@ -2868,6 +2978,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "The date on which recurring invoice will be stop",
"fieldname": "end_date",
@@ -2894,6 +3005,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_82",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2918,6 +3030,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "The date on which next invoice will be generated. It is generated on submit.",
"fieldname": "next_date",
@@ -2944,6 +3057,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "The unique id for tracking all recurring invoices. It is generated on submit.",
"fieldname": "recurring_id",
@@ -2970,6 +3084,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
"fieldname": "notification_email_address",
@@ -2996,6 +3111,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_recurring==1",
"fieldname": "recurring_print_format",
"fieldtype": "Link",
@@ -3032,7 +3148,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-08-24 12:50:15.777689",
"modified": "2016-09-23 18:02:45.349273",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -58,7 +58,7 @@ class PurchaseInvoice(BuyingController):
self.check_for_closed_status()
self.validate_with_previous_doc()
self.validate_uom_is_integer("uom", "qty")
self.set_expense_account()
self.set_expense_account(for_validate=True)
self.set_against_expense_account()
self.validate_write_off_account()
self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", "items")
@@ -71,7 +71,7 @@ class PurchaseInvoice(BuyingController):
frappe.throw(_("Cash or Bank Account is mandatory for making payment entry"))
if flt(self.paid_amount) + flt(self.write_off_amount) \
- flt(self.base_grand_total) > 1/(10**(self.precision("base_grand_total") + 1)):
- flt(self.grand_total) > 1/(10**(self.precision("base_grand_total") + 1)):
frappe.throw(_("""Paid amount + Write Off Amount can not be greater than Grand Total"""))
def create_remarks(self):
@@ -155,7 +155,7 @@ class PurchaseInvoice(BuyingController):
super(PurchaseInvoice, self).validate_warehouse()
def set_expense_account(self):
def set_expense_account(self, for_validate=False):
auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
if auto_accounting_for_stock:
@@ -181,7 +181,7 @@ class PurchaseInvoice(BuyingController):
else:
item.expense_account = stock_not_billed_account
elif not item.expense_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))
def set_against_expense_account(self):
@@ -305,24 +305,7 @@ class PurchaseInvoice(BuyingController):
if not self.grand_total:
return
self.auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
self.negative_expense_to_be_booked = 0.0
gl_entries = []
self.make_supplier_gl_entry(gl_entries)
self.make_item_gl_entries(gl_entries)
self.make_tax_gl_entries(gl_entries)
gl_entries = merge_similar_entries(gl_entries)
self.make_payment_gl_entries(gl_entries)
self.make_write_off_gl_entry(gl_entries)
gl_entries = self.get_gl_entries()
if gl_entries:
update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes"
@@ -341,7 +324,27 @@ class PurchaseInvoice(BuyingController):
elif self.docstatus == 2 and cint(self.update_stock) and self.auto_accounting_for_stock:
delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
def get_gl_entries(self, warehouse_account=None):
self.auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
self.negative_expense_to_be_booked = 0.0
gl_entries = []
self.make_supplier_gl_entry(gl_entries)
self.make_item_gl_entries(gl_entries)
self.make_tax_gl_entries(gl_entries)
gl_entries = merge_similar_entries(gl_entries)
self.make_payment_gl_entries(gl_entries)
self.make_write_off_gl_entry(gl_entries)
return gl_entries
def make_supplier_gl_entry(self, gl_entries):
if self.grand_total:
@@ -372,7 +375,7 @@ class PurchaseInvoice(BuyingController):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.expense_account)
if self.update_stock and self.auto_accounting_for_stock:
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

View File

@@ -1,31 +1,32 @@
from frappe import _
data = {
'fieldname': 'purchase_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Landed Cost Voucher': 'receipt_document',
'Purchase Invoice': 'return_against'
},
'internal_links': {
'Purchase Order': ['items', 'sales_order'],
'Purchase Receipt': ['items', 'delivery_note'],
},
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
def get_data():
return {
'fieldname': 'purchase_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Landed Cost Voucher': 'receipt_document',
'Purchase Invoice': 'return_against'
},
{
'label': _('Reference'),
'items': ['Purchase Order', 'Purchase Receipt', 'Asset', 'Landed Cost Voucher']
'internal_links': {
'Purchase Order': ['items', 'sales_order'],
'Purchase Receipt': ['items', 'delivery_note'],
},
{
'label': _('Returns'),
'items': ['Purchase Invoice']
},
]
}
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
},
{
'label': _('Reference'),
'items': ['Purchase Order', 'Purchase Receipt', 'Asset', 'Landed Cost Voucher']
},
{
'label': _('Returns'),
'items': ['Purchase Invoice']
},
]
}

View File

@@ -15,6 +15,7 @@ def get_pos_data():
doc = frappe.new_doc('Sales Invoice')
doc.is_pos = 1;
pos_profile = get_pos_profile(doc.company) or {}
if not doc.company: doc.company = pos_profile.get('company')
doc.update_stock = pos_profile.get('update_stock')
if pos_profile.get('name'):
@@ -66,7 +67,7 @@ def update_pos_profile_data(doc, pos_profile, company_data):
doc.naming_series = pos_profile.get('naming_series') or 'SINV-'
doc.letter_head = pos_profile.get('letter_head') or company_data.default_letter_head
doc.ignore_pricing_rule = pos_profile.get('ignore_pricing_rule') or 0
doc.apply_discount_on = pos_profile.get('apply_discount_on') or ''
doc.apply_discount_on = pos_profile.get('apply_discount_on') if pos_profile.get('apply_discount') else ''
doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group')
doc.territory = pos_profile.get('territory') or get_root('Territory')
@@ -242,6 +243,6 @@ def save_invoice(e, si_doc, name):
def make_scheduler_log(e, sales_invoice):
scheduler_log = frappe.new_doc('Scheduler Log')
scheduler_log.method = "erpnext.accounts.doctype.sales_invoice.pos.make_invoice"
scheduler_log.error = e
scheduler_log.sales_invoice = sales_invoice
scheduler_log.save(ignore_permissions=True)

View File

@@ -191,7 +191,7 @@
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -380,7 +380,7 @@
"in_list_view": 0,
"label": "Return Against Sales Invoice",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Sales Invoice",
"permlevel": 0,
"precision": "",
@@ -3867,7 +3867,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-08-31 15:47:32.064861",
"modified": "2016-09-23 17:59:42.200474",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -1,30 +1,31 @@
from frappe import _
data = {
'fieldname': 'sales_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Sales Invoice': 'return_against'
},
'internal_links': {
'Sales Order': ['items', 'sales_order'],
'Delivery Note': ['items', 'delivery_note'],
},
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
def get_data():
return {
'fieldname': 'sales_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Sales Invoice': 'return_against'
},
{
'label': _('Reference'),
'items': ['Timesheet', 'Delivery Note', 'Sales Order']
'internal_links': {
'Sales Order': ['items', 'sales_order'],
'Delivery Note': ['items', 'delivery_note'],
},
{
'label': _('Returns'),
'items': ['Sales Invoice']
},
]
}
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
},
{
'label': _('Reference'),
'items': ['Timesheet', 'Delivery Note', 'Sales Order']
},
{
'label': _('Returns'),
'items': ['Sales Invoice']
},
]
}

View File

@@ -550,7 +550,7 @@
"collapsible": 0,
"depends_on": "eval:doc.margin_type && doc.price_list_rate",
"fieldname": "total_margin",
"fieldtype": "Float",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -1660,7 +1660,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:07.483665",
"modified": "2016-11-01 16:27:09.402277",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -168,8 +168,8 @@ def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None,
if not gl_entries:
gl_entries = frappe.db.sql("""
select account, posting_date, party_type, party, cost_center, fiscal_year,
voucher_type, voucher_no, against_voucher_type, against_voucher, cost_center
select account, posting_date, party_type, party, cost_center, fiscal_year,voucher_type,
voucher_no, against_voucher_type, against_voucher, cost_center, company
from `tabGL Entry`
where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no), as_dict=True)

View File

@@ -15,13 +15,11 @@ frappe.pages['pos'].refresh = function(wrapper) {
window.onbeforeunload = function () {
return wrapper.pos.beforeunload()
}
wrapper.pos.on_refresh_page()
}
erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
init: function(wrapper){
this.load = true;
this.page = wrapper.page;
this.wrapper = $(wrapper).find('.page-content');
this.set_indicator();
@@ -31,17 +29,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.si_docs = this.get_doc_from_localstorage();
},
on_refresh_page: function() {
var me = this;
if(this.load){
this.load = false;
}else if(this.connection_status){
this.onload();
}else{
this.create_new();
}
},
beforeunload: function(e){
if(this.connection_status == false && frappe.get_route()[0] == "pos"){
e = e || window.event;
@@ -111,6 +98,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
})
});
this.page.add_menu_item(__("Sync Offline Invoices"), function(){
me.sync_sales_invoice()
});
this.page.add_menu_item(__("POS Profile"), function() {
frappe.set_route('List', 'POS Profile');
});
@@ -355,11 +346,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
get_customers: function(key){
var me = this;
key = key.toLowerCase().trim()
var re = new RegExp('%', 'g');
var reg = new RegExp(key.replace(re, '\\w*\\s*[a-zA-Z0-9]*'))
if(key){
return $.grep(this.customers, function(data) {
if(data.name.toLowerCase().match(key)
|| data.customer_name.toLowerCase().match(key)
|| (data.customer_group && data.customer_group.toLowerCase().match(key))){
if(reg.test(data.name.toLowerCase())
|| reg.test(data.customer_name.toLowerCase())
|| (data.customer_group && reg.test(data.customer_group.toLowerCase()))){
return data
}
})
@@ -383,10 +377,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
if (this.items) {
$.each(this.items, function(index, obj) {
if(index < 16){
if(index < 30){
$(frappe.render_template("pos_item", {
item_code: obj.name,
item_price: format_currency(obj.price_list_rate, obj.currency),
item_price: format_currency(obj.price_list_rate, me.frm.doc.currency),
item_name: obj.name===obj.item_name ? "" : obj.item_name,
item_image: obj.image ? "url('" + obj.image + "')" : null,
color: frappe.get_palette(obj.item_name),
@@ -427,7 +421,9 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
})
}
key = this.search.$input.val().toLowerCase();
key = this.search.$input.val().toLowerCase();
var re = new RegExp('%', 'g');
var reg = new RegExp(key.replace(re, '[\\w*\\s*[a-zA-Z0-9]*]*'))
search_status = true
if(key){
@@ -443,8 +439,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
} else if(item.barcode == me.search.$input.val()) {
search_status = false;
return item.barcode == me.search.$input.val();
} else if((item.item_code.toLowerCase().match(key)) ||
(item.item_name.toLowerCase().match(key)) || (item.item_group.toLowerCase().match(key))) {
} else if(reg.test(item.item_code.toLowerCase()) || reg.test(item.description.toLowerCase()) ||
reg.test(item.item_name.toLowerCase()) || reg.test(item.item_group.toLowerCase()) ){
return true
}
}
@@ -655,7 +651,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
show_items_in_item_cart: function() {
var me = this;
var $items = this.wrapper.find(".items").empty();
me.frm.doc.net_total = 0.0
$.each(this.frm.doc.items|| [], function(i, d) {
$(frappe.render_template("pos_bill_item", {
item_code: d.item_code,
@@ -961,6 +956,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
item.margin_rate_or_amount = pricing_rule[0].margin_rate_or_amount;
item.discount_percentage = pricing_rule[0].discount_percentage || 0.0;
me.apply_pricing_rule_on_item(item)
} else if(item.discount_percentage > 0 || item.margin_rate_or_amount > 0) {
item.margin_rate_or_amount = 0.0;
item.discount_percentage = 0.0;
me.apply_pricing_rule_on_item(item)
}
})
},

View File

@@ -55,7 +55,6 @@ def notify_status(doc, method=None):
if party.status == 'Open':
# may be open elsewhere, check
# default status
party.status = status
update_status(party)
party.update_modified()

View File

@@ -53,9 +53,10 @@ class ReceivablePayableReport(object):
self.filters["range3"] = "90"
for label in ("0-{range1}".format(range1=self.filters["range1"]),
"{range1}-{range2}".format(range1=self.filters["range1"]+1, range2=self.filters["range2"]),
"{range2}-{range3}".format(range2=self.filters["range2"]+1, range3=self.filters["range3"]),
"{range3}-{above}".format(range3=self.filters["range3"] + 1, above=_("Above"))):
"{range1}-{range2}".format(range1=cint(self.filters["range1"])+ 1, range2=self.filters["range2"]),
"{range2}-{range3}".format(range2=cint(self.filters["range2"])+ 1, range3=self.filters["range3"]),
"{range3}-{above}".format(range3=cint(self.filters["range3"])+ 1, above=_("Above"))):
frappe.errprint(label)
columns.append({
"label": label,
"fieldtype": "Currency",
@@ -93,9 +94,10 @@ class ReceivablePayableReport(object):
data = []
for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")):
if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers):
outstanding_amount = self.get_outstanding_amount(gle, self.filters.report_date, dr_or_cr)
outstanding_amount = flt(self.get_outstanding_amount(gle,
self.filters.report_date, dr_or_cr), currency_precision)
if abs(outstanding_amount) > 0.1/10**currency_precision:
row = [gle.posting_date, gle.party]
# customer / supplier name
@@ -124,6 +126,10 @@ class ReceivablePayableReport(object):
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
# issue 6371-Ageing buckets should not have amounts if due date is not reached
if self.filters.ageing_based_on == "Due Date" and getdate(due_date) > getdate(self.filters.report_date):
row[-1]=row[-2]=row[-3]=row[-4]=0
if self.filters.get(scrub(args.get("party_type"))):
row.append(gle.account_currency)
else:
@@ -214,14 +220,16 @@ class ReceivablePayableReport(object):
conditions, values = self.prepare_conditions(party_type)
if self.filters.get(scrub(party_type)):
select_fields = "debit_in_account_currency as debit, credit_in_account_currency as credit"
select_fields = "sum(debit_in_account_currency) as debit, sum(credit_in_account_currency) as credit"
else:
select_fields = "debit, credit"
select_fields = "sum(debit) as debit, sum(credit) as credit"
self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party,
voucher_type, voucher_no, against_voucher_type, against_voucher, account_currency, remarks, {0}
self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party,
voucher_type, voucher_no, against_voucher_type, against_voucher,
account_currency, remarks, {0}
from `tabGL Entry`
where docstatus < 2 and party_type=%s and (party is not null and party != '') {1}
group by voucher_type, voucher_no, against_voucher_type, against_voucher, party
order by posting_date, party"""
.format(select_fields, conditions), values, as_dict=True)

View File

@@ -64,7 +64,7 @@ def get_cost_center_target_details(filters):
return frappe.db.sql("""
select b.cost_center, b.monthly_distribution, ba.account, ba.budget_amount
from `tabBudget` b, `tabBudget Account` ba
where b.name=ba.parent and b.fiscal_year=%s and b.company=%s
where b.name=ba.parent and b.docstatus = 1 and b.fiscal_year=%s and b.company=%s
""", (filters.fiscal_year, filters.company), as_dict=True)
#Get target distribution details of accounts of cost center
@@ -84,8 +84,9 @@ def get_actual_details(cost_center, fiscal_year):
ac_details = frappe.db.sql("""select gl.account, gl.debit, gl.credit,
MONTHNAME(gl.posting_date) as month_name, b.cost_center
from `tabGL Entry` gl, `tabBudget Account` ba, `tabBudget` b
where
where
b.name = ba.parent
and b.docstatus = 1
and ba.account=gl.account
and gl.fiscal_year=%s
and b.cost_center=%s

View File

@@ -59,7 +59,6 @@ def execute(filters=None):
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
for cash_flow_account in cash_flow_accounts:
section_data = []
data.append({
"account_name": cash_flow_account['section_header'],
@@ -82,7 +81,8 @@ def execute(filters=None):
account_data = get_account_type_based_data(filters.company,
account['account_type'], period_list, filters.accumulated_values)
account_data.update({
"account_name": account['label'],
"account_name": account['label'],
"account": account['label'],
"indent": 1,
"parent_account": cash_flow_account['section_header'],
"currency": company_currency
@@ -129,7 +129,7 @@ def get_account_type_based_data(company, account_type, period_list, accumulated_
def add_total_row_account(out, data, label, period_list, currency):
total_row = {
"account_name": "'" + _("{0}").format(label) + "'",
"account": None,
"account": "'" + _("{0}").format(label) + "'",
"currency": currency
}
for row in data:

View File

@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments
def execute(filters=None):
if not filters: filters = {}
@@ -21,6 +22,7 @@ def execute(filters=None):
"width": 80
})
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
mode_of_payments = get_mode_of_payments(set([d.parent for d in item_list]))
data = []
for d in item_list:
@@ -32,7 +34,8 @@ def execute(filters=None):
from `tabDelivery Note Item` where docstatus=1 and so_detail=%s""", d.so_detail))
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.customer, d.customer_name,
d.customer_group, d.debit_to, d.mode_of_payment, d.territory, d.project, d.company, d.sales_order,
d.customer_group, d.debit_to, ", ".join(mode_of_payments.get(d.parent, [])),
d.territory, d.project, d.company, d.sales_order,
delivery_note, d.income_account, d.cost_center, d.qty, d.base_net_rate, d.base_net_amount]
for tax in tax_accounts:
@@ -52,7 +55,7 @@ def get_columns():
_("Posting Date") + ":Date:80", _("Customer") + ":Link/Customer:120",
_("Customer Name") + "::120", _("Customer Group") + ":Link/Customer Group:120",
_("Receivable Account") + ":Link/Account:120",
_("Mode of Payment") + ":Link/Mode of Payment:80", _("Territory") + ":Link/Territory:80",
_("Mode of Payment") + "::120", _("Territory") + ":Link/Territory:80",
_("Project") + ":Link/Project:80", _("Company") + ":Link/Company:100",
_("Sales Order") + ":Link/Sales Order:100", _("Delivery Note") + ":Link/Delivery Note:100",
_("Income Account") + ":Link/Account:140", _("Cost Center") + ":Link/Cost Center:140",
@@ -68,10 +71,14 @@ def get_conditions(filters):
("customer", " and si.customer = %(customer)s"),
("item_code", " and si_item.item_code = %(item_code)s"),
("from_date", " and si.posting_date>=%(from_date)s"),
("to_date", " and si.posting_date<=%(to_date)s"),
("mode_of_payment", " and ifnull(mode_of_payment, '') = %(mode_of_payment)s")):
("to_date", " and si.posting_date<=%(to_date)s")):
if filters.get(opts[0]):
conditions += opts[1]
if filters.get("mode_of_payment"):
conditions += """ and exists(select name from `tabSales Invoice Payment`
where parent=si.name
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
return conditions
@@ -84,7 +91,7 @@ def get_items(filters):
si_item.item_code, si_item.item_name, si_item.item_group, si_item.sales_order,
si_item.delivery_note, si_item.income_account, si_item.cost_center, si_item.qty,
si_item.base_net_rate, si_item.base_net_amount, si.customer_name,
si.customer_group, si_item.so_detail, si.mode_of_payment
si.customer_group, si_item.so_detail
from `tabSales Invoice` si, `tabSales Invoice Item` si_item
where si.name = si_item.parent and si.docstatus = 1 %s
order by si.posting_date desc, si_item.item_code desc""" % conditions, filters, as_dict=1)

View File

@@ -34,7 +34,7 @@ def get_net_profit_loss(income, expense, period_list, company):
total = 0
net_profit_loss = {
"account_name": "'" + _("Net Profit / Loss") + "'",
"account": None,
"account": "'" + _("Net Profit / Loss") + "'",
"warn_if_negative": True,
"currency": frappe.db.get_value("Company", company, "default_currency")
}

View File

@@ -23,6 +23,7 @@ def execute(filters=None):
invoice_so_dn_map = get_invoice_so_dn_map(invoice_list)
customer_map = get_customer_deatils(invoice_list)
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
mode_of_payments = get_mode_of_payments([inv.name for inv in invoice_list])
data = []
for inv in invoice_list:
@@ -33,7 +34,7 @@ def execute(filters=None):
row = [inv.name, inv.posting_date, inv.customer, inv.customer_name,
customer_map.get(inv.customer, {}).get("customer_group"),
customer_map.get(inv.customer, {}).get("territory"),
inv.debit_to, inv.mode_of_payment, inv.project, inv.remarks,
inv.debit_to, ", ".join(mode_of_payments.get(inv.name, [])), inv.project, inv.remarks,
", ".join(sales_order), ", ".join(delivery_note), company_currency]
# map income values
@@ -68,7 +69,7 @@ def get_columns(invoice_list):
_("Invoice") + ":Link/Sales Invoice:120", _("Posting Date") + ":Date:80",
_("Customer Id") + "::120", _("Customer Name") + "::120",
_("Customer Group") + ":Link/Customer Group:120", _("Territory") + ":Link/Territory:80",
_("Receivable Account") + ":Link/Account:120", _("Mode of Payment") + ":Link/Mode of Payment:80",
_("Receivable Account") + ":Link/Account:120", _("Mode of Payment") + "::120",
_("Project") +":Link/Project:80", _("Remarks") + "::150",
_("Sales Order") + ":Link/Sales Order:100", _("Delivery Note") + ":Link/Delivery Note:100",
{
@@ -113,14 +114,17 @@ def get_conditions(filters):
if filters.get("from_date"): conditions += " and posting_date >= %(from_date)s"
if filters.get("to_date"): conditions += " and posting_date <= %(to_date)s"
if filters.get("mode_of_payment"): conditions += " and ifnull(mode_of_payment, '') = %(mode_of_payment)s"
if filters.get("mode_of_payment"):
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)"""
return conditions
def get_invoices(filters):
conditions = get_conditions(filters)
return frappe.db.sql("""select name, posting_date, debit_to, project, customer, customer_name, remarks,
base_net_total, base_grand_total, base_rounded_total, outstanding_amount, mode_of_payment
base_net_total, base_grand_total, base_rounded_total, outstanding_amount
from `tabSales Invoice`
where docstatus = 1 %s order by posting_date desc, name desc""" %
conditions, filters, as_dict=1)
@@ -188,3 +192,16 @@ def get_customer_deatils(invoice_list):
customer_map.setdefault(cust.name, cust)
return customer_map
def get_mode_of_payments(invoice_list):
mode_of_payments = {}
if invoice_list:
inv_mop = frappe.db.sql("""select parent, mode_of_payment
from `tabSales Invoice Payment` where parent in (%s) group by parent, mode_of_payment""" %
', '.join(['%s']*len(invoice_list)), tuple(invoice_list), as_dict=1)
for d in inv_mop:
mode_of_payments.setdefault(d.parent, []).append(d.mode_of_payment)
return mode_of_payments

View File

@@ -302,6 +302,11 @@ def make_purchase_invoice(source_name, target_doc=None):
target.amount = flt(obj.amount) - flt(obj.billed_amt)
target.base_amount = target.amount * flt(source_parent.conversion_rate)
target.qty = target.amount / flt(obj.rate) if (flt(obj.rate) and flt(obj.billed_amt)) else flt(obj.qty)
item = frappe.db.get_value("Item", target.item_code, ["item_group", "buying_cost_center"], as_dict=1)
target.cost_center = frappe.db.get_value("Project", obj.project, "cost_center") \
or item.buying_cost_center \
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
doc = get_mapped_doc("Purchase Order", source_name, {
"Purchase Order": {

View File

@@ -1,24 +1,25 @@
from frappe import _
data = {
'fieldname': 'purchase_order',
'internal_links': {
'Material Request': ['items', 'material_request'],
'Supplier Quotation': ['items', 'supplier_quotation'],
'Project': ['project'],
},
'transactions': [
{
'label': _('Related'),
'items': ['Purchase Receipt', 'Purchase Invoice']
def get_data():
return {
'fieldname': 'purchase_order',
'internal_links': {
'Material Request': ['items', 'material_request'],
'Supplier Quotation': ['items', 'supplier_quotation'],
'Project': ['project'],
},
{
'label': _('Reference'),
'items': ['Material Request', 'Supplier Quotation', 'Project']
},
{
'label': _('Sub-contracting'),
'items': ['Stock Entry']
},
]
}
'transactions': [
{
'label': _('Related'),
'items': ['Purchase Receipt', 'Purchase Invoice']
},
{
'label': _('Reference'),
'items': ['Material Request', 'Supplier Quotation', 'Project']
},
{
'label': _('Sub-contracting'),
'items': ['Stock Entry']
},
]
}

View File

@@ -1,12 +1,13 @@
from frappe import _
data = {
'docstatus': 1,
'fieldname': 'request_for_quotation',
'transactions': [
{
'label': _('Related'),
'items': ['Supplier Quotation']
},
]
}
def get_data():
return {
'docstatus': 1,
'fieldname': 'request_for_quotation',
'transactions': [
{
'label': _('Related'),
'items': ['Supplier Quotation']
},
]
}

View File

@@ -1,17 +1,18 @@
from frappe import _
data = {
'heatmap': True,
'heatmap_message': _('This is based on transactions against this Supplier. See timeline below for details'),
'fieldname': 'supplier',
'transactions': [
{
'label': _('Procurement'),
'items': ['Request for Quotation', 'Supplier Quotation']
},
{
'label': _('Orders'),
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
}
]
}
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on transactions against this Supplier. See timeline below for details'),
'fieldname': 'supplier',
'transactions': [
{
'label': _('Procurement'),
'items': ['Request for Quotation', 'Supplier Quotation']
},
{
'label': _('Orders'),
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
}
]
}

View File

@@ -1,20 +1,21 @@
from frappe import _
data = {
'fieldname': 'supplier_quotation',
'internal_links': {
'Material Request': ['items', 'material_request'],
'Request for Quotation': ['items', 'request_for_quotation'],
'Project': ['items', 'project'],
},
'transactions': [
{
'label': _('Related'),
'items': ['Purchase Order']
def get_data():
return {
'fieldname': 'supplier_quotation',
'internal_links': {
'Material Request': ['items', 'material_request'],
'Request for Quotation': ['items', 'request_for_quotation'],
'Project': ['items', 'project'],
},
{
'label': _('Reference'),
'items': ['Material Request', 'Request for Quotation', 'Project']
},
]
}
'transactions': [
{
'label': _('Related'),
'items': ['Purchase Order']
},
{
'label': _('Reference'),
'items': ['Material Request', 'Request for Quotation', 'Project']
},
]
}

View File

@@ -26,6 +26,9 @@ class AccountsController(TransactionBase):
return self.__company_currency
def onload(self):
self.get("__onload").make_payment_via_journal_entry = frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry')
def validate(self):
if self.get("_action") and self._action != "update_after_submit":
self.set_missing_values(for_validate=True)
@@ -144,7 +147,7 @@ class AccountsController(TransactionBase):
self.conversion_rate = get_exchange_rate(self.currency,
self.company_currency)
def set_missing_item_details(self):
def set_missing_item_details(self, for_validate=False):
"""set missing item values"""
from erpnext.stock.get_item_details import get_item_details
@@ -196,7 +199,7 @@ class AccountsController(TransactionBase):
(1.0 - (flt(item.discount_percentage) / 100.0)), item.precision("rate"))
if self.doctype == "Purchase Invoice":
self.set_expense_account()
self.set_expense_account(for_validate)
def set_taxes(self):
if not self.meta.get_field("taxes"):

View File

@@ -62,7 +62,7 @@ class BuyingController(StockController):
if getattr(self, "supplier", None):
self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions))
self.set_missing_item_details()
self.set_missing_item_details(for_validate)
def set_supplier_from_item_default(self):
if self.meta.get_field("supplier") and not self.supplier:

View File

@@ -23,6 +23,7 @@ class SellingController(StockController):
self.grand_total)
def onload(self):
super(SellingController, self).onload()
if self.doctype in ("Sales Order", "Delivery Note", "Sales Invoice"):
for item in self.get("items"):
item.update(get_bin_details(item.item_code,

View File

@@ -301,12 +301,7 @@ class StatusUpdater(Document):
ref_doc = frappe.get_doc(ref_dt, ref_dn)
ref_doc.db_set("per_billed", per_billed)
if frappe.get_meta(ref_dt).get_field("billing_status"):
if per_billed < 0.001: billing_status = "Not Billed"
elif per_billed >= 99.99: billing_status = "Fully Billed"
else: billing_status = "Partly Billed"
ref_doc.db_set('billing_status', billing_status)
ref_doc.set_status(update=True)
def get_tolerance_for(item_code, item_tolerance={}, global_tolerance=None):
"""

View File

@@ -338,7 +338,7 @@ class calculate_taxes_and_totals(object):
tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail, separators=(',', ':'))
def set_discount_amount(self):
if not self.doc.discount_amount and self.doc.additional_discount_percentage:
if self.doc.additional_discount_percentage:
self.doc.discount_amount = flt(flt(self.doc.get(scrub(self.doc.apply_discount_on)))
* self.doc.additional_discount_percentage / 100, self.doc.precision("discount_amount"))

View File

@@ -49,10 +49,10 @@ def get_data(filters, conditions):
posting_date = 't1.posting_date'
if conditions["based_on_select"] in ["t1.project,", "t2.project,"]:
cond = 'and '+ conditions["based_on_select"][:-1] +' IS Not NULL'
cond = ' and '+ conditions["based_on_select"][:-1] +' IS Not NULL'
if conditions.get('trans') in ['Sales Order', 'Purchase Order']:
cond += "and t1.status != 'Closed'"
cond += " and t1.status != 'Closed'"
year_start_date, year_end_date = frappe.db.get_value("Fiscal Year",
filters.get('fiscal_year'), ["year_start_date", "year_end_date"])

View File

@@ -1,11 +1,15 @@
from frappe import _
data = {
'fieldname': 'prevdoc_docname',
'transactions': [
{
'label': _('Related'),
'items': ['Quotation']
def get_data():
return {
'fieldname': 'prevdoc_docname',
'non_standard_fieldnames': {
'Supplier Quotation': 'opportunity',
},
]
}
'transactions': [
{
'label': _('Related'),
'items': ['Quotation']
},
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -3,6 +3,7 @@ opening-accounts
sales-invoice
point-of-sale-pos-invoice
purchase-invoice
payments
journal-entry
payment-entry
multi-currency-accounting

View File

@@ -0,0 +1,48 @@
Payment can be made against following transactions.
1. Sales Invoice.
2. Purchase Invoice.
3. Sales Order (Advance Payment)
4. Purchase Order (Advance Payment)
In ERPNext, there is two options through which user can capture the payment
1. Payment Entry(Default).
2. Journal Entry.
## Payment Entry
####Step 1: Make Payment
On submitting a document against which Payment Entry can be made, you will find Make Payment button.
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/payment-entry-1.png">
####Step 2: Payment Entry
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/payment-entry-9.png">
For more details about payment entry [check here.](https://frappe.github.io/erpnext/user/manual/en/accounts/payment-entry)
## Journal Entry
To make paymant using journal entry, check below steps
####Step 1: Activate Payment via Journal Entry
Goto Accounts Settings > checked Make Payment via Journal Entry
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/account-settings.png">
####Step 2: Make Payment
On submitting a document against which Journal Entry can be made, you will find Make Payment button.
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/payment-entry-1.png">
####Step 3: Journal Entry
Save and submit the journal entry to record the payament against the invoice
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/journal-entry.png">
For more details about journal entry [check here.](https://frappe.github.io/erpnext/user/manual/en/accounts/journal-entry)

View File

@@ -18,6 +18,11 @@ choose to start its fiscal year on October 1. That way, they know what their
income will be for that year, and can adjust their expenses to maintain their
desired profit margins.
To set the Fiscal Year as default, click on the 'Default' button.
In case you have multiple companies sharing the same Fiscal Year, you can add
it into the grid as shown below.
<img class="screenshot" alt="Fiscal Year" src="{{docs_base_url}}/assets/img/accounts/fiscal-year.png">
{next}

View File

@@ -1,7 +1,7 @@
A Material Request is a simple document identifying a requirement of a set of
Items (products or services) for a particular reason.
![Workflow]({{docs_base_url}}/assets/old_images/erpnext/material-request-workflow.jpg)
![Workflow]({{docs_base_url}}/assets/img/buying/material-request-flowchart.png)
To generate a Material Request manually go to:
@@ -25,6 +25,8 @@ A Material Request can be of type:
* Material Issue - If the requested material is to be Issued.
* Manufacture - If the requested material is to be Produced.
The User can also raise a [Request For Quotation]({{docs_base_url}}/user/manual/en/buying/request-for-quotation.html) against a Material Request. To create a Request For Quotation the user can click on 'Make'.
> Info: Material Request is not mandatory. It is ideal if you have centralized
buying so that you can collect this information from various departments.

View File

@@ -1,25 +1,26 @@
from frappe import _
data = {
'heatmap': True,
'heatmap_message': _('This is based on the attendance of this Employee'),
'fieldname': 'employee',
'transactions': [
{
'label': _('Leave and Attendance'),
'items': ['Attendance', 'Leave Application', 'Leave Allocation']
},
{
'label': _('Payroll'),
'items': ['Salary Structure', 'Salary Slip', 'Timesheet']
},
{
'label': _('Expense'),
'items': ['Expense Claim']
},
{
'label': _('Evaluation'),
'items': ['Appraisal']
}
]
}
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on the attendance of this Employee'),
'fieldname': 'employee',
'transactions': [
{
'label': _('Leave and Attendance'),
'items': ['Attendance', 'Leave Application', 'Leave Allocation']
},
{
'label': _('Payroll'),
'items': ['Salary Structure', 'Salary Slip', 'Timesheet']
},
{
'label': _('Expense'),
'items': ['Expense Claim']
},
{
'label': _('Evaluation'),
'items': ['Appraisal']
}
]
}

View File

@@ -129,9 +129,6 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
doc.total_sanctioned_amount = 0;
$.each((doc.expenses || []), function(i, d) {
doc.total_claimed_amount += d.claim_amount;
if(d.sanctioned_amount==null) {
d.sanctioned_amount = d.claim_amount;
}
doc.total_sanctioned_amount += d.sanctioned_amount;
});
@@ -144,17 +141,6 @@ cur_frm.cscript.calculate_total_amount = function(doc,cdt,cdn){
cur_frm.cscript.calculate_total(doc,cdt,cdn);
}
cur_frm.cscript.claim_amount = function(doc,cdt,cdn){
cur_frm.cscript.calculate_total(doc,cdt,cdn);
var child = locals[cdt][cdn];
refresh_field("sanctioned_amount", child.name, child.parentfield);
}
cur_frm.cscript.sanctioned_amount = function(doc,cdt,cdn){
cur_frm.cscript.calculate_total(doc,cdt,cdn);
}
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
if(cint(frappe.boot.notification_settings && frappe.boot.notification_settings.expense_claim)) {
cur_frm.email_doc(frappe.boot.notification_settings.expense_claim_message);
@@ -172,6 +158,25 @@ erpnext.expense_claim = {
}
}
frappe.ui.form.on("Expense Claim Detail", {
claim_amount: function(frm, cdt, cdn) {
var child = locals[cdt][cdn];
var doc = frm.doc;
if(!child.sanctioned_amount){
frappe.model.set_value(cdt, cdn, 'sanctioned_amount', child.claim_amount)
}
cur_frm.cscript.calculate_total(doc,cdt,cdn);
},
sanctioned_amount: function(frm, cdt, cdn) {
var doc = frm.doc;
cur_frm.cscript.calculate_total(doc,cdt,cdn);
}
})
frappe.ui.form.on("Expense Claim", "employee_name", function(frm) {
erpnext.expense_claim.set_title(frm);
});

View File

@@ -97,12 +97,19 @@ class LeaveApplication(Document):
.format(formatdate(future_allocation[0].from_date), future_allocation[0].name))
def validate_salary_processed_days(self):
last_processed_pay_slip = frappe.db.sql("""select start_date, end_date from `tabSalary Slip`
where docstatus != 2 and employee = %s and ((%s between start_date and end_date) or (%s between start_date and end_date)) order by modified desc limit 1""",(self.employee, self.to_date, self.from_date))
if not frappe.db.get_value("Leave Type", self.leave_type, "is_lwp"):
return
last_processed_pay_slip = frappe.db.sql("""
select start_date, end_date from `tabSalary Slip`
where docstatus != 2 and employee = %s
and ((%s between start_date and end_date) or (%s between start_date and end_date))
order by modified desc limit 1
""",(self.employee, self.to_date, self.from_date))
if last_processed_pay_slip:
frappe.throw(_("Salary already processed for period between {0} and {1}, Leave application period cannot be between this date range.").
format(formatdate(last_processed_pay_slip[0][0]), formatdate(last_processed_pay_slip[0][1])))
frappe.throw(_("Salary already processed for period between {0} and {1}, Leave application period cannot be between this date range.").format(formatdate(last_processed_pay_slip[0][0]),
formatdate(last_processed_pay_slip[0][1])))
def show_block_day_warning(self):

View File

@@ -14,7 +14,7 @@ class TestSalarySlip(unittest.TestCase):
for dt in ["Leave Application", "Leave Allocation", "Salary Slip"]:
frappe.db.sql("delete from `tab%s`" % dt)
make_allocation_record(leave_type="_Test Leave Type LWP")
# make_allocation_record(leave_type="_Test Leave Type")
frappe.db.set_value("Company", "_Test Company", "default_holiday_list", "_Test Holiday List")

View File

@@ -55,9 +55,11 @@ class ProductionOrder(Document):
if not self.expected_delivery_date:
self.expected_delivery_date = so[0].delivery_date
self.project = so[0].project
if so[0].project:
self.project = so[0].project
self.validate_production_order_against_so()
if not self.material_request:
self.validate_production_order_against_so()
else:
frappe.throw(_("Sales Order {0} is not valid").format(self.sales_order))

View File

@@ -10,7 +10,9 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_per
from erpnext.manufacturing.doctype.production_order.production_order \
import make_stock_entry, ItemHasVariantError
from erpnext.stock.doctype.stock_entry import test_stock_entry
from erpnext.stock.doctype.item.test_item import get_total_projected_qty
from erpnext.stock.utils import get_bin
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
class TestProductionOrder(unittest.TestCase):
def setUp(self):
@@ -172,6 +174,28 @@ class TestProductionOrder(unittest.TestCase):
self.assertEqual(self.bin1_at_start.projected_qty,
cint(bin1_on_cancel.projected_qty))
def test_projected_qty_for_production_and_sales_order(self):
before_production_order = get_bin(self.item, self.warehouse)
before_production_order.update_reserved_qty_for_production()
self.pro_order = make_prod_order_test_record(item="_Test FG Item", qty=2,
source_warehouse=self.warehouse)
after_production_order = get_bin(self.item, self.warehouse)
sales_order = make_sales_order(item = self.item, qty = 2)
after_sales_order = get_bin(self.item, self.warehouse)
self.assertEqual(cint(before_production_order.reserved_qty_for_production) + 2,
cint(after_sales_order.reserved_qty_for_production))
self.assertEqual(cint(before_production_order.projected_qty),
cint(after_sales_order.projected_qty) + 2)
total_projected_qty = get_total_projected_qty(self.item)
item_doc = frappe.get_doc('Item', self.item)
self.assertEqual(total_projected_qty, item_doc.total_projected_qty)
def test_reserved_qty_for_production_on_stock_entry(self):
test_stock_entry.make_stock_entry(item_code="_Test Item",
target= self.warehouse, qty=100, basic_rate=100)

View File

@@ -23,17 +23,15 @@ execute:frappe.reload_doc('selling', 'doctype', 'customer') # 2014-01-29
execute:frappe.reload_doc('buying', 'doctype', 'supplier') # 2014-01-29
execute:frappe.reload_doc('accounts', 'doctype', 'asset_category')
execute:frappe.reload_doc('accounts', 'doctype', 'pricing_rule')
execute:frappe.reload_doctype('Item')
erpnext.patches.v4_0.map_charge_to_taxes_and_charges
execute:frappe.reload_doc('support', 'doctype', 'newsletter') # 2014-01-31
execute:frappe.reload_doc('hr', 'doctype', 'employee') # 2014-02-03
execute:frappe.db.sql("update tabPage set module='Core' where name='Setup'")
erpnext.patches.v5_2.change_item_selects_to_checks
execute:frappe.reload_doctype('Item')
erpnext.patches.v4_0.fields_to_be_renamed
erpnext.patches.v4_0.rename_sitemap_to_route
erpnext.patches.v7_0.re_route #2016-06-27
erpnext.patches.v4_0.fix_contact_address
erpnext.patches.v4_0.customer_discount_to_pricing_rule
execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_group, '')=''""")
@@ -173,6 +171,7 @@ execute:frappe.db.set_value("Backup Manager", None, "send_backups_to_dropbox", 1
execute:frappe.db.sql_list("delete from `tabDocPerm` where parent='Issue' and modified_by='Administrator' and role='Guest'")
erpnext.patches.v5_0.update_item_and_description_again
erpnext.patches.v6_0.multi_currency
erpnext.patches.v7_0.create_budget_record
erpnext.patches.v5_0.repost_gle_for_jv_with_multiple_party
erpnext.patches.v5_0.portal_fixes
erpnext.patches.v5_0.reset_values_in_tools # 02-05-2016
@@ -235,7 +234,6 @@ execute:frappe.delete_doc_if_exists("DocType", "Shopping Cart Taxes and Charges
erpnext.patches.v6_4.set_user_in_contact
erpnext.patches.v6_4.make_image_thumbnail #2015-10-20
erpnext.patches.v6_5.show_in_website_for_template_item
erpnext.patches.v7_0.create_budget_record
erpnext.patches.v6_4.fix_expense_included_in_valuation
execute:frappe.delete_doc_if_exists("Report", "Item-wise Last Purchase Rate")
erpnext.patches.v6_6.fix_website_image
@@ -266,7 +264,7 @@ erpnext.patches.v6_20x.remove_fiscal_year_from_holiday_list
erpnext.patches.v6_24.map_customer_address_to_shipping_address_on_po
erpnext.patches.v6_27.fix_recurring_order_status
erpnext.patches.v6_20x.update_product_bundle_description
erpnext.patches.v7_0.update_party_status
erpnext.patches.v7_0.update_party_status #2016-09-22
erpnext.patches.v7_0.update_item_projected
erpnext.patches.v7_0.remove_features_setup
erpnext.patches.v7_0.update_home_page
@@ -284,7 +282,7 @@ execute:frappe.reload_doc('projects', 'doctype', 'project_user')
erpnext.patches.v7_0.convert_timelogbatch_to_timesheet
erpnext.patches.v7_0.convert_timelog_to_timesheet
erpnext.patches.v7_0.move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet
erpnext.patches.v7_0.remove_doctypes_and_reports
erpnext.patches.v7_0.remove_doctypes_and_reports #2016-10-29
erpnext.patches.v7_0.update_maintenance_module_in_doctype
erpnext.patches.v7_0.update_prevdoc_values_for_supplier_quotation_item
erpnext.patches.v7_0.rename_advance_table_fields
@@ -310,6 +308,7 @@ erpnext.patches.v7_0.update_refdoc_in_landed_cost_voucher
erpnext.patches.v7_0.set_material_request_type_in_item
erpnext.patches.v7_0.rename_examination_to_assessment
erpnext.patches.v7_0.set_portal_settings
erpnext.patches.v7_0.update_change_amount_account
erpnext.patches.v7_0.repost_future_gle_for_purchase_invoice
erpnext.patches.v7_0.fix_duplicate_icons
erpnext.patches.v7_0.repost_gle_for_pos_sales_return
@@ -317,3 +316,10 @@ erpnext.patches.v7_0.update_missing_employee_in_timesheet
erpnext.patches.v7_0.update_status_for_timesheet
erpnext.patches.v7_0.set_party_name_in_payment_entry
execute:frappe.db.sql("update `tabTimesheet` ts, `tabEmployee` emp set ts.employee_name = emp.employee_name where emp.name = ts.employee and ts.employee_name is null and ts.employee is not null")
execute:frappe.db.sql("delete from `tabTimesheet Detail` where NOT EXISTS (select name from `tabTimesheet` where name = `tabTimesheet Detail`.parent)")
erpnext.patches.v7_0.update_mode_of_payment_type
finally:erpnext.patches.v7_0.update_timesheet_communications
erpnext.patches.v7_0.update_status_of_zero_amount_sales_order
erpnext.patches.v7_0.repost_bin_qty_and_item_projected_qty
erpnext.patches.v7_0.repost_gle_for_pi_with_update_stock #2016-11-01
erpnext.patches.v7_0.set_base_amount_in_invoice_payment_table

View File

@@ -27,6 +27,7 @@ def execute():
time_sheet.update_cost()
time_sheet.calculate_total_amounts()
time_sheet.flags.ignore_validate = True
time_sheet.flags.ignore_links = True
time_sheet.save(ignore_permissions=True)
# To ignore validate_mandatory_fields function

View File

@@ -17,10 +17,10 @@ def execute():
add_timesheet_detail(time_sheet, args)
time_sheet.docstatus = tlb.docstatus
time_sheet.flags.ignore_links = True
time_sheet.save(ignore_permissions=True)
def get_timesheet_data(data):
time_log = frappe.get_all('Time Log', fields=["*"],
filters = {'name': data.time_log})[0]
return get_timelog_data(time_log)
time_log = frappe.get_all('Time Log', fields=["*"], filters = {'name': data.time_log})
if time_log:
return get_timelog_data(time_log[0])

View File

@@ -29,10 +29,11 @@ def execute():
make_warehouse_nestedset(company)
else:
sle_against_companies = frappe.db.sql_list("""select distinct company from `tabStock Ledger Entry`""")
company = frappe.defaults.get_defaults().company
if len(sle_against_companies) == 1:
set_company_to_warehouse(company)
company = frappe.db.get_value("Company", sle_against_companies[0],
fieldname=["name", "abbr"], as_dict=1)
set_company_to_warehouse(company.name)
make_warehouse_nestedset(company)
elif len(sle_against_companies) > 1:

View File

@@ -5,6 +5,8 @@ def execute():
frappe.reload_doc('accounts', 'doctype', 'sales_invoice_payment')
for time_sheet in frappe.db.sql(""" select sales_invoice, name, total_billing_amount from `tabTimesheet`
where sales_invoice is not null and docstatus < 2""", as_dict=True):
if not frappe.db.exists('Sales Invoice', time_sheet.sales_invoice):
continue
si_doc = frappe.get_doc('Sales Invoice', time_sheet.sales_invoice)
ts = si_doc.append('timesheets',{})
ts.time_sheet = time_sheet.name

View File

@@ -5,6 +5,22 @@ def execute():
frappe.db.sql("""delete from `tabDocType`
where name in('Time Log Batch', 'Time Log Batch Detail', 'Time Log')""")
frappe.db.sql("""delete from `tabDocField` where parent in ('Time Log', 'Time Log Batch')""")
frappe.db.sql("""update `tabCustom Script` set dt = 'Timesheet' where dt = 'Time Log'""")
for data in frappe.db.sql(""" select label, fieldname from `tabCustom Field` where dt = 'Time Log'""", as_dict=1):
custom_field = frappe.get_doc({
'doctype': 'Custom Field',
'label': data.label,
'dt': 'Timesheet Detail',
'fieldname': data.fieldname,
'fieldtype': data.fieldtype or "Data"
}).insert(ignore_permissions=True)
frappe.db.sql("""delete from `tabCustom Field` where dt = 'Time Log'""")
frappe.reload_doc('projects', 'doctype', 'timesheet')
frappe.reload_doc('projects', 'doctype', 'timesheet_detail')
report = "Daily Time Log Summary"
if frappe.db.exists("Report", report):
frappe.delete_doc('Report', report)
frappe.delete_doc('Report', report)

View File

@@ -7,6 +7,8 @@ def execute():
frappe.reload_doctype('Stock Settings')
stock_settings = frappe.get_doc('Stock Settings', 'Stock Settings')
stock_settings.show_barcode_field = cint(frappe.db.get_value("Features Setup", None, "fs_item_barcode"))
if not frappe.db.exists("UOM", stock_settings.stock_uom):
stock_settings.stock_uom = None
stock_settings.save()
create_compact_item_print_custom_field()

View File

@@ -78,9 +78,12 @@ def execute():
for doctype, cols in dt_cols_de.items():
source_cols = "`" + "`, `".join(standard_cols_de + cols) + "`"
frappe.db.sql("""INSERT INTO `tabSalary Component` ({0}) SELECT {1} FROM `tab{2}`"""
.format(target_cols, source_cols, doctype))
try:
frappe.db.sql("""INSERT INTO `tabSalary Component` ({0}) SELECT {1} FROM `tab{2}`"""
.format(target_cols, source_cols, doctype))
except Exception, e:
if e.args[0]==1062:
pass
update_customizations()

View File

@@ -0,0 +1,28 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.stock.doctype.bin.bin import update_item_projected_qty
def execute():
repost_bin_qty()
repost_item_projected_qty()
def repost_bin_qty():
for bin in frappe.db.sql(""" select name from `tabBin`
where (actual_qty + ordered_qty + indented_qty + planned_qty- reserved_qty - reserved_qty_for_production) != projected_qty """, as_dict=1):
bin_doc = frappe.get_doc('Bin', bin.name)
bin_doc.set_projected_qty()
bin_doc.db_set("projected_qty", bin_doc.projected_qty, update_modified = False)
def repost_item_projected_qty():
for data in frappe.db.sql(""" select
`tabBin`.item_code as item_code,
sum(`tabBin`.projected_qty) as projected_qty,
`tabItem`.total_projected_qty as total_projected_qty
from
`tabBin`, `tabItem`
where `tabBin`.item_code = `tabItem`.name
group by `tabBin`.item_code having projected_qty <> total_projected_qty """, as_dict=1):
update_item_projected_qty(data.item_code)

View File

@@ -0,0 +1,20 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint
def execute():
if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
return
for pi in frappe.db.sql("""select name from `tabPurchase Invoice`
where update_stock=1 and docstatus=1 order by posting_date asc""", as_dict=1):
frappe.db.sql("""delete from `tabGL Entry`
where voucher_type = 'Purchase Invoice' and voucher_no = %s""", pi.name)
pi_doc = frappe.get_doc("Purchase Invoice", pi.name)
pi_doc.make_gl_entries(repost_future_gle=False)
frappe.db.commit()

View File

@@ -7,6 +7,7 @@ from frappe.utils import cint, flt
def execute():
frappe.reload_doctype("Sales Invoice")
frappe.reload_doctype("Sales Invoice Item")
for si in frappe.get_all("Sales Invoice", fields = ["name"],
filters={"docstatus": 1, "is_pos": 1, "is_return": 1}):

View File

@@ -0,0 +1,23 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute():
si_list = frappe.db.sql("""
select distinct parent
from `tabSales Invoice Payment`
where docstatus!=2 and amount != 0 and base_amount = 0
""")
count = 0
for d in si_list:
si = frappe.get_doc("Sales Invoice", d[0])
for p in si.get("payments"):
if p.amount and not p.base_amount:
base_amount = flt(p.amount*si.conversion_rate, si.precision("base_paid_amount"))
frappe.db.set_value("Sales Invoice Payment", p.name, "base_amount", base_amount, update_modified=False)
count +=1
if count % 200 == 0:
frappe.db.commit()

View File

@@ -10,9 +10,11 @@ def execute():
for dt in ("assessment", "announcement", "course", "fees"):
frappe.reload_doc("schools", "doctype", dt)
frappe.reload_doc('website', 'doctype', 'portal_menu_item')
frappe.get_doc('Portal Settings').sync_menu()
if 'schools' in frappe.get_installed_apps():
domainify.setup_domain('Education')
else:
domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))
domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))

View File

@@ -16,4 +16,5 @@ def execute():
"company": frappe.db.get_value("Account", expense_claim_type.default_account, "company"),
"default_account": expense_claim_type.default_account,
})
doc.flags.ignore_mandatory = True
doc.save(ignore_permissions=True)

View File

@@ -0,0 +1,19 @@
from __future__ import unicode_literals
import frappe
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
def execute():
frappe.reload_doc('accounts', 'doctype', 'sales_invoice')
for company in frappe.db.sql("""select company from `tabSales Invoice`
where change_amount <> 0 and account_for_change_amount is null group by company""", as_list = 1):
cash_account = get_default_bank_cash_account(company[0], 'Cash').get('account')
if not cash_account:
bank_account = get_default_bank_cash_account(company[0], 'Bank').get('account')
cash_account = bank_account
if cash_account:
frappe.db.sql("""update `tabSales Invoice`
set account_for_change_amount = %(cash_account)s where change_amount <> 0
and company = %(company)s and account_for_change_amount is null""",
{'cash_account': cash_account, 'company': company[0]})

View File

@@ -13,7 +13,7 @@ def execute():
header = frappe.db.get_value('Web Page', website_settings.home_page, 'header')
if header and header.startswith("<div class='hero text-center'>"):
homepage = frappe.get_doc('Homepage', 'Homepage')
homepage.company = erpnext.get_default_company()
homepage.company = erpnext.get_default_company() or frappe.get_all("Company")[0].name
if '<h1>' in header:
homepage.tag_line = header.split('<h1>')[1].split('</h1>')[0] or 'Default Website'
else:

View File

@@ -0,0 +1,29 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute():
frappe.reload_doc('accounts', 'doctype', 'mode_of_payment')
frappe.db.sql(""" update `tabMode of Payment` set type = 'Cash' where (type is null or type = '') and name = 'Cash'""")
for data in frappe.db.sql("""select name from `tabSales Invoice` where is_pos=1 and docstatus<2 and
(ifnull(paid_amount, 0) - ifnull(change_amount, 0)) > ifnull(grand_total, 0) and modified > '2016-05-01'""", as_dict=1):
if data.name:
si_doc = frappe.get_doc("Sales Invoice", data.name)
remove_payment = []
mode_of_payment = [d.mode_of_payment for d in si_doc.payments if flt(d.amount) > 0]
if mode_of_payment != set(mode_of_payment):
for payment_data in si_doc.payments:
if payment_data.idx != 1 and payment_data.amount == si_doc.grand_total:
remove_payment.append(payment_data)
frappe.db.sql(""" delete from `tabSales Invoice Payment`
where name = %(name)s""", {'name': payment_data.name})
if len(remove_payment) > 0:
for d in remove_payment:
si_doc.remove(d)
si_doc.set_paid_amount()
si_doc.db_set("paid_amount", si_doc.paid_amount, update_modified = False)
si_doc.db_set("base_paid_amount", si_doc.base_paid_amount, update_modified = False)

View File

@@ -0,0 +1,7 @@
from __future__ import unicode_literals
import frappe
def execute():
for data in frappe.get_all('Sales Order', fields = ["name"], filters = [["docstatus", "=", "1"], ["grand_total", "=", "0"]]):
sales_order = frappe.get_doc('Sales Order', data.name)
sales_order.set_status(update=True, update_modified = False)

View File

@@ -0,0 +1,27 @@
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.table_exists("Time Log"):
timesheet = frappe.db.sql("""SELECT ts.name AS name, tl.name AS timelogname,
tl.modified AS modified, tl.modified_by AS modified_by, tl.creation AS creation, tl.owner AS owner
FROM
`tabTimesheet` ts, `tabTimesheet Detail` tsd, `tabTime Log` tl
WHERE
tsd.parent = ts.name AND tl.from_time = tsd.from_time AND tl.to_time = tsd.to_time
AND tl.hours = tsd.hours AND tl.billing_rate = tsd.billing_rate AND tsd.idx=1
AND tl.docstatus < 2""", as_dict=1)
for data in timesheet:
frappe.db.sql(""" update `tabTimesheet` set creation = %(creation)s,
owner = %(owner)s, modified = %(modified)s, modified_by = %(modified_by)s
where name = %(name)s""", data)
frappe.db.sql("""
update
tabCommunication
set
reference_doctype = "Timesheet", reference_name = %(timesheet)s
where
reference_doctype = "Time Log" and reference_name = %(timelog)s
""", {'timesheet': data.name, 'timelog': data.timelogname}, auto_commit=1)

View File

@@ -2,6 +2,14 @@
// For license information, please see license.txt
frappe.ui.form.on('Homepage', {
setup: function(frm) {
frm.fields_dict["products"].grid.get_field("item_code").get_query = function(){
return {
filters: {'show_in_website': 1}
}
}
},
refresh: function(frm) {
},
@@ -35,5 +43,12 @@ frappe.ui.form.on('Homepage Featured Product', {
}
});
}
},
view: function(frm, cdt, cdn){
var child= locals[cdt][cdn]
if(child.item_code && frm.doc.products_url){
window.location.href = frm.doc.products_url + '/' + encodeURIComponent(child.item_code);
}
}
});

View File

@@ -1,25 +1,26 @@
from frappe import _
data = {
'heatmap': True,
'heatmap_message': _('This is based on the Time Sheets created against this project'),
'fieldname': 'project',
'transactions': [
{
'label': _('Project'),
'items': ['Task', 'Timesheet', 'Expense Claim', 'Issue']
},
{
'label': _('Material'),
'items': ['Material Request', 'BOM', 'Stock Entry']
},
{
'label': _('Sales'),
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
},
{
'label': _('Purchase'),
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
},
]
}
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on the Time Sheets created against this project'),
'fieldname': 'project',
'transactions': [
{
'label': _('Project'),
'items': ['Task', 'Timesheet', 'Expense Claim', 'Issue']
},
{
'label': _('Material'),
'items': ['Material Request', 'BOM', 'Stock Entry']
},
{
'label': _('Sales'),
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
},
{
'label': _('Purchase'),
'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
},
]
}

View File

@@ -145,7 +145,7 @@ class Timesheet(Document):
def validate_dates(self):
for data in self.time_logs:
if time_diff_in_hours(data.to_time, data.from_time) < 0:
if data.from_time and data.to_time and time_diff_in_hours(data.to_time, data.from_time) < 0:
frappe.throw(_("To date cannot be before from date"))
def validate_time_logs(self):

View File

@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.reportview import build_match_conditions
def execute(filters=None):
if not filters:
@@ -12,25 +13,36 @@ def execute(filters=None):
filters["from_time"] = "00:00:00"
filters["to_time"] = "24:00:00"
columns = [_("Timesheet") + ":Link/Timesheet:120", _("Employee") + "::150", _("Employee Name") + "::150",
_("From Datetime") + "::140", _("To Datetime") + "::140", _("Hours") + "::70",
_("Activity Type") + "::120", _("Task") + ":Link/Task:150",
_("Project") + ":Link/Project:120", _("Status") + "::70"]
conditions = "ts.docstatus = 1"
if filters.get("from_date"):
conditions += " and tsd.from_time >= timestamp(%(from_date)s, %(from_time)s)"
if filters.get("to_date"):
conditions += " and tsd.to_time <= timestamp(%(to_date)s, %(to_time)s)"
columns = get_column()
conditions = get_conditions(filters)
data = get_data(conditions, filters)
return columns, data
def get_column():
return [_("Timesheet") + ":Link/Timesheet:120", _("Employee") + "::150", _("Employee Name") + "::150",
_("From Datetime") + "::140", _("To Datetime") + "::140", _("Hours") + "::70",
_("Activity Type") + "::120", _("Task") + ":Link/Task:150",
_("Project") + ":Link/Project:120", _("Status") + "::70"]
def get_data(conditions, filters):
time_sheet = frappe.db.sql(""" select ts.name, ts.employee, ts.employee_name,
tsd.from_time, tsd.to_time, tsd.hours,
tsd.activity_type, tsd.task, tsd.project, ts.status from `tabTimesheet Detail` tsd,
`tabTimesheet` ts where ts.name = tsd.parent and %s order by ts.name"""%(conditions), filters, as_list=1)
time_sheet = frappe.db.sql(""" select `tabTimesheet`.name, `tabTimesheet`.employee, `tabTimesheet`.employee_name,
`tabTimesheet Detail`.from_time, `tabTimesheet Detail`.to_time, `tabTimesheet Detail`.hours,
`tabTimesheet Detail`.activity_type, `tabTimesheet Detail`.task, `tabTimesheet Detail`.project,
`tabTimesheet`.status from `tabTimesheet Detail`, `tabTimesheet` where
`tabTimesheet Detail`.parent = `tabTimesheet`.name and %s order by `tabTimesheet`.name"""%(conditions), filters, as_list=1)
return time_sheet
def get_conditions(filters):
conditions = "`tabTimesheet`.docstatus = 1"
if filters.get("from_date"):
conditions += " and `tabTimesheet Detail`.from_time >= timestamp(%(from_date)s, %(from_time)s)"
if filters.get("to_date"):
conditions += " and `tabTimesheet Detail`.to_time <= timestamp(%(to_date)s, %(to_time)s)"
match_conditions = build_match_conditions("Timesheet")
if match_conditions:
conditions += " and %s" % match_conditions
return conditions

View File

@@ -15,21 +15,18 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
},
apply_pricing_rule_on_item: function(item){
if(!item.margin_type){
item.margin_rate_or_amount = 0.0;
}
if(item.margin_type == "Percentage"){
item.total_margin = item.price_list_rate + item.price_list_rate * ( item.margin_rate_or_amount / 100);
item.total_margin = flt(item.price_list_rate)
+ flt(item.price_list_rate) * ( flt(item.margin_rate_or_amount) / 100);
}else{
item.total_margin = item.price_list_rate + item.margin_rate_or_amount;
item.total_margin = flt(item.price_list_rate) + flt(item.margin_rate_or_amount);
}
item.rate = flt(item.total_margin , 2);
item.rate = flt(item.total_margin , precision("rate", item));
if(item.discount_percentage){
discount_value = flt(item.total_margin) * flt(item.discount_percentage) / 100;
item.rate = flt((item.total_margin) - (discount_value), precision('rate'));
item.rate = flt((item.total_margin) - (discount_value), precision('rate', item));
}
},

View File

@@ -678,6 +678,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
me._set_values_for_item_list(r.message);
if(item) me.set_gross_profit(item);
if(calculate_taxes_and_totals) me.calculate_taxes_and_totals();
if(me.frm.doc.apply_discount_on) me.frm.trigger("apply_discount_on")
}
}
});
@@ -719,7 +720,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
"brand": d.brand,
"qty": d.qty,
"parenttype": d.parenttype,
"parent": d.parent
"parent": d.parent,
"pricing_rule": d.pricing_rule
});
// if doctype is Quotation Item / Sales Order Iten then add Margin Type and rate in item_list
@@ -988,7 +990,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
make_payment_entry: function() {
return frappe.call({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry",
method: cur_frm.cscript.get_method_for_payment(),
args: {
"dt": cur_frm.doc.doctype,
"dn": cur_frm.doc.name
@@ -999,5 +1001,18 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
// cur_frm.refresh_fields()
}
});
},
get_method_for_payment: function(){
method = "erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry"
if(cur_frm.doc.__onload && cur_frm.doc.__onload.make_payment_via_journal_entry){
if(in_list(['Sales Invoice', 'Purchase Invoice'], cur_frm.doc.doctype)){
method = "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_against_invoice"
}else {
method= "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_against_order"
}
}
return method
}
});

View File

@@ -1,15 +1,16 @@
from frappe import _
data = {
'heatmap': True,
'heatmap_message': _('This is based on the attendance of this Student'),
'fieldname': 'student',
'transactions': [
{
'items': ['Student Log', 'Student Group', 'Student Attendance']
},
{
'items': ['Program Enrollment', 'Fees', 'Assessment', 'Guardian']
}
]
}
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on the attendance of this Student'),
'fieldname': 'student',
'transactions': [
{
'items': ['Student Log', 'Student Group', 'Student Attendance']
},
{
'items': ['Program Enrollment', 'Fees', 'Assessment', 'Guardian']
}
]
}

View File

@@ -1,25 +1,26 @@
from frappe import _
data = {
'heatmap': True,
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
'fieldname': 'customer',
'transactions': [
{
'label': _('Pre Sales'),
'items': ['Opportunity', 'Quotation']
},
{
'label': _('Orders'),
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
},
{
'label': _('Support'),
'items': ['Issue']
},
{
'label': _('Projects'),
'items': ['Project']
}
]
}
def get_data():
return {
'heatmap': True,
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
'fieldname': 'customer',
'transactions': [
{
'label': _('Pre Sales'),
'items': ['Opportunity', 'Quotation']
},
{
'label': _('Orders'),
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
},
{
'label': _('Support'),
'items': ['Issue']
},
{
'label': _('Projects'),
'items': ['Project']
}
]
}

View File

@@ -1,11 +1,12 @@
from frappe import _
data = {
'fieldname': 'prevdoc_docname',
'transactions': [
{
'label': _('Related'),
'items': ['Sales Order']
},
]
}
def get_data():
return {
'fieldname': 'prevdoc_docname',
'transactions': [
{
'label': _('Related'),
'items': ['Sales Order']
},
]
}

View File

@@ -542,7 +542,7 @@
"collapsible": 0,
"depends_on": "eval:doc.margin_type && doc.price_list_rate",
"fieldname": "total_margin",
"fieldtype": "Float",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -1230,7 +1230,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-07-11 03:28:06.436316",
"modified": "2016-11-01 16:26:46.507292",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation Item",

View File

@@ -442,6 +442,11 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
target.amount = flt(source.amount) - flt(source.billed_amt)
target.base_amount = target.amount * flt(source_parent.conversion_rate)
target.qty = target.amount / flt(source.rate) if (source.rate and source.billed_amt) else source.qty
item = frappe.db.get_value("Item", target.item_code, ["item_group", "selling_cost_center"], as_dict=1)
target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
or item.selling_cost_center \
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
doclist = get_mapped_doc("Sales Order", source_name, {
"Sales Order": {
@@ -553,6 +558,9 @@ def get_events(start, end, filters=None):
def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc=None):
def set_missing_values(source, target):
target.supplier = for_supplier
target.apply_discount_on = ""
target.additional_discount_percentage = 0.0
target.discount_amount = 0.0
default_price_list = frappe.get_value("Supplier", for_supplier, "default_price_list")
if default_price_list:

View File

@@ -1,33 +1,34 @@
from frappe import _
data = {
'fieldname': 'sales_order',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_order',
},
'internal_links': {
'Quotation': ['items', 'prevdoc_docname']
},
'transactions': [
{
'label': _('Fulfillment'),
'items': ['Sales Invoice', 'Delivery Note']
def get_data():
return {
'fieldname': 'sales_order',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_order',
},
{
'label': _('Purchasing'),
'items': ['Material Request', 'Purchase Order']
'internal_links': {
'Quotation': ['items', 'prevdoc_docname']
},
{
'label': _('Projects'),
'items': ['Project']
},
{
'label': _('Manufacturing'),
'items': ['Production Order']
},
{
'label': _('Reference'),
'items': ['Quotation']
},
]
}
'transactions': [
{
'label': _('Fulfillment'),
'items': ['Sales Invoice', 'Delivery Note']
},
{
'label': _('Purchasing'),
'items': ['Material Request', 'Purchase Order']
},
{
'label': _('Projects'),
'items': ['Project']
},
{
'label': _('Manufacturing'),
'items': ['Production Order']
},
{
'label': _('Reference'),
'items': ['Quotation']
},
]
}

View File

@@ -5,6 +5,7 @@ import frappe
from frappe.utils import flt, add_days
import frappe.permissions
import unittest
from erpnext.stock.doctype.item.test_item import get_total_projected_qty
from erpnext.selling.doctype.sales_order.sales_order \
import make_material_request, make_delivery_note, make_sales_invoice, WarehouseRequired
@@ -124,8 +125,16 @@ class TestSalesOrder(unittest.TestCase):
dn = create_dn_against_so(so.name, 15)
self.assertEqual(get_reserved_qty(), existing_reserved_qty)
total_projected_qty = get_total_projected_qty('_Test Item')
item_doc_before_cancel = frappe.get_doc('Item', '_Test Item')
self.assertEqual(total_projected_qty, item_doc_before_cancel.total_projected_qty)
dn.cancel()
self.assertEqual(get_reserved_qty(), existing_reserved_qty + 10)
total_projected_qty = get_total_projected_qty('_Test Item')
item_doc_after_cancel = frappe.get_doc('Item', '_Test Item')
self.assertEqual(total_projected_qty, item_doc_after_cancel.total_projected_qty)
def test_reserved_qty_for_over_delivery_via_sales_invoice(self):
# set over-delivery tolerance
@@ -141,6 +150,10 @@ class TestSalesOrder(unittest.TestCase):
si.get("items")[0].qty = 12
si.insert()
si.submit()
total_projected_qty = get_total_projected_qty('_Test Item')
item_doc = frappe.get_doc('Item', '_Test Item')
self.assertEqual(total_projected_qty, item_doc.total_projected_qty)
self.assertEqual(get_reserved_qty(), existing_reserved_qty)
@@ -150,6 +163,9 @@ class TestSalesOrder(unittest.TestCase):
si.cancel()
self.assertEqual(get_reserved_qty(), existing_reserved_qty + 10)
total_projected_qty = get_total_projected_qty('_Test Item')
item_doc = frappe.get_doc('Item', '_Test Item')
self.assertEqual(total_projected_qty, item_doc.total_projected_qty)
so.load_from_db()
self.assertEqual(so.get("items")[0].delivered_qty, 0)
@@ -178,6 +194,10 @@ class TestSalesOrder(unittest.TestCase):
self.assertEqual(get_reserved_qty("_Test Item"), existing_reserved_qty_item1)
self.assertEqual(get_reserved_qty("_Test Item Home Desktop 100"), existing_reserved_qty_item2)
total_projected_qty = get_total_projected_qty('_Test Item')
item_doc = frappe.get_doc('Item', '_Test Item')
self.assertEqual(total_projected_qty, item_doc.total_projected_qty)
# unclose so
so.load_from_db()
so.update_status('Draft')
@@ -211,6 +231,10 @@ class TestSalesOrder(unittest.TestCase):
dn = create_dn_against_so(so.name, 15)
total_projected_qty = get_total_projected_qty('_Test Item')
item_doc = frappe.get_doc('Item', '_Test Item')
self.assertEqual(total_projected_qty, item_doc.total_projected_qty)
self.assertEqual(get_reserved_qty("_Test Item"), existing_reserved_qty_item1)
self.assertEqual(get_reserved_qty("_Test Item Home Desktop 100"),
existing_reserved_qty_item2)
@@ -427,6 +451,13 @@ class TestSalesOrder(unittest.TestCase):
self.assertEquals(abs(flt(reserved_qty)), existing_reserved_qty_for_dn_item)
def test_total_projected_qty_against_sales_order(self):
so = make_sales_order(item = '_Test Item')
total_projected_qty = get_total_projected_qty('_Test Item')
item_doc = frappe.get_doc('Item', '_Test Item')
self.assertEqual(total_projected_qty, item_doc.total_projected_qty)
def test_reserved_qty_for_closing_so(self):
bin = frappe.get_all("Bin", filters={"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"},
fields=["reserved_qty"])

View File

@@ -542,7 +542,7 @@
"collapsible": 0,
"depends_on": "eval:doc.margin_type && doc.price_list_rate",
"fieldname": "total_margin",
"fieldtype": "Float",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -591,7 +591,7 @@
"collapsible": 0,
"depends_on": "eval: doc.type != \"\"",
"fieldname": "rate",
"fieldtype": "Float",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -1525,7 +1525,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-07-11 03:28:07.988319",
"modified": "2016-11-01 16:26:27.256029",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order Item",

View File

@@ -1,5 +1,5 @@
{
"add_total_row": 0,
"add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-05-03 11:31:05",
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2016-01-28 04:22:49.476068",
"modified": "2016-10-05 12:26:15.736596",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Person-wise Transaction Summary",

View File

@@ -39,7 +39,7 @@ def get_columns(filters):
_("Customer") + ":Link/Customer:140", _("Territory") + ":Link/Territory:100", _("Posting Date") + ":Date:100",
_("Item Code") + ":Link/Item:120", _("Item Group") + ":Link/Item Group:120",
_("Brand") + ":Link/Brand:120", _("Qty") + ":Float:100", _("Amount") + ":Currency:120",
_("Sales Person") + ":Link/Sales Person:140", _("Contribution %") + ":Float:110",
_("Sales Person") + ":Link/Sales Person:140", _("Contribution %") + "::110",
_("Contribution Amount") + ":Currency:140"]
def get_entries(filters):

View File

@@ -18,7 +18,6 @@ def delete_company_transactions(company_name):
frappe.PermissionError)
delete_bins(company_name)
delete_time_sheets(company_name)
delete_lead_addresses(company_name)
for doctype in frappe.db.sql_list("""select parent from
@@ -70,14 +69,6 @@ def delete_bins(company_name):
frappe.db.sql("""delete from tabBin where warehouse in
(select name from tabWarehouse where company=%s)""", company_name)
def delete_time_sheets(company_name):
# Delete Time Logs as it is linked to Production Order / Project / Task, which are linked to company
frappe.db.sql("""
delete from `tabTimesheet`
where
company=%(company)s
""", {"company": company_name})
def delete_lead_addresses(company_name):
"""Delete addresses to which leads are linked"""
for lead in frappe.get_all("Lead", filters={"company": company_name}):

View File

@@ -24,7 +24,7 @@ class NamingSeries(Document):
try:
options = self.get_options(d)
except frappe.DoesNotExistError:
frappe.pass_does_not_exist_error()
frappe.msgprint('Unable to find DocType {0}'.format(d))
continue
if options:

View File

@@ -9,7 +9,9 @@ frappe.ui.form.on("Notification Control", {
frm.set_value("custom_message", frm.doc[frm.events.get_fieldname(frm)]);
},
set_message: function(frm) {
frm.set_value(frm.events.get_fieldname(frm), frm.doc.custom_message);
if(frm.doc.select_transaction && frm.doc.select_transaction !== "") {
frm.set_value(frm.events.get_fieldname(frm), frm.doc.custom_message);
}
frm.save();
},
get_fieldname: function(frm) {

View File

@@ -12,9 +12,3 @@ cur_frm.cscript.refresh = function(doc,dt,dn){
erpnext.utils.render_address_and_contact(cur_frm);
}
}
cur_frm.fields_dict['targets'].grid.get_field("item_group").get_query = function(doc, dt, dn) {
return{
filters:{ 'is_group': 0 }
}
}

View File

@@ -1,7 +1,7 @@
{
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 0,
"allow_rename": 1,
"autoname": "field:uom_name",
"beta": 0,
"creation": "2013-01-10 16:34:24",
@@ -15,6 +15,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "uom_name",
"fieldtype": "Data",
"hidden": 0,
@@ -41,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Check this to disallow fractions. (for Nos)",
"fieldname": "must_be_whole_number",
"fieldtype": "Check",
@@ -74,7 +76,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-25 05:24:25.434534",
"modified": "2016-09-23 17:58:21.574996",
"modified_by": "Administrator",
"module": "Setup",
"name": "UOM",
@@ -144,5 +146,6 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_order": "ASC",
"track_seen": 0
}

View File

@@ -63,7 +63,8 @@ def get_domain(domain):
'Education': {
'desktop_icons': ['Student', 'Program', 'Course', 'Student Group', 'Instructor',
'Fees', 'ToDo', 'Schools'],
'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Website Manager'],
'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Item Manager',
'Website Manager', 'HR User', 'HR Manager', 'Purchase User', 'Purchase Manager'],
'allow_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
},
}

View File

@@ -14,18 +14,18 @@ class Bin(Document):
self.stock_uom = frappe.db.get_value('Item', self.item_code, 'stock_uom')
self.validate_mandatory()
self.projected_qty = flt(self.actual_qty) + flt(self.ordered_qty) + \
flt(self.indented_qty) + flt(self.planned_qty) - flt(self.reserved_qty)
self.set_projected_qty()
self.block_transactions_against_group_warehouse()
def on_update(self):
update_item_projected_qty(self.item_code)
def validate_mandatory(self):
qf = ['actual_qty', 'reserved_qty', 'ordered_qty', 'indented_qty']
for f in qf:
if (not getattr(self, f, None)) or (not self.get(f)):
self.set(f, 0.0)
def block_transactions_against_group_warehouse(self):
from erpnext.stock.utils import is_group_warehouse
is_group_warehouse(self.warehouse)
@@ -72,9 +72,7 @@ class Bin(Document):
self.indented_qty = flt(self.indented_qty) + flt(args.get("indented_qty"))
self.planned_qty = flt(self.planned_qty) + flt(args.get("planned_qty"))
self.set_projected_qty()
self.save()
update_item_projected_qty(self.item_code)
def set_projected_qty(self):
self.projected_qty = (flt(self.actual_qty) + flt(self.ordered_qty)

View File

@@ -3,16 +3,19 @@
"allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
"beta": 0,
"creation": "2013-05-24 19:29:09",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "delivery_to_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -38,6 +41,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
@@ -64,6 +68,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "{customer_name}",
"fieldname": "title",
"fieldtype": "Data",
@@ -90,6 +95,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -117,6 +123,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
@@ -144,6 +151,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"depends_on": "customer",
"fieldname": "customer_name",
"fieldtype": "Data",
@@ -169,6 +177,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -193,6 +202,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -222,6 +232,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "company",
"fieldtype": "Link",
@@ -252,6 +263,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
@@ -281,6 +293,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "po_no",
"fieldtype": "Data",
"hidden": 0,
@@ -309,6 +322,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.po_no",
"fieldname": "po_date",
"fieldtype": "Date",
@@ -338,6 +352,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_return",
"fieldtype": "Check",
"hidden": 0,
@@ -347,7 +362,7 @@
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -363,6 +378,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_return",
"fieldname": "return_against",
"fieldtype": "Link",
@@ -373,7 +389,7 @@
"in_list_view": 0,
"label": "Return Against Delivery Note",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Delivery Note",
"permlevel": 0,
"precision": "",
@@ -390,6 +406,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"depends_on": "customer",
"fieldname": "contact_info",
"fieldtype": "Section Break",
@@ -416,6 +433,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_address_name",
"fieldtype": "Link",
"hidden": 0,
@@ -441,6 +459,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_address",
"fieldtype": "Small Text",
"hidden": 0,
@@ -465,6 +484,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_person",
"fieldtype": "Link",
"hidden": 0,
@@ -490,6 +510,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -514,6 +535,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_mobile",
"fieldtype": "Small Text",
"hidden": 1,
@@ -538,6 +560,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact_email",
"fieldtype": "Data",
"hidden": 1,
@@ -563,6 +586,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break21",
"fieldtype": "Column Break",
"hidden": 0,
@@ -588,6 +612,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "customer",
"fieldname": "customer_address",
"fieldtype": "Link",
@@ -614,6 +639,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "address_display",
"fieldtype": "Small Text",
"hidden": 0,
@@ -638,6 +664,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "customer_group",
"fieldtype": "Link",
@@ -664,6 +691,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "territory",
"fieldtype": "Link",
@@ -690,6 +718,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -715,6 +744,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 0,
@@ -742,6 +772,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Rate at which customer's currency is converted to company's base currency",
"fieldname": "conversion_rate",
"fieldtype": "Float",
@@ -770,6 +801,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break23",
"fieldtype": "Column Break",
"hidden": 0,
@@ -793,6 +825,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "selling_price_list",
"fieldtype": "Link",
"hidden": 0,
@@ -820,6 +853,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "price_list_currency",
"fieldtype": "Link",
"hidden": 0,
@@ -845,6 +879,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Rate at which Price list currency is converted to company's base currency",
"fieldname": "plc_conversion_rate",
"fieldtype": "Float",
@@ -871,6 +906,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"hidden": 0,
@@ -895,6 +931,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -921,6 +958,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "items",
"fieldtype": "Table",
"hidden": 0,
@@ -949,6 +987,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "packed_items",
"columns": 0,
"fieldname": "packing_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -975,6 +1014,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "packed_items",
"fieldtype": "Table",
"hidden": 0,
@@ -1002,6 +1042,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "product_bundle_help",
"fieldtype": "HTML",
"hidden": 0,
@@ -1026,6 +1067,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_31",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1049,6 +1091,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1075,6 +1118,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_net_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1104,6 +1148,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_33",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1127,6 +1172,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1153,6 +1199,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1178,6 +1225,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1204,6 +1252,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "If you have created a standard template in Sales Taxes and Charges Template, select one and click on the button below.",
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
@@ -1232,6 +1281,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_39",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1255,6 +1305,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_rule",
"fieldtype": "Link",
"hidden": 0,
@@ -1281,6 +1332,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_41",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1304,6 +1356,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
@@ -1331,6 +1384,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "other_charges_calculation",
"fieldtype": "HTML",
"hidden": 0,
@@ -1356,6 +1410,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_44",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1379,6 +1434,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1408,6 +1464,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_47",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1432,6 +1489,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"hidden": 0,
@@ -1458,6 +1516,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "discount_amount",
"columns": 0,
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1483,6 +1542,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Grand Total",
"fieldname": "apply_discount_on",
"fieldtype": "Select",
@@ -1510,6 +1570,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1536,6 +1597,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_51",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1559,6 +1621,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "additional_discount_percentage",
"fieldtype": "Float",
"hidden": 0,
@@ -1584,6 +1647,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1609,6 +1673,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "totals",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1635,6 +1700,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1664,6 +1730,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_rounded_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1693,6 +1760,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "In Words will be visible once you save the Delivery Note.",
"fieldname": "base_in_words",
"fieldtype": "Data",
@@ -1722,6 +1790,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1746,6 +1815,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "grand_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1775,6 +1845,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "rounded_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1804,6 +1875,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "In Words (Export) will be visible once you save the Delivery Note.",
"fieldname": "in_words",
"fieldtype": "Data",
@@ -1834,6 +1906,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "terms",
"columns": 0,
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1860,6 +1933,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "tc_name",
"fieldtype": "Link",
"hidden": 0,
@@ -1887,6 +1961,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "terms",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -1914,6 +1989,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "transporter_name",
"columns": 0,
"fieldname": "transporter_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1939,6 +2015,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "transporter_name",
"fieldtype": "Data",
"hidden": 0,
@@ -1967,6 +2044,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break34",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1992,6 +2070,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "lr_no",
"fieldtype": "Data",
@@ -2021,6 +2100,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"description": "",
"fieldname": "lr_date",
@@ -2051,6 +2131,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "more_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2077,6 +2158,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Track this Delivery Note against any Project",
"fieldname": "project",
"fieldtype": "Link",
@@ -2105,6 +2187,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.source == 'Campaign'",
"fieldname": "campaign",
"fieldtype": "Link",
@@ -2133,6 +2216,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "source",
"fieldtype": "Select",
"hidden": 0,
@@ -2160,6 +2244,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break5",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2186,6 +2271,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Time at which items were delivered from warehouse",
"fieldname": "posting_time",
"fieldtype": "Time",
@@ -2215,6 +2301,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "per_billed",
"fieldtype": "Percent",
"hidden": 0,
@@ -2240,6 +2327,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "printing_details",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2265,6 +2353,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "letter_head",
"fieldtype": "Link",
"hidden": 0,
@@ -2292,6 +2381,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -2319,6 +2409,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "language",
"fieldtype": "Data",
"hidden": 0,
@@ -2344,6 +2435,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_88",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2368,6 +2460,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "print_without_amount",
"fieldtype": "Check",
"hidden": 0,
@@ -2394,6 +2487,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "section_break_83",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2418,6 +2512,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -2448,6 +2543,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:!doc.__islocal",
"description": "% of materials delivered against this Delivery Note",
"fieldname": "per_installed",
@@ -2476,6 +2572,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "installation_status",
"fieldtype": "Select",
"hidden": 1,
@@ -2500,6 +2597,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_89",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2523,6 +2621,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Required only for sample item.",
"fieldname": "to_warehouse",
"fieldtype": "Link",
@@ -2551,6 +2650,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "excise_page",
"fieldtype": "Data",
"hidden": 1,
@@ -2577,6 +2677,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "instructions",
"fieldtype": "Text",
"hidden": 0,
@@ -2604,6 +2705,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "total_commission",
"columns": 0,
"fieldname": "sales_team_section_break",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2630,6 +2732,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sales_partner",
"fieldtype": "Link",
"hidden": 0,
@@ -2659,6 +2762,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break7",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2684,6 +2788,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "commission_rate",
"fieldtype": "Float",
"hidden": 0,
@@ -2712,6 +2817,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_commission",
"fieldtype": "Currency",
"hidden": 0,
@@ -2740,6 +2846,7 @@
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "sales_team",
"columns": 0,
"fieldname": "section_break1",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2764,6 +2871,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sales_team",
"fieldtype": "Table",
"hidden": 0,
@@ -2792,6 +2900,7 @@
"hide_toolbar": 0,
"icon": "icon-truck",
"idx": 146,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2799,7 +2908,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-04-14 12:53:48.081945",
"modified": "2016-09-23 18:01:54.003673",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
@@ -2906,6 +3015,7 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 1,
"search_fields": "status,customer,customer_name, territory,base_grand_total",
@@ -2914,4 +3024,4 @@
"timeline_field": "customer",
"title_field": "title",
"track_seen": 0
}
}

View File

@@ -1,26 +1,27 @@
from frappe import _
data = {
'fieldname': 'delivery_note_no',
'non_standard_fieldnames': {
'Sales Invoice': 'delivery_note',
'Packing Slip': 'delivery_note',
},
'internal_links': {
'Sales Order': ['items', 'against_sales_order'],
},
'transactions': [
{
'label': _('Related'),
'items': ['Sales Invoice', 'Packing Slip']
def get_data():
return {
'fieldname': 'delivery_note_no',
'non_standard_fieldnames': {
'Sales Invoice': 'delivery_note',
'Packing Slip': 'delivery_note',
},
{
'label': _('Reference'),
'items': ['Sales Order', 'Quality Inspection']
'internal_links': {
'Sales Order': ['items', 'against_sales_order'],
},
{
'label': _('Returns'),
'items': ['Stock Entry']
},
]
}
'transactions': [
{
'label': _('Related'),
'items': ['Sales Invoice', 'Packing Slip']
},
{
'label': _('Reference'),
'items': ['Sales Order', 'Quality Inspection']
},
{
'label': _('Returns'),
'items': ['Stock Entry']
},
]
}

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