Add claimed task name to tickets.

This commit is contained in:
Patrick Fic
2023-07-28 08:22:38 -07:00
parent ab2cf8c8c7
commit fe16329443
10 changed files with 126 additions and 22 deletions

View File

@@ -53,6 +53,7 @@ exports.payall = async function (req, res) {
console.log("Hours", diff.val[key][Object.keys(diff.val[key])[0]]);
console.log("Rate", Object.keys(diff.val[key])[0]);
ticketsToInsert.push({
task_name: "Pay All",
jobid: job.id,
bodyshopid: job.bodyshop.id,
employeeid: path.employeeid,
@@ -68,6 +69,7 @@ exports.payall = async function (req, res) {
} else {
//Only the 1 value to add.
ticketsToInsert.push({
task_name: "Pay All",
jobid: job.id,
bodyshopid: job.bodyshop.id,
employeeid: path.employeeid,
@@ -86,6 +88,7 @@ exports.payall = async function (req, res) {
//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({
task_name: "Pay All",
jobid: job.id,
bodyshopid: job.bodyshop.id,
employeeid: path.employeeid,
@@ -107,12 +110,8 @@ exports.payall = async function (req, res) {
) {
//Multiple oldValues to add.
Object.keys(diff.oldVal).forEach((key) => {
console.log(
"Hours",
diff.oldVal[key][Object.keys(diff.oldVal[key])[0]]
);
console.log("Rate", Object.keys(diff.oldVal[key])[0]);
ticketsToInsert.push({
task_name: "Pay All",
jobid: job.id,
bodyshopid: job.bodyshop.id,
employeeid: path.employeeid,
@@ -129,6 +128,7 @@ exports.payall = async function (req, res) {
} else {
//Only the 1 value to add.
ticketsToInsert.push({
task_name: "Pay All",
jobid: job.id,
bodyshopid: job.bodyshop.id,
employeeid: path.employeeid,