WIP Payroll.

This commit is contained in:
Patrick Fic
2023-07-21 10:04:44 -07:00
parent 756d97a9cb
commit 8dfcda6c5e
7 changed files with 43 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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 (