fix: refs #7134 remove risk

This commit is contained in:
Javier Segarra 2025-01-13 22:58:36 +01:00
parent a8e1bdc684
commit 252dd21492
2 changed files with 2 additions and 25 deletions

View File

@ -1,23 +0,0 @@
import axios from 'axios';
const method = {
supplier: 'SupplierRisks',
customer: 'ClientRisks',
};
export async function getRisk(module, _filter) {
const filter = {
..._filter,
include: { relation: 'company', scope: { fields: ['code'] } },
};
return await axios(module, {
params: { filter: JSON.stringify(filter) },
});
}
export async function getClientRisk(_filter) {
return await getRisk(method.customer, _filter);
}
export async function getSupplierRisk(_filter) {
return await getRisk(method.supplier, _filter);
}

View File

@ -170,7 +170,7 @@ onBeforeMount(() => {
companyId.value = companyUser.value; companyId.value = companyUser.value;
}); });
async function getRisks() { async function getClientRisks() {
const filter = { const filter = {
where: { clientFk: route.params.id, companyFk: companyUser.value }, where: { clientFk: route.params.id, companyFk: companyUser.value },
}; };
@ -180,7 +180,7 @@ async function getRisks() {
} }
async function getCurrentBalance() { async function getCurrentBalance() {
const currentBalance = (await getRisks()).find((balance) => { const currentBalance = (await getClientRisks()).find((balance) => {
return balance.companyFk === companyId.value; return balance.companyFk === companyId.value;
}); });
return currentBalance && currentBalance.amount; return currentBalance && currentBalance.amount;