Merge branch 'dev' into 6695-docker_push_3
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-02-21 11:46:35 +00:00
commit deaeee07e0
18 changed files with 242 additions and 92 deletions

View File

@ -152,7 +152,7 @@ const onTabPressed = async () => {
}; };
</script> </script>
<template> <template>
<div v-if="showFilter" class="full-width flex-center" style="overflow: hidden"> <div v-if="showFilter" class="full-width" style="overflow: hidden">
<VnColumn <VnColumn
:column="$props.column" :column="$props.column"
default="input" default="input"

View File

@ -23,6 +23,10 @@ const $props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
align: {
type: String,
default: 'end',
},
}); });
const hover = ref(); const hover = ref();
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl }); const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
@ -46,16 +50,27 @@ async function orderBy(name, direction) {
} }
defineExpose({ orderBy }); defineExpose({ orderBy });
function textAlignToFlex(textAlign) {
return `justify-content: ${
{
'text-center': 'center',
'text-left': 'start',
'text-right': 'end',
}[textAlign] || 'start'
};`;
}
</script> </script>
<template> <template>
<div <div
@mouseenter="hover = true" @mouseenter="hover = true"
@mouseleave="hover = false" @mouseleave="hover = false"
@click="orderBy(name, model?.direction)" @click="orderBy(name, model?.direction)"
class="row items-center no-wrap cursor-pointer title" class="items-center no-wrap cursor-pointer title"
:style="textAlignToFlex(align)"
> >
<span :title="label">{{ label }}</span> <span :title="label">{{ label }}</span>
<sup v-if="name && model?.index"> <div v-if="name && model?.index">
<QChip <QChip
:label="!vertical ? model?.index : ''" :label="!vertical ? model?.index : ''"
:icon=" :icon="
@ -92,20 +107,16 @@ defineExpose({ orderBy });
/> />
</div> </div>
</QChip> </QChip>
</sup> </div>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.title { .title {
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
height: 30px; height: 30px;
width: 100%; width: 100%;
color: var(--vn-label-color); color: var(--vn-label-color);
} white-space: nowrap;
sup {
vertical-align: super; /* Valor predeterminado */
/* También puedes usar otros valores como "baseline", "top", "text-top", etc. */
} }
</style> </style>

View File

@ -551,9 +551,8 @@ function formatColumnValue(col, row, dashIfEmpty) {
return dashIfEmpty(row[urlRelation][col?.attrs.optionLabel ?? 'name']); return dashIfEmpty(row[urlRelation][col?.attrs.optionLabel ?? 'name']);
} }
if (typeof row[urlRelation] == 'string') return dashIfEmpty(row[urlRelation]); if (typeof row[urlRelation] == 'string') return dashIfEmpty(row[urlRelation]);
} else {
return dashIfEmpty(row[col?.name]);
} }
return dashIfEmpty(row[col?.name]);
} }
function cardClick(_, row) { function cardClick(_, row) {
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` }); if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
@ -648,15 +647,14 @@ function cardClick(_, row) {
v-bind:class="col.headerClass" v-bind:class="col.headerClass"
class="body-cell" class="body-cell"
:style="col?.width ? `max-width: ${col?.width}` : ''" :style="col?.width ? `max-width: ${col?.width}` : ''"
style="padding: inherit"
> >
<div <div
class="no-padding" class="no-padding"
:style=" :style="[
withFilters && $props.columnSearch ? 'height: 75px' : '' withFilters && $props.columnSearch ? 'height: 75px' : '',
" ]"
> >
<div class="text-center" style="height: 30px"> <div style="height: 30px">
<QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip> <QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip>
<VnTableOrder <VnTableOrder
v-model="orders[col.orderBy ?? col.name]" v-model="orders[col.orderBy ?? col.name]"
@ -664,6 +662,7 @@ function cardClick(_, row) {
:label="col?.labelAbbreviation ?? col?.label" :label="col?.labelAbbreviation ?? col?.label"
:data-key="$attrs['data-key']" :data-key="$attrs['data-key']"
:search-url="searchUrl" :search-url="searchUrl"
:align="getColAlign(col)"
/> />
</div> </div>
<VnFilter <VnFilter
@ -1045,8 +1044,8 @@ es:
} }
.body-cell { .body-cell {
padding-left: 2px !important; padding-left: 4px !important;
padding-right: 2px !important; padding-right: 4px !important;
position: relative; position: relative;
} }
.bg-chip-secondary { .bg-chip-secondary {

View File

@ -48,7 +48,8 @@ function toValueAttrs(attrs) {
<span <span
v-for="toComponent of componentArray" v-for="toComponent of componentArray"
:key="toComponent.name" :key="toComponent.name"
class="column flex-center fit" class="column fit"
:class="toComponent?.component == 'checkbox' ? 'flex-center' : ''"
> >
<component <component
v-if="toComponent?.component" v-if="toComponent?.component"

View File

@ -1,14 +1,14 @@
export function getColAlign(col) { export function getColAlign(col) {
let align; let align;
switch (col.component) { switch (col.component) {
case 'time':
case 'date':
case 'select': case 'select':
align = 'left'; align = 'left';
break; break;
case 'number': case 'number':
align = 'right'; align = 'right';
break; break;
case 'time':
case 'date':
case 'checkbox': case 'checkbox':
align = 'center'; align = 'center';
break; break;

View File

@ -3,6 +3,8 @@ import { useI18n } from 'vue-i18n';
export default function (value, options = {}) { export default function (value, options = {}) {
if (!value) return; if (!value) return;
if (!isValidDate(value)) return null;
if (!options.dateStyle && !options.timeStyle) { if (!options.dateStyle && !options.timeStyle) {
options.day = '2-digit'; options.day = '2-digit';
options.month = '2-digit'; options.month = '2-digit';
@ -10,7 +12,12 @@ export default function (value, options = {}) {
} }
const { locale } = useI18n(); const { locale } = useI18n();
const date = new Date(value); const newDate = new Date(value);
return new Intl.DateTimeFormat(locale.value, options).format(date); return new Intl.DateTimeFormat(locale.value, options).format(newDate);
}
// handle 0000-00-00
function isValidDate(date) {
const parsedDate = new Date(date);
return parsedDate instanceof Date && !isNaN(parsedDate.getTime());
} }

View File

@ -16,7 +16,6 @@ import ItemDescriptor from 'src/pages/Item/Card/ItemDescriptor.vue';
import axios from 'axios'; import axios from 'axios';
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue'; import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
import { checkEntryLock } from 'src/composables/checkEntryLock'; import { checkEntryLock } from 'src/composables/checkEntryLock';
import SkeletonDescriptor from 'src/components/ui/SkeletonDescriptor.vue';
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -103,7 +102,7 @@ const columns = [
name: 'itemFk', name: 'itemFk',
component: 'number', component: 'number',
isEditable: false, isEditable: false,
width: '40px', width: '35px',
}, },
{ {
labelAbbreviation: '', labelAbbreviation: '',
@ -111,7 +110,7 @@ const columns = [
name: 'hex', name: 'hex',
columnSearch: false, columnSearch: false,
isEditable: false, isEditable: false,
width: '5px', width: '9px',
component: 'select', component: 'select',
attrs: { attrs: {
url: 'Inks', url: 'Inks',
@ -181,6 +180,7 @@ const columns = [
url: 'packagings', url: 'packagings',
fields: ['id'], fields: ['id'],
optionLabel: 'id', optionLabel: 'id',
optionValue: 'id',
}, },
create: true, create: true,
width: '40px', width: '40px',
@ -192,7 +192,7 @@ const columns = [
component: 'number', component: 'number',
create: true, create: true,
width: '35px', width: '35px',
format: (row, dashIfEmpty) => parseFloat(row['weight']).toFixed(1), format: (row) => parseFloat(row['weight']).toFixed(1),
}, },
{ {
labelAbbreviation: 'P', labelAbbreviation: 'P',
@ -330,6 +330,25 @@ const columns = [
create: true, create: true,
format: (row) => parseFloat(row['price3']).toFixed(2), format: (row) => parseFloat(row['price3']).toFixed(2),
}, },
{
align: 'center',
labelAbbreviation: 'CM',
label: t('Check min price'),
toolTip: t('Check min price'),
name: 'hasMinPrice',
attrs: {
toggleIndeterminate: false,
},
component: 'checkbox',
cellEvent: {
'update:modelValue': async (value, oldValue, row) => {
await axios.patch(`Items/${row['itemFk']}`, {
hasMinPrice: value,
});
},
},
width: '25px',
},
{ {
align: 'center', align: 'center',
labelAbbreviation: 'Min.', labelAbbreviation: 'Min.',
@ -350,25 +369,6 @@ const columns = [
}, },
format: (row) => parseFloat(row['minPrice']).toFixed(2), format: (row) => parseFloat(row['minPrice']).toFixed(2),
}, },
{
align: 'center',
labelAbbreviation: 'CM',
label: t('Check min price'),
toolTip: t('Check min price'),
name: 'hasMinPrice',
attrs: {
toggleIndeterminate: false,
},
component: 'checkbox',
cellEvent: {
'update:modelValue': async (value, oldValue, row) => {
await axios.patch(`Items/${row['itemFk']}`, {
hasMinPrice: value,
});
},
},
width: '25px',
},
{ {
align: 'center', align: 'center',
labelAbbreviation: t('P.Sen'), labelAbbreviation: t('P.Sen'),
@ -378,6 +378,9 @@ const columns = [
component: 'number', component: 'number',
isEditable: false, isEditable: false,
width: '40px', width: '40px',
style: () => {
return { color: 'var(--vn-label-color)' };
},
}, },
{ {
align: 'center', align: 'center',
@ -417,6 +420,9 @@ const columns = [
component: 'input', component: 'input',
isEditable: false, isEditable: false,
width: '35px', width: '35px',
style: () => {
return { color: 'var(--vn-label-color)' };
},
}, },
]; ];
@ -644,8 +650,8 @@ onMounted(() => {
:is-editable="editableMode" :is-editable="editableMode"
:without-header="!editableMode" :without-header="!editableMode"
:with-filters="editableMode" :with-filters="editableMode"
:right-search="false" :right-search="true"
:right-search-icon="false" :right-search-icon="true"
:row-click="false" :row-click="false"
:columns="columns" :columns="columns"
:beforeSaveFn="beforeSave" :beforeSaveFn="beforeSave"

View File

@ -199,7 +199,6 @@ const columns = computed(() => [
optionValue: 'code', optionValue: 'code',
optionLabel: 'description', optionLabel: 'description',
}, },
cardVisible: true,
width: '65px', width: '65px',
format: (row, dashIfEmpty) => dashIfEmpty(row.entryTypeDescription), format: (row, dashIfEmpty) => dashIfEmpty(row.entryTypeDescription),
}, },

View File

@ -57,7 +57,7 @@ const columns = computed(() => [
create: true, create: true,
component: 'number', component: 'number',
summation: true, summation: true,
width: '60px', width: '50px',
}, },
{ {
align: 'center', align: 'center',
@ -286,7 +286,7 @@ function round(value) {
justify-content: center; justify-content: center;
} }
.column { .column {
min-width: 30%; min-width: 40%;
margin-top: 5%; margin-top: 5%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -101,7 +101,8 @@ const columns = [
</template> </template>
<style lang="css" scoped> <style lang="css" scoped>
.container { .container {
max-width: 50vw; max-width: 100%;
width: 50%;
overflow: auto; overflow: auto;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -109,9 +110,6 @@ const columns = [
background-color: var(--vn-section-color); background-color: var(--vn-section-color);
padding: 2%; padding: 2%;
} }
.container > div > div > .q-table__top.relative-position.row.items-center {
background-color: red !important;
}
</style> </style>
<i18n> <i18n>
es: es:

View File

@ -163,10 +163,14 @@ const showExportationLetter = () => {
<QMenu anchor="top end" self="top start"> <QMenu anchor="top end" self="top start">
<QList> <QList>
<QItem v-ripple clickable @click="showSendInvoiceDialog('pdf')"> <QItem v-ripple clickable @click="showSendInvoiceDialog('pdf')">
<QItemSection>{{ t('Send PDF') }}</QItemSection> <QItemSection data-cy="InvoiceOutDescriptorMenuSendPdfOption">
{{ t('Send PDF') }}
</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable @click="showSendInvoiceDialog('csv')"> <QItem v-ripple clickable @click="showSendInvoiceDialog('csv')">
<QItemSection>{{ t('Send CSV') }}</QItemSection> <QItemSection data-cy="InvoiceOutDescriptorMenuSendCsvOption">
{{ t('Send CSV') }}
</QItemSection>
</QItem> </QItem>
</QList> </QList>
</QMenu> </QMenu>

View File

@ -24,6 +24,7 @@ invoiceOut:
min: Min min: Min
max: Max max: Max
hasPdf: Has PDF hasPdf: Has PDF
search: Contains
card: card:
issued: Issued issued: Issued
customerCard: Customer card customerCard: Customer card

View File

@ -24,6 +24,7 @@ invoiceOut:
min: Min min: Min
max: Max max: Max
hasPdf: Tiene PDF hasPdf: Tiene PDF
search: Contiene
card: card:
issued: Fecha emisión issued: Fecha emisión
customerCard: Ficha del cliente customerCard: Ficha del cliente

View File

@ -8,6 +8,7 @@ import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps({
@ -52,7 +53,7 @@ onMounted(async () => {
name: key, name: key,
value, value,
selectedField: { name: key, label: t(`params.${key}`) }, selectedField: { name: key, label: t(`params.${key}`) },
}) }),
); );
} }
exprBuilder('state', arrayData.store?.userParams?.state); exprBuilder('state', arrayData.store?.userParams?.state);
@ -157,6 +158,32 @@ onMounted(async () => {
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.from"
:label="t('params.from')"
is-outlined
/>
</QItemSection>
<QItemSection>
<VnInputDate
v-model="params.to"
:label="t('params.to')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.daysOnward')"
v-model="params.daysOnward"
lazy-rules
is-outlined
/>
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnSelect <VnSelect
@ -175,11 +202,10 @@ onMounted(async () => {
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QCheckbox
:label="t('params.daysOnward')" :label="t('params.mine')"
v-model="params.daysOnward" v-model="params.mine"
lazy-rules :toggle-indeterminate="false"
is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>

View File

@ -3,6 +3,7 @@ import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { dashIfEmpty } from 'src/filters';
const tableRef = ref(); const tableRef = ref();
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
@ -44,9 +45,12 @@ const columns = [
create: true, create: true,
component: 'select', component: 'select',
attrs: { attrs: {
url: 'centers', url: 'medicalCenters',
fields: ['id', 'name'], fields: ['id', 'name'],
}, },
format: (row, dashIfEmpty) => {
return dashIfEmpty(row.center?.name);
},
}, },
{ {
align: 'left', align: 'left',

View File

@ -1,6 +1,16 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('InvoiceOut list', () => { describe('InvoiceOut list', () => {
const serial = 'Española rapida'; const serial = 'Española rapida';
const columnCheckbox =
'.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner';
const firstRowDescriptor =
'tbody > :nth-child(1) > [data-col-field="clientFk"] > .no-padding > .link';
const firstRowCheckbox =
'tbody > :nth-child(1) > :nth-child(1) > .q-checkbox > .q-checkbox__inner ';
const summaryPopupIcon = '.header > :nth-child(2) > .q-btn__content > .q-icon';
const filterBtn = '.q-scrollarea__content > .q-btn--standard > .q-btn__content';
const firstSummaryIcon =
':nth-child(1) > .text-right > [data-cy="tableAction-0"] > .q-btn__content > .q-icon';
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
@ -9,18 +19,32 @@ describe('InvoiceOut list', () => {
cy.typeSearchbar('{enter}'); cy.typeSearchbar('{enter}');
}); });
it('should search and filter an invoice and enter to the summary', () => { it('should download one pdf from the subtoolbar button', () => {
cy.typeSearchbar('1{enter}'); cy.get(firstRowCheckbox).click();
cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click(); cy.dataCy('InvoiceOutDownloadPdfBtn').click();
cy.get('.header > a.q-btn > .q-btn__content').click();
cy.typeSearchbar('{enter}');
cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
}); });
it('should download all pdfs', () => { it('should download all pdfs', () => {
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click(); cy.get(columnCheckbox).click();
cy.dataCy('InvoiceOutDownloadPdfBtn').click(); cy.dataCy('InvoiceOutDownloadPdfBtn').click();
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click(); });
it('should open the invoice descriptor from table icon', () => {
cy.get(firstSummaryIcon).click();
cy.get('.cardSummary').should('be.visible');
cy.get('.summaryHeader > div').should('include.text', 'A1111111');
});
it('should open the client descriptor', () => {
cy.get(firstRowDescriptor).click();
cy.get(summaryPopupIcon).click();
});
it('should filter the results by client ID, then check the first result is correct', () => {
cy.dataCy('Customer ID_input').type('1103');
cy.get(filterBtn).click();
cy.get(firstRowDescriptor).click();
cy.get('.q-item > .q-item__label').should('include.text', '1103');
}); });
it('should give an error when manual invoicing a ticket that is already invoiced', () => { it('should give an error when manual invoicing a ticket that is already invoiced', () => {
@ -31,11 +55,14 @@ describe('InvoiceOut list', () => {
cy.checkNotification('This ticket is already invoiced'); cy.checkNotification('This ticket is already invoiced');
}); });
it('should create a manual invoice and enter to its summary', () => { it('should create a manual invoice and enter to its summary, then delete that invoice', () => {
cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('InvoiceOutCreateTicketinput').type(8); cy.dataCy('InvoiceOutCreateTicketinput').type(9);
cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial); cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial);
cy.dataCy('FormModelPopup_save').click(); cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created'); cy.checkNotification('Data created');
cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(4)').click();
cy.dataCy('VnConfirm_confirm').click();
}); });
}); });

View File

@ -1,11 +1,26 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('InvoiceOut negative bases', () => { describe('InvoiceOut negative bases', () => {
const getDescriptors = (opt) =>
`:nth-child(1) > [data-col-field="${opt}"] > .no-padding > .link`;
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit(`/#/invoice-out/negative-bases`); cy.visit(`/#/invoice-out/negative-bases`);
}); });
it('should open the posible descriptors', () => {
cy.get(getDescriptors('clientId')).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
cy.get(getDescriptors('ticketFk')).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '23');
cy.get(getDescriptors('workerName')).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '18');
});
it('should filter and download as CSV', () => { it('should filter and download as CSV', () => {
cy.get('input[name="ticketFk"]').type('23{enter}'); cy.get('input[name="ticketFk"]').type('23{enter}');
cy.get('#subToolbar > .q-btn').click(); cy.get('#subToolbar > .q-btn').click();

View File

@ -5,40 +5,91 @@ describe('InvoiceOut summary', () => {
Type: { val: 'Error in customer data', type: 'select' }, Type: { val: 'Error in customer data', type: 'select' },
}; };
const firstRowDescriptors = (opt) =>
`tbody > :nth-child(1) > :nth-child(${opt}) > .q-btn`;
const toCustomerSummary = '[href="#/customer/1101"]';
const toTicketList = '[href="#/ticket/list?table={%22refFk%22:%22T1111111%22}"]';
const selectMenuOption = (opt) => `.q-menu > .q-list > :nth-child(${opt})`;
const confirmSend = '.q-btn--unelevated';
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit(`/#/invoice-out/list`); cy.visit(`/#/invoice-out/1/summary`);
}); });
it('should generate the invoice PDF', () => { it('open the descriptors', () => {
cy.typeSearchbar('T1111111{enter}'); cy.get(firstRowDescriptors(1)).click();
cy.dataCy('descriptor-more-opts').click(); cy.get('.descriptor').should('be.visible');
cy.get('.q-menu > .q-list > :nth-child(6)').click(); cy.get('.q-item > .q-item__label').should('include.text', '1');
cy.dataCy('VnConfirm_confirm').click(); cy.get(firstRowDescriptors(2)).click();
cy.checkNotification('The invoice PDF document has been regenerated'); cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
}); });
it('should refund the invoice ', () => {
it('should open the client summary and the ticket list', () => {
cy.get(toCustomerSummary).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
it('should open the ticket list', () => {
cy.get(toTicketList).click();
cy.get('.descriptor').should('be.visible');
cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111');
});
it('should transfer the invoice ', () => {
cy.typeSearchbar('T1111111{enter}'); cy.typeSearchbar('T1111111{enter}');
cy.dataCy('descriptor-more-opts').click(); cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(7)').click(); cy.get(selectMenuOption(1)).click();
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click(); cy.fillInForm(transferInvoice);
cy.checkNotification('The following refund ticket have been created'); cy.get('.q-mt-lg > .q-btn').click();
cy.checkNotification('Transferred invoice');
});
it('should send the invoice as PDF', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(3)).click();
cy.dataCy('InvoiceOutDescriptorMenuSendPdfOption').click();
cy.get(confirmSend).click();
cy.checkNotification('Notification sent');
});
it('should send the invoice as CSV', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(3)).click();
cy.dataCy('InvoiceOutDescriptorMenuSendCsvOption').click();
cy.get(confirmSend).click();
cy.checkNotification('Notification sent');
}); });
it('should delete an invoice ', () => { it('should delete an invoice ', () => {
cy.typeSearchbar('T2222222{enter}'); cy.typeSearchbar('T2222222{enter}');
cy.dataCy('descriptor-more-opts').click(); cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(4)').click(); cy.get(selectMenuOption(4)).click();
cy.dataCy('VnConfirm_confirm').click(); cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('InvoiceOut deleted'); cy.checkNotification('InvoiceOut deleted');
}); });
it('should transfer the invoice ', () => {
cy.typeSearchbar('T1111111{enter}'); it('should book the invoice', () => {
cy.dataCy('descriptor-more-opts').click(); cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(1)').click(); cy.get(selectMenuOption(5)).click();
cy.fillInForm(transferInvoice); cy.dataCy('VnConfirm_confirm').click();
cy.get('.q-mt-lg > .q-btn').click(); cy.checkNotification('InvoiceOut booked');
cy.checkNotification('Transferred invoice'); });
it('should generate the invoice PDF', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(6)).click();
cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('The invoice PDF document has been regenerated');
});
it('should refund the invoice ', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(7)).click();
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
cy.checkNotification('The following refund ticket have been created');
}); });
}); });