($props.useLike ? { like: `%${val}%` } : val);
.q-field--outlined {
max-width: 100%;
}
+.q-field__inner {
+ .q-field__control {
+ min-height: auto !important;
+
+ display: flex;
+ align-items: flex-end;
+ .q-field__native.row {
+ min-height: auto !important;
+ }
+ }
+}
diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue
index ef07b7bef..43d634ad9 100644
--- a/src/components/ui/VnFilterPanel.vue
+++ b/src/components/ui/VnFilterPanel.vue
@@ -3,7 +3,6 @@ import { onMounted, ref, computed, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useArrayData } from 'composables/useArrayData';
import { useRoute } from 'vue-router';
-import { date } from 'quasar';
import toDate from 'filters/toDate';
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
@@ -59,7 +58,6 @@ const $props = defineProps({
});
defineExpose({ search, sanitizer });
-
const emit = defineEmits([
'update:modelValue',
'refresh',
@@ -114,9 +112,9 @@ watch(
);
const isLoading = ref(false);
-async function search() {
+async function search(evt) {
try {
- if ($props.disableSubmitEvent) return;
+ if (evt && $props.disableSubmitEvent) return;
store.filter.where = {};
isLoading.value = true;
@@ -167,7 +165,7 @@ const tagsList = computed(() => {
for (const key of Object.keys(userParams.value)) {
const value = userParams.value[key];
if (value == null || ($props.hiddenTags || []).includes(key)) continue;
- tagList.push({ label: aliasField(key), value });
+ tagList.push({ label: key, value });
}
return tagList;
});
@@ -187,7 +185,6 @@ async function remove(key) {
}
function formatValue(value) {
- if (value instanceof Date) return date.formatDate(value, 'DD/MM/YYYY');
if (typeof value === 'boolean') return value ? t('Yes') : t('No');
if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value);
@@ -203,11 +200,6 @@ function sanitizer(params) {
}
return params;
}
-
-function aliasField(field) {
- const split = field.split('.');
- return split[1] ?? split[0];
-}
@@ -219,7 +211,7 @@ function aliasField(field) {
icon="search"
@click="search()"
>
-
+
diff --git a/src/components/ui/VnRow.vue b/src/components/ui/VnRow.vue
index 16bcfab7d..0df1fb7d4 100644
--- a/src/components/ui/VnRow.vue
+++ b/src/components/ui/VnRow.vue
@@ -9,6 +9,7 @@ defineProps({ wrap: { type: Boolean, default: false } });
diff --git a/src/pages/Entry/MyEntries.vue b/src/pages/Entry/MyEntries.vue
index 1c56427f4..2c37c2c42 100644
--- a/src/pages/Entry/MyEntries.vue
+++ b/src/pages/Entry/MyEntries.vue
@@ -9,22 +9,27 @@ import VnTable from 'components/VnTable/VnTable.vue';
const { t } = useI18n();
const quasar = useQuasar();
+const params = {
+ daysOnward: 7,
+ daysAgo: 3,
+};
+
const columns = computed(() => [
{
align: 'left',
name: 'id',
- label: t('customer.extendedList.tableVisibleColumns.id'),
+ label: t('myEntries.id'),
columnFilter: false,
isTitle: true,
},
{
visible: false,
align: 'right',
- label: t('shipped'),
+ label: t('myEntries.shipped'),
name: 'shipped',
columnFilter: {
name: 'fromShipped',
- label: t('fromShipped'),
+ label: t('myEntries.fromShipped'),
component: 'date',
},
format: ({ shipped }) => toDate(shipped),
@@ -32,11 +37,11 @@ const columns = computed(() => [
{
visible: false,
align: 'left',
- label: t('shipped'),
+ label: t('myEntries.shipped'),
name: 'shipped',
columnFilter: {
name: 'toShipped',
- label: t('toShipped'),
+ label: t('myEntries.toShipped'),
component: 'date',
},
format: ({ shipped }) => toDate(shipped),
@@ -44,14 +49,14 @@ const columns = computed(() => [
},
{
align: 'right',
- label: t('shipped'),
+ label: t('myEntries.shipped'),
name: 'shipped',
columnFilter: false,
format: ({ shipped }) => toDate(shipped),
},
{
align: 'right',
- label: t('landed'),
+ label: t('myEntries.landed'),
name: 'landed',
columnFilter: false,
format: ({ landed }) => toDate(landed),
@@ -59,26 +64,36 @@ const columns = computed(() => [
{
align: 'right',
- label: t('globals.wareHouseIn'),
+ label: t('myEntries.wareHouseIn'),
name: 'warehouseInFk',
- format: (row) => row.warehouseInName,
+ format: (row) => {
+ row.warehouseInName;
+ },
cardVisible: true,
columnFilter: {
+ name: 'warehouseInFk',
+ label: t('myEntries.warehouseInFk'),
component: 'select',
attrs: {
url: 'warehouses',
fields: ['id', 'name'],
optionLabel: 'name',
optionValue: 'id',
+ alias: 't',
},
- alias: 't',
inWhere: true,
},
},
{
align: 'left',
- label: t('globals.daysOnward'),
- name: 'days',
+ label: t('myEntries.daysOnward'),
+ name: 'daysOnward',
+ visible: false,
+ },
+ {
+ align: 'left',
+ label: t('myEntries.daysAgo'),
+ name: 'daysAgo',
visible: false,
},
{
@@ -88,6 +103,7 @@ const columns = computed(() => [
{
title: t('printLabels'),
icon: 'print',
+ isPrimary: true,
action: (row) => printBuys(row.id),
},
],
@@ -114,9 +130,11 @@ const printBuys = (rowId) => {
data-key="myEntriesList"
url="Entries/filter"
:columns="columns"
+ :user-params="params"
default-mode="card"
order="shipped DESC"
auto-load
+ chip-locale="myEntries"
/>
diff --git a/src/pages/Entry/locale/en.yml b/src/pages/Entry/locale/en.yml
index a9faa814b..b4d7c33bc 100644
--- a/src/pages/Entry/locale/en.yml
+++ b/src/pages/Entry/locale/en.yml
@@ -6,9 +6,15 @@ entryFilter:
filter:
search: General search
reference: Reference
-landed: Landed
-shipped: Shipped
-fromShipped: Shipped(from)
-toShipped: Shipped(to)
-printLabels: Print stickers
-viewLabel: View sticker
+myEntries:
+ id: ID
+ landed: Landed
+ shipped: Shipped
+ fromShipped: Shipped(from)
+ toShipped: Shipped(to)
+ printLabels: Print stickers
+ viewLabel: View sticker
+ wareHouseIn: Warehouse in
+ warehouseInFk: Warehouse in
+ daysOnward: Days onward
+ daysAgo: Days ago
diff --git a/src/pages/Entry/locale/es.yml b/src/pages/Entry/locale/es.yml
index eb1e3f88a..2dfd601b1 100644
--- a/src/pages/Entry/locale/es.yml
+++ b/src/pages/Entry/locale/es.yml
@@ -9,10 +9,15 @@ entryFilter:
filter:
search: Búsqueda general
reference: Referencia
-
-landed: F. llegada
-shipped: F. salida
-fromShipped: F. salida(desde)
-toShipped: F. salida(hasta)
-printLabels: Imprimir etiquetas
-viewLabel: Ver etiqueta
+myEntries:
+ id: ID
+ landed: F. llegada
+ shipped: F. salida
+ fromShipped: F. salida(desde)
+ toShipped: F. salida(hasta)
+ printLabels: Imprimir etiquetas
+ viewLabel: Ver etiqueta
+ wareHouseIn: Alm. entrada
+ warehouseInFk: Alm. entrada
+ daysOnward: Días adelante
+ daysAgo: Días atras
diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue
index 5157d957b..3dc565251 100644
--- a/src/pages/InvoiceOut/InvoiceOutList.vue
+++ b/src/pages/InvoiceOut/InvoiceOutList.vue
@@ -27,13 +27,16 @@ const { openReport } = usePrintService();
const columns = computed(() => [
{
- align: 'left',
+ align: 'center',
name: 'id',
label: t('invoiceOutList.tableVisibleColumns.id'),
chip: {
condition: () => true,
},
isId: true,
+ columnFilter: {
+ name: 'search',
+ },
},
{
align: 'left',
diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue
index 774b42478..1ea19033c 100644
--- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue
+++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue
@@ -9,6 +9,7 @@ import { useArrayData } from 'src/composables/useArrayData';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
+import VnInputDate from 'components/common/VnInputDate.vue';
const { t } = useI18n();
const tableRef = ref();
@@ -64,7 +65,8 @@ const columns = computed(() => [
cardVisible: true,
attrs: {
url: 'Clients',
- fields: ['id', 'name'],
+ optionLabel: 'socialName',
+ optionValue: 'socialName',
},
columnField: {
component: null,
@@ -192,10 +194,33 @@ const downloadCSV = async () => {
+
+
+
+
es:
Download as CSV: Descargar como CSV
+ params:
+ from: Desde
+ to: Hasta
+en:
+ params:
+ from: From
+ to: To
diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue
index 2158065bd..7d4d6b896 100644
--- a/src/pages/Item/ItemFixedPrice.vue
+++ b/src/pages/Item/ItemFixedPrice.vue
@@ -514,7 +514,7 @@ function handleOnDataSave({ CrudModelRef }) {
-
+
{
try {
const params = { ticketId: ticket.value.id, sales: props.sales };
const { data } = await axios.post(`Claims/createFromSales`, params);
- router.push({ name: 'ClaimBasicData', params: { id: data.id } });
+ push({ name: 'ClaimBasicData', params: { id: data.id } });
} catch (error) {
console.error('Error creating claim: ', error);
}
@@ -169,7 +169,7 @@ const createRefund = async (withWarehouse) => {
const { data } = await axios.post('Tickets/cloneAll', params);
const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
- router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
+ push({ name: 'TicketSale', params: { id: refundTicket.id } });
} catch (error) {
console.error(error);
}
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index b6a60122c..2ca0b5727 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -1,7 +1,7 @@
+
+
+ (states = data)" auto-load />
+
+
+
+ {{ t(`params.${tag.label}`) }}:
+ {{ formatFn(tag.value) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ travel:
+ Id: Contains
+ ref: Reference
+ agency: Agency
+ warehouseInFk: W. In
+ shipped: Shipped
+ shipmentHour: Shipment Hour
+ warehouseOut: W. Out
+ landed: Landed
+ landingHour: Landing Hour
+ totalEntries: Σ
+es:
+ travel:
+ Id: Id
+ ref: Referencia
+ agency: Agencia
+ warehouseInFk: Alm.Salida
+ shipped: F.Envío
+ shipmentHour: Hora de envío
+ warehouseOut: Alm.Entrada
+ landed: F.Entrega
+ landingHour: Hora de entrega
+ totalEntries: Σ
+
diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue
index e56f5d2ff..05d2e5eda 100644
--- a/src/pages/Travel/TravelList.vue
+++ b/src/pages/Travel/TravelList.vue
@@ -9,6 +9,8 @@ import TravelSummary from './Card/TravelSummary.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { toDate } from 'src/filters';
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
+import RightMenu from 'src/components/common/RightMenu.vue';
+import TravelFilter from './TravelFilter.vue';
const { viewSummary } = useSummaryDialog();
const router = useRouter();
@@ -24,6 +26,7 @@ const $props = defineProps({
});
const entityId = computed(() => $props.id || route.params.id);
+const travelFilterRef = ref();
onMounted(async () => {
stateStore.rightDrawer = true;
});
@@ -201,6 +204,11 @@ const columns = computed(() => [
:label="t('Search travel')"
data-key="TravelList"
/>
+
+
+
+
+
[
editorFk: entityId,
},
}"
+ :right-search="false"
:user-params="{ daysOnward: 7 }"
order="landed DESC"
:columns="columns"
@@ -220,7 +229,6 @@ const columns = computed(() => [
redirect="travel"
:is-editable="false"
:use-model="true"
- chip-locale="travel.travelList.tableVisibleColumns"
>
@@ -262,6 +263,7 @@ async function autofillBic(worker) {
handleLocation(data, location)"
diff --git a/src/pages/Zone/Card/ZoneEventExclusionForm.vue b/src/pages/Zone/Card/ZoneEventExclusionForm.vue
index 0ba2e640a..215c12f46 100644
--- a/src/pages/Zone/Card/ZoneEventExclusionForm.vue
+++ b/src/pages/Zone/Card/ZoneEventExclusionForm.vue
@@ -154,7 +154,7 @@ onMounted(() => {
(stateStore.rightDrawer = false));
-
-
-
-
-
- {{ t('globals.collapseMenu') }}
-
-
-
-
-
import { onMounted, ref, computed, watch, onUnmounted } from 'vue';
import { useRoute } from 'vue-router';
-
+import VnInput from 'src/components/common/VnInput.vue';
import { useState } from 'src/composables/useState';
import axios from 'axios';
import { useArrayData } from 'composables/useArrayData';
@@ -144,7 +144,8 @@ watch(storeData, async (val) => {
});
const reFetch = async () => {
- await arrayData.fetch({ append: false });
+ const { data } = await arrayData.fetch({ append: false });
+ nodes.value = data;
};
onMounted(async () => {
@@ -182,6 +183,16 @@ onUnmounted(() => {
+
+
+
+
+
+describe('UserPanel', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#dashboard`);
+ cy.waitForElement('.q-page', 6000);
+ });
+
+ it('should notify when update user warehouse', () => {
+ const userWarehouse =
+ '.q-menu .q-gutter-xs > :nth-child(3) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input';
+
+ // Abro el panel
+ cy.openUserPanel();
+
+ // Compruebo la opcion inicial
+ cy.get(userWarehouse).should('have.value', 'VNL').click();
+
+ // Actualizo la opción
+ getOption(3);
+
+ //Compruebo la notificación
+ cy.get('.q-notification').should('be.visible');
+ cy.get(userWarehouse).should('have.value', 'VNH');
+
+ //Restauro el valor
+ cy.get(userWarehouse).click();
+ getOption(2);
+ });
+ it('should notify when update user company', () => {
+ const userCompany =
+ '.q-menu .q-gutter-xs > :nth-child(2) > .q-field--float > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input';
+
+ // Abro el panel
+ cy.openUserPanel();
+
+ // Compruebo la opcion inicial
+ cy.get(userCompany).should('have.value', 'Warehouse One').click();
+
+ //Actualizo la opción
+ getOption(2);
+
+ //Compruebo la notificación
+ cy.get('.q-notification').should('be.visible');
+ cy.get(userCompany).should('have.value', 'Warehouse Two');
+
+ //Restauro el valor
+ cy.get(userCompany).click();
+ getOption(1);
+ });
+});
+
+function getOption(index) {
+ cy.waitForElement('[role="listbox"]');
+ const option = `[role="listbox"] .q-item:nth-child(${index})`;
+ cy.get(option).click();
+}
diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js
index 1872d3591..78dc38899 100644
--- a/test/cypress/integration/vnComponent/vnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/vnLocation.spec.js
@@ -3,25 +3,90 @@ describe('VnLocation', () => {
const dialogInputs = '.q-dialog label input';
const createLocationButton = '.q-form > .q-card > .vn-row:nth-child(6) .--add-icon';
const inputLocation = '.q-form input[aria-label="Location"]';
+ const createForm = {
+ prefix: '.q-dialog__inner > .column > #formModel > .q-card',
+ sufix: ' .q-field__inner > .q-field__control',
+ };
+ describe('CreateFormDialog ', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
+ cy.waitForElement('.q-card');
+ cy.get(createLocationButton).click();
+ });
+ it('should filter provinces based on selected country', () => {
+ // Select a country
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
+ 'Ecuador'
+ );
+ // Verify that provinces are filtered
+ cy.get(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
+ ).should('have.length', 1);
+
+ // Verify that towns are filtered
+ cy.get(
+ `${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
+ ).should('have.length', 1);
+ });
+
+ it('should filter towns based on selected province', () => {
+ // Select a country
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`,
+ 'Ecuador'
+ );
+ // Verify that provinces are filtered
+ cy.get(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
+ ).should('have.length', 1);
+
+ // Verify that towns are filtered
+ cy.get(
+ `${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
+ ).should('have.length', 1);
+ });
+ it('should pass selected country', () => {
+ // Select a country
+ const country = 'Ecuador';
+ const province = 'Province five';
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
+ country
+ );
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
+ province
+ );
+ cy.get(
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon`
+ ).click();
+ cy.get(
+ `#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
+ ).should('have.value', province);
+ });
+ });
describe('Worker Create', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/worker/create', { timeout: 5000 });
cy.waitForElement('.q-card');
+ cy.get(inputLocation).click();
});
it('Show all options', function () {
- cy.get(inputLocation).click();
cy.get(locationOptions).should('have.length.at.least', 5);
});
it('input filter location as "al"', function () {
- cy.get(inputLocation).click();
+ // cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('al');
cy.get(locationOptions).should('have.length.at.least', 4);
});
it('input filter location as "ecuador"', function () {
- cy.get(inputLocation).click();
+ // cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('ecuador');
cy.get(locationOptions).should('have.length.at.least', 1);
@@ -63,13 +128,11 @@ describe('VnLocation', () => {
cy.get(dialogInputs).eq(0).clear();
cy.get(dialogInputs).eq(0).type(postCode);
cy.selectOption(
- '.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > .q-select > .q-field__inner > .q-field__control ',
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
province
);
cy.get('.q-mt-lg > .q-btn--standard').click();
- cy.get('.q-dialog__inner > .column > #formModel > .q-card').should(
- 'not.exist'
- );
+ cy.get(`${createForm.prefix}`).should('not.exist');
checkVnLocation(postCode, province);
});
it('Create city', () => {
@@ -79,7 +142,7 @@ describe('VnLocation', () => {
cy.get(dialogInputs).eq(0).type(postCode);
// city create button
cy.get(
- '.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > .q-select > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon'
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
).click();
cy.selectOption('#q-portal--dialog--2 .q-select', 'one');
cy.get('#q-portal--dialog--2 .q-input').type(province);
@@ -89,9 +152,7 @@ describe('VnLocation', () => {
});
function checkVnLocation(postCode, province) {
- cy.get('.q-dialog__inner > .column > #formModel > .q-card').should(
- 'not.exist'
- );
+ cy.get(`${createForm.prefix}`).should('not.exist');
cy.get('.q-form > .q-card > .vn-row:nth-child(6)')
.find('input')
.invoke('val')
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 43788f59f..83f45b721 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -248,3 +248,9 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
});
+
+Cypress.Commands.add('openUserPanel', () => {
+ cy.get(
+ '.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
+ ).click();
+});