diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 661c47d..f9fe025 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -103,9 +103,7 @@ const setupPage = async () => { if(route.params) { if(route.params.id) { itemInfo.value = await useSupabaseSelectSingle("createddocuments", route.params.id) - - - + checkCompatibilityWithInputPrice() } if(itemInfo.value.project) checkForOpenAdvanceInvoices() @@ -257,9 +255,10 @@ const setupPage = async () => { itemInfo.value.endText = linkedDocument.endText } - setCustomerData(null,true) + checkCompatibilityWithInputPrice() + if(route.query.loadMode === "storno") { itemInfo.value.rows.forEach(row => { row.price = row.price * -1 @@ -1192,6 +1191,15 @@ const getTextTemplateByType = (type, pos) => { } +const checkCompatibilityWithInputPrice = () => { + itemInfo.value.rows.forEach(row => { + console.log(row) + if(!row.inputPrice) { + row.inputPrice = row.price + } + }) +} + const updateCustomSurcharge = () => { itemInfo.value.rows.forEach(row => { if(!["pagebreak","title","text"].includes(row.mode)) { @@ -2000,7 +2008,7 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = { >