Merge pull request #7051 from rohitwaghchaure/v7_timesheet_cleanup

cleanup timesheet and fix sales invoice total timesheet billing amount
This commit is contained in:
Nabin Hait 2016-11-24 13:06:04 +05:30 committed by GitHub
commit 1e3d14fda7
2 changed files with 17 additions and 3 deletions

View File

@ -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_hours", data.billing_hours);
frappe.model.set_value(cdt, cdn, "billing_amount", data.billing_amount); frappe.model.set_value(cdt, cdn, "billing_amount", data.billing_amount);
frappe.model.set_value(cdt, cdn, "timesheet_detail", data.timesheet_detail); 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')
}

View File

@ -6,7 +6,7 @@
"beta": 0, "beta": 0,
"creation": "2013-02-28 17:57:33", "creation": "2013-02-28 17:57:33",
"custom": 0, "custom": 0,
"description": "Batch Time Logs for Billing.", "description": "",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Document", "document_type": "Document",
@ -213,7 +213,7 @@
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"depends_on": "", "depends_on": "",
"description": "List of employee which has \"Salary Slip Based on Timesheet\" is enabled in salary structure.", "description": "",
"fieldname": "employee", "fieldname": "employee",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -847,7 +847,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"modified": "2016-11-04 18:27:08.484033", "modified": "2016-11-23 17:35:51.194690",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Projects", "module": "Projects",
"name": "Timesheet", "name": "Timesheet",