Compare commits
12 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8d8a4701e | ||
|
|
84bb25985b | ||
|
|
e38a58550f | ||
|
|
25ef4c6228 | ||
|
|
277fbeebc8 | ||
|
|
399df78957 | ||
|
|
294325343b | ||
|
|
ed17eec948 | ||
|
|
f87c95079c | ||
|
|
f81b21b933 | ||
|
|
a559b56983 | ||
|
|
6a9030b653 |
File diff suppressed because it is too large
Load Diff
@@ -647,7 +647,10 @@
|
|||||||
"payers": "Payers"
|
"payers": "Payers"
|
||||||
},
|
},
|
||||||
"cdk_dealerid": "CDK Dealer ID",
|
"cdk_dealerid": "CDK Dealer ID",
|
||||||
|
"costsmapping": "Costs Mapping",
|
||||||
|
"dms_allocations": "DMS Allocations",
|
||||||
"pbs_serialnumber": "PBS Serial Number",
|
"pbs_serialnumber": "PBS Serial Number",
|
||||||
|
"profitsmapping": "Profits Mapping",
|
||||||
"title": "DMS"
|
"title": "DMS"
|
||||||
},
|
},
|
||||||
"emaillater": "Email Later",
|
"emaillater": "Email Later",
|
||||||
@@ -2936,6 +2939,8 @@
|
|||||||
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
|
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
|
||||||
"purchases_by_date_range_detail": "Purchases by Date - Detail",
|
"purchases_by_date_range_detail": "Purchases by Date - Detail",
|
||||||
"purchases_by_date_range_summary": "Purchases by Date - Summary",
|
"purchases_by_date_range_summary": "Purchases by Date - Summary",
|
||||||
|
"purchases_by_ro_detail_date": "Purchases by RO - Detail",
|
||||||
|
"purchases_by_ro_summary_date": "Purchases by RO - Summary",
|
||||||
"purchases_by_vendor_detailed_date_range": "Purchases By Vendor - Detailed",
|
"purchases_by_vendor_detailed_date_range": "Purchases By Vendor - Detailed",
|
||||||
"purchases_by_vendor_summary_date_range": "Purchases by Vendor - Summary",
|
"purchases_by_vendor_summary_date_range": "Purchases by Vendor - Summary",
|
||||||
"purchases_grouped_by_vendor_detailed": "Purchases Grouped by Vendor - Detailed",
|
"purchases_grouped_by_vendor_detailed": "Purchases Grouped by Vendor - Detailed",
|
||||||
|
|||||||
@@ -647,7 +647,10 @@
|
|||||||
"payers": ""
|
"payers": ""
|
||||||
},
|
},
|
||||||
"cdk_dealerid": "",
|
"cdk_dealerid": "",
|
||||||
|
"costsmapping": "",
|
||||||
|
"dms_allocations": "",
|
||||||
"pbs_serialnumber": "",
|
"pbs_serialnumber": "",
|
||||||
|
"profitsmapping": "",
|
||||||
"title": ""
|
"title": ""
|
||||||
},
|
},
|
||||||
"emaillater": "",
|
"emaillater": "",
|
||||||
@@ -2936,6 +2939,8 @@
|
|||||||
"purchases_by_cost_center_summary": "",
|
"purchases_by_cost_center_summary": "",
|
||||||
"purchases_by_date_range_detail": "",
|
"purchases_by_date_range_detail": "",
|
||||||
"purchases_by_date_range_summary": "",
|
"purchases_by_date_range_summary": "",
|
||||||
|
"purchases_by_ro_detail_date": "",
|
||||||
|
"purchases_by_ro_summary_date": "",
|
||||||
"purchases_by_vendor_detailed_date_range": "",
|
"purchases_by_vendor_detailed_date_range": "",
|
||||||
"purchases_by_vendor_summary_date_range": "",
|
"purchases_by_vendor_summary_date_range": "",
|
||||||
"purchases_grouped_by_vendor_detailed": "",
|
"purchases_grouped_by_vendor_detailed": "",
|
||||||
|
|||||||
@@ -647,7 +647,10 @@
|
|||||||
"payers": ""
|
"payers": ""
|
||||||
},
|
},
|
||||||
"cdk_dealerid": "",
|
"cdk_dealerid": "",
|
||||||
|
"costsmapping": "",
|
||||||
|
"dms_allocations": "",
|
||||||
"pbs_serialnumber": "",
|
"pbs_serialnumber": "",
|
||||||
|
"profitsmapping": "",
|
||||||
"title": ""
|
"title": ""
|
||||||
},
|
},
|
||||||
"emaillater": "",
|
"emaillater": "",
|
||||||
@@ -2936,6 +2939,8 @@
|
|||||||
"purchases_by_cost_center_summary": "",
|
"purchases_by_cost_center_summary": "",
|
||||||
"purchases_by_date_range_detail": "",
|
"purchases_by_date_range_detail": "",
|
||||||
"purchases_by_date_range_summary": "",
|
"purchases_by_date_range_summary": "",
|
||||||
|
"purchases_by_ro_detail_date": "",
|
||||||
|
"purchases_by_ro_summary_date": "",
|
||||||
"purchases_by_vendor_detailed_date_range": "",
|
"purchases_by_vendor_detailed_date_range": "",
|
||||||
"purchases_by_vendor_summary_date_range": "",
|
"purchases_by_vendor_summary_date_range": "",
|
||||||
"purchases_grouped_by_vendor_detailed": "",
|
"purchases_grouped_by_vendor_detailed": "",
|
||||||
|
|||||||
@@ -1081,6 +1081,32 @@ export const TemplateList = (type, context) => {
|
|||||||
},
|
},
|
||||||
group: "purchases"
|
group: "purchases"
|
||||||
},
|
},
|
||||||
|
purchases_by_ro_detail_date: {
|
||||||
|
title: i18n.t("reportcenter.templates.purchases_by_ro_detail_date"),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t("reportcenter.templates.purchases_by_ro_detail_date"),
|
||||||
|
key: "purchases_by_ro_detail_date",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_invoiced")
|
||||||
|
},
|
||||||
|
group: "purchases"
|
||||||
|
},
|
||||||
|
purchases_by_ro_summary_date: {
|
||||||
|
title: i18n.t("reportcenter.templates.purchases_by_ro_summary_date"),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t("reportcenter.templates.purchases_by_ro_summary_date"),
|
||||||
|
key: "purchases_by_ro_summary_date",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_invoiced")
|
||||||
|
},
|
||||||
|
group: "purchases"
|
||||||
|
},
|
||||||
job_costing_ro_date_summary: {
|
job_costing_ro_date_summary: {
|
||||||
title: i18n.t("reportcenter.templates.job_costing_ro_date_summary"),
|
title: i18n.t("reportcenter.templates.job_costing_ro_date_summary"),
|
||||||
description: "",
|
description: "",
|
||||||
|
|||||||
@@ -897,19 +897,20 @@ function checkStateTax(jobline, jobs_by_pk) {
|
|||||||
(jobline.db_ref && jobline.db_ref.startsWith("90051"))) &&
|
(jobline.db_ref && jobline.db_ref.startsWith("90051"))) &&
|
||||||
!isPaintOrShopMat;
|
!isPaintOrShopMat;
|
||||||
|
|
||||||
if (!jobline.part_type && isAdditionalCost) {
|
if (!jobline.part_type && isAdditionalCost) {
|
||||||
if (jobs_by_pk.tax_lbr_rt === 0) {
|
if (jobs_by_pk.tax_lbr_rt === 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (jobline.tax_part === false) {
|
if (jobline.tax_part === false) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (jobline.part_type) {
|
if (jobline.part_type) {
|
||||||
if (
|
if (
|
||||||
|
!jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`] ||
|
||||||
jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_in === false ||
|
jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_in === false ||
|
||||||
jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_rt === 0
|
jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_rt === 0
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -211,6 +211,8 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const repairCosts = CreateCosts(job);
|
const repairCosts = CreateCosts(job);
|
||||||
|
const jobline = CreateJobLines(job.joblines);
|
||||||
|
const timeticket = CreateTimeTickets(job.timetickets);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ret = {
|
const ret = {
|
||||||
@@ -276,8 +278,11 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
DateInvoiced:
|
DateInvoiced:
|
||||||
(job.date_invoiced && moment(job.date_invoiced).tz(job.bodyshop.timezone).format(DateFormat)) || "",
|
(job.date_invoiced && moment(job.date_invoiced).tz(job.bodyshop.timezone).format(DateFormat)) || "",
|
||||||
DateExported:
|
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: {
|
Sales: {
|
||||||
Labour: {
|
Labour: {
|
||||||
Aluminum: Dinero(job.job_totals.rates.laa.total).toFormat(DineroFormat),
|
Aluminum: Dinero(job.job_totals.rates.laa.total).toFormat(DineroFormat),
|
||||||
@@ -625,3 +630,38 @@ const CreateCosts = (job) => {
|
|||||||
}, 0)
|
}, 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;
|
||||||
|
};
|
||||||
|
|||||||
@@ -1113,7 +1113,7 @@ exports.KAIZEN_QUERY = `query KAIZEN_EXPORT($start: timestamptz, $bodyshopid: uu
|
|||||||
use_paint_scale_data
|
use_paint_scale_data
|
||||||
timezone
|
timezone
|
||||||
}
|
}
|
||||||
jobs(where: {_and: [{updated_at: {_gt: $start}}, {updated_at: {_lte: $end}}, {shopid: {_eq: $bodyshopid}}]}) {
|
jobs(where: {_and: [{updated_at: {_gt: $start}}, {updated_at: {_lte: $end}}, {converted: {_eq: true}}, {shopid: {_eq: $bodyshopid}}]}) {
|
||||||
actual_completion
|
actual_completion
|
||||||
actual_delivery
|
actual_delivery
|
||||||
actual_in
|
actual_in
|
||||||
@@ -1138,6 +1138,7 @@ exports.KAIZEN_QUERY = `query KAIZEN_EXPORT($start: timestamptz, $bodyshopid: uu
|
|||||||
date_invoiced
|
date_invoiced
|
||||||
date_open
|
date_open
|
||||||
date_repairstarted
|
date_repairstarted
|
||||||
|
date_void
|
||||||
employee_body_rel {
|
employee_body_rel {
|
||||||
first_name
|
first_name
|
||||||
last_name
|
last_name
|
||||||
@@ -1168,6 +1169,7 @@ exports.KAIZEN_QUERY = `query KAIZEN_EXPORT($start: timestamptz, $bodyshopid: uu
|
|||||||
ins_co_nm
|
ins_co_nm
|
||||||
joblines(where: {removed: {_eq: false}}) {
|
joblines(where: {removed: {_eq: false}}) {
|
||||||
act_price
|
act_price
|
||||||
|
alt_partno
|
||||||
billlines(order_by: {bill: {date: desc_nulls_last}} limit: 1) {
|
billlines(order_by: {bill: {date: desc_nulls_last}} limit: 1) {
|
||||||
actual_cost
|
actual_cost
|
||||||
actual_price
|
actual_price
|
||||||
@@ -1188,6 +1190,8 @@ exports.KAIZEN_QUERY = `query KAIZEN_EXPORT($start: timestamptz, $bodyshopid: uu
|
|||||||
line_no
|
line_no
|
||||||
mod_lb_hrs
|
mod_lb_hrs
|
||||||
mod_lbr_ty
|
mod_lbr_ty
|
||||||
|
oem_partno
|
||||||
|
op_code_desc
|
||||||
parts_order_lines(order_by: {parts_order: {order_date: desc_nulls_last}} limit: 1){
|
parts_order_lines(order_by: {parts_order: {order_date: desc_nulls_last}} limit: 1){
|
||||||
parts_order{
|
parts_order{
|
||||||
id
|
id
|
||||||
@@ -1200,7 +1204,6 @@ exports.KAIZEN_QUERY = `query KAIZEN_EXPORT($start: timestamptz, $bodyshopid: uu
|
|||||||
profitcenter_labor
|
profitcenter_labor
|
||||||
prt_dsmk_m
|
prt_dsmk_m
|
||||||
prt_dsmk_p
|
prt_dsmk_p
|
||||||
oem_partno
|
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
job_totals
|
job_totals
|
||||||
@@ -1251,12 +1254,18 @@ exports.KAIZEN_QUERY = `query KAIZEN_EXPORT($start: timestamptz, $bodyshopid: uu
|
|||||||
scheduled_in
|
scheduled_in
|
||||||
status
|
status
|
||||||
timetickets {
|
timetickets {
|
||||||
id
|
|
||||||
rate
|
|
||||||
cost_center
|
|
||||||
actualhrs
|
actualhrs
|
||||||
productivehrs
|
cost_center
|
||||||
|
date
|
||||||
|
employee {
|
||||||
|
employee_number
|
||||||
|
first_name
|
||||||
|
last_name
|
||||||
|
}
|
||||||
flat_rate
|
flat_rate
|
||||||
|
id
|
||||||
|
productivehrs
|
||||||
|
rate
|
||||||
}
|
}
|
||||||
tlos_ind
|
tlos_ind
|
||||||
v_color
|
v_color
|
||||||
@@ -2481,7 +2490,6 @@ query QUERY_TASK_BY_ID($id: uuid!) {
|
|||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
exports.GET_JOBS_BY_PKS = `query GET_JOBS_BY_PKS($ids: [uuid!]!) {
|
exports.GET_JOBS_BY_PKS = `query GET_JOBS_BY_PKS($ids: [uuid!]!) {
|
||||||
jobs(where: {id: {_in: $ids}}) {
|
jobs(where: {id: {_in: $ids}}) {
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -643,7 +643,7 @@ function CalculateAdditional(job) {
|
|||||||
additionalCosts: null,
|
additionalCosts: null,
|
||||||
additionalCostItems: [],
|
additionalCostItems: [],
|
||||||
adjustments: null,
|
adjustments: null,
|
||||||
towing: null,
|
towing: Dinero(),
|
||||||
shipping: Dinero(),
|
shipping: Dinero(),
|
||||||
storage: null,
|
storage: null,
|
||||||
pvrt: null,
|
pvrt: null,
|
||||||
@@ -668,7 +668,7 @@ function CalculateAdditional(job) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (val.line_desc.toLowerCase().includes("towing")) {
|
if (val.line_desc.toLowerCase().includes("towing")) {
|
||||||
ret.towing = lineValue;
|
ret.towing = ret.towing.add(lineValue);
|
||||||
return acc;
|
return acc;
|
||||||
} else {
|
} else {
|
||||||
ret.additionalCostItems.push({ key: val.line_desc, total: lineValue });
|
ret.additionalCostItems.push({ key: val.line_desc, total: lineValue });
|
||||||
@@ -919,7 +919,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
|||||||
|
|
||||||
Object.keys(taxableAmountsByTier).forEach((taxTierKey) => {
|
Object.keys(taxableAmountsByTier).forEach((taxTierKey) => {
|
||||||
taxable_adjustment = taxableAmountsByTier[taxTierKey].multiply(percent_of_adjustment);
|
taxable_adjustment = taxableAmountsByTier[taxTierKey].multiply(percent_of_adjustment);
|
||||||
console.log("🚀 ~ taxableAmountsByTier ~ taxable_adjustment:", taxable_adjustment)
|
console.log("🚀 ~ taxableAmountsByTier ~ taxable_adjustment:", taxable_adjustment);
|
||||||
if (job.adjustment_bottom_line > 0) {
|
if (job.adjustment_bottom_line > 0) {
|
||||||
taxableAmountsByTier[taxTierKey] = taxableAmountsByTier[taxTierKey].add(taxable_adjustment);
|
taxableAmountsByTier[taxTierKey] = taxableAmountsByTier[taxTierKey].add(taxable_adjustment);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ function CalculateAdditional(job) {
|
|||||||
additionalCosts: null,
|
additionalCosts: null,
|
||||||
additionalCostItems: [],
|
additionalCostItems: [],
|
||||||
adjustments: null,
|
adjustments: null,
|
||||||
towing: null,
|
towing: Dinero(),
|
||||||
shipping: Dinero(),
|
shipping: Dinero(),
|
||||||
storage: null,
|
storage: null,
|
||||||
pvrt: null,
|
pvrt: null,
|
||||||
@@ -512,7 +512,7 @@ function CalculateAdditional(job) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (val.line_desc.toLowerCase().includes("towing")) {
|
if (val.line_desc.toLowerCase().includes("towing")) {
|
||||||
ret.towing = lineValue;
|
ret.towing = ret.towing.add(lineValue);
|
||||||
return acc;
|
return acc;
|
||||||
} else {
|
} else {
|
||||||
ret.additionalCostItems.push({ key: val.line_desc, total: lineValue });
|
ret.additionalCostItems.push({ key: val.line_desc, total: lineValue });
|
||||||
|
|||||||
Reference in New Issue
Block a user