fixed codacy

This commit is contained in:
Pranav Nachanekar 2019-09-10 11:52:55 +05:30
parent 4ac25f28a3
commit 5c211d8abf
3 changed files with 13 additions and 11 deletions

View File

@ -6,6 +6,7 @@
"engine": "InnoDB",
"field_order": [
"scheduled_time",
"status",
"customer_details_section",
"customer_name",
"customer_phone_number",
@ -48,9 +49,16 @@
"in_list_view": 1,
"label": "Scheduled Time",
"reqd": 1
},
{
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"options": "Open\nClosed",
"reqd": 1
}
],
"modified": "2019-09-09 15:40:21.881421",
"modified": "2019-09-10 11:17:20.200603",
"modified_by": "Administrator",
"module": "CRM",
"name": "Appointment",

View File

@ -1,18 +1,13 @@
// frappe.ui.form.on('Availability Of Slots', 'from_time', check_time)
// frappe.ui.form.on('Availability Of Slots', 'to_time', check_time)
frappe.ui.form.on('Appointment Booking Settings', 'validate',check_times)
frappe.ui.form.on('Appointment Booking Settings', 'validate',check_times);
function check_times(frm) {
$.each(frm.doc.availability_of_slots || [], function (i, d) {
let from_time = Date.parse('01/01/2019 ' + d.from_time);
console.log(from_time);
let to_time = Date.parse('01/01/2019 ' + d.to_time);
if (from_time > to_time) {
frappe.throw(__(`In row ${i + 1} of Availability Of Slots : "To Time" must be later than "From Time"`))
frappe.throw(__(`In row ${i + 1} of Availability Of Slots : "To Time" must be later than "From Time"`));
}
})
}
// function check_times(frm, cdt, cdn) {
// let d = locals[cdt][cdn];
//
// }
});
}

File diff suppressed because one or more lines are too long