diff --git a/src/components/common/VnAccountNumber.vue b/src/components/common/VnAccountNumber.vue
index c4fa78674..f66684a0f 100644
--- a/src/components/common/VnAccountNumber.vue
+++ b/src/components/common/VnAccountNumber.vue
@@ -9,7 +9,7 @@ const $props = defineProps({
},
insertable: {
type: Boolean,
- default: false,
+ default: true,
},
});
@@ -79,5 +79,10 @@ function accountShortToStandard() {
-
+
diff --git a/src/pages/Supplier/Card/SupplierFiscalData.vue b/src/pages/Supplier/Card/SupplierFiscalData.vue
index 1a79be8bc..46e377139 100644
--- a/src/pages/Supplier/Card/SupplierFiscalData.vue
+++ b/src/pages/Supplier/Card/SupplierFiscalData.vue
@@ -106,8 +106,6 @@ function handleLocation(data, location) {
:label="t('supplier.fiscalData.account')"
clearable
data-cy="supplierFiscalDataAccount"
- insertable
- :maxlength="10"
/>
{
- urlCreate.value = `Suppliers/${route.params.id}/createReceipt`;
+ urlCreate.value = `Suppliers/${route.params.id}/createPayment`;
});
function setPaymentType(accounting) {
if (!accounting) return;
accountingType.value = accounting.accountingType;
- initialData.description = [];
- initialData.payed = Date.vnNew();
+ initialData.concept = [];
+ initialData.received = 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
+ initialData.received.setDate(
+ initialData.received.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);
+ if (accountingType.value.code == 'compensation') return (initialData.concept = '');
+ if (accountingType.value.receiptconcept)
+ initialData.concept.push(accountingType.value.receiptconcept);
+ if (initialData.concept) initialData.concept.push(initialData.concept);
- initialData.description = initialData.description.join(', ');
+ initialData.concept = initialData.concept.join(', ');
}
const calculateFromAmount = (event) => {
@@ -115,17 +120,18 @@ const calculateFromAmount = (event) => {
};
const calculateFromDeliveredAmount = (event) => {
- initialData.amountToReturn = parseFloat(event) - initialData.amountPaid;
+ initialData.amountToReturn = parseFloat(event) - initialData.amount;
};
function onBeforeSave(data) {
- const exceededAmount = data.amountPaid > maxAmount.value;
+ const exceededAmount = data.amount > maxAmount.value;
if (isCash.value && exceededAmount)
return notify(t('Amount exceeded', { maxAmount: maxAmount.value }), 'negative');
if (isCash.value && shouldSendEmail.value && !data.email)
return notify(t(`There is no assigned email for this supplier`), 'negative');
+ data.dueDate = data.received;
data.bankFk = data.bankFk.id;
return data;
}
@@ -144,25 +150,7 @@ async function onDataSaved(formData, { id }) {
}
}
-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() {
+async function getAmount() {
const filter = {
where: {
supplierFk: route.params.id,
@@ -170,7 +158,7 @@ async function getAmountPaid() {
},
};
const { data } = await getSupplierRisk(filter);
- initialData.amountPaid = (data?.length && data[0].amount) || undefined;
+ initialData.amount = (data?.length && data[0].amount) || undefined;
}
@@ -195,7 +183,7 @@ async function getAmountPaid() {
@on-fetch="(data) => (currenciesOptions = data)"
auto-load
/>
-
-
+
@@ -213,7 +201,7 @@ async function getAmountPaid() {
@@ -251,33 +239,30 @@ async function getAmountPaid() {
-
-
-
- {{ t('Compensation') }}
-
-
-
-
-
+
+
@@ -305,7 +290,12 @@ async function getAmountPaid() {
v-if="$props.extraFields.includes('orderBy')"
:label="t('Type')"
v-model="data.orderBy"
- :options="['issued', ' bookEntried', ' booked', ' dueDate']"
+ :options="[
+ { id: 'issued', name: 'Fecha de expedición' },
+ { id: 'bookEntried', name: 'Fecha de asiento' },
+ { id: 'booked', name: 'Fecha contable' },
+ { id: 'dueDate', name: 'Fecha de vencimiento' },
+ ]"
option-value="id"
option-label="name"
hide-selected
@@ -327,27 +317,8 @@ async function getAmountPaid() {
v-model="data.divisa"
/>
-
-
-
-
-
+