mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: link discount to mail receipts
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { x } from '@xstyled/emotion';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { Group, Stack } from '@/components';
|
||||
import {
|
||||
SendMailReceipt,
|
||||
@@ -14,6 +15,14 @@ export interface EstimateSendMailReceiptProps extends SendMailReceiptProps {
|
||||
estimateNumberLabel?: string;
|
||||
estimateNumber: string;
|
||||
|
||||
// # Discount
|
||||
discount?: string;
|
||||
discountLabel?: string;
|
||||
|
||||
// # Adjustment
|
||||
adjustment?: string;
|
||||
adjsutmentLabel?: string;
|
||||
|
||||
// # Total.
|
||||
total: string;
|
||||
totalLabel?: string;
|
||||
@@ -47,10 +56,6 @@ export function EstimateSendMailReceipt({
|
||||
estimateNumberLabel = 'Estimate #',
|
||||
estimateNumber,
|
||||
|
||||
// # Total.
|
||||
total,
|
||||
totalLabel = 'Total',
|
||||
|
||||
// # Expiration date.
|
||||
expirationDateLabel = 'Expiration Date',
|
||||
expirationDate,
|
||||
@@ -65,6 +70,18 @@ export function EstimateSendMailReceipt({
|
||||
subtotal,
|
||||
subtotalLabel = 'Subtotal',
|
||||
|
||||
// # Discount
|
||||
discount,
|
||||
discountLabel = 'Discount',
|
||||
|
||||
// # Adjustment
|
||||
adjustment,
|
||||
adjsutmentLabel = 'Adjustment',
|
||||
|
||||
// # Total.
|
||||
total,
|
||||
totalLabel = 'Total',
|
||||
|
||||
// # View estimate button
|
||||
showViewEstimateButton = true,
|
||||
viewEstimateButtonLabel = 'View Estimate',
|
||||
@@ -142,6 +159,36 @@ export function EstimateSendMailReceipt({
|
||||
</x.span>
|
||||
</Group>
|
||||
|
||||
{!isEmpty(discount) && (
|
||||
<Group
|
||||
h={'40px'}
|
||||
position={'apart'}
|
||||
borderBottomStyle="solid"
|
||||
borderBottomWidth={'1px'}
|
||||
borderBottomColor={'#D9D9D9'}
|
||||
>
|
||||
<x.span fontWeight={500}>{discountLabel}</x.span>
|
||||
<x.span fontWeight={600} fontSize={15}>
|
||||
{discount}
|
||||
</x.span>
|
||||
</Group>
|
||||
)}
|
||||
|
||||
{!isEmpty(adjustment) && (
|
||||
<Group
|
||||
h={'40px'}
|
||||
position={'apart'}
|
||||
borderBottomStyle="solid"
|
||||
borderBottomWidth={'1px'}
|
||||
borderBottomColor={'#D9D9D9'}
|
||||
>
|
||||
<x.span fontWeight={500}>{adjsutmentLabel}</x.span>
|
||||
<x.span fontWeight={600} fontSize={15}>
|
||||
{adjustment}
|
||||
</x.span>
|
||||
</Group>
|
||||
)}
|
||||
|
||||
<Group
|
||||
h={'40px'}
|
||||
position={'apart'}
|
||||
|
||||
@@ -35,6 +35,9 @@ export const withEstimateMailReceiptPreviewProps = <
|
||||
expirationDate: estimateMailState?.expirationDateFormatted,
|
||||
estimateNumber: estimateMailState?.estimateNumber,
|
||||
estimateDate: estimateMailState?.estimateDateFormatted,
|
||||
subtotal: estimateMailState?.subtotalFormatted,
|
||||
discount: estimateMailState?.discountFormatted,
|
||||
adjustment: estimateMailState?.adjustmentFormatted,
|
||||
items,
|
||||
message,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user