diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
index 99bd24c6b8..bdb4e41e6b 100644
--- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
+++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
@@ -17,8 +17,8 @@
cur_frm.cscript.tname = "PV Detail";
cur_frm.cscript.fname = "entries";
cur_frm.cscript.other_fname = "purchase_tax_details";
-$import(Purchase Other Charges)
-$import(Purchase Common)
+wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
+wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
// On Load
// --------
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
index 391bbcd8ae..9747a2be30 100644
--- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
+++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
@@ -22,9 +22,10 @@ cur_frm.cscript.sales_team_fname = "sales_team";
// print heading
cur_frm.pformat.print_heading = 'Invoice';
-$import(Sales Common)
-$import(Other Charges)
-$import(SMS Control)
+wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
+wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
// On Load
// -------
@@ -476,7 +477,6 @@ cur_frm.cscript.convert_into_recurring_invoice = function(doc) {
}
}
-$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Sales Invoice',
diff --git a/erpnext/buying/doctype/indent/indent.js b/erpnext/buying/doctype/indent/indent.js
index 570e06c1b8..1940e5a606 100644
--- a/erpnext/buying/doctype/indent/indent.js
+++ b/erpnext/buying/doctype/indent/indent.js
@@ -17,8 +17,8 @@
cur_frm.cscript.tname = "Indent Detail";
cur_frm.cscript.fname = "indent_details";
-$import(Purchase Common)
-$import(SMS Control)
+wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
cur_frm.cscript.indent_doctype_label = get_doctype_label('Indent');
//========================== On Load =================================================
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index 9a414a364a..d15d5ceb94 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -71,9 +71,9 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) {
var set_dynamic_label_par = function(doc, cdt, cdn, base_curr) {
//parent flds
par_cols_base = {'net_total': 'Net Total', 'total_tax': 'Total Tax', 'grand_total': 'Grand Total', /*'rounded_total': 'Rounded Total',*/
- 'in_words': 'In Words', 'other_charges_added': 'Other Charges Added', 'other_charges_deducted': 'Other Charges Deducted'}
+ 'in_words': 'In Words', 'other_charges_added': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Added', 'other_charges_deducted': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Deducted'}
par_cols_import = {'net_total_import': 'Net Total', 'grand_total_import': 'Grand Total', 'in_words_import': 'In Words',
- 'other_charges_added_import': 'Other Charges Added', 'other_charges_deducted_import': 'Other Charges Deducted'};
+ 'other_charges_added_import': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Added', 'other_charges_deducted_import': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Deducted'};
for (d in par_cols_base) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_base[d]+' (' + base_curr + ')';
for (d in par_cols_import) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_import[d]+' (' + doc.currency + ')';
@@ -430,7 +430,7 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname)
// ------------------
- cur_frm.fields_dict['Tax Calculation'].disp_area.innerHTML = 'Calculation Details for Other Charges and Landed cost:';
+ cur_frm.fields_dict['Tax Calculation'].disp_area.innerHTML = 'Calculation Details for wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); and Landed cost:';
var cl = getchildren(tname, doc.name, fname);
var tax = getchildren('Purchase Tax Detail', doc.name, other_fname,doc.doctype);
// make display table
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 7af1204fa4..3588a525c3 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -17,9 +17,11 @@
cur_frm.cscript.tname = "PO Detail";
cur_frm.cscript.fname = "po_details";
cur_frm.cscript.other_fname = "purchase_tax_details";
-$import(Purchase Common)
-$import(Purchase Other Charges)
-$import(SMS Control)
+
+wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
+wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
//========================== On Load =================================================
cur_frm.cscript.onload = function(doc, cdt, cdn) {
@@ -270,7 +272,6 @@ cur_frm.pformat.indent_no = function(doc, cdt, cdn){
return out;
}
-$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Purchase Order',
diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js
index 41889af04f..a348848a86 100644
--- a/erpnext/buying/doctype/supplier/supplier.js
+++ b/erpnext/buying/doctype/supplier/supplier.js
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-$import(Contact Control)
+wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
cur_frm.cscript.onload = function(doc,dt,dn){
diff --git a/erpnext/hr/doctype/expense_voucher/expense_voucher.js b/erpnext/hr/doctype/expense_voucher/expense_voucher.js
index 2e03567751..2363dbd696 100644
--- a/erpnext/hr/doctype/expense_voucher/expense_voucher.js
+++ b/erpnext/hr/doctype/expense_voucher/expense_voucher.js
@@ -100,7 +100,7 @@ cur_frm.cscript.sanctioned_amount = function(doc,cdt,cdn){
cur_frm.cscript.calculate_total(doc,cdt,cdn);
}
-$import(Notification Control);
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
cur_frm.cscript['Approve'] = function(doc,cdt,cdn){
@@ -244,7 +244,6 @@ cur_frm.cscript['Update Voucher'] = function(doc){
});
}
-$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Expense Voucher',
diff --git a/erpnext/knowledge_base/page/question_view/question_view.js b/erpnext/knowledge_base/page/question_view/question_view.js
index 578347188e..6d17713918 100644
--- a/erpnext/knowledge_base/page/question_view/question_view.js
+++ b/erpnext/knowledge_base/page/question_view/question_view.js
@@ -185,4 +185,4 @@ KBAnswer = function(body, data, ans_list) {
}
-$import(knowledge_base/page/kb_common/kb_common.js);
\ No newline at end of file
+wn.require('erpnext/knowledge_base/page/kb_common/kb_common.js');
\ No newline at end of file
diff --git a/erpnext/knowledge_base/page/questions/questions.js b/erpnext/knowledge_base/page/questions/questions.js
index 7261cd88f9..cbea1c29db 100644
--- a/erpnext/knowledge_base/page/questions/questions.js
+++ b/erpnext/knowledge_base/page/questions/questions.js
@@ -215,4 +215,4 @@ KBQuestion = function(parent, det, kb) {
this.make()
}
-$import(knowledge_base/page/kb_common/kb_common.js);
\ No newline at end of file
+wn.require('erpnext/knowledge_base/page/kb_common/kb_common.js');
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index 89b95fa89e..b5909c3c2e 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-$import(Contact Control)
+wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
/* ********************************* onload ********************************************* */
diff --git a/erpnext/selling/doctype/enquiry/enquiry.js b/erpnext/selling/doctype/enquiry/enquiry.js
index c3f0a0bc6b..bf2628feaf 100644
--- a/erpnext/selling/doctype/enquiry/enquiry.js
+++ b/erpnext/selling/doctype/enquiry/enquiry.js
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-$import(SMS Control)
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
cur_frm.cscript.refresh = function(doc, cdt, cdn){
diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js
index 7255636a41..a32acf7df5 100644
--- a/erpnext/selling/doctype/lead/lead.js
+++ b/erpnext/selling/doctype/lead/lead.js
@@ -16,7 +16,7 @@
// Module CRM
-$import(SMS Control)
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(user =='Guest'){
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 7f40782d0c..c86c680510 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -21,9 +21,10 @@ cur_frm.cscript.other_fname = "other_charges";
cur_frm.cscript.sales_team_fname = "sales_team";
// =====================================================================================
-$import(Sales Common)
-$import(Other Charges)
-$import(SMS Control)
+wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
+wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
// ONLOAD
// ===================================================================================
@@ -326,7 +327,6 @@ cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query=
return repl("SELECT name, item_name, description FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' %(cond)s ORDER BY tabItem.item_code DESC LIMIT 50", {cond:cond});
}
-$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Quotation',
diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js
index cad8ec16f7..3b33a07ca2 100644
--- a/erpnext/selling/doctype/sales_common/sales_common.js
+++ b/erpnext/selling/doctype/sales_common/sales_common.js
@@ -18,7 +18,7 @@
// ------
// cur_frm.cscript.tname - Details table name
// cur_frm.cscript.fname - Details fieldname
-// cur_frm.cscript.other_fname - Other Charges fieldname
+// cur_frm.cscript.other_fname - wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); fieldname
// cur_frm.cscript.sales_team_fname - Sales Team fieldname
// ============== Load Default Taxes ===================
@@ -96,7 +96,7 @@ cur_frm.cscript.customer = function(doc, cdt, cdn) {
var set_dynamic_label_par = function(doc, cdt, cdn, base_curr) {
//parent flds
- par_cols_base = {'net_total': 'Net Total', 'other_charges_total': 'Other Charges Total',
+ par_cols_base = {'net_total': 'Net Total', 'other_charges_total': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Total',
'grand_total': 'Grand Total', 'rounded_total': 'Rounded Total', 'in_words': 'In Words'}
par_cols_export = {'grand_total_export': 'Grand Total', 'rounded_total_export': 'Rounded Total', 'in_words_export': 'In Words'};
@@ -339,7 +339,7 @@ cur_frm.cscript.export_rate = function(doc,cdt,cdn) {
// ************* GET OTHER CHARGES BASED ON COMPANY *************
cur_frm.fields_dict.charge.get_query = function(doc) {
- return 'SELECT DISTINCT `tabOther Charges`.name FROM `tabOther Charges` WHERE `tabOther Charges`.company = "'+doc.company+'" AND `tabOther Charges`.company is not NULL AND `tabOther Charges`.docstatus != 2 AND `tabOther Charges`.%(key)s LIKE "%s" ORDER BY `tabOther Charges`.name LIMIT 50';
+ return 'SELECT DISTINCT `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.name FROM `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');` WHERE `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.company = "'+doc.company+'" AND `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.company is not NULL AND `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.docstatus != 2 AND `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.%(key)s LIKE "%s" ORDER BY `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.name LIMIT 50';
}
// ********************* Get Charges ****************************
@@ -433,14 +433,14 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname)
doc = locals[doc.doctype][doc.name];
// Make Display Area
- cur_frm.fields_dict['Other Charges Calculation'].disp_area.innerHTML =
- 'Calculation Details for Other Charges:';
+ cur_frm.fields_dict['wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Calculation'].disp_area.innerHTML =
+ 'Calculation Details for wn.require('erpnext/setup/doctype/other_charges/other_charges.js');:';
var cl = getchildren(tname, doc.name, fname);
var tax = getchildren('RV Tax Detail', doc.name, other_fname,doc.doctype);
// Make display table
- var otc = make_table(cur_frm.fields_dict['Other Charges Calculation'].disp_area,
+ var otc = make_table(cur_frm.fields_dict['wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Calculation'].disp_area,
cl.length + 1, tax.length + 1, '90%', [], { border:'1px solid #AAA', padding:'2px' });
$y(otc,{marginTop:'8px'});
@@ -795,10 +795,10 @@ cur_frm.cscript.allocated_percentage = function(doc, cdt, cdn) {
// =================================================================================
cur_frm.cscript.validate = function(doc, cdt, cdn) {
cur_frm.cscript.validate_items(doc);
- var cl = getchildren('Other Charges', doc.name, 'other_charges');
+ var cl = getchildren('wn.require('erpnext/setup/doctype/other_charges/other_charges.js');', doc.name, 'other_charges');
for(var i =0;i\
- %(name)s\
- %(customer_name)s\
- \
+ %(name)s\
+ %(icon)s\
+ %(customer_name)s\
+ \
+ \
+ \
+ \
+ \
+ \
+ %(modified_date)s\
+ %(currency)s %(grand_total_export)s\
+ ', data)).addClass('list-row');
+ }
+}
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index a04423dd25..7d80607324 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -22,9 +22,10 @@ cur_frm.cscript.other_fname = "other_charges";
cur_frm.cscript.sales_team_fname = "sales_team";
-$import(Sales Common)
-$import(Other Charges)
-$import(SMS Control)
+wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
+wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
// ONLOAD
@@ -352,7 +353,6 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
}
-$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Sales Order',
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js
index 1194756412..588fc06c70 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.js
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.js
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-$import(Contact Control)
+wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
cur_frm.cscript.onload = function(doc,dt,dn){
// history doctypes and scripts
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 1f5170be96..13922cb8a5 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -20,9 +20,10 @@ cur_frm.cscript.fname = "delivery_note_details";
cur_frm.cscript.other_fname = "other_charges";
cur_frm.cscript.sales_team_fname = "sales_team";
-$import(Sales Common)
-$import(Other Charges)
-$import(SMS Control)
+wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
+wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
// ONLOAD
// ================================================================================================
@@ -322,7 +323,6 @@ cur_frm.pformat.sales_order_no= function(doc, cdt, cdn){
return out;
}
-$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Delivery Note',
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index 7ad9d91928..921eede2e9 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -18,9 +18,10 @@ cur_frm.cscript.tname = "Purchase Receipt Detail";
cur_frm.cscript.fname = "purchase_receipt_details";
cur_frm.cscript.other_fname = "purchase_tax_details";
-$import(Purchase Common)
-$import(Purchase Other Charges)
-$import(SMS Control)
+wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
+wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
//========================== On Load ================================================================
cur_frm.cscript.onload = function(doc, cdt, cdn) {
@@ -315,7 +316,6 @@ cur_frm.pformat.purchase_order_no = function(doc, cdt, cdn){
return out;
}
-$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Purchase Receipt',
diff --git a/js/all-app.js b/js/all-app.js
index a593e00323..cc3b99312c 100644
--- a/js/all-app.js
+++ b/js/all-app.js
@@ -2230,7 +2230,7 @@ if(user_roles.indexOf("System Manager")!=-1){$('.navbar .modules').append('