Compare commits

..

2 Commits

Author SHA1 Message Date
Allan Carr
6c9dd969e5 IO-3496 STOR Job Total USA
Signed-off-by: Allan Carr <allan@imexsystems.ca>
2026-01-08 15:34:48 -08:00
Allan Carr
a906bc5816 IO-3496 Phase 1 for Job-Total-USA Fix
Signed-off-by: Allan Carr <allan@imexsystems.ca>
2026-01-08 12:20:15 -08:00
5 changed files with 39 additions and 32 deletions

View File

@@ -161,6 +161,7 @@ const productionListColumnsData = ({ technician, state, activeStatuses, data, bo
dataIndex: "actual_in_time",
key: "actual_in_time",
ellipsis: true,
render: (text, record) => <TimeFormatter>{record.actual_in}</TimeFormatter>
},
{
@@ -180,22 +181,6 @@ const productionListColumnsData = ({ technician, state, activeStatuses, data, bo
render: (text, record) => <TimeFormatter>{record.scheduled_completion}</TimeFormatter>
},
{
title: i18n.t("jobs.fields.actual_completion"),
dataIndex: "actual_completion",
key: "actual_completion",
ellipsis: true,
sorter: (a, b) => dateSort(a.actual_completion, b.actual_completion),
sortOrder: state.sortedInfo.columnKey === "actual_completion" && state.sortedInfo.order,
render: (text, record) => <ProductionListDate record={record} field="actual_completion" time />
},
{
title: i18n.t("jobs.fields.actual_completion") + " (HH:MM)",
dataIndex: "actual_completion_time",
key: "actual_completion_time",
ellipsis: true,
render: (text, record) => <TimeFormatter>{record.actual_completion}</TimeFormatter>
},
{
title: i18n.t("jobs.fields.date_last_contacted"),
dataIndex: "date_last_contacted",

View File

@@ -1096,7 +1096,6 @@ export const UPDATE_JOB = gql`
scheduled_completion
scheduled_delivery
actual_in
actual_completion
date_repairstarted
date_void
date_lost_sale
@@ -2593,7 +2592,6 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
vehicleid
plate_no
actual_in
actual_completion
scheduled_completion
scheduled_delivery
date_last_contacted

View File

@@ -239,13 +239,22 @@ export function* signInSuccessSaga({ payload }) {
try {
window.$crisp.push(["set", "user:nickname", [payload.displayName || payload.email]]);
const currentUserSegment = InstanceRenderManager({
imex: "imex-online-user",
rome: "rome-online-user"
});
window.$crisp.push(["set", "session:segments", [[currentUserSegment]]]);
InstanceRenderManager({
executeFunction: true,
args: [],
imex: () => {
window.$crisp.push(["set", "session:segments", [["imex"]]]);
},
rome: () => {
window.$zoho.salesiq.visitor.name(payload.displayName || payload.email);
window.$zoho.salesiq.visitor.email(payload.email);
window.$crisp.push(["set", "session:segments", [["rome"]]]);
}
});
@@ -253,13 +262,11 @@ export function* signInSuccessSaga({ payload }) {
try {
const state = yield select();
const isParts = state?.application?.isPartsEntry === true;
const instanceSeg = InstanceRenderManager({
imex: ["imex-online-user", "imex"],
rome: ["rome-online-user", "rome"]
});
const instanceSeg = InstanceRenderManager({ imex: "imex", rome: "rome" });
// Always ensure segments include instance + user, and append partsManagement if applicable
const segs = [
...instanceSeg,
currentUserSegment,
instanceSeg,
...(isParts
? [
InstanceRenderManager({
@@ -366,10 +373,7 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
// Build consolidated Crisp segments including instance, region, features, and parts mode
const isParts = yield select((state) => state.application.isPartsEntry === true);
const instanceSeg = InstanceRenderManager({
imex: ["imex-online-user", "imex"],
rome: ["rome-online-user", "rome"]
});
const instanceSeg = InstanceRenderManager({ imex: "imex", rome: "rome" });
const featureSegments =
payload.features?.allAccess === true
@@ -398,7 +402,7 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
featureSegments.push(...additionalSegments);
const regionSeg = payload.region_config ? `region:${payload.region_config}` : null;
const segments = [...instanceSeg, ...(regionSeg ? [regionSeg] : []), ...featureSegments];
const segments = [instanceSeg, ...(regionSeg ? [regionSeg] : []), ...featureSegments];
if (isParts) {
segments.push(InstanceRenderManager({ imex: "ImexPartsManagement", rome: "RomePartsManagement" }));
}

View File

@@ -1506,6 +1506,7 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
est_ct_fn
shopid
est_ct_ln
ciecaid
cieca_pfl
cieca_pft
cieca_pfo

View File

@@ -381,7 +381,12 @@ async function CalculateRatesTotals({ job, client }) {
if (item.mod_lbr_ty) {
//Check to see if it has 0 hours and a price instead.
if (item.lbr_op === "OP14" && item.act_price > 0 && (!item.part_type || item.mod_lb_hrs === 0) && !IsAdditionalCost(item)) {
if (
item.lbr_op === "OP14" &&
item.act_price > 0 &&
(!item.part_type || item.mod_lb_hrs === 0) &&
!IsAdditionalCost(item)
) {
//Scenario where SGI may pay out hours using a part price.
if (!ret[item.mod_lbr_ty.toLowerCase()].total) {
ret[item.mod_lbr_ty.toLowerCase()].base = Dinero();
@@ -943,13 +948,27 @@ function CalculateTaxesTotals(job, otherTotals) {
amount: Math.round(stlTowing.t_amt * 100)
})
);
if (stlStorage)
if (!stlTowing && !job.ciecaid && job.towing_payable)
taxableAmounts.TOW = taxableAmounts.TOW.add(
(taxableAmounts.TOW = Dinero({
Dinero({
amount: Math.round((job.towing_payable || 0) * 100)
})
);
if (stlStorage)
taxableAmounts.STOR = taxableAmounts.STOR.add(
(taxableAmounts.STOR = Dinero({
amount: Math.round(stlStorage.t_amt * 100)
}))
);
if (!stlStorage && !job.ciecaid && job.storage_payable)
taxableAmounts.STOR = taxableAmounts.STOR.add(
Dinero({
amount: Math.round((job.storage_payable || 0) * 100)
})
);
const pfp = job.parts_tax_rates;
//For any profile level markups/discounts, add them in now as well.
@@ -988,7 +1007,7 @@ function CalculateTaxesTotals(job, otherTotals) {
const pfo = job.cieca_pfo;
Object.keys(taxableAmounts).map((key) => {
try {
if (key.startsWith("PA")) {
if (key.startsWith("PA") && key !== "PAE") {
const typeOfPart = key; // === "PAM" ? "PAC" : key;
//At least one of these scenarios must be taxable.
for (let tyCounter = 1; tyCounter <= 5; tyCounter++) {