mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix: payment page
This commit is contained in:
@@ -21,7 +21,7 @@ export class GetPaymentServicesSpecificInvoice {
|
||||
const { PaymentIntegration } = this.tenancy.models(tenantId);
|
||||
|
||||
const paymentGateways = await PaymentIntegration.query()
|
||||
.where('active', true)
|
||||
.modify('fullEnabled')
|
||||
.orderBy('name', 'ASC');
|
||||
|
||||
return this.transform.transform(
|
||||
|
||||
@@ -44,6 +44,7 @@ export class GetInvoicePaymentLinkMetadata {
|
||||
.findById(paymentLink.resourceId)
|
||||
.withGraphFetched('entries.item')
|
||||
.withGraphFetched('customer')
|
||||
.withGraphFetched('taxes.taxRate')
|
||||
.throwIfNotFound();
|
||||
|
||||
return this.transformer.transform(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ItemEntryTransformer } from './ItemEntryTransformer';
|
||||
import { SaleInvoiceTaxEntryTransformer } from './SaleInvoiceTaxEntryTransformer';
|
||||
import { SaleInvoiceTransformer } from './SaleInvoiceTransformer';
|
||||
|
||||
export class GetInvoicePaymentLinkMetaTransformer extends SaleInvoiceTransformer {
|
||||
@@ -37,6 +38,7 @@ export class GetInvoicePaymentLinkMetaTransformer extends SaleInvoiceTransformer
|
||||
'invoiceMessage',
|
||||
'termsConditions',
|
||||
'entries',
|
||||
'taxes',
|
||||
];
|
||||
};
|
||||
|
||||
@@ -62,6 +64,22 @@ export class GetInvoicePaymentLinkMetaTransformer extends SaleInvoiceTransformer
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the sale invoice entries.
|
||||
* @returns {}
|
||||
*/
|
||||
protected taxes = (invoice) => {
|
||||
return this.item(
|
||||
invoice.taxes,
|
||||
new GetInvoicePaymentLinkTaxEntryTransformer(),
|
||||
{
|
||||
subtotal: invoice.subtotal,
|
||||
isInclusiveTax: invoice.isInclusiveTax,
|
||||
currencyCode: invoice.currencyCode,
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
class GetInvoicePaymentLinkEntryMetaTransformer extends ItemEntryTransformer {
|
||||
@@ -94,3 +112,13 @@ class GetInvoicePaymentLinkEntryMetaTransformer extends ItemEntryTransformer {
|
||||
return ['*'];
|
||||
};
|
||||
}
|
||||
|
||||
class GetInvoicePaymentLinkTaxEntryTransformer extends SaleInvoiceTaxEntryTransformer {
|
||||
/**
|
||||
* Included attributes.
|
||||
* @returns {Array}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return ['name', 'taxRateCode', 'taxRateAmount', 'taxRateAmountFormatted'];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user