blob: 8006dca317342f5a291b46445e32a447fe2c7efd [file] [log] [blame]
Rushabh Mehta3966f1d2012-02-23 12:35:32 +05301// ERPNext - web based ERP (http://erpnext.com)
2// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
Rushabh Mehta865c00a2012-01-24 14:33:21 +053017/* features setup "Dictionary", "Script"
18Dictionary Format
19 'projects': {
20 'Sales Order': {
21 'fields':['project_name'],
22 'sales_order_details':['projected_qty']
23 },
24 'Purchase Order': {
25 'fields':['project_name']
26 }
27 }
28// ====================================================================*/
29pscript.feature_dict = {
30 'fs_projects': {
31 'Bill Of Materials': {'fields':['project_name']},
32 'Delivery Note': {'fields':['project_name']},
33 'Payable Voucher': {'fields':['project_name']},
34 'Production Order': {'fields':['project_name']},
35 'Purchase Order': {'fields':['project_name']},
36 'Purchase Receipt': {'fields':['project_name']},
37 'Receivable Voucher': {'fields':['project_name']},
38 'Sales Order': {'fields':['project_name']},
39 'Stock Entry': {'fields':['project_name']},
40 'Timesheet': {'timesheet_details':['project_name']}
41 },
42 'fs_packing_details': {
Anand Doshib2be11c2012-02-14 12:45:55 +053043 //'Delivery Note': {'fields':['packing_details','print_packing_slip','packing_checked_by','packed_by','pack_size','shipping_mark'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']},
44 //'Sales Order': {'fields':['packing_details']}
Rushabh Mehta865c00a2012-01-24 14:33:21 +053045 },
46 'fs_discounts': {
47 'Delivery Note': {'delivery_note_details':['adj_rate']},
48 'Quotation': {'quotation_details':['adj_rate']},
49 'Receivable Voucher': {'entries':['adj_rate']},
50 'Sales Order': {'sales_order_details':['adj_rate','ref_rate']}
51 },
52 'fs_purchase_discounts': {
53 'Purchase Order': {'po_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
54 'Purchase Receipt': {'purchase_receipt_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
55 'Payable Voucher': {'entries':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']}
56 },
57 'fs_brands': {
58 'Delivery Note': {'delivery_note_details':['brand']},
59 'Indent': {'indent_details':['brand']},
60 'Item': {'fields':['brand']},
61 'Purchase Order': {'po_details':['brand']},
62 'Payable Voucher': {'entries':['brand']},
63 'Quotation': {'quotation_details':['brand']},
64 'Receivable Voucher': {'entries':['brand']},
65 'Sales BOM': {'fields':['new_item_brand']},
66 'Sales Order': {'sales_order_details':['brand']},
67 'Serial No': {'fields':['brand']}
68 },
69 'fs_after_sales_installations': {
70 'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']}
71 },
72 'fs_item_batch_nos': {
73 'Delivery Note': {'delivery_note_details':['batch_no']},
74 'Item': {'fields':['has_batch_no']},
75 'Purchase Receipt': {'purchase_receipt_details':['batch_no']},
76 'QA Inspection Report': {'fields':['batch_no']},
77 'Sales and Pruchase Return Wizard': {'return_details':['batch_no']},
78 'Receivable Voucher': {'entries':['batch_no']},
79 'Stock Entry': {'mtn_details':['batch_no']},
80 'Stock Ledger Entry': {'fields':['batch_no']}
81 },
82 'fs_item_serial_nos': {
83 'Customer Issue': {'fields':['serial_no']},
84 'Delivery Note': {'delivery_note_details':['serial_no'],'packing_details':['serial_no']},
85 'Installation Note': {'installed_item_details':['serial_no']},
86 'Item': {'fields':['has_serial_no']},
87 'Maintenance Schedule': {'item_maintenance_details':['serial_no'],'maintenance_schedule_details':['serial_no']},
88 'Maintenance Visit': {'maintenance_visit_details':['serial_no']},
89 'Purchase Receipt': {'purchase_receipt_details':['serial_no']},
90 'QA Inspection Report': {'fields':['item_serial_no']},
91 'Sales and Pruchase Return Wizard': {'return_details':['serial_no']},
92 'Receivable Voucher': {'entries':['serial_no']},
93 'Stock Entry': {'mtn_details':['serial_no']},
94 'Stock Ledger Entry': {'fields':['serial_no']}
95 },
96 'fs_item_group_in_details': {
97 'Delivery Note': {'delivery_note_details':['item_group']},
98 'Enquiry': {'enquiry_details':['item_group']},
99 'Indent': {'indent_details':['item_group']},
100 'Item': {'fields':['item_group']},
101 'Manage Account': {'fields':['default_item_group']},
102 'Purchase Order': {'po_details':['item_group']},
103 'Purchase Receipt': {'purchase_receipt_details':['item_group']},
104 'Purchase Voucher': {'entries':['item_group']},
105 'Quotation': {'quotation_details':['item_group']},
106 'Receivable Voucher': {'entries':['item_group']},
107 'Sales BOM': {'fields':['serial_no']},
108 'Sales Order': {'sales_order_details':['item_group']},
109 'Serial No': {'fields':['item_group']},
110 'Sales Partner': {'partner_target_details':['item_group']},
111 'Sales Person': {'target_details':['item_group']},
112 'Territory': {'target_details':['item_group']}
113 },
114 'fs_page_break': {
115 'Delivery Note': {'delivery_note_details':['page_break'],'packing_details':['page_break']},
116 'Indent': {'indent_details':['page_break']},
117 'Purchase Order': {'po_details':['page_break']},
118 'Purchase Receipt': {'purchase_receipt_details':['page_break']},
119 'Purchase Voucher': {'entries':['page_break']},
120 'Quotation': {'quotation_details':['page_break']},
121 'Receivable Voucher': {'entries':['page_break']},
122 'Sales Order': {'sales_order_details':['page_break']}
123 },
124 'fs_exports': {
Nabin Haitcf9c4c42012-03-05 15:21:35 +0530125 'Delivery Note': {'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','amount','basic_rate']},
Rushabh Mehta865c00a2012-01-24 14:33:21 +0530126 'POS Setting': {'fields':['conversion_rate','currency']},
Nabin Haitcf9c4c42012-03-05 15:21:35 +0530127 'Quotation': {'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['base_ref_rate','amount','basic_rate']},
128 'Receivable Voucher': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['base_ref_rate','amount','basic_rate']},
Rushabh Mehta865c00a2012-01-24 14:33:21 +0530129 'Item': {'ref_rate_details':['ref_currency']},
130 'Sales BOM': {'fields':['currency']},
Nabin Haitcf9c4c42012-03-05 15:21:35 +0530131 'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','amount','basic_rate']}
Rushabh Mehta865c00a2012-01-24 14:33:21 +0530132 },
133 'fs_imports': {
Nabin Haitcf9c4c42012-03-05 15:21:35 +0530134 'Payable Voucher': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['purchase_ref_rate', 'amount','rate']},
135 'Purchase Order': {'fields':['Note HTML','conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'po_details':['purchase_ref_rate', 'amount','purchase_rate']},
136 'Purchase Receipt': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['purchase_ref_rate','amount','purchase_rate']},
Rushabh Mehta865c00a2012-01-24 14:33:21 +0530137 'Supplier Quotation': {'fields':['conversion_rate','currency']}
138 },
139 'fs_item_advanced': {
140 'Item': {'fields':['item_customer_details']}
141 },
142 'fs_sales_extras': {
143 'Address': {'fields':['sales_partner']},
144 'Contact': {'fields':['sales_partner']},
145 'Customer': {'fields':['sales_team']},
146 'Delivery Note': {'fields':['sales_team','Packing List']},
147 'Item': {'fields':['item_customer_details']},
148 'Receivable Voucher': {'fields':['sales_team']},
149 'Sales Order': {'fields':['sales_team','Packing List']}
150 },
151 'fs_more_info': {
Rushabh Mehta865c00a2012-01-24 14:33:21 +0530152 'Delivery Note': {'fields':['More Info']},
153 'Enquiry': {'fields':['More Info']},
154 'Indent': {'fields':['More Info']},
155 'Lead': {'fields':['More Info']},
156 'Payable Voucher': {'fields':['More Info']},
157 'Purchase Order': {'fields':['More Info']},
158 'Purchase Receipt': {'fields':['More Info']},
159 'Quotation': {'fields':['More Info']},
160 'Receivable Voucher': {'fields':['More Info']},
161 'Sales Order': {'fields':['More Info']},
Rushabh Mehta865c00a2012-01-24 14:33:21 +0530162 },
163 'fs_quality': {
164 'Item': {'fields':['Item Inspection Criteria','inspection_required']},
165 'Purchase Receipt': {'purchase_receipt_details':['qa_no']}
166 },
167 'fs_manufacturing': {
168 'Item': {'fields':['Manufacturing']}
169 },
170 'fs_pos': {
171 'Receivable Voucher': {'fields':['is_pos']}
172 },
173 'fs_recurring_invoice': {
174 'Receivable Voucher': {'fields': ['Recurring Invoice']}
175 }
176}
177
178$(document).bind('form_refresh', function() {
179 for(sys_feat in sys_defaults)
180 {
181 if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists
182 {
183 if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat])
184 {
185 for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype])
186 {
187 if(fort=='fields')
188 hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
189 else if(cur_frm.fields_dict[fort])
190 {
191 for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort])
192 cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false);
193 }
194 else
195 msgprint('Grid "'+fort+'" does not exists');
196 }
197 }
198 }
199 }
200})