diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 4cd66f532f..5609fcecac 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -503,9 +503,23 @@ frappe.ui.form.on('Sales Invoice Timesheet', { frappe.model.set_value(cdt, cdn, "billing_hours", data.billing_hours); frappe.model.set_value(cdt, cdn, "billing_amount", data.billing_amount); frappe.model.set_value(cdt, cdn, "timesheet_detail", data.timesheet_detail); + calculate_total_billing_amount(frm) } } }) } } }) + +var calculate_total_billing_amount = function(frm) { + var doc = frm.doc; + + doc.total_billing_amount = 0.0 + if(doc.timesheets) { + $.each(doc.timesheets, function(index, data){ + doc.total_billing_amount += data.billing_amount + }) + } + + refresh_field('total_billing_amount') +} diff --git a/erpnext/projects/doctype/timesheet/timesheet.json b/erpnext/projects/doctype/timesheet/timesheet.json index 160e3b7fe4..5d9fe94601 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.json +++ b/erpnext/projects/doctype/timesheet/timesheet.json @@ -6,7 +6,7 @@ "beta": 0, "creation": "2013-02-28 17:57:33", "custom": 0, - "description": "Batch Time Logs for Billing.", + "description": "", "docstatus": 0, "doctype": "DocType", "document_type": "Document", @@ -213,7 +213,7 @@ "collapsible": 0, "columns": 0, "depends_on": "", - "description": "List of employee which has \"Salary Slip Based on Timesheet\" is enabled in salary structure.", + "description": "", "fieldname": "employee", "fieldtype": "Link", "hidden": 0, @@ -847,7 +847,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-11-04 18:27:08.484033", + "modified": "2016-11-23 17:35:51.194690", "modified_by": "Administrator", "module": "Projects", "name": "Timesheet",