feat(saving_account): add columns

This commit is contained in:
Simon Vieille 2025-03-30 14:12:42 +02:00
commit 1b03ecd905
Signed by: deblan
GPG key ID: 579388D585F70417
3 changed files with 19 additions and 2 deletions

View file

@ -24,7 +24,7 @@ const renderDateTime = (value) => {
const renderCategory = (item) => {
if (item !== null) {
return `<span class="badge" style="background: ${item.color}">&nbsp;</span> ${item.label}`
return `<span class="fa-solid fa-square" style="color: ${item.color}" b>&nbsp;</span> ${item.label}`
}
}

View file

@ -48,6 +48,7 @@ import DataList from '../../components/crud/DataList.vue'
import { ref, onMounted, watch } from 'vue'
import { getStorage, saveStorage } from '../../lib/storage'
import { createRequestOptions } from '../../lib/request'
import { renderEuro, renderLabelWithSum } from '../../lib/renderers'
import { useRouter } from 'vue-router'
const endpoint = `/api/saving_account`
@ -114,6 +115,22 @@ const fields = [
key: 'label',
label: 'Libellé',
},
{
key: 'blocked_amount',
renderLabel: (rows) => renderLabelWithSum('Montant bloqué', rows, 'blocked_amount'),
width: '200px',
thClasses: ['text-end'],
tdClasses: ['text-end'],
render: (item) => renderEuro(item.blocked_amount),
},
{
key: 'released_amount',
renderLabel: (rows) => renderLabelWithSum('Montant débloqué', rows, 'released_amount'),
width: '200px',
thClasses: ['text-end'],
tdClasses: ['text-end'],
render: (item) => renderEuro(item.released_amount),
},
]
onMounted(() => {

View file

@ -94,7 +94,7 @@
</template>
<script setup>
import { BTableSimple, BTr, BTh, BTd, BModal, BFormSelect, BFormGroup, BButton, BRow, BCol } from 'bootstrap-vue-next'
import { BTableSimple, BTr, BTh, BTd, BModal, BFormSelect, BButton, BRow, BCol } from 'bootstrap-vue-next'
import { renderDate, renderCategory } from '../../lib/renderers'
import { createRequestOptions } from '../../lib/request'
import { onMounted, ref, watch } from 'vue'