diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 9a3139c..60f0efd 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -39,6 +39,7 @@ const itemInfo = ref({ deliveryDateType: "Lieferdatum", dateOfPerformance: null, paymentDays: profileStore.ownTenant.standardPaymentDays, + customSurchargePercentage: 0, createdBy: profileStore.activeProfile.id, title: null, description: null, @@ -333,6 +334,12 @@ const setCustomerData = () => { if(customer.customPaymentDays) itemInfo.value.paymentDays = customer.customPaymentDays + if(customer.customSurchargePercentage) itemInfo.value.customSurchargePercentage = customer.customSurchargePercentage + + if(contacts.value.filter(i => i.customer === itemInfo.value.customer).length === 1) { + itemInfo.value.contact = contacts.value.filter(i => i.customer === itemInfo.value.customer)[0].id + } + } @@ -504,7 +511,7 @@ const findDocumentErrors = computed(() => { if(!row.taxPercent && typeof row.taxPercent !== "number") errors.push({message: `In Position ${row.pos} ist kein Steuersatz hinterlegt`, type: "breaking"}) if(!row.price && typeof row.price !== "number") errors.push({message: `In Position ${row.pos} ist kein Preis hinterlegt`, type: "breaking"}) - + if(!row.unit) errors.push({message: `In Position ${row.pos} ist keine Einheit hinterlegt`, type: "breaking"}) }