diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue
index c850f2e53..339f90e0e 100644
--- a/src/components/common/VnSelect.vue
+++ b/src/components/common/VnSelect.vue
@@ -171,7 +171,8 @@ onMounted(() => {
});
const arrayDataKey =
- $props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
+ $props.dataKey ??
+ ($props.url?.length > 0 ? $props.url : ($attrs.name ?? $attrs.label));
const arrayData = useArrayData(arrayDataKey, {
url: $props.url,
@@ -220,7 +221,7 @@ async function fetchFilter(val) {
optionFilterValue.value ??
(new RegExp(/\d/g).test(val)
? optionValue.value
- : optionFilter.value ?? optionLabel.value);
+ : (optionFilter.value ?? optionLabel.value));
let defaultWhere = {};
if ($props.filterOptions.length) {
@@ -239,7 +240,7 @@ async function fetchFilter(val) {
const { data } = await arrayData.applyFilter(
{ filter: filterOptions },
- { updateRouter: false }
+ { updateRouter: false },
);
setOptions(data);
return data;
@@ -272,7 +273,7 @@ async function filterHandler(val, update) {
ref.setOptionIndex(-1);
ref.moveOptionSelection(1, true);
}
- }
+ },
);
}
@@ -308,7 +309,7 @@ function handleKeyDown(event) {
if (inputValue) {
const matchingOption = myOptions.value.find(
(option) =>
- option[optionLabel.value].toLowerCase() === inputValue.toLowerCase()
+ option[optionLabel.value].toLowerCase() === inputValue.toLowerCase(),
);
if (matchingOption) {
@@ -320,11 +321,11 @@ function handleKeyDown(event) {
}
const focusableElements = document.querySelectorAll(
- 'a:not([disabled]), button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), details:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])'
+ 'a:not([disabled]), button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), details:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])',
);
const currentIndex = Array.prototype.indexOf.call(
focusableElements,
- event.target
+ event.target,
);
if (currentIndex >= 0 && currentIndex < focusableElements.length - 1) {
focusableElements[currentIndex + 1].focus();
diff --git a/src/components/common/VnSelectSupplier.vue b/src/components/common/VnSelectSupplier.vue
index f86db4f2d..5a821456e 100644
--- a/src/components/common/VnSelectSupplier.vue
+++ b/src/components/common/VnSelectSupplier.vue
@@ -1,9 +1,7 @@
@@ -11,10 +9,11 @@ const url = 'Suppliers';
:label="$t('globals.supplier')"
v-bind="$attrs"
v-model="model"
- :url="url"
+ url="Suppliers"
option-value="id"
option-label="nickname"
:fields="['id', 'name', 'nickname', 'nif']"
+ :filter-options="['id', 'name', 'nickname', 'nif']"
sort-by="name ASC"
>
diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml
index ea5fa9e41..a082ca88d 100644
--- a/src/i18n/locale/es.yml
+++ b/src/i18n/locale/es.yml
@@ -352,7 +352,7 @@ globals:
from: Desde
to: Hasta
supplierFk: Proveedor
- supplierRef: Ref. proveedor
+ supplierRef: Nº factura
serial: Serie
amount: Importe
awbCode: AWB
diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
index a3beabdb6..0cc9ac2c9 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
@@ -125,7 +125,7 @@ function deleteFile(dmsFk) {
@@ -310,7 +310,6 @@ function deleteFile(dmsFk) {
supplierFk: Supplier
es:
supplierFk: Proveedor
- Supplier ref: Ref. proveedor
Expedition date: Fecha expedición
Operation date: Fecha operación
Undeductible VAT: Iva no deducible
diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptorMenu.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptorMenu.vue
index c3ab635c8..8b039ec27 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInDescriptorMenu.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptorMenu.vue
@@ -186,7 +186,7 @@ const createInvoiceInCorrection = async () => {
clickable
@click="book(entityId)"
>
- {{ t('invoiceIn.descriptorMenu.toBook') }}
+ {{ t('invoiceIn.descriptorMenu.book') }}
@@ -197,7 +197,7 @@ const createInvoiceInCorrection = async () => {
@click="triggerMenu('unbook')"
>
- {{ t('invoiceIn.descriptorMenu.toUnbook') }}
+ {{ t('invoiceIn.descriptorMenu.unbook') }}
-import { ref, computed } from 'vue';
+import { ref, computed, onBeforeMount } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
@@ -12,6 +12,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import useNotify from 'src/composables/useNotify.js';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
+import { toCurrency } from 'filters/index';
const route = useRoute();
const { notify } = useNotify();
@@ -26,7 +27,7 @@ const invoiceInFormRef = ref();
const invoiceId = +route.params.id;
const filter = { where: { invoiceInFk: invoiceId } };
const areRows = ref(false);
-
+const totals = ref();
const columns = computed(() => [
{
name: 'duedate',
@@ -66,6 +67,8 @@ const columns = computed(() => [
},
]);
+const totalAmount = computed(() => getTotal(invoiceInFormRef.value.formData, 'amount'));
+
const isNotEuro = (code) => code != 'EUR';
async function insert() {
@@ -73,6 +76,10 @@ async function insert() {
await invoiceInFormRef.value.reload();
notify(t('globals.dataSaved'), 'positive');
}
+
+onBeforeMount(async () => {
+ totals.value = (await axios.get(`InvoiceIns/${invoiceId}/getTotals`)).data;
+});
- {{ getTotal(rows, 'amount', { currency: 'default' }) }}
+ {{ toCurrency(totalAmount) }}
@@ -235,7 +242,16 @@ async function insert() {
v-shortcut="'+'"
size="lg"
round
- @click="!areRows ? insert() : invoiceInFormRef.insert()"
+ @click="
+ () => {
+ if (!areRows) insert();
+ else
+ invoiceInFormRef.insert({
+ amount: (totals.totalTaxableBase - totalAmount).toFixed(2),
+ invoiceInFk: invoiceId,
+ });
+ }
+ "
/>
diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue
index e546638f2..d358601d3 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue
@@ -193,7 +193,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
`#/invoice-in/${entityId.value}/${param}`;
-
+
`#/invoice-in/${entityId.value}/${param}`;
entity.totals.totalTaxableBaseForeignValue &&
toCurrency(
entity.totals.totalTaxableBaseForeignValue,
- currency
+ currency,
)
}}
@@ -392,7 +389,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
entity.totals.totalDueDayForeignValue &&
toCurrency(
entity.totals.totalDueDayForeignValue,
- currency
+ currency,
)
}}
@@ -472,5 +469,5 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
Search invoice: Buscar factura recibida
You can search by invoice reference: Puedes buscar por referencia de la factura
Totals: Totales
- To book: Contabilizar
+ Book: Contabilizar
diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue
index edb43375f..e77453bc0 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue
@@ -1,5 +1,5 @@
{
@@ -210,7 +228,7 @@ const combinedTotal = computed(() => {
-
+
{
@@ -244,11 +266,15 @@ const combinedTotal = computed(() => {
@@ -266,7 +292,7 @@ const combinedTotal = computed(() => {
-
+
await toBook(id));
+ if (!messages.length) toBook(id);
+ else
+ dialog({
+ component: VnConfirm,
+ componentProps: {
+ title: t('Are you sure you want to book this invoice?'),
+ message: messages.reduce((acc, msg) => `${acc}${msg}
`, ''),
+ },
+ }).onOk(() => toBook(id));
}
async function toBook(id) {
@@ -59,4 +82,7 @@ async function toBook(id) {
es:
Are you sure you want to book this invoice?: ¿Estás seguro de querer asentar esta factura?
It was not able to book the invoice: No se pudo contabilizar la factura
+ Some due dates are less than or equal to today: Algún vencimiento tiene una fecha menor o igual que hoy
+ The sum of the taxable bases does not match the due dates: La suma de las bases imponibles no coincide con la de los vencimientos
+ The VAT and Transaction fields have not been informed: No se han informado los campos de iva y/o transacción
diff --git a/src/pages/InvoiceIn/locale/en.yml b/src/pages/InvoiceIn/locale/en.yml
index 6b21b316b..548e6c201 100644
--- a/src/pages/InvoiceIn/locale/en.yml
+++ b/src/pages/InvoiceIn/locale/en.yml
@@ -3,10 +3,10 @@ invoiceIn:
searchInfo: Search incoming invoices by ID or supplier fiscal name
serial: Serial
isBooked: Is booked
+ supplierRef: Invoice nº
list:
ref: Reference
supplier: Supplier
- supplierRef: Supplier ref.
file: File
issued: Issued
dueDated: Due dated
@@ -19,8 +19,6 @@ invoiceIn:
unbook: Unbook
delete: Delete
clone: Clone
- toBook: To book
- toUnbook: To unbook
deleteInvoice: Delete invoice
invoiceDeleted: invoice deleted
cloneInvoice: Clone invoice
@@ -70,4 +68,3 @@ invoiceIn:
isBooked: Is booked
account: Ledger account
correctingFk: Rectificative
-
\ No newline at end of file
diff --git a/src/pages/InvoiceIn/locale/es.yml b/src/pages/InvoiceIn/locale/es.yml
index 3f27c895c..142d95f92 100644
--- a/src/pages/InvoiceIn/locale/es.yml
+++ b/src/pages/InvoiceIn/locale/es.yml
@@ -3,10 +3,10 @@ invoiceIn:
searchInfo: Buscar facturas recibidas por ID o nombre fiscal del proveedor
serial: Serie
isBooked: Contabilizada
+ supplierRef: Nº factura
list:
ref: Referencia
supplier: Proveedor
- supplierRef: Ref. proveedor
issued: F. emisión
dueDated: F. vencimiento
file: Fichero
@@ -15,12 +15,10 @@ invoiceIn:
descriptor:
ticketList: Listado de tickets
descriptorMenu:
- book: Asentar
- unbook: Desasentar
+ book: Contabilizar
+ unbook: Descontabilizar
delete: Eliminar
clone: Clonar
- toBook: Contabilizar
- toUnbook: Descontabilizar
deleteInvoice: Eliminar factura
invoiceDeleted: Factura eliminada
cloneInvoice: Clonar factura
@@ -68,4 +66,3 @@ invoiceIn:
isBooked: Contabilizada
account: Cuenta contable
correctingFk: Rectificativa
-