Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into test
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
commit
68a86e9fcd
|
@ -17,17 +17,6 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</router-link>
|
</router-link>
|
||||||
<QIcon
|
|
||||||
v-if="row?.reserved"
|
|
||||||
color="primary"
|
|
||||||
name="vn:reserva"
|
|
||||||
size="xs"
|
|
||||||
data-cy="ticketSaleReservedIcon"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('ticketSale.reserved') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row?.isDeleted"
|
v-if="row?.isDeleted"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, ref } from 'vue';
|
|
||||||
import VnInput from './VnInput.vue';
|
import VnInput from './VnInput.vue';
|
||||||
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
|
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
|
||||||
|
|
||||||
const $props = defineProps({
|
|
||||||
insertable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
|
||||||
const model = defineModel({ prop: 'modelValue' });
|
const model = defineModel({ prop: 'modelValue' });
|
||||||
const inputRef = ref(false);
|
|
||||||
|
|
||||||
function setCursorPosition(pos) {
|
|
||||||
const input = inputRef.value.vnInputRef.$el.querySelector('input');
|
|
||||||
input.focus();
|
|
||||||
input.setSelectionRange(pos, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleUpdateModel(val) {
|
|
||||||
model.value = val?.at(-1) === '.' ? useAccountShortToStandard(val) : val;
|
|
||||||
await nextTick(() => setCursorPosition(0));
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="model"
|
v-model="model"
|
||||||
ref="inputRef"
|
ref="inputRef"
|
||||||
:insertable
|
@keydown.tab="model = useAccountShortToStandard($event.target.value) ?? model"
|
||||||
@update:model-value="handleUpdateModel"
|
@input="model = $event.target.value.replace(/[^\d.]/g, '')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -187,7 +187,9 @@ const getRowUpdateInputEvents = (sale) => {
|
||||||
|
|
||||||
const resetChanges = async () => {
|
const resetChanges = async () => {
|
||||||
arrayData.fetch({ append: false });
|
arrayData.fetch({ append: false });
|
||||||
tableRef.value.reload();
|
tableRef.value.CrudModelRef.hasChanges = false;
|
||||||
|
await tableRef.value.reload();
|
||||||
|
|
||||||
selectedRows.value = [];
|
selectedRows.value = [];
|
||||||
};
|
};
|
||||||
const changeQuantity = async (sale) => {
|
const changeQuantity = async (sale) => {
|
||||||
|
@ -390,7 +392,7 @@ const changeTicketState = async (val) => {
|
||||||
const params = { ticketFk: route.params.id, code: val };
|
const params = { ticketFk: route.params.id, code: val };
|
||||||
await axios.post('Tickets/state', params);
|
await axios.post('Tickets/state', params);
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
await resetChanges();
|
resetChanges();
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeSelectedSales = () => {
|
const removeSelectedSales = () => {
|
||||||
|
|
|
@ -62,6 +62,7 @@ const isClaimable = computed(() => {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
const sendSms = async (params) => {
|
const sendSms = async (params) => {
|
||||||
await axios.post(`Tickets/${ticket.value.id}/sendSms`, params);
|
await axios.post(`Tickets/${ticket.value.id}/sendSms`, params);
|
||||||
notify(t('SMS sent'), 'positive');
|
notify(t('SMS sent'), 'positive');
|
||||||
|
@ -230,18 +231,6 @@ const createRefund = async (withWarehouse) => {
|
||||||
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
|
||||||
v-if="isTicketEditable"
|
|
||||||
clickable
|
|
||||||
v-close-popup
|
|
||||||
v-ripple
|
|
||||||
@click="setReserved(true)"
|
|
||||||
data-cy="markAsReservedItem"
|
|
||||||
>
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ t('Mark as reserved') }}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem clickable v-ripple data-cy="ticketSaleRefundItem">
|
<QItem clickable v-ripple data-cy="ticketSaleRefundItem">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
||||||
|
@ -287,8 +276,6 @@ es:
|
||||||
Recalculate price: Recalcular precio
|
Recalculate price: Recalcular precio
|
||||||
Update discount: Actualizar descuento
|
Update discount: Actualizar descuento
|
||||||
Add claim: Crear reclamación
|
Add claim: Crear reclamación
|
||||||
Mark as reserved: Marcar como reservado
|
|
||||||
Unmark as reserved: Desmarcar como reservado
|
|
||||||
Refund: Abono
|
Refund: Abono
|
||||||
with warehouse: con almacén
|
with warehouse: con almacén
|
||||||
without warehouse: sin almacén
|
without warehouse: sin almacén
|
||||||
|
|
|
@ -8,6 +8,6 @@ import filter from './TravelFilter.js';
|
||||||
data-key="Travel"
|
data-key="Travel"
|
||||||
url="Travels"
|
url="Travels"
|
||||||
:descriptor="TravelDescriptor"
|
:descriptor="TravelDescriptor"
|
||||||
:filter="filter"
|
:filter="{ ...filter, where: { id: $route.params.id } }"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -268,13 +268,6 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Warehouses"
|
|
||||||
:filter="{ fields: ['id', 'name'] }"
|
|
||||||
order="name"
|
|
||||||
@on-fetch="(data) => (warehouses = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<CardSummary
|
<CardSummary
|
||||||
ref="summaryRef"
|
ref="summaryRef"
|
||||||
:url="`Travels/${entityId}/getTravel`"
|
:url="`Travels/${entityId}/getTravel`"
|
||||||
|
@ -414,18 +407,18 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|
||||||
<QCard class="full-width" v-if="thermographs.length > 0">
|
<QCard class="full-width" v-if="thermographs.length > 0">
|
||||||
<RouterLink
|
<FetchData
|
||||||
class="header header-link"
|
url="Warehouses"
|
||||||
:to="{
|
:filter="{ fields: ['id', 'name'] }"
|
||||||
name: 'TravelThermographsIndex',
|
order="name"
|
||||||
params: { id: travel.id },
|
@on-fetch="(data) => (warehouses = data)"
|
||||||
}"
|
auto-load
|
||||||
>
|
/>
|
||||||
{{ t('travel.summary.thermographs') }}
|
<VnTitle
|
||||||
<QIcon name="open_in_new" />
|
:url="getLink('thermographs')"
|
||||||
</RouterLink>
|
:text="t('travel.summary.thermographs')"
|
||||||
|
/>
|
||||||
<QTable
|
<QTable
|
||||||
:rows="thermographs"
|
:rows="thermographs"
|
||||||
:columns="thermographsTableColumns"
|
:columns="thermographsTableColumns"
|
||||||
|
|
|
@ -201,7 +201,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('components.smartCard.viewSummary'),
|
title: t('components.smartCard.viewSummary'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
action: (row) => viewSummary(row.id, TravelSummary),
|
action: (row) => viewSummary(row.id, TravelSummary, 'lg-width'),
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe('ClaimNotes', () => {
|
describe('Account descriptor', () => {
|
||||||
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
|
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
|
||||||
const url = '/#/account/1/summary';
|
const url = '/#/account/1/summary';
|
||||||
|
|
||||||
|
@ -7,6 +7,9 @@ describe('ClaimNotes', () => {
|
||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get(descriptorOptions)
|
cy.get(descriptorOptions)
|
||||||
|
.should('exist')
|
||||||
|
.should('be.visible')
|
||||||
|
|
||||||
.find('.q-item')
|
.find('.q-item')
|
||||||
.its('length')
|
.its('length')
|
||||||
.then((count) => {
|
.then((count) => {
|
||||||
|
|
|
@ -30,9 +30,11 @@ describe('OrderList', () => {
|
||||||
cy.url().should('include', `/order`);
|
cy.url().should('include', `/order`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('filter list and create order', () => {
|
it('filter list and create order', () => {
|
||||||
cy.dataCy('Customer ID_input').type('1101{enter}');
|
cy.dataCy('Customer ID_input').type('1101{enter}');
|
||||||
|
cy.intercept('GET', /\/api\/Clients/).as('clientFilter');
|
||||||
cy.dataCy('vnTableCreateBtn').click();
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.wait('@clientFilter');
|
||||||
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
||||||
cy.selectOption(agencyCreateSelect, 1);
|
cy.selectOption(agencyCreateSelect, 1);
|
||||||
|
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
describe('VnAccountNumber', () => {
|
|
||||||
const accountInput = 'input[data-cy="supplierFiscalDataAccount_input"]';
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('developer');
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.visit('/#/supplier/1/fiscal-data');
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('VnInput handleInsertMode()', () => {
|
|
||||||
it('should replace character at cursor position in insert mode', () => {
|
|
||||||
cy.get(accountInput).type('{selectall}4100000001');
|
|
||||||
cy.get(accountInput).type('{movetostart}');
|
|
||||||
cy.get(accountInput).type('999');
|
|
||||||
cy.get(accountInput).should('have.value', '9990000001');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should replace character at cursor position in insert mode', () => {
|
|
||||||
cy.get(accountInput).clear();
|
|
||||||
cy.get(accountInput).type('4100000001');
|
|
||||||
cy.get(accountInput).type('{movetostart}');
|
|
||||||
cy.get(accountInput).type('999');
|
|
||||||
cy.get(accountInput).should('have.value', '9990000001');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should respect maxlength prop', () => {
|
|
||||||
cy.get(accountInput).clear();
|
|
||||||
cy.get(accountInput).type('123456789012345');
|
|
||||||
cy.get(accountInput).should('have.value', '1234567890');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should convert short account number to standard format', () => {
|
|
||||||
cy.get(accountInput).clear();
|
|
||||||
cy.get(accountInput).type('123.');
|
|
||||||
cy.get(accountInput).should('have.value', '1230000000');
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue