Use tenant business payment info for invoice QR codes
This commit is contained in:
@@ -537,6 +537,9 @@ export function getDocumentDataBackend(
|
||||
) {
|
||||
const businessInfo = tenant.businessInfo || {}; // Fallback falls leer
|
||||
const paymentQrBankAccount = bankAccounts.find((account: any) => !account.archived && !account.expired && account.iban) || null
|
||||
const paymentQrIban = businessInfo.iban || paymentQrBankAccount?.iban
|
||||
const paymentQrBic = businessInfo.bic || paymentQrBankAccount?.bic
|
||||
const paymentQrRecipient = businessInfo.bankAccountOwner || paymentQrBankAccount?.ownerName || businessInfo.name || tenant.name
|
||||
|
||||
// --- 1. Agriculture Logic ---
|
||||
// Prüfen ob 'extraModules' existiert, sonst leeres Array annehmen
|
||||
@@ -731,9 +734,10 @@ export function getDocumentDataBackend(
|
||||
agriculture: itemInfo.agriculture,
|
||||
// Falls du AdvanceInvoices brauchst, musst du die Objekte hier übergeben oder leer lassen
|
||||
usedAdvanceInvoices: [],
|
||||
paymentQr: paymentQrBankAccount && itemInfo.payment_type === "transfer" ? {
|
||||
iban: paymentQrBankAccount.iban,
|
||||
recipientName: paymentQrBankAccount.ownerName || businessInfo.name || tenant.name,
|
||||
paymentQr: paymentQrIban && itemInfo.payment_type === "transfer" ? {
|
||||
iban: paymentQrIban,
|
||||
bic: paymentQrBic,
|
||||
recipientName: paymentQrRecipient,
|
||||
amount: totals.totalGross,
|
||||
remittance: itemInfo.documentNumber || itemInfo.title,
|
||||
} : null
|
||||
|
||||
Reference in New Issue
Block a user