mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: Hook up customer/company address to invoice preview of payment page
This commit is contained in:
@@ -3,6 +3,7 @@ import { ItemEntryTransformer } from './ItemEntryTransformer';
|
||||
import { SaleInvoiceTaxEntryTransformer } from './SaleInvoiceTaxEntryTransformer';
|
||||
import { SaleInvoiceTransformer } from './SaleInvoiceTransformer';
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
import { contactAddressTextFormat } from '@/utils/address-text-format';
|
||||
|
||||
export class GetInvoicePaymentLinkMetaTransformer extends SaleInvoiceTransformer {
|
||||
/**
|
||||
@@ -43,6 +44,7 @@ export class GetInvoicePaymentLinkMetaTransformer extends SaleInvoiceTransformer
|
||||
'organization',
|
||||
'isReceivable',
|
||||
'hasStripePaymentMethod',
|
||||
'formattedCustomerAddress',
|
||||
];
|
||||
};
|
||||
|
||||
@@ -101,6 +103,14 @@ export class GetInvoicePaymentLinkMetaTransformer extends SaleInvoiceTransformer
|
||||
(paymentMethod) => paymentMethod.paymentIntegration.service === 'Stripe'
|
||||
);
|
||||
}
|
||||
|
||||
protected formattedCustomerAddress(invoice) {
|
||||
return contactAddressTextFormat(invoice.customer, `{ADDRESS_1}
|
||||
{ADDRESS_2}
|
||||
{CITY}, {STATE} {POSTAL_CODE}
|
||||
{COUNTRY}
|
||||
{PHONE}`);
|
||||
}
|
||||
}
|
||||
|
||||
class GetPaymentLinkOrganizationMetaTransformer extends Transformer {
|
||||
|
||||
Reference in New Issue
Block a user