Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
commit
d611a7387c
|
@ -130,20 +130,22 @@ async function onDataSaved(formData, { id }) {
|
|||
}
|
||||
}
|
||||
|
||||
async function getSupplierClientReferences(value) {
|
||||
if (!value) return (initialData.description = '');
|
||||
const params = { bankAccount: value };
|
||||
const { data } = await axios(`Clients/getClientOrSupplierReference`, { params });
|
||||
if (!data.clientId) {
|
||||
initialData.description = t('Supplier Compensation Reference', {
|
||||
supplierId: data.supplierId,
|
||||
supplierName: data.supplierName,
|
||||
async function getSupplierClientReferences(data) {
|
||||
if (!data) return (initialData.description = '');
|
||||
const params = { bankAccount: data.compensationAccount };
|
||||
const { data: reference } = await axios(`Clients/getClientOrSupplierReference`, {
|
||||
params,
|
||||
});
|
||||
if (reference.supplierId) {
|
||||
data.description = t('Supplier Compensation Reference', {
|
||||
supplierId: reference.supplierId,
|
||||
supplierName: reference.supplierName,
|
||||
});
|
||||
return;
|
||||
}
|
||||
initialData.description = t('Client Compensation Reference', {
|
||||
clientId: data.clientId,
|
||||
clientName: data.clientName,
|
||||
data.description = t('Client Compensation Reference', {
|
||||
clientId: reference.clientId,
|
||||
clientName: reference.clientName,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -252,7 +254,7 @@ async function getAmountPaid() {
|
|||
:label="t('Compensation account')"
|
||||
clearable
|
||||
v-model="data.compensationAccount"
|
||||
@blur="getSupplierClientReferences(data.compensationAccount)"
|
||||
@blur="getSupplierClientReferences(data)"
|
||||
/>
|
||||
</VnRow>
|
||||
</div>
|
||||
|
@ -288,6 +290,9 @@ async function getAmountPaid() {
|
|||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
Supplier Compensation Reference: ({supplierId}) Ntro Proveedor {supplierName}
|
||||
Client Compensation Reference: ({clientId}) Ntro Cliente {clientName}
|
||||
es:
|
||||
New payment: Añadir pago
|
||||
Date: Fecha
|
||||
|
|
Loading…
Reference in New Issue