Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into beta
gitea/salix-front/pipeline/head There was a failure building this commit
Details
gitea/salix-front/pipeline/head There was a failure building this commit
Details
This commit is contained in:
commit
308b14c3bc
|
@ -125,7 +125,7 @@ pipeline {
|
|||
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
||||
|
||||
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
|
||||
sh 'sh test/cypress/cypressParallel.sh 2'
|
||||
sh 'sh test/cypress/cypressParallel.sh 1'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,17 +17,6 @@ defineProps({ row: { type: Object, required: true } });
|
|||
</QTooltip>
|
||||
</QIcon>
|
||||
</router-link>
|
||||
<QIcon
|
||||
v-if="row?.reserved"
|
||||
color="primary"
|
||||
name="vn:reserva"
|
||||
size="xs"
|
||||
data-cy="ticketSaleReservedIcon"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.reserved') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.isDeleted"
|
||||
color="primary"
|
||||
|
|
|
@ -1,35 +1,14 @@
|
|||
<script setup>
|
||||
import { nextTick, ref } from 'vue';
|
||||
import VnInput from './VnInput.vue';
|
||||
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 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>
|
||||
<template>
|
||||
<VnInput
|
||||
v-model="model"
|
||||
ref="inputRef"
|
||||
:insertable
|
||||
@update:model-value="handleUpdateModel"
|
||||
@keydown.tab="model = useAccountShortToStandard($event.target.value) ?? model"
|
||||
@input="model = $event.target.value.replace(/[^\d.]/g, '')"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -15,7 +15,7 @@ const editDownloadDisabled = ref(false);
|
|||
const $props = defineProps({
|
||||
defaultDmsCode: {
|
||||
type: String,
|
||||
default: 'InvoiceIn',
|
||||
default: 'invoiceIn',
|
||||
},
|
||||
disable: {
|
||||
type: Boolean,
|
||||
|
|
|
@ -841,6 +841,7 @@ travel:
|
|||
availabledHour: Availabled hour
|
||||
thermographs: Thermographs
|
||||
hb: HB
|
||||
roundedCc: Rounded CC
|
||||
basicData:
|
||||
daysInForward: Automatic movement (Raid)
|
||||
isRaid: Raid
|
||||
|
|
|
@ -924,6 +924,7 @@ travel:
|
|||
availabled: F. Disponible
|
||||
availabledHour: Hora Disponible
|
||||
hb: HB
|
||||
roundedCc: CC redondeado
|
||||
basicData:
|
||||
daysInForward: Desplazamiento automatico (redada)
|
||||
isRaid: Redada
|
||||
|
|
|
@ -105,15 +105,6 @@ const debtWarning = computed(() => {
|
|||
>
|
||||
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
|
||||
</QIcon>
|
||||
|
||||
<QIcon
|
||||
v-if="entity?.substitutionAllowed"
|
||||
name="help"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('Allowed substitution') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="!entity.account?.active"
|
||||
color="primary"
|
||||
|
|
|
@ -61,16 +61,6 @@ const openCreateForm = (type) => {
|
|||
.join('&');
|
||||
useOpenURL(`/#/${type}/list?${params}`);
|
||||
};
|
||||
const updateSubstitutionAllowed = async () => {
|
||||
try {
|
||||
await axios.patch(`Clients/${route.params.id}`, {
|
||||
substitutionAllowed: !$props.customer.substitutionAllowed,
|
||||
});
|
||||
notify('globals.notificationSent', 'positive');
|
||||
} catch (error) {
|
||||
notify(error.message, 'positive');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -79,13 +69,6 @@ const updateSubstitutionAllowed = async () => {
|
|||
{{ t('globals.pageTitles.createTicket') }}
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable>
|
||||
<QItemSection @click="updateSubstitutionAllowed()">{{
|
||||
$props.customer.substitutionAllowed
|
||||
? t('Disable substitution')
|
||||
: t('Allow substitution')
|
||||
}}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable>
|
||||
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -73,6 +73,7 @@ const exprBuilder = (param, value) => {
|
|||
option-value="id"
|
||||
option-label="name"
|
||||
url="Departments"
|
||||
no-one="true"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
@ -161,6 +162,7 @@ en:
|
|||
city: City
|
||||
phone: Phone
|
||||
email: Email
|
||||
departmentFk: Department
|
||||
isToBeMailed: Mailed
|
||||
isEqualizated: Equailized
|
||||
businessTypeFk: Business type
|
||||
|
@ -176,6 +178,7 @@ es:
|
|||
search: Contiene
|
||||
fi: NIF
|
||||
isActive: Activo
|
||||
departmentFk: Departamento
|
||||
isToBeMailed: A enviar
|
||||
isEqualizated: Recargo de equivalencia
|
||||
businessTypeFk: Tipo de negocio
|
||||
|
|
|
@ -127,6 +127,7 @@ es:
|
|||
Identifier: Identificador
|
||||
Social name: Razón social
|
||||
Phone: Teléfono
|
||||
Postcode: Código postal
|
||||
City: Población
|
||||
Email: Email
|
||||
Campaign consumption: Consumo campaña
|
||||
|
|
|
@ -93,10 +93,26 @@ const updateAddressTicket = async () => {
|
|||
};
|
||||
|
||||
const updateObservations = async (payload) => {
|
||||
await axios.post('AddressObservations/crud', payload);
|
||||
await axios.post('AddressObservations/crud', cleanPayload(payload));
|
||||
notes.value = [];
|
||||
deletes.value = [];
|
||||
};
|
||||
|
||||
function cleanPayload(payload) {
|
||||
['creates', 'deletes', 'updates'].forEach((prop) => {
|
||||
if (prop === 'creates' || prop === 'updates') {
|
||||
payload[prop] = payload[prop].filter(
|
||||
(item) => item.description !== '' && item.observationTypeFk !== '',
|
||||
);
|
||||
} else {
|
||||
payload[prop] = payload[prop].filter(
|
||||
(item) => item !== null && item !== undefined,
|
||||
);
|
||||
}
|
||||
});
|
||||
return payload;
|
||||
}
|
||||
|
||||
async function updateAll({ data, payload }) {
|
||||
await updateObservations(payload);
|
||||
await updateAddress(data);
|
||||
|
|
|
@ -191,7 +191,7 @@ const getItemPackagingType = (ticketSales) => {
|
|||
:without-header="true"
|
||||
auto-load
|
||||
:row-click="rowClick"
|
||||
order="shipped DESC, id"
|
||||
order="shipped DESC, id DESC"
|
||||
:disable-option="{ card: true, table: true }"
|
||||
class="full-width"
|
||||
:disable-infinite-scroll="true"
|
||||
|
|
|
@ -648,7 +648,7 @@ onMounted(() => {
|
|||
:url="`Entries/${entityId}/getBuyList`"
|
||||
search-url="EntryBuys"
|
||||
save-url="Buys/crud"
|
||||
:filter="filter"
|
||||
:filter="editableMode ? filter : {}"
|
||||
:disable-option="{ card: true }"
|
||||
v-model:selected="selectedRows"
|
||||
@on-fetch="() => footerFetchDataRef.fetch()"
|
||||
|
|
|
@ -8,6 +8,6 @@ import filter from './EntryFilter.js';
|
|||
data-key="Entry"
|
||||
url="Entries"
|
||||
:descriptor="EntryDescriptor"
|
||||
:filter="filter"
|
||||
:filter="{ ...filter, where: { id: $route.params.id } }"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -147,7 +147,7 @@ async function deleteEntry() {
|
|||
<template>
|
||||
<CardDescriptor
|
||||
:url="`Entries/${entityId}`"
|
||||
:user-filter="entryFilter"
|
||||
:filter="entryFilter"
|
||||
title="supplier.nickname"
|
||||
data-key="Entry"
|
||||
width="lg-width"
|
||||
|
|
|
@ -248,7 +248,6 @@ function getBadgeAttrs(row) {
|
|||
|
||||
let timeDiff = today - timeTicket;
|
||||
|
||||
if (timeDiff > 0) return { color: 'info', 'text-color': 'black' };
|
||||
if (timeDiff < 0) return { color: 'warning', 'text-color': 'black' };
|
||||
switch (row.entryTypeCode) {
|
||||
case 'regularization':
|
||||
|
@ -274,6 +273,7 @@ function getBadgeAttrs(row) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
if (timeDiff > 0) return { color: 'info', 'text-color': 'black' };
|
||||
return { color: 'transparent' };
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ const filter = computed(() => ({
|
|||
hour: 0,
|
||||
minute: 0,
|
||||
second: 0,
|
||||
milliseconds: 0,
|
||||
}),
|
||||
m3: { neq: null },
|
||||
},
|
||||
|
|
|
@ -26,7 +26,7 @@ const routes = reactive({
|
|||
getSupplier: (id) => {
|
||||
return { name: 'SupplierCard', params: { id } };
|
||||
},
|
||||
getTickets: (id) => {
|
||||
getInvoices: (id) => {
|
||||
return {
|
||||
name: 'InvoiceInList',
|
||||
query: {
|
||||
|
@ -135,11 +135,11 @@ async function setInvoiceCorrection(id) {
|
|||
</QBtn>
|
||||
<QBtn
|
||||
size="md"
|
||||
icon="vn:ticket"
|
||||
icon="vn:invoice-in"
|
||||
color="primary"
|
||||
:to="routes.getTickets(entity.supplierFk)"
|
||||
:to="routes.getInvoices(entity.supplierFk)"
|
||||
>
|
||||
<QTooltip>{{ t('globals.ticketList') }}</QTooltip>
|
||||
<QTooltip>{{ t('invoiceIn.descriptor.invoices') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
v-if="
|
||||
|
|
|
@ -14,6 +14,7 @@ invoiceIn:
|
|||
amount: Amount
|
||||
descriptor:
|
||||
ticketList: Ticket list
|
||||
invoices: Supplier invoices
|
||||
descriptorMenu:
|
||||
book: Book
|
||||
unbook: Unbook
|
||||
|
|
|
@ -13,7 +13,7 @@ invoiceIn:
|
|||
awb: AWB
|
||||
amount: Importe
|
||||
descriptor:
|
||||
ticketList: Listado de tickets
|
||||
invoices: Facturas de proveedor
|
||||
descriptorMenu:
|
||||
book: Contabilizar
|
||||
unbook: Descontabilizar
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import DepartmentDescriptorProxy from '../Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import { toDateFormat } from 'src/filters/date.js';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import VnRow from 'src/components/ui/VnRow.vue';
|
||||
import { dateRange } from 'src/filters';
|
||||
import useOpenURL from 'src/composables/useOpenURL';
|
||||
const { t } = useI18n();
|
||||
|
||||
const dates = dateRange(Date.vnNew());
|
||||
|
@ -94,6 +95,7 @@ const columns = computed(() => [
|
|||
columnClass: 'no-padding',
|
||||
},
|
||||
]);
|
||||
const openTab = (id) => useOpenURL(`#/customer/${id}/summary`);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -113,6 +115,8 @@ const columns = computed(() => [
|
|||
:disable-option="{ card: true }"
|
||||
dense
|
||||
class="q-px-none"
|
||||
:row-click="({ id }) => openTab(id)"
|
||||
:row-ctrl-click="(_, { id }) => openTab(id)"
|
||||
>
|
||||
<template #top-left>
|
||||
<VnRow>
|
||||
|
@ -121,12 +125,16 @@ const columns = computed(() => [
|
|||
</VnRow>
|
||||
</template>
|
||||
<template #column-departmentFk="{ row }">
|
||||
<span class="link" :title="row.department" v-text="row.department" />
|
||||
<WorkerDescriptorProxy :id="row.departmentFk" dense />
|
||||
<span @click.stop.prevent class="link" :title="row.department">
|
||||
{{ row.department }}
|
||||
<DepartmentDescriptorProxy :id="row.departmentFk" dense
|
||||
/></span>
|
||||
</template>
|
||||
<template #column-clientFk="{ row }">
|
||||
<span class="link" :title="row.clientName" v-text="row.clientName" />
|
||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
<span @click.stop.prevent class="link" :title="row.clientName">
|
||||
{{ row.clientName }}
|
||||
<CustomerDescriptorProxy :id="row.clientFk" dense
|
||||
/></span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
|
|
@ -9,6 +9,7 @@ import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
|
|||
import { toCurrency } from 'src/filters';
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
import axios from 'axios';
|
||||
import useOpenURL from 'src/composables/useOpenURL';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
@ -108,8 +109,7 @@ const removeOrders = async () => {
|
|||
await table.value.reload();
|
||||
};
|
||||
|
||||
const openTab = (id) =>
|
||||
window.open(`#/order/${id}/summary`, '_blank', 'noopener, noreferrer');
|
||||
const openTab = (id) => useOpenURL(`#/order/${id}/summary`);
|
||||
</script>
|
||||
<template>
|
||||
<VnTable
|
||||
|
@ -129,6 +129,7 @@ const openTab = (id) =>
|
|||
}"
|
||||
default-mode="table"
|
||||
:row-click="({ id }) => openTab(id)"
|
||||
:row-ctrl-click="(_, { id }) => openTab(id)"
|
||||
v-model:selected="selectedRows"
|
||||
:disable-option="{ card: true }"
|
||||
>
|
||||
|
@ -177,16 +178,16 @@ const openTab = (id) =>
|
|||
</template>
|
||||
|
||||
<template #column-clientFk="{ row }">
|
||||
<QTd @click.stop>
|
||||
<span class="link" v-text="row.clientName" :title="row.clientName" />
|
||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</QTd>
|
||||
<span class="link" @click.stop :title="row.clientName">
|
||||
{{ row.clientName }}
|
||||
<CustomerDescriptorProxy :id="row.clientFk" dense
|
||||
/></span>
|
||||
</template>
|
||||
<template #column-departmentFk="{ row }">
|
||||
<QTd @click.stop>
|
||||
<span class="link" v-text="row.departmentName" />
|
||||
<DepartmentDescriptorProxy :id="row.departmentFk" dense />
|
||||
</QTd>
|
||||
<span class="link" @click.stop :title="row.departmentName">
|
||||
{{ row.departmentName }}
|
||||
<DepartmentDescriptorProxy :id="row.departmentFk" dense
|
||||
/></span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
|
|
@ -209,20 +209,6 @@ const getLocale = (label) => {
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:label="t('globals.params.departmentFk')"
|
||||
v-model="params.department"
|
||||
option-label="name"
|
||||
option-value="name"
|
||||
url="Departments"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
|
|
|
@ -449,21 +449,19 @@ const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
|
|||
<span :title="row.province" v-text="row.province" />
|
||||
</template>
|
||||
<template #column-state="{ row }">
|
||||
<div @click.stop.prevent>
|
||||
<div v-if="row.refFk">
|
||||
<span class="link">{{ row.refFk }}</span>
|
||||
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
||||
</div>
|
||||
<QBadge
|
||||
v-else
|
||||
:color="stateColors[row.classColor] || 'transparent'"
|
||||
:text-color="stateColors[row.classColor] ? 'black' : 'white'"
|
||||
class="q-pa-sm"
|
||||
style="font-size: 14px"
|
||||
>
|
||||
{{ row.state }}
|
||||
</QBadge>
|
||||
<div v-if="row.refFk" @click.stop.prevent>
|
||||
<span class="link">{{ row.refFk }}</span>
|
||||
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
||||
</div>
|
||||
<QBadge
|
||||
v-else
|
||||
:color="stateColors[row.classColor] || 'transparent'"
|
||||
:text-color="stateColors[row.classColor] ? 'black' : 'white'"
|
||||
class="q-pa-sm"
|
||||
style="font-size: 14px"
|
||||
>
|
||||
{{ row.state }}
|
||||
</QBadge>
|
||||
</template>
|
||||
<template #column-isFragile="{ row }">
|
||||
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
|
||||
|
|
|
@ -65,7 +65,6 @@ const columns = computed(() => [
|
|||
attrs: {
|
||||
url: 'Departments',
|
||||
},
|
||||
create: true,
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
|
|
|
@ -46,7 +46,6 @@ const columns = computed(() => [
|
|||
},
|
||||
isId: true,
|
||||
columnFilter: false,
|
||||
width: '25px',
|
||||
},
|
||||
{
|
||||
name: 'workerFk',
|
||||
|
@ -142,7 +141,6 @@ const columns = computed(() => [
|
|||
label: 'm3',
|
||||
cardVisible: true,
|
||||
columnClass: 'shrink',
|
||||
width: '50px',
|
||||
},
|
||||
{
|
||||
name: 'started',
|
||||
|
@ -150,7 +148,6 @@ const columns = computed(() => [
|
|||
component: 'time',
|
||||
columnFilter: false,
|
||||
format: ({ started }) => toHour(started),
|
||||
width: '50px',
|
||||
},
|
||||
{
|
||||
name: 'finished',
|
||||
|
@ -158,7 +155,6 @@ const columns = computed(() => [
|
|||
component: 'time',
|
||||
columnFilter: false,
|
||||
format: ({ finished }) => toHour(finished),
|
||||
width: '50px',
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
|
|
|
@ -46,7 +46,6 @@ const columns = computed(() => [
|
|||
condition: () => true,
|
||||
},
|
||||
columnFilter: false,
|
||||
width: '25px',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -57,7 +56,6 @@ const columns = computed(() => [
|
|||
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
||||
columnFilter: false,
|
||||
cardVisible: true,
|
||||
width: '100px',
|
||||
},
|
||||
{
|
||||
label: t('globals.agency'),
|
||||
|
@ -102,7 +100,6 @@ const columns = computed(() => [
|
|||
cardVisible: true,
|
||||
columnFilter: false,
|
||||
format: ({ started }) => toHour(started),
|
||||
width: '50px',
|
||||
},
|
||||
{
|
||||
align: 'center',
|
||||
|
@ -111,7 +108,6 @@ const columns = computed(() => [
|
|||
cardVisible: true,
|
||||
columnFilter: false,
|
||||
format: ({ finished }) => toHour(finished),
|
||||
width: '50px',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
|
|
@ -44,7 +44,7 @@ const getPriceDifference = async () => {
|
|||
shipped: ticket.value.shipped,
|
||||
};
|
||||
const { data } = await axios.post(
|
||||
`tickets/${formData.value.id}/priceDifference`,
|
||||
`tickets/${ticket.value.id}/priceDifference`,
|
||||
params,
|
||||
);
|
||||
ticket.value.sale = data;
|
||||
|
@ -71,7 +71,7 @@ const submit = async () => {
|
|||
};
|
||||
|
||||
const { data } = await axios.post(
|
||||
`tickets/${formData.value.id}/componentUpdate`,
|
||||
`tickets/${ticket.value.id}/componentUpdate`,
|
||||
params,
|
||||
);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { onMounted, ref, computed, watch } from 'vue';
|
||||
import { onMounted, ref, computed, watch, inject } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
@ -25,7 +25,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
|
|||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
|
||||
const app = inject('app');
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
|
@ -187,20 +187,26 @@ const getRowUpdateInputEvents = (sale) => {
|
|||
|
||||
const resetChanges = async () => {
|
||||
arrayData.fetch({ append: false });
|
||||
tableRef.value.reload();
|
||||
tableRef.value.CrudModelRef.hasChanges = false;
|
||||
await tableRef.value.reload();
|
||||
|
||||
selectedRows.value = [];
|
||||
};
|
||||
const changeQuantity = async (sale) => {
|
||||
if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity)
|
||||
return;
|
||||
else sale.originalQuantity = sale.quantity;
|
||||
if (!sale.id) return addSale(sale);
|
||||
try {
|
||||
if (!sale.id) await addSale(sale);
|
||||
} catch (e) {
|
||||
app.config.errorHandler(e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (await isSalePrepared(sale)) {
|
||||
await confirmUpdate(() => updateQuantity(sale));
|
||||
} else await updateQuantity(sale);
|
||||
};
|
||||
|
||||
const updateQuantity = async (sale) => {
|
||||
try {
|
||||
let { quantity, id } = sale;
|
||||
|
@ -213,7 +219,7 @@ const updateQuantity = async (sale) => {
|
|||
(s) => s.id === sale.id,
|
||||
);
|
||||
sale.quantity = quantity;
|
||||
throw e;
|
||||
app.config.errorHandler(e);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -222,24 +228,27 @@ const addSale = async (sale) => {
|
|||
barcode: sale.itemFk,
|
||||
quantity: sale.quantity,
|
||||
};
|
||||
try {
|
||||
const { data } = await axios.post(`tickets/${route.params.id}/addSale`, params);
|
||||
|
||||
const { data } = await axios.post(`tickets/${route.params.id}/addSale`, params);
|
||||
if (!data) return;
|
||||
|
||||
if (!data) return;
|
||||
const newSale = data;
|
||||
sale.id = newSale.id;
|
||||
sale.image = newSale.item.image;
|
||||
sale.subName = newSale.item.subName;
|
||||
sale.concept = newSale.concept;
|
||||
sale.quantity = newSale.quantity;
|
||||
sale.discount = newSale.discount;
|
||||
sale.price = newSale.price;
|
||||
sale.item = newSale.item;
|
||||
|
||||
const newSale = data;
|
||||
sale.id = newSale.id;
|
||||
sale.image = newSale.item.image;
|
||||
sale.subName = newSale.item.subName;
|
||||
sale.concept = newSale.concept;
|
||||
sale.quantity = newSale.quantity;
|
||||
sale.discount = newSale.discount;
|
||||
sale.price = newSale.price;
|
||||
sale.item = newSale.item;
|
||||
|
||||
notify('globals.dataSaved', 'positive');
|
||||
sale.isNew = false;
|
||||
resetChanges();
|
||||
notify('globals.dataSaved', 'positive');
|
||||
sale.isNew = false;
|
||||
resetChanges();
|
||||
} catch (e) {
|
||||
app.config.errorHandler(e);
|
||||
}
|
||||
};
|
||||
const changeConcept = async (sale) => {
|
||||
if (await isSalePrepared(sale)) {
|
||||
|
@ -248,10 +257,14 @@ const changeConcept = async (sale) => {
|
|||
};
|
||||
|
||||
const updateConcept = async (sale) => {
|
||||
const data = { newConcept: sale.concept };
|
||||
await axios.post(`Sales/${sale.id}/updateConcept`, data);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
try {
|
||||
const data = { newConcept: sale.concept };
|
||||
await axios.post(`Sales/${sale.id}/updateConcept`, data);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
} catch (e) {
|
||||
app.config.errorHandler(e);
|
||||
}
|
||||
};
|
||||
|
||||
const DEFAULT_EDIT = {
|
||||
|
@ -262,18 +275,6 @@ const DEFAULT_EDIT = {
|
|||
oldQuantity: null,
|
||||
};
|
||||
const edit = ref({ ...DEFAULT_EDIT });
|
||||
const usesMana = ref(null);
|
||||
|
||||
const getUsesMana = async () => {
|
||||
const { data } = await axios.get('Sales/usesMana');
|
||||
usesMana.value = data;
|
||||
};
|
||||
|
||||
const getMana = async () => {
|
||||
const { data } = await axios.get(`Tickets/${route.params.id}/getDepartmentMana`);
|
||||
mana.value = data;
|
||||
await getUsesMana();
|
||||
};
|
||||
|
||||
const selectedValidSales = computed(() => {
|
||||
if (!sales.value) return;
|
||||
|
@ -310,11 +311,15 @@ const changePrice = async (sale) => {
|
|||
}
|
||||
};
|
||||
const updatePrice = async (sale, newPrice) => {
|
||||
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
||||
sale.price = newPrice;
|
||||
edit.value = { ...DEFAULT_EDIT };
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
try {
|
||||
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
||||
sale.price = newPrice;
|
||||
edit.value = { ...DEFAULT_EDIT };
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
} catch (e) {
|
||||
app.config.errorHandler(e);
|
||||
}
|
||||
};
|
||||
|
||||
const changeDiscount = async (sale) => {
|
||||
|
@ -337,15 +342,20 @@ const updateDiscounts = async (sales, newDiscount) => {
|
|||
};
|
||||
|
||||
const updateDiscount = async (sales, newDiscount = 0) => {
|
||||
const salesIds = sales.map(({ id }) => id);
|
||||
const params = {
|
||||
salesIds,
|
||||
newDiscount,
|
||||
manaCode: manaCode.value,
|
||||
};
|
||||
await axios.post(`Tickets/${route.params.id}/updateDiscount`, params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
try {
|
||||
const salesIds = sales.map(({ id }) => id);
|
||||
const params = {
|
||||
salesIds,
|
||||
newDiscount,
|
||||
manaCode: manaCode.value,
|
||||
};
|
||||
await axios.post(`Tickets/${route.params.id}/updateDiscount`, params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
} catch (e) {
|
||||
app.config.errorHandler(e);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const getNewPrice = computed(() => {
|
||||
|
@ -367,11 +377,15 @@ const getNewPrice = computed(() => {
|
|||
});
|
||||
|
||||
const newOrderFromTicket = async () => {
|
||||
const { data } = await axios.post(`Orders/newFromTicket`, {
|
||||
ticketFk: Number(route.params.id),
|
||||
});
|
||||
const routeData = router.resolve({ name: 'OrderCatalog', params: { id: data } });
|
||||
window.open(routeData.href, '_blank');
|
||||
try {
|
||||
const { data } = await axios.post(`Orders/newFromTicket`, {
|
||||
ticketFk: Number(route.params.id),
|
||||
});
|
||||
const routeData = router.resolve({ name: 'OrderCatalog', params: { id: data } });
|
||||
window.open(routeData.href, '_blank');
|
||||
} catch (e) {
|
||||
app.config.errorHandler(e);
|
||||
}
|
||||
};
|
||||
|
||||
const goToLog = (saleId) => {
|
||||
|
@ -386,11 +400,15 @@ const goToLog = (saleId) => {
|
|||
};
|
||||
|
||||
const changeTicketState = async (val) => {
|
||||
stateBtnDropdownRef.value.hide();
|
||||
const params = { ticketFk: route.params.id, code: val };
|
||||
await axios.post('Tickets/state', params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
await resetChanges();
|
||||
try {
|
||||
stateBtnDropdownRef.value.hide();
|
||||
const params = { ticketFk: route.params.id, code: val };
|
||||
await axios.post('Tickets/state', params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
} catch (e) {
|
||||
app.config.errorHandler(e);
|
||||
}
|
||||
};
|
||||
|
||||
const removeSelectedSales = () => {
|
||||
|
@ -410,10 +428,14 @@ const removeSales = async () => {
|
|||
.forEach((sale) => tableRef.value.CrudModelRef.formData.splice(sale.$index, 1));
|
||||
|
||||
if (params.sales.length == 0) return;
|
||||
await axios.post('Sales/deleteSales', params);
|
||||
removeSelectedSales();
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
try {
|
||||
await axios.post('Sales/deleteSales', params);
|
||||
removeSelectedSales();
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
} catch (e) {
|
||||
app.config.errorHandler(e);
|
||||
}
|
||||
};
|
||||
|
||||
const setTransferParams = async () => {
|
||||
|
|
|
@ -62,6 +62,7 @@ const isClaimable = computed(() => {
|
|||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
const sendSms = async (params) => {
|
||||
await axios.post(`Tickets/${ticket.value.id}/sendSms`, params);
|
||||
notify(t('SMS sent'), 'positive');
|
||||
|
@ -230,18 +231,6 @@ const createRefund = async (withWarehouse) => {
|
|||
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
||||
</QItemSection>
|
||||
</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">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
||||
|
@ -287,8 +276,6 @@ es:
|
|||
Recalculate price: Recalcular precio
|
||||
Update discount: Actualizar descuento
|
||||
Add claim: Crear reclamación
|
||||
Mark as reserved: Marcar como reservado
|
||||
Unmark as reserved: Desmarcar como reservado
|
||||
Refund: Abono
|
||||
with warehouse: con almacén
|
||||
without warehouse: sin almacén
|
||||
|
|
|
@ -8,6 +8,6 @@ import filter from './TravelFilter.js';
|
|||
data-key="Travel"
|
||||
url="Travels"
|
||||
:descriptor="TravelDescriptor"
|
||||
:filter="filter"
|
||||
:filter="{ ...filter, where: { id: $route.params.id } }"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -91,6 +91,13 @@ const entriesTableColumns = computed(() => {
|
|||
showValue: true,
|
||||
},
|
||||
{ label: 'CC', field: 'cc', name: 'cc', align: 'left', showValue: true },
|
||||
{
|
||||
label: t('travel.summary.roundedCc'),
|
||||
field: 'cc',
|
||||
name: 'roundedCc',
|
||||
align: 'left',
|
||||
showValue: true,
|
||||
},
|
||||
{
|
||||
label: 'Pallet',
|
||||
field: 'pallet',
|
||||
|
@ -193,13 +200,18 @@ const entriesTotals = computed(() => {
|
|||
freightValue: 0,
|
||||
packageValue: 0,
|
||||
cc: 0,
|
||||
roundedCc: 0,
|
||||
pallet: 0,
|
||||
m3: 0,
|
||||
};
|
||||
|
||||
entriesTableRows.value.forEach((row) => {
|
||||
for (const key in totals) {
|
||||
totals[key] += row[key] || 0;
|
||||
if (key === 'roundedCc') {
|
||||
totals['roundedCc'] += Math.ceil(row['cc'] || 0);
|
||||
} else {
|
||||
totals[key] += row[key] || 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -208,6 +220,7 @@ const entriesTotals = computed(() => {
|
|||
freight: toCurrency(totals.freightValue),
|
||||
packageValue: toCurrency(totals.packageValue),
|
||||
cc: totals.cc.toFixed(2),
|
||||
roundedCc: totals.roundedCc,
|
||||
pallet: totals.pallet.toFixed(2),
|
||||
m3: totals.m3.toFixed(2),
|
||||
};
|
||||
|
@ -255,13 +268,6 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="Warehouses"
|
||||
:filter="{ fields: ['id', 'name'] }"
|
||||
order="name"
|
||||
@on-fetch="(data) => (warehouses = data)"
|
||||
auto-load
|
||||
/>
|
||||
<CardSummary
|
||||
ref="summaryRef"
|
||||
:url="`Travels/${entityId}/getTravel`"
|
||||
|
@ -337,9 +343,7 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
|||
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
|
||||
<VnLv
|
||||
:label="t('travel.summary.availabled')"
|
||||
:value="
|
||||
dashIfEmpty(toDateTimeFormat(travel.availabled))
|
||||
"
|
||||
:value="dashIfEmpty(toDateTimeFormat(travel.availabled))"
|
||||
/>
|
||||
</QCard>
|
||||
<QCard class="full-width">
|
||||
|
@ -376,6 +380,11 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
|||
</QBtn>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-roundedCc="{ col, value }">
|
||||
<QTd>
|
||||
{{ Math.ceil(value) || 0 }}
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-observation="{ value }">
|
||||
<QTd>
|
||||
<QIcon name="insert_drive_file" color="primary" size="24px">
|
||||
|
@ -392,23 +401,24 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
|||
<QTd class="text-bold">{{ entriesTotals.freight }}</QTd>
|
||||
<QTd class="text-bold">{{ entriesTotals.packageValue }}</QTd>
|
||||
<QTd class="text-bold">{{ entriesTotals.cc }}</QTd>
|
||||
<QTd class="text-bold">{{ entriesTotals.roundedCc }}</QTd>
|
||||
<QTd class="text-bold">{{ entriesTotals.pallet }}</QTd>
|
||||
<QTd class="text-bold">{{ entriesTotals.m3 }}</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
</QCard>
|
||||
|
||||
<QCard class="full-width" v-if="thermographs.length > 0">
|
||||
<RouterLink
|
||||
class="header header-link"
|
||||
:to="{
|
||||
name: 'TravelThermographsIndex',
|
||||
params: { id: travel.id },
|
||||
}"
|
||||
>
|
||||
{{ t('travel.summary.thermographs') }}
|
||||
<QIcon name="open_in_new" />
|
||||
</RouterLink>
|
||||
<FetchData
|
||||
url="Warehouses"
|
||||
:filter="{ fields: ['id', 'name'] }"
|
||||
order="name"
|
||||
@on-fetch="(data) => (warehouses = data)"
|
||||
auto-load
|
||||
/>
|
||||
<VnTitle
|
||||
:url="getLink('thermographs')"
|
||||
:text="t('travel.summary.thermographs')"
|
||||
/>
|
||||
<QTable
|
||||
:rows="thermographs"
|
||||
:columns="thermographsTableColumns"
|
||||
|
|
|
@ -89,7 +89,7 @@ defineExpose({ states });
|
|||
/>
|
||||
<VnSelect
|
||||
:label="t('travel.warehouseOut')"
|
||||
v-model="params.warehouseOut"
|
||||
v-model="params.warehouseOutFk"
|
||||
@update:model-value="searchFn()"
|
||||
url="warehouses"
|
||||
:use-like="false"
|
||||
|
@ -140,6 +140,7 @@ en:
|
|||
ref: Reference
|
||||
agency: Agency
|
||||
warehouseInFk: Warehouse In
|
||||
warehouseOutFk: Warehouse Out
|
||||
shipped: Shipped
|
||||
shipmentHour: Shipment Hour
|
||||
warehouseOut: Warehouse Out
|
||||
|
@ -153,6 +154,7 @@ es:
|
|||
ref: Referencia
|
||||
agency: Agencia
|
||||
warehouseInFk: Alm.Entrada
|
||||
warehouseOutFk: Alm.Salida
|
||||
shipped: F.Envío
|
||||
shipmentHour: Hora de envío
|
||||
warehouseOut: Alm.Salida
|
||||
|
|
|
@ -201,7 +201,7 @@ const columns = computed(() => [
|
|||
{
|
||||
title: t('components.smartCard.viewSummary'),
|
||||
icon: 'preview',
|
||||
action: (row) => viewSummary(row.id, TravelSummary),
|
||||
action: (row) => viewSummary(row.id, TravelSummary, 'lg-width'),
|
||||
isPrimary: true,
|
||||
},
|
||||
],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
describe('ClaimNotes', () => {
|
||||
describe('Account descriptor', () => {
|
||||
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
|
||||
const url = '/#/account/1/summary';
|
||||
|
||||
|
@ -7,6 +7,9 @@ describe('ClaimNotes', () => {
|
|||
cy.visit(url);
|
||||
cy.dataCy('descriptor-more-opts').click();
|
||||
cy.get(descriptorOptions)
|
||||
.should('exist')
|
||||
.should('be.visible')
|
||||
|
||||
.find('.q-item')
|
||||
.its('length')
|
||||
.then((count) => {
|
||||
|
|
|
@ -44,11 +44,12 @@ describe('EntryList', () => {
|
|||
},
|
||||
);
|
||||
|
||||
checkBadgeDate(
|
||||
// fix on task https://redmine.verdnatura.es/issues/8638
|
||||
/* checkBadgeDate(
|
||||
'td[data-col-field="landed"] > div .bg-info',
|
||||
(badgeDate, compareDate) => {
|
||||
expect(badgeDate.getTime()).to.be.lessThan(compareDate.getTime());
|
||||
},
|
||||
);
|
||||
); */
|
||||
});
|
||||
});
|
||||
|
|
|
@ -30,9 +30,11 @@ describe('OrderList', () => {
|
|||
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.intercept('GET', /\/api\/Clients/).as('clientFilter');
|
||||
cy.dataCy('vnTableCreateBtn').click();
|
||||
cy.wait('@clientFilter');
|
||||
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
||||
cy.selectOption(agencyCreateSelect, 1);
|
||||
|
||||
|
|
|
@ -118,8 +118,8 @@ describe('Route extended list', () => {
|
|||
cy.validateContent(selector, value);
|
||||
});
|
||||
});
|
||||
|
||||
it('Should clone selected route and add ticket', () => {
|
||||
// task https://redmine.verdnatura.es/issues/8814
|
||||
xit('Should clone selected route and add ticket', () => {
|
||||
cy.get(selectors.firstRowSelectCheckBox).click();
|
||||
cy.get(selectors.cloneBtn).click();
|
||||
cy.dataCy('Starting date_inputDate').type('01-01-2001');
|
||||
|
@ -146,7 +146,8 @@ describe('Route extended list', () => {
|
|||
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
|
||||
});
|
||||
|
||||
it('Should mark as served the selected route', () => {
|
||||
// task https://redmine.verdnatura.es/issues/8814
|
||||
xit('Should mark as served the selected route', () => {
|
||||
cy.get(selectors.lastRowSelectCheckBox).click();
|
||||
cy.get(selectors.markServedBtn).click();
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('TicketList', () => {
|
||||
describe.skip('TicketList', () => {
|
||||
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -35,7 +35,8 @@ describe('TicketList', () => {
|
|||
cy.get('.summaryBody').should('exist');
|
||||
});
|
||||
|
||||
it('filter client and create ticket', () => {
|
||||
// task https://redmine.verdnatura.es/issues/8779
|
||||
xit('filter client and create ticket', () => {
|
||||
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
|
||||
searchResults();
|
||||
cy.wait('@ticketSearchbar');
|
||||
|
|
|
@ -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