diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue
index e921d8e1f..1a0bb0019 100644
--- a/src/components/common/VnInput.vue
+++ b/src/components/common/VnInput.vue
@@ -75,6 +75,7 @@ const focus = () => {
defineExpose({
focus,
+ vnInputRef,
});
const mixinRules = [
diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue
index fb80a7175..fdf2e52ee 100644
--- a/src/components/common/VnLog.vue
+++ b/src/components/common/VnLog.vue
@@ -804,7 +804,7 @@ watch(
evt.target.blur()"
@clear="selectFilter('date', 'from')"
@@ -1059,9 +1059,9 @@ en:
Deletes: Deletes
Accesses: Accesses
Users:
- User: Usuario
- All: Todo
- System: Sistema
+ User: User
+ All: All
+ System: System
properties:
id: ID
claimFk: Claim ID
diff --git a/src/components/common/VnSection.vue b/src/components/common/VnSection.vue
index e56784d4e..376eaf03d 100644
--- a/src/components/common/VnSection.vue
+++ b/src/components/common/VnSection.vue
@@ -94,8 +94,8 @@ function checkIsMain() {
/>
-
-
+
+
{
notes.value.splice(index, 1);
};
-const onDataSaved = async () => {
- let payload = {
+const updateAddress = async (data) => {
+ await axios.patch(urlUpdate.value, data);
+};
+
+const updateAddressTicket = async () => {
+ urlUpdate.value += '?updateObservations=true';
+};
+
+const updateObservations = async (payload) => {
+ await axios.post('AddressObservations/crud', payload);
+ notes.value = [];
+ deletes.value = [];
+ toCustomerAddress();
+};
+async function updateAll({ data, payload }) {
+ await updateObservations(payload);
+ await updateAddress(data);
+}
+function getPayload() {
+ return {
creates: notes.value.filter((note) => note.$isNew),
deletes: deletes.value,
updates: notes.value
@@ -101,14 +120,40 @@ const onDataSaved = async () => {
where: { id: note.id },
})),
};
+}
- await axios.post('AddressObservations/crud', payload);
- notes.value = [];
- deletes.value = [];
- toCustomerAddress();
-};
+async function handleDialog(data) {
+ const payload = getPayload();
+ const body = { data, payload };
+ if (payload.updates.length) {
+ quasar
+ .dialog({
+ component: VnConfirm,
+ componentProps: {
+ title: t(
+ 'confirmTicket'
+ ),
+ message: t('confirmDeletionMessage'),
+ },
+ })
+ .onOk(async () => {
+ await updateAddressTicket();
+ await updateAll(body);
+ toCustomerAddress();
+ })
+ .onCancel(async () => {
+ await updateAll(body);
+ toCustomerAddress();
+ });
+ } else {
+ updateAll(body);
+ toCustomerAddress();
+ }
+}
const toCustomerAddress = () => {
+ notes.value = [];
+ deletes.value = [];
router.push({
name: 'CustomerAddress',
params: {
@@ -143,7 +188,7 @@ function handleLocation(data, location) {
:observe-form-changes="false"
:url-update="urlUpdate"
:url="`Addresses/${route.params.addressId}`"
- @on-data-saved="onDataSaved()"
+ :save-fn="handleDialog"
auto-load
>
@@ -336,4 +381,9 @@ es:
Remove note: Eliminar nota
Longitude: Longitud
Latitude: Latitud
+ confirmTicket: ¿Desea modificar también los estados de todos los tickets que están a punto de ser servidos?
+ confirmDeletionMessage: Si le das a aceptar, se modificaran todas las notas de los ticket a futuro
+en:
+ confirmTicket: Do you also want to modify the states of all the tickets that are about to be served?
+ confirmDeletionMessage: If you click accept, all the notes of the future tickets will be modified
diff --git a/src/pages/Customer/composables/__tests__/getAddresses.spec.js b/src/pages/Customer/composables/__tests__/getAddresses.spec.js
new file mode 100644
index 000000000..9e04a83cc
--- /dev/null
+++ b/src/pages/Customer/composables/__tests__/getAddresses.spec.js
@@ -0,0 +1,33 @@
+import { describe, it, expect, vi, afterEach } from 'vitest';
+import axios from 'axios';
+import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
+
+vi.mock('axios');
+
+describe('getAddresses', () => {
+ afterEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('should fetch addresses with correct parameters for a valid clientId', async () => {
+ const clientId = '12345';
+
+ await getAddresses(clientId);
+
+ expect(axios.get).toHaveBeenCalledWith(`Clients/${clientId}/addresses`, {
+ params: {
+ filter: JSON.stringify({
+ fields: ['nickname', 'street', 'city', 'id'],
+ where: { isActive: true },
+ order: 'nickname ASC',
+ }),
+ },
+ });
+ });
+
+ it('should return undefined when clientId is not provided', async () => {
+ await getAddresses(undefined);
+
+ expect(axios.get).not.toHaveBeenCalled();
+ });
+});
\ No newline at end of file
diff --git a/src/pages/Customer/composables/__tests__/getClient.spec.js b/src/pages/Customer/composables/__tests__/getClient.spec.js
new file mode 100644
index 000000000..a83d3d89f
--- /dev/null
+++ b/src/pages/Customer/composables/__tests__/getClient.spec.js
@@ -0,0 +1,41 @@
+import { describe, it, expect, vi, afterEach } from 'vitest';
+import axios from 'axios';
+import { getClient } from 'src/pages/Customer/composables/getClient';
+
+vi.mock('axios');
+
+describe('getClient', () => {
+ afterEach(() => {
+ vi.clearAllMocks();
+ });
+
+ const generateParams = (clientId) => ({
+ params: {
+ filter: JSON.stringify({
+ include: {
+ relation: 'defaultAddress',
+ scope: {
+ fields: ['id', 'agencyModeFk'],
+ },
+ },
+ where: { id: clientId },
+ }),
+ },
+ });
+
+ it('should fetch client data with correct parameters for a valid clientId', async () => {
+ const clientId = '12345';
+
+ await getClient(clientId);
+
+ expect(axios.get).toHaveBeenCalledWith('Clients', generateParams(clientId));
+ });
+
+ it('should return undefined when clientId is not provided', async () => {
+ const clientId = undefined;
+
+ await getClient(clientId);
+
+ expect(axios.get).toHaveBeenCalledWith('Clients', generateParams(clientId));
+ });
+});
diff --git a/src/pages/Customer/composables/getAddresses.js b/src/pages/Customer/composables/getAddresses.js
new file mode 100644
index 000000000..eecc0150b
--- /dev/null
+++ b/src/pages/Customer/composables/getAddresses.js
@@ -0,0 +1,14 @@
+import axios from 'axios';
+
+export async function getAddresses(clientId) {
+ if (!clientId) return;
+ const filter = {
+ fields: ['nickname', 'street', 'city', 'id'],
+ where: { isActive: true },
+ order: 'nickname ASC',
+ };
+ const params = { filter: JSON.stringify(filter) };
+ return await axios.get(`Clients/${clientId}/addresses`, {
+ params,
+ });
+};
\ No newline at end of file
diff --git a/src/pages/Customer/composables/getClient.js b/src/pages/Customer/composables/getClient.js
new file mode 100644
index 000000000..ecacc67c0
--- /dev/null
+++ b/src/pages/Customer/composables/getClient.js
@@ -0,0 +1,15 @@
+import axios from 'axios';
+
+export async function getClient(clientId) {
+ const filter = {
+ include: {
+ relation: 'defaultAddress',
+ scope: {
+ fields: ['id', 'agencyModeFk'],
+ },
+ },
+ where: { id: clientId },
+ };
+ const params = { filter: JSON.stringify(filter) };
+ return await axios.get('Clients', { params });
+};
\ No newline at end of file
diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
index 90aa50af7..498e67303 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
@@ -268,7 +268,7 @@ function deleteFile(dmsFk) {
-import VnCard from 'components/common/VnCard.vue';
+import VnCardBeta from 'components/common/VnCardBeta.vue';
import InvoiceInDescriptor from './InvoiceInDescriptor.vue';
-import InvoiceInFilter from '../InvoiceInFilter.vue';
-import InvoiceInSearchbar from '../InvoiceInSearchbar.vue';
-import { onBeforeRouteUpdate } from 'vue-router';
-import { setRectificative } from '../composables/setRectificative';
const filter = {
include: [
@@ -39,20 +35,13 @@ const filter = {
},
],
};
-
-onBeforeRouteUpdate(async (to) => await setRectificative(to));
+
-
-
-
-
-
+ :user-filter="filter"
+ />
diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
index 9fa3bcbcb..029a08d25 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue
@@ -105,7 +105,7 @@ async function setInvoiceCorrection(id) {
if (correctingData[0]) invoiceInCorrection.corrected = correctingData[0].correctedFk;
invoiceInCorrection.correcting = correctedData.map(
- (corrected) => corrected.correctingFk
+ (corrected) => corrected.correctingFk,
);
}
@@ -122,13 +122,13 @@ async function setInvoiceCorrection(id) {
-
+
-
-
+
+
{{ entity?.supplier?.nickname }}
@@ -145,7 +145,7 @@ async function setInvoiceCorrection(id) {
color="primary"
:to="routes.getSupplier(entity.supplierFk)"
>
- {{ t('invoicein.list.supplier') }}
+ {{ t('globals.supplier') }}
- {{ t('Entry') }}
+ {{ t('globals.entry') }}
- {{ t('InvoiceOut.card.ticketList') }}
+ {{ t('globals.ticketList') }}
- {{ t('invoicein.descriptorMenu.toBook') }}
+ {{ t('invoiceIn.descriptorMenu.toBook') }}
@@ -197,7 +197,7 @@ const createInvoiceInCorrection = async () => {
@click="triggerMenu('unbook')"
>
- {{ t('invoicein.descriptorMenu.toUnbook') }}
+ {{ t('invoiceIn.descriptorMenu.toUnbook') }}
{
clickable
@click="triggerMenu('delete')"
>
- {{ t('invoicein.descriptorMenu.deleteInvoice') }}
+ {{ t('invoiceIn.descriptorMenu.deleteInvoice') }}
- {{ t('invoicein.descriptorMenu.cloneInvoice') }}
+ {{ t('invoiceIn.descriptorMenu.cloneInvoice') }}
{{
- t('invoicein.descriptorMenu.showAgriculturalPdf')
+ t('invoiceIn.descriptorMenu.showAgriculturalPdf')
}}
{{ t('invoicein.descriptorMenu.sendAgriculturalPdf') }}...{{ t('invoiceIn.descriptorMenu.sendAgriculturalPdf') }}...
{
@click="triggerMenu('correct')"
>
{{ t('invoicein.descriptorMenu.createCorrective') }}...{{ t('invoiceIn.descriptorMenu.createCorrective') }}...
@@ -272,7 +272,6 @@ const createInvoiceInCorrection = async () => {
>
- {{ console.log('opt: ', opt) }}
{{ opt.id }} -
@@ -311,11 +310,11 @@ const createInvoiceInCorrection = async () => {
en:
- isNotLinked: The entry {bookEntry} has been deleted with {accountingEntries} entries
- isLinked: The entry has been linked to Sage. Please contact administration for further information
+ isNotLinked: The entry {bookEntry} has been deleted with {accountingEntries} entries
+ isLinked: The entry has been linked to Sage. Please contact administration for further information
assertAction: Are you sure you want to {action} this invoice?
es:
- isNotLinked: Se ha eliminado el asiento nº {bookEntry} con {accountingEntries} apuntes
- isLinked: El asiento fue enlazado a Sage, por favor contacta con administración
+ isNotLinked: Se ha eliminado el asiento nº {bookEntry} con {accountingEntries} apuntes
+ isLinked: El asiento fue enlazado a Sage, por favor contacta con administración
assertAction: Estas seguro de querer {action} esta factura?
diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue
index eca0c7af1..e546638f2 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue
@@ -27,14 +27,14 @@ const intrastatTotals = ref({ amount: 0, net: 0, stems: 0 });
const vatColumns = ref([
{
name: 'expense',
- label: 'invoicein.summary.expense',
+ label: 'invoiceIn.summary.expense',
field: (row) => row.expenseFk,
sortable: true,
align: 'left',
},
{
name: 'landed',
- label: 'invoicein.summary.taxableBase',
+ label: 'invoiceIn.summary.taxableBase',
field: (row) => row.taxableBase,
format: (value) => toCurrency(value),
sortable: true,
@@ -42,7 +42,7 @@ const vatColumns = ref([
},
{
name: 'vat',
- label: 'invoicein.summary.sageVat',
+ label: 'invoiceIn.summary.sageVat',
field: (row) => {
if (row.taxTypeSage) return `#${row.taxTypeSage.id} : ${row.taxTypeSage.vat}`;
},
@@ -52,7 +52,7 @@ const vatColumns = ref([
},
{
name: 'transaction',
- label: 'invoicein.summary.sageTransaction',
+ label: 'invoiceIn.summary.sageTransaction',
field: (row) => {
if (row.transactionTypeSage)
return `#${row.transactionTypeSage.id} : ${row.transactionTypeSage?.transaction}`;
@@ -63,7 +63,7 @@ const vatColumns = ref([
},
{
name: 'rate',
- label: 'invoicein.summary.rate',
+ label: 'invoiceIn.summary.rate',
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
format: (value) => toCurrency(value),
sortable: true,
@@ -71,7 +71,7 @@ const vatColumns = ref([
},
{
name: 'currency',
- label: 'invoicein.summary.currency',
+ label: 'invoiceIn.summary.currency',
field: (row) => row.foreignValue,
format: (val) => val && toCurrency(val, currency.value),
sortable: true,
@@ -82,21 +82,21 @@ const vatColumns = ref([
const dueDayColumns = ref([
{
name: 'date',
- label: 'invoicein.summary.dueDay',
+ label: 'invoiceIn.summary.dueDay',
field: (row) => toDate(row.dueDated),
sortable: true,
align: 'left',
},
{
name: 'bank',
- label: 'invoicein.summary.bank',
+ label: 'invoiceIn.summary.bank',
field: (row) => row.bank.bank,
sortable: true,
align: 'left',
},
{
name: 'amount',
- label: 'invoicein.list.amount',
+ label: 'invoiceIn.list.amount',
field: (row) => row.amount,
format: (value) => toCurrency(value),
sortable: true,
@@ -104,7 +104,7 @@ const dueDayColumns = ref([
},
{
name: 'landed',
- label: 'invoicein.summary.foreignValue',
+ label: 'invoiceIn.summary.foreignValue',
field: (row) => row.foreignValue,
format: (val) => val && toCurrency(val, currency.value),
sortable: true,
@@ -115,7 +115,7 @@ const dueDayColumns = ref([
const intrastatColumns = ref([
{
name: 'code',
- label: 'invoicein.summary.code',
+ label: 'invoiceIn.summary.code',
field: (row) => {
return `${row.intrastat.id}: ${row.intrastat?.description}`;
},
@@ -124,21 +124,21 @@ const intrastatColumns = ref([
},
{
name: 'amount',
- label: 'invoicein.list.amount',
+ label: 'invoiceIn.list.amount',
field: (row) => toCurrency(row.amount),
sortable: true,
align: 'left',
},
{
name: 'net',
- label: 'invoicein.summary.net',
+ label: 'invoiceIn.summary.net',
field: (row) => row.net,
sortable: true,
align: 'left',
},
{
name: 'stems',
- label: 'invoicein.summary.stems',
+ label: 'invoiceIn.summary.stems',
field: (row) => row.stems,
format: (value) => value,
sortable: true,
@@ -146,7 +146,7 @@ const intrastatColumns = ref([
},
{
name: 'landed',
- label: 'invoicein.summary.country',
+ label: 'invoiceIn.summary.country',
field: (row) => row.country?.code,
format: (value) => value,
sortable: true,
@@ -214,7 +214,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
/>
@@ -225,14 +225,14 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
-
+
`#/invoice-in/${entityId.value}/${param}`;
@@ -272,18 +272,18 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
/>
-
+
@@ -294,11 +294,11 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
-
+
`#/invoice-in/${entityId.value}/${param}`;
:color="amountsNotMatch ? 'negative' : 'transparent'"
:title="
amountsNotMatch
- ? t('invoicein.summary.noMatch')
- : t('invoicein.summary.dueTotal')
+ ? t('invoiceIn.summary.noMatch')
+ : t('invoiceIn.summary.dueTotal')
"
>
{{ toCurrency(entity.totals.totalDueDay) }}
@@ -318,7 +318,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
-
+
`#/invoice-in/${entityId.value}/${param}`;
-
+
@@ -404,7 +404,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
{
@@ -97,10 +97,10 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
map-options
hide-selected
:required="true"
- :rules="validate('invoicein.companyFk')"
+ :rules="validate('invoiceIn.companyFk')"
/>
diff --git a/src/pages/InvoiceIn/InvoiceInFilter.vue b/src/pages/InvoiceIn/InvoiceInFilter.vue
index 31a611936..43b91c93f 100644
--- a/src/pages/InvoiceIn/InvoiceInFilter.vue
+++ b/src/pages/InvoiceIn/InvoiceInFilter.vue
@@ -164,7 +164,7 @@ function handleDaysAgo(params, daysAgo) {
[
{
align: 'left',
name: 'isBooked',
- label: t('invoicein.isBooked'),
+ label: t('invoiceIn.isBooked'),
columnFilter: false,
},
{
@@ -41,7 +41,7 @@ const cols = computed(() => [
{
align: 'left',
name: 'supplierFk',
- label: t('invoicein.list.supplier'),
+ label: t('invoiceIn.list.supplier'),
columnFilter: {
component: 'select',
attrs: {
@@ -55,16 +55,16 @@ const cols = computed(() => [
{
align: 'left',
name: 'supplierRef',
- label: t('invoicein.list.supplierRef'),
+ label: t('invoiceIn.list.supplierRef'),
},
{
align: 'left',
name: 'serial',
- label: t('invoicein.serial'),
+ label: t('invoiceIn.serial'),
},
{
align: 'left',
- label: t('invoicein.list.issued'),
+ label: t('invoiceIn.list.issued'),
name: 'issued',
component: null,
columnFilter: {
@@ -74,7 +74,7 @@ const cols = computed(() => [
},
{
align: 'left',
- label: t('invoicein.list.dueDated'),
+ label: t('invoiceIn.list.dueDated'),
name: 'dueDated',
component: null,
columnFilter: {
@@ -86,12 +86,12 @@ const cols = computed(() => [
{
align: 'left',
name: 'awbCode',
- label: t('invoicein.list.awb'),
+ label: t('invoiceIn.list.awb'),
},
{
align: 'left',
name: 'amount',
- label: t('invoicein.list.amount'),
+ label: t('invoiceIn.list.amount'),
format: ({ amount }) => toCurrency(amount),
cardVisible: true,
},
@@ -130,71 +130,84 @@ const cols = computed(() => [
},
]);
+
(companies = data)" auto-load />
-
-
-
-
-
-
-
-
-
- {{ row.supplierName }}
-
-
+
+
-
-
+
-
-
-
- {{ scope.opt?.nickname }}
- #{{ scope.opt?.id }}, {{ scope.opt?.name }}
-
-
+
+
+ {{ row.supplierName }}
+
+
-
-
-
-
+
+
+
+
+
+ {{ scope.opt?.nickname }}
+
+ #{{ scope.opt?.id }}, {{ scope.opt?.name }}
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/pages/InvoiceIn/InvoiceInSearchbar.vue b/src/pages/InvoiceIn/InvoiceInSearchbar.vue
deleted file mode 100644
index f2731b005..000000000
--- a/src/pages/InvoiceIn/InvoiceInSearchbar.vue
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-es:
- Search invoice: Buscar factura recibida
- Search invoices in by id or supplier fiscal name: Buscar facturas recibidas por id o por nombre fiscal del proveedor
-
diff --git a/src/pages/InvoiceIn/locale/en.yml b/src/pages/InvoiceIn/locale/en.yml
index 94db50066..6b21b316b 100644
--- a/src/pages/InvoiceIn/locale/en.yml
+++ b/src/pages/InvoiceIn/locale/en.yml
@@ -1,4 +1,6 @@
-invoicein:
+invoiceIn:
+ search: Search invoice
+ searchInfo: Search incoming invoices by ID or supplier fiscal name
serial: Serial
isBooked: Is booked
list:
diff --git a/src/pages/InvoiceIn/locale/es.yml b/src/pages/InvoiceIn/locale/es.yml
index bcb9c0551..3f27c895c 100644
--- a/src/pages/InvoiceIn/locale/es.yml
+++ b/src/pages/InvoiceIn/locale/es.yml
@@ -1,4 +1,6 @@
-invoicein:
+invoiceIn:
+ search: Buscar factura recibida
+ searchInfo: Buscar facturas recibidas por ID o nombre fiscal del proveedor
serial: Serie
isBooked: Contabilizada
list:
@@ -63,6 +65,7 @@ invoicein:
params:
search: Id o nombre proveedor
correctedFk: Rectificada
+ isBooked: Contabilizada
account: Cuenta contable
correctingFk: Rectificativa
diff --git a/src/pages/Item/ItemRequest.vue b/src/pages/Item/ItemRequest.vue
index d96fbca2f..76e4b8083 100644
--- a/src/pages/Item/ItemRequest.vue
+++ b/src/pages/Item/ItemRequest.vue
@@ -272,11 +272,12 @@ const onDenyAccept = (_, responseData) => {
diff --git a/src/pages/Route/Agency/AgencyList.vue b/src/pages/Route/Agency/AgencyList.vue
index 9d456c1da..4322b9bc8 100644
--- a/src/pages/Route/Agency/AgencyList.vue
+++ b/src/pages/Route/Agency/AgencyList.vue
@@ -2,11 +2,12 @@
import { computed } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
-import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnTable from 'components/VnTable/VnTable.vue';
+import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n();
const router = useRouter();
+const dataKey = 'AgencyList';
function navigate(id) {
router.push({ path: `/agency/${id}` });
}
@@ -67,26 +68,28 @@ const columns = computed(() => [
]);
-
-
+
+