Skip to content

Commit

Permalink
Use in ProofFooterRow
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Dec 2, 2024
1 parent a4b1bf5 commit d9ff3d6
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/components/ProofFooterRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
<v-row>
<v-col :cols="userIsProofOwner ? '11' : '12'">
<ProofTypeChip class="mr-1" :proof="proof" />
<v-chip v-if="showReceiptPriceCount" class="mr-1" label size="small" variant="flat" density="comfortable" :title="$t('Common.ReceiptPriceCount')">
{{ $t('Common.PriceCount', { count: proof.receipt_price_count }) }}
</v-chip>
<v-chip v-if="showReceiptPriceTotal" class="mr-1" label size="small" variant="flat" density="comfortable" :title="$t('Common.ReceiptPriceTotal')">
{{ getPriceValueDisplay(proof.receipt_price_total) }}
</v-chip>
<ProofReceiptPriceCountChip v-if="showReceiptPriceCount" :count="proof.receipt_price_count" />
<ProofReceiptPriceTotalChip v-if="showReceiptPriceTotal" class="mr-1" :count="proof.receipt_price_total" :currency="proof.currency" />
<PriceCountChip :count="proof.price_count" :withLabel="true" @click="goToProof()" />
<LocationChip class="mr-1" :location="proof.location" :locationId="proof.location_id" :readonly="readonly" :showErrorIfLocationMissing="true" />
<DateChip class="mr-1" :date="proof.date" :showErrorIfDateMissing="true" />
Expand All @@ -25,11 +21,12 @@ import { defineAsyncComponent } from 'vue'
import { mapStores } from 'pinia'
import { useAppStore } from '../store'
import constants from '../constants'
import utils from '../utils.js'
export default {
components: {
ProofTypeChip: defineAsyncComponent(() => import('../components/ProofTypeChip.vue')),
ProofReceiptPriceCountChip: defineAsyncComponent(() => import('../components/ProofReceiptPriceCountChip.vue')),
ProofReceiptPriceTotalChip: defineAsyncComponent(() => import('../components/ProofReceiptPriceTotalChip.vue')),
PriceCountChip: defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
LocationChip: defineAsyncComponent(() => import('../components/LocationChip.vue')),
DateChip: defineAsyncComponent(() => import('../components/DateChip.vue')),
Expand Down Expand Up @@ -75,13 +72,6 @@ export default {
},
},
methods: {
getPriceValue(priceValue, priceCurrency) {
return utils.prettyPrice(priceValue, priceCurrency)
},
getPriceValueDisplay(price) {
price = parseFloat(price)
return this.getPriceValue(price, this.proof.currency)
},
goToProof() {
if (this.readonly || !this.userIsProofOwner) {
return
Expand Down

0 comments on commit d9ff3d6

Please sign in to comment.