Merge branch 'dev' into 7134-supplierBalance

This commit is contained in:
Javier Segarra 2025-01-28 23:38:45 +01:00
commit 01c4553e5f
15 changed files with 89 additions and 64 deletions

View File

@ -349,4 +349,11 @@ es:
floramondo: Floramondo floramondo: Floramondo
salesPersonFk: Comprador salesPersonFk: Comprador
categoryFk: Categoría categoryFk: Categoría
Plant: Planta natural
Flower: Flor fresca
Handmade: Hecho a mano
Artificial: Artificial
Green: Verdes frescos
Accessories: Complementos florales
Fruit: Fruta
</i18n> </i18n>

View File

@ -175,7 +175,11 @@ const handleUppercase = () => {
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase" v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
@click="handleUppercase" @click="handleUppercase"
class="uppercase-icon" class="uppercase-icon"
/> >
<QTooltip>
{{ t('Convert to uppercase') }}
</QTooltip>
</QIcon>
<slot name="append" v-if="$slots.append && !$attrs.disabled" /> <slot name="append" v-if="$slots.append && !$attrs.disabled" />
<QIcon v-if="info" name="info"> <QIcon v-if="info" name="info">
@ -188,13 +192,26 @@ const handleUppercase = () => {
</div> </div>
</template> </template>
<style>
.uppercase-icon {
transition: color 0.3s, transform 0.2s;
cursor: pointer;
}
.uppercase-icon:hover {
color: #ed9937;
transform: scale(1.2);
}
</style>
<i18n> <i18n>
en: en:
inputMin: Must be more than {value} inputMin: Must be more than {value}
maxLength: The value exceeds {value} characters maxLength: The value exceeds {value} characters
inputMax: Must be less than {value} inputMax: Must be less than {value}
es: es:
inputMin: Debe ser mayor a {value} inputMin: Debe ser mayor a {value}
maxLength: El valor excede los {value} carácteres maxLength: El valor excede los {value} carácteres
inputMax: Debe ser menor a {value} inputMax: Debe ser menor a {value}
Convert to uppercase: Convertir a mayúsculas
</i18n> </i18n>

View File

@ -170,7 +170,7 @@ function emitStoreData() {
async function paginate() { async function paginate() {
const { page, rowsPerPage, sortBy, descending } = pagination.value; const { page, rowsPerPage, sortBy, descending } = pagination.value;
if (!props.url) return; if (!arrayData.store.url) return;
isLoading.value = true; isLoading.value = true;
await arrayData.loadMore(); await arrayData.loadMore();

View File

@ -114,7 +114,7 @@ const columns = computed(() => [
action: ({ id }) => action: ({ id }) =>
window.open( window.open(
router.resolve({ params: { id }, name: 'TicketSale' }).href, router.resolve({ params: { id }, name: 'TicketSale' }).href,
'_blank' '_blank',
), ),
isPrimary: true, isPrimary: true,
}, },
@ -122,7 +122,7 @@ const columns = computed(() => [
title: t('components.smartCard.viewSummary'), title: t('components.smartCard.viewSummary'),
icon: 'preview', icon: 'preview',
isPrimary: true, isPrimary: true,
action: (row) => viewSummary(row.id, TicketSummary), action: (row) => viewSummary(row.id, TicketSummary, 'lg-width'),
}, },
], ],
}, },

View File

@ -44,7 +44,7 @@ const transferEntry = async () => {
<template> <template>
<QItem v-ripple clickable @click="showEntryReport"> <QItem v-ripple clickable @click="showEntryReport">
<QItemSection>{{ $t('entryList.list.showEntryReport') }}</QItemSection> <QItemSection>{{ $t('entry.descriptorMenu.showEntryReport') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable @click="openDialog"> <QItem v-ripple clickable @click="openDialog">
<QItemSection>{{ t('transferEntry') }}</QItemSection> <QItemSection>{{ t('transferEntry') }}</QItemSection>

View File

@ -76,6 +76,8 @@ entry:
warehouseInFk: Warehouse in warehouseInFk: Warehouse in
search: Search entries search: Search entries
searchInfo: You can search by entry reference searchInfo: You can search by entry reference
descriptorMenu:
showEntryReport: Show entry report
entryFilter: entryFilter:
params: params:
invoiceNumber: Invoice number invoiceNumber: Invoice number

View File

@ -75,6 +75,8 @@ entry:
warehouseInFk: Alm. entrada warehouseInFk: Alm. entrada
daysOnward: Días adelante daysOnward: Días adelante
daysAgo: Días atras daysAgo: Días atras
descriptorMenu:
showEntryReport: Ver informe del pedido
search: Buscar entradas search: Buscar entradas
searchInfo: Puedes buscar por referencia de entrada searchInfo: Puedes buscar por referencia de entrada
entryFilter: entryFilter:

View File

@ -48,14 +48,14 @@ const itemPackingTypesOptions = ref([]);
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>
<VnInput v-model="data.code" :label="t('shared.code')" /> <VnInput v-model="data.code" :label="t('itemType.shared.code')" />
<VnInput v-model="data.name" :label="t('shared.name')" /> <VnInput v-model="data.name" :label="t('itemType.shared.name')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnSelect <VnSelect
url="Workers/search" url="Workers/search"
v-model="data.workerFk" v-model="data.workerFk"
:label="t('shared.worker')" :label="t('itemType.shared.worker')"
sort-by="nickname ASC" sort-by="nickname ASC"
:fields="['id', 'nickname']" :fields="['id', 'nickname']"
option-label="nickname" option-label="nickname"
@ -83,7 +83,7 @@ const itemPackingTypesOptions = ref([]);
> >
<VnSelect <VnSelect
v-model="data.categoryFk" v-model="data.categoryFk"
:label="t('shared.category')" :label="t('itemType.shared.category')"
:options="categoriesOptions" :options="categoriesOptions"
option-value="id" option-value="id"
option-label="name" option-label="name"
@ -93,27 +93,30 @@ const itemPackingTypesOptions = ref([]);
<VnRow> <VnRow>
<VnSelect <VnSelect
v-model="data.temperatureFk" v-model="data.temperatureFk"
:label="t('shared.temperature')" :label="t('itemType.shared.temperature')"
:options="temperaturesOptions" :options="temperaturesOptions"
option-value="code" option-value="code"
option-label="name" option-label="name"
hide-selected hide-selected
/> />
<VnInput v-model="data.life" :label="t('shared.life')" /> <VnInput v-model="data.life" :label="t('itemType.summary.life')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnSelect <VnSelect
v-model="data.itemPackingTypeFk" v-model="data.itemPackingTypeFk"
:label="t('shared.itemPackingType')" :label="t('itemType.shared.itemPackingType')"
:options="itemPackingTypesOptions" :options="itemPackingTypesOptions"
option-value="code" option-value="code"
option-label="description" option-label="description"
hide-selected hide-selected
/> />
<VnInput v-model="data.maxRefs" :label="t('shared.maxRefs')" /> <VnInput v-model="data.maxRefs" :label="t('itemType.shared.maxRefs')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
<QCheckbox v-model="data.isFragile" :label="t('shared.fragile')" /> <QCheckbox
v-model="data.isFragile"
:label="t('itemType.shared.fragile')"
/>
</VnRow> </VnRow>
</template> </template>
</FormModel> </FormModel>

View File

@ -50,15 +50,15 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity
@on-fetch="setData" @on-fetch="setData"
> >
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('shared.code')" :value="entity.code" /> <VnLv :label="t('itemType.shared.code')" :value="entity.code" />
<VnLv :label="t('shared.name')" :value="entity.name" /> <VnLv :label="t('itemType.shared.name')" :value="entity.name" />
<VnLv :label="t('shared.worker')"> <VnLv :label="t('itemType.shared.worker')">
<template #value> <template #value>
<span class="link">{{ entity.worker?.firstName }}</span> <span class="link">{{ entity.worker?.firstName }}</span>
<WorkerDescriptorProxy :id="entity.worker?.id" /> <WorkerDescriptorProxy :id="entity.worker?.id" />
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('shared.category')" :value="entity.category?.name" /> <VnLv :label="t('itemType.shared.category')" :value="entity.category?.name" />
</template> </template>
</CardDescriptor> </CardDescriptor>
</template> </template>

View File

@ -76,13 +76,6 @@ itemTags:
searchbar: searchbar:
label: Search item label: Search item
info: Search by item id info: Search by item id
itemType:
shared:
code: Code
name: Name
worker: Worker
category: Category
temperature: Temperature
item: item:
params: params:
daysOnward: Days onward daysOnward: Days onward

View File

@ -80,6 +80,9 @@ itemType:
worker: Trabajador worker: Trabajador
category: Reino category: Reino
temperature: Temperatura temperature: Temperatura
searchbar:
label: Buscar artículo
info: Buscar por id de artículo
params: params:
state: asfsdf state: asfsdf
item: item:
@ -216,6 +219,6 @@ item:
item: 'Artículo' item: 'Artículo'
achieved: 'Conseguido' achieved: 'Conseguido'
concept: 'Concepto' concept: 'Concepto'
state: 'Estado' state: 'Estado'
search: 'Buscar artículo' search: 'Buscar artículo'
searchInfo: 'Puedes buscar por id' searchInfo: 'Puedes buscar por id'

View File

@ -185,33 +185,31 @@ const entriesTableRows = computed(() => {
return entries.value; return entries.value;
}); });
const entriesTotalHb = computed(() => const entriesTotals = computed(() => {
entriesTableRows.value.reduce((acc, { hb }) => acc + hb, 0) const totals = {
); hb: 0,
freightValue: 0,
packageValue: 0,
cc: 0,
pallet: 0,
m3: 0,
};
const entriesTotalFreight = computed(() => entriesTableRows.value.forEach((row) => {
toCurrency( for (const key in totals) {
entriesTableRows.value.reduce((acc, { freightValue }) => acc + freightValue, 0) totals[key] += row[key] || 0;
) }
); });
const entriesTotalPackageValue = computed(() => return {
toCurrency( hb: totals.hb.toFixed(2),
entriesTableRows.value.reduce((acc, { packageValue }) => acc + packageValue, 0) freight: toCurrency(totals.freightValue),
) packageValue: toCurrency(totals.packageValue),
); cc: totals.cc.toFixed(2),
pallet: totals.pallet.toFixed(2),
const entriesTotalCc = computed(() => m3: totals.m3.toFixed(2),
entriesTableRows.value.reduce((acc, { cc }) => acc + cc, 0) };
); });
const entriesTotalPallet = computed(() =>
entriesTableRows.value.reduce((acc, { pallet }) => acc + pallet, 0)
);
const entriesTotalM3 = computed(() =>
entriesTableRows.value.reduce((acc, { m3 }) => acc + m3, 0)
);
const getTravelEntries = async (id) => { const getTravelEntries = async (id) => {
const { data } = await axios.get(`Travels/${id}/getEntries`); const { data } = await axios.get(`Travels/${id}/getEntries`);
@ -382,12 +380,12 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
<QTd></QTd> <QTd></QTd>
<QTd></QTd> <QTd></QTd>
<QTd></QTd> <QTd></QTd>
<QTd class="text-bold">{{ entriesTotalHb }}</QTd> <QTd class="text-bold">{{ entriesTotals.hb }}</QTd>
<QTd class="text-bold">{{ entriesTotalFreight }}</QTd> <QTd class="text-bold">{{ entriesTotals.freight }}</QTd>
<QTd class="text-bold">{{ entriesTotalPackageValue }}</QTd> <QTd class="text-bold">{{ entriesTotals.packageValue }}</QTd>
<QTd class="text-bold">{{ entriesTotalCc }}</QTd> <QTd class="text-bold">{{ entriesTotals.cc }}</QTd>
<QTd class="text-bold">{{ entriesTotalPallet }}</QTd> <QTd class="text-bold">{{ entriesTotals.pallet }}</QTd>
<QTd class="text-bold">{{ entriesTotalM3 }}</QTd> <QTd class="text-bold">{{ entriesTotals.m3 }}</QTd>
</template> </template>
</QTable> </QTable>
</QCard> </QCard>

View File

@ -132,7 +132,7 @@ const redirectToThermographForm = (action, id) => {
}; };
if (action === 'edit' && id) { if (action === 'edit' && id) {
routeDetails.query = { travelThermographFk: id }; routeDetails.query = { id };
} else if (action === 'create') { } else if (action === 'create') {
routeDetails.query = { agencyModeFk: travel.value?.agencyModeFk }; routeDetails.query = { agencyModeFk: travel.value?.agencyModeFk };
} }

View File

@ -83,7 +83,7 @@ const setEditDefaultParams = async () => {
const filterObj = { include: { relation: 'dms' } }; const filterObj = { include: { relation: 'dms' } };
const filter = encodeURIComponent(JSON.stringify(filterObj)); const filter = encodeURIComponent(JSON.stringify(filterObj));
const { data } = await axios.get( const { data } = await axios.get(
`TravelThermographs/${route.query.travelThermographFk}?filter=${filter}` `TravelThermographs/${route.query.id}?filter=${filter}`,
); );
if (data) { if (data) {
@ -170,7 +170,6 @@ const onThermographCreated = async (data) => {
<QPage class="column items-center full-width"> <QPage class="column items-center full-width">
<QForm <QForm
model="travel"
:form-initial-data="thermographForm" :form-initial-data="thermographForm"
:observe-form-changes="viewAction === 'create'" :observe-form-changes="viewAction === 'create'"
:default-actions="true" :default-actions="true"
@ -210,10 +209,11 @@ const onThermographCreated = async (data) => {
}" }"
sort-by="thermographFk ASC" sort-by="thermographFk ASC"
option-label="thermographFk" option-label="thermographFk"
option-filter-value="thermographFk" option-filter-value="id"
:disable="viewAction === 'edit'" :disable="viewAction === 'edit'"
:tooltip="t('New thermograph')" :tooltip="t('New thermograph')"
:roles-allowed-to-create="['logistic']" :roles-allowed-to-create="['logistic']"
data-key="travelThermographSelect"
> >
<template #form> <template #form>
<CreateThermographForm <CreateThermographForm

View File

@ -9,7 +9,7 @@ describe('InvoiceInList', () => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit(`/#/invoice-in/list`); cy.visit(`/#/invoice-in/list`);
cy.get('#searchbar input').type('{enter}'); cy.get('#searchbar input').should('be.visible').type('{enter}');
}); });
it('should redirect on clicking a invoice', () => { it('should redirect on clicking a invoice', () => {
@ -22,7 +22,7 @@ describe('InvoiceInList', () => {
}); });
}); });
// https://redmine.verdnatura.es/issues/8420 // https://redmine.verdnatura.es/issues/8420
it.skip('should open the details', () => { it('should open the details', () => {
cy.get(firstDetailBtn).click(); cy.get(firstDetailBtn).click();
cy.get(summaryHeaders).eq(1).contains('Basic data'); cy.get(summaryHeaders).eq(1).contains('Basic data');
cy.get(summaryHeaders).eq(4).contains('Vat'); cy.get(summaryHeaders).eq(4).contains('Vat');