Merged in feature/IO-3499-React-19 (pull request #2878)

feature/IO-3499-React-19 - The Calculate button on Totals did not actually have refetch passed down
This commit is contained in:
Dave Richer
2026-01-23 18:04:06 +00:00
3 changed files with 7 additions and 27 deletions

View File

@@ -18,29 +18,6 @@ export default function JobCalculateTotals({ job, disabled, refetch }) {
});
if (refetch) refetch();
// const result = await updateJob({
// refetchQueries: ["GET_JOB_BY_PK"],
// awaitRefetchQueries: true,
// variables: {
// jobId: job.id,
// job: {
// job_totals: newTotals,
// clm_total: Dinero(newTotals.totals.total_repairs).toFormat("0.00"),
// owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat(
// "0.00"
// ),
// },
// },
// });
// if (!!!result.errors) {
// notification["success"]({ message: t("jobs.successes.updated") });
// } else {
// notification.error({
// message: t("jobs.errors.updating", {
// error: JSON.stringify(result.errors),
// }),
// });
// }
} catch (error) {
notification.error({
title: t("jobs.errors.updating", {

View File

@@ -21,13 +21,16 @@ const colSpan = {
lg: { span: 12 }
};
export function JobsTotalsTableComponent({ jobRO, currentUser, job }) {
export function JobsTotalsTableComponent({ jobRO, currentUser, job, refetch }) {
const { t } = useTranslation();
if (!job.job_totals) {
return (
<Card>
<Result title={t("jobs.errors.nofinancial")} extra={<JobCalculateTotals job={job} disabled={jobRO} />} />
<Result
title={t("jobs.errors.nofinancial")}
extra={<JobCalculateTotals job={job} disabled={jobRO} refetch={refetch} />}
/>
</Card>
);
}
@@ -64,7 +67,7 @@ export function JobsTotalsTableComponent({ jobRO, currentUser, job }) {
{(currentUser.email.includes("@imex.") || currentUser.email.includes("@rome.")) && (
<Col span={24}>
<Card title="DEVELOPMENT USE ONLY">
<JobCalculateTotals job={job} disabled={jobRO} />
<JobCalculateTotals job={job} disabled={jobRO} refetch={refetch} />
<Collapse
items={[
{

View File

@@ -5,7 +5,7 @@ import JobTotalsTable from "../job-totals-table/job-totals-table.component";
export function JobsDetailTotals({ job, refetch }) {
return (
<div>
<JobTotalsTable job={job} />
<JobTotalsTable job={job} refetch={refetch} />
<Divider />
<JobPayments job={job} refetch={refetch} />
</div>