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