production #1

Merged
sipo merged 45 commits from production into master 2026-01-27 18:02:44 +00:00
3 changed files with 10 additions and 1 deletions
Showing only changes of commit f646b6530a - Show all commits

View File

@ -34,6 +34,7 @@ class ClientContractsExport extends DefaultValueBinder implements FromQuery, Sho
public const COLUMN_METADATA = [ public const COLUMN_METADATA = [
'reference' => ['label' => 'Referenca'], 'reference' => ['label' => 'Referenca'],
'customer' => ['label' => 'Stranka'], 'customer' => ['label' => 'Stranka'],
'address' => ['label' => 'Naslov'],
'start' => ['label' => 'Začetek'], 'start' => ['label' => 'Začetek'],
'segment' => ['label' => 'Segment'], 'segment' => ['label' => 'Segment'],
'balance' => ['label' => 'Stanje'], 'balance' => ['label' => 'Stanje'],
@ -105,6 +106,7 @@ private function resolveValue(Contract $contract, string $column): mixed
return match ($column) { return match ($column) {
'reference' => $contract->reference, 'reference' => $contract->reference,
'customer' => optional($contract->clientCase?->person)->full_name, 'customer' => optional($contract->clientCase?->person)->full_name,
'address' => optional($contract->clientCase?->person?->address)->address,
'start' => $this->formatDate($contract->start_date), 'start' => $this->formatDate($contract->start_date),
'segment' => $contract->segments?->first()?->name, 'segment' => $contract->segments?->first()?->name,
'balance' => optional($contract->account)->balance_amount, 'balance' => optional($contract->account)->balance_amount,

View File

@ -141,6 +141,7 @@ public function contracts(Client $client, Request $request)
->with([ ->with([
'clientCase:id,uuid,person_id', 'clientCase:id,uuid,person_id',
'clientCase.person:id,full_name', 'clientCase.person:id,full_name',
'clientCase.person.address',
'segments' => function ($q) { 'segments' => function ($q) {
$q->wherePivot('active', true)->select('segments.id', 'segments.name'); $q->wherePivot('active', true)->select('segments.id', 'segments.name');
}, },
@ -188,6 +189,7 @@ public function exportContracts(ExportClientContractsRequest $request, Client $c
->with([ ->with([
'clientCase:id,uuid,person_id', 'clientCase:id,uuid,person_id',
'clientCase.person:id,full_name', 'clientCase.person:id,full_name',
'clientCase.person.address',
'segments' => function ($q) { 'segments' => function ($q) {
$q->wherePivot('active', true)->select('segments.id', 'segments.name'); $q->wherePivot('active', true)->select('segments.id', 'segments.name');
}, },

View File

@ -62,13 +62,14 @@ const filterPopoverOpen = ref(false);
const exportDialogOpen = ref(false); const exportDialogOpen = ref(false);
const exportScope = ref("current"); const exportScope = ref("current");
const exportColumns = ref(["reference", "customer", "start", "segment", "balance"]); const exportColumns = ref(["reference", "customer", "address", "start", "segment", "balance"]);
const exportError = ref(""); const exportError = ref("");
const isExporting = ref(false); const isExporting = ref(false);
const exportableColumns = [ const exportableColumns = [
{ key: "reference", label: "Referenca" }, { key: "reference", label: "Referenca" },
{ key: "customer", label: "Stranka" }, { key: "customer", label: "Stranka" },
{ key: "address", label: "Naslov" },
{ key: "start", label: "Začetek" }, { key: "start", label: "Začetek" },
{ key: "segment", label: "Segment" }, { key: "segment", label: "Segment" },
{ key: "balance", label: "Stanje" }, { key: "balance", label: "Stanje" },
@ -359,6 +360,7 @@ function extractFilenameFromHeaders(headers) {
:columns="[ :columns="[
{ key: 'reference', label: 'Referenca', sortable: false }, { key: 'reference', label: 'Referenca', sortable: false },
{ key: 'customer', label: 'Stranka', sortable: false }, { key: 'customer', label: 'Stranka', sortable: false },
{ key: 'address', label: 'Naslov', sortable: false },
{ key: 'start', label: 'Začetek', sortable: false }, { key: 'start', label: 'Začetek', sortable: false },
{ key: 'segment', label: 'Segment', sortable: false }, { key: 'segment', label: 'Segment', sortable: false },
{ key: 'balance', label: 'Stanje', sortable: false, align: 'right' }, { key: 'balance', label: 'Stanje', sortable: false, align: 'right' },
@ -492,6 +494,9 @@ function extractFilenameFromHeaders(headers) {
<template #cell-customer="{ row }"> <template #cell-customer="{ row }">
{{ row.client_case?.person?.full_name || "-" }} {{ row.client_case?.person?.full_name || "-" }}
</template> </template>
<template #cell-address="{ row }">
{{ row.client_case?.person?.address?.address || "-" }}
</template>
<template #cell-start="{ row }"> <template #cell-start="{ row }">
{{ formatDate(row.start_date) }} {{ formatDate(row.start_date) }}
</template> </template>