Restore Export PDF button to the UI
This commit is contained in:
@@ -1,272 +1,152 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Daily Sale Payment Report</title>
|
||||
<style>
|
||||
@page {
|
||||
size: A4 landscape;
|
||||
margin: 30px;
|
||||
}
|
||||
body {
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
color: #333;
|
||||
font-size: 11px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.header-section {
|
||||
margin-bottom: 30px;
|
||||
border-bottom: 3px solid #00489f;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.header-section h1 {
|
||||
color: #00489f;
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
margin: 0;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.meta-box {
|
||||
background-color: #f0f4f8;
|
||||
border-left: 4px solid #078bce;
|
||||
padding: 10px;
|
||||
margin-bottom: 20px;
|
||||
display: inline-block;
|
||||
}
|
||||
.meta-box p {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
}
|
||||
.section-title {
|
||||
color: #00489f;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 10px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
th {
|
||||
background-color: #00489f;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
font-size: 11px;
|
||||
text-transform: uppercase;
|
||||
padding: 10px 8px;
|
||||
text-align: left;
|
||||
border: 1px solid #003679;
|
||||
}
|
||||
td {
|
||||
padding: 8px;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
border-left: 1px solid #dee2e6;
|
||||
border-right: 1px solid #dee2e6;
|
||||
color: #333;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: #f4f7f9;
|
||||
}
|
||||
tfoot td {
|
||||
background-color: #e0e5ea;
|
||||
font-weight: bold;
|
||||
color: #00489f;
|
||||
border-top: 2px solid #b5c3d0;
|
||||
border-bottom: 2px solid #b5c3d0;
|
||||
}
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; margin-bottom: 20px;">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="border: none; border-bottom: 3px solid #00489f; padding-bottom: 10px; font-size: 24px; color: #00489f; font-weight: bold; text-transform: uppercase;">
|
||||
Daily Sale Payment Report
|
||||
</td>
|
||||
<th colspan="7" style="font-size: 16px; font-weight: bold;">Daily Sale Payment Report - {{ $report_date }}</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; margin-bottom: 30px;">
|
||||
<tr>
|
||||
<td style="border: none; border-left: 4px solid #078bce; background-color: #f0f4f8; padding: 10px; font-size: 12px; font-weight: bold; color: #444;">
|
||||
REPORT DATE: {{ $report_date }}
|
||||
</td>
|
||||
<th colspan="7" style="font-size: 14px; font-weight: bold;">Sales Table (Daily Sale)</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; margin-bottom: 5px;">
|
||||
<tr>
|
||||
<td style="border: none; color: #00489f; font-weight: bold; font-size: 14px; text-transform: uppercase;">
|
||||
Daily Sales
|
||||
</td>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Date</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Reference Number</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Cashier</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Customer</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Grand Total</th>
|
||||
@foreach($paymentOptions as $option)
|
||||
<th style="font-weight: bold; background-color: #cccccc;">{{ $option->name }}</th>
|
||||
@endforeach
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Due Amount</th>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$tot_grand = 0;
|
||||
$tot_due = 0;
|
||||
$option_totals = [];
|
||||
foreach ($paymentOptions as $opt) {
|
||||
$option_totals[$opt->id] = 0;
|
||||
}
|
||||
@endphp
|
||||
@foreach($sales_data as $sale)
|
||||
<tr>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Date</th>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Reference Number</th>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Cashier</th>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Customer</th>
|
||||
<th class="text-right" style="background-color: #00489f; color: #ffffff; font-weight: bold;">Grand Total</th>
|
||||
<td>{{ $sale->date }}</td>
|
||||
<td>{{ $sale->reference_no }}</td>
|
||||
<td>{{ $sale->cashier }}</td>
|
||||
<td>{{ $sale->customer }}</td>
|
||||
<td>{{ number_format($sale->grand_total, 2) }}</td>
|
||||
@foreach($paymentOptions as $option)
|
||||
<th class="text-right" style="background-color: #00489f; color: #ffffff; font-weight: bold;">{{ $option->name }}</th>
|
||||
<td>{{ number_format($sale->methods[$option->id] ?? 0, 2) }}</td>
|
||||
@endforeach
|
||||
<th class="text-right" style="background-color: #00489f; color: #ffffff; font-weight: bold;">Due Amount</th>
|
||||
<td>{{ number_format($sale->due_amount, 2) }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$tot_grand = 0;
|
||||
$tot_due = 0;
|
||||
$option_totals = [];
|
||||
$tot_grand += $sale->grand_total;
|
||||
$tot_due += $sale->due_amount;
|
||||
foreach ($paymentOptions as $opt) {
|
||||
$option_totals[$opt->id] = 0;
|
||||
$option_totals[$opt->id] += ($sale->methods[$opt->id] ?? 0);
|
||||
}
|
||||
@endphp
|
||||
@foreach($sales_data as $sale)
|
||||
<tr>
|
||||
<td>{{ $sale->date }}</td>
|
||||
<td>{{ $sale->reference_no }}</td>
|
||||
<td>{{ $sale->cashier }}</td>
|
||||
<td>{{ $sale->customer }}</td>
|
||||
<td class="text-right">{{ number_format($sale->grand_total, 2) }}</td>
|
||||
@foreach($paymentOptions as $option)
|
||||
<td class="text-right">{{ number_format($sale->methods[$option->id] ?? 0, 2) }}</td>
|
||||
@endforeach
|
||||
<td class="text-right">{{ number_format($sale->due_amount, 2) }}</td>
|
||||
</tr>
|
||||
@php
|
||||
$tot_grand += $sale->grand_total;
|
||||
$tot_due += $sale->due_amount;
|
||||
foreach ($paymentOptions as $opt) {
|
||||
$option_totals[$opt->id] += ($sale->methods[$opt->id] ?? 0);
|
||||
}
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4" class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">DAILY TOTALS</td>
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">{{ number_format($tot_grand, 2) }}</td>
|
||||
@foreach($paymentOptions as $option)
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">{{ number_format($option_totals[$option->id], 2) }}</td>
|
||||
@endforeach
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">{{ number_format($tot_due, 2) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<!-- EMPTY ROW FOR SPACING FOR EXCEL -->
|
||||
<table><tr><td style="border: none; padding: 20px;"></td></tr></table>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; margin-bottom: 5px;">
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td style="border: none; color: #00489f; font-weight: bold; font-size: 14px; text-transform: uppercase;">
|
||||
Credit Sale Collections
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Original Bill Date</th>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Reference Number</th>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Cashier</th>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Customer</th>
|
||||
<th class="text-right" style="background-color: #00489f; color: #ffffff; font-weight: bold;">Grand Total</th>
|
||||
@foreach ($paymentOptions as $option)
|
||||
<th class="text-right" style="background-color: #00489f; color: #ffffff; font-weight: bold;">{{ $option->name }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($creditCollections as $row)
|
||||
<tr>
|
||||
<td>{{ \Carbon\Carbon::parse($row['date'])->format('Y-m-d') }}</td>
|
||||
<td>{{ $row['reference'] }}</td>
|
||||
<td>{{ $row['cashier'] }}</td>
|
||||
<td>{{ $row['customer'] }}</td>
|
||||
<td class="text-right">{{ number_format($row['grand_total'], 2) }}</td>
|
||||
@foreach ($paymentOptions as $option)
|
||||
<td class="text-right">{{ number_format($row['methods'][$option->id] ?? 0, 2) }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
<td colspan="4" style="font-weight: bold; text-align: right;">Total</td>
|
||||
<td style="font-weight: bold;">{{ number_format($tot_grand, 2) }}</td>
|
||||
@foreach($paymentOptions as $option)
|
||||
<td style="font-weight: bold;">{{ number_format($option_totals[$option->id], 2) }}</td>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<td style="font-weight: bold;">{{ number_format($tot_due, 2) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tr><td></td></tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="5" style="font-size: 14px; font-weight: bold;">Credit Sale Collections</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Original Bill Date</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Reference Number</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Cashier</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Customer</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Grand Total</th>
|
||||
@foreach ($paymentOptions as $option)
|
||||
<th style="font-weight: bold; background-color: #cccccc;">{{ $option->name }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($creditCollections as $row)
|
||||
<tr>
|
||||
<td colspan="4" class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">COLLECTION TOTALS</td>
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">{{ number_format($creditTotals['grand_total'], 2) }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($row['date'])->format('Y-m-d') }}</td>
|
||||
<td>{{ $row['reference'] }}</td>
|
||||
<td>{{ $row['cashier'] }}</td>
|
||||
<td>{{ $row['customer'] }}</td>
|
||||
<td>{{ number_format($row['grand_total'], 2) }}</td>
|
||||
@foreach ($paymentOptions as $option)
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">{{ number_format($creditTotals['methods'][$option->id] ?? 0, 2) }}</td>
|
||||
<td>{{ number_format($row['methods'][$option->id] ?? 0, 2) }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<!-- EMPTY ROW FOR SPACING FOR EXCEL -->
|
||||
<table><tr><td style="border: none; padding: 20px;"></td></tr></table>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; margin-bottom: 5px;">
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td style="border: none; color: #00489f; font-weight: bold; font-size: 14px; text-transform: uppercase;">
|
||||
Payment Method Summary
|
||||
</td>
|
||||
<td colspan="4" style="font-weight: bold; text-align: right;">Total</td>
|
||||
<td style="font-weight: bold;">{{ number_format($creditTotals['grand_total'], 2) }}</td>
|
||||
@foreach ($paymentOptions as $option)
|
||||
<td style="font-weight: bold;">{{ number_format($creditTotals['methods'][$option->id] ?? 0, 2) }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<thead>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tr><td></td></tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4" style="font-size: 14px; font-weight: bold;">Payment Method Summary</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Payment Option</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Sale Amount</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Received Amount</th>
|
||||
<th style="font-weight: bold; background-color: #cccccc;">Total Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$grand_sale = 0;
|
||||
$grand_received = 0;
|
||||
$grand_total = 0;
|
||||
@endphp
|
||||
@foreach ($summaryData as $summary)
|
||||
<tr>
|
||||
<th style="background-color: #00489f; color: #ffffff; font-weight: bold;">Payment Option</th>
|
||||
<th class="text-right" style="background-color: #00489f; color: #ffffff; font-weight: bold;">Sale Amount</th>
|
||||
<th class="text-right" style="background-color: #00489f; color: #ffffff; font-weight: bold;">Received Amount</th>
|
||||
<th class="text-right" style="background-color: #00489f; color: #ffffff; font-weight: bold;">Total Amount</th>
|
||||
<td>{{ $summary['name'] }}</td>
|
||||
<td>{{ number_format($summary['sale_amount'], 2) }}</td>
|
||||
<td>{{ number_format($summary['received_amount'], 2) }}</td>
|
||||
<td>{{ number_format($summary['total_amount'], 2) }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$grand_sale = 0;
|
||||
$grand_received = 0;
|
||||
$grand_total = 0;
|
||||
$grand_sale += $summary['sale_amount'];
|
||||
$grand_received += $summary['received_amount'];
|
||||
$grand_total += $summary['total_amount'];
|
||||
@endphp
|
||||
@foreach ($summaryData as $summary)
|
||||
<tr>
|
||||
<td><strong>{{ strtoupper($summary['name']) }}</strong></td>
|
||||
<td class="text-right">{{ number_format($summary['sale_amount'], 2) }}</td>
|
||||
<td class="text-right">{{ number_format($summary['received_amount'], 2) }}</td>
|
||||
<td class="text-right">{{ number_format($summary['total_amount'], 2) }}</td>
|
||||
</tr>
|
||||
@php
|
||||
$grand_sale += $summary['sale_amount'];
|
||||
$grand_received += $summary['received_amount'];
|
||||
$grand_total += $summary['total_amount'];
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">GRAND TOTAL</td>
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">{{ number_format($grand_sale, 2) }}</td>
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">{{ number_format($grand_received, 2) }}</td>
|
||||
<td class="text-right" style="background-color: #e0e5ea; font-weight: bold; color: #00489f;">{{ number_format($grand_total, 2) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td style="font-weight: bold; text-align: right;">Grand Total</td>
|
||||
<td style="font-weight: bold;">{{ number_format($grand_sale, 2) }}</td>
|
||||
<td style="font-weight: bold;">{{ number_format($grand_received, 2) }}</td>
|
||||
<td style="font-weight: bold;">{{ number_format($grand_total, 2) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<!-- අලුතෙන් දාපු Single Export Buttons ටික -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-12 text-right">
|
||||
<button class="btn btn-danger" onclick="exportFullReport('pdf')" style="border-radius: 10px;">
|
||||
<button class="btn btn-danger" style="border-radius: 10px;">
|
||||
<i class="fa fa-file-pdf-o"></i> Export PDF
|
||||
</button>
|
||||
<button class="btn btn-success" onclick="exportFullReport('excel')" style="border-radius: 10px;">
|
||||
@@ -63,8 +63,8 @@
|
||||
<i class="fa fa-file-text-o"></i> Export CSV
|
||||
</button>
|
||||
<!-- <button class="btn btn-secondary" onclick="window.print()" style="border-radius: 10px;">
|
||||
<i class="fa fa-print"></i> Print Report
|
||||
</button> -->
|
||||
<i class="fa fa-print"></i> Print Report
|
||||
</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user