#6321 - Negative ticket #158

Open
jsegarra wants to merge 197 commits from 6321_negative_tickets into dev
14 changed files with 508 additions and 54 deletions
Showing only changes of commit 3e61b93ba3 - Show all commits

View File

@ -10,12 +10,13 @@ import routes from 'src/router/modules';
import LeftMenuItem from './LeftMenuItem.vue'; import LeftMenuItem from './LeftMenuItem.vue';
import LeftMenuItemGroup from './LeftMenuItemGroup.vue'; import LeftMenuItemGroup from './LeftMenuItemGroup.vue';
import VnInput from './common/VnInput.vue'; import VnInput from './common/VnInput.vue';
import { useRouter } from 'vue-router';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const quasar = useQuasar(); const quasar = useQuasar();
const navigation = useNavigationStore(); const navigation = useNavigationStore();
const router = useRouter();
const props = defineProps({ const props = defineProps({
source: { source: {
type: String, type: String,
@ -174,6 +175,10 @@ function normalize(text) {
.replace(/[\u0300-\u036f]/g, '') .replace(/[\u0300-\u036f]/g, '')
.toLowerCase(); .toLowerCase();
} }
const searchModule = () => {
const [item] = filteredItems.value;
if (item) router.push({ name: item.name });
};
</script> </script>
<template> <template>
@ -188,10 +193,11 @@ function normalize(text) {
filled filled
dense dense
autofocus autofocus
@keyup.enter.stop="searchModule()"
/> />
</QItem> </QItem>
<QSeparator /> <QSeparator />
<template v-if="filteredPinnedModules.size"> <template v-if="filteredPinnedModules.size && !search">
<LeftMenuItem <LeftMenuItem
v-for="[key, pinnedModule] of filteredPinnedModules" v-for="[key, pinnedModule] of filteredPinnedModules"
:key="key" :key="key"
@ -215,11 +221,11 @@ function normalize(text) {
</LeftMenuItem> </LeftMenuItem>
<QSeparator /> <QSeparator />
</template> </template>
<template v-for="item in filteredItems" :key="item.name"> <template v-for="(item, index) in filteredItems" :key="item.name">
<template <template
v-if="item.children && !filteredPinnedModules.has(item.name)" v-if="search ||item.children && !filteredPinnedModules.has(item.name)"
> >
<LeftMenuItem :item="item" group="modules"> <LeftMenuItem :item="item" group="modules" :class="search && index === 0 ? 'searched' : ''">
<template #side> <template #side>
<QBtn <QBtn
v-if="item.isPinned === true" v-if="item.isPinned === true"
@ -336,6 +342,9 @@ function normalize(text) {
.header { .header {
color: var(--vn-label-color); color: var(--vn-label-color);
} }
.searched{
background-color: var(--vn-section-hover-color);
}
</style> </style>
<i18n> <i18n>
es: es:

View File

@ -53,6 +53,7 @@ const url = computed(() => {
:fields="['id', 'name', 'nickname', 'code']" :fields="['id', 'name', 'nickname', 'code']"
:filter-options="['id', 'name', 'nickname', 'code']" :filter-options="['id', 'name', 'nickname', 'code']"
sort-by="nickname ASC" sort-by="nickname ASC"
data-cy="vnWorkerSelect"
> >
<template #prepend v-if="$props.hasAvatar"> <template #prepend v-if="$props.hasAvatar">
<VnAvatar :worker-id="value" color="primary" v-bind="$attrs" /> <VnAvatar :worker-id="value" color="primary" v-bind="$attrs" />

View File

@ -328,6 +328,7 @@ globals:
ticketsMonitor: Tickets monitor ticketsMonitor: Tickets monitor
clientsActionsMonitor: Clients and actions clientsActionsMonitor: Clients and actions
serial: Serial serial: Serial
business: Business
medical: Mutual medical: Mutual
pit: IRPF pit: IRPF
wasteRecalc: Waste recaclulate wasteRecalc: Waste recaclulate
@ -511,6 +512,24 @@ department:
hasToSendMail: Send check-ins by email hasToSendMail: Send check-ins by email
departmentRemoved: Department removed departmentRemoved: Department removed
worker: worker:
pageTitles:
workers: Workers
list: List
basicData: Basic data
summary: Summary
notifications: Notifications
workerCreate: New worker
department: Department
pda: PDA
notes: Notas
dms: My documentation
pbx: Private Branch Exchange
log: Log
calendar: Calendar
timeControl: Time control
locker: Locker
balance: Balance
medical: Medical
list: list:
department: Department department: Department
schedule: Schedule schedule: Schedule
@ -526,15 +545,24 @@ worker:
role: Role role: Role
sipExtension: Extension sipExtension: Extension
locker: Locker locker: Locker
fiDueDate: FI due date fiDueDate: DNI expiration date
sex: Sex sex: Sex
seniority: Seniority seniority: Antiquity
fi: DNI/NIE/NIF fi: DNI/NIE/NIF
birth: Birth birth: Birth
isFreelance: Freelance isFreelance: Freelance
isSsDiscounted: SS Bonification isSsDiscounted: SS Bonification
hasMachineryAuthorized: Machinery authorized hasMachineryAuthorized: Machinery authorized
isDisable: Disable isDisable: Disable
business: Business
started: Started
ended: Ended
reasonEnd: Reason End
department: Departament
workerBusinessCategory: Worker Business Category
notes: Notes
workCenter: Center
professionalCategory: Professional Category
notificationsManager: notificationsManager:
activeNotifications: Active notifications activeNotifications: Active notifications
availableNotifications: Available notifications availableNotifications: Available notifications
@ -593,6 +621,23 @@ worker:
sizeLimit: Size limit sizeLimit: Size limit
isOnReservationMode: Reservation mode isOnReservationMode: Reservation mode
machine: Machine machine: Machine
business:
tableVisibleColumns:
started: Start Date
ended: End Date
company: Company
reasonEnd: Reason for Termination
department: Department
professionalCategory: Professional Category
calendarType: Work Calendar
workCenter: Work Center
payrollCategories: Contract Category
occupationCode: Contribution Code
rate: Rate
businessType: Contract Type
amount: Salary
basicSalary: Transport Workers Salary
notes: Notes
wagon: wagon:
type: type:
submit: Submit submit: Submit

View File

@ -331,6 +331,7 @@ globals:
ticketsMonitor: Monitor de tickets ticketsMonitor: Monitor de tickets
clientsActionsMonitor: Clientes y acciones clientsActionsMonitor: Clientes y acciones
serial: Facturas por serie serial: Facturas por serie
business: Contratos
medical: Mutua medical: Mutua
pit: IRPF pit: IRPF
wasteRecalc: Recalcular mermas wasteRecalc: Recalcular mermas
@ -518,6 +519,26 @@ department:
hasToSendMail: Enviar fichadas por mail hasToSendMail: Enviar fichadas por mail
departmentRemoved: Departamento eliminado departmentRemoved: Departamento eliminado
worker: worker:
pageTitles:
workers: Trabajadores
list: Listado
basicData: Datos básicos
summary: Resumen
notifications: Notificaciones
workerCreate: Nuevo trabajador
department: Departamentos
pda: PDA
notes: Notas
dms: Mi documentación
pbx: Centralita
log: Historial
calendar: Calendario
timeControl: Control de horario
locker: Taquilla
balance: Balance
business: Contrato
formation: Formación
medical: Mutua
list: list:
department: Departamento department: Departamento
schedule: Horario schedule: Horario
@ -542,6 +563,15 @@ worker:
isSsDiscounted: Bonificación SS isSsDiscounted: Bonificación SS
hasMachineryAuthorized: Autorizado para maquinaria hasMachineryAuthorized: Autorizado para maquinaria
isDisable: Deshabilitado isDisable: Deshabilitado
business: Contrato
started: Antigüedad
ended: Fin
reasonEnd: Motivo finalización
department: Departamento
workerBusinessCategory: Categoria profesional
notes: Notas
workCenter: Centro
professionalCategory: Categoria profesional
notificationsManager: notificationsManager:
activeNotifications: Notificaciones activas activeNotifications: Notificaciones activas
availableNotifications: Notificaciones disponibles availableNotifications: Notificaciones disponibles
@ -588,6 +618,23 @@ worker:
debit: Debe debit: Debe
credit: Haber credit: Haber
concept: Concepto concept: Concepto
business:
tableVisibleColumns:
started: Fecha inicio
ended: Fecha fin
company: Empresa
reasonEnd: Motivo finalización
department: Departamento
professionalCategory: Categoria profesional
calendarType: Calendario laboral
workCenter: Centro
payrollCategories: Categoria contrato
occupationCode: Cotización
rate: Tarifa
businessType: Contrato
amount: Salario
basicSalary: Salario transportistas
notes: Notas
operator: operator:
numberOfWagons: Número de vagones numberOfWagons: Número de vagones
train: tren train: tren
@ -600,7 +647,6 @@ worker:
sizeLimit: Tamaño límite sizeLimit: Tamaño límite
isOnReservationMode: Modo de reserva isOnReservationMode: Modo de reserva
machine: Máquina machine: Máquina
wagon: wagon:
type: type:
submit: Guardar submit: Guardar

View File

@ -226,6 +226,7 @@ const createInvoiceInCorrection = async () => {
v-ripple v-ripple
clickable clickable
@click="triggerMenu('correct')" @click="triggerMenu('correct')"
data-cy="createCorrectiveItem"
> >
<QItemSection <QItemSection
>{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection >{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection

View File

@ -5,6 +5,9 @@ import VnTable from 'components/VnTable/VnTable.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import VnSection from 'src/components/common/VnSection.vue'; import VnSection from 'src/components/common/VnSection.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const { t } = useI18n(); const { t } = useI18n();
const tableRef = ref(); const tableRef = ref();
@ -60,20 +63,17 @@ const columns = computed(() => [
label: t('code'), label: t('code'),
isTitle: true, isTitle: true,
cardVisible: true, cardVisible: true,
create: true,
}, },
{ {
align: 'left', align: 'left',
name: 'name', name: 'name',
label: t('globals.name'), label: t('globals.name'),
cardVisible: true, cardVisible: true,
create: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker'), label: t('worker'),
name: 'workerFk', name: 'workerFk',
create: true,
component: 'select', component: 'select',
attrs: { attrs: {
url: 'Workers/search', url: 'Workers/search',
@ -100,7 +100,6 @@ const columns = computed(() => [
align: 'left', align: 'left',
name: 'categoryFk', name: 'categoryFk',
label: t('ItemCategory'), label: t('ItemCategory'),
create: true,
component: 'select', component: 'select',
attrs: { attrs: {
options: itemCategoriesOptions.value, options: itemCategoriesOptions.value,
@ -112,7 +111,6 @@ const columns = computed(() => [
align: 'left', align: 'left',
name: 'Temperature', name: 'Temperature',
label: t('Temperature'), label: t('Temperature'),
create: true,
component: 'select', component: 'select',
attrs: { attrs: {
options: temperatureOptions.value, options: temperatureOptions.value,
@ -180,6 +178,29 @@ const columns = computed(() => [
<WorkerDescriptorProxy :id="row.workerFk" /> <WorkerDescriptorProxy :id="row.workerFk" />
</span> </span>
</template> </template>
<template #more-create-dialog="{ data }">
<VnInput v-model="data.code" :label="t('code')" data-cy="codeInput" />
<VnInput
v-model="data.name"
:label="t('globals.name')"
data-cy="nameInput"
/>
<VnSelectWorker v-model="data.workerFk" />
<VnSelect
:label="t('ItemCategory')"
v-model="data.categoryFk"
:options="itemCategoriesOptions"
hide-selected
data-cy="itemCategorySelect"
/>
<VnSelect
:label="t('Temperature')"
v-model="data.temperatureFk"
:options="temperatureOptions"
hide-selected
data-cy="temperatureSelect"
/>
</template>
</VnTable> </VnTable>
</template> </template>
</VnSection> </VnSection>

View File

@ -0,0 +1,234 @@
<script setup>
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue';
import { toDate } from 'src/filters';
import { useQuasar } from 'quasar';
import axios from 'axios';
const { t } = useI18n();
const route = useRoute();
const tableRef = ref();
const entityId = computed(() => route.params.id);
const quasar = useQuasar();
async function reactivateWorker() {
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
(data) => !data.ended
);
if (hasToReactive) {
quasar
.dialog({
message: t('Do you want to reactivate the user?'),
ok: {
push: true,
color: 'primary',
},
cancel: true,
})
.onOk(async () => {
await axios.patch(`Workers/${entityId.value}`, {
isDisable: false,
});
});
}
}
const columns = computed(() => [
{
name: 'started',
label: t('worker.business.tableVisibleColumns.started'),
align: 'left',
format: ({ started }) => toDate(started),
component: 'date',
cardVisible: true,
create: true,
},
{
name: 'ended',
label: t('worker.business.tableVisibleColumns.ended'),
align: 'left',
format: ({ ended }) => toDate(ended),
component: 'date',
cardVisible: true,
create: true,
},
{
label: t('worker.business.tableVisibleColumns.company'),
align: 'left',
name: 'companyCodeFk',
component: 'select',
attrs: {
url: 'Companies',
fields: ['code'],
optionLabel: 'code',
optionValue: 'code',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'reasonEndFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.reasonEnd'),
attrs: {
url: 'BusinessReasonEnds',
fields: ['id', 'reason'],
optionLabel: 'reason',
},
cardVisible: true,
},
{
align: 'left',
name: 'departmentFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.department'),
attrs: {
url: 'Departments',
fields: ['id', 'name'],
optionLabel: 'name',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'workerBusinessProfessionalCategoryFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.professionalCategory'),
attrs: {
url: 'WorkerBusinessProfessionalCategories',
fields: ['id', 'description', 'code'],
optionLabel: 'description',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'calendarTypeFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.calendarType'),
attrs: {
url: 'CalendarTypes',
fields: ['id', 'description'],
optionLabel: 'description',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'workcenterFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.workCenter'),
attrs: {
url: 'WorkCenters',
fields: ['id', 'name'],
optionLabel: 'name',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'workerBusinessCategoryFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.payrollCategories'),
attrs: {
url: 'payrollCategories',
fields: ['id', 'description'],
optionLabel: 'description',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'occupationCodeFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.occupationCode'),
attrs: {
url: 'OccupationCodes',
fields: ['code', 'name'],
optionValue: 'code',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'rate',
label: t('worker.business.tableVisibleColumns.rate'),
component: 'input',
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'workerBusinessTypeFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.businessType'),
attrs: {
url: 'WorkerBusinessTypes',
fields: ['id', 'name'],
},
cardVisible: true,
create: true,
},
{
align: 'left',
label: t('worker.business.tableVisibleColumns.amount'),
name: 'amount',
component: 'input',
cardVisible: true,
create: true,
},
{
align: 'left',
label: t('worker.business.tableVisibleColumns.basicSalary'),
name: 'basicSalary',
component: 'input',
cardVisible: true,
create: true,
},
{
name: 'notes',
label: t('worker.business.tableVisibleColumns.notes'),
align: 'left',
component: 'input',
cardVisible: true,
},
]);
</script>
<template>
<VnTable
ref="tableRef"
data-key="WorkerBusiness"
:url="`Workers/${entityId}/Business`"
save-url="/Businesses/crud"
:create="{
urlCreate: `Workers/${entityId}/Business`,
title: 'Create business',
onDataSaved: () => tableRef.reload(),
formInitialData: {},
}"
order="id DESC"
:columns="columns"
default-mode="card"
auto-load
:disable-option="{ table: true }"
:right-search="false"
card-class="grid-two q-gutter-x-xl q-gutter-y-md q-pr-lg q-py-lg"
:is-editable="true"
:use-model="true"
@save-changes="(data) => reactivateWorker(data)"
/>
</template>
<i18n>
es:
Do you want to reactivate the user?: desea reactivar el usuario?
</i18n>

View File

@ -12,6 +12,7 @@ import RoleDescriptorProxy from 'src/pages/Account/Role/Card/RoleDescriptorProxy
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue'; import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary'; import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
import WorkerDescriptorMenu from './WorkerDescriptorMenu.vue'; import WorkerDescriptorMenu from './WorkerDescriptorMenu.vue';
import axios from 'axios';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -27,6 +28,76 @@ const entityId = computed(() => $props.id || route.params.id);
const basicDataUrl = ref(null); const basicDataUrl = ref(null);
const advancedSummary = ref(); const advancedSummary = ref();
const filter = {
include: [
{
relation: 'user',
scope: {
fields: ['name', 'nickname', 'roleFk'],
include: [
{
relation: 'role',
scope: {
fields: ['name'],
},
},
{
relation: 'emailUser',
scope: {
fields: ['email'],
},
},
],
},
},
{
relation: 'department',
scope: {
include: {
relation: 'department',
scope: {
fields: ['name'],
},
},
},
},
{
relation: 'boss',
},
{
relation: 'client',
},
{
relation: 'sip',
},
{
relation: 'business',
scope: {
include: [
{
relation: 'department',
scope: {
fields: ['id', 'name'],
},
},
{
relation: 'reasonEnd',
scope: {
fields: ['id', 'reason'],
},
},
{
relation: 'workerBusinessProfessionalCategory',
scope: {
fields: ['id', 'description'],
},
},
],
},
},
],
};
onBeforeMount(async () => { onBeforeMount(async () => {
advancedSummary.value = await useAdvancedSummary('Workers', entityId.value); advancedSummary.value = await useAdvancedSummary('Workers', entityId.value);
basicDataUrl.value = `#/worker/${entityId.value}/basic-data`; basicDataUrl.value = `#/worker/${entityId.value}/basic-data`;
@ -37,7 +108,7 @@ onBeforeMount(async () => {
<CardSummary <CardSummary
ref="summary" ref="summary"
:url="`Workers/summary`" :url="`Workers/summary`"
:filter="{ where: { id: entityId } }" :user-filter="{ where: { id: entityId }, filter }"
data-key="Worker" data-key="Worker"
> >
<template #header="{ entity }"> <template #header="{ entity }">
@ -143,6 +214,29 @@ onBeforeMount(async () => {
</VnLv> </VnLv>
<VnLv :label="t('queue')" :value="worker.sip?.queueMember?.queue" /> <VnLv :label="t('queue')" :value="worker.sip?.queueMember?.queue" />
</QCard> </QCard>
<QCard class="vn-one" v-if="advancedSummary">
<VnTitle
:url="`#/worker/${entityId}/business`"
:text="t('worker.summary.business')"
/>
<VnLv
:label="t('worker.summary.started')"
:value="toDate(advancedSummary.currentBusiness?.started)"
/>
<VnLv
:label="t('worker.summary.ended')"
:value="toDate(advancedSummary.currentBusiness?.ended)"
/>
<VnLv
:label="t('worker.summary.reasonEnd')"
:value="advancedSummary.currentBusiness?.reasonEnd?.reason"
/>
<VnLv
:label="t('worker.summary.notes')"
:value="advancedSummary.currentBusiness?.notes"
/>
</QCard>
</template> </template>
</CardSummary> </CardSummary>
</template> </template>

View File

@ -8,6 +8,7 @@ const workerCard = {
meta: { meta: {
menu: [ menu: [
'WorkerBasicData', 'WorkerBasicData',
'WorkerBusiness',
'WorkerNotes', 'WorkerNotes',
'WorkerPda', 'WorkerPda',
'WorkerNotificationsManager', 'WorkerNotificationsManager',
@ -50,6 +51,15 @@ const workerCard = {
}, },
component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'), component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'),
}, },
{
path: 'business',
name: 'WorkerBusiness',
meta: {
title: 'business',
icon: 'handshake',
},
component: () => import('src/pages/Worker/Card/WorkerBusiness.vue'),
},
{ {
path: 'notes', path: 'notes',
name: 'NotesCard', name: 'NotesCard',

View File

@ -1,8 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
// https://redmine.verdnatura.es/issues/8419 describe('InvoiceInCorrective', () => {
describe.skip('InvoiceInCorrective', () => {
const createCorrective = '.q-menu > .q-list > :nth-child(6) > .q-item__section';
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
const saveDialog = '.q-card > .q-card__actions > .q-btn--standard '; const saveDialog = '.q-card > .q-card__actions > .q-btn--standard ';
it('should create a correcting invoice', () => { it('should create a correcting invoice', () => {
@ -13,13 +10,13 @@ describe.skip('InvoiceInCorrective', () => {
cy.openActionsDescriptor(); cy.openActionsDescriptor();
cy.get(createCorrective).click(); cy.dataCy('createCorrectiveItem').click();
cy.get(saveDialog).click(); cy.get(saveDialog).click();
cy.wait('@corrective').then((interception) => { cy.wait('@corrective').then((interception) => {
const correctingId = interception.response.body; const correctingId = interception.response.body;
cy.url().should('include', `/invoice-in/${correctingId}/summary`); cy.url().should('include', `/invoice-in/${correctingId}/summary`);
cy.visit(`/#/invoice-in/${correctingId}/corrective`);
}); });
cy.get(rectificativeSection).click();
cy.get('tbody > tr:visible').should('have.length', 1); cy.get('tbody > tr:visible').should('have.length', 1);
}); });
}); });

View File

@ -1,7 +1,7 @@
describe('InvoiceInDescriptor', () => { describe('InvoiceInDescriptor', () => {
const dialogBtns = '.q-card__actions button'; const book = '.summaryHeader > .no-wrap > .q-btn';
const firstDescritorOpt = '.q-menu > .q-list > :nth-child(1) > .q-item__section'; const firstDescritorOpt = '.q-menu > .q-list > :nth-child(5) > .q-item__section';
const isBookedField = '.q-card:nth-child(3) .vn-label-value:nth-child(5) .q-checkbox'; const checkbox = ':nth-child(5) > .q-checkbox';
it('should booking and unbooking the invoice properly', () => { it('should booking and unbooking the invoice properly', () => {
cy.viewport(1280, 720); cy.viewport(1280, 720);
@ -9,13 +9,13 @@ describe('InvoiceInDescriptor', () => {
cy.visit('/#/invoice-in/1/summary'); cy.visit('/#/invoice-in/1/summary');
cy.waitForElement('.q-page'); cy.waitForElement('.q-page');
cy.openActionsDescriptor(); cy.get(book).click();
cy.get(firstDescritorOpt).click(); cy.dataCy('VnConfirm_confirm').click();
cy.get(dialogBtns).eq(1).click(); cy.get(checkbox).invoke('attr', 'aria-checked').should('eq', 'true');
cy.get(isBookedField).should('have.attr', 'aria-checked', 'true');
cy.dataCy('descriptor-more-opts').first().click();
cy.get(firstDescritorOpt).click(); cy.get(firstDescritorOpt).click();
cy.get(dialogBtns).eq(1).click(); cy.dataCy('VnConfirm_confirm').click();
cy.get(isBookedField).should('have.attr', 'aria-checked', 'false'); cy.get(checkbox).invoke('attr', 'aria-checked').should('eq', 'false');
}); });
}); });

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Item shelving', () => { describe('ItemBarcodes', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');

View File

@ -1,5 +1,10 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Item type', () => { describe('Item type', () => {
const workerError = 'employeeNick';
const worker = 'buyerNick';
const category = 'Artificial';
const type = 'Flower';
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
@ -8,32 +13,24 @@ describe('Item type', () => {
it('should throw an error if the code already exists', () => { it('should throw an error if the code already exists', () => {
cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('vnTableCreateBtn').click();
cy.get( cy.dataCy('codeInput').type('ALS');
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]' cy.dataCy('nameInput').type('Alstroemeria');
).type('ALS'); cy.dataCy('vnWorkerSelect').type(workerError);
cy.get( cy.get('.q-menu .q-item').contains(workerError).click();
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]' cy.dataCy('itemCategorySelect').type(category);
).type('Alstroemeria'); cy.get('.q-menu .q-item').contains(category).click();
cy.dataCy('Worker_select').type('employeeNick');
cy.get('.q-menu .q-item').contains('employeeNick').click();
cy.dataCy('ItemCategory_select').type('Artificial');
cy.get('.q-menu .q-item').contains('Artificial').click();
cy.dataCy('FormModelPopup_save').click(); cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('An item type with the same code already exists'); cy.checkNotification('An item type with the same code already exists');
}); });
it('should create a new type', () => { it('should create a new type', () => {
cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('vnTableCreateBtn').click();
cy.get( cy.dataCy('codeInput').type('LIL');
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]' cy.dataCy('nameInput').type('Lilium');
).type('LIL'); cy.dataCy('vnWorkerSelect').type(worker);
cy.get( cy.get('.q-menu .q-item').contains(worker).click();
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]' cy.dataCy('itemCategorySelect').type(type);
).type('Lilium'); cy.get('.q-menu .q-item').contains(type).click();
cy.dataCy('Worker_select').type('buyerNick');
cy.get('.q-menu .q-item').contains('buyerNick').click();
cy.dataCy('ItemCategory_select').type('Flower');
cy.get('.q-menu .q-item').contains('Flower').click();
cy.dataCy('FormModelPopup_save').click(); cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created'); cy.checkNotification('Data created');
}); });

View File

@ -14,17 +14,16 @@ describe('ZoneWarehouse', () => {
it('should throw an error if the warehouse chosen is already put in the zone', () => { it('should throw an error if the warehouse chosen is already put in the zone', () => {
cy.addBtnClick(); cy.addBtnClick();
cy.selectOption('[data-cy="Warehouse_select"]', 'Warehouse Two'); cy.dataCy('Warehouse_select').type('Warehouse Two{enter}');
cy.get(saveBtn).click(); cy.get(saveBtn).click();
cy.checkNotification(dataError); cy.checkNotification(dataError);
}); });
// https://redmine.verdnatura.es/issues/8425
it.skip('should create & remove a warehouse', () => { it('should create & remove a warehouse', () => {
cy.addBtnClick(); cy.addBtnClick();
cy.fillInForm(data); cy.fillInForm(data);
cy.get(saveBtn).click(); cy.get(saveBtn).click();
cy.get('.q-mt-lg > .q-btn--standard').click(); cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click(); cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
cy.get('[title="Confirm"]').click(); cy.get('[title="Confirm"]').click();