fixes in Time Log Batch
diff --git a/erpnext/projects/doctype/time_log/time_log_list.js b/erpnext/projects/doctype/time_log/time_log_list.js
index d444806..a2eb05c 100644
--- a/erpnext/projects/doctype/time_log/time_log_list.js
+++ b/erpnext/projects/doctype/time_log/time_log_list.js
@@ -3,7 +3,7 @@
// render
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,
onload: function(me) {
me.page.add_menu_item(__("Make Time Log Batch"), function() {
@@ -37,7 +37,7 @@
$.extend(detail, {
"time_log": d.name,
"activity_type": d.activity_type,
- "created_by": d.owner,
+ "billing_amount": d.billing_amount,
"hours": d.hours
});
})
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.js b/erpnext/projects/doctype/time_log_batch/time_log_batch.js
index 39141ed..6b5f080 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch.js
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.js
@@ -36,3 +36,15 @@
});
}
});
+
+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);
+});
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py
index 9ea3256..eaccc8c 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py
@@ -26,7 +26,7 @@
d.update({
"hours": tl.hours,
"activity_type": tl.activity_type,
- "created_by": tl.owner
+ "billing_amount": tl.billing_amount
})
def validate_time_log_is_submitted(self, tl):