WIP Payroll.
This commit is contained in:
@@ -82,7 +82,6 @@ exports.claimtask = async function (req, res) {
|
||||
completed_tasks: [...job.completed_tasks, task],
|
||||
},
|
||||
});
|
||||
console.log("🚀 ~ file: claim-task.js:85 ~ updateResult:", updateResult)
|
||||
}
|
||||
res.json(ticketsToInsert);
|
||||
} catch (error) {
|
||||
|
||||
@@ -83,6 +83,22 @@ exports.payall = async function (req, res) {
|
||||
});
|
||||
}
|
||||
} else if (diff.op === "update") {
|
||||
//An old ticket amount isn't sufficient
|
||||
//We can't modify the existing ticket, it might already be committed. So let's add a new one instead.
|
||||
ticketsToInsert.push({
|
||||
jobid: job.id,
|
||||
bodyshopid: job.bodyshop.id,
|
||||
employeeid: path.employeeid,
|
||||
productivehrs: diff.val - diff.oldVal,
|
||||
rate: path.rate,
|
||||
ciecacode: path.mod_lbr_ty,
|
||||
flat_rate: true,
|
||||
cost_center:
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs[
|
||||
path.mod_lbr_ty
|
||||
],
|
||||
memo: "*System* Hours adjustment during Pay All function. (Update)",
|
||||
});
|
||||
} else {
|
||||
//Has to be a delete
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user