fixes in Time Log Batch
This commit is contained in:
parent
086c0463be
commit
832dfe7980
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
// render
|
// render
|
||||||
frappe.listview_settings['Time Log'] = {
|
frappe.listview_settings['Time Log'] = {
|
||||||
add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "for_manufacturing"],
|
add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "for_manufacturing", "billing_amount"],
|
||||||
selectable: true,
|
selectable: true,
|
||||||
onload: function(me) {
|
onload: function(me) {
|
||||||
me.page.add_menu_item(__("Make Time Log Batch"), function() {
|
me.page.add_menu_item(__("Make Time Log Batch"), function() {
|
||||||
@ -37,7 +37,7 @@ frappe.listview_settings['Time Log'] = {
|
|||||||
$.extend(detail, {
|
$.extend(detail, {
|
||||||
"time_log": d.name,
|
"time_log": d.name,
|
||||||
"activity_type": d.activity_type,
|
"activity_type": d.activity_type,
|
||||||
"created_by": d.owner,
|
"billing_amount": d.billing_amount,
|
||||||
"hours": d.hours
|
"hours": d.hours
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
@ -36,3 +36,15 @@ $.extend(cur_frm.cscript, {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frappe.ui.form.on("Time Log Batch Detail", "time_log", function(frm, cdt, cdn) {
|
||||||
|
var tl = frm.doc.time_logs || [];
|
||||||
|
total_hr = 0;
|
||||||
|
total_amt = 0;
|
||||||
|
for(var i=0; i<tl.length; i++) {
|
||||||
|
total_hr += tl[i].hours;
|
||||||
|
total_amt += tl[i].billing_amount;
|
||||||
|
}
|
||||||
|
cur_frm.set_value("total_hours", total_hr);
|
||||||
|
cur_frm.set_value("total_billing_amount", total_amt);
|
||||||
|
});
|
@ -26,7 +26,7 @@ class TimeLogBatch(Document):
|
|||||||
d.update({
|
d.update({
|
||||||
"hours": tl.hours,
|
"hours": tl.hours,
|
||||||
"activity_type": tl.activity_type,
|
"activity_type": tl.activity_type,
|
||||||
"created_by": tl.owner
|
"billing_amount": tl.billing_amount
|
||||||
})
|
})
|
||||||
|
|
||||||
def validate_time_log_is_submitted(self, tl):
|
def validate_time_log_is_submitted(self, tl):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user