mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-03 08:32:24 +00:00
minor changes
This commit is contained in:
@@ -156,9 +156,12 @@ var calculate_time_and_amount = function(frm) {
|
||||
for(var i=0; i<tl.length; i++) {
|
||||
if (tl[i].hours) {
|
||||
total_working_hr += tl[i].hours;
|
||||
total_billing_hr += tl[i].billing_hours;
|
||||
total_billing_amount += tl[i].billing_amount;
|
||||
total_costing_amount += tl[i].costing_amount;
|
||||
|
||||
if(tl[i].billable){
|
||||
total_billing_hr += tl[i].billing_hours;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -246,12 +246,12 @@ class Timesheet(Document):
|
||||
|
||||
def update_cost(self):
|
||||
for data in self.time_logs:
|
||||
if data.activity_type and (not data.billing_amount or not data.costing_amount):
|
||||
if data.activity_type and data.billable:
|
||||
rate = get_activity_cost(self.employee, data.activity_type)
|
||||
hours = data.billing_hours or 0
|
||||
if rate:
|
||||
data.billing_rate = flt(rate.get('billing_rate'))
|
||||
data.costing_rate = flt(rate.get('costing_rate'))
|
||||
data.billing_rate = flt(rate.get('billing_rate')) if flt(data.billing_rate) == 0 else data.billing_rate
|
||||
data.costing_rate = flt(rate.get('costing_rate')) if flt(data.costing_rate) == 0 else data.costing_rate
|
||||
data.billing_amount = data.billing_rate * hours
|
||||
data.costing_amount = data.costing_rate * hours
|
||||
|
||||
@@ -262,7 +262,7 @@ def get_projectwise_timesheet_data(project, parent=None):
|
||||
cond = "and parent = %(parent)s"
|
||||
|
||||
return frappe.db.sql("""select name, parent, billing_hours, billing_amount as billing_amt
|
||||
from `tabTimesheet Detail` where docstatus=1 and project = %(project)s {0}
|
||||
from `tabTimesheet Detail` where docstatus=1 and project = %(project)s {0} and billable = 1
|
||||
and sales_invoice is null""".format(cond), {'project': project, 'parent': parent}, as_dict=1)
|
||||
|
||||
@frappe.whitelist()
|
||||
|
||||
Reference in New Issue
Block a user