mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix: total lines style
This commit is contained in:
@@ -49,7 +49,7 @@ export class SaleReceiptTransformer extends Transformer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve formatted receipt created at date.
|
* Retrieve formatted receipt created at date.
|
||||||
* @param receipt
|
* @param receipt
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
protected formattedCreatedAt = (receipt: ISaleReceipt): string => {
|
protected formattedCreatedAt = (receipt: ISaleReceipt): string => {
|
||||||
@@ -62,7 +62,9 @@ export class SaleReceiptTransformer extends Transformer {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
protected subtotalFormatted = (receipt: ISaleReceipt): string => {
|
protected subtotalFormatted = (receipt: ISaleReceipt): string => {
|
||||||
return formatNumber(receipt.subtotal, { money: false });
|
return formatNumber(receipt.subtotal, {
|
||||||
|
currencyCode: receipt.currencyCode,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,7 +84,7 @@ export class SaleReceiptTransformer extends Transformer {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
protected totalFormatted = (receipt: ISaleReceipt): string => {
|
protected totalFormatted = (receipt: ISaleReceipt): string => {
|
||||||
return formatNumber(receipt.total, { money: false });
|
return formatNumber(receipt.total, { currencyCode: receipt.currencyCode });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,7 +93,9 @@ export class SaleReceiptTransformer extends Transformer {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
protected totalLocalFormatted = (receipt: ISaleReceipt): string => {
|
protected totalLocalFormatted = (receipt: ISaleReceipt): string => {
|
||||||
return formatNumber(receipt.totalLocal, { money: false });
|
return formatNumber(receipt.totalLocal, {
|
||||||
|
currencyCode: receipt.currencyCode,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -123,9 +127,7 @@ export class SaleReceiptTransformer extends Transformer {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
protected discountPercentageFormatted = (receipt: ISaleReceipt): string => {
|
protected discountPercentageFormatted = (receipt: ISaleReceipt): string => {
|
||||||
return receipt.discountPercentage
|
return receipt.discountPercentage ? `${receipt.discountPercentage}%` : '';
|
||||||
? `${receipt.discountPercentage}%`
|
|
||||||
: '';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ export default function EstimateFromCurrencyTag() {
|
|||||||
if (!isForeignCustomer) {
|
if (!isForeignCustomer) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseCurrencyRoot>
|
<BaseCurrencyRoot>
|
||||||
<BaseCurrency currency={selectCustomer?.currency_code} />
|
<BaseCurrency currency={selectCustomer?.currency_code} />
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import isEmpty from 'lodash/isEmpty';
|
||||||
import { Box } from '../lib/layout/Box';
|
import { Box } from '../lib/layout/Box';
|
||||||
import { Text } from '../lib/text/Text';
|
import { Text } from '../lib/text/Text';
|
||||||
import { Stack } from '../lib/layout/Stack';
|
import { Stack } from '../lib/layout/Stack';
|
||||||
@@ -10,7 +11,11 @@ import {
|
|||||||
DefaultPdfTemplateAddressBilledTo,
|
DefaultPdfTemplateAddressBilledTo,
|
||||||
DefaultPdfTemplateAddressBilledFrom,
|
DefaultPdfTemplateAddressBilledFrom,
|
||||||
} from './_constants';
|
} from './_constants';
|
||||||
import { PaperTemplate, PaperTemplateProps } from './PaperTemplate';
|
import {
|
||||||
|
PaperTemplate,
|
||||||
|
PaperTemplateProps,
|
||||||
|
PaperTemplateTotalBorder,
|
||||||
|
} from './PaperTemplate';
|
||||||
|
|
||||||
export interface EstimatePaperTemplateProps extends PaperTemplateProps {
|
export interface EstimatePaperTemplateProps extends PaperTemplateProps {
|
||||||
// # Company
|
// # Company
|
||||||
@@ -242,33 +247,40 @@ export function EstimatePaperTemplate({
|
|||||||
<PaperTemplate.TotalLine
|
<PaperTemplate.TotalLine
|
||||||
label={subtotalLabel}
|
label={subtotalLabel}
|
||||||
amount={subtotal}
|
amount={subtotal}
|
||||||
|
border={PaperTemplateTotalBorder.Gray}
|
||||||
|
style={{ fontWeight: 500 }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showDiscount && discount && (
|
{showDiscount && !isEmpty(discount) && (
|
||||||
<PaperTemplate.TotalLine
|
<PaperTemplate.TotalLine
|
||||||
label={discountLabel}
|
label={discountLabel}
|
||||||
amount={discount}
|
amount={discount}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showAdjustment && adjustment && (
|
{showAdjustment && !isEmpty(adjustment) && (
|
||||||
<PaperTemplate.TotalLine
|
<PaperTemplate.TotalLine
|
||||||
label={adjustmentLabel}
|
label={adjustmentLabel}
|
||||||
amount={adjustment}
|
amount={adjustment}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showTotal && (
|
{showTotal && (
|
||||||
<PaperTemplate.TotalLine label={totalLabel} amount={total} />
|
<PaperTemplate.TotalLine
|
||||||
|
label={totalLabel}
|
||||||
|
amount={total}
|
||||||
|
border={PaperTemplateTotalBorder.Dark}
|
||||||
|
style={{ fontWeight: 500 }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</PaperTemplate.Totals>
|
</PaperTemplate.Totals>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
{showCustomerNote && (
|
{showCustomerNote && !isEmpty(customerNote) && (
|
||||||
<PaperTemplate.Statement label={customerNoteLabel}>
|
<PaperTemplate.Statement label={customerNoteLabel}>
|
||||||
{customerNote}
|
{customerNote}
|
||||||
</PaperTemplate.Statement>
|
</PaperTemplate.Statement>
|
||||||
)}
|
)}
|
||||||
{showTermsConditions && (
|
{showTermsConditions && !isEmpty(termsConditions) && (
|
||||||
<PaperTemplate.Statement label={termsConditionsLabel}>
|
<PaperTemplate.Statement label={termsConditionsLabel}>
|
||||||
{termsConditions}
|
{termsConditions}
|
||||||
</PaperTemplate.Statement>
|
</PaperTemplate.Statement>
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
|
import isEmpty from 'lodash/isEmpty';
|
||||||
import { Box } from '../lib/layout/Box';
|
import { Box } from '../lib/layout/Box';
|
||||||
import { Text } from '../lib/text/Text';
|
import { Text } from '../lib/text/Text';
|
||||||
import { Stack } from '../lib/layout/Stack';
|
import { Stack } from '../lib/layout/Stack';
|
||||||
import { Group } from '../lib/layout/Group';
|
import { Group } from '../lib/layout/Group';
|
||||||
import { PaperTemplate, PaperTemplateProps } from './PaperTemplate';
|
import {
|
||||||
|
PaperTemplate,
|
||||||
|
PaperTemplateProps,
|
||||||
|
PaperTemplateTotalBorder,
|
||||||
|
} from './PaperTemplate';
|
||||||
import {
|
import {
|
||||||
DefaultPdfTemplateTerms,
|
DefaultPdfTemplateTerms,
|
||||||
DefaultPdfTemplateItemDescription,
|
DefaultPdfTemplateItemDescription,
|
||||||
@@ -230,6 +235,8 @@ export function ReceiptPaperTemplate({
|
|||||||
<PaperTemplate.TotalLine
|
<PaperTemplate.TotalLine
|
||||||
label={subtotalLabel}
|
label={subtotalLabel}
|
||||||
amount={subtotal}
|
amount={subtotal}
|
||||||
|
border={PaperTemplateTotalBorder.Gray}
|
||||||
|
style={{ fontWeight: 500 }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showDiscount && discount && (
|
{showDiscount && discount && (
|
||||||
@@ -245,18 +252,24 @@ export function ReceiptPaperTemplate({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showTotal && (
|
{showTotal && (
|
||||||
<PaperTemplate.TotalLine label={totalLabel} amount={total} />
|
<PaperTemplate.TotalLine
|
||||||
|
label={totalLabel}
|
||||||
|
amount={total}
|
||||||
|
border={PaperTemplateTotalBorder.Gray}
|
||||||
|
style={{ fontWeight: 500 }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</PaperTemplate.Totals>
|
</PaperTemplate.Totals>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
{showCustomerNote && (
|
{showCustomerNote && !isEmpty(customerNote) && (
|
||||||
<PaperTemplate.Statement label={customerNoteLabel}>
|
<PaperTemplate.Statement label={customerNoteLabel}>
|
||||||
{customerNote}
|
{customerNote}
|
||||||
</PaperTemplate.Statement>
|
</PaperTemplate.Statement>
|
||||||
)}
|
)}
|
||||||
{showTermsConditions && (
|
|
||||||
|
{showTermsConditions && !isEmpty(termsConditions) && (
|
||||||
<PaperTemplate.Statement label={termsConditionsLabel}>
|
<PaperTemplate.Statement label={termsConditionsLabel}>
|
||||||
{termsConditions}
|
{termsConditions}
|
||||||
</PaperTemplate.Statement>
|
</PaperTemplate.Statement>
|
||||||
|
|||||||
Reference in New Issue
Block a user