diff --git a/src/common/api/worker/facades/lazy/CustomerFacade.ts b/src/common/api/worker/facades/lazy/CustomerFacade.ts index 5de14062b5d..31dc9656d68 100644 --- a/src/common/api/worker/facades/lazy/CustomerFacade.ts +++ b/src/common/api/worker/facades/lazy/CustomerFacade.ts @@ -23,7 +23,6 @@ import { createMembershipRemoveData, createPaymentDataServicePutData, CustomDomainReturn, - Customer, CustomerInfoTypeRef, CustomerServerProperties, CustomerServerPropertiesTypeRef, @@ -465,7 +464,8 @@ export class CustomerFacade { } } - async generateXRechnungInvoice(invoiceNumber: string, customer: Customer, accountingInfo: AccountingInfo): Promise { + async generateXRechnungInvoice(invoiceNumber: string): Promise { + const customer = await this.entityClient.load(CustomerTypeRef, assertNotNull(this.userFacade.getUser()?.customer)) const customerInfo = await this.entityClient.load(CustomerInfoTypeRef, customer.customerInfo) const invoiceData = await this.serviceExecutor.get(InvoiceDataService, createInvoiceDataGetIn({ invoiceNumber })) const xRechnungGenerator = new XRechnungInvoiceGenerator(invoiceData, invoiceNumber, this.getCustomerId(), customerInfo.registrationMailAddress) diff --git a/src/common/subscription/PaymentViewer.ts b/src/common/subscription/PaymentViewer.ts index a52d0e5256f..2a40b8ce098 100644 --- a/src/common/subscription/PaymentViewer.ts +++ b/src/common/subscription/PaymentViewer.ts @@ -364,9 +364,7 @@ export class PaymentViewer implements UpdatableSettingsViewer { private async doXrechnungInvoiceDownload(posting: CustomerAccountPosting) { return showProgressDialog( "pleaseWait_msg", - locator.customerFacade - .generateXRechnungInvoice(neverNull(posting.invoiceNumber), neverNull(this.customer), neverNull(this.accountingInfo)) - .then((xInvoice) => locator.fileController.saveDataFile(xInvoice)), + locator.customerFacade.generateXRechnungInvoice(neverNull(posting.invoiceNumber)).then((xInvoice) => locator.fileController.saveDataFile(xInvoice)), ) }