Merge branch 'dev' into 8647_fix_warnings
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
This commit is contained in:
commit
88099a9f34
|
@ -1,12 +1,22 @@
|
|||
<script setup>
|
||||
import { toCurrency } from 'src/filters';
|
||||
import { getValueFromPath } from 'src/composables/getValueFromPath';
|
||||
|
||||
defineProps({ row: { type: Object, required: true } });
|
||||
const { row, visibleProblems = null } = defineProps({
|
||||
row: { type: Object, required: true },
|
||||
visibleProblems: { type: Array },
|
||||
});
|
||||
|
||||
function showProblem(problem) {
|
||||
const val = getValueFromPath(row, problem);
|
||||
if (!visibleProblems) return val;
|
||||
return !!(visibleProblems?.includes(problem) && val);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<span class="q-gutter-x-xs">
|
||||
<router-link
|
||||
v-if="row.claim?.claimFk"
|
||||
v-if="showProblem('claim.claimFk')"
|
||||
:to="{ name: 'ClaimBasicData', params: { id: row.claim?.claimFk } }"
|
||||
class="link"
|
||||
>
|
||||
|
@ -18,7 +28,7 @@ defineProps({ row: { type: Object, required: true } });
|
|||
</QIcon>
|
||||
</router-link>
|
||||
<QIcon
|
||||
v-if="row?.isDeleted"
|
||||
v-if="showProblem('isDeleted')"
|
||||
color="primary"
|
||||
name="vn:deletedTicket"
|
||||
size="xs"
|
||||
|
@ -29,7 +39,7 @@ defineProps({ row: { type: Object, required: true } });
|
|||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.hasRisk"
|
||||
v-if="showProblem('hasRisk')"
|
||||
name="vn:risk"
|
||||
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
||||
size="xs"
|
||||
|
@ -40,51 +50,76 @@ defineProps({ row: { type: Object, required: true } });
|
|||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.hasComponentLack"
|
||||
v-if="showProblem('hasComponentLack')"
|
||||
name="vn:components"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.hasItemDelay" color="primary" size="xs" name="vn:hasItemDelay">
|
||||
<QIcon
|
||||
v-if="showProblem('hasItemDelay')"
|
||||
color="primary"
|
||||
size="xs"
|
||||
name="vn:hasItemDelay"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ $t('ticket.summary.hasItemDelay') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.hasItemLost" color="primary" size="xs" name="vn:hasItemLost">
|
||||
<QIcon
|
||||
v-if="showProblem('hasItemLost')"
|
||||
color="primary"
|
||||
size="xs"
|
||||
name="vn:hasItemLost"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ $t('salesTicketsTable.hasItemLost') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.hasItemShortage"
|
||||
v-if="showProblem('hasItemShortage')"
|
||||
name="vn:unavailable"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.hasRounding" color="primary" name="sync_problem" size="xs">
|
||||
<QIcon
|
||||
v-if="showProblem('hasRounding')"
|
||||
color="primary"
|
||||
name="sync_problem"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ $t('ticketList.rounding') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.hasTicketRequest"
|
||||
v-if="showProblem('hasTicketRequest')"
|
||||
name="vn:buyrequest"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.isTaxDataChecked" name="vn:no036" color="primary" size="xs">
|
||||
<QIcon
|
||||
v-if="showProblem('isTaxDataChecked')"
|
||||
name="vn:no036"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||
<QIcon v-if="showProblem('isFreezed')" name="vn:frozen" color="primary" size="xs">
|
||||
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
|
||||
<QIcon
|
||||
v-if="showProblem('isTooLittle')"
|
||||
name="vn:isTooLittle"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
||||
</QIcon>
|
||||
</span>
|
||||
|
|
|
@ -1,65 +1,63 @@
|
|||
import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest';
|
||||
import { vi, describe, expect, it, beforeEach, beforeAll, afterEach } from 'vitest';
|
||||
import { createWrapper } from 'app/test/vitest/helper';
|
||||
import UserPanel from 'src/components/UserPanel.vue';
|
||||
import axios from 'axios';
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
vi.mock('src/utils/quasarLang', () => ({
|
||||
default: vi.fn(),
|
||||
}));
|
||||
|
||||
describe('UserPanel', () => {
|
||||
let wrapper;
|
||||
let vm;
|
||||
let state;
|
||||
let wrapper;
|
||||
let vm;
|
||||
let state;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = createWrapper(UserPanel, {});
|
||||
state = useState();
|
||||
state.setUser({
|
||||
id: 115,
|
||||
name: 'itmanagement',
|
||||
nickname: 'itManagementNick',
|
||||
lang: 'en',
|
||||
darkMode: false,
|
||||
companyFk: 442,
|
||||
warehouseFk: 1,
|
||||
beforeEach(() => {
|
||||
wrapper = createWrapper(UserPanel, {});
|
||||
state = useState();
|
||||
state.setUser({
|
||||
id: 115,
|
||||
name: 'itmanagement',
|
||||
nickname: 'itManagementNick',
|
||||
lang: 'en',
|
||||
darkMode: false,
|
||||
companyFk: 442,
|
||||
warehouseFk: 1,
|
||||
});
|
||||
wrapper = wrapper.wrapper;
|
||||
vm = wrapper.vm;
|
||||
});
|
||||
wrapper = wrapper.wrapper;
|
||||
vm = wrapper.vm;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should fetch warehouses data on mounted', async () => {
|
||||
const fetchData = wrapper.findComponent({ name: 'FetchData' });
|
||||
expect(fetchData.props('url')).toBe('Warehouses');
|
||||
expect(fetchData.props('autoLoad')).toBe(true);
|
||||
});
|
||||
it('should fetch warehouses data on mounted', async () => {
|
||||
const fetchData = wrapper.findComponent({ name: 'FetchData' });
|
||||
expect(fetchData.props('url')).toBe('Warehouses');
|
||||
expect(fetchData.props('autoLoad')).toBe(true);
|
||||
});
|
||||
|
||||
it('should toggle dark mode correctly and update preferences', async () => {
|
||||
await vm.saveDarkMode(true);
|
||||
expect(axios.patch).toHaveBeenCalledWith('/UserConfigs/115', { darkMode: true });
|
||||
expect(vm.user.darkMode).toBe(true);
|
||||
await vm.updatePreferences();
|
||||
expect(vm.darkMode).toBe(true);
|
||||
});
|
||||
it('should toggle dark mode correctly and update preferences', async () => {
|
||||
await vm.saveDarkMode(true);
|
||||
expect(axios.patch).toHaveBeenCalledWith('/UserConfigs/115', { darkMode: true });
|
||||
expect(vm.user.darkMode).toBe(true);
|
||||
vm.updatePreferences();
|
||||
expect(vm.darkMode).toBe(true);
|
||||
});
|
||||
|
||||
it('should change user language and update preferences', async () => {
|
||||
const userLanguage = 'es';
|
||||
await vm.saveLanguage(userLanguage);
|
||||
expect(axios.patch).toHaveBeenCalledWith('/VnUsers/115', { lang: userLanguage });
|
||||
expect(vm.user.lang).toBe(userLanguage);
|
||||
await vm.updatePreferences();
|
||||
expect(vm.locale).toBe(userLanguage);
|
||||
});
|
||||
it('should change user language and update preferences', async () => {
|
||||
const userLanguage = 'es';
|
||||
await vm.saveLanguage(userLanguage);
|
||||
expect(axios.patch).toHaveBeenCalledWith('/VnUsers/115', { lang: userLanguage });
|
||||
expect(vm.user.lang).toBe(userLanguage);
|
||||
vm.updatePreferences();
|
||||
expect(vm.locale).toBe(userLanguage);
|
||||
});
|
||||
|
||||
it('should update user data', async () => {
|
||||
const key = 'name';
|
||||
const value = 'itboss';
|
||||
await vm.saveUserData(key, value);
|
||||
expect(axios.post).toHaveBeenCalledWith('UserConfigs/setUserConfig', { [key]: value });
|
||||
});
|
||||
});
|
||||
it('should update user data', async () => {
|
||||
const key = 'name';
|
||||
const value = 'itboss';
|
||||
await vm.saveUserData(key, value);
|
||||
expect(axios.post).toHaveBeenCalledWith('UserConfigs/setUserConfig', {
|
||||
[key]: value,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const model = defineModel({ type: [Number, String] });
|
||||
const emit = defineEmits(['updateBic']);
|
||||
|
||||
const getIbanCountry = (bank) => {
|
||||
return bank.substr(0, 2);
|
||||
};
|
||||
|
||||
const autofillBic = async (iban) => {
|
||||
if (!iban) return;
|
||||
|
||||
const bankEntityId = parseInt(iban.substr(4, 4));
|
||||
const ibanCountry = getIbanCountry(iban);
|
||||
|
||||
if (ibanCountry != 'ES') return;
|
||||
|
||||
const filter = { where: { id: bankEntityId.value } };
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
|
||||
const { data } = await axios.get(`BankEntities`, { params });
|
||||
|
||||
emit('updateBic', data[0].id);
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<VnInput
|
||||
:label="t('IBAN')"
|
||||
clearable
|
||||
v-model="model"
|
||||
@update:model-value="autofillBic($event)"
|
||||
>
|
||||
<template #append>
|
||||
<QIcon name="info" class="cursor-info">
|
||||
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
</template>
|
|
@ -6,6 +6,7 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
|||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useClipboard } from 'src/composables/useClipboard';
|
||||
import VnMoreOptions from './VnMoreOptions.vue';
|
||||
import { getValueFromPath } from 'src/composables/getValueFromPath';
|
||||
|
||||
const entity = defineModel({ type: Object, default: null });
|
||||
const $props = defineProps({
|
||||
|
@ -56,18 +57,6 @@ const routeName = computed(() => {
|
|||
return `${routeName}Summary`;
|
||||
});
|
||||
|
||||
function getValueFromPath(path) {
|
||||
if (!path) return;
|
||||
const keys = path.toString().split('.');
|
||||
let current = entity.value;
|
||||
|
||||
for (const key of keys) {
|
||||
if (current[key] === undefined) return undefined;
|
||||
else current = current[key];
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
function copyIdText(id) {
|
||||
copyText(id, {
|
||||
component: {
|
||||
|
@ -170,10 +159,10 @@ const toModule = computed(() => {
|
|||
<div class="title">
|
||||
<span
|
||||
v-if="title"
|
||||
:title="getValueFromPath(title)"
|
||||
:title="getValueFromPath(entity, title)"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'vnDescriptor'}_title`"
|
||||
>
|
||||
{{ getValueFromPath(title) ?? title }}
|
||||
{{ getValueFromPath(entity, title) ?? title }}
|
||||
</span>
|
||||
<slot v-else name="description" :entity="entity">
|
||||
<span
|
||||
|
@ -189,7 +178,7 @@ const toModule = computed(() => {
|
|||
class="subtitle"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'vnDescriptor'}_subtitle`"
|
||||
>
|
||||
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
||||
#{{ getValueFromPath(entity, subtitle) ?? entity.id }}
|
||||
</QItemLabel>
|
||||
<QBtn
|
||||
round
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
usesMana: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
manaCode: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
manaVal: {
|
||||
type: String,
|
||||
default: 'mana',
|
||||
},
|
||||
manaLabel: {
|
||||
type: String,
|
||||
default: 'Promotion mana',
|
||||
},
|
||||
manaClaimVal: {
|
||||
type: String,
|
||||
default: 'manaClaim',
|
||||
},
|
||||
claimLabel: {
|
||||
type: String,
|
||||
default: 'Claim mana',
|
||||
},
|
||||
});
|
||||
|
||||
const manaCode = ref(props.manaCode);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="column q-gutter-y-sm q-mt-sm">
|
||||
<QRadio
|
||||
v-model="manaCode"
|
||||
dense
|
||||
:val="manaVal"
|
||||
:label="t(manaLabel)"
|
||||
:dark="true"
|
||||
class="q-mb-sm"
|
||||
/>
|
||||
<QRadio
|
||||
v-model="manaCode"
|
||||
dense
|
||||
:val="manaClaimVal"
|
||||
:label="t(claimLabel)"
|
||||
:dark="true"
|
||||
class="q-mb-sm"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<i18n>
|
||||
es:
|
||||
Promotion mana: Maná promoción
|
||||
Claim mana: Maná reclamación
|
||||
</i18n>
|
|
@ -0,0 +1,11 @@
|
|||
export function getValueFromPath(root, path) {
|
||||
if (!root || !path) return;
|
||||
const keys = path.toString().split('.');
|
||||
let current = root;
|
||||
|
||||
for (const key of keys) {
|
||||
if (current[key] === undefined) return undefined;
|
||||
else current = current[key];
|
||||
}
|
||||
return current;
|
||||
}
|
|
@ -18,6 +18,7 @@ $positive: #c8e484;
|
|||
$negative: #fb5252;
|
||||
$info: #84d0e2;
|
||||
$warning: #f4b974;
|
||||
$neutral: #b0b0b0;
|
||||
// Pendiente de cuadrar con la base de datos
|
||||
$success: $positive;
|
||||
$alert: $negative;
|
||||
|
@ -51,3 +52,6 @@ $width-xl: 1600px;
|
|||
.bg-alert {
|
||||
background-color: $negative;
|
||||
}
|
||||
.bg-neutral {
|
||||
background-color: $neutral;
|
||||
}
|
||||
|
|
|
@ -28,14 +28,8 @@ const entityId = computed(() => {
|
|||
return $props.id || route.params.id;
|
||||
});
|
||||
|
||||
const STATE_COLOR = {
|
||||
pending: 'warning',
|
||||
incomplete: 'info',
|
||||
resolved: 'positive',
|
||||
canceled: 'negative',
|
||||
};
|
||||
function stateColor(code) {
|
||||
return STATE_COLOR[code];
|
||||
function stateColor(entity) {
|
||||
return entity?.claimState?.classColor;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
@ -57,9 +51,8 @@ onMounted(async () => {
|
|||
<VnLv v-if="entity.claimState" :label="t('claim.state')">
|
||||
<template #value>
|
||||
<QBadge
|
||||
:color="stateColor(entity.claimState.code)"
|
||||
text-color="black"
|
||||
dense
|
||||
:color="stateColor(entity)"
|
||||
style="color: var(--vn-black-text-color)"
|
||||
>
|
||||
{{ entity.claimState.description }}
|
||||
</QBadge>
|
||||
|
|
|
@ -123,8 +123,8 @@ async function fetchMana() {
|
|||
|
||||
async function updateDiscount({ saleFk, discount, canceller }) {
|
||||
const body = { salesIds: [saleFk], newDiscount: discount };
|
||||
const claimId = claim.value.ticketFk;
|
||||
const query = `Tickets/${claimId}/updateDiscount`;
|
||||
const ticketFk = claim.value.ticketFk;
|
||||
const query = `Tickets/${ticketFk}/updateDiscount`;
|
||||
|
||||
await axios.post(query, body, {
|
||||
signal: canceller.signal,
|
||||
|
|
|
@ -108,15 +108,9 @@ const markerLabels = [
|
|||
{ value: 5, label: t('claim.person') },
|
||||
];
|
||||
|
||||
const STATE_COLOR = {
|
||||
pending: 'warning',
|
||||
incomplete: 'info',
|
||||
resolved: 'positive',
|
||||
canceled: 'negative',
|
||||
};
|
||||
|
||||
function stateColor(code) {
|
||||
return STATE_COLOR[code];
|
||||
const claimState = claimStates.value.find((state) => state.code === code);
|
||||
return claimState?.classColor;
|
||||
}
|
||||
|
||||
const developmentColumns = ref([
|
||||
|
@ -188,7 +182,7 @@ function claimUrl(section) {
|
|||
<template>
|
||||
<FetchData
|
||||
url="ClaimStates"
|
||||
:filter="{ fields: ['id', 'description'] }"
|
||||
:filter="{ fields: ['id', 'description', 'code', 'classColor'] }"
|
||||
@on-fetch="(data) => (claimStates = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
@ -346,17 +340,18 @@ function claimUrl(section) {
|
|||
<template #body="props">
|
||||
<QTr :props="props">
|
||||
<QTd v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span v-if="col.name != 'description'">{{
|
||||
t(col.value)
|
||||
}}</span>
|
||||
<span class="link" v-if="col.name === 'description'">{{
|
||||
t(col.value)
|
||||
}}</span>
|
||||
<ItemDescriptorProxy
|
||||
v-if="col.name == 'description'"
|
||||
:id="props.row.sale.itemFk"
|
||||
:sale-fk="props.row.saleFk"
|
||||
></ItemDescriptorProxy>
|
||||
<template v-if="col.name === 'description'">
|
||||
<span class="link">{{
|
||||
dashIfEmpty(col.field(props.row))
|
||||
}}</span>
|
||||
<ItemDescriptorProxy
|
||||
:id="props.row.sale.itemFk"
|
||||
:sale-fk="props.row.saleFk"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ dashIfEmpty(col.field(props.row)) }}
|
||||
</template>
|
||||
</QTd>
|
||||
</QTr>
|
||||
</template>
|
||||
|
|
|
@ -101,7 +101,10 @@ const columns = computed(() => [
|
|||
name: 'stateCode',
|
||||
chip: {
|
||||
condition: () => true,
|
||||
color: ({ stateCode }) => STATE_COLOR[stateCode] ?? 'bg-grey',
|
||||
color: ({ stateCode }) => {
|
||||
const state = states.value?.find(({ code }) => code === stateCode);
|
||||
return `bg-${state.classColor}`;
|
||||
},
|
||||
},
|
||||
columnFilter: {
|
||||
name: 'claimStateFk',
|
||||
|
@ -131,12 +134,6 @@ const columns = computed(() => [
|
|||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const STATE_COLOR = {
|
||||
pending: 'bg-warning',
|
||||
loses: 'bg-negative',
|
||||
resolved: 'bg-positive',
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -9,6 +9,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
|
||||
import VnInputBic from 'src/components/common/VnInputBic.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -17,7 +18,7 @@ const bankEntitiesRef = ref(null);
|
|||
|
||||
const filter = {
|
||||
fields: ['id', 'bic', 'name'],
|
||||
order: 'bic ASC'
|
||||
order: 'bic ASC',
|
||||
};
|
||||
|
||||
const getBankEntities = (data, formData) => {
|
||||
|
@ -43,13 +44,11 @@ const getBankEntities = (data, formData) => {
|
|||
</VnRow>
|
||||
|
||||
<VnRow>
|
||||
<VnInput :label="t('IBAN')" clearable v-model="data.iban">
|
||||
<template #append>
|
||||
<QIcon name="info" class="cursor-info">
|
||||
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
<VnInputBic
|
||||
:label="t('IBAN')"
|
||||
v-model="data.iban"
|
||||
@update-bic="(bankEntityFk) => (data.bankEntityFk = bankEntityFk)"
|
||||
/>
|
||||
<VnSelectDialog
|
||||
:label="t('Swift / BIC')"
|
||||
ref="bankEntitiesRef"
|
||||
|
|
|
@ -185,7 +185,7 @@ const sumRisk = ({ clientRisks }) => {
|
|||
/>
|
||||
<VnLv
|
||||
:label="t('customer.summary.payMethod')"
|
||||
:value="entity.payMethod.name"
|
||||
:value="entity.payMethod?.name"
|
||||
/>
|
||||
<VnLv :label="t('customer.summary.bankAccount')" :value="entity.iban" />
|
||||
<VnLv :label="t('customer.summary.dueDay')" :value="entity.dueDay" />
|
||||
|
|
|
@ -46,7 +46,7 @@ async function getClaims() {
|
|||
originalTicket.value = data[0]?.originalTicketFk;
|
||||
}
|
||||
async function getProblems() {
|
||||
const { data } = await axios.get(`Tickets/${entityId.value}/getTicketProblems`);
|
||||
const { data } = await axios.get(`Tickets/getTicketProblems`, {params: { ids: [entityId.value] }});
|
||||
if (!data) return;
|
||||
problems.value = data[0];
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
|||
import { computed, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { toCurrency } from 'src/filters';
|
||||
import VnUsesMana from 'components/ui/VnUsesMana.vue';
|
||||
|
||||
const $props = defineProps({
|
||||
newPrice: {
|
||||
|
@ -15,23 +14,36 @@ const $props = defineProps({
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
componentId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['save', 'cancel', 'update:componentId']);
|
||||
|
||||
const route = useRoute();
|
||||
const mana = ref(null);
|
||||
const usesMana = ref(false);
|
||||
|
||||
const emit = defineEmits(['save', 'cancel']);
|
||||
const usesMana = ref([]);
|
||||
|
||||
const { t } = useI18n();
|
||||
const QPopupProxyRef = ref(null);
|
||||
const manaCode = ref($props.manaCode);
|
||||
|
||||
const componentId = computed({
|
||||
get: () => $props.componentId,
|
||||
set: (val) => emit('update:componentId', val),
|
||||
});
|
||||
|
||||
const save = (sale = $props.sale) => {
|
||||
emit('save', sale);
|
||||
QPopupProxyRef.value.hide();
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
emit('cancel');
|
||||
QPopupProxyRef.value.hide();
|
||||
};
|
||||
|
||||
const getMana = async () => {
|
||||
const { data } = await axios.get(`Tickets/${route.params.id}/getDepartmentMana`);
|
||||
mana.value = data;
|
||||
|
@ -39,15 +51,12 @@ const getMana = async () => {
|
|||
};
|
||||
|
||||
const getUsesMana = async () => {
|
||||
const { data } = await axios.get('Sales/usesMana');
|
||||
const { data } = await axios.get('Sales/getComponents');
|
||||
usesMana.value = data;
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
emit('cancel');
|
||||
QPopupProxyRef.value.hide();
|
||||
};
|
||||
const hasMana = computed(() => typeof mana.value === 'number');
|
||||
|
||||
defineExpose({ save });
|
||||
</script>
|
||||
|
||||
|
@ -59,17 +68,29 @@ defineExpose({ save });
|
|||
>
|
||||
<div class="container">
|
||||
<div class="header">Mana: {{ toCurrency(mana) }}</div>
|
||||
<QSpinner v-if="!hasMana" color="primary" size="md" />
|
||||
|
||||
<QSpinner v-if="!usesMana.length" color="primary" />
|
||||
|
||||
<div class="q-pa-md" v-else>
|
||||
<slot :popup="QPopupProxyRef" />
|
||||
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
||||
<VnUsesMana :mana-code="manaCode" />
|
||||
|
||||
<div v-if="usesMana.length" class="column q-gutter-y-sm q-mt-sm">
|
||||
<QRadio
|
||||
v-for="(item, index) in usesMana"
|
||||
:key="index"
|
||||
v-model="componentId"
|
||||
:val="item.id"
|
||||
:label="item.name"
|
||||
dense
|
||||
:dark="true"
|
||||
class="q-mb-sm"
|
||||
:data-cy="`componentOption-${item.id}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="newPrice" class="column items-center q-mt-lg">
|
||||
<span class="text-primary">{{ t('New price') }}</span>
|
||||
<span class="text-subtitle1">
|
||||
{{ toCurrency($props.newPrice) }}
|
||||
</span>
|
||||
<span class="text-subtitle1">{{ toCurrency(newPrice) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -77,7 +98,6 @@ defineExpose({ save });
|
|||
<QBtn
|
||||
color="primary"
|
||||
class="no-border-radius"
|
||||
dense
|
||||
style="width: 50%"
|
||||
@click="cancel()"
|
||||
>
|
||||
|
@ -86,7 +106,6 @@ defineExpose({ save });
|
|||
<QBtn
|
||||
color="primary"
|
||||
class="no-border-radius"
|
||||
dense
|
||||
style="width: 50%"
|
||||
@click="save()"
|
||||
data-cy="saveManaBtn"
|
||||
|
@ -116,8 +135,3 @@ defineExpose({ save });
|
|||
min-width: 230px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
New price: Nuevo precio
|
||||
</i18n>
|
||||
|
|
|
@ -45,7 +45,7 @@ const isTicketEditable = ref(false);
|
|||
const sales = ref([]);
|
||||
const editableStatesOptions = ref([]);
|
||||
const selectedSales = ref([]);
|
||||
const manaCode = ref('mana');
|
||||
const componentId = ref(null);
|
||||
const ticketState = computed(() => store.data?.ticketState?.state?.code);
|
||||
const transfer = ref({
|
||||
lastActiveTickets: [],
|
||||
|
@ -187,7 +187,7 @@ const getRowUpdateInputEvents = (sale) => {
|
|||
};
|
||||
|
||||
const resetChanges = async () => {
|
||||
arrayData.fetch({ append: false });
|
||||
await arrayData.fetch({ append: false });
|
||||
tableRef.value.CrudModelRef.hasChanges = false;
|
||||
await tableRef.value.reload();
|
||||
|
||||
|
@ -308,14 +308,15 @@ const changePrice = async (sale) => {
|
|||
if (newPrice != null && newPrice != sale.price) {
|
||||
if (await isSalePrepared(sale)) {
|
||||
await confirmUpdate(() => updatePrice(sale, newPrice));
|
||||
} else updatePrice(sale, newPrice);
|
||||
} else await updatePrice(sale, newPrice);
|
||||
}
|
||||
};
|
||||
const updatePrice = async (sale, newPrice) => {
|
||||
try {
|
||||
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
||||
sale.price = newPrice;
|
||||
edit.value = { ...DEFAULT_EDIT };
|
||||
await axios.post(`Sales/${sale.id}/updatePrice`, {
|
||||
newPrice: newPrice,
|
||||
componentId: componentId.value,
|
||||
});
|
||||
notify('globals.dataSaved', 'positive');
|
||||
resetChanges();
|
||||
} catch (e) {
|
||||
|
@ -327,28 +328,31 @@ const changeDiscount = async (sale) => {
|
|||
const newDiscount = edit.value.discount;
|
||||
if (newDiscount != null && newDiscount != sale.discount) {
|
||||
if (await isSalePrepared(sale))
|
||||
await confirmUpdate(() => updateDiscount([sale], newDiscount));
|
||||
else await updateDiscount([sale], newDiscount);
|
||||
await confirmUpdate(() =>
|
||||
updateDiscount([sale], newDiscount, componentId.value),
|
||||
);
|
||||
else await updateDiscount([sale], newDiscount, componentId.value);
|
||||
}
|
||||
};
|
||||
|
||||
const updateDiscounts = async (sales, newDiscount) => {
|
||||
const updateDiscounts = async (sales, newDiscount, componentId) => {
|
||||
const salesTracking = await fetchSalesTracking();
|
||||
|
||||
const someSaleIsPrepared = salesTracking.some((sale) =>
|
||||
matchSale(salesTracking, sale),
|
||||
);
|
||||
if (someSaleIsPrepared) await confirmUpdate(() => updateDiscount(sales, newDiscount));
|
||||
else updateDiscount(sales, newDiscount);
|
||||
if (someSaleIsPrepared)
|
||||
await confirmUpdate(() => updateDiscount(sales, newDiscount, componentId));
|
||||
else updateDiscount(sales, newDiscount, componentId);
|
||||
};
|
||||
|
||||
const updateDiscount = async (sales, newDiscount = 0) => {
|
||||
const updateDiscount = async (sales, newDiscount, componentId) => {
|
||||
try {
|
||||
const salesIds = sales.map(({ id }) => id);
|
||||
const params = {
|
||||
salesIds,
|
||||
newDiscount,
|
||||
manaCode: manaCode.value,
|
||||
newDiscount: newDiscount ?? 0,
|
||||
componentId,
|
||||
};
|
||||
await axios.post(`Tickets/${route.params.id}/updateDiscount`, params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
|
@ -821,10 +825,11 @@ watch(
|
|||
ref="editPriceProxyRef"
|
||||
:sale="row"
|
||||
:new-price="getNewPrice"
|
||||
v-model:component-id="componentId"
|
||||
@save="changePrice"
|
||||
>
|
||||
<VnInput
|
||||
@keyup.enter.stop="() => editManaProxyRef.save(row)"
|
||||
@keyup.enter.stop="() => editPriceProxyRef.save(row)"
|
||||
v-model.number="edit.price"
|
||||
:label="t('basicData.price')"
|
||||
type="number"
|
||||
|
@ -843,7 +848,7 @@ watch(
|
|||
ref="editManaProxyRef"
|
||||
:sale="row"
|
||||
:new-price="getNewPrice"
|
||||
:mana-code="manaCode"
|
||||
v-model:component-id="componentId"
|
||||
@save="changeDiscount"
|
||||
>
|
||||
<VnInput
|
||||
|
|
|
@ -47,6 +47,7 @@ const { notify } = useNotify();
|
|||
const acl = useAcl();
|
||||
const btnDropdownRef = ref(null);
|
||||
const editManaProxyRef = ref(null);
|
||||
const componentId = ref(null);
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const newDiscount = ref(null);
|
||||
|
@ -112,7 +113,7 @@ const changeMultipleDiscount = () => {
|
|||
});
|
||||
|
||||
if (newDiscount.value != null && hasChanges)
|
||||
emit('updateDiscounts', props.sales, newDiscount.value);
|
||||
emit('updateDiscounts', props.sales, newDiscount.value, componentId.value);
|
||||
btnDropdownRef.value.hide();
|
||||
};
|
||||
|
||||
|
@ -206,6 +207,7 @@ const createRefund = async (withWarehouse) => {
|
|||
ref="editManaProxyRef"
|
||||
:sale="row"
|
||||
@save="changeMultipleDiscount"
|
||||
v-model:component-id="componentId"
|
||||
>
|
||||
<VnInput
|
||||
autofocus
|
||||
|
|
|
@ -14,6 +14,8 @@ import { useState } from 'src/composables/useState';
|
|||
import { toDateFormat } from 'src/filters/date.js';
|
||||
import axios from 'axios';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import { QTable } from 'quasar';
|
||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
|
||||
const state = useState();
|
||||
const { t } = useI18n();
|
||||
|
@ -27,6 +29,16 @@ const selectedTickets = ref([]);
|
|||
const vnTableRef = ref({});
|
||||
const originElRef = ref(null);
|
||||
const destinationElRef = ref(null);
|
||||
const actions = {
|
||||
advance: {
|
||||
title: t('advanceTickets.advanceTickets'),
|
||||
cb: moveTicketsAdvance,
|
||||
},
|
||||
advanceWithoutNegative: {
|
||||
title: t('advanceTickets.advanceTicketsWithoutNegatives'),
|
||||
cb: splitTickets,
|
||||
},
|
||||
};
|
||||
let today = Date.vnNew().toISOString();
|
||||
const tomorrow = new Date(today);
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
|
@ -78,6 +90,15 @@ const ticketColumns = computed(() => [
|
|||
headerClass: 'horizontal-separator',
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
label: t('globals.agency'),
|
||||
name: 'agency',
|
||||
field: 'agency',
|
||||
align: 'left',
|
||||
sortable: true,
|
||||
headerClass: 'horizontal-separator',
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
label: t('advanceTickets.preparation'),
|
||||
name: 'preparation',
|
||||
|
@ -85,7 +106,6 @@ const ticketColumns = computed(() => [
|
|||
align: 'left',
|
||||
sortable: true,
|
||||
headerClass: 'horizontal-separator',
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -110,10 +130,17 @@ const ticketColumns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('advanceTickets.futureId'),
|
||||
name: 'futureId',
|
||||
label: '',
|
||||
name: 'problems',
|
||||
headerClass: 'vertical-separator horizontal-separator',
|
||||
columnClass: 'vertical-separator',
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('advanceTickets.futureId'),
|
||||
name: 'futureId',
|
||||
headerClass: 'horizontal-separator',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -242,7 +269,7 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => {
|
|||
return { query, params };
|
||||
};
|
||||
|
||||
const moveTicketsAdvance = async () => {
|
||||
async function moveTicketsAdvance() {
|
||||
let ticketsToMove = [];
|
||||
for (const ticket of selectedTickets.value) {
|
||||
if (!ticket.id) {
|
||||
|
@ -267,7 +294,7 @@ const moveTicketsAdvance = async () => {
|
|||
vnTableRef.value.reload();
|
||||
selectedTickets.value = [];
|
||||
if (ticketsToMove.length) notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
||||
};
|
||||
}
|
||||
|
||||
const progressLength = ref(0);
|
||||
const progressPercentage = computed(() => {
|
||||
|
@ -290,7 +317,7 @@ const progressAdd = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const splitTickets = async () => {
|
||||
async function splitTickets() {
|
||||
try {
|
||||
showProgressDialog.value = true;
|
||||
for (const ticket of selectedTickets.value) {
|
||||
|
@ -310,7 +337,7 @@ const splitTickets = async () => {
|
|||
} finally {
|
||||
vnTableRef.value.reload();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const resetProgressData = () => {
|
||||
if (cancelProgress.value) cancelProgress.value = false;
|
||||
|
@ -326,6 +353,32 @@ const handleCloseProgressDialog = () => {
|
|||
|
||||
const handleCancelProgress = () => (cancelProgress.value = true);
|
||||
|
||||
const confirmAction = (action) => {
|
||||
openConfirmationModal(actions[action].title, false, actions[action].cb, null, {
|
||||
component: QTable,
|
||||
props: {
|
||||
columns: [
|
||||
{
|
||||
align: 'left',
|
||||
label: t('advanceTickets.destination'),
|
||||
name: 'id',
|
||||
field: (row) => row.id,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('advanceTickets.origin'),
|
||||
name: 'futureId',
|
||||
field: (row) => row.futureId,
|
||||
},
|
||||
],
|
||||
rows: selectedTickets.value,
|
||||
class: 'full-width',
|
||||
dense: true,
|
||||
flat: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => vnTableRef.value.tableRef?.$el,
|
||||
($el) => {
|
||||
|
@ -399,15 +452,7 @@ watch(
|
|||
color="primary"
|
||||
class="q-mr-sm"
|
||||
:disable="!selectedTickets.length"
|
||||
@click.stop="
|
||||
openConfirmationModal(
|
||||
t('advanceTickets.advanceTicketTitle'),
|
||||
t(`advanceTickets.advanceTitleSubtitle`, {
|
||||
selectedTickets: selectedTickets.length,
|
||||
}),
|
||||
moveTicketsAdvance,
|
||||
)
|
||||
"
|
||||
@click.stop="confirmAction('advance')"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('advanceTickets.advanceTickets') }}
|
||||
|
@ -417,15 +462,7 @@ watch(
|
|||
icon="alt_route"
|
||||
color="primary"
|
||||
:disable="!selectedTickets.length"
|
||||
@click.stop="
|
||||
openConfirmationModal(
|
||||
t('advanceTickets.advanceWithoutNegativeTitle'),
|
||||
t(`advanceTickets.advanceWithoutNegativeSubtitle`, {
|
||||
selectedTickets: selectedTickets.length,
|
||||
}),
|
||||
splitTickets,
|
||||
)
|
||||
"
|
||||
@click.stop="confirmAction('advanceWithoutNegative')"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('advanceTickets.advanceTicketsWithoutNegatives') }}
|
||||
|
@ -454,9 +491,9 @@ watch(
|
|||
}"
|
||||
v-model:selected="selectedTickets"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:no-data-label="t('globals.noResults')"
|
||||
:no-data-label="$t('globals.noResults')"
|
||||
:right-search="false"
|
||||
:order="['futureTotalWithVat ASC']"
|
||||
:order="['futureTotalWithVat ASC']"
|
||||
auto-load
|
||||
:disable-option="{ card: true }"
|
||||
>
|
||||
|
@ -522,6 +559,9 @@ watch(
|
|||
{{ toCurrency(row.totalWithVat || 0) }}
|
||||
</QBadge>
|
||||
</template>
|
||||
<template #column-problems="{ row }">
|
||||
<TicketProblems :row="row.problems" :visible-problems="['hasRisk']" />
|
||||
</template>
|
||||
<template #column-futureId="{ row }">
|
||||
<QBtn flat class="link" dense>
|
||||
{{ row.futureId }}
|
||||
|
|
|
@ -10,7 +10,7 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
|
|||
import axios from 'axios';
|
||||
import { onMounted } from 'vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
|
||||
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||
const { t, te } = useI18n();
|
||||
const props = defineProps({
|
||||
dataKey: {
|
||||
|
@ -122,18 +122,20 @@ onMounted(async () => await getItemPackingTypes());
|
|||
<QItemSection>
|
||||
<VnInputNumber
|
||||
v-model="params.scopeDays"
|
||||
:label="t('Days onward')"
|
||||
:label="t('globals.daysOnward')"
|
||||
filled
|
||||
:step="0"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
<VnCheckbox
|
||||
:label="t('params.isFullMovable')"
|
||||
v-model="params.isFullMovable"
|
||||
toggle-indeterminate
|
||||
@update:model-value="searchFn()"
|
||||
dense
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
@ -166,11 +168,12 @@ onMounted(async () => await getItemPackingTypes());
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
<VnCheckbox
|
||||
toggle-indeterminate
|
||||
label="only with destination"
|
||||
:label="t('params.onlyWithDestination')"
|
||||
v-model="params.onlyWithDestination"
|
||||
@update:model-value="searchFn()"
|
||||
dense
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
@ -194,8 +197,8 @@ es:
|
|||
Vertical: Vertical
|
||||
iptInfo: Encajado
|
||||
params:
|
||||
dateFuture: fecha origen
|
||||
dateToAdvance: Fecha destino
|
||||
dateFuture: F. origen
|
||||
dateToAdvance: F. destino
|
||||
futureIpt: IPT Origen
|
||||
ipt: IPT destino
|
||||
isFullMovable: 100% movible
|
||||
|
|
|
@ -18,6 +18,8 @@ import { useState } from 'src/composables/useState';
|
|||
import axios from 'axios';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
import VnInputBic from 'src/components/common/VnInputBic.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const tableRef = ref();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
@ -161,16 +163,6 @@ function generateCodeUser(worker) {
|
|||
|
||||
if (!worker.companyFk) worker.companyFk = user.companyFk;
|
||||
}
|
||||
|
||||
async function autofillBic(worker) {
|
||||
if (!worker || !worker.iban) return;
|
||||
|
||||
let bankEntityId = parseInt(worker.iban.substr(4, 4));
|
||||
let filter = { where: { id: bankEntityId } };
|
||||
|
||||
const { data } = await axios.get(`BankEntities`, { params: { filter } });
|
||||
worker.bankEntityFk = data?.[0]?.id ?? undefined;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -331,20 +323,14 @@ async function autofillBic(worker) {
|
|||
(val) => !val && delete data.payMethodFk
|
||||
"
|
||||
/>
|
||||
<VnInput
|
||||
<VnInputBic
|
||||
:label="t('IBAN')"
|
||||
v-model="data.iban"
|
||||
:label="t('worker.create.iban')"
|
||||
:disable="data.isFreelance"
|
||||
@update:model-value="autofillBic(data)"
|
||||
>
|
||||
<template #append>
|
||||
<QIcon name="info" class="cursor-info">
|
||||
<QTooltip>{{
|
||||
t('components.iban_tooltip')
|
||||
}}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
@update-bic="
|
||||
(bankEntityFk) => (data.bankEntityFk = bankEntityFk)
|
||||
"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelectDialog
|
||||
|
@ -362,7 +348,6 @@ async function autofillBic(worker) {
|
|||
},
|
||||
]"
|
||||
:disable="data.isFreelance"
|
||||
@update:model-value="autofillBic(data)"
|
||||
:filter-options="['bic', 'name']"
|
||||
>
|
||||
<template #form>
|
||||
|
|
|
@ -113,7 +113,7 @@ const ticketCard = {
|
|||
name: 'TicketExpedition',
|
||||
meta: {
|
||||
title: 'expedition',
|
||||
icon: 'vn:package',
|
||||
icon: 'view_in_ar',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketExpedition.vue'),
|
||||
},
|
||||
|
@ -168,7 +168,7 @@ const ticketCard = {
|
|||
name: 'TicketBoxing',
|
||||
meta: {
|
||||
title: 'boxing',
|
||||
icon: 'view_in_ar',
|
||||
icon: 'videocam',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'),
|
||||
},
|
||||
|
|
|
@ -6,7 +6,6 @@ describe('ClaimAction', () => {
|
|||
const destinationRow = '.q-item__section > .q-field';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/claim/${claimId}/action`);
|
||||
});
|
||||
|
|
|
@ -7,7 +7,6 @@ describe('ClaimDevelopment', () => {
|
|||
const newReason = 'Calor';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/claim/${claimId}/development`);
|
||||
cy.waitForElement('tbody');
|
||||
|
|
|
@ -2,7 +2,6 @@ import '../commands.js';
|
|||
|
||||
describe.skip('EntryBasicData', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('buyer');
|
||||
cy.visit(`/#/entry/list`);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import '../commands.js';
|
||||
describe('EntryDescriptor', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('buyer');
|
||||
cy.visit(`/#/entry/list`);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import '../commands.js';
|
||||
describe.skip('EntryDms', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('buyer');
|
||||
cy.visit(`/#/entry/list`);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import '../commands.js';
|
||||
describe('EntryLock', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('buyer');
|
||||
cy.visit(`/#/entry/list`);
|
||||
});
|
||||
|
|
|
@ -2,7 +2,6 @@ import '../commands.js';
|
|||
|
||||
describe('EntryNotes', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('buyer');
|
||||
cy.visit(`/#/entry/list`);
|
||||
});
|
||||
|
|
|
@ -2,7 +2,6 @@ import './commands';
|
|||
|
||||
describe('EntryList', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('buyer');
|
||||
cy.visit(`/#/entry/list`);
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
describe('EntryStockBought', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('buyer');
|
||||
cy.visit(`/#/entry/stock-Bought`);
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
describe('EntrySupplier when is supplier', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('supplier');
|
||||
cy.visit(`/#/entry/my`, {
|
||||
onBeforeLoad(win) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import './commands';
|
||||
describe('EntryDms', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('buyerBoss');
|
||||
cy.visit(`/#/entry/waste-recalc`);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe.skip('InvoiceOut manual invoice', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/ticket/list`);
|
||||
cy.get('#searchbar input').type('{enter}');
|
||||
|
|
|
@ -4,7 +4,6 @@ describe('InvoiceOut negative bases', () => {
|
|||
`:nth-child(1) > [data-col-field="${opt}"] > .no-padding > .link`;
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-out/negative-bases`);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceOut global invoicing', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('administrative');
|
||||
cy.visit(`/#/invoice-out/global-invoicing`);
|
||||
});
|
||||
|
@ -17,7 +16,7 @@ describe('InvoiceOut global invoicing', () => {
|
|||
cy.dataCy('InvoiceOutGlobalPrinterSelect').type('printer1');
|
||||
cy.get('.q-menu .q-item').contains('printer1').click();
|
||||
cy.get(
|
||||
'[label="Invoice date"] > .q-field > .q-field__inner > .q-field__control'
|
||||
'[label="Invoice date"] > .q-field > .q-field__inner > .q-field__control',
|
||||
).click();
|
||||
cy.get(':nth-child(5) > div > .q-btn > .q-btn__content > .block').click();
|
||||
cy.get('.q-date__years-content > :nth-child(2) > .q-btn').click();
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('ItemBarcodes', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/1/barcode`);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('Item botanical', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/1/botanical`);
|
||||
});
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
describe('Item list', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/list`);
|
||||
cy.typeSearchbar('{enter}');
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('Item summary', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/1/summary`);
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
describe('Item tag', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/1/tags`);
|
||||
cy.get('.q-page').should('be.visible');
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('Item tax', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/1/tax`);
|
||||
});
|
||||
|
|
|
@ -6,7 +6,6 @@ describe('Item type', () => {
|
|||
const type = 'Flower';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/item-type`);
|
||||
});
|
||||
|
|
|
@ -6,7 +6,6 @@ describe('OrderList', () => {
|
|||
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/order/list');
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ describe('Agency modes', () => {
|
|||
const name = 'inhouse pickup';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/agency/1/modes`);
|
||||
});
|
||||
|
|
|
@ -13,7 +13,6 @@ describe('AgencyWorkCenter', () => {
|
|||
};
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/agency/11/workCenter`);
|
||||
});
|
||||
|
|
|
@ -24,7 +24,6 @@ describe('Cmr list', () => {
|
|||
};
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit('/#/route/cmr');
|
||||
cy.typeSearchbar('{enter}');
|
||||
|
|
|
@ -27,7 +27,6 @@ describe('RoadMap', () => {
|
|||
const summaryUrl = '/summary';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/roadmap`);
|
||||
cy.typeSearchbar('{enter}');
|
||||
|
|
|
@ -32,7 +32,6 @@ describe('RouteAutonomous', () => {
|
|||
const dataSaved = 'Data saved';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/agency-term`);
|
||||
cy.typeSearchbar('{enter}');
|
||||
|
|
|
@ -75,7 +75,6 @@ describe('Route extended list', () => {
|
|||
}
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(url);
|
||||
cy.typeSearchbar('{enter}');
|
||||
|
|
|
@ -26,8 +26,8 @@ describe('Route', () => {
|
|||
const summaryUrl = '/summary';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit(`/#/route/list`);
|
||||
cy.typeSearchbar('{enter}');
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
describe('Vehicle', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('deliveryAssistant');
|
||||
cy.visit(`/#/route/vehicle/7/summary`);
|
||||
});
|
||||
|
|
|
@ -21,7 +21,6 @@ describe('Vehicle list', () => {
|
|||
const summaryUrl = '/summary';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/vehicle/list`);
|
||||
cy.typeSearchbar('{enter}');
|
||||
|
|
|
@ -10,7 +10,6 @@ describe('Vehicle Notes', () => {
|
|||
const newNoteText = 'probando';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/vehicle/1/notes`);
|
||||
});
|
||||
|
|
|
@ -5,7 +5,6 @@ describe('ParkingList', () => {
|
|||
const summaryHeader = '.header-link';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/shelving/parking/list`);
|
||||
});
|
||||
|
|
|
@ -3,7 +3,6 @@ describe('ShelvingList', () => {
|
|||
const parking =
|
||||
'.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container';
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/shelving/1/basic-data`);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('ShelvingList', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/shelving/list`);
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
describe('Supplier Balance', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/supplier/1/balance`);
|
||||
});
|
||||
|
|
|
@ -9,7 +9,6 @@ describe('Ticket descriptor', () => {
|
|||
const weightValue = '[data-cy="vnLvWeight"]';
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
});
|
||||
|
||||
it('should clone the ticket without warehouse', () => {
|
||||
|
|
|
@ -5,7 +5,6 @@ describe('Ticket expedtion', () => {
|
|||
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
});
|
||||
|
||||
it('should change the state', () => {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
describe('TicketFilter', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/list');
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
describe('TicketList', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/list', false);
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
describe('TicketNotes', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/31/observation');
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
describe('TicketRequest', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/31/request');
|
||||
});
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const firstRow = 'tbody > :nth-child(1)';
|
|||
describe('TicketSale', () => {
|
||||
describe('#23', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('salesBoss');
|
||||
cy.login('claimManager');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/ticket/23/sale');
|
||||
});
|
||||
|
@ -15,6 +15,8 @@ describe('TicketSale', () => {
|
|||
cy.get('[data-col-field="price"]').find('.q-btn').click();
|
||||
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
||||
cy.dataCy('ticketEditManaProxy').should('exist');
|
||||
cy.get('[data-cy="componentOption-37"]').click();
|
||||
|
||||
cy.waitForElement('[data-cy="Price_input"]');
|
||||
cy.dataCy('Price_input').clear().type(price);
|
||||
cy.intercept('POST', /\/api\/Sales\/\d+\/updatePrice/).as('updatePrice');
|
||||
|
@ -33,6 +35,7 @@ describe('TicketSale', () => {
|
|||
cy.get('[data-col-field="discount"]').find('.q-btn').click();
|
||||
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
||||
cy.dataCy('ticketEditManaProxy').should('exist');
|
||||
cy.get('[data-cy="componentOption-37"]').click();
|
||||
cy.waitForElement('[data-cy="Disc_input"]');
|
||||
cy.dataCy('Disc_input').clear().type(discount);
|
||||
cy.intercept('POST', /\/api\/Tickets\/\d+\/updateDiscount/).as(
|
||||
|
@ -83,8 +86,7 @@ describe('TicketSale', () => {
|
|||
});
|
||||
describe('#24 add claim', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('salesPerson');
|
||||
cy.visit('/#/ticket/24/sale');
|
||||
});
|
||||
|
||||
|
@ -102,8 +104,7 @@ describe('TicketSale', () => {
|
|||
});
|
||||
describe('#31 free ticket', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('claimManager');
|
||||
cy.visit('/#/ticket/31/sale');
|
||||
});
|
||||
|
||||
|
@ -139,14 +140,15 @@ describe('TicketSale', () => {
|
|||
cy.dataCy('ticketSaleMoreActionsDropdown').should('be.disabled');
|
||||
});
|
||||
|
||||
it.only('should update discount when "Update discount" is clicked', () => {
|
||||
it('should update discount when "Update discount" is clicked', () => {
|
||||
const discount = Number((Math.random() * 99 + 1).toFixed(2));
|
||||
|
||||
selectFirstRow();
|
||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
||||
cy.waitForElement('[data-cy="updateDiscountItem"]');
|
||||
cy.dataCy('updateDiscountItem').should('exist');
|
||||
cy.dataCy('updateDiscountItem').click();
|
||||
cy.waitForElement('[data-cy="componentOption-37"]');
|
||||
cy.get('[data-cy="componentOption-37"]').click();
|
||||
cy.waitForElement('[data-cy="ticketSaleDiscountInput"]');
|
||||
cy.dataCy('ticketSaleDiscountInput').find('input').focus();
|
||||
cy.intercept('POST', /\/api\/Tickets\/\d+\/updateDiscount/).as(
|
||||
|
@ -191,8 +193,7 @@ describe('TicketSale', () => {
|
|||
});
|
||||
describe('#32 transfer', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('salesPerson');
|
||||
cy.visit('/#/ticket/32/sale');
|
||||
});
|
||||
it('transfer sale to a new ticket', () => {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
describe('VnBreadcrumbs', () => {
|
||||
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit('/');
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
describe('WagonTypeCreate', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit('/#/wagon/type/list');
|
||||
cy.waitForElement('.q-page', 6000);
|
||||
|
|
|
@ -2,7 +2,6 @@ describe('WagonTypeEdit', () => {
|
|||
const trayColorRow =
|
||||
'.q-select > .q-field__inner > .q-field__control > .q-field__control-container';
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit('/#/wagon/type/1/edit');
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@ describe('WorkerPit', () => {
|
|||
const savePIT = '#st-actions > .q-btn-group > .q-btn--standard';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/worker/1107/pit`);
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@ describe('ZoneDeliveryDays', () => {
|
|||
const submitForm = '.q-form > .q-btn > .q-btn__content';
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit(`/#/zone/delivery-days`);
|
||||
});
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ describe('ZoneUpcomingDeliveries', () => {
|
|||
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit(`/#/zone/upcoming-deliveries`);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue