This commit is contained in:
parent
136f9abeff
commit
0faa42867d
|
@ -9,7 +9,6 @@ import { getTotal } from 'src/composables/getTotal';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import { toCurrency } from 'src/filters';
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
|
@ -72,7 +71,6 @@ async function insert() {
|
||||||
await invoiceInFormRef.value.reload();
|
await invoiceInFormRef.value.reload();
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
}
|
}
|
||||||
// const getTotal = (rows, key) => rows.reduce((acc, row) => acc + +row[key], 0);
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
|
|
@ -164,11 +164,6 @@ async function addExpense() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatTotal = (rows, key, cb) => {
|
|
||||||
const total = rows.reduce((acc, row) => acc + +(cb ? cb(row) : row[key] || 0), 0);
|
|
||||||
return toCurrency(total, key == 'foreignValue' ? currency.value : undefined);
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatOpt = (row, { model, options }, prop) => {
|
const formatOpt = (row, { model, options }, prop) => {
|
||||||
const obj = row[model];
|
const obj = row[model];
|
||||||
const option = options.find(({ id }) => id == obj);
|
const option = options.find(({ id }) => id == obj);
|
||||||
|
|
Loading…
Reference in New Issue