#7134 SupplierBalance #905
|
@ -0,0 +1,12 @@
|
||||||
|
export default function (initialFooter, data) {
|
||||||
|
const footer = data.reduce(
|
||||||
|
(acc, row) => {
|
||||||
|
Object.entries(initialFooter).forEach(([key, initialValue]) => {
|
||||||
|
acc[key] += row?.[key] !== undefined ? row[key] : initialValue;
|
||||||
|
});
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
{ ...initialFooter }
|
||||||
|
);
|
||||||
|
return footer;
|
||||||
|
}
|
|
@ -6,7 +6,7 @@ import { useAcl } from 'src/composables/useAcl';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { getSupplierRisk } from 'src/composables/getRisk';
|
import { getSupplierRisk } from 'src/composables/getRisk';
|
||||||
|
import tableFooter from 'src/components/VnTable/filters/tableFooter';
|
||||||
import { dashIfEmpty, toCurrency, toDate, toDateHourMin } from 'src/filters';
|
import { dashIfEmpty, toCurrency, toDate, toDateHourMin } from 'src/filters';
|
||||||
import { useState } from 'composables/useState';
|
import { useState } from 'composables/useState';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
@ -187,7 +187,15 @@ async function getCurrentBalance() {
|
||||||
});
|
});
|
||||||
return currentBalance && currentBalance.amount;
|
return currentBalance && currentBalance.amount;
|
||||||
}
|
}
|
||||||
|
function setFooter(data) {
|
||||||
|
const initialFooter = {
|
||||||
|
invoiceEuros: 0,
|
||||||
|
paymentEuros: 0,
|
||||||
|
euroBalance: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
tableRef.value.footer = tableFooter(initialFooter, data);
|
||||||
|
}
|
||||||
async function onFetch(data) {
|
async function onFetch(data) {
|
||||||
return;
|
return;
|
||||||
// balances.value = [];
|
// balances.value = [];
|
||||||
|
|
Loading…
Reference in New Issue