feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration -Cleaned up DMS key check (consolidated into a helper function), Clean up DMS post form and make it agnostic, same with customer selector.

This commit is contained in:
Dave
2025-11-13 11:18:11 -05:00
parent 577c3bec04
commit 09ea6dff2b
32 changed files with 1747 additions and 1411 deletions

View File

@@ -1,4 +1,5 @@
import i18next from "i18next";
import { bodyshopHasDmsKey } from "../../utils/dmsUtils.js";
export const CalculateAllocationsTotals = (bodyshop, joblines, timetickets, adjustments = []) => {
const responsibilitycenters = bodyshop.md_responsibility_centers;
@@ -14,10 +15,9 @@ export const CalculateAllocationsTotals = (bodyshop, joblines, timetickets, adju
const r = allCodes.reduce((acc, value) => {
const r = {
opcode: value,
cost_center:
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid
? i18next.t(`joblines.fields.lbr_types.${value && value.toUpperCase()}`)
: responsibilitycenters.defaults.costs[value],
cost_center: bodyshopHasDmsKey(bodyshop)
? i18next.t(`joblines.fields.lbr_types.${value && value.toUpperCase()}`)
: responsibilitycenters.defaults.costs[value],
mod_lbr_ty: value,
total: joblines.reduce((acc2, val2) => {
return val2.mod_lbr_ty === value ? acc2 + val2.mod_lb_hrs : acc2;