Removed Title from Freitext
Correct Advance Invoice Loading
This commit is contained in:
@@ -101,6 +101,8 @@ const setupPage = async () => {
|
||||
if(route.params) {
|
||||
if(route.params.id) itemInfo.value = await useSupabaseSelectSingle("createddocuments", route.params.id)
|
||||
|
||||
if(itemInfo.value.project) checkForOpenAdvanceInvoices()
|
||||
|
||||
if(!itemInfo.value.deliveryDateType) itemInfo.value.deliveryDateType = "Lieferdatum"
|
||||
|
||||
if(itemInfo.value.rows.find(i => i.agriculture)) {
|
||||
@@ -235,6 +237,8 @@ const setupPage = async () => {
|
||||
itemInfo.value.description = project.customerRef
|
||||
}
|
||||
|
||||
checkForOpenAdvanceInvoices()
|
||||
|
||||
}
|
||||
|
||||
if(route.query.plant) {
|
||||
@@ -257,6 +261,7 @@ const setupPage = async () => {
|
||||
setupPage()
|
||||
const openAdvanceInvoices = ref([])
|
||||
const checkForOpenAdvanceInvoices = async () => {
|
||||
console.log("Check for Open Advance Invoices")
|
||||
const {data,error} = await supabase.from("createddocuments").select().eq("project", itemInfo.value.project).eq("advanceInvoiceResolved", false).eq("type","advanceInvoices")
|
||||
|
||||
console.log(data)
|
||||
@@ -293,7 +298,7 @@ const setDocumentTypeConfig = (withTexts = false) => {
|
||||
|
||||
itemInfo.value.letterhead = letterheads.value[0].id
|
||||
|
||||
if(itemInfo.value.type === "advanceInvoices") {
|
||||
if(itemInfo.value.type === "advanceInvoices" && !itemInfo.value.rows.find(i => i.text === "Abschlagszahlung")) {
|
||||
|
||||
|
||||
itemInfo.value.rows.push({
|
||||
@@ -510,7 +515,7 @@ const findDocumentErrors = computed(() => {
|
||||
if(row.mode === "normal" && !row.product) errors.push({message: `In Position ${row.pos} ist kein Artikel ausgewählt`, type: "breaking"})
|
||||
if(row.mode === "service" && !row.service) errors.push({message: `In Position ${row.pos} ist keine Leistung ausgewählt`, type: "breaking"})
|
||||
if(row.mode === "title" && !row.text) errors.push({message: `In Position ${row.pos} ist kein Titel hinterlegt`, type: "breaking"})
|
||||
if(row.mode === "text" && !row.text) errors.push({message: `In einer Freitext Position ist kein Titel hinterlegt`, type: "breaking"})
|
||||
//if(row.mode === "text" && !row.text) errors.push({message: `In einer Freitext Position ist kein Titel hinterlegt`, type: "breaking"})
|
||||
if(row.mode === "free" && !row.text) errors.push({message: `In einer freien Position ist kein Titel hinterlegt`, type: "breaking"})
|
||||
|
||||
if(["normal","service","free"].includes(row.mode)){
|
||||
@@ -1847,13 +1852,12 @@ const setRowData = (row) => {
|
||||
v-if="row.mode === 'text'"
|
||||
colspan="9"
|
||||
>
|
||||
<UInput
|
||||
<!-- <UInput
|
||||
v-model="row.text"
|
||||
placeholder="Titel"
|
||||
maxlength="60"
|
||||
/>
|
||||
/>-->
|
||||
<UTextarea
|
||||
class="mt-2"
|
||||
v-model="row.description"
|
||||
placeholder="Text"
|
||||
/>
|
||||
@@ -2289,7 +2293,7 @@ const setRowData = (row) => {
|
||||
@click="addPosition('text')"
|
||||
class="mt-3"
|
||||
>
|
||||
+ Freitext
|
||||
+ Text
|
||||
</UButton>
|
||||
</InputGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user