@@ -53,10 +60,20 @@ const toCustomerRecoveries = () => {
-
+
-
+
diff --git a/src/pages/Customer/components/CustomerSamplesCreate.vue b/src/pages/Customer/components/CustomerSamplesCreate.vue
new file mode 100644
index 000000000..4a28a3061
--- /dev/null
+++ b/src/pages/Customer/components/CustomerSamplesCreate.vue
@@ -0,0 +1,385 @@
+
+
+
+
+
+ (optionsCompanies = data)"
+ auto-load
+ url="Companies"
+ />
+ (optionsSamplesVisible = data)"
+ auto-load
+ url="Samples/visible"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ t('Its only used when sample is sent')
+ }}
+
+
+
+
+
+
+
+
+ {{
+ t('To who should the recipient replay?')
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ `${scope.opt.nickname}, ${scope.opt.street}, ${scope.opt.city}, ${scope.opt.province.name} - ${scope.opt.agencyMode.name}`
+ }}
+
+
+
+
+
+
+ {{ t('Edit address') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+es:
+ Sample: Plantilla
+ Recipient: Destinatario
+ Reply to: Responder a
+ Company: Empresa
+ Address: Dirección
+ Since: Desde
+ Its only used when sample is sent: Se utiliza únicamente cuando se envía la plantilla
+ To who should the recipient replay?: ¿A quien debería responder el destinatario?
+ Edit address: Editar dirección
+ Preview: Vista previa
+ Email cannot be blank: Debes introducir un email
+ Choose a sample: Selecciona una plantilla
+ Choose a company: Selecciona una empresa
+ Choose a date: Selecciona una fecha
+
diff --git a/src/pages/Customer/components/CustomerSamplesPreview.vue b/src/pages/Customer/components/CustomerSamplesPreview.vue
new file mode 100644
index 000000000..dcd2f7591
--- /dev/null
+++ b/src/pages/Customer/components/CustomerSamplesPreview.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Customer/components/CustomerSummaryTable.vue b/src/pages/Customer/components/CustomerSummaryTable.vue
new file mode 100644
index 000000000..6a33ebc88
--- /dev/null
+++ b/src/pages/Customer/components/CustomerSummaryTable.vue
@@ -0,0 +1,247 @@
+
+
+
+ (rows = data)"
+ auto-load
+ url="Tickets"
+ />
+
+
+
+
+
+
+ {{ props.value }}
+
+
+
+ {{ props.value }}
+
+
+
+
+ {{ props.value }}
+
+
+
+
+ {{ toCurrency(props.value) }}
+
+ {{ toCurrency(props.value) }}
+
+
+
+
+
+
+
+
+
+
+
+es:
+ Id: Id
+ Nickname: Alias
+ Agency: Agencia
+ Route: Ruta
+ Packages: Bultos
+ Date: Fecha
+ State: Estado
+ Total: Total
+
diff --git a/src/pages/Customer/components/CustomerSummaryTableActions.vue b/src/pages/Customer/components/CustomerSummaryTableActions.vue
new file mode 100644
index 000000000..6e9038374
--- /dev/null
+++ b/src/pages/Customer/components/CustomerSummaryTableActions.vue
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+ {{ t('Go to lines') }}
+
+
+
+
+ {{ t('Preview') }}
+
+
+
+
+
+
+es:
+ Go to lines: Ir a lineas
+ Preview: Vista previa
+
diff --git a/src/pages/Customer/components/ModalCloseContract.vue b/src/pages/Customer/components/ModalCloseContract.vue
new file mode 100644
index 000000000..606cfab98
--- /dev/null
+++ b/src/pages/Customer/components/ModalCloseContract.vue
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('Are you sure you want to close this contract?') }}
+
+ {{ t('Close contract') }}
+
+
+
+
+
+
+
+
+
+
+
+es:
+ Are you sure you want to close this contract?: ¿Seguro que quieres cerrar este contrato?
+ Close contract: Cerrar contrato
+
diff --git a/src/pages/Customer/locale/en.yml b/src/pages/Customer/locale/en.yml
new file mode 100644
index 000000000..6eb7cfa85
--- /dev/null
+++ b/src/pages/Customer/locale/en.yml
@@ -0,0 +1,4 @@
+customerFilter:
+ filter:
+ name: Name
+ socialName: Social name
diff --git a/src/pages/Customer/locale/es.yml b/src/pages/Customer/locale/es.yml
new file mode 100644
index 000000000..8fed37092
--- /dev/null
+++ b/src/pages/Customer/locale/es.yml
@@ -0,0 +1,4 @@
+customerFilter:
+ filter:
+ name: Nombre
+ socialName: Razón Social
diff --git a/src/pages/Department/Card/DepartmentDescriptor.vue b/src/pages/Department/Card/DepartmentDescriptor.vue
index 7049d4145..e60a8c91b 100644
--- a/src/pages/Department/Card/DepartmentDescriptor.vue
+++ b/src/pages/Department/Card/DepartmentDescriptor.vue
@@ -63,7 +63,7 @@ const removeDepartment = () => {
router.push({ name: 'WorkerDepartment' });
notify('department.departmentRemoved', 'positive');
} catch (err) {
- console.log('Error removing department');
+ console.error('Error removing department');
}
});
};
diff --git a/src/pages/Entry/Card/EntryBasicData.vue b/src/pages/Entry/Card/EntryBasicData.vue
index 4a8cf154a..12e03fd32 100644
--- a/src/pages/Entry/Card/EntryBasicData.vue
+++ b/src/pages/Entry/Card/EntryBasicData.vue
@@ -2,6 +2,7 @@
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
+import { useRole } from 'src/composables/useRole';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
@@ -15,6 +16,8 @@ import { toDate } from 'src/filters';
const route = useRoute();
const { t } = useI18n();
+const { hasAny } = useRole();
+const isAdministrative = () => hasAny(['administrative']);
const suppliersOptions = ref([]);
const travelsOptions = ref([]);
@@ -206,6 +209,7 @@ const onFilterTravelSelected = (formData, id) => {
diff --git a/src/pages/Entry/Card/EntryBuys.vue b/src/pages/Entry/Card/EntryBuys.vue
index 0208b49ba..3b39840c8 100644
--- a/src/pages/Entry/Card/EntryBuys.vue
+++ b/src/pages/Entry/Card/EntryBuys.vue
@@ -268,16 +268,11 @@ const importBuys = () => {
const toggleGroupingMode = async (buy, mode) => {
try {
- const grouping = 1;
- const packing = 2;
- const groupingMode = mode === 'grouping' ? grouping : packing;
-
- const newGroupingMode = buy.groupingMode === groupingMode ? 0 : groupingMode;
-
+ const groupingMode = mode === 'grouping' ? mode : 'packing';
+ const newGroupingMode = buy.groupingMode === groupingMode ? null : groupingMode;
const params = {
groupingMode: newGroupingMode,
};
-
await axios.patch(`Buys/${buy.id}`, params);
buy.groupingMode = newGroupingMode;
} catch (err) {
@@ -287,9 +282,9 @@ const toggleGroupingMode = async (buy, mode) => {
const lockIconType = (groupingMode, mode) => {
if (mode === 'packing') {
- return groupingMode === 2 ? 'lock' : 'lock_open';
+ return groupingMode === 'packing' ? 'lock' : 'lock_open';
} else {
- return groupingMode === 1 ? 'lock' : 'lock_open';
+ return groupingMode === 'grouping' ? 'lock' : 'lock_open';
}
};
diff --git a/src/pages/Entry/Card/EntryNotes.vue b/src/pages/Entry/Card/EntryNotes.vue
index 02a0c020a..ae37b4b39 100644
--- a/src/pages/Entry/Card/EntryNotes.vue
+++ b/src/pages/Entry/Card/EntryNotes.vue
@@ -1,19 +1,19 @@
{
model="EntryAccount"
:filter="{
fields: ['id', 'entryFk', 'observationTypeFk', 'description'],
- where: { entryFk: route.params.id },
+ where: { entryFk: params.id },
}"
ref="entryObservationsRef"
- :default-remove="false"
- :data-required="{ entryFk: route.params.id }"
+ :data-required="{ entryFk: params.id }"
+ v-model:selected="selected"
>
-
-
-
-
-
-
-
-
-
- {{ t('Remove note') }}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- {{ t('Add note') }}
-
-
-
+
+
+
+
+
-
es:
Add note: Añadir nota
diff --git a/src/pages/Entry/EntryFilter.vue b/src/pages/Entry/EntryFilter.vue
index 22ddf0bbf..86c1f6b23 100644
--- a/src/pages/Entry/EntryFilter.vue
+++ b/src/pages/Entry/EntryFilter.vue
@@ -1,6 +1,8 @@
@@ -58,7 +65,7 @@ const suppliersOptions = ref([]);
@@ -67,7 +74,7 @@ const suppliersOptions = ref([]);
@@ -210,8 +217,7 @@ const suppliersOptions = ref([]);
en:
params:
- search: General search
- reference: Reference
+
invoiceNumber: Invoice number
travelFk: Travel
companyFk: Company
@@ -225,8 +231,7 @@ en:
isOrdered: Ordered
es:
params:
- search: Búsqueda general
- reference: Referencia
+
invoiceNumber: Núm. factura
travelFk: Envío
companyFk: Empresa
diff --git a/src/pages/Entry/locale/en.yml b/src/pages/Entry/locale/en.yml
new file mode 100644
index 000000000..1956140ed
--- /dev/null
+++ b/src/pages/Entry/locale/en.yml
@@ -0,0 +1,8 @@
+entryList:
+ list:
+ inventoryEntry: Inventory entry
+ virtualEntry: Virtual entry
+entryFilter:
+ filter:
+ search: General search
+ reference: Reference
diff --git a/src/pages/Entry/locale/es.yml b/src/pages/Entry/locale/es.yml
new file mode 100644
index 000000000..192d03542
--- /dev/null
+++ b/src/pages/Entry/locale/es.yml
@@ -0,0 +1,8 @@
+entryList:
+ list:
+ inventoryEntry: Es inventario
+ virtualEntry: Es una redada
+entryFilter:
+ filter:
+ search: Búsqueda general
+ reference: Referencia
diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
index 5adaeca94..2c4a19be5 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
@@ -257,7 +257,7 @@ const requiredFieldRule = (val) => val || t('globals.requiredField');
const isAdministrative = () => hasAny(['administrative']);
const isAgricultural = () =>
- invoiceIn.value.supplier.sageWithholdingFk == config.value[0].sageWithholdingFk;
+ invoiceIn.value?.supplier?.sageWithholdingFk === config.value[0]?.sageWithholdingFk;
function showPdfInvoice() {
if (isAgricultural()) openReport(`InvoiceIns/${entityId.value}/invoice-in-pdf`);
diff --git a/src/pages/Item/Card/ItemBasicData.vue b/src/pages/Item/Card/ItemBasicData.vue
new file mode 100644
index 000000000..334cf049d
--- /dev/null
+++ b/src/pages/Item/Card/ItemBasicData.vue
@@ -0,0 +1 @@
+Item basic data
diff --git a/src/pages/Item/ItemCreate.vue b/src/pages/Item/ItemCreate.vue
new file mode 100644
index 000000000..18e7522cb
--- /dev/null
+++ b/src/pages/Item/ItemCreate.vue
@@ -0,0 +1,170 @@
+
+
+
+ (originsOptions = data)"
+ :filter="{ order: 'name' }"
+ auto-load
+ />
+ (tagsOptions = data)"
+ auto-load
+ />
+ (itemTypesOptions = data)"
+ auto-load
+ />
+ (intrastatsOptions = data)"
+ auto-load
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.opt?.code }}
+
+
+ {{ scope.opt?.name }}
+
+
+
+ {{ scope.opt?.category?.name }}
+
+
+
+
+
+
+
+
+
+ {{ scope.opt?.description }}
+
+
+ #{{ scope.opt?.id }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Item/ItemList.vue b/src/pages/Item/ItemList.vue
index 49a5dbb64..3e399e29f 100644
--- a/src/pages/Item/ItemList.vue
+++ b/src/pages/Item/ItemList.vue
@@ -1 +1,577 @@
-Item list
+
+
+
+ (itemTypesOptions = data)"
+ />
+ (itemCategoriesOptions = data)"
+ />
+ (intrastatOptions = data)"
+ />
+ (originsOptions = data)"
+ />
+ (buyersOptions = data)"
+ />
+
+
+
+
+
+
+
+
+
+ redirectToItemSummary(row.id)"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.id }}
+
+
+
+
+
+
+
+ {{ row.userName }}
+
+
+
+
+
+
+ {{ row.name }} {{ row.subName }}
+
+
+
+
+
+
+
+
+
+
+ cloneItem(row.id)
+ )
+ "
+ class="q-ml-sm"
+ color="primary"
+ name="vn:clone"
+ size="sm"
+ >
+
+ {{ t('Clone') }}
+
+
+
+
+ {{ t('Preview') }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('New item') }}
+
+
+
+
+
+
+es:
+ New item: Nuevo artículo
+ All it's properties will be copied: Todas sus propiedades serán copiadas
+ Do you want to clone this item?: ¿Desea clonar este artículo?
+ Clone: Clonar
+ Preview: Vista previa
+
diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue
index 1c770194a..60e86d04e 100644
--- a/src/pages/Order/Card/OrderDescriptor.vue
+++ b/src/pages/Order/Card/OrderDescriptor.vue
@@ -61,7 +61,7 @@ const data = ref(useCardDescription());
const setData = (entity) => {
if (!entity) return;
data.value = useCardDescription(entity.client.name, entity.id);
- state.set('ClaimDescriptor', entity);
+ state.set('OrderDescriptor', entity);
};
const getConfirmationValue = (isConfirmed) => {
diff --git a/src/pages/Order/Card/OrderForm.vue b/src/pages/Order/Card/OrderForm.vue
index 42aee7640..6a4ae6aac 100644
--- a/src/pages/Order/Card/OrderForm.vue
+++ b/src/pages/Order/Card/OrderForm.vue
@@ -1,6 +1,6 @@
@@ -58,15 +55,10 @@ const isAdministrative = computed(() => {
-
- {{ t('globals.summary.basicData') }}
+
@@ -94,15 +86,10 @@ const isAdministrative = computed(() => {
/>
-
- {{ t('supplier.summary.billingData') }}
+
{
-
- {{ t('supplier.summary.fiscalData') }}
+
{
/>
-
- {{ t('supplier.summary.fiscalAddress') }}
+
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index bf818ef77..d648433b0 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -151,7 +151,7 @@ async function changeState(value) {
+import { useRoute, useRouter } from 'vue-router';
+import { onBeforeMount, reactive, ref } from 'vue';
+import { useI18n } from 'vue-i18n';
+
+import FormModel from 'components/FormModel.vue';
+import FetchData from 'components/FetchData.vue';
+import VnRow from 'components/ui/VnRow.vue';
+import VnSelectFilter from 'components/common/VnSelectFilter.vue';
+import VnInputDate from 'components/common/VnInputDate.vue';
+import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+
+import { useState } from 'composables/useState';
+import axios from 'axios';
+
+const { t } = useI18n();
+const route = useRoute();
+const router = useRouter();
+const state = useState();
+const user = state.getUser();
+
+const initialFormState = reactive({
+ clientId: Number(route.query?.clientFk) || null,
+ addressId: null,
+ agencyModeId: null,
+ warehouseId: user.value.warehouseFk,
+ landed: null,
+});
+const clientOptions = ref([]);
+const agenciesOptions = ref([]);
+const addressesOptions = ref([]);
+const warehousesOptions = ref([]);
+const selectedClient = ref(null);
+
+onBeforeMount(async () => {
+ await onClientSelected(initialFormState);
+});
+
+const fetchClient = async (formData) => {
+ try {
+ const filter = {
+ include: {
+ relation: 'defaultAddress',
+ scope: {
+ fields: ['id', 'agencyModeFk'],
+ },
+ },
+ where: { id: formData.clientId },
+ };
+ const params = { filter: JSON.stringify(filter) };
+ const { data } = await axios.get('Clients', { params });
+ const [client] = data;
+ selectedClient.value = client;
+ } catch (err) {
+ console.error('Error fetching client');
+ }
+};
+
+const fetchAddresses = async (formData) => {
+ try {
+ if (!formData.clientId) return;
+
+ const filter = {
+ fields: ['nickname', 'street', 'city', 'id'],
+ where: { isActive: true },
+ order: 'nickname ASC',
+ };
+ const params = { filter: JSON.stringify(filter) };
+ const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
+ params,
+ });
+ addressesOptions.value = data;
+
+ const { defaultAddress } = selectedClient.value;
+ formData.addressId = defaultAddress.id;
+ console.log();
+ } catch (err) {
+ console.error(`Error fetching addresses`, err);
+ return err.response;
+ }
+};
+
+const onClientSelected = async (formData) => {
+ await fetchClient(formData);
+ await fetchAddresses(formData);
+};
+
+const fetchAvailableAgencies = async (formData) => {
+ if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
+ let params = {
+ warehouseFk: formData.warehouseId,
+ addressFk: formData.addressId,
+ landed: formData.landed,
+ };
+
+ const { data } = await axios.get('Agencies/getAgenciesWithWarehouse', { params });
+
+ agenciesOptions.value = data;
+
+ const defaultAgency = agenciesOptions.value.find(
+ (agency) =>
+ agency.agencyModeFk === selectedClient.value.defaultAddress.agencyModeFk
+ );
+
+ if (defaultAgency) formData.agencyModeId = defaultAgency.agencyModeFk;
+};
+
+const redirectToTicketList = (_, { id }) => {
+ router.push({ name: 'TicketSummary', params: { id } });
+};
+
+
+
+ (clientOptions = data)"
+ :filter="{ fields: ['id', 'name', 'defaultAddressFk'], order: 'id' }"
+ auto-load
+ />
+ (warehousesOptions = data)"
+ order="name"
+ auto-load
+ />
+
+
+
+
+
+
+ onClientSelected(data)"
+ >
+
+
+
+
+ {{ scope.opt.name }}
+
+
+ {{ `#${scope.opt.id}` }}
+
+
+
+
+
+
+
+
+
+ fetchAvailableAgencies(data)"
+ >
+
+
+
+
+ {{ scope.opt.nickname }}
+
+
+ {{ `${scope.opt.street}, ${scope.opt.city}` }}
+
+
+
+
+
+
+
+
+
+ fetchAvailableAgencies(data)"
+ />
+
+
+
+
+ fetchAvailableAgencies(data)"
+ />
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index c5d25fed2..c6e5cb60c 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -123,6 +123,13 @@ function navigate(id) {
+
+
+
+ {{ t('New ticket') }}
+
+
+
@@ -131,4 +138,5 @@ es:
Search ticket: Buscar ticket
You can search by ticket id or alias: Puedes buscar por id o alias del ticket
Zone: Zona
+ New ticket: Nuevo ticket
diff --git a/src/pages/Travel/TravelFilter.vue b/src/pages/Travel/TravelFilter.vue
index 7e8d19405..545bb58ae 100644
--- a/src/pages/Travel/TravelFilter.vue
+++ b/src/pages/Travel/TravelFilter.vue
@@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
-import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
@@ -63,7 +62,7 @@ const decrement = (paramsObj, key) => {
{
{
{
{
en:
params:
search: Id/Reference
- agencyModeFk: Agency
- warehouseInFk: Warehouse In
- warehouseOutFk: Warehouse Out
- scopeDays: Days onward
landedFrom: Landed from
landedTo: Landed to
continent: Continent out
@@ -222,10 +217,6 @@ en:
es:
params:
search: Id/Referencia
- agencyModeFk: Agencia
- warehouseInFk: Alm. entrada
- warehouseOutFk: Alm. salida
- scopeDays: Días adelante
landedFrom: Llegada desde
landedTo: Llegada hasta
continent: Cont. Salida
diff --git a/src/pages/Travel/locale/en.yml b/src/pages/Travel/locale/en.yml
new file mode 100644
index 000000000..c67eddce0
--- /dev/null
+++ b/src/pages/Travel/locale/en.yml
@@ -0,0 +1,6 @@
+travelFilter:
+ filter:
+ warehouseOutFk: Warehouse Out
+ warehouseInFk: Warehouse In
+ agencyModeFk: Agency
+ scopeDays: Days onward
diff --git a/src/pages/Travel/locale/es.yml b/src/pages/Travel/locale/es.yml
new file mode 100644
index 000000000..8e958c074
--- /dev/null
+++ b/src/pages/Travel/locale/es.yml
@@ -0,0 +1,6 @@
+travelFilter:
+ filter:
+ warehouseInFk: Alm. entrada
+ warehouseOutFk: Alm. salida
+ agencyModeFk: Agencia
+ scopeDays: Días adelante
diff --git a/src/pages/Worker/Card/WorkerBasicData.vue b/src/pages/Worker/Card/WorkerBasicData.vue
index c59f4281d..775472065 100644
--- a/src/pages/Worker/Card/WorkerBasicData.vue
+++ b/src/pages/Worker/Card/WorkerBasicData.vue
@@ -27,6 +27,7 @@ const workerFilter = {
},
{ relation: 'sip', scope: { fields: ['extension', 'secret'] } },
{ relation: 'department', scope: { include: { relation: 'department' } } },
+ { relation: 'client', scope: {fields:['phone']} },
],
};
const workersFilter = {
@@ -86,6 +87,7 @@ const maritalStatus = [
:label="t('Mobile extension')"
clearable
/>
+
@@ -157,6 +159,7 @@ es:
Last name: Apellidos
Business phone: Teléfono de empresa
Mobile extension: Extensión móvil
+ Personal phone: Teléfono personal
Boss: Jefe
Marital status: Estado civil
Married: Casado/a
diff --git a/src/pages/Worker/Card/WorkerCalendar.vue b/src/pages/Worker/Card/WorkerCalendar.vue
new file mode 100644
index 000000000..288e78dcf
--- /dev/null
+++ b/src/pages/Worker/Card/WorkerCalendar.vue
@@ -0,0 +1,239 @@
+
+
+
+
+ (isSubordinate = data)"
+ auto-load
+ />
+
+
+
+
+
+ {{ t('globals.collapseMenu') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('Autonomous worker') }}
+
+
+
+
+
+ {{ t('addAbsencesText') }}
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ addAbsencesText: To start adding absences, click an absence type from the right menu and then on the day you want to add an absence
+
+es:
+ Search worker: Buscar trabajador
+ You can search by worker id or name: Puedes buscar por id o nombre del trabajador
+ addAbsencesText: Para empezar a añadir ausencias, haz clic en un tipo de ausencia desde el menu de la derecha y después en el día que quieres añadir la ausencia
+
diff --git a/src/pages/Worker/Card/WorkerCalendarFilter.vue b/src/pages/Worker/Card/WorkerCalendarFilter.vue
new file mode 100644
index 000000000..374762ac1
--- /dev/null
+++ b/src/pages/Worker/Card/WorkerCalendarFilter.vue
@@ -0,0 +1,248 @@
+
+
+
+ (absenceTypeList = data)"
+ auto-load
+ />
+ (contractList = data)"
+ auto-load
+ />
+
+
+
+
+ {{ t('Contract') }} #{{ selectedBusinessFk }}
+
+
+
+
+ {{
+ t('usedDays', {
+ holidaysEnjoyed: contractHolidays.holidaysEnjoyed || 0,
+ totalHolidays: contractHolidays.totalHolidays || 0,
+ })
+ }}
+
+
+
+
+ {{
+ t('spentHours', {
+ hoursEnjoyed: contractHolidays.hoursEnjoyed || 0,
+ totalHours: contractHolidays.totalHours || 0,
+ })
+ }}
+
+
+
+
+ {{
+ t('paidHolidays', {
+ payedHolidays: contractHolidays.payedHolidays || 0,
+ })
+ }}
+
+
+
+
+
+
+ {{ t('Year') }} {{ selectedYear }}
+
+
+
+
+ {{
+ t('usedDays', {
+ holidaysEnjoyed: yearHolidays.holidaysEnjoyed || 0,
+ totalHolidays: yearHolidays.totalHolidays || 0,
+ })
+ }}
+
+
+
+ {{
+ t('spentHours', {
+ hoursEnjoyed: yearHolidays.hoursEnjoyed || 0,
+ totalHours: yearHolidays.totalHours || 0,
+ })
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # {{ scope.opt?.businessFk }}
+
+ {{ toDateFormat(scope.opt?.started) }} -
+ {{
+ scope.opt?.ended
+ ? toDateFormat(scope.opt?.ended)
+ : 'Indef.'
+ }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ type.name }}
+
+
+
+
+
+
+
+ {{ t('Festive') }}
+
+
+ {{ t('Current day') }}
+
+
+
+
+
+
+
+
+en:
+ spentHours: Spent {hoursEnjoyed} of {totalHours} hours
+ usedDays: Used {holidaysEnjoyed} of {totalHolidays} days
+ paidHolidays: Paid holidays {payedHolidays} days
+
+es:
+ Paid holidays: Vacaciones pagadas
+ Year: Año
+ Contract: Contrato
+ Festive: Festivo
+ Current day: Día actual
+ spentHours: Utilizadas {hoursEnjoyed} de {totalHours} horas
+ usedDays: Utilizados {holidaysEnjoyed} de {totalHolidays} días
+ paidHolidays: Vacaciones pagadas {payedHolidays} días
+
+
diff --git a/src/pages/Worker/Card/WorkerCalendarItem.vue b/src/pages/Worker/Card/WorkerCalendarItem.vue
new file mode 100644
index 000000000..584222d19
--- /dev/null
+++ b/src/pages/Worker/Card/WorkerCalendarItem.vue
@@ -0,0 +1,313 @@
+
+
+
+
+
+ {{
+ weekdayStore.getLocaleMonths[$props.month - 1].locale
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+es:
+ Choose an absence type from the right menu: Elige un tipo de ausencia desde el menú de la derecha
+
diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue
index a20ad5546..bb4acec69 100644
--- a/src/pages/Worker/Card/WorkerDescriptor.vue
+++ b/src/pages/Worker/Card/WorkerDescriptor.vue
@@ -31,29 +31,7 @@ const entityId = computed(() => {
});
const worker = ref();
-const filter = {
- include: [
- {
- relation: 'user',
- scope: {
- fields: ['email', 'name', 'nickname'],
- },
- },
- {
- relation: 'department',
- scope: {
- include: [
- {
- relation: 'department',
- },
- ],
- },
- },
- {
- relation: 'sip',
- },
- ],
-};
+const filter = { where: { id: route.params.id}};
const sip = ref(null);
@@ -82,7 +60,7 @@ const setData = (entity) => {
+import VnDmsList from 'src/components/common/VnDmsList.vue';
+import { useRoute } from 'vue-router';
+const route = useRoute();
+
+
+
+
diff --git a/src/pages/Worker/Card/WorkerEventLabel.vue b/src/pages/Worker/Card/WorkerEventLabel.vue
new file mode 100644
index 000000000..b75fea890
--- /dev/null
+++ b/src/pages/Worker/Card/WorkerEventLabel.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
diff --git a/src/pages/Worker/Card/WorkerNotes.vue b/src/pages/Worker/Card/WorkerNotes.vue
index 6c74aefa0..c15b1dfab 100644
--- a/src/pages/Worker/Card/WorkerNotes.vue
+++ b/src/pages/Worker/Card/WorkerNotes.vue
@@ -28,11 +28,5 @@ const body = {
-
+
diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue
index dad21cda5..43c493565 100644
--- a/src/pages/Worker/Card/WorkerSummary.vue
+++ b/src/pages/Worker/Card/WorkerSummary.vue
@@ -10,7 +10,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
-const route = useRoute();
+const { params } = useRoute();
const { t } = useI18n();
const $props = defineProps({
@@ -20,53 +20,18 @@ const $props = defineProps({
},
});
-const entityId = computed(() => $props.id || route.params.id);
+const entityId = computed(() => $props.id || params.id);
const workerUrl = ref();
onMounted(async () => {
workerUrl.value = (await getUrl('')) + `worker/${entityId.value}/`;
});
-const filter = {
- include: [
- {
- relation: 'user',
- scope: {
- fields: ['email', 'name', 'nickname', 'roleFk'],
- include: {
- relation: 'role',
- scope: {
- fields: ['name'],
- },
- },
- },
- },
- {
- relation: 'department',
- scope: {
- include: {
- relation: 'department',
- scope: {
- fields: ['name'],
- },
- },
- },
- },
- {
- relation: 'boss',
- },
- {
- relation: 'client',
- },
- {
- relation: 'sip',
- },
- ],
-};
+const filter = { where: { id: entityId.value } };
-
+
{{ entity.id }} - {{ entity.firstName }} {{ entity.lastName }}
@@ -103,12 +68,6 @@ const filter = {
-
-
- {{ t('worker.summary.personalPhone') }}
-
-
-
diff --git a/src/router/modules/Supplier.js b/src/router/modules/Supplier.js
index 64c48146b..da45aad2f 100644
--- a/src/router/modules/Supplier.js
+++ b/src/router/modules/Supplier.js
@@ -45,7 +45,8 @@ export default {
path: 'create',
name: 'SupplierCreate',
meta: {
- title: 'create',
+ title: 'supplierCreate',
+ icon: 'add',
},
component: () => import('src/pages/Supplier/SupplierCreate.vue'),
},
diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js
index 75188bd32..5ef5945f3 100644
--- a/src/router/modules/customer.js
+++ b/src/router/modules/customer.js
@@ -22,7 +22,7 @@ export default {
'CustomerBasicData',
'CustomerFiscalData',
'CustomerBillingData',
- 'CustomerConsignees',
+ 'CustomerAddress',
'CustomerNotes',
'CustomerCredits',
'CustomerGreuges',
@@ -55,7 +55,8 @@ export default {
path: 'create',
name: 'CustomerCreate',
meta: {
- title: 'create',
+ title: 'customerCreate',
+ icon: 'add',
},
component: () => import('src/pages/Customer/CustomerCreate.vue'),
},
@@ -152,45 +153,45 @@ export default {
import('src/pages/Customer/Card/CustomerBillingData.vue'),
},
{
- path: 'consignees',
- name: 'ConsigneesCard',
- redirect: { name: 'CustomerConsignees' },
+ path: 'address',
+ name: 'AddressCard',
+ redirect: { name: 'CustomerAddress' },
children: [
{
path: '',
- name: 'CustomerConsignees',
+ name: 'CustomerAddress',
meta: {
icon: 'vn:delivery',
title: 'consignees',
},
component: () =>
- import('src/pages/Customer/Card/CustomerConsignees.vue'),
+ import('src/pages/Customer/Card/CustomerAddress.vue'),
},
{
path: 'create',
- name: 'CustomerConsigneeCreate',
+ name: 'CustomerAddressCreate',
meta: {
- title: 'consignee-create',
+ title: 'address-create',
},
component: () =>
import(
- 'src/pages/Customer/components/CustomerConsigneeCreate.vue'
+ 'src/pages/Customer/components/CustomerAddressCreate.vue'
),
},
{
- path: ':consigneeId',
- name: 'CustomerConsigneeEditCard',
- redirect: { name: 'CustomerConsigneeEdit' },
+ path: ':addressId',
+ name: 'CustomerAddressEditCard',
+ redirect: { name: 'CustomerAddressEdit' },
children: [
{
path: 'edit',
- name: 'CustomerConsigneeEdit',
+ name: 'CustomerAddressEdit',
meta: {
- title: 'consignee-edit',
+ title: 'address-edit',
},
component: () =>
import(
- 'src/pages/Customer/components/CustomerConsigneeEdit.vue'
+ 'src/pages/Customer/components/CustomerAddressEdit.vue'
),
},
],
@@ -199,7 +200,7 @@ export default {
},
{
path: 'notes',
- name: 'NotesCard',
+ name: 'CustomerNotesCard',
redirect: { name: 'CustomerNotes' },
children: [
{
@@ -357,36 +358,55 @@ export default {
{
name: 'CustomerCreditContracts',
title: 'creditContracts',
- icon: 'paid',
+ icon: 'vn:solunion',
},
{
name: 'CustomerCreditOpinion',
title: 'creditOpinion',
- icon: 'paid',
+ icon: 'vn:linesprepaired',
},
],
},
- component: () =>
- import('src/pages/Customer/Card/CustomerCreditManagement.vue'),
children: [
{
path: 'credit-contracts',
- name: 'CustomerCreditContracts',
- meta: {
- title: 'creditContracts',
- icon: 'paid',
- },
- component: () =>
- import(
- 'src/pages/Customer/Card/CustomerCreditContracts.vue'
- ),
+ name: 'CreditContractsCard',
+ redirect: { name: 'CustomerCreditContracts' },
+ children: [
+ {
+ path: '',
+ name: 'CustomerCreditContracts',
+ meta: {
+ title: 'creditContracts',
+ },
+ component: () =>
+ import(
+ 'src/pages/Customer/Card/CustomerCreditContracts.vue'
+ ),
+ },
+ {
+ path: 'create',
+ name: 'CustomerCreditContractsCreate',
+ component: () =>
+ import(
+ 'src/pages/Customer/components/CustomerCreditContractsCreate.vue'
+ ),
+ },
+ {
+ path: 'insurance/:creditId',
+ name: 'CustomerCreditContractsInsurance',
+ component: () =>
+ import(
+ 'src/pages/Customer/components/CustomerCreditContractsInsurance.vue'
+ ),
+ },
+ ],
},
{
path: 'credit-opinion',
name: 'CustomerCreditOpinion',
meta: {
title: 'creditOpinion',
- icon: 'paid',
},
component: () =>
import(
@@ -395,15 +415,177 @@ export default {
},
],
},
-
{
path: 'others',
name: 'CustomerOthers',
meta: {
title: 'others',
icon: 'pending',
+ menuChildren: [
+ {
+ name: 'CustomerSamples',
+ title: 'samples',
+ icon: 'vn:notes',
+ },
+ {
+ name: 'CustomerConsumption',
+ title: 'consumption',
+ icon: 'show_chart',
+ },
+ {
+ name: 'CustomerMandates',
+ title: 'mandates',
+ icon: 'vn:mandatory',
+ },
+ {
+ name: 'CustomerContacts',
+ title: 'contacts',
+ icon: 'contact_phone',
+ },
+ {
+ name: 'CustomerWebPayment',
+ title: 'webPayment',
+ icon: 'vn:onlinepayment',
+ },
+ {
+ name: 'CustomerFileManagement',
+ title: 'fileManagement',
+ icon: 'Upload',
+ },
+ {
+ name: 'CustomerUnpaid',
+ title: 'unpaid',
+ icon: 'vn:defaulter',
+ },
+ ],
},
- component: () => import('src/pages/Customer/Card/CustomerOthers.vue'),
+ children: [
+ {
+ path: 'samples',
+ name: 'CustomerSamples',
+ meta: {
+ title: 'samples',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerSamples.vue'),
+ },
+ {
+ path: 'samples',
+ name: 'CustomerSamplesCard',
+ redirect: { name: 'CustomerSamples' },
+ children: [
+ {
+ path: '',
+ name: 'CustomerSamples',
+ meta: {
+ title: 'samples',
+ },
+ component: () =>
+ import(
+ 'src/pages/Customer/Card/CustomerSamples.vue'
+ ),
+ },
+ {
+ path: 'create',
+ name: 'CustomerSamplesCreate',
+ component: () =>
+ import(
+ 'src/pages/Customer/components/CustomerSamplesCreate.vue'
+ ),
+ },
+ ],
+ },
+ {
+ path: 'consumption',
+ name: 'CustomerConsumption',
+ meta: {
+ title: 'consumption',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerConsumption.vue'),
+ },
+ {
+ path: 'mandates',
+ name: 'CustomerMandates',
+ meta: {
+ title: 'mandates',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerMandates.vue'),
+ },
+ {
+ path: 'contacts',
+ name: 'CustomerContacts',
+ meta: {
+ title: 'contacts',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerContacts.vue'),
+ },
+ {
+ path: 'web-payment',
+ name: 'CustomerWebPayment',
+ meta: {
+ title: 'webPayment',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerWebPayment.vue'),
+ },
+ {
+ path: 'file-management',
+ name: 'CustomerFileManagement',
+ meta: {
+ title: 'fileManagement',
+ },
+ component: () =>
+ import(
+ 'src/pages/Customer/Card/CustomerFileManagement.vue'
+ ),
+ },
+ {
+ path: 'file-management',
+ name: 'CustomerFileManagementCard',
+ redirect: { name: 'CustomerFileManagement' },
+ children: [
+ {
+ path: '',
+ name: 'CustomerFileManagement',
+ meta: {
+ title: 'fileManagement',
+ },
+ component: () =>
+ import(
+ 'src/pages/Customer/Card/CustomerFileManagement.vue'
+ ),
+ },
+ {
+ path: 'create',
+ name: 'CustomerFileManagementCreate',
+ component: () =>
+ import(
+ 'src/pages/Customer/components/CustomerFileManagementCreate.vue'
+ ),
+ },
+ {
+ path: ':dmsId/edit',
+ name: 'CustomerFileManagementEdit',
+ component: () =>
+ import(
+ 'src/pages/Customer/components/CustomerFileManagementEdit.vue'
+ ),
+ },
+ ],
+ },
+ {
+ path: 'unpaid',
+ name: 'CustomerUnpaid',
+ meta: {
+ title: 'unpaid',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerUnpaid.vue'),
+ },
+ ],
},
],
},
diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js
index 50a651af5..67fc41824 100644
--- a/src/router/modules/entry.js
+++ b/src/router/modules/entry.js
@@ -34,7 +34,8 @@ export default {
path: 'create',
name: 'EntryCreate',
meta: {
- title: 'create',
+ title: 'entryCreate',
+ icon: 'add',
},
component: () => import('src/pages/Entry/EntryCreate.vue'),
},
diff --git a/src/router/modules/item.js b/src/router/modules/item.js
index d3462e15c..41f3ec92a 100644
--- a/src/router/modules/item.js
+++ b/src/router/modules/item.js
@@ -10,15 +10,15 @@ export default {
component: RouterView,
redirect: { name: 'ItemMain' },
menus: {
- main: [],
- card: [],
+ main: ['ItemList', 'WasteBreakdown'],
+ card: ['ItemBasicData'],
},
children: [
{
path: '',
name: 'ItemMain',
component: () => import('src/pages/Item/ItemMain.vue'),
- redirect: { name: 'Itemlist' },
+ redirect: { name: 'ItemList' },
children: [
{
path: 'list',
@@ -29,6 +29,27 @@ export default {
},
component: () => import('src/pages/Item/ItemList.vue'),
},
+ {
+ path: 'create',
+ name: 'ItemCreate',
+ meta: {
+ title: 'create',
+ },
+ component: () => import('src/pages/Item/ItemCreate.vue'),
+ },
+ {
+ path: 'waste-breakdown',
+ name: 'WasteBreakdown',
+ meta: {
+ title: 'wasteBreakdown',
+ icon: 'vn:claims',
+ },
+ beforeEnter: (to, from, next) => {
+ next({ name: 'ItemList' });
+ window.location.href =
+ 'https://grafana.verdnatura.es/d/TTNXQAxVk';
+ },
+ },
],
},
{
@@ -64,6 +85,15 @@ export default {
},
component: () => import('src/pages/Item/Card/ItemTags.vue'),
},
+ {
+ path: 'basic-data',
+ name: 'ItemBasicData',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Item/Card/ItemBasicData.vue'),
+ },
],
},
],
diff --git a/src/router/modules/order.js b/src/router/modules/order.js
index 16d73281b..eb5424e75 100644
--- a/src/router/modules/order.js
+++ b/src/router/modules/order.js
@@ -34,7 +34,8 @@ export default {
path: 'create',
name: 'OrderCreate',
meta: {
- title: 'create',
+ title: 'orderCreate',
+ icon: 'add',
},
component: () => import('src/pages/Order/Card/OrderForm.vue'),
},
diff --git a/src/router/modules/route.js b/src/router/modules/route.js
index 099492981..f8ededf55 100644
--- a/src/router/modules/route.js
+++ b/src/router/modules/route.js
@@ -34,7 +34,8 @@ export default {
path: 'create',
name: 'RouteCreate',
meta: {
- title: 'create',
+ title: 'routeCreate',
+ icon: 'add',
},
component: () => import('src/pages/Route/Card/RouteForm.vue'),
},
diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js
index b881ca020..d20ce40f4 100644
--- a/src/router/modules/shelving.js
+++ b/src/router/modules/shelving.js
@@ -34,7 +34,8 @@ export default {
path: 'create',
name: 'ShelvingCreate',
meta: {
- title: 'create',
+ title: 'shelvingCreate',
+ icon: 'add',
},
component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'),
},
diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js
index d6b714154..eb6c1b6d2 100644
--- a/src/router/modules/ticket.js
+++ b/src/router/modules/ticket.js
@@ -38,7 +38,7 @@ export default {
icon: 'vn:ticketAdd',
roles: ['developer'],
},
- component: () => import('src/pages/Ticket/TicketList.vue'),
+ component: () => import('src/pages/Ticket/TicketCreate.vue'),
},
],
},
diff --git a/src/router/modules/travel.js b/src/router/modules/travel.js
index 2f1e2150e..e1a08e9de 100644
--- a/src/router/modules/travel.js
+++ b/src/router/modules/travel.js
@@ -44,6 +44,7 @@ export default {
name: 'TravelCreate',
meta: {
title: 'travelCreate',
+ icon: 'add',
},
component: () => import('src/pages/Travel/TravelCreate.vue'),
},
diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js
index 68f096220..bf8d6093f 100644
--- a/src/router/modules/worker.js
+++ b/src/router/modules/worker.js
@@ -19,6 +19,8 @@ export default {
'WorkerNotificationsManager',
'WorkerPBX',
'WorkerLog',
+ 'WorkerCalendar',
+ 'WorkerDms',
],
departmentCard: ['BasicData'],
},
@@ -52,7 +54,7 @@ export default {
name: 'WorkerCreate',
meta: {
title: 'workerCreate',
- icon: '',
+ icon: 'add',
},
component: () => import('src/pages/Worker/WorkerCreate.vue'),
},
@@ -127,6 +129,15 @@ export default {
},
component: () => import('src/pages/Worker/Card/WorkerPBX.vue'),
},
+ {
+ name: 'WorkerDms',
+ path: 'dms',
+ meta: {
+ title: 'dms',
+ icon: 'cloud_upload',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerDms.vue'),
+ },
{
name: 'WorkerLog',
path: 'log',
@@ -136,6 +147,15 @@ export default {
},
component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
},
+ {
+ name: 'WorkerCalendar',
+ path: 'calendar',
+ meta: {
+ title: 'calendar',
+ icon: 'calendar_today',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerCalendar.vue'),
+ },
],
},
],
diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js
index afd3af0c0..f075301f6 100644
--- a/src/stores/useNavigationStore.js
+++ b/src/stores/useNavigationStore.js
@@ -7,6 +7,7 @@ import routes from 'src/router/modules';
export const useNavigationStore = defineStore('navigationStore', () => {
const modules = [
+ 'item',
'shelving',
'order',
'customer',
diff --git a/src/stores/useWeekdayStore.js b/src/stores/useWeekdayStore.js
new file mode 100644
index 000000000..ad898c9a7
--- /dev/null
+++ b/src/stores/useWeekdayStore.js
@@ -0,0 +1,95 @@
+import { reactive, ref, computed } from 'vue';
+import { useI18n } from 'vue-i18n';
+import { defineStore } from 'pinia';
+
+export const useWeekdayStore = defineStore('weekdayStore', () => {
+ const { t } = useI18n();
+
+ const weekdays = [
+ { code: 'sun', name: 'Sunday' },
+ { code: 'mon', name: 'Monday' },
+ { code: 'tue', name: 'Tuesday' },
+ { code: 'wed', name: 'Wednesday' },
+ { code: 'thu', name: 'Thursday' },
+ { code: 'fri', name: 'Friday' },
+ { code: 'sat', name: 'Saturday' },
+ ];
+
+ const monthCodes = [
+ 'jan',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'may',
+ 'jun',
+ 'jul',
+ 'aug',
+ 'sep',
+ 'oct',
+ 'nov',
+ 'dec',
+ ];
+
+ const localeOrder = {
+ es: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'],
+ en: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'],
+ };
+
+ const weekdaysMap = reactive({});
+ const localeWeekdays = ref([]);
+
+ const initStore = () => {
+ getWeekdaysMap();
+ };
+
+ const getWeekdaysMap = () => {
+ if (Object.keys(weekdaysMap).length > 0) return weekdaysMap;
+
+ weekdays.forEach((day, i) => {
+ const obj = {
+ ...day,
+ index: i,
+ char: day.name.substr(0, 1),
+ abr: day.name.substr(0, 3),
+ };
+ weekdaysMap[day.code] = obj;
+ });
+ };
+
+ const getLocales = computed(() => {
+ // El día de mañana esto permitirá ordenar los weekdays en base a el locale si se lo desea reemplazando localeOrder.es por localeOrder[locale]
+ const locales = [];
+ for (let code of localeOrder.es) {
+ const obj = {
+ ...weekdaysMap[code],
+ locale: t(`weekdays.${weekdaysMap[code].code}`),
+ localeChar: t(`weekdays.${weekdaysMap[code].code}`).substr(0, 1),
+ localeAbr: t(`weekdays.${weekdaysMap[code].code}`).substr(0, 3),
+ };
+ locales.push(obj);
+ }
+ return locales;
+ });
+
+ const getLocaleMonths = computed(() => {
+ const locales = [];
+ for (let code of monthCodes) {
+ const obj = {
+ code: code,
+ locale: t(`months.${code}`),
+ };
+ locales.push(obj);
+ }
+ return locales;
+ });
+
+ return {
+ initStore,
+ weekdaysMap,
+ localeWeekdays,
+ getLocales,
+ weekdays,
+ monthCodes,
+ getLocaleMonths,
+ };
+});
diff --git a/test/cypress/integration/VnLocation.spec.js b/test/cypress/integration/VnLocation.spec.js
index 3a90afce9..f89a0f716 100644
--- a/test/cypress/integration/VnLocation.spec.js
+++ b/test/cypress/integration/VnLocation.spec.js
@@ -1,48 +1,64 @@
-const locationOptions ='[role="listbox"] > div.q-virtual-scroll__content > .q-item'
+const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
describe('VnLocation', () => {
- describe('Create',()=>{
- const inputLocation = ':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control';
+ describe('Create', () => {
+ const inputLocation =
+ '.q-form .q-card> :nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/worker/create');
cy.waitForElement('.q-card');
});
- it('Show all options', function() {
+ it('Show all options', function () {
cy.get(inputLocation).click();
- cy.get(locationOptions).should('have.length.at.least',5);
+ cy.get(locationOptions).should('have.length.at.least', 5);
});
- it('input filter location as "al"', function() {
+ it('input filter location as "al"', function () {
cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('al');
- cy.get(locationOptions).should('have.length.at.least',3);
+ cy.get(locationOptions).should('have.length.at.least', 3);
});
- it('input filter location as "ecuador"', function() {
+ it('input filter location as "ecuador"', function () {
cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('ecuador');
- cy.get(locationOptions).should('have.length.at.least',1);
+ cy.get(locationOptions).should('have.length.at.least', 1);
cy.get(`${locationOptions}:nth-child(1)`).click();
- cy.get(':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon').click();
+ cy.get(inputLocation + '> :nth-child(2) > .q-icon').click();
});
});
- describe('Fiscal-data',()=>{
+ describe('Fiscal-data', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit('/#/supplier/567/fiscal-data', {timeout: 2000});
+ cy.visit('/#/supplier/567/fiscal-data', { timeout: 2000 });
cy.waitForElement('.q-card');
});
- it('Create postCode', function() {
- cy.get(':nth-child(6) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(3) > .q-icon').click();
+ it('Create postCode', function () {
+ cy.get(
+ ':nth-child(6) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(3) > .q-icon'
+ ).click();
cy.get(' .q-card > h1').should('have.text', 'New postcode');
- cy.get('.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input').clear('12');
- cy.get('.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input').type('1234453');
- cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ', 'Valencia');
- cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control ', 'Province one');
- cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ', 'España');
+ cy.get(
+ '.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input'
+ ).clear('12');
+ cy.get(
+ '.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input'
+ ).type('1234453');
+ cy.selectOption(
+ '.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ',
+ 'Valencia'
+ );
+ cy.selectOption(
+ '.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control ',
+ 'Province one'
+ );
+ cy.selectOption(
+ '.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ',
+ 'España'
+ );
cy.get('.q-mt-lg > .q-btn--standard').click();
});
});
-})
+});
diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js
index 26c7ee196..903f58d4b 100755
--- a/test/cypress/integration/claim/claimDevelopment.spec.js
+++ b/test/cypress/integration/claim/claimDevelopment.spec.js
@@ -8,6 +8,7 @@ describe('ClaimDevelopment', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
+ cy.waitForElement('tbody');
});
it('should reset line', () => {
diff --git a/test/cypress/integration/claim/claimNotes.spec.js b/test/cypress/integration/claim/claimNotes.spec.js
index 0a0f28fe7..a4a493cda 100644
--- a/test/cypress/integration/claim/claimNotes.spec.js
+++ b/test/cypress/integration/claim/claimNotes.spec.js
@@ -1,4 +1,3 @@
-///
describe('ClaimNotes', () => {
beforeEach(() => {
cy.login('developer');
@@ -7,11 +6,8 @@ describe('ClaimNotes', () => {
it('should add a new note', () => {
const message = 'This is a new message.';
- cy.get('.q-page-sticky > div > button').click();
- cy.get('.q-dialog .q-card__section:nth-child(2)').type(message);
- cy.get('.q-card__actions button:nth-child(2)').click();
- cy.get('.q-card .q-card__section:nth-child(2)')
- .eq(0)
- .should('have.text', message);
+ cy.get('.q-textarea').type(message);
+ cy.get('.q-field__append > .q-btn > .q-btn__content > .q-icon').click(); //save
+ cy.get(':nth-child(1) > .q-card__section--vert').should('have.text', message);
});
});
diff --git a/test/cypress/integration/entry/entryDms.spec.js b/test/cypress/integration/entry/entryDms.spec.js
index 79a9c5162..5f9fae3dd 100644
--- a/test/cypress/integration/entry/entryDms.spec.js
+++ b/test/cypress/integration/entry/entryDms.spec.js
@@ -5,37 +5,40 @@ describe('WagonTypeCreate', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/entry/${entryId}/dms`);
-
});
it('should create edit and remove new dms', () => {
cy.addRow();
- cy.get('.icon-attach').click()
+ cy.get('.icon-attach').click();
cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
- cy.get("tbody > tr").then((value) => {
+ cy.get('tbody > tr').then((value) => {
+ const u = undefined;
+
//Create and check if exist new row
let newFileTd = Cypress.$(value).length;
cy.get('.q-btn--standard > .q-btn__content > .block').click();
expect(value).to.have.length(newFileTd++);
- const newRowSelector = `tbody > :nth-child(${newFileTd})`
+ const newRowSelector = `tbody > :nth-child(${newFileTd})`;
cy.waitForElement(newRowSelector);
+ cy.validateRow(newRowSelector, [u, u, u, u, 'ENTRADA ID 1']);
//Edit new dms
- const u = undefined;
- cy.validateRow(newRowSelector, [u,u,u,u,'ENTRADA ID 1'])
- cy.get(`tbody :nth-child(${newFileTd}) > .text-right > .flex > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`).click();
- })
- // cy.log('newFileTd', newFileTd)
+ const newDescription = 'entry id 1 modified';
+ const textAreaSelector =
+ '.q-textarea > .q-field__inner > .q-field__control > .q-field__control-container';
+ cy.get(
+ `tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`
+ ).click();
- // //Create and check if exist new row
- // cy.log('newFileTd:', newFileTd);
- // cy.get(`tbody :nth-child(${newFileTd}) > .text-right > .flex > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`).click()
+ cy.get(textAreaSelector).clear();
+ cy.get(textAreaSelector).type(newDescription);
+ cy.saveCard();
+ cy.reload();
- // cy.get(`tbody :nth-child(${newFileTd}) > :nth-child(5) > .q-tr > :nth-child(1) > span`).then((value) => {
- // cy.log(value)
- // });
+ cy.validateRow(newRowSelector, [u, u, u, u, newDescription]);
+ });
});
});
diff --git a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js
index 20f137aeb..fc989d6c5 100644
--- a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js
@@ -1,6 +1,6 @@
///
describe('InvoiceInBasicData', () => {
- const selects = ':nth-child(1) > :nth-child(1) > .q-field';
+ const selects = '.q-form .q-card>:nth-child(1) > :nth-child(1) > .q-field';
const appendBtns = 'label button';
const dialogAppendBtns = '.q-dialog label button';
const dialogInputs = '.q-dialog input';
diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
index 811374b98..2f045f32c 100644
--- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
@@ -37,6 +37,7 @@ describe('InvoiceInVat', () => {
it('should throw an error if there are fields undefined', () => {
cy.get(inputBtns).eq(0).click();
+ cy.get(':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon').click();
cy.get(dialogBtns).eq(2).click();
cy.get('.q-notification__message').should('have.text', "The code can't be empty");
});
@@ -44,7 +45,7 @@ describe('InvoiceInVat', () => {
it('should correctly handle expense addition', () => {
cy.get(inputBtns).eq(0).click();
- cy.get(dialogInputs).eq(0).click();
+ cy.get(':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon').click();
cy.get(dialogInputs).eq(0).type(randomInt);
cy.get(dialogInputs).eq(1).click();
cy.get(dialogInputs).eq(1).type('This is a dummy expense');
diff --git a/test/cypress/integration/worker/workerList.spec.js b/test/cypress/integration/worker/workerList.spec.js
index c950f9fed..38e7ea6d0 100644
--- a/test/cypress/integration/worker/workerList.spec.js
+++ b/test/cypress/integration/worker/workerList.spec.js
@@ -8,9 +8,9 @@ describe('WorkerList', () => {
});
it('should load workers', () => {
- cy.get(workerFieldNames).eq(0).should('have.text', 'JessicaJones');
- cy.get(workerFieldNames).eq(1).should('have.text', 'BruceBanner');
- cy.get(workerFieldNames).eq(2).should('have.text', 'CharlesXavier');
+ cy.get(workerFieldNames).eq(0).should('have.text', 'jessicajones');
+ cy.get(workerFieldNames).eq(1).should('have.text', 'brucebanner');
+ cy.get(workerFieldNames).eq(2).should('have.text', 'charlesxavier');
});
it('should open the worker summary', () => {
diff --git a/test/cypress/integration/worker/workerNotificationsManager.spec.js b/test/cypress/integration/worker/workerNotificationsManager.spec.js
index 175933277..ac452c4ff 100644
--- a/test/cypress/integration/worker/workerNotificationsManager.spec.js
+++ b/test/cypress/integration/worker/workerNotificationsManager.spec.js
@@ -60,7 +60,6 @@ describe('WorkerNotificationsManager', () => {
it('should active a notification if you are their boss', () => {
cy.login('salesBoss');
cy.visit(`/#/worker/${salesPersonId}/notifications`);
- cy.waitForElement(activeList);
cy.waitForElement(availableList);
cy.get(activeList)
diff --git a/test/cypress/integration/worker/workerSummary.spec.js b/test/cypress/integration/worker/workerSummary.spec.js
index 7228b4b31..3d70fdf96 100644
--- a/test/cypress/integration/worker/workerSummary.spec.js
+++ b/test/cypress/integration/worker/workerSummary.spec.js
@@ -6,7 +6,8 @@ describe('WorkerSummary', () => {
});
it('should load worker summary', () => {
- cy.get('.summaryHeader > div').should('have.text', '19 - salesBoss salesBoss');
+ cy.waitForElement('.summaryHeader');
+ cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss');
cy.get(':nth-child(1) > :nth-child(2) > .value > span').should(
'have.text',
'salesBossNick'
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 544e7e6b5..28a8aa979 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -72,6 +72,7 @@ Cypress.Commands.add('getValue', (selector) => {
// Fill Inputs
Cypress.Commands.add('selectOption', (selector, option) => {
+ cy.waitForElement(selector);
cy.get(selector).find('.q-select__dropdown-icon').click();
cy.get('.q-menu .q-item').contains(option).click();
});
@@ -183,11 +184,11 @@ Cypress.Commands.add('closeSideMenu', (element) => {
Cypress.Commands.add('clearSearchbar', (element) => {
if (element) cy.waitForElement(element);
- cy.get('#searchbar > form > label > div:nth-child(1) input').clear();
+ cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').clear();
});
Cypress.Commands.add('writeSearchbar', (value) => {
- cy.get('#searchbar > form > label > div:nth-child(1) input').type(value);
+ cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').type(value);
});
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);
diff --git a/vitest.config.js b/vitest.config.js
index 5a8699e99..ca9f6c1fe 100644
--- a/vitest.config.js
+++ b/vitest.config.js
@@ -19,7 +19,7 @@ export default defineConfig({
plugins: [
vue({
template: {
- transformAssetUrls
+ transformAssetUrls,
},
}),
quasar({
@@ -27,7 +27,10 @@ export default defineConfig({
sassVariables: 'src/quasar-variables.scss',
}),
VueI18nPlugin({
- include: path.resolve(__dirname, 'src/i18n/**'),
+ include: [
+ path.resolve(__dirname, 'src/i18n/**'),
+ path.resolve(__dirname, 'src/pages/**/locale/**'),
+ ],
}),
jsconfigPaths(),
],