fix: discount and adjustment fields

This commit is contained in:
Ahmed Bouhuolia
2024-12-04 12:18:20 +02:00
parent 6ab461a212
commit 7dd09e2903
5 changed files with 21 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ export default function EstimateDetailTableFooter() {
value={estimate.formatted_subtotal}
borderStyle={TotalLineBorderStyle.SingleDark}
/>
{estimate?.discount_amount > 0 && (
{estimate?.discount_amount_formatted && (
<TotalLine
title={
estimate.discount_percentage_formatted
@@ -36,6 +36,13 @@ export default function EstimateDetailTableFooter() {
textStyle={TotalLineTextStyle.Regular}
/>
)}
{estimate?.adjustment_formatted && (
<TotalLine
title="Adjustment"
value={estimate.adjustment_formatted}
textStyle={TotalLineTextStyle.Regular}
/>
)}
<TotalLine
title={<T id={'estimate.details.total'} />}
value={estimate.total_formatted}

View File

@@ -37,7 +37,7 @@ export function InvoiceDetailTableFooter() {
textStyle={TotalLineTextStyle.Regular}
/>
)}
{invoice?.adjustment > 0 && (
{invoice?.adjustment_formatted && (
<TotalLine
title="Adjustment"
value={invoice.adjustment_formatted}

View File

@@ -25,7 +25,7 @@ export default function VendorCreditDetailDrawerFooter() {
value={vendorCredit.formatted_subtotal}
borderStyle={TotalLineBorderStyle.SingleDark}
/>
{vendorCredit.discount_amount_formatted && (
{vendorCredit?.discount_amount_formatted && (
<TotalLine
title={
vendorCredit.discount_percentage_formatted
@@ -36,6 +36,13 @@ export default function VendorCreditDetailDrawerFooter() {
textStyle={TotalLineTextStyle.Regular}
/>
)}
{vendorCredit?.adjustment_formatted && (
<TotalLine
title={'Adjustment'}
value={vendorCredit.adjustment_formatted}
textStyle={TotalLineTextStyle.Regular}
/>
)}
<TotalLine
title={<T id={'vendor_credit.drawer.label_total'} />}
value={vendorCredit.formatted_amount}