Use tenant business payment info for invoice QR codes
This commit is contained in:
@@ -1411,8 +1411,11 @@ const getDocumentData = async () => {
|
||||
|
||||
let customerData = customers.value.find(i => i.id === itemInfo.value.customer)
|
||||
let contactData = contacts.value.find(i => i.id === itemInfo.value.contact)
|
||||
let businessInfo = auth.activeTenantData.businessInfo
|
||||
let businessInfo = auth.activeTenantData.businessInfo || {}
|
||||
const paymentQrBankAccount = bankaccounts.value.find(account => !account.archived && !account.expired && account.iban)
|
||||
const paymentQrIban = businessInfo.iban || paymentQrBankAccount?.iban
|
||||
const paymentQrBic = businessInfo.bic || paymentQrBankAccount?.bic
|
||||
const paymentQrRecipient = businessInfo.bankAccountOwner || paymentQrBankAccount?.ownerName || businessInfo.name || auth.activeTenantData.name
|
||||
|
||||
if (auth.activeTenantData.extraModules.includes("agriculture")) {
|
||||
itemInfo.value.rows.forEach(row => {
|
||||
@@ -1629,9 +1632,10 @@ const getDocumentData = async () => {
|
||||
usedAdvanceInvoices: itemInfo.value.usedAdvanceInvoices.map(i => {
|
||||
return createddocuments.value.find(x => x.id === i)
|
||||
}),
|
||||
paymentQr: paymentQrBankAccount && itemInfo.value.payment_type === "transfer" ? {
|
||||
iban: paymentQrBankAccount.iban,
|
||||
recipientName: paymentQrBankAccount.ownerName || businessInfo.name || auth.activeTenantData.name,
|
||||
paymentQr: paymentQrIban && itemInfo.value.payment_type === "transfer" ? {
|
||||
iban: paymentQrIban,
|
||||
bic: paymentQrBic,
|
||||
recipientName: paymentQrRecipient,
|
||||
amount: documentTotal.value.totalSumToPay,
|
||||
remittance: itemInfo.value.documentNumber || itemInfo.value.title,
|
||||
} : null
|
||||
|
||||
Reference in New Issue
Block a user