feat: add rounded CC field to travel summary and translations

This commit is contained in:
Pablo Natek 2025-03-26 07:46:39 +01:00
parent a519014685
commit 02e29c167a
3 changed files with 23 additions and 4 deletions
src
i18n/locale
pages/Travel/Card

View File

@ -841,6 +841,7 @@ travel:
availabledHour: Availabled hour
thermographs: Thermographs
hb: HB
roundedCc: Rounded CC
basicData:
daysInForward: Automatic movement (Raid)
isRaid: Raid

View File

@ -924,6 +924,7 @@ travel:
availabled: F. Disponible
availabledHour: Hora Disponible
hb: HB
roundedCc: CC redondeado
basicData:
daysInForward: Desplazamiento automatico (redada)
isRaid: Redada

View File

@ -91,6 +91,13 @@ const entriesTableColumns = computed(() => {
showValue: true,
},
{ label: 'CC', field: 'cc', name: 'cc', align: 'left', showValue: true },
{
label: t('travel.summary.roundedCc'),
field: 'cc',
name: 'roundedCc',
align: 'left',
showValue: true,
},
{
label: 'Pallet',
field: 'pallet',
@ -193,13 +200,18 @@ const entriesTotals = computed(() => {
freightValue: 0,
packageValue: 0,
cc: 0,
roundedCc: 0,
pallet: 0,
m3: 0,
};
entriesTableRows.value.forEach((row) => {
for (const key in totals) {
totals[key] += row[key] || 0;
if (key === 'roundedCc') {
totals['roundedCc'] += Math.ceil(row['cc'] || 0);
} else {
totals[key] += row[key] || 0;
}
}
});
@ -208,6 +220,7 @@ const entriesTotals = computed(() => {
freight: toCurrency(totals.freightValue),
packageValue: toCurrency(totals.packageValue),
cc: totals.cc.toFixed(2),
roundedCc: totals.roundedCc,
pallet: totals.pallet.toFixed(2),
m3: totals.m3.toFixed(2),
};
@ -337,9 +350,7 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
<VnLv
:label="t('travel.summary.availabled')"
:value="
dashIfEmpty(toDateTimeFormat(travel.availabled))
"
:value="dashIfEmpty(toDateTimeFormat(travel.availabled))"
/>
</QCard>
<QCard class="full-width">
@ -376,6 +387,11 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
</QBtn>
</QTd>
</template>
<template #body-cell-roundedCc="{ col, value }">
<QTd>
{{ Math.ceil(value) || 0 }}
</QTd>
</template>
<template #body-cell-observation="{ value }">
<QTd>
<QIcon name="insert_drive_file" color="primary" size="24px">
@ -392,6 +408,7 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
<QTd class="text-bold">{{ entriesTotals.freight }}</QTd>
<QTd class="text-bold">{{ entriesTotals.packageValue }}</QTd>
<QTd class="text-bold">{{ entriesTotals.cc }}</QTd>
<QTd class="text-bold">{{ entriesTotals.roundedCc }}</QTd>
<QTd class="text-bold">{{ entriesTotals.pallet }}</QTd>
<QTd class="text-bold">{{ entriesTotals.m3 }}</QTd>
</template>