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;