import { Box } from '../lib/layout/Box'; import { Stack } from '../lib/layout/Stack'; import { Group } from '../lib/layout/Group'; import { PaperTemplate, PaperTemplateProps, PaperTemplateTotalBorder, } from './PaperTemplate'; import { DefaultPdfTemplateAddressBilledFrom, DefaultPdfTemplateAddressBilledTo, } from './_constants'; export interface PaymentReceivedPaperTemplateProps extends PaperTemplateProps { // # Company logo showCompanyLogo?: boolean; companyLogoUri?: string; // # Company name companyName?: string; // Customer address showCustomerAddress?: boolean; customerAddress?: string; // Company address showCompanyAddress?: boolean; companyAddress?: string; billedToLabel?: string; // Total. total?: string; showTotal?: boolean; totalLabel?: string; // Subtotal. subtotal?: string; showSubtotal?: boolean; subtotalLabel?: string; lines?: Array<{ paidAmount: string; invoiceAmount: string; invoiceNumber: string; }>; // Issue date. paymentReceivedDateLabel?: string; showPaymentReceivedDate?: boolean; paymentReceivedDate?: string; // Payment received number. paymentReceivedNumebr?: string; paymentReceivedNumberLabel?: string; showPaymentReceivedNumber?: boolean; } export function PaymentReceivedPaperTemplate({ // # Colors primaryColor, secondaryColor, // # Company logo showCompanyLogo = true, companyLogoUri, // # Company name companyName = 'Bigcapital Technology, Inc.', // # Customer address showCustomerAddress = true, customerAddress = DefaultPdfTemplateAddressBilledTo, // # Company address showCompanyAddress = true, companyAddress = DefaultPdfTemplateAddressBilledFrom, billedToLabel = 'Billed To', total = '$1000.00', totalLabel = 'Total', showTotal = true, subtotal = '1000/00', subtotalLabel = 'Subtotal', showSubtotal = true, lines = [ { invoiceNumber: 'INV-00001', invoiceAmount: '$1000.00', paidAmount: '$1000.00', }, ], showPaymentReceivedNumber = true, paymentReceivedNumberLabel = 'Payment Number', paymentReceivedNumebr = '346D3D40-0001', paymentReceivedDate = 'September 3, 2024', showPaymentReceivedDate = true, paymentReceivedDateLabel = 'Payment Date', }: PaymentReceivedPaperTemplateProps) { return ( {showPaymentReceivedNumber && ( {paymentReceivedNumebr} )} {showPaymentReceivedDate && ( {paymentReceivedDate} )} {companyLogoUri && showCompanyLogo && ( )} {showCompanyAddress && ( )} {showCustomerAddress && ( {billedToLabel} )} {showSubtotal && ( )} {showTotal && ( )} ); }