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",
inputTrailing: "EUR",
inputChangeFunction: function (row) {
console.log(row)
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 {
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",
inputTrailing: "%",
inputChangeFunction: function (row) {
if(row.purchase_price && ! row.seling_price) {
row.seling_price = (row.purchase_price * (1+row.markup_percentage/100)).toFixed(4)
} else if(row.seling_price && !row.purchase_price) {
row.purchase_price = (row.seling_price / (1+row.markup_percentage/100)).toFixed(4)
console.log(row)
if(row.purchase_price && ! row.selling_price) {
row.selling_price = (row.purchase_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 {
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",
inputTrailing: "EUR",
inputChangeFunction: function (row) {
console.log(row)
if(row.purchase_price ) {
row.markup_percentage = ((row.selling_price / row.purchase_price - 1) * 100 ).toFixed(2)
} else{