bp - taxID now used when billing fee
MODIFY
src/integration/billing/stripe/StripeBillingIntegration.ts
src/integration/billing/stripe/StripeBillingIntegration.ts
@@ -1775,7 +1775,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
});
}
// Add items to the invoice
- await this.addItemsToPlatformFeeInvoice(stripeInvoice, billingTransfer, user, billingAccount);
+ await this.addItemsToPlatformFeeInvoice(stripeInvoice, billingTransfer, user, billingAccount, this.settings.billing?.platformFeeTaxID);
// Mark the invoice as paid
const stripePaidInvoice = await this.markStripeInvoiceAsPaid(stripeInvoice);
// Preserve some information
@@ -1809,7 +1809,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
}
}
- private async addItemsToPlatformFeeInvoice(stripeInvoice: Stripe.Invoice, billingTransfer: BillingTransfer, user: User, billingAccount: BillingAccount): Promise<void> {
+ private async addItemsToPlatformFeeInvoice(stripeInvoice: Stripe.Invoice, billingTransfer: BillingTransfer, user: User, billingAccount: BillingAccount, taxID: string): Promise<void> {
// Create invoice items
try {
// Convert to cents
@@ -1817,7 +1817,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
// Generate the invoice item
const description = this.buildTransferFeeItemDescription(user, billingTransfer.sessionCounter);
// A single tax rate per session
- const tax_rates = (billingAccount.taxID) ? [billingAccount.taxID] : [] ;
+ const tax_rates = (taxID) ? [taxID] : [] ;
// Prepare item parameters
const parameters: Stripe.InvoiceItemCreateParams = {
invoice: stripeInvoice.id,

MODIFY
src/server/rest/v1/service/BillingService.ts
src/server/rest/v1/service/BillingService.ts
@@ -603,7 +603,6 @@ export default class BillingService {
businessOwnerID: user.id,
status: BillingAccountStatus.IDLE,
accountExternalID: null,
- taxID: filteredRequest.taxID,
createdBy: { id: req.user.id },
createdOn: new Date(),
companyName: filteredRequest.companyName

MODIFY
src/storage/mongodb/BillingStorage.ts
src/storage/mongodb/BillingStorage.ts
@@ -213,7 +213,6 @@ export default class BillingStorage {
status: billingAccount.status,
businessOwnerID: DatabaseUtils.convertToObjectID(billingAccount.businessOwnerID),
accountExternalID: billingAccount.accountExternalID,
- taxID: billingAccount.taxID,
activationLink: billingAccount.activationLink, // Should not be persisted - added here only for troubleshooting purposes
companyName: billingAccount.companyName
};

MODIFY
src/types/Billing.ts
src/types/Billing.ts
@@ -167,7 +167,6 @@ export interface BillingAccount extends CreatedUpdatedProps, BillingTransferAuth
status: BillingAccountStatus;
activationLink?: string;
accountExternalID: string;
- taxID: string;
}
export interface BillingAccountData {

bp - taxID now used when billing fee