Compare commits
46 Commits
46cb18b5ef
...
c006b4cb37
Author | SHA1 | Date |
---|---|---|
Pablo Natek | c006b4cb37 | |
Javier Segarra | 3bc5c9bd6a | |
Javier Segarra | 81d7b9f04f | |
Jon Elias | e943838dbe | |
Jon Elias | 4d8d56eb6e | |
Alex Moreno | 9e41459da4 | |
Alex Moreno | 6b8470d6e1 | |
Javier Segarra | 350c28eef0 | |
Alex Moreno | c1e06325d3 | |
William Buezas | 8e411125bf | |
Javier Segarra | 3b5d385d22 | |
Jorge Penadés | 7039b68bba | |
Javi Gallego | bc173d9f6a | |
Javi Gallego | 2a1cc49499 | |
Carlos Satorres | 093e6cb0e8 | |
Carlos Satorres | 131cd2de8c | |
Carlos Satorres | 2d5d1c549b | |
Carlos Satorres | c59baf9cf5 | |
Alex Moreno | 51beef3cbe | |
Carlos Satorres | 2806c94fdb | |
Jon Elias | 71c26c2fa7 | |
Jon Elias | 26ee54c488 | |
Alex Moreno | eee5873283 | |
Alex Moreno | 98ac560b16 | |
Alex Moreno | c1d9650c60 | |
Alex Moreno | e33bb9f8b5 | |
Alex Moreno | 3ba8402dfd | |
Alex Moreno | 67a5800a66 | |
Alex Moreno | 46430d1b6d | |
Alex Moreno | 44134a8fec | |
Alex Moreno | fef7dd9ac1 | |
Jon Elias | 98017df57d | |
Jon Elias | 7cef1d11be | |
Jon Elias | cf6695f7ff | |
Jon Elias | 5acce4d61d | |
William Buezas | 28bfda869a | |
Javier Segarra | 73072794ee | |
Javier Segarra | 2f06eea8ea | |
William Buezas | d8c1bd5b16 | |
Jon Elias | 8cfc2996d4 | |
Jon Elias | 7f4a73fd56 | |
Jon Elias | cc85d4ab4b | |
Jon Elias | 9533c1a97e | |
William Buezas | 4bfbd1925e | |
Jon Elias | 493e518339 | |
Jon Elias | e13090bb3b |
|
@ -9,8 +9,6 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import FormModelPopup from './FormModelPopup.vue';
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
defineProps({ showEntityField: { type: Boolean, default: true } });
|
||||
|
||||
const emit = defineEmits(['onDataSaved']);
|
||||
const { t } = useI18n();
|
||||
const bicInputRef = ref(null);
|
||||
|
@ -18,17 +16,16 @@ const state = useState();
|
|||
|
||||
const customer = computed(() => state.get('customer'));
|
||||
|
||||
const countriesFilter = {
|
||||
fields: ['id', 'name', 'code'],
|
||||
};
|
||||
|
||||
const bankEntityFormData = reactive({
|
||||
name: null,
|
||||
bic: null,
|
||||
countryFk: customer.value?.countryFk,
|
||||
id: null,
|
||||
});
|
||||
|
||||
const countriesFilter = {
|
||||
fields: ['id', 'name', 'code'],
|
||||
};
|
||||
|
||||
const countriesOptions = ref([]);
|
||||
|
||||
const onDataSaved = (...args) => {
|
||||
|
@ -44,7 +41,6 @@ onMounted(async () => {
|
|||
<template>
|
||||
<FetchData
|
||||
url="Countries"
|
||||
:filter="countriesFilter"
|
||||
auto-load
|
||||
@on-fetch="(data) => (countriesOptions = data)"
|
||||
/>
|
||||
|
@ -54,6 +50,7 @@ onMounted(async () => {
|
|||
:title="t('title')"
|
||||
:subtitle="t('subtitle')"
|
||||
:form-initial-data="bankEntityFormData"
|
||||
:filter="countriesFilter"
|
||||
@on-data-saved="onDataSaved"
|
||||
>
|
||||
<template #form-inputs="{ data, validate }">
|
||||
|
@ -85,7 +82,13 @@ onMounted(async () => {
|
|||
:rules="validate('bankEntity.countryFk')"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="showEntityField" class="col">
|
||||
<div
|
||||
v-if="
|
||||
countriesOptions.find((c) => c.id === data.countryFk)?.code ==
|
||||
'ES'
|
||||
"
|
||||
class="col"
|
||||
>
|
||||
<VnInput
|
||||
:label="t('id')"
|
||||
v-model="data.id"
|
||||
|
|
|
@ -394,6 +394,7 @@ watch(formUrl, async () => {
|
|||
@click="onSubmit"
|
||||
:disable="!hasChanges"
|
||||
:title="t('globals.save')"
|
||||
data-cy="crudModelDefaultSaveBtn"
|
||||
/>
|
||||
<slot name="moreAfterActions" />
|
||||
</QBtnGroup>
|
||||
|
|
|
@ -143,6 +143,10 @@ function alignRow() {
|
|||
const showFilter = computed(
|
||||
() => $props.column?.columnFilter !== false && $props.column.name != 'tableActions'
|
||||
);
|
||||
|
||||
const onTabPressed = async () => {
|
||||
if (model.value) enterEvent['keyup.enter']();
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div
|
||||
|
@ -157,6 +161,7 @@ const showFilter = computed(
|
|||
v-model="model"
|
||||
:components="components"
|
||||
component-prop="columnFilter"
|
||||
@keydown.tab="onTabPressed"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -394,7 +394,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
|||
:name="col.orderBy ?? col.name"
|
||||
:data-key="$attrs['data-key']"
|
||||
:search-url="searchUrl"
|
||||
:vertical="true"
|
||||
:vertical="false"
|
||||
/>
|
||||
</div>
|
||||
<slot
|
||||
|
@ -737,6 +737,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
|||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
data-cy="vnTableCreateBtn"
|
||||
/>
|
||||
<QTooltip self="top right">
|
||||
{{ createForm?.title }}
|
||||
|
|
|
@ -101,7 +101,13 @@ const mixinRules = [
|
|||
<QIcon
|
||||
name="close"
|
||||
size="xs"
|
||||
v-if="hover && value && !$attrs.disabled && $props.clearable"
|
||||
v-if="
|
||||
hover &&
|
||||
value &&
|
||||
!$attrs.disabled &&
|
||||
!$attrs.readonly &&
|
||||
$props.clearable
|
||||
"
|
||||
@click="
|
||||
() => {
|
||||
value = null;
|
||||
|
|
|
@ -138,8 +138,6 @@ onMounted(() => {
|
|||
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
||||
});
|
||||
|
||||
defineExpose({ opts: myOptions });
|
||||
|
||||
const arrayDataKey =
|
||||
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
||||
|
||||
|
@ -259,6 +257,30 @@ async function onScroll({ to, direction, from, index }) {
|
|||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ opts: myOptions });
|
||||
|
||||
function handleKeyDown(event) {
|
||||
if (event.key === 'Tab') {
|
||||
event.preventDefault();
|
||||
|
||||
const inputValue = vnSelectRef.value?.inputValue;
|
||||
|
||||
if (inputValue) {
|
||||
const matchingOption = myOptions.value.find(
|
||||
(option) =>
|
||||
option[optionLabel.value].toLowerCase() === inputValue.toLowerCase()
|
||||
);
|
||||
|
||||
if (matchingOption) {
|
||||
emit('update:modelValue', matchingOption[optionValue.value]);
|
||||
} else {
|
||||
emit('update:modelValue', inputValue);
|
||||
}
|
||||
vnSelectRef.value?.hidePopup();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -269,6 +291,7 @@ async function onScroll({ to, direction, from, index }) {
|
|||
:option-value="optionValue"
|
||||
v-bind="$attrs"
|
||||
@filter="filterHandler"
|
||||
@keydown="handleKeyDown"
|
||||
:emit-value="nullishToTrue($attrs['emit-value'])"
|
||||
:map-options="nullishToTrue($attrs['map-options'])"
|
||||
:use-input="nullishToTrue($attrs['use-input'])"
|
||||
|
|
|
@ -86,7 +86,7 @@ async function send() {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<QDialog ref="dialogRef">
|
||||
<QDialog ref="dialogRef" data-cy="vnSmsDialog">
|
||||
<QCard class="q-pa-sm">
|
||||
<QCardSection class="row items-center q-pb-none">
|
||||
<span class="text-h6 text-grey">
|
||||
|
@ -161,6 +161,7 @@ async function send() {
|
|||
:loading="isLoading"
|
||||
color="primary"
|
||||
unelevated
|
||||
data-cy="sendSmsBtn"
|
||||
/>
|
||||
</QCardActions>
|
||||
</QCard>
|
||||
|
|
|
@ -130,6 +130,7 @@ async function search() {
|
|||
dense
|
||||
standout
|
||||
autofocus
|
||||
data-cy="vnSearchBar"
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon
|
||||
|
|
|
@ -241,7 +241,7 @@ input::-webkit-inner-spin-button {
|
|||
th,
|
||||
td {
|
||||
padding: 1px 10px 1px 10px;
|
||||
max-width: 100px;
|
||||
max-width: 130px;
|
||||
div span {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
|
|
@ -100,7 +100,7 @@ async function remove() {
|
|||
</QMenu>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QItem @click="confirmRemove()" v-ripple clickable>
|
||||
<QItem @click="confirmRemove()" v-ripple clickable data-cy="deleteClaim">
|
||||
<QItemSection avatar>
|
||||
<QIcon name="delete" />
|
||||
</QItemSection>
|
||||
|
|
|
@ -130,7 +130,7 @@ function cancel() {
|
|||
<template #body-cell-description="{ row, value }">
|
||||
<QTd auto-width align="right" class="link">
|
||||
{{ value }}
|
||||
<ItemDescriptorProxy :id="row.itemFk"></ItemDescriptorProxy>
|
||||
<ItemDescriptorProxy :id="row.itemFk" />
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
|
|
|
@ -25,7 +25,7 @@ const claimFilter = computed(() => {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname'],
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -256,10 +256,10 @@ const showBalancePdf = ({ id }) => {
|
|||
{{ toCurrency(balances[rowIndex]?.balance) }}
|
||||
</template>
|
||||
<template #column-description="{ row }">
|
||||
<div class="link" v-if="row.isInvoice">
|
||||
<span class="link" v-if="row.isInvoice" @click.stop>
|
||||
{{ t('bill', { ref: row.description }) }}
|
||||
<InvoiceOutDescriptorProxy :id="row.description" />
|
||||
</div>
|
||||
<InvoiceOutDescriptorProxy :id="row.id" />
|
||||
</span>
|
||||
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">
|
||||
{{ row.description }}
|
||||
</span>
|
||||
|
|
|
@ -12,6 +12,7 @@ import VnImg from 'src/components/ui/VnImg.vue';
|
|||
|
||||
const stateStore = useStateStore();
|
||||
const { t } = useI18n();
|
||||
const tableRef = ref();
|
||||
const columns = [
|
||||
{
|
||||
align: 'center',
|
||||
|
@ -234,7 +235,6 @@ const columns = [
|
|||
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)),
|
||||
},
|
||||
];
|
||||
const tableRef = ref();
|
||||
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
|
|
|
@ -254,10 +254,7 @@ watchEffect(selectedRows);
|
|||
@update:model-value="fetchClientAddress"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem
|
||||
v-bind="scope.itemProps"
|
||||
@click="selectedClient(scope.opt)"
|
||||
>
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
#{{ scope.opt?.id }} -
|
||||
|
@ -296,18 +293,17 @@ watchEffect(selectedRows);
|
|||
: ''
|
||||
} `
|
||||
}}
|
||||
<span>
|
||||
{{
|
||||
scope.opt?.nickname
|
||||
}}</span
|
||||
>
|
||||
<span>{{
|
||||
scope.opt?.nickname
|
||||
}}</span>
|
||||
<span
|
||||
v-if="
|
||||
scope.opt?.province ||
|
||||
scope.opt?.city ||
|
||||
scope.opt?.street
|
||||
"
|
||||
>, {{ scope.opt?.street }},
|
||||
>
|
||||
, {{ scope.opt?.street }},
|
||||
{{ scope.opt?.city }},
|
||||
{{
|
||||
scope.opt?.province?.name
|
||||
|
@ -316,8 +312,8 @@ watchEffect(selectedRows);
|
|||
{{
|
||||
scope.opt?.agencyMode
|
||||
?.name
|
||||
}}</span
|
||||
>
|
||||
}}
|
||||
</span>
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -27,7 +27,7 @@ function exprBuilder(param, value) {
|
|||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
label: t('salesOrdersTable.dateSend'),
|
||||
label: t('globals.landed'),
|
||||
name: 'dateSend',
|
||||
field: 'dateSend',
|
||||
align: 'left',
|
||||
|
|
|
@ -11,7 +11,6 @@ salesClientsTable:
|
|||
client: Client
|
||||
salesOrdersTable:
|
||||
delete: Delete
|
||||
dateSend: Send date
|
||||
dateMake: Make date
|
||||
deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue?
|
||||
agency: Agency
|
||||
|
|
|
@ -11,7 +11,6 @@ salesClientsTable:
|
|||
client: Cliente
|
||||
salesOrdersTable:
|
||||
delete: Eliminar
|
||||
dateSend: Fecha de envío
|
||||
dateMake: Fecha de realización
|
||||
deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar?
|
||||
agency: Agencia
|
||||
|
|
|
@ -126,7 +126,6 @@ const setWireTransfer = async () => {
|
|||
(_, requestResponse) =>
|
||||
onBankEntityCreated(requestResponse, row)
|
||||
"
|
||||
:show-entity-field="false"
|
||||
/>
|
||||
</template>
|
||||
<template #option="scope">
|
||||
|
|
|
@ -130,6 +130,7 @@ function ticketFilter(ticket) {
|
|||
<QBadge
|
||||
text-color="black"
|
||||
:color="entity.ticketState.state.classColor"
|
||||
data-cy="ticketDescriptorStateBadge"
|
||||
>
|
||||
{{ entity.ticketState.state.name }}
|
||||
</QBadge>
|
||||
|
@ -174,7 +175,7 @@ function ticketFilter(ticket) {
|
|||
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="entity.problem.includes('hasRisk')"
|
||||
v-if="entity?.problem?.includes('hasRisk')"
|
||||
name="vn:risk"
|
||||
size="xs"
|
||||
color="primary"
|
||||
|
|
|
@ -239,7 +239,7 @@ function makeInvoiceDialog() {
|
|||
}
|
||||
async function makeInvoice() {
|
||||
const params = {
|
||||
ticketsIds: [parseInt(ticketId)],
|
||||
ticketsIds: [parseInt(ticketId.value)],
|
||||
};
|
||||
await axios.post(`Tickets/invoiceTicketsAndPdf`, params);
|
||||
|
||||
|
@ -265,7 +265,7 @@ async function transferClient(client) {
|
|||
|
||||
async function addTurn(day) {
|
||||
const params = {
|
||||
ticketFk: parseInt(ticketId),
|
||||
ticketFk: parseInt(ticketId.value),
|
||||
weekDay: day,
|
||||
agencyModeFk: ticket.value.agencyModeFk,
|
||||
};
|
||||
|
@ -280,7 +280,7 @@ async function addTurn(day) {
|
|||
|
||||
async function createRefund(withWarehouse) {
|
||||
const params = {
|
||||
ticketsIds: [parseInt(ticketId)],
|
||||
ticketsIds: [parseInt(ticketId.value)],
|
||||
withWarehouse: withWarehouse,
|
||||
negative: true,
|
||||
};
|
||||
|
@ -368,7 +368,7 @@ async function uploadDocuware(force) {
|
|||
|
||||
const { data } = await axios.post(`Docuwares/upload`, {
|
||||
fileCabinet: 'deliveryNote',
|
||||
ticketIds: [parseInt(ticketId)],
|
||||
ticketIds: [parseInt(ticketId.value)],
|
||||
});
|
||||
|
||||
if (data) notify({ message: t('PDF sent!'), type: 'positive' });
|
||||
|
|
|
@ -75,6 +75,7 @@ const cancel = () => {
|
|||
dense
|
||||
style="width: 50%"
|
||||
@click="save()"
|
||||
data-cy="saveManaBtn"
|
||||
>
|
||||
{{ t('globals.save') }}
|
||||
</QBtn>
|
||||
|
|
|
@ -86,12 +86,14 @@ async function handleSave() {
|
|||
option-value="id"
|
||||
v-model="row.observationTypeFk"
|
||||
:disable="!!row.id"
|
||||
data-cy="ticketNotesObservationType"
|
||||
/>
|
||||
<VnInput
|
||||
:label="t('basicData.description')"
|
||||
v-model="row.description"
|
||||
class="col"
|
||||
@keyup.enter="handleSave"
|
||||
data-cy="ticketNotesDescription"
|
||||
/>
|
||||
<QIcon
|
||||
name="delete"
|
||||
|
@ -99,6 +101,7 @@ async function handleSave() {
|
|||
class="cursor-pointer"
|
||||
color="primary"
|
||||
@click="handleDelete(row)"
|
||||
data-cy="ticketNotesRemoveNoteBtn"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketNotes.removeNote') }}
|
||||
|
@ -113,6 +116,7 @@ async function handleSave() {
|
|||
class="fill-icon-on-hover q-ml-md"
|
||||
color="primary"
|
||||
@click="ticketNotesCrudRef.insert()"
|
||||
data-cy="ticketNotesAddNoteBtn"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketNotes.addNote') }}
|
||||
|
|
|
@ -584,6 +584,7 @@ watch(
|
|||
color="primary"
|
||||
:disable="!isTicketEditable || ticketState === 'OK'"
|
||||
@click="changeTicketState('OK')"
|
||||
data-cy="ticketSaleOkStateBtn"
|
||||
>
|
||||
<QTooltip>{{ t(`Change ticket state to 'Ok'`) }}</QTooltip>
|
||||
</QBtn>
|
||||
|
@ -592,6 +593,7 @@ watch(
|
|||
color="primary"
|
||||
:label="t('ticketList.state')"
|
||||
:disable="!isTicketEditable"
|
||||
data-cy="ticketSaleStateDropdown"
|
||||
>
|
||||
<VnSelect
|
||||
:options="editableStatesOptions"
|
||||
|
@ -601,6 +603,7 @@ watch(
|
|||
hide-dropdown-icon
|
||||
focus-on-mount
|
||||
@update:model-value="changeTicketState"
|
||||
data-cy="ticketSaleStateSelect"
|
||||
/>
|
||||
</QBtnDropdown>
|
||||
<TicketSaleMoreActions
|
||||
|
@ -633,6 +636,7 @@ watch(
|
|||
icon="vn:splitline"
|
||||
:disable="!isTicketEditable || !hasSelectedRows"
|
||||
@click="setTransferParams()"
|
||||
data-cy="ticketSaleTransferBtn"
|
||||
>
|
||||
<QTooltip>{{ t('Transfer lines') }}</QTooltip>
|
||||
<TicketTransfer
|
||||
|
@ -712,7 +716,13 @@ watch(
|
|||
{{ t('ticketSale.visible') }}: {{ row.visible || 0 }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row.reserved" color="primary" name="vn:reserva" size="xs">
|
||||
<QIcon
|
||||
v-if="row.reserved"
|
||||
color="primary"
|
||||
name="vn:reserva"
|
||||
size="xs"
|
||||
data-cy="ticketSaleReservedIcon"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.reserved') }}
|
||||
</QTooltip>
|
||||
|
@ -865,7 +875,14 @@ watch(
|
|||
</VnTable>
|
||||
|
||||
<QPageSticky :offset="[20, 20]" style="z-index: 2">
|
||||
<QBtn @click="newOrderFromTicket()" color="primary" fab icon="add" shortcut="+" />
|
||||
<QBtn
|
||||
@click="newOrderFromTicket()"
|
||||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
data-cy="ticketSaleAddToBasketBtn"
|
||||
/>
|
||||
<QTooltip class="text-no-wrap">
|
||||
{{ t('Add item to basket') }}
|
||||
</QTooltip>
|
||||
|
|
|
@ -179,6 +179,7 @@ const createRefund = async (withWarehouse) => {
|
|||
color="primary"
|
||||
:label="t('ticketSale.more')"
|
||||
:disable="disable"
|
||||
data-cy="ticketSaleMoreActionsDropdown"
|
||||
>
|
||||
<template #label>
|
||||
<QTooltip>{{ t('Select lines to see the options') }}</QTooltip>
|
||||
|
@ -190,6 +191,7 @@ const createRefund = async (withWarehouse) => {
|
|||
v-close-popup
|
||||
v-ripple
|
||||
@click="showSmsDialog('productNotAvailable')"
|
||||
data-cy="sendShortageSMSItem"
|
||||
>
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Send shortage SMS') }}</QItemLabel>
|
||||
|
@ -201,12 +203,18 @@ const createRefund = async (withWarehouse) => {
|
|||
v-close-popup
|
||||
v-ripple
|
||||
@click="calculateSalePrice()"
|
||||
data-cy="recalculatePriceItem"
|
||||
>
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Recalculate price') }}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem clickable v-ripple @click="emit('getMana')">
|
||||
<QItem
|
||||
clickable
|
||||
v-ripple
|
||||
@click="emit('getMana')"
|
||||
data-cy="updateDiscountItem"
|
||||
>
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
||||
</QItemSection>
|
||||
|
@ -215,6 +223,7 @@ const createRefund = async (withWarehouse) => {
|
|||
v-model.number="newDiscount"
|
||||
:label="t('ticketSale.discount')"
|
||||
type="number"
|
||||
data-cy="ticketSaleDiscountInput"
|
||||
/>
|
||||
</TicketEditManaProxy>
|
||||
</QItem>
|
||||
|
@ -224,6 +233,7 @@ const createRefund = async (withWarehouse) => {
|
|||
v-close-popup
|
||||
v-ripple
|
||||
@click="createClaim()"
|
||||
data-cy="createClaimItem"
|
||||
>
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
||||
|
@ -235,6 +245,7 @@ const createRefund = async (withWarehouse) => {
|
|||
v-close-popup
|
||||
v-ripple
|
||||
@click="setReserved(true)"
|
||||
data-cy="markAsReservedItem"
|
||||
>
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Mark as reserved') }}</QItemLabel>
|
||||
|
@ -246,12 +257,13 @@ const createRefund = async (withWarehouse) => {
|
|||
v-close-popup
|
||||
v-ripple
|
||||
@click="setReserved(false)"
|
||||
data-cy="unmarkAsReservedItem"
|
||||
>
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Unmark as reserved') }}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem clickable v-ripple>
|
||||
<QItem clickable v-ripple data-cy="ticketSaleRefundItem">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
||||
</QItemSection>
|
||||
|
@ -260,12 +272,22 @@ const createRefund = async (withWarehouse) => {
|
|||
</QItemSection>
|
||||
<QMenu anchor="top end" self="top start" auto-close bordered>
|
||||
<QList>
|
||||
<QItem v-ripple clickable @click="createRefund(true)">
|
||||
<QItem
|
||||
v-ripple
|
||||
clickable
|
||||
@click="createRefund(true)"
|
||||
data-cy="ticketSaleRefundWithWarehouse"
|
||||
>
|
||||
<QItemSection>
|
||||
{{ t('with warehouse') }}
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="createRefund(false)">
|
||||
<QItem
|
||||
v-ripple
|
||||
clickable
|
||||
@click="createRefund(false)"
|
||||
data-cy="ticketSaleRefundWithoutWarehouse"
|
||||
>
|
||||
<QItemSection>
|
||||
{{ t('without warehouse') }}
|
||||
</QItemSection>
|
||||
|
|
|
@ -100,6 +100,7 @@ function toTicketUrl(section) {
|
|||
ref="summaryRef"
|
||||
:url="`Tickets/${entityId}/summary`"
|
||||
data-key="TicketSummary"
|
||||
data-cy="ticketSummary"
|
||||
>
|
||||
<template #header-left>
|
||||
<VnToSummary
|
||||
|
|
|
@ -91,7 +91,7 @@ onMounted(() => (_transfer.value = $props.transfer));
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<QPopupProxy ref="QPopupProxyRef">
|
||||
<QPopupProxy ref="QPopupProxyRef" data-cy="ticketTransferPopup">
|
||||
<QCard class="q-px-md" style="display: flex; width: 80vw">
|
||||
<QTable
|
||||
:rows="transfer.sales"
|
||||
|
|
|
@ -57,6 +57,7 @@ defineExpose({ transferSales });
|
|||
v-model.number="_transfer.ticketId"
|
||||
:label="t('Transfer to ticket')"
|
||||
:clearable="false"
|
||||
data-cy="ticketTransferDestinationTicketInput"
|
||||
>
|
||||
<template #append>
|
||||
<QBtn
|
||||
|
@ -64,6 +65,7 @@ defineExpose({ transferSales });
|
|||
color="primary"
|
||||
@click="transferSales(_transfer.ticketId)"
|
||||
style="width: 30px"
|
||||
data-cy="ticketTransferTransferBtn"
|
||||
/>
|
||||
</template>
|
||||
</VnInput>
|
||||
|
@ -72,6 +74,7 @@ defineExpose({ transferSales });
|
|||
color="primary"
|
||||
class="full-width q-my-lg"
|
||||
@click="transferSales()"
|
||||
data-cy="ticketTransferNewTicketBtn"
|
||||
/>
|
||||
</QForm>
|
||||
</template>
|
||||
|
|
|
@ -462,6 +462,7 @@ function setReference(data) {
|
|||
data-key="TicketList"
|
||||
:label="t('Search ticket')"
|
||||
:info="t('You can search by ticket id or alias')"
|
||||
data-cy="ticketListSearchBar"
|
||||
/>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
|
@ -489,6 +490,7 @@ function setReference(data) {
|
|||
'row-key': 'id',
|
||||
selection: 'multiple',
|
||||
}"
|
||||
data-cy="ticketListTable"
|
||||
>
|
||||
<template #column-statusIcons="{ row }">
|
||||
<TicketProblems :row="row" />
|
||||
|
|
|
@ -15,7 +15,7 @@ const filter = {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname'],
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -28,7 +28,7 @@ describe('Logout', () => {
|
|||
});
|
||||
|
||||
it('when token not exists', () => {
|
||||
cy.get('.q-list > [href="#/item"]').click();
|
||||
cy.get('.q-list').first().should('be.visible').click();
|
||||
cy.checkNotification('Authorization Required');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('TicketList', () => {
|
||||
const firstRow = 'tbody > :nth-child(1)';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/list');
|
||||
});
|
||||
|
||||
const searchResults = (search) => {
|
||||
cy.dataCy('vnSearchBar').find('input').focus();
|
||||
if (search) cy.dataCy('vnSearchBar').find('input').type(search);
|
||||
cy.dataCy('vnSearchBar').find('input').type('{enter}');
|
||||
cy.dataCy('ticketListTable').should('exist');
|
||||
cy.get(firstRow).should('exist');
|
||||
};
|
||||
|
||||
it('should search results', () => {
|
||||
cy.dataCy('ticketListTable').should('not.exist');
|
||||
cy.get('.q-field__control').should('exist');
|
||||
searchResults();
|
||||
});
|
||||
|
||||
it('should open ticket sales', () => {
|
||||
searchResults();
|
||||
cy.window().then((win) => {
|
||||
cy.stub(win, 'open').as('windowOpen');
|
||||
});
|
||||
cy.get(firstRow).find('.q-btn:first').click();
|
||||
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
||||
});
|
||||
|
||||
it('should open ticket summary', () => {
|
||||
searchResults();
|
||||
cy.get(firstRow).find('.q-btn:last').click();
|
||||
cy.dataCy('ticketSummary').should('exist');
|
||||
});
|
||||
|
||||
it('Client list create new client', () => {
|
||||
cy.dataCy('vnTableCreateBtn').should('exist');
|
||||
cy.dataCy('vnTableCreateBtn').click();
|
||||
const data = {
|
||||
Customer: { val: 1, type: 'select' },
|
||||
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||
Address: { val: 'employee', type: 'select' },
|
||||
Landed: { val: '01-01-2024', type: 'date' },
|
||||
};
|
||||
cy.fillInForm(data);
|
||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||
cy.checkNotification('Data created');
|
||||
cy.url().should('match', /\/ticket\/\d+\/summary/);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,25 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('TicketRequest', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/31/observation');
|
||||
});
|
||||
|
||||
it('Creates and deletes a note', () => {
|
||||
cy.dataCy('ticketNotesAddNoteBtn').should('exist');
|
||||
cy.dataCy('ticketNotesAddNoteBtn').click();
|
||||
cy.dataCy('ticketNotesObservationType').should('exist');
|
||||
cy.selectOption('[data-cy="ticketNotesObservationType"]:last', 'Weight');
|
||||
cy.dataCy('ticketNotesDescription').should('exist');
|
||||
cy.get('[data-cy="ticketNotesDescription"]:last').type(
|
||||
'This is a note description'
|
||||
);
|
||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||
cy.checkNotification('Data saved');
|
||||
cy.dataCy('ticketNotesRemoveNoteBtn').should('exist');
|
||||
cy.dataCy('ticketNotesRemoveNoteBtn').click();
|
||||
cy.dataCy('VnConfirm_confirm').click();
|
||||
cy.checkNotification('Data saved');
|
||||
});
|
||||
});
|
|
@ -0,0 +1,22 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('TicketRequest', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/31/request');
|
||||
});
|
||||
|
||||
it('Creates a new request', () => {
|
||||
cy.dataCy('vnTableCreateBtn').should('exist');
|
||||
cy.dataCy('vnTableCreateBtn').click();
|
||||
const data = {
|
||||
Description: { val: 'Purchase description' },
|
||||
Atender: { val: 'buyerNick', type: 'select' },
|
||||
Quantity: { val: 2 },
|
||||
Price: { val: 123 },
|
||||
};
|
||||
cy.fillInForm(data);
|
||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||
cy.checkNotification('Data created');
|
||||
});
|
||||
});
|
|
@ -0,0 +1,131 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
const c = require('croppie');
|
||||
|
||||
describe('TicketSale', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/31/sale');
|
||||
});
|
||||
|
||||
const firstRow = 'tbody > :nth-child(1)';
|
||||
|
||||
const selectFirstRow = () => {
|
||||
cy.waitForElement(firstRow);
|
||||
cy.get(firstRow).find('.q-checkbox__inner').click();
|
||||
};
|
||||
|
||||
it('it should add item to basket', () => {
|
||||
cy.window().then((win) => {
|
||||
cy.stub(win, 'open').as('windowOpen');
|
||||
});
|
||||
cy.dataCy('ticketSaleAddToBasketBtn').should('exist');
|
||||
cy.dataCy('ticketSaleAddToBasketBtn').click();
|
||||
cy.get('@windowOpen').should('be.calledWithMatch', /\/order\/\d+\/catalog/);
|
||||
});
|
||||
|
||||
it('should send SMS', () => {
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.waitForElement('[data-cy="sendShortageSMSItem"]');
|
||||
cy.dataCy('sendShortageSMSItem').should('exist');
|
||||
cy.dataCy('sendShortageSMSItem').click();
|
||||
cy.dataCy('vnSmsDialog').should('exist');
|
||||
cy.dataCy('sendSmsBtn').click();
|
||||
cy.checkNotification('SMS sent');
|
||||
});
|
||||
|
||||
it('should recalculate price when "Recalculate price" is clicked', () => {
|
||||
cy.intercept('POST', '**/recalculatePrice').as('recalculatePrice');
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.waitForElement('[data-cy="recalculatePriceItem"]');
|
||||
cy.dataCy('recalculatePriceItem').should('exist');
|
||||
cy.dataCy('recalculatePriceItem').click();
|
||||
cy.wait('@recalculatePrice').its('response.statusCode').should('eq', 200);
|
||||
cy.checkNotification('Data saved');
|
||||
});
|
||||
|
||||
it('should update discount when "Update discount" is clicked', () => {
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.waitForElement('[data-cy="updateDiscountItem"]');
|
||||
cy.dataCy('updateDiscountItem').should('exist');
|
||||
cy.dataCy('updateDiscountItem').click();
|
||||
cy.waitForElement('[data-cy="ticketSaleDiscountInput"]');
|
||||
cy.dataCy('ticketSaleDiscountInput').find('input').focus();
|
||||
cy.dataCy('ticketSaleDiscountInput').find('input').type('10');
|
||||
cy.dataCy('saveManaBtn').click();
|
||||
cy.waitForElement('.q-notification__message');
|
||||
cy.checkNotification('Data saved');
|
||||
});
|
||||
|
||||
it('adds claim', () => {
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.dataCy('createClaimItem').click();
|
||||
cy.dataCy('VnConfirm_confirm').click();
|
||||
cy.url().should('match', /\/claim\/\d+\/basic-data/);
|
||||
// Delete created claim to avoid cluttering the database
|
||||
cy.dataCy('descriptor-more-opts').click();
|
||||
cy.dataCy('deleteClaim').click();
|
||||
cy.dataCy('VnConfirm_confirm').click();
|
||||
cy.checkNotification('Data deleted');
|
||||
});
|
||||
|
||||
it('marks row as reserved', () => {
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.waitForElement('[data-cy="markAsReservedItem"]');
|
||||
cy.dataCy('markAsReservedItem').click();
|
||||
cy.dataCy('ticketSaleReservedIcon').should('exist');
|
||||
});
|
||||
|
||||
it('unmarks row as reserved', () => {
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.waitForElement('[data-cy="unmarkAsReservedItem"]');
|
||||
cy.dataCy('unmarkAsReservedItem').click();
|
||||
cy.dataCy('ticketSaleReservedIcon').should('not.exist');
|
||||
});
|
||||
|
||||
it('refunds row with warehouse', () => {
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.dataCy('ticketSaleRefundItem').click();
|
||||
cy.dataCy('ticketSaleRefundWithWarehouse').click();
|
||||
cy.checkNotification('The following refund ticket have been created');
|
||||
});
|
||||
|
||||
it('refunds row without warehouse', () => {
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.dataCy('ticketSaleRefundItem').click();
|
||||
cy.dataCy('ticketSaleRefundWithoutWarehouse').click();
|
||||
cy.checkNotification('The following refund ticket have been created');
|
||||
});
|
||||
|
||||
it('transfers ticket', () => {
|
||||
cy.visit('/#/ticket/32/sale');
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleTransferBtn').click();
|
||||
cy.dataCy('ticketTransferPopup').should('exist');
|
||||
cy.dataCy('ticketTransferNewTicketBtn').click();
|
||||
// existen 3 elementos "tbody" necesito checkear que el segundo elemento tbody tenga una row sola
|
||||
cy.get('tbody').eq(1).find('tr').should('have.length', 1);
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleTransferBtn').click();
|
||||
cy.dataCy('ticketTransferPopup').should('exist');
|
||||
cy.dataCy('ticketTransferDestinationTicketInput').find('input').focus();
|
||||
cy.dataCy('ticketTransferDestinationTicketInput').find('input').type('32');
|
||||
cy.dataCy('ticketTransferTransferBtn').click();
|
||||
// checkear que la url contenga /ticket/1000002/sale
|
||||
cy.url().should('match', /\/ticket\/32\/sale/);
|
||||
});
|
||||
|
||||
it('should redirect to ticket logs', () => {
|
||||
cy.get(firstRow).find('.q-btn:last').click();
|
||||
cy.url().should('match', /\/ticket\/31\/log/);
|
||||
});
|
||||
});
|
|
@ -5,6 +5,7 @@ describe('VnSearchBar', () => {
|
|||
const idGap = '.q-item > .q-item__label';
|
||||
const vnTableRow = '.q-virtual-scroll__content';
|
||||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('#/customer/list');
|
||||
});
|
||||
|
|
|
@ -310,3 +310,7 @@ Cypress.Commands.add('checkValueSelectForm', (id, search) => {
|
|||
Cypress.Commands.add('searchByLabel', (label, value) => {
|
||||
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('dataCy', (dataTestId, attr = 'data-cy') => {
|
||||
return cy.get(`[${attr}="${dataTestId}"]`);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue