IO-1316 Add flat_rate to time tickets & resolve issues in job costing calculations.

This commit is contained in:
Patrick Fic
2021-08-18 15:39:37 -07:00
parent 86bee9ad0d
commit a269fd3ad8
19 changed files with 311 additions and 3 deletions

View File

@@ -791,6 +791,7 @@ exports.QUERY_JOB_COSTING_DETAILS = ` query QUERY_JOB_COSTING_DETAILS($id: uuid!
cost_center
actualhrs
productivehrs
flat_rate
}
bodyshop{
id
@@ -893,6 +894,7 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT
cost_center
actualhrs
productivehrs
flat_rate
}
bodyshop {
id

View File

@@ -446,7 +446,11 @@ function GenerateCostingData(job) {
].add(
Dinero({
amount: Math.round((ticket_val.rate || 0) * 100),
}).multiply(ticket_val.actualhrs || ticket_val.productivehrs || 0)
}).multiply(
ticket_val.flat_rate
? ticket_val.productivehrs || ticket_val.actualhrs || 0
: ticket_val.actualhrs || ticket_val.productivehrs || 0
) //Should base this on the employee.
);
return ticket_acc;