From e44da1c9992fc63aa4957a432a52fe4b16097ebf Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 22 Mar 2023 15:11:08 +0100 Subject: [PATCH] Show mana --- src/pages/Claim/Card/ClaimLines.vue | 34 ++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue index f7f4715fe..8fc0838d4 100644 --- a/src/pages/Claim/Card/ClaimLines.vue +++ b/src/pages/Claim/Card/ClaimLines.vue @@ -19,7 +19,10 @@ const stateStore = useStateStore(); const arrayData = useArrayData('ClaimLines'); const store = arrayData.store; -const filter = { +const claimFilter = { + fields: ['ticketFk'], +}; +const linesFilter = { include: { relation: 'sale', scope: { @@ -31,6 +34,13 @@ const filter = { }, }; +const claim = ref(null); +async function onFetchClaim(data) { + claim.value = data; + + fetchMana(); +} + const amount = ref(0); const amountClaimed = ref(0); async function onFetch(rows) { @@ -96,6 +106,13 @@ const columns = computed(() => [ }, ]); +const mana = ref(0); +async function fetchMana() { + const ticketId = claim.value.ticketFk; + const response = await axios.get(`Tickets/${ticketId}/getSalesPersonMana`); + mana.value = response.data; +} + async function updateQuantity({ id, quantity }) { if (!id) return; await axios.patch(`ClaimBeginnings/${id}`, { quantity }); @@ -124,6 +141,9 @@ async function remove({ id }) { message: t('globals.rowRemoved'), }); } + +const manaTitle = computed(() => `${t('Mana')} ${toCurrency(mana.value)}`); +const totalClaimed = 0;