IO-2520 Kaizen Data Pump
Add in Repair Line Details, Time Ticket Details, Void Date Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
@@ -211,6 +211,8 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
||||
}
|
||||
|
||||
const repairCosts = CreateCosts(job);
|
||||
const jobline = CreateJobLines(job.joblines);
|
||||
const timeticket = CreateTimeTickets(job.timetickets);
|
||||
|
||||
try {
|
||||
const ret = {
|
||||
@@ -276,8 +278,11 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
||||
DateInvoiced:
|
||||
(job.date_invoiced && moment(job.date_invoiced).tz(job.bodyshop.timezone).format(DateFormat)) || "",
|
||||
DateExported:
|
||||
(job.date_exported && moment(job.date_exported).tz(job.bodyshop.timezone).format(DateFormat)) || ""
|
||||
(job.date_exported && moment(job.date_exported).tz(job.bodyshop.timezone).format(DateFormat)) || "",
|
||||
DateVoid: (job.date_void && moment(job.date_void).tz(job.bodyshop.timezone).format(DateFormat)) || ""
|
||||
},
|
||||
JobLineDetails: { jobline },
|
||||
TimeTicketDetails: { timeticket },
|
||||
Sales: {
|
||||
Labour: {
|
||||
Aluminum: Dinero(job.job_totals.rates.laa.total).toFormat(DineroFormat),
|
||||
@@ -625,3 +630,38 @@ const CreateCosts = (job) => {
|
||||
}, 0)
|
||||
};
|
||||
};
|
||||
|
||||
const CreateJobLines = (joblines) => {
|
||||
const repairLines = [];
|
||||
joblines.forEach((jobline) => {
|
||||
repairLines.push({
|
||||
line_description: jobline.line_desc,
|
||||
oem_part_no: jobline.oem_partno,
|
||||
alt_part_no: jobline.alt_partno,
|
||||
op_code_desc: jobline.op_code_desc,
|
||||
part_type: jobline.part_type,
|
||||
part_qty: jobline.part_qty,
|
||||
part_price: jobline.act_price,
|
||||
labor_type: jobline.mod_lbr_ty,
|
||||
labor_hours: jobline.mod_lb_hrs
|
||||
});
|
||||
});
|
||||
return repairLines;
|
||||
};
|
||||
|
||||
const CreateTimeTickets = (timetickets) => {
|
||||
const timeTickets = [];
|
||||
timetickets.forEach((ticket) => {
|
||||
timeTickets.push({
|
||||
date: ticket.date,
|
||||
employee: ticket.employee.employee_number
|
||||
.trim()
|
||||
.concat(" - ", ticket.employee.first_name.trim(), " ", ticket.employee.last_name.trim())
|
||||
.trim(),
|
||||
productive_hrs: ticket.productivehrs,
|
||||
actual_hrs: ticket.actualhrs,
|
||||
cost_center: ticket.cost_center
|
||||
});
|
||||
});
|
||||
return timeTickets;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user