refactor: Total lines of commercial documents.

This commit is contained in:
a.bouhuolia
2021-12-21 16:51:47 +02:00
parent e2349f1951
commit 588995e759
39 changed files with 447 additions and 349 deletions

View File

@@ -1,11 +1,16 @@
import React from 'react';
import clsx from 'classnames';
import styled from 'styled-components';
import { FormatNumber, T, TotalLines, TotalLine } from '../../../components';
import {
TotalLineBorderStyle,
TotalLineTextStyle,
FormatNumber,
T,
TotalLines,
TotalLine,
} from '../../../components';
import { useBillDrawerContext } from './BillDrawerProvider';
import BillDrawerCls from 'style/components/Drawers/BillDrawer.module.scss';
/**
* Bill read-only details footer.
*/
@@ -13,29 +18,34 @@ export function BillDetailFooter() {
const { bill } = useBillDrawerContext();
return (
<div className={clsx(BillDrawerCls.detail_panel_footer)}>
<TotalLines>
<BillDetailsFooterRoot>
<BillTotalLines labelColWidth={'180px'} amountColWidth={'180px'}>
<TotalLine
title={<T id={'bill.details.subtotal'} />}
value={<FormatNumber value={bill.amount} />}
className={BillDrawerCls.total_line_subtotal}
value={<FormatNumber value={bill.amont} />}
borderStyle={TotalLineBorderStyle.SingleDark}
/>
<TotalLine
title={<T id={'bill.details.total'} />}
value={bill.formatted_amount}
className={BillDrawerCls.total_line_total}
borderStyle={TotalLineBorderStyle.DoubleDark}
textStyle={TotalLineTextStyle.Bold}
/>
<TotalLine
title={<T id={'bill.details.payment_amount'} />}
value={bill.formatted_payment_amount}
className={BillDrawerCls.total_line_payment}
/>
<TotalLine
title={<T id={'bill.details.due_amount'} />}
value={bill.formatted_due_amount}
className={BillDrawerCls.total_line_dueAmount}
/>
</TotalLines>
</div>
</BillTotalLines>
</BillDetailsFooterRoot>
);
}
export const BillDetailsFooterRoot = styled.div``;
export const BillTotalLines = styled(TotalLines)`
margin-left: auto;
`;