Skip to content

Commit

Permalink
Import fixes + unused params
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsugo authored and mpfau committed Nov 25, 2024
1 parent 125f41d commit 2f5172f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/common/api/worker/facades/lazy/CustomerFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
createMembershipRemoveData,
createPaymentDataServicePutData,
CustomDomainReturn,
Customer,
CustomerInfoTypeRef,
CustomerServerProperties,
CustomerServerPropertiesTypeRef,
Expand Down Expand Up @@ -71,7 +70,6 @@ import { KeyLoaderFacade } from "../KeyLoaderFacade.js"
import { RecoverCodeFacade } from "./RecoverCodeFacade.js"
import { encryptKeyWithVersionedKey, VersionedEncryptedKey, VersionedKey } from "../../crypto/CryptoWrapper.js"
import { AsymmetricCryptoFacade } from "../../crypto/AsymmetricCryptoFacade.js"
import { XRechnungInvoiceGenerator } from "../../invoicegen/XRechnungInvoiceGenerator.js"

assertWorkerOrNode()

Expand Down Expand Up @@ -465,9 +463,11 @@ export class CustomerFacade {
}
}

async generateXRechnungInvoice(invoiceNumber: string, customer: Customer, accountingInfo: AccountingInfo): Promise<DataFile> {
async generateXRechnungInvoice(invoiceNumber: string): Promise<DataFile> {
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 { XRechnungInvoiceGenerator } = await import("../../invoicegen/XRechnungInvoiceGenerator.js")
const xRechnungGenerator = new XRechnungInvoiceGenerator(invoiceData, invoiceNumber, this.getCustomerId(), customerInfo.registrationMailAddress)
const xRechnungFile = xRechnungGenerator.generate()
return {
Expand Down
3 changes: 0 additions & 3 deletions src/common/api/worker/pdf/PdfDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,6 @@ export class PdfDocument {
let tableHeight = this.addTablePage(position, tableWidth, columns, data.slice(0, entriesOnFirstPage))
let entryCounter = entriesOnFirstPage

// only two fit on first page to then have enough space to render the BIGGEST, we have three so we new page
// BIGGEST is German or Enligsh (its close) invoice + not vat + vatid

// Keep writing pages of entries until all data is exhausted
while (entryCounter < data.length) {
await this.addPage()
Expand Down
4 changes: 1 addition & 3 deletions src/common/subscription/PaymentViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
)
}

Expand Down

0 comments on commit 2f5172f

Please sign in to comment.