Compare commits

...

19 Commits

Author SHA1 Message Date
Allan Carr
3c0e62ffac IO-3430 Additional Cost Items
Signed-off-by: Allan Carr <allan@imexsystems.ca>
2025-11-04 08:57:23 -08:00
Dave Richer
907f291f90 Merged in release/2025-10-24 (pull request #2640)
Release/2025 10 24 into master-AIO - IO-3412 - IO-3398
2025-10-25 01:41:09 +00:00
Patrick Fic
abce19530f Merged in feature/IO-3398-bill-line-select-display (pull request #2638)
IO-3398 Bill line search select will now show price in select value.
2025-10-23 18:49:29 +00:00
Patrick Fic
1fd9b68320 IO-3398 Bill line search select will now show price in select value. 2025-10-23 11:48:35 -07:00
Patrick Fic
cff1afe605 Merged in feature/IO-3412-costing-tax-rate-typo (pull request #2637)
IO-3412 Resolve tax rate typo in job costing.
2025-10-23 16:21:03 +00:00
Patrick Fic
b337309f94 IO-3412 Resolve tax rate typo in job costing. 2025-10-23 09:17:15 -07:00
Patrick Fic
77f041b0f1 Merged in feature/IO-3407-us-qbd-tax-adj-quantity (pull request #2636)
IO-3407 Remove tax code ref for adjustment as well.
2025-10-17 22:09:11 +00:00
Patrick Fic
68be8670b4 IO-3407 Remove tax code ref for adjustment as well. 2025-10-17 15:06:58 -07:00
Patrick Fic
745c429f08 Merged in feature/IO-3407-us-qbd-tax-adj-quantity (pull request #2635)
IO-3407 Resolve quantity required for QBD sales tax adj.
2025-10-17 21:57:23 +00:00
Patrick Fic
cc9e4740de IO-3407 Resolve quantity required for QBD sales tax adj. 2025-10-17 14:56:44 -07:00
Dave Richer
06ebcbaa07 Merged in release/2025-10-17 (pull request #2633)
Release/2025 10 17  into Master-AIO - IO-3373 - IO-3404 - IO-3385
2025-10-17 18:59:37 +00:00
Dave
42427c4569 release/2025-10-17 - Refine Job Totals Logging (switch from error to warn for USA key issues, normalize case on logging level) 2025-10-17 14:56:21 -04:00
Dave Richer
d5f921ed35 Merged in feature/IO-3385-Remove-CASL-From-Rome (pull request #2631)
feature/IO-3385-Remove-CASL-From-Rome - Remove CASL Report from Rome Customers.
2025-10-15 15:48:13 +00:00
Dave Richer
54850e8ee2 Merged in feature/IO-3404-Seamless-Logout (pull request #2629)
feature/IO-3404-Seamless-Logout - Implement Seamless Logout
2025-10-15 15:33:29 +00:00
Dave
199ddc7d9e feature/IO-3404-Seamless-Logout - Implement Seamless Logout 2025-10-15 11:31:34 -04:00
Dave Richer
e3337bacea Merged in hotfix/2025-10-10 (pull request #2626)
Hotfix/2025 10 10
2025-10-10 20:05:08 +00:00
Allan Carr
29df829120 Merged in feature/IO-3373-Dashboard-Component-Redux-Fix (pull request #2622)
IO-3373 Dashboard Component Refresh Cyclic object fix

Approved-by: Dave Richer
2025-10-10 16:08:21 +00:00
Allan Carr
d2b6054e60 Merged in feature/IO-3386-carfax-rps (pull request #2620)
IO-3368 CARFAX Adjustments for OP_CODE [PENDING APPROVAL]
2025-10-09 17:28:31 +00:00
Allan Carr
7004ed9880 IO-3373 Dashboard Component Refresh Cyclic object fix
Signed-off-by: Allan Carr <allan@imexsystems.ca>
2025-10-09 09:13:03 -07:00
8 changed files with 102 additions and 73 deletions

View File

@@ -12,6 +12,7 @@ import GlobalLoadingBar from "../components/global-loading-bar/global-loading-ba
import { setDarkMode } from "../redux/application/application.actions";
import { selectDarkMode } from "../redux/application/application.selectors";
import { selectCurrentUser } from "../redux/user/user.selectors.js";
import { signOutStart } from "../redux/user/user.actions";
import client from "../utils/GraphQLClient";
import App from "./App";
import getTheme from "./themeProvider";
@@ -20,14 +21,13 @@ import getTheme from "./themeProvider";
const config = {
core: {
authorizationKey: import.meta.env.VITE_APP_SPLIT_API,
key: "anon" // Default key, overridden dynamically by SplitClientProvider
key: "anon"
}
};
// Custom provider to manage the Split client key based on imexshopid from Redux
function SplitClientProvider({ children }) {
const imexshopid = useSelector((state) => state.user.imexshopid); // Access imexshopid from Redux store
const splitClient = useSplitClient({ key: imexshopid || "anon" }); // Use imexshopid or fallback to "anon"
const imexshopid = useSelector((state) => state.user.imexshopid);
const splitClient = useSplitClient({ key: imexshopid || "anon" });
useEffect(() => {
if (splitClient && imexshopid) {
console.log(`Split client initialized with key: ${imexshopid}, isReady: ${splitClient.isReady}`);
@@ -36,40 +36,66 @@ function SplitClientProvider({ children }) {
return children;
}
const mapDispatchToProps = (dispatch) => ({
setDarkMode: (isDarkMode) => dispatch(setDarkMode(isDarkMode))
});
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser
});
function AppContainer({ currentUser, setDarkMode }) {
const mapDispatchToProps = (dispatch) => ({
setDarkMode: (isDarkMode) => dispatch(setDarkMode(isDarkMode)),
signOutStart: () => dispatch(signOutStart())
});
function AppContainer({ currentUser, setDarkMode, signOutStart }) {
const { t } = useTranslation();
const isDarkMode = useSelector(selectDarkMode);
const theme = useMemo(() => getTheme(isDarkMode), [isDarkMode]);
// Update data-theme attribute when dark mode changes
// Global seamless logout listener with redirect to /signin
useEffect(() => {
const handleSeamlessLogout = (event) => {
if (event.data?.type !== "seamlessLogoutRequest") return;
const requestOrigin = event.origin;
if (currentUser?.authorized !== true) {
window.parent.postMessage(
{ type: "seamlessLogoutResponse", status: "already_logged_out" },
requestOrigin || "*"
);
return;
}
signOutStart();
window.parent.postMessage({ type: "seamlessLogoutResponse", status: "logged_out" }, requestOrigin || "*");
};
window.addEventListener("message", handleSeamlessLogout);
return () => {
window.removeEventListener("message", handleSeamlessLogout);
};
}, [signOutStart, currentUser]);
// Update data-theme attribute
useEffect(() => {
document.documentElement.setAttribute("data-theme", isDarkMode ? "dark" : "light");
return () => document.documentElement.removeAttribute("data-theme");
}, [isDarkMode]);
// Sync Redux darkMode with localStorage on user change
// Sync darkMode with localStorage
useEffect(() => {
if (currentUser?.uid) {
const savedMode = localStorage.getItem(`dark-mode-${currentUser.uid}`);
if (savedMode !== null) {
setDarkMode(JSON.parse(savedMode));
} else {
setDarkMode(false); // default to light mode
setDarkMode(false);
}
} else {
setDarkMode(false);
}
}, [currentUser?.uid]);
}, [currentUser?.uid, setDarkMode]);
// Persist darkMode to localStorage when it or user changes
// Persist darkMode
useEffect(() => {
if (currentUser?.uid) {
localStorage.setItem(`dark-mode-${currentUser.uid}`, JSON.stringify(isDarkMode));

View File

@@ -45,7 +45,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.jobline"),
dataIndex: "joblineid",
editable: true,
width: "20rem",
minWidth: "10rem",
formItemProps: (field) => {
return {
key: `${field.index}joblinename`,
@@ -71,9 +71,9 @@ export function BillEnterModalLinesComponent({
disabled={disabled}
options={lineData}
style={{
width: "20rem",
maxWidth: "20rem",
minWidth: "10rem",
//width: "10rem",
// maxWidth: "20rem",
minWidth: "20rem",
whiteSpace: "normal",
height: "auto",
minHeight: "32px" // default height of Ant Design inputs
@@ -110,7 +110,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.line_desc"),
dataIndex: "line_desc",
editable: true,
width: "20rem",
minWidth: "10rem",
formItemProps: (field) => {
return {
key: `${field.index}line_desc`,
@@ -232,7 +232,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.actual_cost"),
dataIndex: "actual_cost",
editable: true,
width: "8rem",
width: "10rem",
formItemProps: (field) => {
return {
@@ -357,6 +357,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.labels.deductedfromlbr"),
dataIndex: "deductedfromlbr",
editable: true,
width: "40px",
formItemProps: (field) => {
return {
valuePropName: "checked",
@@ -464,7 +465,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.federal_tax_applicable"),
dataIndex: "applicable_taxes.federal",
editable: true,
width: "40px",
formItemProps: (field) => {
return {
key: `${field.index}fedtax`,
@@ -485,7 +486,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.state_tax_applicable"),
dataIndex: "applicable_taxes.state",
editable: true,
width: "40px",
formItemProps: (field) => {
return {
key: `${field.index}statetax`,
@@ -503,7 +504,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.local_tax_applicable"),
dataIndex: "applicable_taxes.local",
editable: true,
width: "40px",
formItemProps: (field) => {
return {
key: `${field.index}localtax`,

View File

@@ -39,30 +39,32 @@ const BillLineSearchSelect = ({ options, disabled, allowRemoved, ...restProps },
style: {
...(item.removed ? { textDecoration: "line-through" } : {})
},
name: `${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
item.oem_partno ? ` - ${item.oem_partno}` : ""
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim(),
label: (
<div style={{ whiteSpace: "normal", wordBreak: "break-word" }}>
<span>
{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
item.oem_partno ? ` - ${item.oem_partno}` : ""
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim()}
</span>
{InstanceRenderMgr({
rome: item.act_price === 0 && item.mod_lb_hrs > 0 && (
<span style={{ float: "right", paddingleft: "1rem" }}>{`${item.mod_lb_hrs} units`}</span>
)
})}
<span style={{ float: "right", paddingleft: "1rem" }}>
{item.act_price ? `$${item.act_price && item.act_price.toFixed(2)}` : ``}
</span>
</div>
)
name: generateLineName(item),
label: generateLineName(item)
}))
]}
{...restProps}
></Select>
);
};
function generateLineName(item) {
return (
<div style={{ whiteSpace: "normal", wordBreak: "break-word" }}>
<span>
{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
item.oem_partno ? ` - ${item.oem_partno}` : ""
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim()}
</span>
{InstanceRenderMgr({
rome: item.act_price === 0 && item.mod_lb_hrs > 0 && (
<span style={{ float: "right", paddingleft: "1rem" }}>{`${item.mod_lb_hrs} units`}</span>
)
})}
<span style={{ float: "right", paddingleft: "1rem" }}>
{item.act_price ? `$${item.act_price && item.act_price.toFixed(2)}` : ``}
</span>
</div>
);
}
export default forwardRef(BillLineSearchSelect);

View File

@@ -196,7 +196,7 @@ export function DashboardGridComponent({ currentUser }) {
<PageHeader
extra={
<Space>
<Button onClick={refetch}>
<Button onClick={() => refetch()}>
<SyncOutlined />
</Button>
<Dropdown menu={menu} trigger={["click"]}>

View File

@@ -919,16 +919,16 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
FullName: responsibilityCenters.ttl_tax_adjustment?.accountitem
},
Desc: "Tax Adjustment",
Quantity: 1,
//Quantity: 1,
Amount: Dinero(jobs_by_pk.job_totals.totals?.ttl_tax_adjustment).toFormat(DineroQbFormat),
SalesTaxCodeRef: InstanceManager({
imex: {
FullName: "E"
},
rome: {
FullName: bodyshop.md_responsibility_centers.taxes.itemexemptcode || "NON"
}
})
// SalesTaxCodeRef: InstanceManager({
// imex: {
// FullName: "E"
// },
// rome: {
// FullName: bodyshop.md_responsibility_centers.taxes.itemexemptcode || "NON"
// }
// })
});
}
}

View File

@@ -405,7 +405,7 @@ function GenerateCostingData(job) {
) {
const discountRate =
Math.abs(job.parts_tax_rates[val.part_type.toUpperCase()].prt_discp) > 1
? job.parts_tax_rates_rates[val.part_type.toUpperCase()].prt_discp
? job.parts_tax_rates[val.part_type.toUpperCase()].prt_discp
: job.parts_tax_rates[val.part_type.toUpperCase()].prt_discp * 100;
const disc = partsAmount.percentage(discountRate).multiply(-1);
partsAmount = partsAmount.add(disc);

View File

@@ -24,7 +24,7 @@ exports.totalsSsu = async function (req, res) {
const BearerToken = req.BearerToken;
const client = req.userGraphQLClient;
logger.log("job-totals-ssu-USA", "DEBUG", req?.user?.email, id);
logger.log("job-totals-ssu-USA", "debug", req?.user?.email, id);
try {
const job = await client.setHeaders({ Authorization: BearerToken }).request(queries.GET_JOB_BY_PK, {
@@ -49,7 +49,7 @@ exports.totalsSsu = async function (req, res) {
res.status(200).send();
} catch (error) {
logger.log("job-totals-ssu-USA-error", "ERROR", req?.user?.email, id, {
logger.log("job-totals-ssu-USA-error", "error", req?.user?.email, id, {
jobid: id,
error: error.message,
stack: error.stack
@@ -95,7 +95,7 @@ async function TotalsServerSide(req, res) {
ret.totals.subtotal = ret.totals.subtotal.add(ret.totals.ttl_adjustment);
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_adjustment);
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_adjustment);
logger.log("job-totals-USA-ttl-adj", "DEBUG", null, job.id, {
logger.log("job-totals-USA-ttl-adj", "debug", null, job.id, {
adjAmount: ttlDifference
});
}
@@ -116,7 +116,7 @@ async function TotalsServerSide(req, res) {
ret.totals.ttl_tax_adjustment = Dinero({ amount: Math.round(ttlTaxDifference * 100) });
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_tax_adjustment);
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_tax_adjustment);
logger.log("job-totals-USA-ttl-tax-adj", "DEBUG", null, job.id, {
logger.log("job-totals-USA-ttl-tax-adj", "debug", null, job.id, {
adjAmount: ttlTaxDifference
});
}
@@ -124,7 +124,7 @@ async function TotalsServerSide(req, res) {
return ret;
} catch (error) {
logger.log("job-totals-ssu-USA-error", "ERROR", req.user?.email, job.id, {
logger.log("job-totals-ssu-USA-error", "error", req.user?.email, job.id, {
jobid: job.id,
error: error.message,
stack: error.stack
@@ -142,7 +142,7 @@ async function Totals(req, res) {
const logger = req.logger;
const client = req.userGraphQLClient;
logger.log("job-totals-ssu-USA", "DEBUG", req.user.email, job.id, {
logger.log("job-totals-ssu-USA", "debug", req.user.email, job.id, {
jobid: job.id,
id: id
});
@@ -159,7 +159,7 @@ async function Totals(req, res) {
res.status(200).json(ret);
} catch (error) {
logger.log("job-totals-ssu-USA-error", "ERROR", req.user.email, job.id, {
logger.log("job-totals-ssu-USA-error", "error", req.user.email, job.id, {
jobid: job.id,
error: error.message,
stack: error.stack
@@ -240,7 +240,7 @@ async function AtsAdjustmentsIfRequired({ job, client, user }) {
job.joblines.push(newAtsLine);
}
} catch (error) {
logger.log("job-totals-ssu-ats-error", "ERROR", user?.email, job.id, {
logger.log("job-totals-ssu-ats-error", "error", user?.email, job.id, {
jobid: job.id,
error: error.message,
stack: error.stack
@@ -258,7 +258,7 @@ async function AtsAdjustmentsIfRequired({ job, client, user }) {
job.joblines[atsLineIndex].act_price = atsAmount;
}
} catch (error) {
logger.log("job-totals-ssu-ats-error", "ERROR", user?.email, job.id, {
logger.log("job-totals-ssu-ats-error", "error", user?.email, job.id, {
jobid: job.id,
atsLineIndex: atsLineIndex,
atsAmount: atsAmount,
@@ -381,7 +381,7 @@ 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)) {
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();
@@ -1055,7 +1055,7 @@ function CalculateTaxesTotals(job, otherTotals) {
}
}
} catch (error) {
logger.log("job-totals-USA Key with issue", "error", null, job.id, {
logger.log("job-totals-USA Key with issue", "warn", null, job.id, {
key: key,
error: error.message,
stack: error.stack

View File

@@ -23,7 +23,7 @@ exports.totalsSsu = async function (req, res) {
const BearerToken = req.BearerToken;
const client = req.userGraphQLClient;
logger.log("job-totals-ssu", "DEBUG", req.user.email, id, null);
logger.log("job-totals-ssu", "debug", req.user.email, id, null);
try {
const job = await client.setHeaders({ Authorization: BearerToken }).request(queries.GET_JOB_BY_PK, {
@@ -49,7 +49,7 @@ exports.totalsSsu = async function (req, res) {
res.status(200).send();
} catch (error) {
logger.log("job-totals-ssu-error", "ERROR", req.user.email, id, {
logger.log("job-totals-ssu-error", "error", req.user.email, id, {
jobid: id,
error: error.message,
stack: error.stack
@@ -73,7 +73,7 @@ async function TotalsServerSide(req, res) {
return ret;
} catch (error) {
logger.log("job-totals-ssu-error", "ERROR", req?.user?.email, job.id, {
logger.log("job-totals-ssu-error", "error", req?.user?.email, job.id, {
jobid: job.id,
error: error.message,
stack: error.stack
@@ -91,7 +91,7 @@ async function Totals(req, res) {
const logger = req.logger;
const client = req.userGraphQLClient;
logger.log("job-totals-ssu", "DEBUG", req.user.email, job.id, {
logger.log("job-totals-ssu", "debug", req.user.email, job.id, {
jobid: job.id,
id: id
});
@@ -108,7 +108,7 @@ async function Totals(req, res) {
res.status(200).json(ret);
} catch (error) {
logger.log("job-totals-ssu-error", "ERROR", req.user.email, job.id, {
logger.log("job-totals-ssu-error", "error", req.user.email, job.id, {
jobid: job.id,
error: error.message,
stack: error.stack
@@ -189,7 +189,7 @@ async function AtsAdjustmentsIfRequired({ job, client, user }) {
job.joblines.push(newAtsLine);
}
} catch (error) {
logger.log("job-totals-ssu-ats-error", "ERROR", user?.email, job.id, {
logger.log("job-totals-ssu-ats-error", "error", user?.email, job.id, {
jobid: job.id,
error: error.message,
stack: error.stack
@@ -207,7 +207,7 @@ async function AtsAdjustmentsIfRequired({ job, client, user }) {
job.joblines[atsLineIndex].act_price = atsAmount;
}
} catch (error) {
logger.log("job-totals-ssu-ats-error", "ERROR", user?.email, job.id, {
logger.log("job-totals-ssu-ats-error", "error", user?.email, job.id, {
jobid: job.id,
atsLineIndex: atsLineIndex,
atsAmount: atsAmount,
@@ -315,7 +315,7 @@ function CalculateRatesTotals(ratesList) {
if (item.mod_lbr_ty) {
//Check to see if it has 0 hours and a price instead.
//Extend for when there are hours and a price.
if (item.lbr_op === "OP14" && item.act_price > 0 && (!item.part_type || item.mod_lb_hrs === 0)) {
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()].total = Dinero();