Merge branch 'Hotfix-CustomerAddress' of https://gitea.verdnatura.es/verdnatura/salix-front into Hotfix-CustomerAddress
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Jon Elias 2025-03-27 15:03:12 +01:00
commit 3fc56700e4
11 changed files with 67 additions and 40 deletions

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

@ -8,6 +8,6 @@ import filter from './EntryFilter.js';
data-key="Entry"
url="Entries"
:descriptor="EntryDescriptor"
:filter="filter"
:filter="{ ...filter, where: { id: $route.params.id } }"
/>
</template>

View File

@ -248,7 +248,6 @@ function getBadgeAttrs(row) {
let timeDiff = today - timeTicket;
if (timeDiff > 0) return { color: 'info', 'text-color': 'black' };
if (timeDiff < 0) return { color: 'warning', 'text-color': 'black' };
switch (row.entryTypeCode) {
case 'regularization':
@ -274,6 +273,7 @@ function getBadgeAttrs(row) {
default:
break;
}
if (timeDiff > 0) return { color: 'info', 'text-color': 'black' };
return { color: 'transparent' };
}

View File

@ -1,13 +1,14 @@
<script setup>
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import DepartmentDescriptorProxy from '../Worker/Department/Card/DepartmentDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import { toDateFormat } from 'src/filters/date.js';
import VnTable from 'src/components/VnTable/VnTable.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnRow from 'src/components/ui/VnRow.vue';
import { dateRange } from 'src/filters';
import useOpenURL from 'src/composables/useOpenURL';
const { t } = useI18n();
const dates = dateRange(Date.vnNew());
@ -94,6 +95,7 @@ const columns = computed(() => [
columnClass: 'no-padding',
},
]);
const openTab = (id) => useOpenURL(`#/customer/${id}/summary`);
</script>
<template>
@ -113,6 +115,8 @@ const columns = computed(() => [
:disable-option="{ card: true }"
dense
class="q-px-none"
:row-click="({ id }) => openTab(id)"
:row-ctrl-click="(_, { id }) => openTab(id)"
>
<template #top-left>
<VnRow>
@ -121,12 +125,16 @@ const columns = computed(() => [
</VnRow>
</template>
<template #column-departmentFk="{ row }">
<span class="link" :title="row.department" v-text="row.department" />
<WorkerDescriptorProxy :id="row.departmentFk" dense />
<span @click.stop.prevent class="link" :title="row.department">
{{ row.department }}
<DepartmentDescriptorProxy :id="row.departmentFk" dense
/></span>
</template>
<template #column-clientFk="{ row }">
<span class="link" :title="row.clientName" v-text="row.clientName" />
<CustomerDescriptorProxy :id="row.clientFk" />
<span @click.stop.prevent class="link" :title="row.clientName">
{{ row.clientName }}
<CustomerDescriptorProxy :id="row.clientFk" dense
/></span>
</template>
</VnTable>
</template>

View File

@ -9,6 +9,7 @@ import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
import { toCurrency } from 'src/filters';
import { useVnConfirm } from 'composables/useVnConfirm';
import axios from 'axios';
import useOpenURL from 'src/composables/useOpenURL';
const { t } = useI18n();
const { openConfirmationModal } = useVnConfirm();
@ -108,8 +109,7 @@ const removeOrders = async () => {
await table.value.reload();
};
const openTab = (id) =>
window.open(`#/order/${id}/summary`, '_blank', 'noopener, noreferrer');
const openTab = (id) => useOpenURL(`#/order/${id}/summary`);
</script>
<template>
<VnTable
@ -129,6 +129,7 @@ const openTab = (id) =>
}"
default-mode="table"
:row-click="({ id }) => openTab(id)"
:row-ctrl-click="(_, { id }) => openTab(id)"
v-model:selected="selectedRows"
:disable-option="{ card: true }"
>
@ -177,16 +178,16 @@ const openTab = (id) =>
</template>
<template #column-clientFk="{ row }">
<QTd @click.stop>
<span class="link" v-text="row.clientName" :title="row.clientName" />
<CustomerDescriptorProxy :id="row.clientFk" />
</QTd>
<span class="link" @click.stop :title="row.clientName">
{{ row.clientName }}
<CustomerDescriptorProxy :id="row.clientFk" dense
/></span>
</template>
<template #column-departmentFk="{ row }">
<QTd @click.stop>
<span class="link" v-text="row.departmentName" />
<DepartmentDescriptorProxy :id="row.departmentFk" dense />
</QTd>
<span class="link" @click.stop :title="row.departmentName">
{{ row.departmentName }}
<DepartmentDescriptorProxy :id="row.departmentFk" dense
/></span>
</template>
</VnTable>
</template>

View File

@ -449,21 +449,19 @@ const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
<span :title="row.province" v-text="row.province" />
</template>
<template #column-state="{ row }">
<div @click.stop.prevent>
<div v-if="row.refFk">
<span class="link">{{ row.refFk }}</span>
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
</div>
<QBadge
v-else
:color="stateColors[row.classColor] || 'transparent'"
:text-color="stateColors[row.classColor] ? 'black' : 'white'"
class="q-pa-sm"
style="font-size: 14px"
>
{{ row.state }}
</QBadge>
<div v-if="row.refFk" @click.stop.prevent>
<span class="link">{{ row.refFk }}</span>
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
</div>
<QBadge
v-else
:color="stateColors[row.classColor] || 'transparent'"
:text-color="stateColors[row.classColor] ? 'black' : 'white'"
class="q-pa-sm"
style="font-size: 14px"
>
{{ row.state }}
</QBadge>
</template>
<template #column-isFragile="{ row }">
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">

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,14 +200,15 @@ const entriesTotals = computed(() => {
freightValue: 0,
packageValue: 0,
cc: 0,
roundedCc: 0,
pallet: 0,
m3: 0,
};
entriesTableRows.value.forEach((row) => {
for (const key in totals) {
if (key === 'cc') {
totals[key] += Math.ceil(row[key] || 0);
if (key === 'roundedCc') {
totals['roundedCc'] += Math.ceil(row['cc'] || 0);
} else {
totals[key] += row[key] || 0;
}
@ -212,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),
};
@ -378,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">
@ -394,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>

View File

@ -44,11 +44,12 @@ describe('EntryList', () => {
},
);
checkBadgeDate(
// fix on task https://redmine.verdnatura.es/issues/8638
/* checkBadgeDate(
'td[data-col-field="landed"] > div .bg-info',
(badgeDate, compareDate) => {
expect(badgeDate.getTime()).to.be.lessThan(compareDate.getTime());
},
);
); */
});
});

View File

@ -118,8 +118,8 @@ describe('Route extended list', () => {
cy.validateContent(selector, value);
});
});
it('Should clone selected route and add ticket', () => {
// task https://redmine.verdnatura.es/issues/8814
xit('Should clone selected route and add ticket', () => {
cy.get(selectors.firstRowSelectCheckBox).click();
cy.get(selectors.cloneBtn).click();
cy.dataCy('Starting date_inputDate').type('01-01-2001');
@ -146,7 +146,8 @@ describe('Route extended list', () => {
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
});
it('Should mark as served the selected route', () => {
// task https://redmine.verdnatura.es/issues/8814
xit('Should mark as served the selected route', () => {
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.markServedBtn).click();

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('TicketList', () => {
describe.skip('TicketList', () => {
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
beforeEach(() => {
@ -35,7 +35,8 @@ describe('TicketList', () => {
cy.get('.summaryBody').should('exist');
});
it('filter client and create ticket', () => {
// task https://redmine.verdnatura.es/issues/8779
xit('filter client and create ticket', () => {
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
searchResults();
cy.wait('@ticketSearchbar');