($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/common/VnSelectDialog.vue b/src/components/common/VnSelectDialog.vue
index 17f893255..350aa9272 100644
--- a/src/components/common/VnSelectDialog.vue
+++ b/src/components/common/VnSelectDialog.vue
@@ -1,5 +1,5 @@
@@ -219,7 +211,7 @@ function aliasField(field) {
icon="search"
@click="search()"
>
-
+
diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue
index c6f57b479..80c607214 100644
--- a/src/components/ui/VnPaginate.vue
+++ b/src/components/ui/VnPaginate.vue
@@ -56,7 +56,7 @@ const props = defineProps({
},
offset: {
type: Number,
- default: 0,
+ default: undefined,
},
skeleton: {
type: Boolean,
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/EntryWasteRecalc.vue b/src/pages/Entry/EntryWasteRecalc.vue
new file mode 100644
index 000000000..cd823beb4
--- /dev/null
+++ b/src/pages/Entry/EntryWasteRecalc.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
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..f9dbd0589 100644
--- a/src/pages/Entry/locale/en.yml
+++ b/src/pages/Entry/locale/en.yml
@@ -6,9 +6,17 @@ 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
+wasteRecalc:
+ recalcOk: The wastes were successfully recalculated
diff --git a/src/pages/Entry/locale/es.yml b/src/pages/Entry/locale/es.yml
index eb1e3f88a..feeea1fc9 100644
--- a/src/pages/Entry/locale/es.yml
+++ b/src/pages/Entry/locale/es.yml
@@ -9,10 +9,17 @@ 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
+wasteRecalc:
+ recalcOk: Se han recalculado las mermas correctamente
diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue
index 08b21fb4a..70d38cb93 100644
--- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue
+++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue
@@ -9,7 +9,6 @@ import RefundInvoiceForm from 'src/components/RefundInvoiceForm.vue';
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
import useNotify from 'src/composables/useNotify';
-import { useSession } from 'src/composables/useSession';
import { usePrintService } from 'composables/usePrintService';
import { useVnConfirm } from 'composables/useVnConfirm';
import { getUrl } from 'src/composables/getUrl';
@@ -30,8 +29,6 @@ const $props = defineProps({
const { notify } = useNotify();
const router = useRouter();
-const session = useSession();
-const token = session.getToken();
const { t } = useI18n();
const { openReport, sendEmail } = usePrintService();
const { openConfirmationModal } = useVnConfirm();
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/Card/ItemTags.vue b/src/pages/Item/Card/ItemTags.vue
index 1b5eb28f0..6f31d0cf8 100644
--- a/src/pages/Item/Card/ItemTags.vue
+++ b/src/pages/Item/Card/ItemTags.vue
@@ -171,7 +171,6 @@ const insertTag = (rows) => {
-
+
(stateStore.rightDrawer = false));
diff --git a/src/pages/Monitor/MonitorOrders.vue b/src/pages/Monitor/MonitorOrders.vue
index 52d442d0a..fac601735 100644
--- a/src/pages/Monitor/MonitorOrders.vue
+++ b/src/pages/Monitor/MonitorOrders.vue
@@ -139,33 +139,35 @@ const openTab = (id) =>
:disable-option="{ card: true }"
>
-
- {{ $t('globals.refresh') }}
-
-
- {{ t('salesOrdersTable.delete') }}
-
+
+
+ {{ $t('globals.refresh') }}
+
+
+ {{ t('salesOrdersTable.delete') }}
+
+
diff --git a/src/pages/Monitor/locale/en.yml b/src/pages/Monitor/locale/en.yml
index 4cdd245aa..b8082f02a 100644
--- a/src/pages/Monitor/locale/en.yml
+++ b/src/pages/Monitor/locale/en.yml
@@ -15,7 +15,6 @@ salesOrdersTable:
dateMake: Make date
client: Client
salesPerson: Salesperson
- deleteConfirmTitle: Delete selected elements
deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue?
agency: Agency
import: Import
diff --git a/src/pages/Monitor/locale/es.yml b/src/pages/Monitor/locale/es.yml
index 8087bb444..4ee5b90a9 100644
--- a/src/pages/Monitor/locale/es.yml
+++ b/src/pages/Monitor/locale/es.yml
@@ -15,7 +15,6 @@ salesOrdersTable:
dateMake: Fecha de realización
client: Cliente
salesPerson: Comercial
- deleteConfirmTitle: Eliminar los elementos seleccionados
deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar?
agency: Agencia
import: Importe
diff --git a/src/pages/Order/Card/OrderCatalog.vue b/src/pages/Order/Card/OrderCatalog.vue
index 68bf9511f..b13e8661d 100644
--- a/src/pages/Order/Card/OrderCatalog.vue
+++ b/src/pages/Order/Card/OrderCatalog.vue
@@ -130,4 +130,5 @@ function extractValueTags(items) {
es:
You can search items by name or id: Puedes buscar items por nombre o id
+ Search items: Buscar items
diff --git a/src/pages/Order/Card/OrderCatalogFilter.vue b/src/pages/Order/Card/OrderCatalogFilter.vue
index 354c44747..6de43e86a 100644
--- a/src/pages/Order/Card/OrderCatalogFilter.vue
+++ b/src/pages/Order/Card/OrderCatalogFilter.vue
@@ -247,6 +247,7 @@ function addOrder(value, field, params) {
rounded
emit-value
use-input
+ sort-by="name ASC"
:disable="!selectedCategoryFk"
@update:model-value="
(value) => {
diff --git a/src/pages/Order/Card/OrderCatalogItemDialog.vue b/src/pages/Order/Card/OrderCatalogItemDialog.vue
index 46a50c021..09a25fcb8 100644
--- a/src/pages/Order/Card/OrderCatalogItemDialog.vue
+++ b/src/pages/Order/Card/OrderCatalogItemDialog.vue
@@ -20,8 +20,10 @@ const props = defineProps({
const fields = ref((props.prices || []).map((item) => ({ ...item, quantity: 0 })));
const descriptorData = useArrayData('orderData');
-
+const isLoading = ref(false);
const addToOrder = async () => {
+ if (isLoading.value) return;
+ isLoading.value = true;
const items = (fields.value || []).filter((item) => Number(item.quantity) > 0);
await axios.post('/OrderRows/addToOrder', {
items,
@@ -30,6 +32,10 @@ const addToOrder = async () => {
notify(t('globals.dataSaved'), 'positive');
emit('added');
descriptorData.fetch({});
+ isLoading.value = false;
+};
+const canAddToOrder = () => {
+ return (fields.value || []).some((item) => Number(item.quantity) > 0);
};
@@ -68,7 +74,11 @@ const addToOrder = async () => {
-
+
{{ t('globals.add') }}
@@ -81,3 +91,10 @@ const addToOrder = async () => {
width: 200px;
}
+
+
+es:
+ noAmount: La cantidad no puede ser 0
+en:
+ noAmount: Amount can not be 0
+
diff --git a/src/pages/Order/Card/OrderCreateDialog.vue b/src/pages/Order/Card/OrderCreateDialog.vue
index 9d5c9281e..27b0171f2 100644
--- a/src/pages/Order/Card/OrderCreateDialog.vue
+++ b/src/pages/Order/Card/OrderCreateDialog.vue
@@ -1,5 +1,5 @@
+ (warehouses = data)"
+ auto-load
+ />
-
(warehouses = data)"
- auto-load
- />
{
{{ props.value }}
-
+
diff --git a/src/pages/Route/RouteExtendedList.vue b/src/pages/Route/RouteExtendedList.vue
new file mode 100644
index 000000000..51da4ec12
--- /dev/null
+++ b/src/pages/Route/RouteExtendedList.vue
@@ -0,0 +1,360 @@
+
+
+
+
+
+
+
+ {{ t('route.Select the starting date') }}
+
+
+
+
+
+
+
+
+ {{ t('globals.clone') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('route.Clone Selected Routes') }}
+
+
+ {{ t('route.Download selected routes as PDF') }}
+
+
+ {{ t('route.Mark as served') }}
+
+
+
+
diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue
index 1e20df99c..d0feb9a65 100644
--- a/src/pages/Route/RouteList.vue
+++ b/src/pages/Route/RouteList.vue
@@ -1,34 +1,19 @@
-
-
-
-
- {{ t('Select the starting date') }}
-
-
-
-
-
-
-
-
- {{ t('globals.clone') }}
-
-
-
-
-
-
-
- {{ t('Clone Selected Routes') }}
-
-
- {{ t('Download selected routes as PDF') }}
-
-
- {{ t('Mark as served') }}
-
+
+
+ {{ row?.workerUserName }}
+
+
-
-
-
-en:
- newRoute: New Route
- hourStarted: Started hour
- hourFinished: Finished hour
-es:
- From: Desde
- To: Hasta
- Worker: Trabajador
- Agency: Agencia
- Vehicle: Vehículo
- Volume: Volumen
- Date: Fecha
- Description: Descripción
- Hour started: Hora inicio
- Hour finished: Hora fin
- KmStart: Km inicio
- KmEnd: Km fin
- Served: Servida
- newRoute: Nueva Ruta
- Clone Selected Routes: Clonar rutas seleccionadas
- Select the starting date: Seleccione la fecha de inicio
- Stating date: Fecha de inicio
- Cancel: Cancelar
- Mark as served: Marcar como servidas
- Download selected routes as PDF: Descargar rutas seleccionadas como PDF
- Add ticket: Añadir tickets
- Preview: Vista previa
- Summary: Resumen
- Route is closed: La ruta está cerrada
- Route is not served: La ruta no está servida
- hourStarted: Hora de inicio
- hourFinished: Hora de fin
-
diff --git a/src/pages/Route/RouteRoadmap.vue b/src/pages/Route/RouteRoadmap.vue
index d921dab1f..3687442f5 100644
--- a/src/pages/Route/RouteRoadmap.vue
+++ b/src/pages/Route/RouteRoadmap.vue
@@ -87,7 +87,7 @@ const columns = computed(() => [
actions: [
{
title: t('Ver cmr'),
- icon: 'visibility',
+ icon: 'preview',
isPrimary: true,
action: (row) => viewSummary(row?.id, RoadmapSummary),
},
diff --git a/src/pages/Route/RouteTickets.vue b/src/pages/Route/RouteTickets.vue
index 5960636b0..3bdad4fec 100644
--- a/src/pages/Route/RouteTickets.vue
+++ b/src/pages/Route/RouteTickets.vue
@@ -342,10 +342,7 @@ const openSmsDialog = async () => {
-
+
{{ value }}
{{ t('Open buscaman') }}
@@ -353,7 +350,7 @@ const openSmsDialog = async () => {
-
+
{{ value }}
@@ -361,7 +358,7 @@ const openSmsDialog = async () => {
-
+
{{ value }}
diff --git a/src/pages/Route/locale/en.yml b/src/pages/Route/locale/en.yml
new file mode 100644
index 000000000..d113fda67
--- /dev/null
+++ b/src/pages/Route/locale/en.yml
@@ -0,0 +1,39 @@
+route:
+ Worker: Worker
+ Agency: Agency
+ Vehicle: Vehicle
+ Description: Description
+ hourStarted: H.Start
+ hourFinished: H.End
+ createRoute: Create route
+ From: From
+ To: To
+ Date: Date
+ KmStart: Km start
+ KmEnd: Km end
+ Served: Served
+ Clone Selected Routes: Clone selected routes
+ Select the starting date: Select the starting date
+ Stating date: Starting date
+ Cancel: Cancel
+ Mark as served: Mark as served
+ Download selected routes as PDF: Download selected routes as PDF
+ Add ticket: Add ticket
+ Preview: Preview
+ Summary: Summary
+ Route is closed: Route is closed
+ Route is not served: Route is not served
+ cmr:
+ list:
+ results: results
+ cmrFk: CMR id
+ hasCmrDms: Attached in gestdoc
+ 'true': 'Yes'
+ 'false': 'No'
+ ticketFk: Ticketd id
+ routeFk: Route id
+ country: Country
+ clientFk: Client id
+ shipped: Preparation date
+ viewCmr: View CMR
+ downloadCmrs: Download CMRs
diff --git a/src/pages/Route/locale/es.yml b/src/pages/Route/locale/es.yml
new file mode 100644
index 000000000..a6ba4f370
--- /dev/null
+++ b/src/pages/Route/locale/es.yml
@@ -0,0 +1,39 @@
+route:
+ Worker: Trabajador
+ Agency: Agencia
+ Vehicle: Vehículo
+ Description: Descripción
+ hourStarted: H.Inicio
+ hourFinished: H.Fin
+ createRoute: Crear ruta
+ From: Desde
+ To: Hasta
+ Date: Fecha
+ KmStart: Km inicio
+ KmEnd: Km fin
+ Served: Servida
+ Clone Selected Routes: Clonar rutas seleccionadas
+ Select the starting date: Seleccione la fecha de inicio
+ Stating date: Fecha de inicio
+ Cancel: Cancelar
+ Mark as served: Marcar como servidas
+ Download selected routes as PDF: Descargar rutas seleccionadas como PDF
+ Add ticket: Añadir tickets
+ Preview: Vista previa
+ Summary: Resumen
+ Route is closed: La ruta está cerrada
+ Route is not served: La ruta no está servida
+ cmr:
+ list:
+ results: resultados
+ cmrFk: Id CMR
+ hasCmrDms: Gestdoc
+ 'true': Sí
+ 'false': 'No'
+ ticketFk: Id ticket
+ routeFk: Id ruta
+ country: País
+ clientFk: Id cliente
+ shipped: Fecha preparación
+ viewCmr: Ver CMR
+ downloadCmrs: Descargar CMRs
diff --git a/src/pages/Supplier/Card/SupplierAddressesCreate.vue b/src/pages/Supplier/Card/SupplierAddressesCreate.vue
index 290373039..0feceb74a 100644
--- a/src/pages/Supplier/Card/SupplierAddressesCreate.vue
+++ b/src/pages/Supplier/Card/SupplierAddressesCreate.vue
@@ -84,6 +84,7 @@ function handleLocation(data, location) {
(observationTypes = data)"
+ @on-fetch="
+ (data) =>
+ (observationTypes = data.map((type) => {
+ type.label = t(`ticketNotes.observationTypes.${type.description}`);
+ return type;
+ }))
+ "
auto-load
url="ObservationTypes"
/>
@@ -76,7 +82,7 @@ async function handleSave() {
:label="t('ticketNotes.observationType')"
:options="observationTypes"
hide-selected
- option-label="description"
+ option-label="label"
option-value="id"
v-model="row.observationTypeFk"
:disable="!!row.id"
diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue
index d87f6c402..43af8d528 100644
--- a/src/pages/Ticket/Card/TicketSale.vue
+++ b/src/pages/Ticket/Card/TicketSale.vue
@@ -53,7 +53,7 @@ const tableRef = ref([]);
watch(
() => route.params.id,
- async () => await getSales()
+ () => tableRef.value.reload()
);
const columns = computed(() => [
@@ -161,15 +161,6 @@ const onSalesFetched = (salesData) => {
for (let sale of salesData) sale.amount = getSaleTotal(sale);
};
-const getSales = async () => {
- try {
- const { data } = await axios.get(`Tickets/${route.params.id}/getSales`);
- onSalesFetched(data);
- } catch (err) {
- console.error('Error fetching sales', err);
- }
-};
-
const getSaleTotal = (sale) => {
if (sale.quantity == null || sale.price == null) return null;
@@ -181,7 +172,7 @@ const getSaleTotal = (sale) => {
const resetChanges = async () => {
arrayData.fetch({ append: false });
- getSales();
+ tableRef.value.reload();
};
const updateQuantity = async (sale) => {
@@ -434,8 +425,6 @@ const setTransferParams = async () => {
onMounted(async () => {
stateStore.rightDrawer = true;
getConfig();
- getSales();
- getItems();
});
onUnmounted(() => (stateStore.rightDrawer = false));
@@ -443,11 +432,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
const items = ref([]);
const newRow = ref({});
-async function getItems() {
- const { data } = await axios.get(`Items/withName`);
- items.value = data;
-}
-
const updateItem = (row) => {
const selectedItem = items.value.find((item) => item.id === row.itemFk);
if (selectedItem) {
@@ -623,6 +607,7 @@ watch(
:column-search="false"
:disable-option="{ card: true }"
auto-load
+ @on-fetch="onSalesFetched"
:create="{
onDataSaved: handleOnDataSave,
}"
@@ -678,6 +663,13 @@ watch(
+
+
+
+
+
+
+
diff --git a/src/pages/Ticket/Card/TicketSaleMoreActions.vue b/src/pages/Ticket/Card/TicketSaleMoreActions.vue
index 94db67be2..2ec519d2d 100644
--- a/src/pages/Ticket/Card/TicketSaleMoreActions.vue
+++ b/src/pages/Ticket/Card/TicketSaleMoreActions.vue
@@ -44,7 +44,7 @@ const props = defineProps({
},
});
-const router = useRouter();
+const { push } = useRouter();
const { t } = useI18n();
const { dialog } = useQuasar();
const { notify } = useNotify();
@@ -142,7 +142,7 @@ const onCreateClaimAccepted = async () => {
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..af96c2724 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -1,7 +1,7 @@
@@ -185,6 +158,11 @@ const onThermographCreated = async (data) => {
:filter="{ order: 'name' }"
auto-load
/>
+ (temperaturesOptions = data)"
+ auto-load
+ url="Temperatures"
+ />
{
(thermographForm.thermographId = data.id)
- "
+ @on-data-saved="onThermographCreated"
/>
@@ -271,6 +248,26 @@ const onThermographCreated = async (data) => {
option-label="name"
/>
+
+
+
+
+
+
{
-es:
- Select files: Selecciona ficheros
- Thermograph created: Termógrafo creado
- New thermograph: Nuevo termógrafo
+ es:
+ Select files: Selecciona ficheros
+ Thermograph created: Termógrafo creado
+ New thermograph: Nuevo termógrafo
diff --git a/src/pages/Travel/TravelFilter.vue b/src/pages/Travel/TravelFilter.vue
new file mode 100644
index 000000000..96298853f
--- /dev/null
+++ b/src/pages/Travel/TravelFilter.vue
@@ -0,0 +1,157 @@
+
+
+
+ (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"
>
[
field: 'concept',
cardVisible: true,
},
+ {
+ align: 'right',
+ name: 'tableActions',
+ style: 'max-width: 20px; text-align: initial;',
+ actions: [
+ {
+ title: t('delete'),
+ icon: 'delete',
+ action: async (row) => await tableRef.value.CrudModelRef.remove([row]),
+ isPrimary: true,
+ },
+ ],
+ },
]);
-
[
save-url="WorkerIncomes/crud"
:create="{
urlCreate: 'workerIncomes',
- title: t('Create workerBalance'),
+ title: t('Create balance'),
onDataSaved: () => tableRef.reload(),
formInitialData: {
workerFk: entityId,
@@ -81,10 +93,10 @@ const columns = computed(() => [
:right-search="false"
:is-editable="true"
:use-model="true"
+ :default-remove="false"
/>
-
es:
- Create workerBalance: Crear balance
+ Create balance: Crear balance
diff --git a/src/pages/Worker/Card/WorkerChangePasswordForm.vue b/src/pages/Worker/Card/WorkerChangePasswordForm.vue
deleted file mode 100644
index 20132f21e..000000000
--- a/src/pages/Worker/Card/WorkerChangePasswordForm.vue
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-es:
- Reset password: Restablecer contraseña
- New password: Nueva contraseña
- Repeat password: Repetir contraseña
- You must enter a new password: Debes introducir la nueva contraseña
- Passwords don't match: Las contraseñas no coinciden
-
diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue
index 3675d40f8..1cb42bbfb 100644
--- a/src/pages/Worker/Card/WorkerDescriptor.vue
+++ b/src/pages/Worker/Card/WorkerDescriptor.vue
@@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
-import WorkerChangePasswordForm from 'src/pages/Worker/Card/WorkerChangePasswordForm.vue';
+import VnChangePassword from 'src/components/common/VnChangePassword.vue';
import { useState } from 'src/composables/useState';
import axios from 'axios';
import VnImg from 'src/components/ui/VnImg.vue';
@@ -24,18 +24,13 @@ const route = useRoute();
const { t } = useI18n();
const state = useState();
const user = state.getUser();
-const changePasswordFormDialog = ref(null);
-const cardDescriptorRef = ref(null);
const showEditPhotoForm = ref(false);
const toggleEditPictureForm = () => {
showEditPhotoForm.value = !showEditPhotoForm.value;
};
-
const entityId = computed(() => {
return $props.id || route.params.id;
});
-
-const worker = ref();
const workerExcluded = ref(false);
const getIsExcluded = async () => {
@@ -61,10 +56,10 @@ const handleExcluded = async () => {
workerExcluded.value = !workerExcluded.value;
};
+
const handlePhotoUpdated = (evt = false) => {
image.value.reload(evt);
};
-const refetch = async () => await cardDescriptorRef.value.getData();
await cardDescriptorRef.value.getData();
url="Workers/descriptor"
:filter="{ where: { id: entityId } }"
title="user.nickname"
- @on-fetch="
- (data) => {
- worker = data;
- getIsExcluded();
- }
- "
+ @on-fetch="getIsExcluded"
>
-
-
+
+
{{
workerExcluded
@@ -92,16 +82,13 @@ const refetch = async () => await cardDescriptorRef.value.getData();
- {{ t('Change password') }}
-
-
-
+ {{ t('globals.changePass') }}
@@ -167,10 +154,10 @@ const refetch = async () => await cardDescriptorRef.value.getData();
-
+
{{ t('worker.summary.sipExtension') }}
-
+
@@ -201,6 +188,15 @@ const refetch = async () => await cardDescriptorRef.value.getData();
+
es:
Create training course: Crear curso de formación
diff --git a/src/pages/Worker/Card/WorkerMedical.vue b/src/pages/Worker/Card/WorkerMedical.vue
index 6bca4ae85..fab1416c9 100644
--- a/src/pages/Worker/Card/WorkerMedical.vue
+++ b/src/pages/Worker/Card/WorkerMedical.vue
@@ -65,6 +65,18 @@ const columns = [
create: true,
component: 'input',
},
+ {
+ align: 'right',
+ name: 'tableActions',
+ actions: [
+ {
+ title: t('delete'),
+ icon: 'delete',
+ action: async (row) => await tableRef.value.CrudModelRef.remove([row]),
+ isPrimary: true,
+ },
+ ],
+ },
];
@@ -87,5 +99,6 @@ const columns = [
:right-search="false"
:is-editable="true"
:use-model="true"
+ :default-remove="false"
/>
diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue
index fbfd4b28d..39fb536b6 100644
--- a/src/pages/Worker/Card/WorkerTimeControl.vue
+++ b/src/pages/Worker/Card/WorkerTimeControl.vue
@@ -326,16 +326,20 @@ const updateData = async () => {
};
const getMailStates = async (date) => {
+ const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
+ const month = date.getMonth() + 1;
+ const prevMonth = month == 1 ? 12 : month - 1;
const params = {
- month: date.getMonth() + 1,
+ month,
year: date.getFullYear(),
};
- const { data } = await axios.get(
- `WorkerTimeControls/${route.params.id}/getMailStates`,
- { params }
- );
- workerTimeControlMails.value = data;
+ const curMonthStates = (await axios.get(url, { params })).data;
+ const prevMonthStates = (
+ await axios.get(url, { params: { ...params, month: prevMonth } })
+ ).data;
+
+ workerTimeControlMails.value = curMonthStates.concat(prevMonthStates);
};
const showWorkerTimeForm = (propValue, formType) => {
diff --git a/src/pages/Worker/WorkerFilter.vue b/src/pages/Worker/WorkerFilter.vue
index 765241341..dfb5659fe 100644
--- a/src/pages/Worker/WorkerFilter.vue
+++ b/src/pages/Worker/WorkerFilter.vue
@@ -7,7 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
-const { t } = useI18n();
+const { t, te } = useI18n();
const props = defineProps({
dataKey: {
type: String,
@@ -16,6 +16,11 @@ const props = defineProps({
});
const departments = ref();
+
+const getLocale = (label) => {
+ const globalLocale = `globals.params.${label}`;
+ return te(globalLocale) ? t(globalLocale) : t(`params.${label}`);
+};
@@ -23,7 +28,7 @@ const departments = ref();
- {{ t(`params.${tag.label}`) }}:
+ {{ getLocale(tag.label) }}:
{{ formatFn(tag.value) }}
@@ -64,10 +69,7 @@ const departments = ref();
-
-
-
-
+
+
+
+
+
+
[
},
{
align: 'left',
- name: 'nickname',
- label: t('tableColumns.name'),
+ name: 'firstName',
+ label: t('tableColumns.firstName'),
isTitle: true,
columnFilter: {
name: 'firstName',
},
},
+ {
+ align: 'left',
+ name: 'lastName',
+ label: t('tableColumns.lastName'),
+ isTitle: true,
+ columnFilter: {
+ name: 'lastName',
+ },
+ },
+ {
+ align: 'left',
+ name: 'nickname',
+ label: t('tableColumns.userName'),
+ isTitle: true,
+ columnFilter: {
+ name: 'userName',
+ },
+ },
{
align: 'left',
name: 'departmentFk',
@@ -66,10 +84,17 @@ const columns = computed(() => [
label: t('tableColumns.email'),
cardVisible: true,
columnFilter: {
- alias: 'mu',
- inWhere: true,
+ name: 'email',
+ },
+ },
+ {
+ align: 'left',
+ name: 'extension',
+ label: t('tableColumns.extension'),
+ cardVisible: true,
+ columnFilter: {
+ name: 'extension',
},
- hidden: true,
},
{
align: 'right',
@@ -180,7 +205,7 @@ async function autofillBic(worker) {
default-mode="table"
redirect="worker"
:right-search="false"
- auto-load
+ :order="['id DESC']"
>
@@ -214,6 +239,7 @@ async function autofillBic(worker) {
@@ -262,6 +288,7 @@ async function autofillBic(worker) {
handleLocation(data, location)"
diff --git a/src/pages/Worker/locale/en.yml b/src/pages/Worker/locale/en.yml
index 96df37919..865e86e7e 100644
--- a/src/pages/Worker/locale/en.yml
+++ b/src/pages/Worker/locale/en.yml
@@ -1,6 +1,11 @@
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
tableColumns:
id: ID
- name: Name
+ firstName: First name
+ lastName: Last Name
+ userName: User Name
department: Department
email: Email
+ fi: FI
+ SSN: SSN
+ extension: Extension
diff --git a/src/pages/Worker/locale/es.yml b/src/pages/Worker/locale/es.yml
index 41812345f..b3c093ec5 100644
--- a/src/pages/Worker/locale/es.yml
+++ b/src/pages/Worker/locale/es.yml
@@ -6,6 +6,11 @@ External: Externo
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
tableColumns:
id: ID
- name: Nombre
+ firstName: Nombre
+ lastName: Apellidos
+ userName: Nombre de usuario
department: Departamento
email: Email
+ fi: NIF
+ SSN: NSS
+ extension: Extensión
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(() => {
+
+
+
+
+
import('src/pages/Entry/EntryStockBought.vue'),
},
+ {
+ path: 'waste-recalc',
+ name: 'EntryWasteRecalc',
+ meta: {
+ title: 'wasteRecalc',
+ icon: 'compost',
+ },
+ component: () => import('src/pages/Entry/EntryWasteRecalc.vue'),
+ },
],
},
{
diff --git a/src/router/modules/route.js b/src/router/modules/route.js
index 3c5c860cf..9a7b16df3 100644
--- a/src/router/modules/route.js
+++ b/src/router/modules/route.js
@@ -11,7 +11,14 @@ export default {
component: RouterView,
redirect: { name: 'RouteMain' },
menus: {
- main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList', 'AgencyList'],
+ main: [
+ 'RouteList',
+ 'RouteExtendedList',
+ 'RouteAutonomous',
+ 'RouteRoadmap',
+ 'CmrList',
+ 'AgencyList',
+ ],
card: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
},
children: [
@@ -19,9 +26,6 @@ export default {
path: '/route',
name: 'RouteMain',
component: () => import('src/components/common/VnSectionMain.vue'),
- props: {
- leftDrawer: false,
- },
redirect: { name: 'RouteList' },
children: [
{
@@ -33,6 +37,15 @@ export default {
},
component: () => import('src/pages/Route/RouteList.vue'),
},
+ {
+ path: 'extended-list',
+ name: 'RouteExtendedList',
+ meta: {
+ title: 'RouteExtendedList',
+ icon: 'format_list_bulleted',
+ },
+ component: () => import('src/pages/Route/RouteExtendedList.vue'),
+ },
{
path: 'create',
name: 'RouteCreate',
@@ -78,7 +91,7 @@ export default {
name: 'AgencyList',
meta: {
title: 'agencyList',
- icon: 'view_list',
+ icon: 'list',
},
component: () =>
import('src/pages/Route/Agency/AgencyList.vue'),
diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js
index b2716474b..7258881be 100644
--- a/src/router/modules/worker.js
+++ b/src/router/modules/worker.js
@@ -168,6 +168,7 @@ export default {
meta: {
title: 'log',
icon: 'vn:History',
+ acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
},
component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
},
diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
index 6d33dbc39..353c5805b 100644
--- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
+++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
@@ -4,12 +4,12 @@ describe('AgencyWorkCenter', () => {
cy.login('developer');
cy.visit(`/#/agency/11/workCenter`);
});
+ const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
+ const workCenterCombobox = 'input[role="combobox"]';
it('assign workCenter', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(
- '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
- ).type('workCenterOne{enter}');
+ cy.get(createButton).click();
+ cy.get(workCenterCombobox).type('workCenterOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
});
@@ -22,12 +22,10 @@ describe('AgencyWorkCenter', () => {
});
it('error on duplicate workCenter', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(
- '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
- ).type('workCenterOne{enter}');
+ cy.get(createButton).click();
+ cy.get(workCenterCombobox).type('workCenterOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.get(createButton).click();
cy.get(
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
).type('workCenterOne{enter}');
diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js
index c9d7147c2..8020d3ea9 100644
--- a/test/cypress/integration/route/routeList.spec.js
+++ b/test/cypress/integration/route/routeList.spec.js
@@ -2,7 +2,7 @@ describe('Route', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit(`/#/route/list`);
+ cy.visit(`/#/route/extended-list`);
});
const getVnSelect =
'> :nth-child(1) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
diff --git a/test/cypress/integration/vnComponent/UserPanel.spec.js b/test/cypress/integration/vnComponent/UserPanel.spec.js
new file mode 100644
index 000000000..e83d07954
--- /dev/null
+++ b/test/cypress/integration/vnComponent/UserPanel.spec.js
@@ -0,0 +1,58 @@
+///
+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();
+});
diff --git a/test/vitest/__tests__/components/common/VnChangePassword.spec.js b/test/vitest/__tests__/components/common/VnChangePassword.spec.js
new file mode 100644
index 000000000..f5a967bb5
--- /dev/null
+++ b/test/vitest/__tests__/components/common/VnChangePassword.spec.js
@@ -0,0 +1,70 @@
+import { createWrapper, axios } from 'app/test/vitest/helper';
+import VnChangePassword from 'src/components/common/VnChangePassword.vue';
+import { vi, beforeEach, afterEach, beforeAll, describe, expect, it } from 'vitest';
+import { Notify } from 'quasar';
+
+describe('VnSmsDialog', () => {
+ let vm;
+
+ beforeAll(() => {
+ vi.spyOn(axios, 'get').mockResolvedValue({
+ data: [],
+ });
+ vm = createWrapper(VnChangePassword, {
+ propsData: {
+ submitFn: vi.fn(),
+ },
+ }).vm;
+ });
+
+ beforeEach(() => {
+ Notify.create = vi.fn();
+ });
+
+ afterEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('should notify when new password is empty', async () => {
+ vm.passwords.newPassword = '';
+ vm.passwords.repeatPassword = 'password';
+
+ await vm.validate();
+ expect(Notify.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ message: 'You must enter a new password',
+ type: 'negative',
+ })
+ );
+ });
+
+ it("should notify when passwords don't match", async () => {
+ vm.passwords.newPassword = 'password1';
+ vm.passwords.repeatPassword = 'password2';
+ await vm.validate();
+ expect(Notify.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ message: `Passwords don't match`,
+ type: 'negative',
+ })
+ );
+ });
+
+ describe('if passwords match', () => {
+ it('should call submitFn and emit password', async () => {
+ vm.passwords.newPassword = 'password';
+ vm.passwords.repeatPassword = 'password';
+ await vm.validate();
+ expect(vm.props.submitFn).toHaveBeenCalledWith('password', undefined);
+ });
+
+ it('should call submitFn and emit password and old password', async () => {
+ vm.passwords.newPassword = 'password';
+ vm.passwords.repeatPassword = 'password';
+ vm.passwords.oldPassword = 'oldPassword';
+
+ await vm.validate();
+ expect(vm.props.submitFn).toHaveBeenCalledWith('password', 'oldPassword');
+ });
+ });
+});