feat: refs #8828 add warehouse filtering for tickets and travels #1678

Open
benjaminedc wants to merge 30 commits from 8828-filterVnSelectWarehouses into dev
74 changed files with 156 additions and 236 deletions
Showing only changes of commit 8ea4163f05 - Show all commits

View File

@ -20,12 +20,12 @@ const autofillBic = async (iban) => {
if (ibanCountry != 'ES') return;
const filter = { where: { id: bankEntityId.value } };
const filter = { where: { id: bankEntityId } };
const params = { filter: JSON.stringify(filter) };
const { data } = await axios.get(`BankEntities`, { params });
emit('updateBic', data[0].id);
emit('updateBic', data[0]?.id);
};
</script>
<template>

View File

@ -68,7 +68,6 @@ const filter = {
},
},
],
where: { and: [{ originFk: route.params.id }] },
};
const paginate = ref();
@ -267,13 +266,6 @@ onMounted(() => {
onUnmounted(() => {
stateStore.rightDrawer = false;
});
watch(
() => router.currentRoute.value.params.id,
() => {
applyFilter();
},
);
</script>
<template>
<VnPaginate
@ -281,6 +273,7 @@ watch(
:data-key
:url="dataKey + 's'"
:user-filter="filter"
:filter="{ where: { and: [{ originFk: route.params.id }] } }"
:skeleton="false"
auto-load
@on-fetch="setLogTree"

View File

@ -39,7 +39,7 @@ const checkboxOptions = ref([
{ name: 'select', label: 'Accesses', selected: false },
]);
const columns = computed(() => [
{ name: 'changedModelValue' },
{ name: 'changedModelValue', orderBy: 'id' },
{ name: 'changedModel' },
{ name: 'userType', orderBy: false },
{ name: 'userFk' },

View File

@ -6,6 +6,7 @@ import { computed } from 'vue';
const $props = defineProps({
label: { type: String, default: null },
tooltip: { type: String, default: null },
value: {
type: [String, Boolean, Number],
default: null,
@ -40,7 +41,10 @@ const val = computed(() => $props.value);
<template v-else>
<div v-if="label || $slots.label" class="label">
<slot name="label">
<span style="color: var(--vn-label-color)">{{ label }}</span>
<QTooltip v-if="tooltip">{{ tooltip }}</QTooltip>
<span style="color: var(--vn-label-color)">
{{ label }}
</span>
</slot>
</div>
<div class="value" v-if="value || $slots.value">

View File

@ -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>

View File

@ -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;
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -131,6 +131,7 @@ const columns = computed(() => [
name: 'isConciliate',
label: t('Conciliated'),
cardVisible: true,
component: 'checkbox',
},
{
align: 'left',

View File

@ -18,7 +18,7 @@ import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
const arrayData = useArrayData('Client');
const arrayData = useArrayData('Customer');
const { t } = useI18n();
const route = useRoute();
const campaignList = ref();
@ -260,7 +260,7 @@ const updateDateParams = (value, params) => {
:label="t('globals.campaign')"
:filled="true"
class="q-px-sm q-pt-none fit"
:option-label="(opt) => t(opt.code)"
:option-label="(opt) => t(opt.code ?? '')"
:fields="['id', 'code', 'dated', 'scopeDays']"
@update:model-value="(data) => updateDateParams(data, params)"
dense

View File

@ -34,7 +34,7 @@ const columns = computed(() => [
},
{
align: 'left',
format: (row) => row.type.description,
format: (row) => row?.type?.description,
label: t('Description'),
name: 'description',
},

View File

@ -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" />
@ -208,7 +208,8 @@ const sumRisk = ({ clientRisks }) => {
:text="t('customer.summary.consignee')"
/>
<VnLv
:label="t('customer.summary.addressName')"
:tooltip="t('customer.summary.addressName')"
:label="t('customer.summary.addressNameAbbr')"
:value="entity.defaultAddress.nickname"
/>
<VnLv
@ -252,7 +253,8 @@ const sumRisk = ({ clientRisks }) => {
/>
<VnLv
v-if="entity.claimsRatio"
:label="t('customer.summary.priceIncreasingRate')"
:tooltip="t('customer.summary.priceIncreasingRate')"
:label="t('customer.summary.priceIncreasingRateAbbr')"
:value="toPercentage(priceIncreasingRate)"
/>
<VnLv
@ -261,7 +263,8 @@ const sumRisk = ({ clientRisks }) => {
/>
<VnLv
v-if="entity.claimsRatio"
:label="t('customer.summary.claimRate')"
:label="t('customer.summary.claimRateAbbr')"
:tooltip="t('customer.summary.claimRate')"
:value="toPercentage(claimRate)"
/>
</QCard>
@ -318,8 +321,9 @@ const sumRisk = ({ clientRisks }) => {
/>
<VnLv
:label="t('customer.summary.recommendCredit')"
:value="entity.recommendedCredit"
:label="t('customer.summary.recommendCreditAbbr')"
:tooltip="t('customer.summary.recommendCredit')"
:value="toCurrency(entity.recommendedCredit)"
/>
</QCard>
<QCard class="vn-max">

View File

@ -111,14 +111,11 @@ const columns = computed(() => [
component: 'number',
},
columnField: {
component: null,
after: {
component: markRaw(VnLinkPhone),
attrs: ({ model }) => {
return {
'phone-number': model,
};
},
component: markRaw(VnLinkPhone),
attrs: ({ model }) => {
return {
'phone-number': model,
};
},
},
},

View File

@ -42,14 +42,17 @@ customer:
hasCoreVnl: Has core VNL
hasB2BVnl: Has B2B VNL
addressName: Address name
addressNameAbbr: A. Name
addressCity: City
username: Username
webAccess: Web access
totalGreuge: Total greuge
mana: Mana
priceIncreasingRate: Price increasing rate
priceIncreasingRateAbbr: Price inc. rate
averageInvoiced: Average invoiced
claimRate: Claming rate
claimRateAbbr: Claim. rate
payMethodFk: Billing data
risk: Risk
maximumRisk: Solunion's maximum risk
@ -68,6 +71,7 @@ customer:
descriptorInfo: Invoices minus payments plus orders not yet
rating: Rating
recommendCredit: Recommended credit
recommendCreditAbbr: Rec. credit
goToLines: Go to lines
basicData:
socialName: Fiscal name

View File

@ -42,14 +42,17 @@ customer:
hasCoreVnl: Recibido core VNL
hasB2BVnl: Recibido B2B VNL
addressName: Nombre de la dirección
addressNameAbbr: N. Dirección
addressCity: Ciudad
username: Usuario
webAccess: Acceso web
totalGreuge: Greuge total
mana: Maná
priceIncreasingRate: Ratio de incremento de precio
priceIncreasingRateAbbr: R. Inc. Precio
averageInvoiced: Facturación media
claimRate: Ratio de reclamaciones
claimRateAbbr: R. Reclamaciones
maximumRisk: Riesgo máximo asumido por Solunion
payMethodFk: Forma de pago
risk: Riesgo
@ -68,6 +71,7 @@ customer:
descriptorInfo: Facturas menos recibos mas pedidos sin facturar
rating: Clasificación
recommendCredit: Crédito recomendado
recommendCreditAbbr: Cr. Recomendado
goToLines: Ir a líneas
basicData:
socialName: Nombre fiscal

View File

@ -141,7 +141,7 @@ const setOrderedPriority = async () => {
};
const sortRoutes = async () => {
await axios.patch(`Routes/${route.params?.id}/guessPriority/`);
await axios.patch(`Routes/${route.params?.id}/optimizePriority`);
refreshKey.value++;
};

View File

@ -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>

View File

@ -38,7 +38,9 @@ function handleDelete(row) {
ticketNotesCrudRef.value.remove([row]);
}
async function handleSave() {
async function handleSave(e) {
if (e.shiftKey && e.key === 'Enter') return;
e.preventDefault();
if (!isSaving.value) {
isSaving.value = true;
await ticketNotesCrudRef.value?.saveChanges();
@ -70,7 +72,7 @@ async function handleSave() {
<div
v-for="(row, index) in rows"
:key="index"
class="q-mb-md row items-center q-gutter-x-md"
class="q-mb-md row q-gutter-x-md"
>
<VnSelect
:label="t('ticketNotes.observationType')"
@ -86,7 +88,8 @@ async function handleSave() {
:label="t('basicData.description')"
v-model="row.description"
class="col"
@keyup.enter="handleSave"
@keydown.enter.stop="handleSave"
autogrow
data-cy="ticketNotesDescription"
/>
<QIcon

View File

@ -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

View File

@ -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

View File

@ -241,6 +241,7 @@ onMounted(async () => {
:value="`${entity.address?.nickname} #${entity.address?.id}`"
/>
<VnLv
class="white-space-normal"
:label="t('ticket.summary.consigneeStreet')"
:value="formattedAddress"
/>
@ -524,4 +525,7 @@ onMounted(async () => {
.grafana {
color: $primary-light;
}
.white-space-normal :deep(.value span) {
white-space: normal;
}
</style>

View File

@ -282,6 +282,7 @@ en:
orderFk: Order
from: From
shipped: Shipped
shippedDate: Shipped date
to: To
stateFk: State
groupedStates: Grouped State
@ -309,6 +310,7 @@ es:
orderFk: Pedido
from: Desde
shipped: F. envío
shippedDate: F. envío
to: Hasta
stateFk: Estado
groupedStates: Estado agrupado

View File

@ -113,13 +113,13 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'shippedDate',
name: 'shipped',
cardVisible: true,
label: t('ticketList.shipped'),
columnFilter: {
component: 'date',
},
format: ({ shippedDate }) => toDate(shippedDate),
format: ({ shipped }) => toDate(shipped),
},
{
align: 'left',
@ -482,7 +482,7 @@ function setReference(data) {
prefix="card"
:array-data-props="{
url: 'Tickets/filter',
order: ['shippedDate DESC', 'shippedHour ASC', 'zoneLanding ASC', 'id'],
order: ['shipped DESC', 'shippedHour ASC', 'zoneLanding ASC', 'id'],
exprBuilder,
}"
>
@ -520,10 +520,10 @@ function setReference(data) {
<DepartmentDescriptorProxy :id="row.departmentFk" />
</span>
</template>
<template #column-shippedDate="{ row }">
<template #column-shipped="{ row }">
<span v-if="getDateColor(row.shipped)">
<QChip :class="getDateColor(row.shipped)" dense square>
{{ toDate(row.shippedDate) }}
{{ toDate(row.shipped) }}
</QChip>
</span>
</template>

View File

@ -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'),
},

View File

@ -6,7 +6,6 @@ describe.skip('ClaimAction', () => {
const destinationRow = '.q-item__section > .q-field';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/action`);
});

View File

@ -7,7 +7,6 @@ describe.skip('ClaimDevelopment', () => {
const newReason = 'Calor';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
cy.waitForElement('tbody');

View File

@ -2,7 +2,6 @@ import '../commands.js';
describe('EntryBasicData', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
cy.visit(`/#/entry/list`);
});

View File

@ -1,7 +1,6 @@
import '../commands.js';
describe('EntryDescriptor', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
cy.visit(`/#/entry/list`);
});

View File

@ -1,7 +1,6 @@
import '../commands.js';
describe('EntryDms', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
cy.visit(`/#/entry/list`);
});

View File

@ -1,7 +1,6 @@
import '../commands.js';
describe('EntryLock', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
cy.visit(`/#/entry/list`);
});

View File

@ -2,7 +2,6 @@ import '../commands.js';
describe('EntryNotes', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
cy.visit(`/#/entry/list`);
});

View File

@ -2,7 +2,6 @@ import './commands';
describe('EntryList', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
cy.visit(`/#/entry/list`);
});

View File

@ -1,6 +1,5 @@
describe('EntryStockBought', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
cy.visit(`/#/entry/stock-Bought`);
});

View File

@ -1,6 +1,5 @@
describe('EntrySupplier when is supplier', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('supplier');
cy.visit(`/#/entry/my`, {
onBeforeLoad(win) {

View File

@ -1,7 +1,6 @@
import './commands';
describe('EntryDms', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyerBoss');
cy.visit(`/#/entry/waste-recalc`);
});

View File

@ -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}');

View File

@ -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`);
});

View File

@ -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();

View File

@ -1,7 +1,6 @@
/// <reference types="cypress" />
describe('ItemBarcodes', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/1/barcode`);
});

View File

@ -1,7 +1,6 @@
/// <reference types="cypress" />
describe('Item botanical', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/1/botanical`);
});

View File

@ -2,7 +2,6 @@
describe.skip('Item list', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/list`);
cy.typeSearchbar('{enter}');

View File

@ -1,7 +1,6 @@
/// <reference types="cypress" />
describe('Item summary', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/1/summary`);
});

View File

@ -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');

View File

@ -1,7 +1,6 @@
/// <reference types="cypress" />
describe('Item tax', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/1/tax`);
});

View File

@ -6,7 +6,6 @@ describe('Item type', () => {
const type = 'Flower';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/item-type`);
});

View File

@ -6,7 +6,6 @@ describe('OrderList', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/order/list');
});

View File

@ -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`);
});

View File

@ -13,7 +13,6 @@ describe('AgencyWorkCenter', () => {
};
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/agency/11/workCenter`);
});

View File

@ -24,7 +24,6 @@ describe('Cmr list', () => {
};
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit('/#/route/cmr');
cy.typeSearchbar('{enter}');

View File

@ -27,7 +27,6 @@ describe('RoadMap', () => {
const summaryUrl = '/summary';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/roadmap`);
cy.typeSearchbar('{enter}');

View File

@ -32,7 +32,6 @@ describe.skip('RouteAutonomous', () => {
const dataSaved = 'Data saved';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/agency-term`);
cy.typeSearchbar('{enter}');

View File

@ -75,7 +75,6 @@ describe.skip('Route extended list', () => {
}
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(url);
cy.typeSearchbar('{enter}');

View File

@ -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}');
});

View File

@ -1,6 +1,5 @@
describe('Vehicle', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('deliveryAssistant');
cy.visit(`/#/route/vehicle/7/summary`);
});

View File

@ -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}');

View File

@ -10,7 +10,6 @@ describe('Vehicle Notes', () => {
const newNoteText = 'probando';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/vehicle/1/notes`);
});

View File

@ -5,7 +5,6 @@ describe('ParkingList', () => {
const summaryHeader = '.header-link';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/shelving/parking/list`);
});

View File

@ -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`);
});

View File

@ -1,7 +1,6 @@
/// <reference types="cypress" />
describe('ShelvingList', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/shelving/list`);
});

View File

@ -1,6 +1,5 @@
describe('Supplier Balance', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/supplier/1/balance`);
});

View File

@ -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', () => {

View File

@ -5,7 +5,6 @@ describe('Ticket expedtion', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
});
it('should change the state', () => {

View File

@ -2,7 +2,6 @@
describe('TicketFilter', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/ticket/list');
});

View File

@ -2,7 +2,6 @@
describe('TicketList', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/ticket/list', false);
});

View File

@ -2,7 +2,6 @@
describe('TicketNotes', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/ticket/31/observation');
});

View File

@ -2,7 +2,6 @@
describe('TicketRequest', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/ticket/31/request');
});

View File

@ -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', () => {

View File

@ -2,7 +2,6 @@
describe('VnBreadcrumbs', () => {
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit('/');
});

View File

@ -1,6 +1,5 @@
describe('WagonTypeCreate', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit('/#/wagon/type/list');
cy.waitForElement('.q-page', 6000);

View File

@ -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');
});

View File

@ -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`);
});

View File

@ -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`);
});

View File

@ -4,7 +4,6 @@ describe('ZoneUpcomingDeliveries', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit(`/#/zone/upcoming-deliveries`);
});