Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdwallo committed Oct 22, 2024
1 parent add50b0 commit 5ba8e26
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/Filament/Company/Pages/Reports/AccountTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getTable(): array
->label('Credit')
->alignment(Alignment::Right),
Column::make('balance')
->label('Balance')
->label('Running Balance')
->alignment(Alignment::Right),
];
}
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Company/Pages/Reports/BalanceSheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ protected function getTransformer(ReportDTO $reportDTO): ExportableReport

public function exportCSV(): StreamedResponse
{
return $this->exportService->exportToCsv($this->company, $this->report, $this->getFilterState('asOfDate'));
return $this->exportService->exportToCsv($this->company, $this->report, endDate: $this->getFilterState('asOfDate'));
}

public function exportPDF(): StreamedResponse
{
return $this->exportService->exportToPdf($this->company, $this->report, $this->getFilterState('asOfDate'));
return $this->exportService->exportToPdf($this->company, $this->report, endDate: $this->getFilterState('asOfDate'));
}
}
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
.company-name {
font-size: 1.125rem;
font-weight: 600;
font-weight: bold;
}
.date-range {
Expand All @@ -71,7 +71,7 @@
.category-header-row > td {
background-color: #f3f4f6; /* Gray background for category names */
font-weight: 600;
font-weight: bold;
}
.table-body tr {
Expand All @@ -84,7 +84,7 @@
.category-summary-row > td,
.table-footer-row > td {
font-weight: 600;
font-weight: bold;
background-color: #ffffff; /* White background for footer */
}
</style>
Expand Down
51 changes: 48 additions & 3 deletions resources/views/components/company/reports/report-pdf.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
.company-name {
font-size: 1.125rem;
font-weight: 600;
font-weight: bold;
}
.date-range {
Expand All @@ -69,9 +69,16 @@
border-bottom: 1px solid #d1d5db; /* Gray border for all rows */
}
.category-header-row > td {
.category-header-row > td,
.type-header-row > td {
background-color: #f3f4f6; /* Gray background for category names */
font-weight: 600;
font-weight: bold;
}
.type-header-row > td,
.type-data-row > td,
.type-summary-row > td {
padding-left: 1.5rem; /* Indentation for type rows */
}
.table-body tr {
Expand All @@ -83,6 +90,7 @@
}
.category-summary-row > td,
.type-summary-row > td,
.table-footer-row > td {
font-weight: bold;
background-color: #ffffff; /* White background for footer */
Expand Down Expand Up @@ -131,6 +139,43 @@
@endforeach
</tr>
@endforeach

<!-- Category Types -->
@foreach($category->types ?? [] as $type)
<!-- Type Header -->
<tr class="type-header-row">
@foreach($type->header as $index => $header)
<td class="{{ $report->getAlignmentClass($index) }}">
{{ $header }}
</td>
@endforeach
</tr>

<!-- Type Data -->
@foreach($type->data as $typeRow)
<tr class="type-data-row">
@foreach($typeRow as $index => $cell)
<td class="{{ $report->getAlignmentClass($index) }} {{ $index === 'account_name' ? 'whitespace-normal' : 'whitespace-nowrap' }}">
@if(is_array($cell) && isset($cell['name']))
{{ $cell['name'] }}
@else
{{ $cell }}
@endif
</td>
@endforeach
</tr>
@endforeach

<!-- Type Summary -->
<tr class="type-summary-row">
@foreach($type->summary as $index => $cell)
<td class="{{ $report->getAlignmentClass($index) }}">
{{ $cell }}
</td>
@endforeach
</tr>
@endforeach

<tr class="category-summary-row">
@foreach($category->summary as $index => $cell)
<td class="{{ $report->getAlignmentClass($index) }}">
Expand Down

0 comments on commit 5ba8e26

Please sign in to comment.