Merge branch 'dev' into 7414-ticketHistoryChanges
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jose Antonio Tubau 2025-02-28 13:14:24 +00:00
commit ee91c8410b
18 changed files with 240 additions and 69 deletions

1
Jenkinsfile vendored
View File

@ -113,6 +113,7 @@ pipeline {
}
steps {
script {
sh 'rm junit/e2e-*.xml || true'
env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev'
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"

View File

@ -694,8 +694,10 @@ worker:
machine: Machine
business:
tableVisibleColumns:
id: ID
started: Start Date
ended: End Date
hourlyLabor: Time sheet
company: Company
reasonEnd: Reason for Termination
department: Department
@ -703,6 +705,7 @@ worker:
calendarType: Work Calendar
workCenter: Work Center
payrollCategories: Contract Category
workerBusinessAgreementName: Agreement
occupationCode: Contribution Code
rate: Rate
businessType: Contract Type

View File

@ -770,8 +770,10 @@ worker:
concept: Concepto
business:
tableVisibleColumns:
id: Id
started: Fecha inicio
ended: Fecha fin
hourlyLabor: Ficha
company: Empresa
reasonEnd: Motivo finalización
department: Departamento
@ -782,6 +784,7 @@ worker:
occupationCode: Cotización
rate: Tarifa
businessType: Contrato
workerBusinessAgreementName: Convenio
amount: Salario
basicSalary: Salario transportistas
notes: Notas

View File

@ -62,9 +62,10 @@ const columns = [
name: 'workerFk',
component: 'select',
attrs: {
url: 'Workers/search',
url: 'TicketRequests/getItemTypeWorker',
fields: ['id', 'nickname'],
optionLabel: 'nickname',
sortBy: 'nickname ASC',
optionValue: 'id',
},
visible: false,

View File

@ -248,7 +248,7 @@ const entryFilterPanel = ref();
<i18n>
en:
params:
isExcludedFromAvailable: Inventory
isExcludedFromAvailable: Is excluded
isOrdered: Ordered
isReceived: Received
isConfirmed: Confirmed

View File

@ -19,6 +19,7 @@ const { t } = useI18n();
const quasar = useQuasar();
const state = useState();
const user = state.getUser();
const footer = ref({ bought: 0, reserve: 0 });
const columns = computed(() => [
{
align: 'left',
@ -38,16 +39,14 @@ const columns = computed(() => [
cardVisible: true,
create: true,
attrs: {
url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name', 'nickname'],
where: { role: 'buyer' },
optionFilter: 'firstName',
url: 'TicketRequests/getItemTypeWorker',
fields: ['id', 'nickname'],
optionLabel: 'nickname',
sortBy: 'nickname ASC',
optionValue: 'id',
useLike: false,
},
columnFilter: false,
width: '70px',
width: '50px',
},
{
align: 'center',
@ -58,6 +57,7 @@ const columns = computed(() => [
component: 'number',
summation: true,
width: '50px',
format: ({ reserve }, dashIfEmpty) => dashIfEmpty(round(reserve)),
},
{
align: 'center',
@ -65,6 +65,7 @@ const columns = computed(() => [
name: 'bought',
summation: true,
cardVisible: true,
style: ({ reserve, bought }) => boughtStyle(bought, reserve),
columnFilter: false,
},
{
@ -95,7 +96,6 @@ const columns = computed(() => [
},
},
],
dataCy: 'table-actions',
},
]);
@ -137,20 +137,20 @@ function openDialog() {
}
function setFooter(data) {
const footer = {
bought: 0,
reserve: 0,
};
footer.value = { bought: 0, reserve: 0 };
data.forEach((row) => {
footer.bought += row?.bought;
footer.reserve += row?.reserve;
footer.value.bought += row?.bought;
footer.value.reserve += row?.reserve;
});
tableRef.value.footer = footer;
}
function round(value) {
return Math.round(value * 100) / 100;
}
function boughtStyle(bought, reserve) {
return reserve < bought ? { color: 'var(--q-negative)' } : '';
}
</script>
<template>
<VnSubToolbar>
@ -253,24 +253,14 @@ function round(value) {
<WorkerDescriptorProxy :id="row?.workerFk" />
</span>
</template>
<template #column-bought="{ row }">
<span :class="{ 'text-negative': row.reserve < row.bought }">
{{ row?.bought }}
</span>
</template>
<template #column-footer-reserve>
<span>
{{ round(tableRef.footer.reserve) }}
{{ round(footer.reserve) }}
</span>
</template>
<template #column-footer-bought>
<span
:class="{
'text-negative':
tableRef.footer.reserve < tableRef.footer.bought,
}"
>
{{ round(tableRef.footer.bought) }}
<span :style="boughtStyle(footer?.bought, footer?.reserve)">
{{ round(footer.bought) }}
</span>
</template>
</VnTable>
@ -286,7 +276,7 @@ function round(value) {
justify-content: center;
}
.column {
min-width: 40%;
min-width: 35%;
margin-top: 5%;
display: flex;
flex-direction: column;

View File

@ -14,7 +14,7 @@ const $props = defineProps({
required: true,
},
dated: {
type: Date,
type: [Date, String],
required: true,
},
});

View File

@ -185,6 +185,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
data-key="InvoiceInSummary"
:url="`InvoiceIns/${entityId}/summary`"
@on-fetch="(data) => init(data)"
module-name="InvoiceIn"
>
<template #header="{ entity }">
<div>{{ entity.id }} - {{ entity.supplier?.name }}</div>

View File

@ -12,7 +12,7 @@ import FetchData from 'components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import { toDateFormat } from 'src/filters/date.js';
import { toDateTimeFormat } from 'src/filters/date.js';
import { dashIfEmpty } from 'src/filters';
import { date } from 'quasar';
import { useState } from 'src/composables/useState';
@ -143,7 +143,12 @@ onMounted(async () => {
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
const getBadgeAttrs = (_date) => {
const isSameDate = date.isSameDate(today, _date);
let today = Date.vnNew();
today.setHours(0, 0, 0, 0);
let timeTicket = new Date(_date);
timeTicket.setHours(0, 0, 0, 0);
const isSameDate = date.isSameDate(today, timeTicket);
const attrs = {
'text-color': isSameDate ? 'black' : 'white',
color: isSameDate ? 'warning' : 'transparent',
@ -244,7 +249,7 @@ async function updateWarehouse(warehouseFk) {
dense
style="font-size: 14px"
>
{{ toDateFormat(row.shipped) }}
{{ toDateTimeFormat(row.shipped) }}
</QBadge>
</QTd>
</template>

View File

@ -11,7 +11,6 @@ import { toCurrency } from 'filters/index';
import { useArrayData } from 'composables/useArrayData';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
const { t } = useI18n();
const route = useRoute();
const from = ref();
@ -41,7 +40,7 @@ const itemLastEntries = ref([]);
const columns = computed(() => [
{
label: 'Nv',
label: 'NV',
name: 'ig',
align: 'center',
},
@ -70,6 +69,7 @@ const columns = computed(() => [
field: 'reference',
align: 'center',
format: (_, row) => toCurrency(row.price2) + ' / ' + toCurrency(row.price3),
style: (row) => highlightedRow(row),
},
{
label: t('lastEntries.printedStickers'),
@ -84,6 +84,7 @@ const columns = computed(() => [
field: 'stickers',
align: 'center',
format: (val) => dashIfEmpty(val),
style: (row) => highlightedRow(row),
},
{
label: 'Packing',
@ -102,12 +103,14 @@ const columns = computed(() => [
name: 'stems',
field: 'stems',
align: 'center',
style: (row) => highlightedRow(row),
},
{
label: t('lastEntries.quantity'),
name: 'quantity',
field: 'quantity',
align: 'center',
style: (row) => highlightedRow(row),
},
{
label: t('lastEntries.cost'),
@ -120,12 +123,14 @@ const columns = computed(() => [
name: 'weight',
field: 'weight',
align: 'center',
style: (row) => highlightedRow(row),
},
{
label: t('lastEntries.cube'),
name: 'cube',
field: 'packagingFk',
align: 'center',
style: (row) => highlightedRow(row),
},
{
label: t('lastEntries.supplier'),
@ -208,6 +213,14 @@ onMounted(async () => {
function getBadgeClass(groupingMode, expectedGrouping) {
return groupingMode === expectedGrouping ? 'accent-badge' : 'simple-badge';
}
function highlightedRow(row) {
return row?.isInventorySupplier
? {
'background-color': 'var(--vn-section-hover-color)',
}
: '';
}
</script>
<template>
<VnSubToolbar>
@ -236,7 +249,7 @@ function getBadgeClass(groupingMode, expectedGrouping) {
:no-data-label="t('globals.noResults')"
>
<template #body-cell-ig="{ row }">
<QTd class="text-center">
<QTd class="text-center" :style="highlightedRow(row)">
<QIcon
:name="row.isIgnored ? 'check_box' : 'check_box_outline_blank'"
style="color: var(--vn-label-color)"
@ -245,38 +258,38 @@ function getBadgeClass(groupingMode, expectedGrouping) {
</QTd>
</template>
<template #body-cell-warehouse="{ row }">
<QTd>
<QTd :style="highlightedRow(row)">
<span>{{ row.warehouse }}</span>
</QTd>
</template>
<template #body-cell-date="{ row }">
<QTd class="text-center">
<QTd class="text-center" :style="highlightedRow(row)">
<VnDateBadge :date="row.landed" />
</QTd>
</template>
<template #body-cell-entry="{ row }">
<QTd @click.stop>
<QTd @click.stop :style="highlightedRow(row)">
<div class="full-width flex justify-center">
<EntryDescriptorProxy :id="row.entryFk" class="q-ma-none" dense />
<span class="link">{{ row.entryFk }}</span>
</div>
</QTd>
</template>
<template #body-cell-pvp="{ value }">
<QTd @click.stop class="text-center">
<template #body-cell-pvp="{ row, value }">
<QTd @click.stop class="text-center" :style="highlightedRow(row)">
<span> {{ value }}</span>
<QTooltip> {{ t('lastEntries.grouping') }}/Packing </QTooltip></QTd
>
<QTooltip> {{ t('lastEntries.grouping') }}/Packing </QTooltip>
</QTd>
</template>
<template #body-cell-printedStickers="{ row }">
<QTd @click.stop class="text-center">
<QTd @click.stop class="text-center" :style="highlightedRow(row)">
<span style="color: var(--vn-label-color)">
{{ row.printedStickers }}</span
>
</QTd>
</template>
<template #body-cell-packing="{ row }">
<QTd @click.stop>
<QTd @click.stop :style="highlightedRow(row)">
<QBadge
class="center-content"
:class="getBadgeClass(row.groupingMode, 'packing')"
@ -288,7 +301,7 @@ function getBadgeClass(groupingMode, expectedGrouping) {
</QTd>
</template>
<template #body-cell-grouping="{ row }">
<QTd @click.stop>
<QTd @click.stop :style="highlightedRow(row)">
<QBadge
class="center-content"
:class="getBadgeClass(row.groupingMode, 'grouping')"
@ -300,7 +313,7 @@ function getBadgeClass(groupingMode, expectedGrouping) {
</QTd>
</template>
<template #body-cell-cost="{ row }">
<QTd @click.stop class="text-center">
<QTd @click.stop class="text-center" :style="highlightedRow(row)">
<span>
{{ toCurrency(row.cost, 'EUR', 3) }}
<QTooltip>
@ -319,7 +332,7 @@ function getBadgeClass(groupingMode, expectedGrouping) {
</QTd>
</template>
<template #body-cell-supplier="{ row }">
<QTd @click.stop>
<QTd @click.stop :style="highlightedRow(row)">
<div class="full-width flex justify-left">
<QBadge
:class="
@ -354,7 +367,6 @@ function getBadgeClass(groupingMode, expectedGrouping) {
.th :first-child {
.td {
text-align: center;
background-color: red;
}
}
.accent-badge {

View File

@ -180,6 +180,7 @@ const onDmsSaved = async (dms, response) => {
rows: dmsDialog.value.rowsToCreateInvoiceIn,
dms: response.data,
});
notify(t('Data saved'), 'positive');
}
dmsDialog.value.show = false;
dmsDialog.value.initialForm = null;
@ -243,7 +244,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</template>
<template #column-invoiceInFk="{ row }">
<span class="link" @click.stop>
{{ row.invoiceInFk }}
{{ row.supplierRef }}
<InvoiceInDescriptorProxy v-if="row.invoiceInFk" :id="row.invoiceInFk" />
</span>
</template>

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, ref } from 'vue';
import { computed, ref, markRaw } from 'vue';
import { useI18n } from 'vue-i18n';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { toHour } from 'src/filters';
@ -8,6 +8,7 @@ import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import VnSection from 'src/components/common/VnSection.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
@ -38,17 +39,7 @@ const columns = computed(() => [
align: 'left',
name: 'workerFk',
label: t('route.Worker'),
component: 'select',
attrs: {
url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name'],
useLike: false,
optionFilter: 'firstName',
find: {
value: 'workerFk',
label: 'workerUserName',
},
},
component: markRaw(VnSelectWorker),
create: true,
cardVisible: true,
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
@ -59,6 +50,10 @@ const columns = computed(() => [
name: 'agencyName',
label: t('route.Agency'),
cardVisible: true,
},
{
label: t('route.Agency'),
name: 'agencyModeFk',
component: 'select',
attrs: {
url: 'agencyModes',
@ -69,14 +64,19 @@ const columns = computed(() => [
},
},
create: true,
columnClass: 'expand',
columnFilter: false,
visible: false,
},
{
align: 'left',
name: 'vehiclePlateNumber',
label: t('route.Vehicle'),
cardVisible: true,
},
{
name: 'vehicleFk',
label: t('route.Vehicle'),
cardVisible: true,
component: 'select',
attrs: {
url: 'vehicles',
@ -90,6 +90,7 @@ const columns = computed(() => [
},
create: true,
columnFilter: false,
visible: false,
},
{
align: 'left',
@ -156,6 +157,7 @@ const columns = computed(() => [
<VnTable
:data-key
:columns="columns"
ref="tableRef"
:right-search="false"
redirect="route"
:create="{

View File

@ -35,6 +35,22 @@ async function reactivateWorker() {
}
}
const columns = computed(() => [
{
name: 'id',
label: t('Id'),
align: 'left',
isId: true,
cardVisible: true,
width: '40px',
},
{
name: 'isHourlyLabor',
label: t('worker.business.tableVisibleColumns.hourlyLabor'),
align: 'left',
component: 'checkbox',
cardVisible: true,
width: '60px',
},
{
name: 'started',
label: t('worker.business.tableVisibleColumns.started'),
@ -194,6 +210,20 @@ const columns = computed(() => [
format: ({ workerBusinessTypeName }, dashIfEmpty) =>
dashIfEmpty(workerBusinessTypeName),
},
{
align: 'left',
name: 'workerBusinessAgreementFk',
label: t('worker.business.tableVisibleColumns.workerBusinessAgreementName'),
component: 'select',
attrs: {
url: 'WorkerBusinessAgreements',
fields: ['id', 'name'],
},
cardVisible: true,
create: true,
format: ({ workerBusinessAgreementName }, dashIfEmpty) =>
dashIfEmpty(workerBusinessAgreementName),
},
{
align: 'left',
label: t('worker.business.tableVisibleColumns.amount'),
@ -230,7 +260,7 @@ const columns = computed(() => [
save-url="/Businesses/crud"
:create="{
urlCreate: `Workers/${entityId}/Business`,
title: 'Create business',
title: t('Create business'),
onDataSaved: () => tableRef.reload(),
formInitialData: {},
}"
@ -248,4 +278,5 @@ const columns = computed(() => [
<i18n>
es:
Do you want to reactivate the user?: desea reactivar el usuario?
Create business: Crear contrato
</i18n>

View File

@ -1,4 +1,4 @@
describe('ClaimNotes', () => {
describe.skip('ClaimNotes', () => {
const saveBtn = '.q-field__append > .q-btn > .q-btn__content > .q-icon';
const firstNote = '.q-infinite-scroll :nth-child(1) > .q-card__section--vert';
beforeEach(() => {

View File

@ -1,4 +1,4 @@
describe('Entry', () => {
describe.skip('Entry', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');

View File

@ -1,4 +1,4 @@
describe('EntryStockBought', () => {
describe.skip('EntryStockBought', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');

View File

@ -0,0 +1,121 @@
describe('RouteAutonomous', () => {
const getLinkSelector = (colField) =>
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;
const selectors = {
reference: 'Reference_input',
date: 'tr:first-child > [data-col-field="dated"]',
total: '.value > .text-h6',
received: getLinkSelector('invoiceInFk'),
autonomous: getLinkSelector('supplierName'),
firstRowCheckbox: '.q-virtual-scroll__content tr:first-child .q-checkbox__bg',
secondRowCheckbox: '.q-virtual-scroll__content tr:nth-child(2) .q-checkbox__bg',
createInvoiceBtn: '.q-card > .q-btn',
saveFormBtn: 'FormModelPopup_save',
summaryIcon: 'tableAction-0',
summaryPopupBtn: '.header > :nth-child(2) > .q-btn__content > .q-icon',
summaryHeader: '.summaryHeader > :nth-child(2)',
descriptorHeader: '.summaryHeader > div',
descriptorTitle: '.q-item__label--header > .title > span',
summaryGoToSummaryBtn: '.header > .q-icon',
descriptorGoToSummaryBtn: '.descriptor > .header > a[href] > .q-btn',
};
const data = {
reference: 'Test invoice',
total: '€206.40',
supplier: 'PLANTS SL',
route: 'first route',
};
const summaryUrl = '/summary';
const dataSaved = 'Data saved';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/agency-term`);
cy.typeSearchbar('{enter}');
});
it('Should list autonomous routes', () => {
cy.get('.q-table')
.children()
.should('be.visible')
.should('have.length.greaterThan', 0);
});
it('Should create invoice in to selected route', () => {
cy.get(selectors.firstRowCheckbox).click();
cy.get(selectors.createInvoiceBtn).click();
cy.dataCy(selectors.reference).type(data.reference);
cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
cy.dataCy(selectors.saveFormBtn).click();
cy.checkNotification(dataSaved);
cy.typeSearchbar('{enter}');
});
it('Should display the total price of the selected rows', () => {
cy.get(selectors.firstRowCheckbox).click();
cy.get(selectors.secondRowCheckbox).click();
cy.validateContent(selectors.total, data.total);
});
it('Should redirect to the summary when clicking a route', () => {
cy.get(selectors.date).click();
cy.get(selectors.summaryHeader).should('contain', data.route);
cy.url().should('include', summaryUrl);
});
describe('Received pop-ups', () => {
it('Should redirect to invoice in summary from the received descriptor pop-up', () => {
cy.get(selectors.received).click();
cy.validateContent(selectors.descriptorTitle, data.reference);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
cy.url().should('include', summaryUrl);
});
it('Should redirect to the invoiceIn summary from summary pop-up from the received descriptor pop-up', () => {
cy.get(selectors.received).click();
cy.validateContent(selectors.descriptorTitle, data.reference);
cy.get(selectors.summaryPopupBtn).click();
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
cy.url().should('include', summaryUrl);
});
});
describe('Autonomous pop-ups', () => {
it('Should redirect to the supplier summary from the received descriptor pop-up', () => {
cy.get(selectors.autonomous).click();
cy.validateContent(selectors.descriptorTitle, data.supplier);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.get(selectors.summaryHeader).should('contain', data.supplier);
cy.url().should('include', summaryUrl);
});
it('Should redirect to the supplier summary from summary pop-up from the autonomous descriptor pop-up', () => {
cy.get(selectors.autonomous).click();
cy.get(selectors.descriptorTitle).should('contain', data.supplier);
cy.get(selectors.summaryPopupBtn).click();
cy.get(selectors.summaryHeader).should('contain', data.supplier);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.summaryHeader).should('contain', data.supplier);
cy.url().should('include', summaryUrl);
});
});
describe('Route pop-ups', () => {
it('Should redirect to the summary from the route summary pop-up', () => {
cy.dataCy(selectors.summaryIcon).first().click();
cy.get(selectors.summaryHeader).should('contain', data.route);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.summaryHeader).should('contain', data.route);
cy.url().should('include', summaryUrl);
});
});
});

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('TicketList', () => {
describe.skip('TicketList', () => {
const firstRow = 'tbody > :nth-child(1)';
beforeEach(() => {