Lint and fix JS files

This commit is contained in:
Faris Ansari
2017-05-30 12:54:42 +05:30
parent dae7721384
commit ab74ca7fff
138 changed files with 1280 additions and 1268 deletions

View File

@@ -71,7 +71,7 @@ erpnext.maintenance.MaintenanceSchedule = frappe.ui.form.Controller.extend({
if (item.start_date && item.end_date && item.periodicity) {
if(item.start_date > item.end_date) {
msgprint(__("Row {0}:Start Date must be before End Date", [item.idx]));
frappe.msgprint(__("Row {0}:Start Date must be before End Date", [item.idx]));
return;
}
@@ -97,7 +97,7 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
if(!doc.status) set_multiple(dt,dn,{status:'Draft'});
if(doc.__islocal){
set_multiple(dt,dn,{transaction_date:get_today()});
set_multiple(dt,dn,{transaction_date: frappe.datetime.get_today()});
}
// set add fetch for item_code's item_name and description
@@ -108,12 +108,12 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) {
if (!doc.__islocal) {
return $c('runserverobj', args={'method':'generate_schedule', 'docs':doc},
return $c('runserverobj', {'method':'generate_schedule', 'docs':doc},
function(r, rt) {
refresh_field('schedules');
});
} else {
msgprint(__("Please save the document before generating maintenance schedule"));
frappe.msgprint(__("Please save the document before generating maintenance schedule"));
}
}

View File

@@ -2,8 +2,6 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.maintenance");
me.frm.set_query('contact_person', erpnext.queries.contact_query);
frappe.ui.form.on('Maintenance Visit', {
setup: function(frm) {
@@ -85,7 +83,7 @@ $.extend(cur_frm.cscript, new erpnext.maintenance.MaintenanceVisit({frm: cur_frm
cur_frm.cscript.onload = function(doc, dt, dn) {
if(!doc.status) set_multiple(dt,dn,{status:'Draft'});
if(doc.__islocal) set_multiple(dt,dn,{mntc_date:get_today()});
if(doc.__islocal) set_multiple(dt,dn,{mntc_date: frappe.datetime.get_today()});
// set add fetch for item_code's item_name and description
cur_frm.add_fetch('item_code', 'item_name', 'item_name');