Fix for #73
This commit is contained in:
@@ -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{
|
||||||
|
|||||||
Reference in New Issue
Block a user