Fix for #73
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 16s
Build and Push Docker Images / build-frontend (push) Successful in 1m7s

This commit is contained in:
2026-01-30 16:23:57 +01:00
parent 5c69388f1c
commit 0bfef0806b

View File

@@ -912,10 +912,11 @@ export const useDataStore = defineStore('data', () => {
inputType: "number", inputType: "number",
inputTrailing: "EUR", inputTrailing: "EUR",
inputChangeFunction: function (row) { inputChangeFunction: function (row) {
console.log(row)
if(row.markup_percentage) { if(row.markup_percentage) {
row.seling_price = (row.purchase_price * (1+row.markup_percentage/100)).toFixed(4) row.selling_price = (row.purchase_price * (1+row.markup_percentage/100)).toFixed(4)
} else { } else {
row.seling_price = row.purchase_price.toFixed(4) row.selling_price = Number(row.purchase_price.toFixed(4))
} }
} }
},{ },{
@@ -924,12 +925,13 @@ export const useDataStore = defineStore('data', () => {
inputType: "number", inputType: "number",
inputTrailing: "%", inputTrailing: "%",
inputChangeFunction: function (row) { inputChangeFunction: function (row) {
if(row.purchase_price && ! row.seling_price) { console.log(row)
row.seling_price = (row.purchase_price * (1+row.markup_percentage/100)).toFixed(4) if(row.purchase_price && ! row.selling_price) {
} else if(row.seling_price && !row.purchase_price) { row.selling_price = (row.purchase_price * (1+row.markup_percentage/100)).toFixed(4)
row.purchase_price = (row.seling_price / (1+row.markup_percentage/100)).toFixed(4) } else if(row.selling_price && !row.purchase_price) {
row.purchase_price = (row.selling_price / (1+row.markup_percentage/100)).toFixed(4)
} else { } else {
row.seling_price = (row.purchase_price * (1+row.markup_percentage/100)).toFixed(4) row.selling_price = (row.purchase_price * (1+row.markup_percentage/100)).toFixed(4)
} }
} }
},{ },{
@@ -940,6 +942,7 @@ export const useDataStore = defineStore('data', () => {
inputType: "number", inputType: "number",
inputTrailing: "EUR", inputTrailing: "EUR",
inputChangeFunction: function (row) { inputChangeFunction: function (row) {
console.log(row)
if(row.purchase_price ) { if(row.purchase_price ) {
row.markup_percentage = ((row.selling_price / row.purchase_price - 1) * 100 ).toFixed(2) row.markup_percentage = ((row.selling_price / row.purchase_price - 1) * 100 ).toFixed(2)
} else{ } else{