Skip to content

Commit

Permalink
fix(Price add): Allow 'quantity bought' field to be decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jan 17, 2025
1 parent ed121f2 commit 5867e75
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/PriceAlreadyUploadedListCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
},
proofPriceUploadedListSum() {
return this.proofPriceUploadedList.reduce((acc, priceUploaded) => {
return acc + parseFloat(priceUploaded.price)*parseInt(priceUploaded.receipt_quantity)
return acc + parseFloat(priceUploaded.price)*parseFloat(priceUploaded.receipt_quantity)
}, 0)
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/PriceInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
density="compact"
:label="$t('Common.QuantityBought')"
type="text"
inputmode="numeric"
inputmode="decimal"
:rules="receiptQuantityRules"
:prepend-inner-icon="PROOF_TYPE_RECEIPT_ICON"
hide-details="auto"
Expand Down Expand Up @@ -143,7 +143,7 @@ export default {
if (!this.priceForm.receipt_quantity) return [() => true] // optional field
return [
value => !isNaN(value) || this.$t('PriceRules.Number'),
value => Number(value) >= 1 || this.$t('PriceRules.Positive'),
value => Number(value) >= 0 || this.$t('PriceRules.Positive'),
]
},
productIsTypeCategory() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PricePriceRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<v-tooltip v-if="price.price_without_discount" activator="parent" open-on-click location="top">{{ $t('PriceCard.FullPrice') }} {{ getPriceValueDisplay(price.price_without_discount) }}</v-tooltip>
</v-chip>
</span>
<span v-if="!hidePriceReceiptQuantity && price.receipt_quantity && price.receipt_quantity > 1" class="mr-1">
<span v-if="!hidePriceReceiptQuantity && price.receipt_quantity" class="mr-1">
<v-chip class="ml-1" variant="outlined" size="small" density="comfortable">
x{{ price.receipt_quantity }}
</v-chip>
Expand Down

0 comments on commit 5867e75

Please sign in to comment.