fix: display adjustment in minues

This commit is contained in:
Ahmed Bouhuolia
2024-12-08 14:47:03 +02:00
parent 46719ef361
commit 11d7a40326
9 changed files with 29 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ export function BillDetailTableFooter() {
textStyle={TotalLineTextStyle.Regular}
/>
)}
{bill.adjustment > 0 && (
{bill.adjustment_formatted && (
<TotalLine
title={'Adjustment'}
value={bill.adjustment_formatted}

View File

@@ -33,7 +33,7 @@ export default function CreditNoteDetailTableFooter() {
value={creditNote.discount_amount_formatted}
/>
)}
{creditNote.adjustment > 0 && (
{creditNote.adjustment_formatted && (
<TotalLine
title={'Adjustment'}
value={creditNote.adjustment_formatted}

View File

@@ -36,7 +36,7 @@ export default function ReceiptDetailTableFooter() {
textStyle={TotalLineTextStyle.Regular}
/>
)}
{receipt.adjustment > 0 && (
{receipt.adjustment_formatted && (
<TotalLine
title={'Adjustment'}
value={receipt.adjustment_formatted}

View File

@@ -45,7 +45,7 @@ export default function VendorCreditDetailDrawerFooter() {
)}
<TotalLine
title={<T id={'vendor_credit.drawer.label_total'} />}
value={vendorCredit.formatted_amount}
value={vendorCredit.total_formatted}
borderStyle={TotalLineBorderStyle.DoubleDark}
textStyle={TotalLineTextStyle.Bold}
/>

View File

@@ -5,7 +5,6 @@ import styled from 'styled-components';
import { defaultTo } from 'lodash';
import {
FormatDate,
T,
Row,
Col,
@@ -29,13 +28,14 @@ export default function VendorCreditDetailHeader() {
<CommercialDocTopHeader>
<DetailsMenu>
<AmountItem label={intl.get('amount')}>
<span class="big-number">{vendorCredit.formatted_amount}</span>
<span class="big-number">{vendorCredit.total_formatted}</span>
</AmountItem>
<StatusItem>
<VendorCreditDetailsStatus vendorCredit={vendorCredit} />
</StatusItem>
</DetailsMenu>
</CommercialDocTopHeader>
<Row>
<Col xs={6}>
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>

View File

@@ -455,7 +455,7 @@ export const useInvoiceTotal = () => {
return R.compose(
R.when(R.always(isExclusiveTax), R.add(totalTaxAmount)),
R.subtract(R.__, discountAmount),
R.add(R.__, adjustmentAmount),
R.add(adjustmentAmount),
)(subtotal);
};