IO-3534 Adjust value prop to content for antd prop change to fix color display.
This commit is contained in:
@@ -373,9 +373,16 @@ export function BillFormComponent({
|
|||||||
"local_tax_rate"
|
"local_tax_rate"
|
||||||
]);
|
]);
|
||||||
let totals;
|
let totals;
|
||||||
if (!!values.total && !!values.billlines && values.billlines.length > 0)
|
if (!!values.total && !!values.billlines && values.billlines.length > 0) {
|
||||||
totals = CalculateBillTotal(values);
|
totals = CalculateBillTotal(values);
|
||||||
if (totals)
|
}
|
||||||
|
|
||||||
|
if (totals) {
|
||||||
|
console.log(
|
||||||
|
"Discrep",
|
||||||
|
totals.discrepancy.getAmount(),
|
||||||
|
totals.discrepancy.getAmount() === 0 ? "green" : "red"
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
// TODO: Align is not correct
|
// TODO: Align is not correct
|
||||||
// eslint-disable-next-line react/no-unknown-property
|
// eslint-disable-next-line react/no-unknown-property
|
||||||
@@ -414,7 +421,7 @@ export function BillFormComponent({
|
|||||||
<Statistic
|
<Statistic
|
||||||
title={t("bills.labels.discrepancy")}
|
title={t("bills.labels.discrepancy")}
|
||||||
styles={{
|
styles={{
|
||||||
value: {
|
content: {
|
||||||
color: totals.discrepancy.getAmount() === 0 ? "green" : "red"
|
color: totals.discrepancy.getAmount() === 0 ? "green" : "red"
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -427,6 +434,7 @@ export function BillFormComponent({
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export function DashboardTotalProductionHours({ bodyshop, data, ...cardProps })
|
|||||||
<Statistic
|
<Statistic
|
||||||
title={t("dashboard.labels.prodhrs")}
|
title={t("dashboard.labels.prodhrs")}
|
||||||
value={hours.total.toFixed(1)}
|
value={hours.total.toFixed(1)}
|
||||||
styles={{ value: { color: aboveTargetHours ? "green" : "red" } }}
|
styles={{ content: { color: aboveTargetHours ? "green" : "red" } }}
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ export default function CdkLikePostForm({ bodyshop, socket, job, logsRef, mode,
|
|||||||
<Typography.Title>=</Typography.Title>
|
<Typography.Title>=</Typography.Title>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("jobs.labels.dms.notallocated")}
|
title={t("jobs.labels.dms.notallocated")}
|
||||||
styles={{ value: { color: discrep.getAmount() === 0 ? "green" : "red" } }}
|
styles={{ content: { color: discrep.getAmount() === 0 ? "green" : "red" } }}
|
||||||
value={discrep.toFormat()}
|
value={discrep.toFormat()}
|
||||||
/>
|
/>
|
||||||
<Button disabled={disablePost} htmlType="submit">
|
<Button disabled={disablePost} htmlType="submit">
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default function PaymentFormTotalPayments({ jobid }) {
|
|||||||
{balance && (
|
{balance && (
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("payments.labels.balance")}
|
title={t("payments.labels.balance")}
|
||||||
styles={{ value: { color: balance.getAmount() !== 0 ? "red" : "green" } }}
|
styles={{ content: { color: balance.getAmount() !== 0 ? "red" : "green" } }}
|
||||||
value={(balance && balance.toFormat()) || ""}
|
value={(balance && balance.toFormat()) || ""}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ export function JobsCloseComponent({ job, bodyshop, jobRO, insertAuditTrail, set
|
|||||||
<Statistic
|
<Statistic
|
||||||
title={t("jobs.labels.pimraryamountpayable")}
|
title={t("jobs.labels.pimraryamountpayable")}
|
||||||
styles={{
|
styles={{
|
||||||
value: {
|
content: {
|
||||||
color: discrep.getAmount() >= 0 ? "green" : "red"
|
color: discrep.getAmount() >= 0 ? "green" : "red"
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user