diff --git a/src/pages/Customer/Card/CustomerGreuges.vue b/src/pages/Customer/Card/CustomerGreuges.vue
index 8cca2ef23..12173727f 100644
--- a/src/pages/Customer/Card/CustomerGreuges.vue
+++ b/src/pages/Customer/Card/CustomerGreuges.vue
@@ -2,101 +2,86 @@
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
-import { QBtn } from 'quasar';
-import { useStateStore } from 'src/stores/useStateStore';
import { toCurrency } from 'src/filters';
import { toDateTimeFormat } from 'src/filters/date';
-import FetchData from 'components/FetchData.vue';
-import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
+import VnTable from 'components/VnTable/VnTable.vue';
const { t } = useI18n();
const route = useRoute();
-const stateStore = computed(() => useStateStore());
const rows = ref([]);
const totalAmount = ref();
-
-const filter = {
- include: [
- {
- relation: 'greugeType',
- scope: {
- fields: ['id', 'name'],
+const tableRef = ref();
+const filter = computed(() => {
+ return {
+ include: [
+ {
+ relation: 'greugeType',
+ scope: {
+ fields: ['id', 'name'],
+ },
},
- },
- {
- relation: 'user',
- scope: {
- fields: ['id', 'name'],
+ {
+ relation: 'user',
+ scope: {
+ fields: ['id', 'name'],
+ },
},
+ ],
+ where: {
+ clientFk: route.params.id,
},
- ],
- order: 'shipped DESC, amount',
- where: {
- clientFk: `${route.params.id}`,
- },
- limit: 20,
-};
-
-const tableColumnComponents = {
- date: {
- component: 'span',
- props: () => {},
- event: () => {},
- },
- createdBy: {
- component: QBtn,
- props: () => ({ flat: true, color: 'blue', noCaps: true }),
- event: () => {},
- },
- comment: {
- component: 'span',
- props: () => {},
- event: () => {},
- },
- type: {
- component: 'span',
- props: () => {},
- event: () => {},
- },
- amount: {
- component: 'span',
- props: () => {},
- event: () => {},
- },
-};
+ };
+});
const columns = computed(() => [
{
align: 'left',
- field: 'shipped',
label: t('Date'),
- name: 'date',
- format: (value) => toDateTimeFormat(value),
+ name: 'shipped',
+ format: ({ shipped }) => toDateTimeFormat(shipped),
+ create: true,
+ columnCreate: {
+ component: 'date',
+ autofocus: true,
+ },
},
{
align: 'left',
- field: (value) => value?.user?.name,
+ name: 'userFk',
label: t('Created by'),
- name: 'createdBy',
+ component: 'userLink',
+ attrs: ({ row }) => {
+ return {
+ defaultName: true,
+ workerId: row.user?.id,
+ name: row.user?.name,
+ };
+ },
},
{
align: 'left',
- field: 'description',
+ name: 'description',
label: t('Comment'),
- name: 'comment',
+ create: true,
},
{
align: 'left',
- field: (value) => value?.greugeType?.name,
+ name: 'greugeTypeFk',
+ format: ({ greugeType }) => greugeType?.name,
label: t('Type'),
- name: 'type',
+ create: true,
+ columnCreate: {
+ component: 'select',
+ url: 'greugeTypes',
+ limit: 0,
+ },
},
{
align: 'left',
- field: 'amount',
- label: t('Amount'),
name: 'amount',
- format: (value) => toCurrency(value),
+ label: t('Amount'),
+ format: ({ amount }) => toCurrency(amount),
+ create: true,
},
]);
@@ -107,60 +92,33 @@ const setRows = (data) => {
-
-
-
-
- {{ t('Total') }}:
- {{ toCurrency(totalAmount) }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ props.value }}
-
-
-
-
-
-
+ setRows(data)"
+ :create="{
+ urlCreate: `Greuges`,
+ title: t('New credit'),
+ onDataSaved: () => tableRef.reload(),
+ formInitialData: { shipped: new Date(), clientFk: route.params.id },
+ }"
+ auto-load
+ >
+
+
+ {{ t('Total') }}: {{ toCurrency(totalAmount) }}
-
-
-
-
-
-
- {{ t('New greuge') }}
-
-
+
+
-
-
-es:
- New note: Nueva nota
-
diff --git a/src/pages/Customer/Card/CustomerRecoveries.vue b/src/pages/Customer/Card/CustomerRecoveries.vue
index 289b4bc0e..8d3d05702 100644
--- a/src/pages/Customer/Card/CustomerRecoveries.vue
+++ b/src/pages/Customer/Card/CustomerRecoveries.vue
@@ -1,146 +1,107 @@
- (rows = data)"
- auto-load
+
-
-
-
-
-
-
-
-
- {{ props.value }}
-
-
-
-
-
-
-
-
-
-
-
- {{ t('New recoverie') }}
-
-
-
-
es:
- Since: Desde
- To: Hasta
- Amount: Importe
Period: Periodo
- New recoverie: Nuevo recobro
+ New recovery: Nuevo recobro
+ Finish that recovery period: Terminar recobro
diff --git a/src/pages/Customer/Card/CustomerSms.vue b/src/pages/Customer/Card/CustomerSms.vue
index a567f6b47..0ad1f8168 100644
--- a/src/pages/Customer/Card/CustomerSms.vue
+++ b/src/pages/Customer/Card/CustomerSms.vue
@@ -1,17 +1,16 @@
-
-
-
+
diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue
index 33659dd77..8d025a365 100644
--- a/src/pages/Customer/Card/CustomerWebAccess.vue
+++ b/src/pages/Customer/Card/CustomerWebAccess.vue
@@ -2,164 +2,81 @@
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
-
import axios from 'axios';
import { useQuasar } from 'quasar';
-import { useValidator } from 'src/composables/useValidator';
-import useNotify from 'src/composables/useNotify';
-import { useStateStore } from 'stores/useStateStore';
-
-import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue';
import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue';
+import FormModel from 'components/FormModel.vue';
-const { notify } = useNotify();
const { t } = useI18n();
-const { validate } = useValidator();
const quasar = useQuasar();
const route = useRoute();
-const stateStore = useStateStore();
-
-const active = ref(false);
const canChangePassword = ref(0);
-const email = ref(null);
-const isLoading = ref(false);
-const name = ref(null);
-const usersPreviewRef = ref(null);
-const user = ref([]);
-const dataChanges = computed(() => {
- return (
- user.value.active !== active.value ||
- user.value.email !== email.value ||
- user.value.name !== name.value
- );
+const filter = computed(() => {
+ return {
+ fields: ['active', 'email', 'name'],
+ where: { id: route.params.id },
+ };
});
-const filter = { where: { id: `${route.params.id}` } };
-
const showChangePasswordDialog = () => {
quasar.dialog({
component: CustomerChangePassword,
componentProps: {
id: route.params.id,
- promise: usersPreviewRef.value.fetch(),
},
});
};
-const setInitialData = () => {
- if (user.value.length) {
- active.value = user.value[0].active;
- email.value = user.value[0].email;
- name.value = user.value[0].name;
- }
-};
-
-const onSubmit = async () => {
- isLoading.value = true;
-
- const payload = {
- active: active.value,
- email: email.value,
- name: name.value,
- };
- try {
- await axios.patch(`Clients/${route.params.id}/updateUser`, payload);
- notify('globals.dataSaved', 'positive');
- if (usersPreviewRef.value) usersPreviewRef.value.fetch();
- } catch (error) {
- notify('errors.create', 'negative');
- } finally {
- isLoading.value = false;
- }
-};
+async function hasCustomerRole() {
+ const { data } = await axios(`Clients/${route.params.id}/hasCustomerRole`);
+ canChangePassword.value = data;
+}
- {
- user = data;
- setInitialData();
+ model="webAccess"
+ :mapper="
+ ({ active, name, email }) => {
+ return {
+ active,
+ name,
+ email,
+ };
}
"
+ @on-fetch="hasCustomerRole()"
auto-load
- ref="usersPreviewRef"
- url="VnUsers/preview"
- />
- (canChangePassword = data)"
- auto-load
- />
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{
- t(
- 'This email is used for user to regain access their account'
- )
- }}
-
-
-
-
-
-
-
-
+
+
diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue
index b173242b6..82ad559ad 100644
--- a/src/pages/Customer/CustomerList.vue
+++ b/src/pages/Customer/CustomerList.vue
@@ -105,9 +105,9 @@ const columns = computed(() => [
component: null,
after: {
component: markRaw(VnLinkPhone),
- attrs: (prop) => {
+ attrs: ({ model }) => {
return {
- 'phone-number': prop,
+ 'phone-number': model,
};
},
},
diff --git a/src/pages/Customer/Payments/CustomerPaymentsFilter.vue b/src/pages/Customer/Payments/CustomerPaymentsFilter.vue
index 1b79868c0..8982cba5a 100644
--- a/src/pages/Customer/Payments/CustomerPaymentsFilter.vue
+++ b/src/pages/Customer/Payments/CustomerPaymentsFilter.vue
@@ -3,7 +3,7 @@ import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
-import VnCurrency from 'src/components/common/VnCurrency.vue';
+import VnInputNumber from 'src/components/common/VnInputNumber.vue';
const { t } = useI18n();
const props = defineProps({
@@ -47,7 +47,11 @@ const props = defineProps({
-
+
diff --git a/src/pages/Customer/components/CustomerCreditCreate.vue b/src/pages/Customer/components/CustomerCreditCreate.vue
deleted file mode 100644
index 729deb258..000000000
--- a/src/pages/Customer/components/CustomerCreditCreate.vue
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-es:
- Credit: Crédito
-
diff --git a/src/pages/Customer/components/CustomerGreugeCreate.vue b/src/pages/Customer/components/CustomerGreugeCreate.vue
deleted file mode 100644
index 06b1b2124..000000000
--- a/src/pages/Customer/components/CustomerGreugeCreate.vue
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
- (greugeTypes = data)" auto-load url="greugeTypes" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-es:
- Amount: Importe
- Date: Fecha
- Comment: Comentario
- Type: Tipo
-
diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue
index cfa3acea8..16dd28767 100644
--- a/src/pages/Customer/components/CustomerNewPayment.vue
+++ b/src/pages/Customer/components/CustomerNewPayment.vue
@@ -2,21 +2,25 @@
import { onBeforeMount, reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
+import axios from 'axios';
import { useDialogPluginComponent } from 'quasar';
+import { usePrintService } from 'composables/usePrintService';
+import useNotify from 'src/composables/useNotify.js';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
+import VnInputNumber from 'components/common/VnInputNumber.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
-import { useState } from 'src/composables/useState';
+
const { t } = useI18n();
const route = useRoute();
+const { notify } = useNotify();
+const { sendEmail, openReport } = usePrintService();
const { dialogRef } = useDialogPluginComponent();
-const state = useState();
-const user = state.getUser();
const $props = defineProps({
companyId: {
@@ -29,7 +33,7 @@ const $props = defineProps({
},
promise: {
type: Function,
- required: true,
+ default: null,
},
});
@@ -38,11 +42,12 @@ const urlCreate = ref([]);
const companyOptions = ref([]);
const bankOptions = ref([]);
const clientFindOne = ref([]);
-const deliveredAmount = ref(null);
-const amountToReturn = ref(null);
-const viewRecipt = ref(true);
-const sendEmail = ref(false);
-const isLoading = ref(false);
+const viewReceipt = ref();
+const shouldSendEmail = ref(false);
+const maxAmount = ref();
+const accountingType = ref({});
+const isCash = ref(false);
+const formModelRef = ref(false);
const filterBanks = {
fields: ['id', 'bank', 'accountingTypeFk'],
@@ -57,77 +62,135 @@ const filterClientFindOne = {
id: route.params.id,
},
};
+
const initialData = reactive({
amountPaid: $props.totalCredit,
clientFk: route.params.id,
companyFk: $props.companyId,
email: clientFindOne.value.email,
- bankFk: user.value.localBankFk,
});
onBeforeMount(() => {
urlCreate.value = `Clients/${route.params.id}/createReceipt`;
});
-const setPaymentType = (id) => {
- initialData.payed = '2001-01-01T11:00:00.000Z';
- if (id === 1) initialData.description = 'Credit card';
- if (id === 2) initialData.description = 'Cash';
- if (id === 3 || id === 3117) initialData.description = '';
- if (id === 4) initialData.description = 'Transfer';
-};
+function setPaymentType(accounting) {
+ if (!accounting) return;
+ accountingType.value = accounting.accountingType;
+
+ initialData.description = [];
+ initialData.payed = Date.vnNew();
+ isCash.value = accountingType.value.code == 'cash';
+ viewReceipt.value = isCash.value;
+ if (accountingType.value.daysInFuture)
+ initialData.payed.setDate(
+ initialData.payed.getDate() + accountingType.value.daysInFuture
+ );
+ maxAmount.value = accountingType.value && accountingType.value.maxAmount;
+
+ if (accountingType.value.code == 'compensation')
+ return (initialData.description = '');
+ if (accountingType.value.receiptDescription)
+ initialData.description.push(accountingType.value.receiptDescription);
+ if (initialData.description) initialData.description.push(initialData.description);
+
+ initialData.description = initialData.description.join(', ');
+}
const calculateFromAmount = (event) => {
- amountToReturn.value = parseFloat(event) * -1 + parseFloat(deliveredAmount.value);
+ initialData.amountToReturn =
+ parseFloat(initialData.deliveredAmount) + parseFloat(event) * -1;
};
const calculateFromDeliveredAmount = (event) => {
- amountToReturn.value = parseFloat($props.totalCredit) * -1 + parseFloat(event);
+ initialData.amountToReturn = parseFloat(event) - initialData.amountPaid;
};
-const setClientEmail = (data) => {
- initialData.email = data.email;
-};
+function onBeforeSave(data) {
+ const exceededAmount = data.amountPaid > maxAmount.value;
+ if (isCash.value && exceededAmount)
+ return notify(t('Amount exceeded', { maxAmount: maxAmount.value }), 'negative');
-const onDataSaved = async () => {
- isLoading.value = true;
- if ($props.promise) {
- try {
- await $props.promise();
- } finally {
- isLoading.value = false;
- if (closeButton.value) closeButton.value.click();
- }
+ if (isCash.value && shouldSendEmail.value && !data.email)
+ return notify(t('There is no assigned email for this client'), 'negative');
+
+ data.bankFk = data.bankFk.id;
+ return data;
+}
+
+async function onDataSaved(formData, { id }) {
+ try {
+ if (shouldSendEmail.value && isCash.value)
+ await sendEmail(`Receipts/${id}/receipt-email`, {
+ recipient: formData.email,
+ });
+
+ if (viewReceipt.value) openReport(`Receipts/${id}/receipt-pdf`);
+ } finally {
+ if ($props.promise) $props.promise();
+ if (closeButton.value) closeButton.value.click();
}
-};
+}
+
+async function accountShortToStandard({ target: { value } }) {
+ if (!value) return (initialData.description = '');
+ initialData.compensationAccount = value.replace('.', '0'.repeat(11 - value.length));
+ const params = { bankAccount: initialData.compensationAccount };
+ const { data } = await axios(`Clients/getClientOrSupplierReference`, { params });
+ if (!data.clientId) {
+ initialData.description = t('Supplier Compensation Reference', {
+ supplierId: data.supplierId,
+ supplierName: data.supplierName,
+ });
+ return;
+ }
+ initialData.description = t('Client Compensation Reference', {
+ clientId: data.clientId,
+ clientName: data.clientName,
+ });
+}
+
+async function getAmountPaid() {
+ const filter = {
+ where: {
+ clientFk: route.params.id,
+ companyFk: initialData.companyFk,
+ },
+ };
+
+ const { data } = await axios(`ClientRisks`, {
+ params: { filter: JSON.stringify(filter) },
+ });
+ initialData.amountPaid = (data?.length && data[0].amount) || undefined;
+}
-
-
+ (companyOptions = data)"
auto-load
url="Companies"
/>
- (bankOptions = data)"
auto-load
url="Accountings"
/>
- (initialData.email = email)"
auto-load
url="Clients/findOne"
/>
-
@@ -151,19 +214,22 @@ const onDataSaved = async () => {
option-label="code"
option-value="id"
v-model="data.companyFk"
+ @update:model-value="getAmountPaid()"
/>
-
setPaymentType(value, options)
+ "
+ :emit-value="false"
>
@@ -180,62 +246,54 @@ const onDataSaved = async () => {
:required="true"
@update:model-value="calculateFromAmount($event)"
clearable
- type="number"
v-model.number="data.amountPaid"
/>
-
-
- {{ t('Compensation') }}
-
-
-
-
+
+
+ {{ t('Compensation') }}
+
+
-
-
-
+
+
+
-
+
{{ t('Cash') }}
-
-
-
-
-
-
+
+
-
{
v-close-popup
/>
@@ -270,4 +328,8 @@ es:
Send email: Enviar correo
Compensation: Compensación
Compensation account: Cuenta para compensar
+ Supplier Compensation Reference: ({supplierId}) Ntro Proveedor {supplierName}
+ Client Compensation Reference: ({clientId}) Ntro Cliente {clientName}
+ There is no assigned email for this client: No hay correo asignado para este cliente
+ Amount exceeded: Según ley contra el fraude no se puede recibir cobros por importe igual o superior a {maxAmount}
diff --git a/src/pages/Customer/components/CustomerNoteCreate.vue b/src/pages/Customer/components/CustomerNoteCreate.vue
deleted file mode 100644
index fa1045023..000000000
--- a/src/pages/Customer/components/CustomerNoteCreate.vue
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-es:
- Note: Nota
-
diff --git a/src/pages/Entry/Card/EntryCard.vue b/src/pages/Entry/Card/EntryCard.vue
index 9fadd2d06..436f5b9cd 100644
--- a/src/pages/Entry/Card/EntryCard.vue
+++ b/src/pages/Entry/Card/EntryCard.vue
@@ -10,8 +10,10 @@ import EntryFilter from '../EntryFilter.vue';
:descriptor="EntryDescriptor"
:filter-panel="EntryFilter"
search-data-key="EntryList"
- search-url="Entries/filter"
- searchbar-label="Search entries"
- searchbar-info="You can search by entry reference"
+ :searchbar-props="{
+ url: 'Entries/filter',
+ label: 'Search entries',
+ info: 'You can search by entry reference',
+ }"
/>
diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue
index b8e250a57..7c4354b65 100644
--- a/src/pages/Entry/EntryLatestBuys.vue
+++ b/src/pages/Entry/EntryLatestBuys.vue
@@ -18,9 +18,9 @@ const columns = [
name: 'itemFk',
columnField: {
component: VnImg,
- attrs: (id) => {
+ attrs: ({ row }) => {
return {
- id,
+ id: row.id,
size: '50x50',
width: '50px',
};
diff --git a/src/pages/Entry/EntryList.vue b/src/pages/Entry/EntryList.vue
index 4272ce10e..bd5ace677 100644
--- a/src/pages/Entry/EntryList.vue
+++ b/src/pages/Entry/EntryList.vue
@@ -192,7 +192,7 @@ onMounted(async () => {
:filter="entryFilter"
:create="{
urlCreate: 'Entries',
- title: 'Create entry',
+ title: t('Create entry'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
@@ -210,4 +210,5 @@ es:
Virtual entry: Es una redada
Search entries: Buscar entradas
You can search by entry reference: Puedes buscar por referencia de la entrada
+ Create entry: Crear entrada
diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
index da24e50fa..cba2a31d2 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
@@ -130,8 +130,6 @@ onBeforeMount(async () => {
});
onBeforeRouteUpdate(async (to, from) => {
- invoiceInCorrection.correcting.length = 0;
- invoiceInCorrection.corrected = null;
if (to.params.id !== from.params.id) {
await setInvoiceCorrection(to.params.id);
const { data } = await axios.get(`InvoiceIns/${to.params.id}/getTotals`);
@@ -140,6 +138,8 @@ onBeforeRouteUpdate(async (to, from) => {
});
async function setInvoiceCorrection(id) {
+ invoiceInCorrection.correcting.length = 0;
+ invoiceInCorrection.corrected = null;
const { data: correctingData } = await axios.get('InvoiceInCorrections', {
params: { filter: { where: { correctingFk: id } } },
});
@@ -198,7 +198,6 @@ async function cloneInvoice() {
const isAdministrative = () => hasAny(['administrative']);
const isAgricultural = () => {
- console.error(config);
if (!config.value) return false;
return (
invoiceIn.value?.supplier?.sageFarmerWithholdingFk ===
diff --git a/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue b/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue
index d2b43c57a..7dbd0fe9e 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue
@@ -8,9 +8,10 @@ import { useArrayData } from 'src/composables/useArrayData';
import CrudModel from 'src/components/CrudModel.vue';
import FetchData from 'src/components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
-import VnCurrency from 'src/components/common/VnCurrency.vue';
import { toCurrency } from 'src/filters';
import useNotify from 'src/composables/useNotify.js';
+import VnInputDate from 'src/components/common/VnInputDate.vue';
+import VnInputNumber from 'src/components/common/VnInputNumber.vue';
const route = useRoute();
const { notify } = useNotify();
@@ -22,9 +23,6 @@ const rowsSelected = ref([]);
const banks = ref([]);
const invoiceInFormRef = ref();
const invoiceId = +route.params.id;
-
-const placeholder = 'yyyy/mm/dd';
-
const filter = { where: { invoiceInFk: invoiceId } };
const columns = computed(() => [
@@ -104,42 +102,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -164,7 +127,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
- rows.reduce((acc, { amount }) => acc + +amount,
- rows.reduce((acc, { amount }) => acc + +amount,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ />
rows.reduce((acc, { amount }) => acc + +amount,
-
-
-
+
@@ -203,7 +200,7 @@ const formatOpt = (row, { model, options }, prop) => {
]"
:key="index"
>
- toCurrency(row.amount, currency.value),
sortable: true,
align: 'left',
- style: 'width: 10px',
},
{
name: 'net',
@@ -415,6 +413,11 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
+
+
+ {{ codeCell }}
+
+
diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue
index 63a84b855..4dac5058e 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue
@@ -9,7 +9,8 @@ import { toCurrency } from 'src/filters';
import FetchData from 'src/components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import CrudModel from 'src/components/CrudModel.vue';
-import VnCurrency from 'src/components/common/VnCurrency.vue';
+import VnInput from 'src/components/common/VnInput.vue';
+import VnInputNumber from 'src/components/common/VnInputNumber.vue';
const { t } = useI18n();
const quasar = useQuasar();
@@ -205,7 +206,7 @@ const formatOpt = (row, { model, options }, prop) => {
:grid="$q.screen.lt.sm"
>
-
+
{
name="close"
@click.stop="value = null"
class="cursor-pointer"
+ size="xs"
/>
{
- {
- {
-
-
+
{
/>
-
diff --git a/src/pages/InvoiceIn/InvoiceInCreate.vue b/src/pages/InvoiceIn/InvoiceInCreate.vue
index 4dec9ac7d..e6863beb1 100644
--- a/src/pages/InvoiceIn/InvoiceInCreate.vue
+++ b/src/pages/InvoiceIn/InvoiceInCreate.vue
@@ -26,8 +26,7 @@ const newInvoiceIn = reactive({
companyFk: user.value.companyFk || null,
issued: Date.vnNew(),
});
-const suppliersOptions = ref([]);
-const companiesOptions = ref([]);
+const companies = ref([]);
const redirectToInvoiceInBasicData = (__, { id }) => {
router.push({ name: 'InvoiceInBasicData', params: { id } });
@@ -35,19 +34,12 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
- (suppliersOptions = data)"
- auto-load
- />
(companiesOptions = data)"
+ @on-fetch="(data) => (companies = data)"
auto-load
/>
@@ -69,9 +61,10 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
{
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
@@ -76,39 +105,20 @@ const activities = ref([]);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -133,32 +143,16 @@ const activities = ref([]);
-
-
-
-
-
-
-
+
diff --git a/src/pages/InvoiceIn/InvoiceInList.vue b/src/pages/InvoiceIn/InvoiceInList.vue
index 192d0ccc7..234cfb50f 100644
--- a/src/pages/InvoiceIn/InvoiceInList.vue
+++ b/src/pages/InvoiceIn/InvoiceInList.vue
@@ -1,18 +1,19 @@
+const tableRef = ref();
+const cols = computed(() => [
+ {
+ align: 'left',
+ name: 'id',
+ label: 'Id',
+ },
+ {
+ align: 'left',
+ name: 'supplierFk',
+ label: t('invoiceIn.list.supplier'),
+ columnFilter: {
+ component: 'select',
+ attrs: {
+ url: 'Suppliers',
+ fields: ['id', 'name'],
+ },
+ },
+ columnClass: 'expand',
+ },
+ {
+ align: 'left',
+ name: 'supplierRef',
+ label: t('invoiceIn.list.supplierRef'),
+ },
+
+ {
+ align: 'left',
+ name: 'serialNumber',
+ label: t('invoiceIn.list.serialNumber'),
+ },
+ {
+ align: 'left',
+ name: 'serial',
+ label: t('invoiceIn.list.serial'),
+ },
+ {
+ align: 'left',
+ label: t('invoiceIn.list.issued'),
+ name: 'issued',
+ component: null,
+ columnFilter: {
+ component: 'date',
+ },
+ format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.issued)),
+ },
+ {
+ align: 'left',
+ name: 'isBooked',
+ label: t('invoiceIn.list.isBooked'),
+ columnFilter: false,
+ },
+ {
+ align: 'left',
+ name: 'awbCode',
+ label: t('invoiceIn.list.awb'),
+ },
+ {
+ align: 'left',
+ name: 'amount',
+ label: t('invoiceIn.list.amount'),
+ format: ({ amount }) => toCurrency(amount),
+ },
+ {
+ align: 'right',
+ name: 'tableActions',
+ actions: [
+ {
+ title: t('components.smartCard.openSummary'),
+ icon: 'preview',
+ type: 'submit',
+ action: (row) => viewSummary(row.id, InvoiceInSummary),
+ },
+ {
+ title: t('globals.download'),
+ icon: 'download',
+ type: 'submit',
+ isPrimary: true,
+ action: (row) => downloadFile(row.dmsFk),
+ },
+ ],
+ },
+]);
+
@@ -29,92 +113,63 @@ onUnmounted(() => (stateStore.rightDrawer = false));
-
-
-
+
+
+ {{ row.supplierName }}
+
+
+
+
+
-
-
-
-
-
-
-
- {{ row.supplierName }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ scope.opt?.nickname }}
+ #{{ scope.opt?.id }}
+
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/pages/InvoiceIn/Serial/InvoiceInSerial.vue b/src/pages/InvoiceIn/Serial/InvoiceInSerial.vue
new file mode 100644
index 000000000..4eb9fa69d
--- /dev/null
+++ b/src/pages/InvoiceIn/Serial/InvoiceInSerial.vue
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+es:
+ Serial: Serie
+ Pending: Pendiente
+
diff --git a/src/pages/InvoiceIn/Serial/InvoiceInSerialFilter.vue b/src/pages/InvoiceIn/Serial/InvoiceInSerialFilter.vue
new file mode 100644
index 000000000..4f8c9d70b
--- /dev/null
+++ b/src/pages/InvoiceIn/Serial/InvoiceInSerialFilter.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
+ {{ t(`params.${tag.label}`) }}:
+ {{ formatFn(tag.value) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ params:
+ daysAgo: Last days
+ serial: serial
+es:
+ params:
+ daysAgo: Últimos días
+ serial: serie
+
diff --git a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
index e187a2df2..17b4216da 100644
--- a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
+++ b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
@@ -10,8 +10,10 @@ import InvoiceOutFilter from '../InvoiceOutFilter.vue';
:descriptor="InvoiceOutDescriptor"
:filter-panel="InvoiceOutFilter"
search-data-key="InvoiceOutList"
- search-url="InvoiceOuts/filter"
- searchbar-label="Search invoice"
- searchbar-info="You can search by invoice reference"
+ :searchbar-props="{
+ url: 'InvoiceOuts/filter',
+ label: 'Search invoice',
+ info: 'You can search by invoice reference',
+ }"
/>
diff --git a/src/pages/InvoiceOut/InvoiceOutFilter.vue b/src/pages/InvoiceOut/InvoiceOutFilter.vue
index 103e175ec..d0d42ea9b 100644
--- a/src/pages/InvoiceOut/InvoiceOutFilter.vue
+++ b/src/pages/InvoiceOut/InvoiceOutFilter.vue
@@ -6,7 +6,7 @@ import FetchData from 'components/FetchData.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
-import VnCurrency from 'src/components/common/VnCurrency.vue';
+import VnInputNumber from 'src/components/common/VnInputNumber.vue';
const { t } = useI18n();
const props = defineProps({
@@ -58,7 +58,7 @@ function setWorkers(data) {
-
- {
@on-fetch="(data) => (itemTypesOptions = data)"
auto-load
/>
- (itemsWithNameOptions = data)"
- auto-load
- />
{
-
-
+
+
-
+
{
{
{
-
-
+
+
- {{ t('basicData.isFragileTooltip') }}
+ {{ t('itemBasicData.isFragileTooltip') }}
- {{ t('basicData.isPhotoRequestedTooltip') }}
+ {{ t('itemBasicData.isPhotoRequestedTooltip') }}
diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue
index ae5321b3c..8381f0624 100644
--- a/src/pages/Item/Card/ItemDescriptor.vue
+++ b/src/pages/Item/Card/ItemDescriptor.vue
@@ -112,7 +112,7 @@ const openCloneDialog = async () => {
.dialog({
component: VnConfirm,
componentProps: {
- title: t("All it's properties will be copied"),
+ title: t('All its properties will be copied'),
message: t('Do you want to clone this item?'),
},
})
@@ -215,7 +215,7 @@ const openCloneDialog = async () => {
es:
Regularize stock: Regularizar stock
- All it's properties will be copied: Todas sus propiedades serán copiadas
+ All its properties will be copied: Todas sus propiedades serán copiadas
Do you want to clone this item?: ¿Desea clonar este artículo?
diff --git a/src/pages/Item/Card/ItemDescriptorImage.vue b/src/pages/Item/Card/ItemDescriptorImage.vue
index aceede880..d923dd28f 100644
--- a/src/pages/Item/Card/ItemDescriptorImage.vue
+++ b/src/pages/Item/Card/ItemDescriptorImage.vue
@@ -64,7 +64,7 @@ const handlePhotoUpdated = (evt = false) => {
-
+
diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue
index 442dbfcba..68633caa2 100644
--- a/src/pages/Item/Card/ItemDiary.vue
+++ b/src/pages/Item/Card/ItemDiary.vue
@@ -17,6 +17,7 @@ import { toDateFormat } from 'src/filters/date.js';
import { dashIfEmpty } from 'src/filters';
import { date } from 'quasar';
import { useState } from 'src/composables/useState';
+import axios from 'axios';
const { t } = useI18n();
const route = useRoute();
@@ -34,6 +35,7 @@ const itemsBalanceFilter = reactive({
const itemBalances = ref([]);
const warehouseFk = ref(null);
const _showWhatsBeforeInventory = ref(false);
+const inventoriedDate = ref(null);
const columns = computed(() => [
{
@@ -99,7 +101,7 @@ const showWhatsBeforeInventory = computed({
set: (val) => {
_showWhatsBeforeInventory.value = val;
if (!val) itemsBalanceFilter.where.date = null;
- else itemsBalanceFilter.where.date = new Date();
+ else itemsBalanceFilter.where.date = inventoriedDate.value ?? new Date();
},
});
@@ -161,6 +163,8 @@ onMounted(async () => {
if (route.query.warehouseFk) warehouseFk.value = route.query.warehouseFk;
else if (user.value) warehouseFk.value = user.value.warehouseFk;
itemsBalanceFilter.where.warehouseFk = warehouseFk.value;
+ const { data } = await axios.get('Configs/findOne');
+ inventoriedDate.value = data.inventoried;
await fetchItemBalances();
await scrollToToday();
});
@@ -293,7 +297,7 @@ watch(
>
{{ row.entityId }}
-
+
{{ dashIfEmpty(row.entityName) }}
diff --git a/src/pages/Item/Card/ItemLastEntries.vue b/src/pages/Item/Card/ItemLastEntries.vue
index a3ae99da6..b211790ca 100644
--- a/src/pages/Item/Card/ItemLastEntries.vue
+++ b/src/pages/Item/Card/ItemLastEntries.vue
@@ -1,5 +1,5 @@
-
-
+
+
(stateStore.rightDrawer = false));
class="q-mr-lg"
/>
-
-
-
-
-
+
+
+
{
});
};
-const handleTagSelected = (rows, index, tag) => {
+const handleTagSelected = (rows, index, tagId) => {
+ const tag = tagOptions.value.find((t) => t.id === tagId);
rows[index].tag = tag;
- rows[index].tagFk = tag.id;
+ rows[index].tagFk = tagId;
rows[index].value = null;
getSelectedTagValues(rows[index]);
};
@@ -94,7 +95,6 @@ const insertTag = (rows) => {
:filter="{
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
where: { itemFk: route.params.id },
- order: 'priority ASC',
include: {
relation: 'tag',
scope: {
@@ -102,16 +102,13 @@ const insertTag = (rows) => {
},
},
}"
+ order="priority"
auto-load
@on-fetch="onItemTagsFetched"
>
-
-
+
+
{
option-label="name"
hide-selected
@update:model-value="
- ($event) => handleTagSelected(rows, index, $event)
+ (val) => handleTagSelected(rows, index, val)
"
:required="true"
:rules="validate('itemTag.tagFk')"
@@ -146,7 +143,6 @@ const insertTag = (rows) => {
v-model="row.value"
:label="t('itemTags.value')"
:is-clearable="false"
- style="width: 100%"
/>
{
:required="true"
:rules="validate('itemTag.priority')"
/>
-
+
{
-
+
{
color="primary"
name="add"
size="sm"
+ style="flex: 0"
>
{{ t('itemTags.addTag') }}
diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml
index 0e855523c..c32ee493c 100644
--- a/src/pages/Item/locale/en.yml
+++ b/src/pages/Item/locale/en.yml
@@ -25,7 +25,7 @@ itemDiary:
showBefore: Show what's before the inventory
since: Since
warehouse: Warehouse
-basicData:
+itemBasicData:
type: Type
reference: Reference
relevancy: Relevancy
diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml
index 451b75698..d32cb7885 100644
--- a/src/pages/Item/locale/es.yml
+++ b/src/pages/Item/locale/es.yml
@@ -25,7 +25,7 @@ itemDiary:
showBefore: Mostrar lo anterior al inventario
since: Desde
warehouse: Almacén
-basicData:
+itemBasicData:
type: Tipo
reference: Referencia
relevancy: Relevancia
diff --git a/src/pages/Login/LoginMain.vue b/src/pages/Login/LoginMain.vue
index 5a3490f50..4eb21f573 100644
--- a/src/pages/Login/LoginMain.vue
+++ b/src/pages/Login/LoginMain.vue
@@ -28,35 +28,10 @@ async function onSubmit() {
};
try {
const { data } = await axios.post('Accounts/login', params);
-
if (!data) return;
- const {
- data: { multimediaToken },
- } = await axios.get('VnUsers/ShareToken', {
- headers: { Authorization: data.token },
- });
- if (!multimediaToken) return;
-
- const login = {
- ...data,
- created: Date.now(),
- tokenMultimedia: multimediaToken.id,
- keepLogin: keepLogin.value,
- };
- await session.login(login);
-
- quasar.notify({
- message: t('login.loginSuccess'),
- type: 'positive',
- });
-
- const currentRoute = router.currentRoute.value;
- if (currentRoute.query && currentRoute.query.redirect) {
- router.push(currentRoute.query.redirect);
- } else {
- router.push({ name: 'Dashboard' });
- }
+ data.keepLogin = keepLogin.value;
+ await session.setLogin(data);
} catch (res) {
if (res.response?.data?.error?.code === 'REQUIRES_2FA') {
Notify.create({
diff --git a/src/pages/Login/TwoFactor.vue b/src/pages/Login/TwoFactor.vue
index 8ba1a1f7d..31b4ccc79 100644
--- a/src/pages/Login/TwoFactor.vue
+++ b/src/pages/Login/TwoFactor.vue
@@ -25,21 +25,10 @@ async function onSubmit() {
try {
params.code = code.value;
const { data } = await axios.post('VnUsers/validate-auth', params);
-
if (!data) return;
- await session.login(data.token, params.keepLogin);
- quasar.notify({
- message: t('login.loginSuccess'),
- type: 'positive',
- });
-
- const currentRoute = router.currentRoute.value;
- if (currentRoute.query && currentRoute.query.redirect) {
- router.push(currentRoute.query.redirect);
- } else {
- router.push({ name: 'Dashboard' });
- }
+ data.keepLogin = params.keepLogin;
+ await session.setLogin(data);
} catch (e) {
quasar.notify({
message: e.response?.data?.error.message,
diff --git a/src/pages/Order/OrderLines.vue b/src/pages/Order/OrderLines.vue
index f361d9898..9814eaf34 100644
--- a/src/pages/Order/OrderLines.vue
+++ b/src/pages/Order/OrderLines.vue
@@ -70,9 +70,9 @@ const columns = computed(() => [
name: 'image',
columnField: {
component: VnImg,
- attrs: (id) => {
+ attrs: ({ row }) => {
return {
- id,
+ id: row.id,
width: '50px',
};
},
diff --git a/src/pages/Parking/Card/ParkingCard.vue b/src/pages/Parking/Card/ParkingCard.vue
index 620f4bb2d..ad37eb630 100644
--- a/src/pages/Parking/Card/ParkingCard.vue
+++ b/src/pages/Parking/Card/ParkingCard.vue
@@ -16,8 +16,10 @@ const filter = {
:descriptor="ParkingDescriptor"
:filter-panel="ParkingFilter"
search-data-key="ParkingList"
- search-url="Parkings"
- searchbar-label="parking.searchBar.label"
- searchbar-info="parking.searchBar.info"
+ :searchbar-props="{
+ url: 'Parkings',
+ label: 'parking.searchBar.label',
+ info: 'parking.searchBar.info',
+ }"
/>
diff --git a/src/pages/Route/Agency/Card/AgencyCard.vue b/src/pages/Route/Agency/Card/AgencyCard.vue
index e1eebabf7..9935fc6eb 100644
--- a/src/pages/Route/Agency/Card/AgencyCard.vue
+++ b/src/pages/Route/Agency/Card/AgencyCard.vue
@@ -8,8 +8,10 @@ import VnCard from 'components/common/VnCard.vue';
base-url="Agencies"
:descriptor="AgencyDescriptor"
search-data-key="AgencyList"
- search-url="Agencies"
- searchbar-label="agency.searchBar.label"
- searchbar-info="agency.searchBar.info"
+ :searchbar-props="{
+ url: 'Agencies',
+ label: 'agency.searchBar.label',
+ info: 'agency.searchBar.info',
+ }"
/>
diff --git a/src/pages/Route/Roadmap/RoadmapCard.vue b/src/pages/Route/Roadmap/RoadmapCard.vue
index 4e8f8dd50..148d16ac9 100644
--- a/src/pages/Route/Roadmap/RoadmapCard.vue
+++ b/src/pages/Route/Roadmap/RoadmapCard.vue
@@ -10,8 +10,10 @@ import RoadmapFilter from 'pages/Route/Roadmap/RoadmapFilter.vue';
:descriptor="RoadmapDescriptor"
:filter-panel="RoadmapFilter"
search-data-key="RoadmapList"
- search-url="Roadmaps"
- searchbar-label="Search roadmap"
- searchbar-info="You can search by roadmap id or customer name"
+ :searchbar-props="{
+ url: 'Roadmaps',
+ label: 'Search roadmap',
+ info: 'You can search by roadmap id or customer name',
+ }"
/>
diff --git a/src/pages/Route/RouteAutonomous.vue b/src/pages/Route/RouteAutonomous.vue
index 8e7900652..5ad349942 100644
--- a/src/pages/Route/RouteAutonomous.vue
+++ b/src/pages/Route/RouteAutonomous.vue
@@ -214,7 +214,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
@click="openDmsUploadDialog"
>
- {{ t('Create invoiceIn') }}
+ {{ t('globals.createInvoiceIn') }}
@@ -267,7 +267,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
es:
Search autonomous: Buscar autónomos
You can search by autonomous reference: Puedes buscar por referencia del autónomo
- Create invoiceIn: Crear factura recibida
Two autonomous cannot be counted at the same time: Dos autonónomos no pueden ser contabilizados al mismo tiempo
Date: Fecha
Agency route: Agencia Ruta
diff --git a/src/pages/Supplier/Card/SupplierCard.vue b/src/pages/Supplier/Card/SupplierCard.vue
index ed4ce7eb2..594026d18 100644
--- a/src/pages/Supplier/Card/SupplierCard.vue
+++ b/src/pages/Supplier/Card/SupplierCard.vue
@@ -10,8 +10,10 @@ import SupplierListFilter from '../SupplierListFilter.vue';
:descriptor="SupplierDescriptor"
:filter-panel="SupplierListFilter"
search-data-key="SupplierList"
- search-url="Suppliers/filter"
- searchbar-label="Search suppliers"
- search-url-query="table"
+ :searchbar-props="{
+ url: 'Suppliers/filter',
+ searchUrl: 'table',
+ label: 'Search suppliers',
+ }"
/>
diff --git a/src/pages/Supplier/Card/SupplierDescriptor.vue b/src/pages/Supplier/Card/SupplierDescriptor.vue
index a31a3bc8d..6e60a336c 100644
--- a/src/pages/Supplier/Card/SupplierDescriptor.vue
+++ b/src/pages/Supplier/Card/SupplierDescriptor.vue
@@ -177,7 +177,7 @@ const getEntryQueryParams = (supplier) => {
icon="vn:invoice-in-create"
color="primary"
>
- {{ t('Create invoiceIn') }}
+ {{ t('globals.createInvoiceIn') }}
@@ -188,7 +188,6 @@ const getEntryQueryParams = (supplier) => {
es:
All entries with current supplier: Todas las entradas con proveedor actual
Go to client: Ir a cliente
- Create invoiceIn: Crear factura recibida
Go to module index: Ir al índice del módulo
Inactive supplier: Proveedor inactivo
Unverified supplier: Proveedor no verificado
diff --git a/src/pages/Ticket/Card/TicketBoxing.vue b/src/pages/Ticket/Card/TicketBoxing.vue
index 05bde8977..bff95c0e2 100644
--- a/src/pages/Ticket/Card/TicketBoxing.vue
+++ b/src/pages/Ticket/Card/TicketBoxing.vue
@@ -105,14 +105,14 @@ async function getVideoList(expeditionId, timed) {
label
markers
snap
- color="orange"
+ color="primary"
/>
route.name);
+const customRouteRedirectName = computed(() => routeName.value);
route.name);
:filter-panel="TicketFilter"
:descriptor="TicketDescriptor"
search-data-key="TicketList"
- :search-custom-route-redirect="routeName"
- :searchbar-label="t('card.search')"
- :searchbar-info="t('card.searchInfo')"
+ :searchbar-props="{
+ customRouteRedirectName,
+ label: t('card.search'),
+ info: t('card.searchInfo'),
+ }"
/>
diff --git a/src/pages/Ticket/Card/TicketEditMana.vue b/src/pages/Ticket/Card/TicketEditMana.vue
index 721057515..428e5e8c2 100644
--- a/src/pages/Ticket/Card/TicketEditMana.vue
+++ b/src/pages/Ticket/Card/TicketEditMana.vue
@@ -34,7 +34,7 @@ const cancel = () => {
-
+
diff --git a/src/pages/Ticket/TicketWeekly.vue b/src/pages/Ticket/TicketWeekly.vue
index 61532ee51..d68d18c24 100644
--- a/src/pages/Ticket/TicketWeekly.vue
+++ b/src/pages/Ticket/TicketWeekly.vue
@@ -221,9 +221,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:find="['agencyModeFk', 'agencyModeName']"
v-model="row.agencyModeFk"
@update:model-value="onUpdate(row.ticketFk, 'agencyModeFk', $event)"
- >
- {{ console.log('row: ', row) }}
-
+ />
diff --git a/src/pages/Travel/Card/TravelCard.vue b/src/pages/Travel/Card/TravelCard.vue
index a3c1430e9..44bd9d430 100644
--- a/src/pages/Travel/Card/TravelCard.vue
+++ b/src/pages/Travel/Card/TravelCard.vue
@@ -35,10 +35,12 @@ const filter = {
data-key="Travel"
base-url="Travels"
search-data-key="TravelList"
- searchbar-label="Search travel"
- searchbar-info="You can search by travel id or name"
- search-url="Travels"
:filter="filter"
:descriptor="TravelDescriptor"
+ :searchbar-props="{
+ url: 'Travels',
+ label: 'Search travel',
+ info: 'You can search by travel id or name',
+ }"
/>
diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue
index dbb8949a7..8989e485c 100644
--- a/src/pages/Travel/TravelList.vue
+++ b/src/pages/Travel/TravelList.vue
@@ -9,7 +9,7 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { computed } from 'vue';
import TravelSummary from './Card/TravelSummary.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
-import { dashIfEmpty, toDate } from 'src/filters';
+import { toDate } from 'src/filters';
const { viewSummary } = useSummaryDialog();
const router = useRouter();
const { t } = useI18n();
diff --git a/src/pages/Wagon/WagonCounter.vue b/src/pages/Wagon/WagonCounter.vue
index 70bbc9803..505cbba28 100644
--- a/src/pages/Wagon/WagonCounter.vue
+++ b/src/pages/Wagon/WagonCounter.vue
@@ -64,7 +64,12 @@ function confirm() {
-
+
{{ props.title }}
diff --git a/src/pages/Worker/Card/WorkerBasicData.vue b/src/pages/Worker/Card/WorkerBasicData.vue
index 62ca9dad9..d131fea3e 100644
--- a/src/pages/Worker/Card/WorkerBasicData.vue
+++ b/src/pages/Worker/Card/WorkerBasicData.vue
@@ -12,9 +12,12 @@ import VnSelect from 'src/components/common/VnSelect.vue';
const route = useRoute();
const { t } = useI18n();
-const workersOptions = ref([]);
-const countriesOptions = ref([]);
-const educationLevelsOptions = ref([]);
+const educationLevels = ref([]);
+const countries = ref([]);
+const maritalStatus = [
+ { code: 'M', name: t('Married') },
+ { code: 'S', name: t('Single') },
+];
const workerFilter = {
include: [
@@ -29,44 +32,21 @@ const workerFilter = {
{ relation: 'department', scope: { include: { relation: 'department' } } },
],
};
-const workersFilter = {
- fields: ['id', 'nickname'],
- order: 'nickname ASC',
- limit: 30,
-};
-const countriesFilter = {
- fields: ['id', 'name', 'code'],
- order: 'name ASC',
- limit: 30,
-};
-const educationLevelsFilter = { fields: ['id', 'name'], order: 'name ASC', limit: 30 };
-
-const maritalStatus = [
- { code: 'M', name: t('Married') },
- { code: 'S', name: t('Single') },
-];
(workersOptions = data)"
- auto-load
- url="Workers/search"
- />
- (countriesOptions = data)"
- auto-load
- url="Countries"
- />
- (educationLevelsOptions = data)"
+ :filter="{ fields: ['id', 'name'], order: 'name ASC' }"
+ @on-fetch="(data) => (educationLevels = data)"
auto-load
url="EducationLevels"
/>
-
+ (countries = data)"
+ auto-load
+ />
-
-
-
-
-
+
-
+
diff --git a/src/pages/Worker/Card/WorkerCalendar.vue b/src/pages/Worker/Card/WorkerCalendar.vue
index ea6e62683..e9cb793f4 100644
--- a/src/pages/Worker/Card/WorkerCalendar.vue
+++ b/src/pages/Worker/Card/WorkerCalendar.vue
@@ -171,18 +171,16 @@ watch([year, businessFk], () => refreshData());
ref="WorkerFreelanceRef"
auto-load
/>
-
-
-
-
-
+
+
+
diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue
index 1a5bacf2f..0abcdcafd 100644
--- a/src/pages/Worker/Card/WorkerCard.vue
+++ b/src/pages/Worker/Card/WorkerCard.vue
@@ -5,13 +5,15 @@ import WorkerFilter from '../WorkerFilter.vue';
diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue
index e8dc7d878..8fbb23ef8 100644
--- a/src/pages/Worker/Card/WorkerDescriptor.vue
+++ b/src/pages/Worker/Card/WorkerDescriptor.vue
@@ -147,7 +147,7 @@ const refetch = async () => await cardDescriptorRef.value.getData();
diff --git a/src/pages/Worker/Card/WorkerFormation.vue b/src/pages/Worker/Card/WorkerFormation.vue
index 829326898..71c5cba5d 100644
--- a/src/pages/Worker/Card/WorkerFormation.vue
+++ b/src/pages/Worker/Card/WorkerFormation.vue
@@ -108,7 +108,7 @@ const columns = computed(() => [
:filter="courseFilter"
:create="{
urlCreate: 'trainingCourses',
- title: 'Create trainingCourse',
+ title: t('Create training course'),
onDataSaved: () => tableRef.reload(),
formInitialData: {
workerFk: entityId,
@@ -122,3 +122,7 @@ const columns = computed(() => [
:use-model="true"
/>
+
+es:
+ Create training course: Crear curso de formación
+
diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue
index 11c36c22d..5c6261b94 100644
--- a/src/pages/Worker/Card/WorkerSummary.vue
+++ b/src/pages/Worker/Card/WorkerSummary.vue
@@ -11,6 +11,7 @@ import VnUserLink from 'src/components/ui/VnUserLink.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import RoleDescriptorProxy from 'src/pages/Account/Role/Card/RoleDescriptorProxy.vue';
import VnRow from 'src/components/ui/VnRow.vue';
+import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
const route = useRoute();
const { t } = useI18n();
@@ -84,10 +85,14 @@ const filter = {
:text="t('worker.summary.basicData')"
/>
-
+
+
+
+
+
+
diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue
index 7bce5983c..87ff44e63 100644
--- a/src/pages/Worker/Card/WorkerTimeControl.vue
+++ b/src/pages/Worker/Card/WorkerTimeControl.vue
@@ -489,7 +489,7 @@ onMounted(async () => {
-
+
@@ -515,7 +515,7 @@ onMounted(async () => {
@click-date="onInputChange"
@on-moved="getMailStates"
/>
-
+
diff --git a/src/pages/Worker/WorkerFilter.vue b/src/pages/Worker/WorkerFilter.vue
index 0853791ef..765241341 100644
--- a/src/pages/Worker/WorkerFilter.vue
+++ b/src/pages/Worker/WorkerFilter.vue
@@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
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 props = defineProps({
@@ -26,7 +27,7 @@ const departments = ref();
{{ formatFn(tag.value) }}
-
+
-
@@ -107,6 +105,7 @@ en:
userName: User
extension: Extension
departmentFk: Department
+ id: ID
es:
params:
search: Contiene
@@ -116,6 +115,7 @@ es:
userName: Usuario
extension: Extensión
departmentFk: Departamento
+ id: ID
FI: NIF
First Name: Nombre
Last Name: Apellidos
diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue
index 0c2656597..7b3237f70 100644
--- a/src/pages/Worker/WorkerList.vue
+++ b/src/pages/Worker/WorkerList.vue
@@ -14,6 +14,8 @@ import VnLocation from 'src/components/common/VnLocation.vue';
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
import FetchData from 'src/components/FetchData.vue';
+import RightMenu from 'src/components/common/RightMenu.vue';
+import WorkerFilter from './WorkerFilter.vue';
const { t } = useI18n();
const tableRef = ref();
@@ -28,14 +30,8 @@ const columns = computed(() => [
{
align: 'left',
name: 'id',
- label: t('tableColumns.id'),
- columnFilter: {
- alias: 'w',
- inWhere: true,
- },
- chip: {
- condition: () => true,
- },
+ label: t('id'),
+ field: 'id',
isId: true,
},
{
@@ -44,7 +40,7 @@ const columns = computed(() => [
label: t('tableColumns.name'),
isTitle: true,
columnFilter: {
- name: 'search',
+ name: 'firstName',
},
},
{
@@ -54,8 +50,7 @@ const columns = computed(() => [
cardVisible: true,
columnFilter: {
component: 'select',
- inWhere: true,
- alias: 'wd',
+ name: 'departmentFk',
attrs: {
url: 'Departments',
},
@@ -130,6 +125,11 @@ function uppercaseStreetModel(data) {
@on-fetch="(data) => (bankEntitiesOptions = data)"
auto-load
/>
+
+
+
+
+
diff --git a/src/pages/Zone/Card/ZoneCard.vue b/src/pages/Zone/Card/ZoneCard.vue
index 59049a5b3..02ec12fe7 100644
--- a/src/pages/Zone/Card/ZoneCard.vue
+++ b/src/pages/Zone/Card/ZoneCard.vue
@@ -28,11 +28,12 @@ const searchBarDataKeys = {
data-key="Zone"
:descriptor="ZoneDescriptor"
:search-data-key="searchBarDataKeys[routeName]"
- :search-custom-route-redirect="customRouteRedirectName"
- :search-redirect="!!customRouteRedirectName"
- :search-make-fetch="searchbarMakeFetch"
- :searchbar-label="t('list.searchZone')"
- :searchbar-info="t('list.searchInfo')"
+ :filter-panel="ZoneFilterPanel"
+ :searchbar-props="{
+ url: 'Zones',
+ label: t('list.searchZone'),
+ info: t('list.searchInfo'),
+ }"
>
diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js
index d9d047433..684b83b0f 100644
--- a/src/router/modules/customer.js
+++ b/src/router/modules/customer.js
@@ -187,87 +187,32 @@ export default {
},
{
path: 'notes',
- name: 'CustomerNotesCard',
- redirect: { name: 'CustomerNotes' },
- children: [
- {
- path: '',
- name: 'CustomerNotes',
- meta: {
- title: 'notes',
- icon: 'vn:notes',
- },
- component: () =>
- import('src/pages/Customer/Card/CustomerNotes.vue'),
- },
- {
- path: 'create',
- name: 'CustomerNoteCreate',
- meta: {
- title: 'note-create',
- },
- component: () =>
- import(
- 'src/pages/Customer/components/CustomerNoteCreate.vue'
- ),
- },
- ],
+ name: 'CustomerNotes',
+ meta: {
+ title: 'notes',
+ icon: 'vn:notes',
+ },
+ component: () => import('src/pages/Customer/Card/CustomerNotes.vue'),
},
{
path: 'credits',
- name: 'CreditsCard',
- redirect: { name: 'CustomerCredits' },
- children: [
- {
- path: '',
- name: 'CustomerCredits',
- meta: {
- title: 'credits',
- icon: 'vn:credit',
- },
- component: () =>
- import('src/pages/Customer/Card/CustomerCredits.vue'),
- },
- {
- path: 'create',
- name: 'CustomerCreditCreate',
- meta: {
- title: 'credit-create',
- },
- component: () =>
- import(
- 'src/pages/Customer/components/CustomerCreditCreate.vue'
- ),
- },
- ],
+ name: 'CustomerCredits',
+ meta: {
+ title: 'credits',
+ icon: 'vn:credit',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerCredits.vue'),
},
{
path: 'greuges',
- name: 'GreugesCard',
- redirect: { name: 'CustomerGreuges' },
- children: [
- {
- path: '',
- name: 'CustomerGreuges',
- meta: {
- title: 'greuges',
- icon: 'vn:greuge',
- },
- component: () =>
- import('src/pages/Customer/Card/CustomerGreuges.vue'),
- },
- {
- path: 'create',
- name: 'CustomerGreugeCreate',
- meta: {
- title: 'greuge-create',
- },
- component: () =>
- import(
- 'src/pages/Customer/components/CustomerGreugeCreate.vue'
- ),
- },
- ],
+ name: 'CustomerGreuges',
+ meta: {
+ title: 'greuges',
+ icon: 'vn:greuge',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerGreuges.vue'),
},
{
path: 'balance',
@@ -281,31 +226,13 @@ export default {
},
{
path: 'recoveries',
- name: 'RecoveriesCard',
- redirect: { name: 'CustomerRecoveries' },
- children: [
- {
- path: '',
- name: 'CustomerRecoveries',
- meta: {
- title: 'recoveries',
- icon: 'vn:recovery',
- },
- component: () =>
- import('src/pages/Customer/Card/CustomerRecoveries.vue'),
- },
- {
- path: 'create',
- name: 'CustomerRecoverieCreate',
- meta: {
- title: 'recoverie-create',
- },
- component: () =>
- import(
- 'src/pages/Customer/components/CustomerRecoverieCreate.vue'
- ),
- },
- ],
+ name: 'CustomerRecoveries',
+ meta: {
+ title: 'recoveries',
+ icon: 'vn:recovery',
+ },
+ component: () =>
+ import('src/pages/Customer/Card/CustomerRecoveries.vue'),
},
{
path: 'web-access',
diff --git a/src/router/modules/invoiceIn.js b/src/router/modules/invoiceIn.js
index cd8f7de9c..906db8a58 100644
--- a/src/router/modules/invoiceIn.js
+++ b/src/router/modules/invoiceIn.js
@@ -11,7 +11,7 @@ export default {
component: RouterView,
redirect: { name: 'InvoiceInMain' },
menus: {
- main: ['InvoiceInList'],
+ main: ['InvoiceInList', 'InvoiceInSerial'],
card: [
'InvoiceInBasicData',
'InvoiceInVat',
@@ -37,6 +37,16 @@ export default {
},
component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'),
},
+ {
+ path: 'serial',
+ name: 'InvoiceInSerial',
+ meta: {
+ title: 'serial',
+ icon: 'view_list',
+ },
+ component: () =>
+ import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
+ },
{
path: 'create',
name: 'InvoiceInCreare',
diff --git a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
index a297a60f4..f6dac4c73 100644
--- a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
@@ -1,8 +1,9 @@
///
describe('InvoiceInIntrastat', () => {
- const inputBtns = 'label button';
+ const firstRow = 'tbody > :nth-child(1)';
const thirdRow = 'tbody > :nth-child(3)';
- const firstLineCode = 'tbody > :nth-child(1) > :nth-child(2)';
+ const firstRowCode = `${firstRow} > :nth-child(2)`;
+ const firstRowAmount = `${firstRow} > :nth-child(3)`;
beforeEach(() => {
cy.login('developer');
@@ -10,10 +11,10 @@ describe('InvoiceInIntrastat', () => {
});
it('should edit the first line', () => {
- cy.selectOption(firstLineCode, 'Plantas vivas: Esqueje/injerto, Vid');
- cy.get(inputBtns).eq(1).click();
+ cy.selectOption(firstRowCode, 'Plantas vivas: Esqueje/injerto, Vid');
+ cy.get(firstRowAmount).clear();
cy.saveCard();
- cy.get(`${firstLineCode} span`).should(
+ cy.get(`${firstRowCode} span`).should(
'have.text',
'6021010:Plantas vivas: Esqueje/injerto, Vid'
);
diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js
index b2fa10d52..fa0d1c5e4 100644
--- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js
@@ -1,23 +1,23 @@
///
describe('InvoiceInList', () => {
- const firstCard = '.q-card:nth-child(1)';
- const firstChipId =
- ':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
- const firstDetailBtn = '.q-card:nth-child(1) .q-btn:nth-child(2)';
+ const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
+ const firstId = `${firstRow} > td:nth-child(1) span`;
+ const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`;
const summaryHeaders = '.summaryBody .header-link';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/invoice-in/list`);
+ cy.get('#searchbar input').type('{enter}');
});
it('should redirect on clicking a invoice', () => {
- cy.get(firstChipId)
+ cy.get(firstId)
.invoke('text')
.then((content) => {
const id = content.replace(/\D/g, '');
- cy.get(firstCard).click();
+ cy.get(firstRow).click();
cy.url().should('include', `/invoice-in/${id}/summary`);
});
});
diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
index 932aca96d..018ae7a53 100644
--- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
@@ -4,8 +4,7 @@ describe('InvoiceInVat', () => {
const firstLineVat = 'tbody > :nth-child(1) > :nth-child(4)';
const dialogInputs = '.q-dialog label input';
const dialogBtns = '.q-dialog button';
- const acrossInput =
- ':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon';
+ const acrossInput = 'tbody tr:nth-child(1) td:nth-child(2) .default-icon';
const randomInt = Math.floor(Math.random() * 100);
beforeEach(() => {
diff --git a/test/cypress/integration/logout.spec.js b/test/cypress/integration/logout.spec.js
index b35a8415a..423189908 100644
--- a/test/cypress/integration/logout.spec.js
+++ b/test/cypress/integration/logout.spec.js
@@ -7,10 +7,8 @@ describe('Logout', () => {
});
describe('by user', () => {
it('should logout', () => {
- cy.get(
- '#user > .q-btn__content > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
- ).click();
- cy.get('.block').click();
+ cy.get('#user').click();
+ cy.get('#logout').click();
});
});
describe('not user', () => {
diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js
index afc0fc395..c9d7147c2 100644
--- a/test/cypress/integration/route/routeList.spec.js
+++ b/test/cypress/integration/route/routeList.spec.js
@@ -10,12 +10,13 @@ describe('Route', () => {
it('Route list create route', () => {
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get('input[name="description"]').eq(1).type('routeTestOne{enter}');
+ cy.get('input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
cy.url().should('include', '/summary');
});
it('Route list search and edit', () => {
+ cy.get('#searchbar input').type('{enter}');
cy.get('input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-table tr')
.its('length')
diff --git a/test/cypress/integration/worker/workerList.spec.js b/test/cypress/integration/worker/workerList.spec.js
index de57c9638..8a8bea443 100644
--- a/test/cypress/integration/worker/workerList.spec.js
+++ b/test/cypress/integration/worker/workerList.spec.js
@@ -1,4 +1,7 @@
describe('WorkerList', () => {
+ const inputName = '.q-drawer .q-form input[aria-label="First Name"]';
+ const searchBtn = '.q-drawer button:nth-child(3)';
+ const descriptorTitle = '.descriptor .title span';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@@ -6,6 +9,11 @@ describe('WorkerList', () => {
});
it('should open the worker summary', () => {
- cy.get('.q-drawer .q-form input[aria-label="Name"]').type('jessica jones{enter}');
+ cy.get(inputName).type('jessica{enter}');
+ cy.get(searchBtn).click();
+ cy.intercept('GET', /\/api\/Workers\/\d+/).as('worker');
+ cy.wait('@worker').then(() =>
+ cy.get(descriptorTitle).should('include.text', 'Jessica')
+ );
});
});
diff --git a/test/cypress/integration/worker/workerLocker.spec.js b/test/cypress/integration/worker/workerLocker.spec.js
index 9a4a19c7a..9a4066f54 100644
--- a/test/cypress/integration/worker/workerLocker.spec.js
+++ b/test/cypress/integration/worker/workerLocker.spec.js
@@ -2,7 +2,7 @@ describe('WorkerLocker', () => {
const workerId = 1109;
const lockerCode = '2F';
const input = '.q-card input';
- const thirdOpt = '[role="listbox"] .q-item:nth-child(3)';
+ const thirdOpt = '[role="listbox"] .q-item:nth-child(1)';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('productionBoss');
diff --git a/test/vitest/__tests__/pages/Login/Login.spec.js b/test/vitest/__tests__/pages/Login/Login.spec.js
index 9b9968736..5ab4cee9e 100644
--- a/test/vitest/__tests__/pages/Login/Login.spec.js
+++ b/test/vitest/__tests__/pages/Login/Login.spec.js
@@ -25,18 +25,20 @@ describe('Login', () => {
vi.spyOn(axios, 'post').mockResolvedValueOnce({ data: { token: 'token' } });
vi.spyOn(axios, 'get').mockImplementation((url) => {
if (url === 'VnUsers/acls') return Promise.resolve({ data: [] });
- return Promise.resolve({data: { roles: [], user: expectedUser , multimediaToken: {id:'multimediaToken' }}});
+ return Promise.resolve({
+ data: {
+ roles: [],
+ user: expectedUser,
+ multimediaToken: { id: 'multimediaToken' },
+ },
+ });
});
- vi.spyOn(vm.quasar, 'notify');
expect(vm.session.getToken()).toEqual('');
await vm.onSubmit();
expect(vm.session.getToken()).toEqual('token');
- expect(vm.quasar.notify).toHaveBeenCalledWith(
- expect.objectContaining({ type: 'positive' })
- );
await vm.session.destroy();
});