fix(documents): include foreign country in recipient address
This commit is contained in:
@@ -675,6 +675,7 @@ export function getDocumentDataBackend(
|
|||||||
// --- 7. Construct Final Object ---
|
// --- 7. Construct Final Object ---
|
||||||
|
|
||||||
// Adresse aufbereiten
|
// Adresse aufbereiten
|
||||||
|
const recipientCountry = String(itemInfo.address?.country ?? customerData.infoData?.country ?? customerData.country ?? "").trim();
|
||||||
const recipientArray = [
|
const recipientArray = [
|
||||||
customerData.name,
|
customerData.name,
|
||||||
...(customerData.nameAddition ? [customerData.nameAddition] : []),
|
...(customerData.nameAddition ? [customerData.nameAddition] : []),
|
||||||
@@ -682,6 +683,7 @@ export function getDocumentDataBackend(
|
|||||||
itemInfo.address?.street || customerData.street || "",
|
itemInfo.address?.street || customerData.street || "",
|
||||||
...(itemInfo.address?.special ? [itemInfo.address.special] : []),
|
...(itemInfo.address?.special ? [itemInfo.address.special] : []),
|
||||||
`${itemInfo.address?.zip || customerData.zip} ${itemInfo.address?.city || customerData.city}`,
|
`${itemInfo.address?.zip || customerData.zip} ${itemInfo.address?.city || customerData.city}`,
|
||||||
|
...(recipientCountry && recipientCountry.toLocaleLowerCase("de") !== "deutschland" ? [recipientCountry] : []),
|
||||||
].filter(Boolean); // Leere Einträge entfernen
|
].filter(Boolean); // Leere Einträge entfernen
|
||||||
|
|
||||||
console.log(contactPerson)
|
console.log(contactPerson)
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ const itemInfo = ref({
|
|||||||
special: null,
|
special: null,
|
||||||
zip: null,
|
zip: null,
|
||||||
city: null,
|
city: null,
|
||||||
|
country: null,
|
||||||
},
|
},
|
||||||
project: null,
|
project: null,
|
||||||
costcentre: null,
|
costcentre: null,
|
||||||
@@ -791,6 +792,7 @@ const setCustomerData = async (customerId, loadOnlyAdress = false) => {
|
|||||||
itemInfo.value.address.zip = customer.infoData.zip
|
itemInfo.value.address.zip = customer.infoData.zip
|
||||||
itemInfo.value.address.city = customer.infoData.city
|
itemInfo.value.address.city = customer.infoData.city
|
||||||
itemInfo.value.address.special = customer.infoData.special
|
itemInfo.value.address.special = customer.infoData.special
|
||||||
|
itemInfo.value.address.country = customer.infoData.country
|
||||||
|
|
||||||
if (!loadOnlyAdress && customer.customPaymentDays) itemInfo.value.paymentDays = customer.customPaymentDays
|
if (!loadOnlyAdress && customer.customPaymentDays) itemInfo.value.paymentDays = customer.customPaymentDays
|
||||||
if (!loadOnlyAdress && customer.custom_payment_type) itemInfo.value.payment_type = customer.custom_payment_type
|
if (!loadOnlyAdress && customer.custom_payment_type) itemInfo.value.payment_type = customer.custom_payment_type
|
||||||
@@ -1542,6 +1544,8 @@ const getDocumentData = async () => {
|
|||||||
console.log(returnTitleSumsTransfer)
|
console.log(returnTitleSumsTransfer)
|
||||||
|
|
||||||
|
|
||||||
|
const recipientCountry = String(itemInfo.value.address.country ?? customerData.infoData?.country ?? "").trim()
|
||||||
|
|
||||||
const returnData = {
|
const returnData = {
|
||||||
type: itemInfo.value.type,
|
type: itemInfo.value.type,
|
||||||
taxType: itemInfo.value.taxType,
|
taxType: itemInfo.value.taxType,
|
||||||
@@ -1561,6 +1565,7 @@ const getDocumentData = async () => {
|
|||||||
itemInfo.value.address.street,
|
itemInfo.value.address.street,
|
||||||
...itemInfo.value.address.special ? [itemInfo.value.address.special] : [],
|
...itemInfo.value.address.special ? [itemInfo.value.address.special] : [],
|
||||||
`${itemInfo.value.address.zip} ${itemInfo.value.address.city}`,
|
`${itemInfo.value.address.zip} ${itemInfo.value.address.city}`,
|
||||||
|
...(recipientCountry && recipientCountry.toLocaleLowerCase("de") !== "deutschland" ? [recipientCountry] : []),
|
||||||
|
|
||||||
],
|
],
|
||||||
/*info: {
|
/*info: {
|
||||||
|
|||||||
Reference in New Issue
Block a user