migrate to gtea from bistbucket
This commit is contained in:
110
Modules/Business/resources/views/reports/vats/excel.blade.php
Normal file
110
Modules/Business/resources/views/reports/vats/excel.blade.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('Date') }}</th>
|
||||
<th>{{ __('Invoice') }}</th>
|
||||
<th>{{ __('Customer') }}</th>
|
||||
<th>{{ __('Total Amount') }}</th>
|
||||
<th>{{ __('Payment Method') }}</th>
|
||||
<th>{{ __('Discount') }}</th>
|
||||
@foreach ($vats as $vat)
|
||||
<th>{{ $vat->name }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Show sales data if sales tab is active -->
|
||||
@if (Request::get('type') == 'sales')
|
||||
@foreach ($sales as $sale)
|
||||
<tr>
|
||||
<td>{{ formatted_date($sale->created_at) }}</td>
|
||||
<td>{{ $sale->invoiceNumber }}</td>
|
||||
<td>{{ $sale->party->name ?? '' }}</td>
|
||||
<td>{{ currency_format($sale->totalAmount, currency: business_currency()) }}</td>
|
||||
<td>
|
||||
@if ($sale->transactions && $sale->transactions->isNotEmpty())
|
||||
{{ $sale->transactions->map(function($transaction) {
|
||||
if ($transaction->transaction_type === 'bank_payment' && !empty($transaction->paymentType?->name)) {
|
||||
return $transaction->paymentType->name;
|
||||
}
|
||||
return $transaction->transaction_type ? ucfirst(explode('_', $transaction->transaction_type)[0]) : '';
|
||||
})->unique()->implode(', ') }}
|
||||
@elseif ($sale->payment_type_id)
|
||||
{{ $sale->payment_type?->name }}
|
||||
@else
|
||||
{{ $sale->paymentType }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ currency_format($sale->discountAmount, currency: business_currency()) }}</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td>{{ $sale->vat_id == $vat->id ? currency_format($sale->vat_amount, currency: business_currency()) : '0' }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
@if ($sales->count() > 0)
|
||||
<tr class="table-footer">
|
||||
<td class="text-start fw-bold">{{ __('Total') }}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="text-center fw-bold">
|
||||
{{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="d-print-none"></td>
|
||||
<td class="text-center fw-bold">
|
||||
{{ currency_format($sales->sum('discountAmount'), currency: business_currency()) }}
|
||||
</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td class="text-center fw-bold">
|
||||
{{ currency_format($salesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<!-- Show purchase data if purchase tab is active -->
|
||||
@if (Request::get('type') == 'purchases')
|
||||
@foreach ($purchases as $purchase)
|
||||
<tr>
|
||||
<td>{{ formatted_date($purchase->created_at) }}</td>
|
||||
<td>{{ $purchase->invoiceNumber }}</td>
|
||||
<td>{{ $purchase->party->name ?? '' }}</td>
|
||||
<td>{{ currency_format($purchase->totalAmount, currency: business_currency()) }}</td>
|
||||
<td>
|
||||
@if ($purchase->transactions && $purchase->transactions->isNotEmpty())
|
||||
{{ $purchase->transactions->map(function($transaction) {
|
||||
if ($transaction->transaction_type === 'bank_payment' && !empty($transaction->paymentType?->name)) {
|
||||
return $transaction->paymentType->name;
|
||||
}
|
||||
return $transaction->transaction_type ? ucfirst(explode('_', $transaction->transaction_type)[0]) : '';
|
||||
})->unique()->implode(', ') }}
|
||||
@elseif ($purchase->payment_type_id)
|
||||
{{ $purchase->payment_type?->name }}
|
||||
@else
|
||||
{{ $purchase->paymentType }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ currency_format($purchase->discountAmount, currency: business_currency()) }}</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td>{{ $purchase->vat_id == $vat->id ? currency_format($purchase->vat_amount, currency: business_currency()) : '0' }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
@if ($purchases->count() > 0)
|
||||
<tr class="table-footer">
|
||||
<td class="text-start fw-bold">{{ __('Total') }}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="text-center fw-bold">{{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }}</td>
|
||||
<td class="d-print-none"></td>
|
||||
<td class="text-center fw-bold">{{ currency_format($purchases->sum('discountAmount'), currency: business_currency()) }}</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td class="text-center fw-bold">
|
||||
{{ currency_format($purchasesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endif
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
115
Modules/Business/resources/views/reports/vats/index.blade.php
Normal file
115
Modules/Business/resources/views/reports/vats/index.blade.php
Normal file
@@ -0,0 +1,115 @@
|
||||
@extends('layouts.business.master')
|
||||
|
||||
@section('title')
|
||||
{{ __('Tax Reports') }}
|
||||
@endsection
|
||||
|
||||
@section('main_content')
|
||||
<div class="">
|
||||
<div class="erp-table-section">
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-bodys">
|
||||
<div class="tab-table-container">
|
||||
<div class="table-header p-16 d-print-none">
|
||||
<h4>{{ __('Tax Report List') }}</h4>
|
||||
</div>
|
||||
<div class="table-header justify-content-center border-0 d-none d-block d-print-block text-center">
|
||||
@include('business::print.header')
|
||||
<h4 class="mt-2 mb-2">{{ __('Tax Report List') }}</h4>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-between table-top-form">
|
||||
<form action="{{ route('business.vat-reports.index') }}" method="GET" class="vat-report-filter-form">
|
||||
<div class="table-top-left d-flex gap-3 d-print-none flex-wrap p-3">
|
||||
<div class="custom-from-to align-items-center date-filters d-none">
|
||||
<label class="header-label">{{ __('From Date') }}</label>
|
||||
<input type="date" name="from_date" value="{{ request('from_date') ?? now()->format('Y-m-d') }}" class="form-control">
|
||||
</div>
|
||||
<div class="custom-from-to align-items-center date-filters d-none">
|
||||
<label class="header-label">{{ __('To Date') }}</label>
|
||||
<input type="date" name="to_date" value="{{ request('to_date') ?? now()->format('Y-m-d') }}" class="form-control">
|
||||
</div>
|
||||
<div class="gpt-up-down-arrow position-relative d-print-none custom-date-filter">
|
||||
<select name="custom_days" class="form-control custom-days">
|
||||
<option value="today" {{ request()->get('custom_days') == 'today' ? 'selected' : '' }}>{{ __('Today') }}</option>
|
||||
<option value="yesterday" {{ request()->get('custom_days') == 'yesterday' ? 'selected' : '' }}>{{ __('Yesterday') }}</option>
|
||||
<option value="last_seven_days" {{ request()->get('custom_days') == 'last_seven_days' ? 'selected' : '' }}>{{ __('Last 7 Days') }}</option>
|
||||
<option value="last_thirty_days" {{ request()->get('custom_days') == 'last_thirty_days' ? 'selected' : '' }}>{{ __('Last 30 Days') }}</option>
|
||||
<option value="current_month" {{ request()->get('custom_days') == 'current_month' ? 'selected' : '' }}>{{ __('Current Month') }}</option>
|
||||
<option value="last_month" {{ request()->get('custom_days') == 'last_month' ? 'selected' : '' }}>{{ __('Last Month') }}</option>
|
||||
<option value="current_year" {{ request()->get('custom_days') == 'current_year' ? 'selected' : '' }}>{{ __('Current Year') }}</option>
|
||||
<option value="custom_date" {{ request()->get('custom_days') == 'custom_date' ? 'selected' : '' }}>{{ __('Custom Date') }}</option>
|
||||
</select>
|
||||
|
||||
<span></span>
|
||||
<div class="calendar-icon">
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.6667 2.67188H3.33333C2.59695 2.67188 2 3.26883 2 4.00521V13.3385C2 14.0749 2.59695 14.6719 3.33333 14.6719H12.6667C13.403 14.6719 14 14.0749 14 13.3385V4.00521C14 3.26883 13.403 2.67188 12.6667 2.67188Z" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M10.6641 1.32812V3.99479" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M5.33594 1.32812V3.99479" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M2 6.67188H14" stroke="#4B5563" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="table-top-btn-group d-print-none p-3">
|
||||
<ul>
|
||||
<input type="hidden" id="csvBaseUrl" value="{{ route('business.vat.reports.csv') }}">
|
||||
<input type="hidden" id="excelBaseUrl" value="{{ route('business.vat.reports.excel') }}">
|
||||
<input type="hidden" id="pdfBaseUrl" value="{{ route('business.vat.reports.pdf') }}">
|
||||
|
||||
<li>
|
||||
<a id="csvExportLink" href="#">
|
||||
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="CSV">
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="excelExportLink" href="#">
|
||||
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="Excel">
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="blank" id="pdfExportLink" href="#">
|
||||
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="Pdf">
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a onclick="window.print()" class="print-window">
|
||||
<img src="{{ asset('assets/images/logo/printer.svg') }}" alt="">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="custom-tabs d-print-none">
|
||||
<button class="tab-item active" onclick="showTab('sales')">{{ __('Sales') }}</button>
|
||||
<button class="tab-item" onclick="showTab('purchase')">{{ __('Purchases') }}</button>
|
||||
</div>
|
||||
|
||||
<div id="sales" class="tab-content dashboard-tab active">
|
||||
<div id="sale-vat-reports-data">
|
||||
@include('business::reports.vats.sale-datas')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="purchase" class="tab-content dashboard-tab">
|
||||
<div id="purchase-vat-reports-data">
|
||||
@include('business::reports.vats.purchase-datas')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/custom/tab.js') }}?v={{ time() }}"></script>
|
||||
@endpush
|
||||
176
Modules/Business/resources/views/reports/vats/pdf.blade.php
Normal file
176
Modules/Business/resources/views/reports/vats/pdf.blade.php
Normal file
@@ -0,0 +1,176 @@
|
||||
@extends('layouts.business.pdf.pdf_layout')
|
||||
|
||||
@section('pdf_title')
|
||||
<div class="table-header justify-content-center border-0 d-none d-block d-print-block text-center">
|
||||
@include('business::print.header')
|
||||
<h4 style="text-align: center; margin: 0; padding: 0; font-size: 16px;" class="">
|
||||
@if (Request::get('type') == 'sales')
|
||||
{{ __('Sale Tax Report List') }}
|
||||
@elseif (Request::get('type') == 'purchases')
|
||||
{{ __('Purchase Tax Report List') }}
|
||||
@else
|
||||
{{ __('Tax Report List') }}
|
||||
@endif
|
||||
</h4>
|
||||
{{-- <p style="text-align: center; margin: 0; padding: 0; font-weight: 400; font-size: 14px;" class="">{{ __('Duration: 14-12-2025 to 24-12-2025') }}</p> --}}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('pdf_content')
|
||||
<table width="100%" cellpadding="6" cellspacing="0"
|
||||
style="border-collapse: collapse; border: 1px solid gainsboro; font-size:12px;"
|
||||
id="datatable">
|
||||
<thead>
|
||||
<tr style="background-color: #C52127; color: white;">
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Date') }}</th>
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Invoice No') }}</th>
|
||||
@if (Request::get('type') == 'sales')
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Customer') }}</th>
|
||||
@else
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Supplier') }}</th>
|
||||
@endif
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Payment Type') }}</th>
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Total Amount') }}</th>
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Discount') }}</th>
|
||||
@foreach ($vats as $vat)
|
||||
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ $vat->name }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (Request::get('type') == 'sales')
|
||||
@foreach ($sales as $sale)
|
||||
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ formatted_date($sale->saleDate) }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $sale->invoiceNumber }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $sale->party?->name }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;" class="d-print-none">
|
||||
@if ($sale->transactions && $sale->transactions->isNotEmpty())
|
||||
{{ $sale->transactions->map(function($transaction) {
|
||||
if ($transaction->transaction_type === 'bank_payment' && !empty($transaction->paymentType?->name)) {
|
||||
return $transaction->paymentType->name;
|
||||
}
|
||||
return $transaction->transaction_type
|
||||
? ucfirst(explode('_', $transaction->transaction_type)[0])
|
||||
: '';
|
||||
})->unique()->implode(', ') }}
|
||||
@elseif ($sale->payment_type_id)
|
||||
{{ $sale->payment_type?->name }}
|
||||
@else
|
||||
{{ $sale->paymentType }}
|
||||
@endif
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ currency_format($sale->totalAmount, currency: business_currency()) }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ currency_format($sale->discountAmount, currency: business_currency()) }}
|
||||
</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $sale->vat_id == $vat->id ? currency_format($sale->vat_amount, currency: business_currency()) : '0' }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@if ($sales->count() > 0)
|
||||
<tfoot>
|
||||
<tr style="background-color:#C52127; color:#FFFFFF; font-weight:bold;">
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white">
|
||||
{{ __('Total') }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
||||
{{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
||||
{{ currency_format($sales->sum('discountAmount'), currency: business_currency()) }}
|
||||
</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
||||
{{ currency_format($salesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
</tfoot>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if (Request::get('type') == 'purchases')
|
||||
@foreach ($purchases as $purchase)
|
||||
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ formatted_date($purchase->purchaseDate) }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $purchase->invoiceNumber }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $purchase->party?->name }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;" class="d-print-none">
|
||||
@if ($purchase->transactions && $purchase->transactions->isNotEmpty())
|
||||
{{ $purchase->transactions->map(function($transaction) {
|
||||
if ($transaction->transaction_type === 'bank_payment' && !empty($transaction->paymentType?->name)) {
|
||||
return $transaction->paymentType->name;
|
||||
}
|
||||
return $transaction->transaction_type
|
||||
? ucfirst(explode('_', $transaction->transaction_type)[0])
|
||||
: '';
|
||||
})->unique()->implode(', ') }}
|
||||
@elseif ($purchase->payment_type_id)
|
||||
{{ $purchase->payment_type?->name }}
|
||||
@else
|
||||
{{ $purchase->paymentType }}
|
||||
@endif
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ currency_format($purchase->totalAmount, currency: business_currency()) }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ currency_format($purchase->discountAmount, currency: business_currency()) }}
|
||||
</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td style="border:1px solid gainsboro; text-align:center;">
|
||||
{{ $purchase->vat_id == $vat->id ? currency_format($purchase->vat_amount, currency: business_currency()) : '0' }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@if ($purchases->count() > 0)
|
||||
<tfoot>
|
||||
<tr style="background-color:#C52127; color:#FFFFFF; font-weight:bold;">
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white">
|
||||
{{ __('Total') }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
||||
{{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }}
|
||||
</td>
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
||||
{{ currency_format($purchases->sum('discountAmount'), currency: business_currency()) }}
|
||||
</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
||||
{{ currency_format($purchasesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
</tfoot>
|
||||
@endif
|
||||
@endif
|
||||
</table>
|
||||
@endsection
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
@if ($filter_from_date && $filter_to_date)
|
||||
<div class="mb-2 text-center fw-bold duration-display">
|
||||
<strong>{{ __('Duration:') }}</strong>
|
||||
@if ($duration === 'today')
|
||||
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
||||
@elseif ($duration === 'yesterday')
|
||||
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
||||
@else
|
||||
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
||||
{{ __('to') }}
|
||||
{{ Carbon\Carbon::parse($filter_to_date)->format('d-m-Y') }}
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<div class="responsive-table tax-report-table m-0">
|
||||
<table class="table dashboard-table-content">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="text-start" scope="col">{{ __('Date') }}</th>
|
||||
<th class="text-center d-print-none" scope="col">{{ __('Invoice') }}</th>
|
||||
<th class="text-center" scope="col">{{ __('Supplier') }}</th>
|
||||
<th class="text-center" scope="col">{{ __('Total Amount') }}</th>
|
||||
<th class="text-center d-print-none" scope="col">{{ __('Payment Method') }}</th>
|
||||
<th class="text-center d-print-none" scope="col">{{ __('Discount') }}</th>
|
||||
@foreach ($vats as $vat)
|
||||
<th class="text-center">{{ $vat->name }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($purchases as $purchase)
|
||||
<tr>
|
||||
<td class="text-start">{{ formatted_date($purchase->created_at) }}</td>
|
||||
<td class="text-center d-print-none">{{ $purchase->invoiceNumber }}</td>
|
||||
<td class="text-center">{{ $purchase->party->name ?? '' }}</td>
|
||||
<td class="text-center">
|
||||
{{ currency_format($purchase->totalAmount, currency: business_currency()) }}</td>
|
||||
<td class="text-center d-print-none">
|
||||
@if ($purchase->transactions && $purchase->transactions->isNotEmpty())
|
||||
{{ $purchase->transactions->map(function($transaction) {
|
||||
if ($transaction->transaction_type === 'bank_payment' && !empty($transaction->paymentType?->name)) {
|
||||
return $transaction->paymentType->name;
|
||||
}
|
||||
return $transaction->transaction_type ? ucfirst(explode('_', $transaction->transaction_type)[0]) : '';
|
||||
})->unique()->implode(', ') }}
|
||||
@elseif ($purchase->payment_type_id)
|
||||
{{ $purchase->payment_type?->name }}
|
||||
@else
|
||||
{{ $purchase->paymentType }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center d-print-none">
|
||||
{{ currency_format($purchase->discountAmount, currency: business_currency()) }}</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td class="text-center">
|
||||
{{ $purchase->vat_id == $vat->id ? currency_format($purchase->vat_amount, currency: business_currency()) : '0' }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@if ($purchases->count() > 0)
|
||||
<tr class="table-footer">
|
||||
<td class="text-start fw-bold">{{ __('Total') }}</td>
|
||||
<td class="d-print-none"></td>
|
||||
<td></td>
|
||||
<td class="text-center fw-bold">{{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }}</th>
|
||||
<td class="d-print-none"></td>
|
||||
<td class="text-center fw-bold d-print-none">{{ currency_format($purchases->sum('discountAmount'), currency: business_currency()) }}</th>
|
||||
@foreach ($vats as $vat)
|
||||
<td class="text-center fw-bold">
|
||||
{{ currency_format($purchasesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
{{ $purchases->appends(['tab' => 'purchases'])->links('vendor.pagination.bootstrap-5') }}
|
||||
</div>
|
||||
@@ -0,0 +1,86 @@
|
||||
@if ($filter_from_date && $filter_to_date)
|
||||
<div class="mb-2 text-center fw-bold duration-display">
|
||||
<strong>{{ __('Duration:') }}</strong>
|
||||
@if ($duration === 'today')
|
||||
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
||||
@elseif ($duration === 'yesterday')
|
||||
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
||||
@else
|
||||
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
||||
{{ __('to') }}
|
||||
{{ Carbon\Carbon::parse($filter_to_date)->format('d-m-Y') }}
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<div class="responsive-table tax-report-table m-0">
|
||||
<table class="table dashboard-table-content">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="text-start" scope="col">{{ __('Date') }}</th>
|
||||
<th class="text-center d-print-none" scope="col">{{ __('Invoice') }}</th>
|
||||
<th class="text-center" scope="col">{{ __('Customer') }}</th>
|
||||
<th class="text-center" scope="col">{{ __('Total Amount') }}</th>
|
||||
<th class="text-center d-print-none" scope="col">{{ __('Payment Method') }}</th>
|
||||
<th class="text-center d-print-none" scope="col">{{ __('Discount') }}</th>
|
||||
@foreach ($vats as $vat)
|
||||
<th class="text-center">{{ $vat->name }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($sales as $sale)
|
||||
<tr>
|
||||
<td class="text-start">{{ formatted_date($sale->created_at) }}</td>
|
||||
<td class="text-center d-print-none">{{ $sale->invoiceNumber }}</td>
|
||||
<td class="text-center">{{ $sale->party->name ?? '' }}</td>
|
||||
<td class="text-center">
|
||||
{{ currency_format($sale->totalAmount, currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="text-center d-print-none">
|
||||
@if ($sale->transactions && $sale->transactions->isNotEmpty())
|
||||
{{ $sale->transactions->map(function($transaction) {
|
||||
if ($transaction->transaction_type === 'bank_payment' && !empty($transaction->paymentType?->name)) {
|
||||
return $transaction->paymentType->name;
|
||||
}
|
||||
return $transaction->transaction_type ? ucfirst(explode('_', $transaction->transaction_type)[0]) : '';
|
||||
})->unique()->implode(', ') }}
|
||||
@elseif ($sale->payment_type_id)
|
||||
{{ $sale->payment_type?->name }}
|
||||
@else
|
||||
{{ $sale->paymentType }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center d-print-none">
|
||||
{{ currency_format($sale->discountAmount, currency: business_currency()) }}</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td class="text-center">
|
||||
{{ $sale->vat_id == $vat->id ? currency_format($sale->vat_amount, currency: business_currency()) : '0' }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@if ($sales->count() > 0)
|
||||
<tr class="table-footer">
|
||||
<td class="text-start fw-bold">{{ __('Total') }}</td>
|
||||
<td class="d-print-none"></td>
|
||||
<td></td>
|
||||
<td class="text-center fw-bold">
|
||||
{{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="d-print-none"></td>
|
||||
<td class="text-center fw-bold d-print-none">
|
||||
{{ currency_format($sales->sum('discountAmount'), currency: business_currency()) }}
|
||||
</td>
|
||||
@foreach ($vats as $vat)
|
||||
<td class="text-center fw-bold">
|
||||
{{ currency_format($salesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
{{ $sales->appends(['tab' => 'sales'])->links('vendor.pagination.bootstrap-5') }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user