mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat: enhance discount and adjustment formatting
This commit is contained in:
@@ -30,7 +30,7 @@ export default function EstimateDetailHeader() {
|
||||
<CommercialDocTopHeader>
|
||||
<DetailsMenu>
|
||||
<AmountEstimateDetail label={intl.get('amount')}>
|
||||
<span class="big-number">{estimate.formatted_amount}</span>
|
||||
<span class="big-number">{estimate.total_formatted}</span>
|
||||
</AmountEstimateDetail>
|
||||
|
||||
<EstimateStatusDetail>
|
||||
|
||||
@@ -25,11 +25,11 @@ export default function EstimateDetailTableFooter() {
|
||||
value={estimate.formatted_subtotal}
|
||||
borderStyle={TotalLineBorderStyle.SingleDark}
|
||||
/>
|
||||
{estimate.discount_amount > 0 && (
|
||||
{estimate?.discount_amount > 0 && (
|
||||
<TotalLine
|
||||
title={
|
||||
estimate.discount_percentage_formatted
|
||||
? `Discount [${invoice.discount_percentage_formatted}]`
|
||||
? `Discount [${estimate.discount_percentage_formatted}]`
|
||||
: 'Discount'
|
||||
}
|
||||
value={estimate.discount_amount_formatted}
|
||||
@@ -38,7 +38,7 @@ export default function EstimateDetailTableFooter() {
|
||||
)}
|
||||
<TotalLine
|
||||
title={<T id={'estimate.details.total'} />}
|
||||
value={estimate.formatted_amount}
|
||||
value={estimate.total_formatted}
|
||||
borderStyle={TotalLineBorderStyle.DoubleDark}
|
||||
textStyle={TotalLineTextStyle.Bold}
|
||||
/>
|
||||
|
||||
@@ -26,7 +26,7 @@ export function InvoiceDetailTableFooter() {
|
||||
value={invoice.subtotal_formatted}
|
||||
borderStyle={TotalLineBorderStyle.SingleDark}
|
||||
/>
|
||||
{invoice.discount_amount > 0 && (
|
||||
{invoice?.discount_amount > 0 && (
|
||||
<TotalLine
|
||||
title={
|
||||
invoice.discount_percentage_formatted
|
||||
@@ -37,14 +37,14 @@ export function InvoiceDetailTableFooter() {
|
||||
textStyle={TotalLineTextStyle.Regular}
|
||||
/>
|
||||
)}
|
||||
{invoice.adjustment > 0 && (
|
||||
{invoice?.adjustment > 0 && (
|
||||
<TotalLine
|
||||
title="Adjustment"
|
||||
value={invoice.adjustment_formatted}
|
||||
textStyle={TotalLineTextStyle.Regular}
|
||||
/>
|
||||
)}
|
||||
{invoice.taxes.map((taxRate) => (
|
||||
{invoice?.taxes?.map((taxRate) => (
|
||||
<TotalLine
|
||||
key={taxRate.id}
|
||||
title={`${taxRate.name} [${taxRate.tax_rate}%]`}
|
||||
|
||||
@@ -25,11 +25,11 @@ export default function VendorCreditDetailDrawerFooter() {
|
||||
value={vendorCredit.formatted_subtotal}
|
||||
borderStyle={TotalLineBorderStyle.SingleDark}
|
||||
/>
|
||||
{vendorCredit.discount_amount > 0 && (
|
||||
{vendorCredit.discount_amount_formatted && (
|
||||
<TotalLine
|
||||
title={
|
||||
bill.discount_percentage_formatted
|
||||
? `Discount [${bill.discount_percentage_formatted}]`
|
||||
vendorCredit.discount_percentage_formatted
|
||||
? `Discount [${vendorCredit.discount_percentage_formatted}]`
|
||||
: 'Discount'
|
||||
}
|
||||
value={vendorCredit.discount_amount_formatted}
|
||||
|
||||
Reference in New Issue
Block a user