2013-08-05 09:29:54 +00:00
|
|
|
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
|
|
|
// License: GNU General Public License v3. See license.txt
|
2012-02-23 07:05:32 +00:00
|
|
|
|
2012-01-24 09:03:21 +00:00
|
|
|
/* features setup "Dictionary", "Script"
|
|
|
|
Dictionary Format
|
|
|
|
'projects': {
|
|
|
|
'Sales Order': {
|
|
|
|
'fields':['project_name'],
|
|
|
|
'sales_order_details':['projected_qty']
|
|
|
|
},
|
|
|
|
'Purchase Order': {
|
|
|
|
'fields':['project_name']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====================================================================*/
|
|
|
|
pscript.feature_dict = {
|
|
|
|
'fs_projects': {
|
2012-03-30 06:59:06 +00:00
|
|
|
'BOM': {'fields':['project_name']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Delivery Note': {'fields':['project_name']},
|
2012-04-13 10:33:27 +00:00
|
|
|
'Purchase Invoice': {'entries':['project_name']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Production Order': {'fields':['project_name']},
|
2012-04-13 10:33:27 +00:00
|
|
|
'Purchase Order': {'po_details':['project_name']},
|
|
|
|
'Purchase Receipt': {'purchase_receipt_details':['project_name']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'fields':['project_name']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales Order': {'fields':['project_name']},
|
|
|
|
'Stock Entry': {'fields':['project_name']},
|
|
|
|
'Timesheet': {'timesheet_details':['project_name']}
|
|
|
|
},
|
|
|
|
'fs_packing_details': {
|
2012-02-14 07:15:55 +00:00
|
|
|
//'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']},
|
|
|
|
//'Sales Order': {'fields':['packing_details']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_discounts': {
|
|
|
|
'Delivery Note': {'delivery_note_details':['adj_rate']},
|
|
|
|
'Quotation': {'quotation_details':['adj_rate']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'entries':['adj_rate']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales Order': {'sales_order_details':['adj_rate','ref_rate']}
|
|
|
|
},
|
|
|
|
'fs_purchase_discounts': {
|
|
|
|
'Purchase Order': {'po_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
|
|
|
|
'Purchase Receipt': {'purchase_receipt_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Purchase Invoice': {'entries':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_brands': {
|
|
|
|
'Delivery Note': {'delivery_note_details':['brand']},
|
2013-02-18 08:19:15 +00:00
|
|
|
'Material Request': {'indent_details':['brand']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Item': {'fields':['brand']},
|
|
|
|
'Purchase Order': {'po_details':['brand']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Purchase Invoice': {'entries':['brand']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Quotation': {'quotation_details':['brand']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'entries':['brand']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales BOM': {'fields':['new_item_brand']},
|
|
|
|
'Sales Order': {'sales_order_details':['brand']},
|
|
|
|
'Serial No': {'fields':['brand']}
|
|
|
|
},
|
|
|
|
'fs_after_sales_installations': {
|
|
|
|
'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']}
|
|
|
|
},
|
|
|
|
'fs_item_batch_nos': {
|
|
|
|
'Delivery Note': {'delivery_note_details':['batch_no']},
|
|
|
|
'Item': {'fields':['has_batch_no']},
|
|
|
|
'Purchase Receipt': {'purchase_receipt_details':['batch_no']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Quality Inspection': {'fields':['batch_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales and Pruchase Return Wizard': {'return_details':['batch_no']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'entries':['batch_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Stock Entry': {'mtn_details':['batch_no']},
|
|
|
|
'Stock Ledger Entry': {'fields':['batch_no']}
|
|
|
|
},
|
|
|
|
'fs_item_serial_nos': {
|
|
|
|
'Customer Issue': {'fields':['serial_no']},
|
|
|
|
'Delivery Note': {'delivery_note_details':['serial_no'],'packing_details':['serial_no']},
|
|
|
|
'Installation Note': {'installed_item_details':['serial_no']},
|
|
|
|
'Item': {'fields':['has_serial_no']},
|
2012-04-10 13:44:37 +00:00
|
|
|
'Maintenance Schedule': {'item_maintenance_detail':['serial_no'],'maintenance_schedule_detail':['serial_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Maintenance Visit': {'maintenance_visit_details':['serial_no']},
|
|
|
|
'Purchase Receipt': {'purchase_receipt_details':['serial_no']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Quality Inspection': {'fields':['item_serial_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales and Pruchase Return Wizard': {'return_details':['serial_no']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'entries':['serial_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Stock Entry': {'mtn_details':['serial_no']},
|
|
|
|
'Stock Ledger Entry': {'fields':['serial_no']}
|
|
|
|
},
|
2012-06-07 13:39:17 +00:00
|
|
|
'fs_item_barcode': {
|
|
|
|
'Item': {'fields': ['barcode']},
|
|
|
|
'Delivery Note': {'delivery_note_details': ['barcode']},
|
|
|
|
'Sales Invoice': {'entries': ['barcode']}
|
|
|
|
},
|
2012-01-24 09:03:21 +00:00
|
|
|
'fs_item_group_in_details': {
|
|
|
|
'Delivery Note': {'delivery_note_details':['item_group']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Opportunity': {'enquiry_details':['item_group']},
|
2013-02-18 08:19:15 +00:00
|
|
|
'Material Request': {'indent_details':['item_group']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Item': {'fields':['item_group']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Global Defaults': {'fields':['default_item_group']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Purchase Order': {'po_details':['item_group']},
|
|
|
|
'Purchase Receipt': {'purchase_receipt_details':['item_group']},
|
|
|
|
'Purchase Voucher': {'entries':['item_group']},
|
|
|
|
'Quotation': {'quotation_details':['item_group']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'entries':['item_group']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales BOM': {'fields':['serial_no']},
|
|
|
|
'Sales Order': {'sales_order_details':['item_group']},
|
|
|
|
'Serial No': {'fields':['item_group']},
|
|
|
|
'Sales Partner': {'partner_target_details':['item_group']},
|
|
|
|
'Sales Person': {'target_details':['item_group']},
|
|
|
|
'Territory': {'target_details':['item_group']}
|
|
|
|
},
|
|
|
|
'fs_page_break': {
|
|
|
|
'Delivery Note': {'delivery_note_details':['page_break'],'packing_details':['page_break']},
|
2013-02-18 08:19:15 +00:00
|
|
|
'Material Request': {'indent_details':['page_break']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Purchase Order': {'po_details':['page_break']},
|
|
|
|
'Purchase Receipt': {'purchase_receipt_details':['page_break']},
|
|
|
|
'Purchase Voucher': {'entries':['page_break']},
|
|
|
|
'Quotation': {'quotation_details':['page_break']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'entries':['page_break']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales Order': {'sales_order_details':['page_break']}
|
|
|
|
},
|
|
|
|
'fs_exports': {
|
2013-08-01 11:51:53 +00:00
|
|
|
'Delivery Note': {'fields':['conversion_rate','currency','grand_total','in_words','rounded_total'],'delivery_note_details':['base_ref_rate','amount','basic_rate']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'POS Setting': {'fields':['conversion_rate','currency']},
|
2013-08-01 11:51:53 +00:00
|
|
|
'Quotation': {'fields':['conversion_rate','currency','grand_total','in_words','rounded_total'],'quotation_details':['base_ref_rate','amount','basic_rate']},
|
|
|
|
'Sales Invoice': {'fields':['conversion_rate','currency','grand_total','in_words','rounded_total'],'entries':['base_ref_rate','amount','basic_rate']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales BOM': {'fields':['currency']},
|
2013-08-01 11:51:53 +00:00
|
|
|
'Sales Order': {'fields':['conversion_rate','currency','grand_total','in_words','rounded_total'],'sales_order_details':['base_ref_rate','amount','basic_rate']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
2013-01-28 11:26:07 +00:00
|
|
|
|
2012-01-24 09:03:21 +00:00
|
|
|
'fs_imports': {
|
2013-01-28 11:26:07 +00:00
|
|
|
'Purchase Invoice': {
|
|
|
|
'fields': ['conversion_rate', 'currency', 'grand_total',
|
|
|
|
'in_words', 'net_total', 'other_charges_added',
|
|
|
|
'other_charges_deducted'],
|
|
|
|
'entries': ['purchase_ref_rate', 'amount','rate']
|
|
|
|
},
|
|
|
|
'Purchase Order': {
|
2013-07-18 09:41:29 +00:00
|
|
|
'fields': ['conversion_rate','currency', 'grand_total',
|
2013-01-28 11:26:07 +00:00
|
|
|
'in_words', 'net_total', 'other_charges_added',
|
|
|
|
'other_charges_deducted'],
|
|
|
|
'po_details': ['purchase_ref_rate', 'amount','purchase_rate']
|
|
|
|
},
|
|
|
|
'Purchase Receipt': {
|
|
|
|
'fields': ['conversion_rate', 'currency','grand_total', 'in_words',
|
|
|
|
'net_total', 'other_charges_added', 'other_charges_deducted'],
|
|
|
|
'purchase_receipt_details': ['purchase_ref_rate','amount','purchase_rate']
|
|
|
|
},
|
|
|
|
'Supplier Quotation': {
|
|
|
|
'fields':['conversion_rate','currency']
|
|
|
|
}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
2013-01-28 11:26:07 +00:00
|
|
|
|
2012-01-24 09:03:21 +00:00
|
|
|
'fs_item_advanced': {
|
|
|
|
'Item': {'fields':['item_customer_details']}
|
|
|
|
},
|
|
|
|
'fs_sales_extras': {
|
|
|
|
'Address': {'fields':['sales_partner']},
|
|
|
|
'Contact': {'fields':['sales_partner']},
|
|
|
|
'Customer': {'fields':['sales_team']},
|
2013-03-14 04:39:13 +00:00
|
|
|
'Delivery Note': {'fields':['sales_team','packing_list']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Item': {'fields':['item_customer_details']},
|
2013-03-14 04:39:13 +00:00
|
|
|
'Sales Invoice': {'fields':['sales_team', 'packing_list']},
|
|
|
|
'Sales Order': {'fields':['sales_team','packing_list']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_more_info': {
|
2013-03-14 04:37:59 +00:00
|
|
|
"Customer Issue": {"fields": ["more_info"]},
|
|
|
|
'Material Request': {'fields':['more_info']},
|
|
|
|
'Lead': {'fields':['more_info']},
|
|
|
|
'Opportunity': {'fields':['more_info']},
|
|
|
|
'Purchase Invoice': {'fields':['more_info']},
|
|
|
|
'Purchase Order': {'fields':['more_info']},
|
|
|
|
'Purchase Receipt': {'fields':['more_info']},
|
|
|
|
'Supplier Quotation': {'fields':['more_info']},
|
|
|
|
'Quotation': {'fields':['more_info']},
|
|
|
|
'Sales Invoice': {'fields':['more_info']},
|
|
|
|
'Sales Order': {'fields':['more_info']},
|
|
|
|
'Delivery Note': {'fields':['more_info']},
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_quality': {
|
2013-07-18 09:34:29 +00:00
|
|
|
'Item': {'fields':['inspection_criteria','inspection_required']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Purchase Receipt': {'purchase_receipt_details':['qa_no']}
|
|
|
|
},
|
|
|
|
'fs_manufacturing': {
|
2013-07-18 09:34:29 +00:00
|
|
|
'Item': {'fields':['manufacturing']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_pos': {
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'fields':['is_pos']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_recurring_invoice': {
|
2013-07-18 09:34:29 +00:00
|
|
|
'Sales Invoice': {'fields': ['recurring_invoice']}
|
2012-01-24 09:03:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).bind('form_refresh', function() {
|
2013-07-18 09:34:29 +00:00
|
|
|
for(var sys_feat in sys_defaults) {
|
2013-03-14 04:37:59 +00:00
|
|
|
if(sys_defaults[sys_feat]=='0'
|
|
|
|
&& (sys_feat in pscript.feature_dict)) { //"Features to hide" exists
|
|
|
|
|
2013-07-18 09:34:29 +00:00
|
|
|
if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat]) {
|
|
|
|
for(var fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype]) {
|
2013-03-14 04:37:59 +00:00
|
|
|
if(fort=='fields') {
|
2012-01-24 09:03:21 +00:00
|
|
|
hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
|
2013-03-14 04:37:59 +00:00
|
|
|
} else if(cur_frm.fields_dict[fort]) {
|
2013-07-25 13:23:22 +00:00
|
|
|
cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort], false);
|
2013-03-14 04:37:59 +00:00
|
|
|
} else {
|
2013-10-07 21:56:56 +00:00
|
|
|
msgprint(wn._('Grid "')+fort+wn._('" does not exists'));
|
2013-03-14 04:37:59 +00:00
|
|
|
}
|
2012-01-24 09:03:21 +00:00
|
|
|
}
|
|
|
|
}
|
2013-03-14 04:37:59 +00:00
|
|
|
|
2012-01-24 09:03:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|