fix: codacy
This commit is contained in:
parent
785f98efd9
commit
aa0eaab3df
@ -33,7 +33,7 @@ frappe.ui.form.on("Issue", {
|
||||
frm.call('change_sla_priority', {
|
||||
"priority": frm.doc.priority
|
||||
}).then(() => {
|
||||
frm.refresh()
|
||||
frm.refresh();
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -116,6 +116,5 @@ function get_time_left(timestamp) {
|
||||
if (diff_display == '00:00') {
|
||||
indicator = "red";
|
||||
}
|
||||
return {"diff_display": diff_display,
|
||||
"indicator": indicator};
|
||||
return {"diff_display": diff_display, "indicator": indicator};
|
||||
}
|
||||
|
@ -11,11 +11,16 @@ frappe.ui.form.on('Service Level Agreement', {
|
||||
name: frm.doc.service_level
|
||||
},
|
||||
callback: function(data){
|
||||
for (var i in data.message.priorities){
|
||||
frm.add_child("priorities", data.message.priorities[i]);
|
||||
}
|
||||
for (var i in data.message.support_and_resolution){
|
||||
frm.add_child("support_and_resolution", data.message.support_and_resolution[i]);
|
||||
let count = Math.max(data.message.priorities.length, data.message.support_and_resolution.length);
|
||||
let i = 0;
|
||||
while (i < count){
|
||||
if (data.message.priorities[i]) {
|
||||
frm.add_child("priorities", data.message.priorities[i]);
|
||||
}
|
||||
if (data.message.support_and_resolution[i]) {
|
||||
frm.add_child("support_and_resolution", data.message.support_and_resolution[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
frm.refresh();
|
||||
}
|
||||
|
@ -41,21 +41,23 @@ def check_agreement_status():
|
||||
@frappe.whitelist()
|
||||
def get_active_service_level_agreement_for(customer, priority):
|
||||
|
||||
agreement = frappe.db.sql("""
|
||||
select `tabService Level Agreement`.name, `tabService Level Agreement`.service_level,
|
||||
`tabService Level Agreement`.holiday_list
|
||||
from `tabService Level Agreement`
|
||||
inner join `tabService Level Priority`
|
||||
on `tabService Level Agreement`.name=`tabService Level Priority`.parent where
|
||||
(
|
||||
`tabService Level Agreement`.customer='{0}' and
|
||||
`tabService Level Agreement`.agreement_status='Active' and
|
||||
`tabService Level Priority`.priority='{1}'
|
||||
) or
|
||||
(
|
||||
`tabService Level Agreement`.default_service_level_agreement='1'
|
||||
)
|
||||
limit 1
|
||||
""".format(customer, priority), as_dict=True)
|
||||
agreement = frappe.db.sql("""select `tabService Level Agreement`.name, `tabService Level Agreement`.service_level,
|
||||
`tabService Level Agreement`.holiday_list
|
||||
from `tabService Level Agreement`
|
||||
inner join `tabService Level Priority`
|
||||
on `tabService Level Agreement`.name=`tabService Level Priority`.parent where
|
||||
(
|
||||
`tabService Level Agreement`.customer='%(customer)s' and
|
||||
`tabService Level Agreement`.agreement_status='Active' and
|
||||
`tabService Level Priority`.priority='%(priority)s'
|
||||
) or
|
||||
(
|
||||
`tabService Level Agreement`.default_service_level_agreement='1'
|
||||
)
|
||||
limit 1""",
|
||||
{
|
||||
"customer": customer,
|
||||
"priority": priority
|
||||
}, as_dict=True)
|
||||
|
||||
return agreement[0] if agreement else None
|
Loading…
x
Reference in New Issue
Block a user