import fix for update so it does not insert person and client case

This commit is contained in:
Simon Pocrnjič
2025-10-16 20:11:45 +02:00
parent ed62311ba4
commit e782bcca7c
11 changed files with 393 additions and 54 deletions
+14
View File
@@ -24,6 +24,16 @@ const fmtCurrency = (v) => {
return `${n.toFixed(2)}`;
}
};
const fmtDateDMY = (v) => {
if (!v) return "-";
const d = new Date(v);
if (isNaN(d)) return "-";
const dd = String(d.getDate()).padStart(2, "0");
const mm = String(d.getMonth() + 1).padStart(2, "0");
const yyyy = d.getFullYear();
return `${dd}.${mm}.${yyyy}`;
};
</script>
<template>
<AppLayout title="Client cases">
@@ -43,6 +53,7 @@ const fmtCurrency = (v) => {
{ key: 'case', label: 'Primer', sortable: false },
{ key: 'client', label: 'Stranka', sortable: false },
{ key: 'tax', label: 'Davčna', sortable: false },
{ key: 'created_at', label: 'Ustvarjeno', sortable: false },
{
key: 'active_contracts',
label: 'Aktivne pogodbe',
@@ -97,6 +108,9 @@ const fmtCurrency = (v) => {
<template #cell-tax="{ row }">
{{ row.person?.tax_number || "-" }}
</template>
<template #cell-created_at="{ row }">
{{ fmtDateDMY(row.created_at) }}
</template>
<template #cell-active_contracts="{ row }">
<div class="text-right">{{ row.active_contracts_count ?? 0 }}</div>
</template>