mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 05:31:24 +00:00
Fix negative values on item price (#335)
* Fix negative values on item price * Remove console log
This commit is contained in:
@@ -254,22 +254,12 @@ const quantity = computed({
|
||||
const price = computed({
|
||||
get: () => {
|
||||
const price = props.itemData.price
|
||||
|
||||
if (parseFloat(price) > 0) {
|
||||
return price / 100
|
||||
}
|
||||
|
||||
return price
|
||||
return price / 100
|
||||
},
|
||||
|
||||
set: (newValue) => {
|
||||
if (parseFloat(newValue) > 0) {
|
||||
let price = Math.round(newValue * 100)
|
||||
|
||||
updateItemAttribute('price', price)
|
||||
} else {
|
||||
updateItemAttribute('price', newValue)
|
||||
}
|
||||
let price = Math.round(newValue * 100)
|
||||
updateItemAttribute('price', price)
|
||||
setDiscount()
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user