migrate to gtea from bistbucket

This commit is contained in:
2026-03-15 17:08:23 +07:00
commit 129ca2260c
3716 changed files with 566316 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<div class="responsive-table m-0">
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th class="d-print-none"> {{ __('Image') }} </th>
<th> {{ __('Name') }} </th>
<th> {{ __('Code') }} </th>
<th> {{ __('Product') }} </th>
<th> {{ __('Category') }} </th>
<th class="d-print-none"> {{ __('Unit') }} </th>
<th> {{ __('Cost Price') }}</th>
<th> {{ __('Sales price') }}</th>
<th> {{ __('Stock') }}</th>
</tr>
</thead>
<tbody>
@foreach ($combo_products as $product)
<tr>
<td>{{ $combo_products->firstItem() + $loop->index }}</td>
<td class="d-print-none"><img src="{{ asset($product->productPicture ?? 'assets/images/logo/upload2.jpg') }}" alt="Img" class="table-product-img"></td>
<td>
<a href="javascript:void(0);"class="combo-product-view text-primary"
data-combo='@json($product->combo_items)'>
{{ $product->productName }}
</a>
</td>
<td>{{ $product->productCode }}</td>
<td>{{ $product->total_combo_products }}</td>
<td>{{ $product->category->categoryName ?? '' }}</td>
<td class="d-print-none">{{ $product->unit->unitName ?? '' }}</td>
<td>{{ currency_format($product->total_cost, currency: business_currency()) }}</td>
<td>{{ currency_format($product->productSalePrice, currency: business_currency()) }}</td>
<td class="{{ $product->total_stock <= $product->alert_qty ? 'text-danger' : 'text-success' }}">
<span class="fw-bold">{{ $product->total_stock ?? '' }}</span>
</td>
</tr>
@endforeach
</tbody>
@if ($combo_products->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td class="d-print-none"></td>
<td></td>
<td></td>
<td>
{{ $combo_products->sum('total_combo_products') }}
</td>
<td></td>
<td class="d-print-none"></td>
<td>
{{ currency_format($combo_products->sum('total_cost'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($combo_products->sum('productSalePrice'), currency: business_currency()) }}
</td>
<td>
{{ $combo_products->sum('total_stock') }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $combo_products->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,53 @@
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th> {{ __('Name') }} </th>
<th> {{ __('Code') }} </th>
<th> {{ __('Product') }} </th>
<th> {{ __('Category') }} </th>
<th> {{ __('Unit') }} </th>
<th> {{ __('Cost Price') }}</th>
<th> {{ __('Sales price') }}</th>
<th> {{ __('Stock') }}</th>
</tr>
</thead>
<tbody>
@foreach ($combo_products as $product)
<tr>
<td>{{ $loop->index + 1 }}</td>
<td>{{ $product->productName }}</td>
<td>{{ $product->productCode }}</td>
<td>{{ $product->total_combo_products }}</td>
<td>{{ $product->category->categoryName ?? '' }}</td>
<td>{{ $product->unit->unitName ?? '' }}</td>
<td>{{ currency_format($product->total_cost, currency: business_currency()) }}</td>
<td>{{ currency_format($product->productSalePrice, currency: business_currency()) }}</td>
<td class="{{ $product->total_stock <= $product->alert_qty ? 'text-danger' : 'text-success' }}">
<span class="fw-bold">{{ $product->total_stock ?? '' }}</span>
</td>
</tr>
@endforeach
</tbody>
@if ($combo_products->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td>
{{ $combo_products->sum('total_combo_products') }}
</td>
<td></td>
<td class="d-print-none"></td>
<td>
{{ currency_format($combo_products->sum('total_cost'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($combo_products->sum('productSalePrice'), currency: business_currency()) }}
</td>
<td>
{{ $combo_products->sum('total_stock') }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,85 @@
@extends('layouts.business.master')
@section('title')
{{ __('Combo Product') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card ">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Combo Product') }}</h4>
</div>
<div class="table-header justify-content-center border-0 text-center d-none d-block d-print-block">
@include('business::print.header')
<h4 class="mt-2">{{ __('Combo Product') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.combo-product-reports.index') }}" method="GET" class="report-filter-form" table="#combo-product-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
</div>
</form>
</div>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.combo-product-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.combo-product-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.combo-product-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="combo-product-reports-data">
@include('business::reports.combo-products.datas')
</div>
</div>
</div>
</div>
@endsection
@push('modal')
@include('business::reports.combo-products.view')
@endpush

View File

@@ -0,0 +1,72 @@
@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="">{{ __('Combo Product Report List') }}</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">{{ __('Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Code') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Stock') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Cost Price') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product Price') }}</th>
</tr>
</thead>
<tbody>
@foreach ($combo_products as $product)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product->productName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product->productCode }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product->total_combo_products }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product->total_stock }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($product->total_cost, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($product->productSalePrice, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($combo_products->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; color: white; font-weight: 600;">
{{ $combo_products->sum('total_combo_products') }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ $combo_products->sum('total_stock') }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($combo_products->sum('total_cost'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($combo_products->sum('productSalePrice'), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,30 @@
<div class="modal fade p-0" id="combo-product-view" >
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5">{{ __('View Combo Product') }}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body order-form-section">
<div class="costing-list">
<div class="table-responsive mt-3">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{{ __('Items') }}</th>
<th>{{ __('Qty') }}</th>
<th>{{ __('Purchase Price') }}</th>
<th>{{ __('Stock') }}</th>
</tr>
</thead>
<tbody id="combo-product-table-data">
{{-- Filled via jQuery --}}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,45 @@
<div class="responsive-table m-0">
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Product Code') }} </th>
<th>{{ __('Purchase Price') }} </th>
<th>{{ __('Sale Price') }} </th>
<th>{{ __('Discount') }} </th>
</tr>
</thead>
<tbody>
@foreach ($discount_products as $discount_product)
<tr>
<td>{{ $discount_products->firstItem() + $loop->index }}</td>
<td>{{ $discount_product->product?->productName }}</td>
<td>{{ $discount_product->product?->productCode }}</td>
<td>{{ currency_format($discount_product->productPurchasePrice, currency: business_currency()) }}</td>
<td>{{ currency_format(($discount_product->price) - ($discount_product->discount), currency: business_currency()) }}</td>
<td>{{ currency_format(abs($discount_product->discount), currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($discount_products->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td>
{{ currency_format($discount_products->sum('productPurchasePrice'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($discount_products->sum(fn($item) => ($item->price - $item->discount)), currency: business_currency()) }}
</td>
<td>
{{ currency_format($discount_products->sum(fn($item) => abs($item->discount)), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $discount_products->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,40 @@
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Product Code') }} </th>
<th>{{ __('Purchase Price') }} </th>
<th>{{ __('Sale Price') }} </th>
<th>{{ __('Discount') }} </th>
</tr>
</thead>
<tbody>
@foreach ($discount_products as $discount_product)
<tr>
<td>{{ $loop->index + 1 }}</td>
<td>{{ $discount_product->product?->productName }}</td>
<td>{{ $discount_product->product?->productCode }}</td>
<td>{{ currency_format($discount_product->productPurchasePrice, currency: business_currency()) }}</td>
<td>{{ currency_format(($discount_product->price) - ($discount_product->discount), currency: business_currency()) }}</td>
<td>{{ currency_format(abs($discount_product->discount), currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($discount_products->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td>
{{ currency_format($discount_products->sum('productPurchasePrice'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($discount_products->sum(fn($item) => ($item->price - $item->discount)), currency: business_currency()) }}
</td>
<td>
{{ currency_format($discount_products->sum(fn($item) => abs($item->discount)), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,82 @@
@extends('layouts.business.master')
@section('title')
{{ __('Product Wise Discount') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card ">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Product Wise Discount') }}</h4>
</div>
<div class="table-header justify-content-center border-0 text-center d-none d-block d-print-block">
@include('business::print.header')
<h4 class="mt-2">{{ __('Product Wise Discount') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.discount-product-reports.index') }}" method="GET" class="report-filter-form" table="#discount-product-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
</div>
</form>
</div>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.discount-product-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.discount-product-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.discount-product-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="discount-product-reports-data">
@include('business::reports.discount-products.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,65 @@
@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="">{{ __('Discount Product Report List') }}</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">{{ __('Product Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product Code') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Purchase Price') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Sale Price') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Discount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($discount_products as $discount_product)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ $discount_product->product?->productName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $discount_product->product?->productCode }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($discount_product->productPurchasePrice, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format(($discount_product->price) - ($discount_product->discount), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format(abs($discount_product->discount), currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($discount_products->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; color: white; font-weight: 600;">
{{ currency_format($discount_products->sum('productPurchasePrice'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($discount_products->sum(fn($item) => ($item->price - $item->discount)), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($discount_products->sum(fn($item) => abs($item->discount)), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,47 @@
<div class="responsive-table m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Name') }}</th>
<th class="text-start">{{ __('Phone') }}</th>
<th class="text-start">{{ __('Type') }}</th>
<th class="text-start">{{ __('Credit Limit') }}</th>
<th class="text-end">{{ __('Due Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($parties as $party)
<tr>
<td>{{ ($parties->currentPage() - 1) * $parties->perPage() + $loop->iteration }}</td>
<td class="text-start">{{ $party->name }}</td>
<td class="text-start">{{ $party->phone }}</td>
@if ($party->type == 'Retailer')
<td class="text-start">{{ __('Customer') }}</td>
@else
<td class="text-start">{{ $party->type }}</td>
@endif
<td class="text-start">{{ currency_format($party->credit_limit, currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($party->due, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($parties->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td class="text-start">{{ currency_format($parties->sum('credit_limit'), currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($parties->sum('due'), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $parties->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,103 @@
@extends('layouts.business.master')
@section('title')
{{ __('Customer Due Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __("Total Due") }}</p>
<p class="stat-value">{{ currency_format($total_due, currency: business_currency()) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Customer Due 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">{{ __('Customer Due List') }}</h4>
</div>
<div class="table-top-form p-16">
<form action="{{ route('business.due-reports.index') }}" method="GET" class="filter-form" table="#due-reports-data">
<div class="table-top-left d-flex gap-3 ">
<div class="gpt-up-down-arrow position-relative d-print-none">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative d-print-none">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<div class="gpt-up-down-arrow position-relative d-print-none">
<select name="type" class="form-control">
<option value="">{{ __('All Party') }}</option>
<option value="Retailer">{{ __('Customer') }}</option>
<option value="Wholesaler">{{ __('Wholesaler') }}</option>
<option value="Dealer">{{ __('Dealer') }}</option>
</select>
<span></span>
</div>
</div>
</form>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.due-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.due-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.due-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="due-reports-data">
@include('business::reports.due.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,42 @@
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Name') }}</th>
<th class="text-start">{{ __('Phone') }}</th>
<th class="text-start">{{ __('Type') }}</th>
<th class="text-start">{{ __('Credit Limit') }}</th>
<th class="text-end">{{ __('Due Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($parties as $party)
<tr>
<td>{{ $loop->iteration }}</td>
<td class="text-start">{{ $party->name }}</td>
<td class="text-start">{{ $party->phone }}</td>
@if ($party->type == 'Retailer')
<td class="text-start">{{ __('Customer') }}</td>
@else
<td class="text-start">{{ $party->type }}</td>
@endif
<td class="text-start">{{ currency_format($party->credit_limit, currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($party->due, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($parties->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td class="text-start">{{ currency_format($parties->sum('credit_limit'), currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($parties->sum('due'), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,67 @@
@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="">{{ __('Customer Due Report List') }}</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">{{ __('Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Phone') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Type ') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Credit Limit') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Due Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($parties as $party)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ $party->name }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $party->phone }}
</td>
@if ($party->type == 'Retailer')
<td style="border:1px solid gainsboro; text-align:center;">{{ __('Customer') }}</td>
@else
<td style="border:1px solid gainsboro; text-align:center;">
{{ $party->phone }}
</td>
@endif
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($party->credit_limit, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($party->due, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($parties->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; color: white; font-weight: 600;">
{{ currency_format($parties->sum('credit_limit'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($parties->sum('due'), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,84 @@
@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 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th class="d-print-none">{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Category') }}</th>
<th class="text-start">{{ __('Expense For') }}</th>
<th class="text-start d-print-none">{{ __('Payment Type') }}</th>
<th class="text-start">{{ __('Reference Number') }}</th>
<th class="text-start">{{ __('Expense Date') }}</th>
<th class="text-end">{{ __('Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($expense_reports as $expense_report)
<tr>
<td class="d-print-none">{{ ($expense_reports->currentPage() - 1) * $expense_reports->perPage() + $loop->iteration }}
</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $expense_report->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $expense_report->category->categoryName }}</td>
<td class="text-start">{{ $expense_report->expanseFor }}</td>
<td class="text-start d-print-none">
@if ($expense_report->transactions && $expense_report->transactions->isNotEmpty())
{{ $expense_report->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 ($expense_report->payment_type_id)
{{ $expense_report->payment_type?->name }}
@else
{{ $expense_report->paymentType }}
@endif
</td>
<td class="text-start">{{ $expense_report->referenceNo }}</td>
<td class="text-start">{{ formatted_date($expense_report->expenseDate) }}</td>
<td class="text-end">
{{ currency_format($expense_report->amount, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($expense_reports->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td class="d-print-none"></td>
<td class="d-print-none"></td>
<td></td>
<td></td>
<td></td>
<td class="text-end">
{{ currency_format($expense_reports->sum('amount'), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3 d-print-none">
{{ $expense_reports->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,65 @@
<table class="table" id="datatable">
<thead>
<tr>
<th class="d-print-none">{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Category') }}</th>
<th class="text-start">{{ __('Expense For') }}</th>
<th class="text-start d-print-none">{{ __('Payment Type') }}</th>
<th class="text-start">{{ __('Reference Number') }}</th>
<th class="text-start">{{ __('Expense Date') }}</th>
<th class="text-end">{{ __('Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($expense_reports as $expense_report)
<tr>
<td class="d-print-none">{{ $loop->iteration }}
</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $expense_report->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $expense_report->category->categoryName }}</td>
<td class="text-start">{{ $expense_report->expanseFor }}</td>
<td class="text-start">
@if ($expense_report->transactions && $expense_report->transactions->isNotEmpty())
{{ $expense_report->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 ($expense_report->payment_type_id)
{{ $expense_report->payment_type?->name }}
@else
{{ $expense_report->paymentType }}
@endif
</td>
<td class="text-start">{{ $expense_report->referenceNo }}</td>
<td class="text-start">{{ formatted_date($expense_report->expenseDate) }}</td>
<td class="text-end">
{{ currency_format($expense_report->amount, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($expense_reports->count() > 0)
<tr class="table-footer">
<td class="d-print-none text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="text-end">
{{ currency_format($expense_reports->sum('amount'), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,148 @@
@extends('layouts.business.master')
@section('title')
{{ __('Expense Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __('Total Amount') }}</p>
<p class="stat-value" id="total_expense">{{ currency_format($total_expense, currency: business_currency()) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Expense Report List') }}</h4>
</div>
<div class="table-header justify-content-center border-0 text-center d-none d-block d-print-block">
@include('business::print.header')
<h4 class="mt-2">{{ __('Expense Report List') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.expense-reports.index') }}" method="GET" class="report-filter-form" table="#expense-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none flex-wrap">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
@if(auth()->user()->accessToMultiBranch())
<div class="table-search position-relative">
<div class="gpt-up-down-arrow position-relative">
<select name="branch_id" class="form-control">
<option value="">{{ __('Select Branch') }}</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(request('branch_id') == $branch->id) >{{ $branch->name }}</option>
@endforeach
</select>
<span></span>
</div>
</div>
@endif
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.expense-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.expense-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.expense-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="expense-reports-data">
@include('business::reports.expense.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,90 @@
@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="">{{ __('Expense Report List') }}</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;">
@if (auth()->user()->accessToMultiBranch())
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Branch') }}</th>
@endif
<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">{{ __('Category') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Expense For') }}</th>
<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">{{ __('Reference') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($expense_reports as $expense_report)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center;">
{{ $expense_report->branch->name ?? '' }}
</td>
@endif
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($expense_report->expenseDate) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $expense_report->category?->categoryName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $expense_report->expanseFor }}
</td>
<td style="border:1px solid gainsboro; text-align:center;" class="d-print-none">
@if ($expense_report->transactions && $expense_report->transactions->isNotEmpty())
{{ $expense_report->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 ($expense_report->payment_type_id)
{{ $expense_report->payment_type?->name }}
@else
{{ $expense_report->paymentType }}
@endif
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $expense_report->referenceNo }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($expense_report->amount, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($expense_reports->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>
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center; font-weight: 600;"></td>
@endif
<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;"></td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($expense_report->amount, currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,133 @@
@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 m-0">
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th class="d-print-none">{{ __('Image') }} </th>
<th>{{ __('Product Name') }} </th>
<th class="d-print-none">{{ __('Code') }} </th>
<th class="d-print-none">{{ __('Brand') }} </th>
<th>{{ __('Category') }} </th>
<th class="d-print-none">{{ __('Unit') }} </th>
@usercan('expired-product-reports.price')
<th>{{ __('Purchase price') }}</th>
@endusercan
<th>{{ __('Sale price') }}</th>
<th>{{ __('Stock') }}</th>
<th>{{ __('Expired Date') }}</th>
<th class="d-print-none">{{ __('Action') }} </th>
</tr>
</thead>
<tbody>
@foreach ($expired_products as $product)
@php
$nonEmptyStock = $product->stocks->firstWhere('productStock', '>', 0);
$fallbackStock = $product->stocks->first(); // fallback if no stock > 0
$stock = $nonEmptyStock ?? $fallbackStock;
$latestPurchasePrice = $stock?->productPurchasePrice ?? 0;
$latestSalePrice = $stock?->productSalePrice ?? 0;
$latestWholeSalePrice = $stock?->productWholeSalePrice ?? 0;
$latestDealerPrice = $stock?->productDealerPrice ?? 0;
$productStock = $product->total_stock ?? 0;
@endphp
<tr>
<td>{{ ($expired_products->currentPage() - 1) * $expired_products->perPage() + $loop->iteration }}
</td>
<td class="d-print-none">
<img src="{{ asset($product->productPicture ?? 'assets/images/logo/upload2.jpg') }}"
alt="Img" class="table-product-img">
</td>
<td>{{ $product->productName }}</td>
<td class="d-print-none">{{ $product->productCode }}</td>
<td class="d-print-none">{{ $product->brand->brandName ?? '' }}</td>
<td>{{ $product->category->categoryName ?? '' }}</td>
<td class="d-print-none">{{ $product->unit->unitName ?? '' }}</td>
@usercan('expired-product-reports.price')
<td>{{ currency_format($latestPurchasePrice, currency: business_currency()) }}</td>
@endusercan
<td>{{ currency_format($latestSalePrice, currency: business_currency()) }}</td>
<td
class="{{ $product->stocks_sum_product_stock <= $product->alert_qty ? 'text-danger' : 'text-success' }}">
{{ $product->stocks_sum_product_stock }}</td>
<td class="text-danger">
@if ($product->stocks->isNotEmpty() && $product->stocks->first()->expire_date)
{{ formatted_date($product->stocks->first()->expire_date) }}
@else
N/A
@endif
</td>
<td class="d-print-none">
<div class="dropdown table-action">
<button type="button" data-bs-toggle="dropdown">
<i class="far fa-ellipsis-v"></i>
</button>
<ul class="dropdown-menu">
<li>
<a href="#expire-product-report-view" class="product-view" data-bs-toggle="modal"
data-name="{{ $product->productName }}"
data-image="{{ asset($product->productPicture ?? 'assets/images/logo/upload2.jpg') }}"
data-code="{{ $product->productCode }}"
data-brand="{{ $product->brand->brandName ?? '' }}"
data-category="{{ $product->category->categoryName ?? '' }}"
data-unit="{{ $product->unit->unitName ?? '' }}" @usercan('expired-product-reports.price')
data-purchase-price="{{ currency_format($latestPurchasePrice, currency: business_currency()) }}"
@endusercan
data-sale-price="{{ currency_format($latestSalePrice, currency: business_currency()) }}"
data-wholesale-price="{{ currency_format($latestWholeSalePrice, currency: business_currency()) }}"
data-dealer-price="{{ currency_format($latestDealerPrice, currency: business_currency()) }}"
data-stock="{{ $product->stocks_sum_product_stock }}"
data-product-expire-date="{{ formatted_date($product->stocks->first()?->expire_date) }}"
data-manufacturer="{{ $product->productManufacturer }}">
<i class="fal fa-eye"></i>
{{ __('View') }}
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
@if ($expired_products->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td class="d-print-none"></td>
<td></td>
<td class="d-print-none"></td>
<td class="d-print-none"></td>
<td></td>
<td class="d-print-none"></td>
@usercan('expired-product-reports.price')
<td>{{ currency_format($expired_products->sum(fn($product) => $product->stocks->first()?->productPurchasePrice ?? 0), currency: business_currency()) }}</td>
@endusercan
<td>{{ currency_format($expired_products->sum(fn($product) => $product->stocks->first()?->productSalePrice ?? 0), currency: business_currency()) }}</td>
<td>{{ $expired_products->sum('stocks_sum_product_stock') }}</td>
<td></td>
<td class="d-print-none"></td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $expired_products->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,75 @@
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Product Name') }} </th>
<th class="d-print-none">{{ __('Code') }} </th>
<th class="d-print-none">{{ __('Brand') }} </th>
<th>{{ __('Category') }} </th>
<th class="d-print-none">{{ __('Unit') }} </th>
@usercan('expired-product-reports.price')
<th>{{ __('Purchase price') }}</th>
@endusercan
<th>{{ __('Sale price') }}</th>
<th>{{ __('Stock') }}</th>
<th>{{ __('Expired Date') }}</th>
</tr>
</thead>
<tbody>
@foreach ($expired_products as $product)
@php
$nonEmptyStock = $product->stocks->firstWhere('productStock', '>', 0);
$fallbackStock = $product->stocks->first(); // fallback if no stock > 0
$stock = $nonEmptyStock ?? $fallbackStock;
$latestPurchasePrice = $stock?->productPurchasePrice ?? 0;
$latestSalePrice = $stock?->productSalePrice ?? 0;
$latestWholeSalePrice = $stock?->productWholeSalePrice ?? 0;
$latestDealerPrice = $stock?->productDealerPrice ?? 0;
$productStock = $product->total_stock ?? 0;
@endphp
<tr>
<td>{{ $loop->iteration }}
</td>
<td>{{ $product->productName }}</td>
<td class="d-print-none">{{ $product->productCode }}</td>
<td class="d-print-none">{{ $product->brand->brandName ?? '' }}</td>
<td>{{ $product->category->categoryName ?? '' }}</td>
<td class="d-print-none">{{ $product->unit->unitName ?? '' }}</td>
@usercan('expired-product-reports.price')
<td>{{ currency_format($latestPurchasePrice, currency: business_currency()) }}</td>
@endusercan
<td>{{ currency_format($latestSalePrice, currency: business_currency()) }}</td>
<td
class="{{ $product->stocks_sum_product_stock <= $product->alert_qty ? 'text-danger' : 'text-success' }}">
{{ $product->stocks_sum_product_stock }}</td>
<td class="text-danger">
@if ($product->stocks->isNotEmpty() && $product->stocks->first()->expire_date)
{{ formatted_date($product->stocks->first()->expire_date) }}
@else
{{__('N/A')}}
@endif
</td>
</tr>
@endforeach
</tbody>
@if ($expired_products->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td class="d-print-none"></td>
<td></td>
<td class="d-print-none"></td>
<td></td>
<td class="d-print-none"></td>
@usercan('expired-product-reports.price')
<td>{{ currency_format($expired_products->sum(fn($product) => $product->stocks->first()?->productPurchasePrice ?? 0), currency: business_currency()) }}</td>
@endusercan
<td>{{ currency_format($expired_products->sum(fn($product) => $product->stocks->first()?->productSalePrice ?? 0), currency: business_currency()) }}</td>
<td>{{ $expired_products->sum('stocks_sum_product_stock') }}</td>
<td></td>
<td class="d-print-none"></td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,117 @@
@extends('layouts.business.master')
@section('title')
{{ __('Expired Products') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card ">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Expired Products') }}</h4>
</div>
<div class="table-header justify-content-center border-0 text-center d-none d-block d-print-block">
@include('business::print.header')
<h4 class="mt-2">{{ __('Expired Products') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.expired-product-reports.index') }}" method="GET" class="report-filter-form" table="#expired-product-report-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.expired.product.reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.expired.product.reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.expired.product.reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="expired-product-report-data">
@include('business::reports.expired-products.datas')
</div>
</div>
</div>
</div>
@endsection
@push('modal')
@include('business::reports.expired-products.view')
@endpush

View File

@@ -0,0 +1,94 @@
@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="">{{ __('Expired Product Report List') }}</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">{{ __('Product Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product Code') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Category') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Expired Date') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Stock') }}</th>
@usercan('expired-product-reports.price')
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Purchase Price') }}</th>
@endusercan
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Sale Price') }}</th>
</tr>
</thead>
<tbody>
@foreach ($expired_products as $product)
@php
$nonEmptyStock = $product->stocks->firstWhere('productStock', '>', 0);
$fallbackStock = $product->stocks->first(); // fallback if no stock > 0
$stock = $nonEmptyStock ?? $fallbackStock;
$latestPurchasePrice = $stock?->productPurchasePrice ?? 0;
$latestSalePrice = $stock?->productSalePrice ?? 0;
$latestWholeSalePrice = $stock?->productWholeSalePrice ?? 0;
$latestDealerPrice = $stock?->productDealerPrice ?? 0;
$productStock = $product->total_stock ?? 0;
@endphp
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product->productName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product->productCode }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product->category->categoryName ?? '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
@if ($product->stocks->isNotEmpty() && $product->stocks->first()->expire_date)
{{ formatted_date($product->stocks->first()->expire_date) }}
@else
{{__('N/A')}}
@endif
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product->stocks_sum_product_stock }}
</td>
@usercan('expired-product-reports.price')
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($latestPurchasePrice, currency: business_currency()) }}
</td>
@endusercan
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($latestSalePrice, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($expired_products->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;"></td>
@usercan('expired-product-reports.price')
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($expired_products->sum(fn($product) => $product->stocks->first()?->productPurchasePrice ?? 0), currency: business_currency()) }}
</td>
@endusercan
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($expired_products->sum(fn($product) => $product->stocks->first()?->productSalePrice ?? 0), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,36 @@
<div class="modal fade p-0" id="expire-product-report-view">
<div class="modal-dialog modal-dialog-centered modal-md">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5">{{ __('View') }}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body order-form-section">
<div class="costing-list">
<ul>
<li><span>{{ __('Product Image') }}</span> <span>:</span> <span> <img class="table-img"
src="" alt="" id="product_image"></span></li>
<li><span>{{ __('Product Name') }}</span> <span>:</span> <span id="product_name"></span></li>
<li><span>{{ __('Code') }}</span> <span>:</span> <span id="product_code"></span></li>
<li><span>{{ __('Brand') }}</span> <span>:</span> <span id="product_brand"></span></li>
<li><span>{{ __('Category') }}</span> <span>:</span> <span id="product_category"></span></li>
<li><span>{{ __('Unit') }}</span> <span>:</span> <span id="product_unit"></span></li>
@usercan('expired-product-reports.price')
<li><span>{{ __('Purchase price') }}</span> <span>:</span> <span id="product_purchase_price"></span></li>
@endusercan
<li><span>{{ __('Sale price') }}</span> <span>:</span> <span id="product_sale_price"></span>
</li>
<li><span>{{ __('Wholesale Price') }}</span> <span>:</span> <span
id="product_wholesale_price"></span></li>
<li><span>{{ __('Dealer Price') }}</span> <span>:</span> <span
id="product_dealer_price"></span></li>
<li><span>{{ __('Stock') }}</span> <span>:</span> <span id="product_stock"></span></li>
<li><span>{{ __('Expire Date') }}</span> <span>:</span> <span id="product_expire_date" class="text-danger"></span></li>
<li><span>{{ __('Manufacturer') }}</span> <span>:</span> <span
id="product_manufacturer"></span></li>
</ul>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,84 @@
@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 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th class="d-print-none">{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Category') }}</th>
<th class="text-start">{{ __('Income For') }}</th>
<th class="text-start d-print-none">{{ __('Payment Type') }}</th>
<th class="text-start">{{ __('Reference Number') }}</th>
<th class="text-start">{{ __('Income Date') }}</th>
<th class="text-end">{{ __('Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($income_reports as $income_report)
<tr>
<td class="d-print-none">{{ ($income_reports->currentPage() - 1) * $income_reports->perPage() + $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $income_report->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $income_report->category->categoryName }}</td>
<td class="text-start">{{ $income_report->incomeFor }}</td>
<td class="text-start d-print-none">
@if ($income_report->transactions && $income_report->transactions->isNotEmpty())
{{ $income_report->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 ($income_report->payment_type_id)
{{ $income_report->payment_type?->name }}
@else
{{ $income_report->paymentType }}
@endif
</td>
<td class="text-start">{{ $income_report->referenceNo }}</td>
<td class="text-start">{{ formatted_date($income_report->incomeDate) }}</td>
<td class="text-end">{{ currency_format($income_report->amount, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($income_reports->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td class="d-print-none"></td>
<td class="d-print-none"></td>
<td></td>
<td></td>
<td></td>
<td class="text-end">
{{ currency_format($income_reports->sum('amount'), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3 d-print-none">
{{ $income_reports->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,64 @@
<table class="table" id="datatable">
<thead>
<tr>
<th class="d-print-none">{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Category') }}</th>
<th class="text-start">{{ __('Income For') }}</th>
<th class="text-start">{{ __('Payment Type') }}</th>
<th class="text-start">{{ __('Reference Number') }}</th>
<th class="text-start">{{ __('Income Date') }}</th>
<th class="text-end">{{ __('Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($income_reports as $income_report)
<tr>
<td class="d-print-none">{{ $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $income_report->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $income_report->category?->categoryName }}</td>
<td class="text-start">{{ $income_report->incomeFor }}</td>
<td class="text-start">
@if ($income_report->transactions && $income_report->transactions->isNotEmpty())
{{ $income_report->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 ($income_report->payment_type_id)
{{ $income_report->payment_type?->name }}
@else
{{ $income_report->paymentType }}
@endif
</td>
<td class="text-start">{{ $income_report->referenceNo }}</td>
<td class="text-start">{{ formatted_date($income_report->incomeDate) }}</td>
<td class="text-end">{{ currency_format($income_report->amount, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($income_reports->count() > 0)
<tr class="table-footer">
<td class="d-print-none text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="text-end">
{{ currency_format($income_reports->sum('amount'), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,141 @@
@extends('layouts.business.master')
@section('title')
{{ __('Income Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __('Total Amount') }}</p>
<p class="stat-value" id="total_income">{{ currency_format($total_income, currency: business_currency()) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Income 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">{{ __('Income Report List') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.income-reports.index') }}" method="GET" class="report-filter-form" table="#income-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none flex-wrap">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
@if(auth()->user()->accessToMultiBranch())
<div class="gpt-up-down-arrow position-relative">
<select name="branch_id" class="form-control">
<option value="">{{ __('Select Branch') }}</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(request('branch_id') == $branch->id) >{{ $branch->name }}</option>
@endforeach
</select>
<span></span>
</div>
@endif
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.income-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.income-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.income-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="income-reports-data">
@include('business::reports.income.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,90 @@
@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="">{{ __('Income Report List') }}</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;">
@if (auth()->user()->accessToMultiBranch())
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Branch') }}</th>
@endif
<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">{{ __('Category') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Income For') }}</th>
<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">{{ __('Reference') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($income_reports as $income_report)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center;">
{{ $income_report->branch->name ?? '' }}
</td>
@endif
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($income_report->incomeDate) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $income_report->category?->categoryName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $income_report->incomeFor }}
</td>
<td style="border:1px solid gainsboro; text-align:center;" class="d-print-none">
@if ($income_report->transactions && $income_report->transactions->isNotEmpty())
{{ $income_report->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 ($income_report->payment_type_id)
{{ $income_report->payment_type?->name }}
@else
{{ $income_report->paymentType }}
@endif
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $income_report->referenceNo }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($income_report->amount, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($income_reports->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>
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center; font-weight: 600;"></td>
@endif
<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;"></td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($income_report->amount, currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,147 @@
@extends('layouts.business.master')
@section('title')
{{ __('Loss Profit Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Loss/Profit Report Details') }}</h4>
</div>
<div class="table-top-form table-top-left p-16 mt-2">
<div class="d-flex align-items-center gap-3 flex-wrap">
<div class="m-0 p-0 d-print-none">
<form action="{{ route('business.loss-profit.details.reports.filter') }}" method="GET" class="report-filter-form">
@csrf
<div class="date-filters-container">
<div class="input-wrapper align-items-center date-filters d-none">
<label class="header-label">{{ __('From Date') }}</label>
<input type="date" name="from_date" value="{{ now()->format('Y-m-d') }}" class="form-control">
</div>
<div class="input-wrapper align-items-center date-filters d-none">
<label class="header-label">{{ __('To Date') }}</label>
<input type="date" name="to_date" value="{{ 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">{{__('Today')}}</option>
<option value="yesterday">{{__('Yesterday')}}</option>
<option value="last_seven_days">{{__('Last 7 Days')}}</option>
<option value="last_thirty_days">{{__('Last 30 Days')}}</option>
<option value="current_month">{{__('Current Month')}}</option>
<option value="last_month">{{__('Last Month')}}</option>
<option value="current_year">{{__('Current Year')}}</option>
<option value="custom_date">{{__('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>
</div>
</div>
</div>
<div class="m-3">
<div class="row g-4">
{{-- Left Column--}}
<div class="col-md-6 table-responsive">
<table class="table table-striped bg-white border rounded">
<tbody>
<tr>
<td class="text-start">{{__('Opening Stock')}}</td>
<td id="opening_stock_by_purchase">{{ $opening_stock_by_purchase }}</td>
</tr>
<tr>
<td class="text-start" colspan="2">{{__('(By purchase price)')}}</td>
</tr>
<tr>
<td class="text-start">{{__('Opening Stock')}}</td>
<td id="opening_stock_by_sale">{{ $opening_stock_by_sale }}</td>
</tr>
<tr>
<td class="text-start" colspan="2">{{__('(By sale price)')}}</td>
</tr>
<tr>
<td class="text-start">{{__('Total purchase:')}}</td>
<td id="total_purchase_price">{{ currency_format($total_purchase_price, currency: business_currency()) }}</td>
</tr>
<tr>
<td class="text-start">{{__('Total purchase shipping charge:')}}</td>
<td id="total_purchase_shipping_charge">{{ currency_format($total_purchase_shipping_charge, currency: business_currency()) }}</td>
</tr>
<tr>
<td class="text-start">{{__('Total Sell discount:')}}</td>
<td id="total_sale_discount">{{ currency_format($total_sale_discount, currency: business_currency()) }}</td>
</tr>
<tr>
<td class="text-start">{{__('Total Sell Return:')}}</td>
<td id="all_sale_return">{{ currency_format($all_sale_return, currency: business_currency()) }}</td>
</tr>
</tbody>
</table>
</div>
{{-- Right Column--}}
<div class="col-md-6 table-responsive">
<table class="table table-striped bg-white border rounded">
<tbody>
<tr>
<td class='text-start'>{{__('Closing stock')}}</td>
<td id="closing_stock_by_purchase">{{ $closing_stock_by_purchase }}</td>
</tr>
<tr>
<td class='text-start' colspan="2">{{__('(By purchase price)')}}</td>
</tr>
<tr>
<td class='text-start'>{{__('Closing stock')}}</td>
<td id="closing_stock_by_sale">{{ $closing_stock_by_sale }}</td>
</tr>
<tr>
<td class='text-start' colspan="2">{{__('(By sale price)')}}</td>
</tr>
<tr>
<td class='text-start'>{{__('Total Sales:')}}</td>
<td id="total_sale_price">{{ currency_format($total_sale_price, currency: business_currency()) }}</td>
</tr>
<tr>
<td class='text-start'>{{__('Total sell shipping charge:')}}</td>
<td id="total_sale_shipping_charge">{{ currency_format($total_sale_shipping_charge, currency: business_currency()) }}</td>
</tr>
<tr>
<td class='text-start'>{{__('Total Purchase Return:')}}</td>
<td id="all_purchase_return">{{ currency_format($all_purchase_return, currency: business_currency()) }}</td>
</tr>
<tr>
<td class='text-start'>{{__('Total Purchase discount:')}}</td>
<td id="total_purchase_discount">{{ currency_format($total_purchase_discount, currency: business_currency()) }}</td>
</tr>
<tr>
<td class='text-start'>{{__('Total sell round off:')}}</td>
<td id="total_sale_rounding_off">{{ currency_format($total_sale_rounding_off, currency: business_currency()) }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" value="{{ route('business.loss-profit.details.reports.filter') }}" id="get-loss-profit">
@endsection

View File

@@ -0,0 +1,40 @@
<div class="responsive-table m-0">
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Product Code') }} </th>
<th>{{ __('Profit') }} </th>
<th>{{ __('Loss') }} </th>
</tr>
</thead>
<tbody>
@foreach ($product_lossProfits as $loss_profit)
<tr>
<td>{{ $product_lossProfits->firstItem() + $loop->index }}</td>
<td>{{ $loss_profit->product?->productName }}</td>
<td>{{ $loss_profit->product?->productCode }}</td>
<td class="{{ $loss_profit->profit ? 'text-success' : '' }}">{{ currency_format($loss_profit->profit, currency: business_currency()) }}</td>
<td class="{{ $loss_profit->loss ? 'text-danger' : '' }}">{{ currency_format(abs($loss_profit->loss), currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($product_lossProfits->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td class="text-success">
{{ currency_format($product_lossProfits->sum('profit'), currency: business_currency()) }}
</td>
<td class="text-danger">
{{ currency_format($product_lossProfits->sum(fn($item) => abs($item->loss)), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $product_lossProfits->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,35 @@
<table>
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Product Code') }} </th>
<th>{{ __('Profit') }} </th>
<th>{{ __('Loss') }} </th>
</tr>
</thead>
<tbody>
@foreach ($product_lossProfits as $loss_profit)
<tr>
<td>{{ $loop->index + 1 }}</td>
<td>{{ $loss_profit->product?->productName }}</td>
<td>{{ $loss_profit->product?->productCode }}</td>
<td class="text-success">{{ currency_format($loss_profit->profit, currency: business_currency()) }}</td>
<td class="text-danger">{{ currency_format(abs($loss_profit->loss), currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($product_lossProfits->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td class="text-success">
{{ currency_format($product_lossProfits->sum('profit'), currency: business_currency()) }}
</td>
<td class="text-danger">
{{ currency_format($product_lossProfits->sum(fn($item) => abs($item->loss)), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,101 @@
@extends('layouts.business.master')
@section('title')
{{ __('Product Wise Loss Profit') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card ">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Product Wise Loss Profit') }}</h4>
</div>
<div class="table-header justify-content-center border-0 text-center d-none d-block d-print-block">
@include('business::print.header')
<h4 class="mt-2">{{ __('Product Wise Loss Profit') }}</h4>
</div>
<div class="loss-profit-container d-print-none">
<div class="row">
<div class="col-lg-2 col-md-12 ">
<div class="sales-card p-3 m-2 text-white">
<p class="stat-title">{{ __('Loss') }}</p>
<p class="stat-value">{{ currency_format($loss, currency: business_currency()) }}</p>
</div>
</div>
<div class="col-lg-2 col-md-6 ">
<div class="profit-card p-3 m-2 text-white">
<p class="stat-title">{{ __('Profit') }}</p>
<p class="stat-value">{{ currency_format($profit, currency: business_currency()) }}</p>
</div>
</div>
</div>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.product-loss-profit-reports.index') }}" method="GET" class="report-filter-form" table="#product-loss-profit-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
</div>
</form>
</div>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.product-loss-profit-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.product-loss-profit-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.product-loss-profit-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="product-loss-profit-reports-data">
@include('business::reports.product-loss-profit.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,58 @@
@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="">{{ __('Product Loss Profit Report List') }}</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">{{ __('Product Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product Code') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Profit') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Loss') }}</th>
</tr>
</thead>
<tbody>
@foreach ($product_lossProfits as $loss_profit)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ $loss_profit->product?->productName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $loss_profit->product?->productCode }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($loss_profit->profit, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($loss_profit->loss, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($product_lossProfits->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; color: white; font-weight: 600;">
{{ currency_format($product_lossProfits->sum('profit'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($product_lossProfits->sum(fn($item) => abs($item->loss)), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,63 @@
@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 m-0">
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Date') }} </th>
<th>{{ __('Invoice') }} </th>
<th>{{ __('Supplier') }} </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Purchase QTY') }} </th>
<th>{{ __('Total Amount') }} </th>
</tr>
</thead>
<tbody>
@foreach ($product_purchases as $product_purchase)
<tr>
<td>{{ $product_purchases->firstItem() + $loop->index }}</td>
<td>{{ formatted_date($product_purchase->purchase?->purchaseDate) }}</td>
<td>{{ $product_purchase->purchase?->invoiceNumber }}</td>
<td>{{ $product_purchase->purchase?->party?->name }}</td>
<td>{{ $product_purchase->product?->productName }}</td>
<td>{{ $product_purchase->quantities }}</td>
<td>{{ currency_format(($product_purchase->quantities) * ($product_purchase->productPurchasePrice), currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($product_purchases->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
{{ $product_purchases->sum('quantities') }}
</td>
<td>
{{ currency_format(
$product_purchases->sum(fn($item) => $item->quantities * $item->productPurchasePrice),
currency: business_currency()
) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $product_purchases->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,44 @@
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Date') }} </th>
<th>{{ __('Invoice') }} </th>
<th>{{ __('Supplier') }} </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Purchase QTY') }} </th>
<th>{{ __('Total Amount') }} </th>
</tr>
</thead>
<tbody>
@foreach ($product_purchases as $product_purchase)
<tr>
<td>{{ $loop->index + 1 }}</td>
<td>{{ formatted_date($product_purchase->purchase?->purchaseDate) }}</td>
<td>{{ $product_purchase->purchase?->invoiceNumber }}</td>
<td>{{ $product_purchase->purchase?->party?->name }}</td>
<td>{{ $product_purchase->product?->productName }}</td>
<td>{{ $product_purchase->quantities }}</td>
<td>{{ currency_format(($product_purchase->quantities) * ($product_purchase->productPurchasePrice), currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($product_purchases->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
{{ $product_purchases->sum('quantities') }}
</td>
<td>
{{ currency_format(
$product_purchases->sum(fn($item) => $item->quantities * $item->productPurchasePrice),
currency: business_currency()
) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,113 @@
@extends('layouts.business.master')
@section('title')
{{ __('Product Wise Purchase') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card ">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Product Wise Purchase') }}</h4>
</div>
<div class="table-header justify-content-center border-0 text-center d-none d-block d-print-block">
@include('business::print.header')
<h4 class="mt-2">{{ __('Product Wise Purchase') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.product-purchase-reports.index') }}" method="GET" class="report-filter-form" table="#product-purchase-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.product-purchase-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.product-purchase-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.product-purchase-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="product-purchase-reports-data">
@include('business::reports.product-purchase.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,71 @@
@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="">{{ __('Product Wise Purchase List') }}</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>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Supplier') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Purchase QTY') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Total Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($product_purchases as $product_purchase)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($product_purchase->purchase?->purchaseDate) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product_purchase->purchase?->invoiceNumber }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product_purchase->purchase?->party?->name }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product_purchase->product?->productName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product_purchase->quantities }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format(($product_purchase->quantities) * ($product_purchase->productPurchasePrice), currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($product_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;">
{{ $product_purchases->sum('quantities') }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format(
$product_purchases->sum(fn($item) => $item->quantities * $item->productPurchasePrice),
currency: business_currency()
) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,66 @@
@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 m-0">
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Date') }} </th>
<th>{{ __('Invoice') }} </th>
<th>{{ __('Customer') }} </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Sale QTY') }} </th>
<th>{{ __('Total Amount') }} </th>
</tr>
</thead>
<tbody>
@foreach ($product_sales as $product_sale)
@php $sl = $product_sales->firstItem() + $loop->index; @endphp
@foreach ($product_sale->details as $detail)
<tr>
<td>{{ $sl }}</td>
<td>{{ formatted_date($product_sale->saleDate) }}</td>
<td>{{ $product_sale->invoiceNumber }}</td>
<td>{{ $product_sale->party?->name }}</td>
<td>{{ $detail->product?->productName }}</td>
<td>{{ $detail->quantities }}</td>
<td>{{ currency_format(($detail->quantities) * (($detail->price)), currency: business_currency()) }}</td>
</tr>
@endforeach
@endforeach
</tbody>
@if ($product_sales->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
{{ $product_sales->sum(fn($sale) => $sale->details->sum('quantities')) }}
</td>
<td>
{{ currency_format(
$product_sales->sum(fn($sale) => $sale->details->sum(fn($detail) => $detail->quantities * $detail->price)),
currency: business_currency()
) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $product_sales->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,28 @@
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Date') }} </th>
<th>{{ __('Invoice') }} </th>
<th>{{ __('Customer') }} </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Sale QTY') }} </th>
<th>{{ __('Total Amount') }} </th>
</tr>
</thead>
<tbody>
@foreach ($product_sales as $product_sale)
@foreach ($product_sale->details as $detail)
<tr>
<td>{{ $loop->parent->iteration }}</td>
<td>{{ formatted_date($product_sale->saleDate) }}</td>
<td>{{ $product_sale->invoiceNumber }}</td>
<td>{{ $product_sale->party?->name }}</td>
<td>{{ $detail->product?->productName }}</td>
<td>{{ $detail->quantities }}</td>
<td>{{ currency_format(($detail->quantities) * (($detail->price)), currency: business_currency()) }}</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>

View File

@@ -0,0 +1,113 @@
@extends('layouts.business.master')
@section('title')
{{ __('Product Wise Sale') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card ">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Product Wise Sale') }}</h4>
</div>
<div class="table-header justify-content-center border-0 text-center d-none d-block d-print-block">
@include('business::print.header')
<h4 class="mt-2">{{ __('Product Wise Sale') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.product-sale-reports.index') }}" method="GET" class="report-filter-form" table="#product-sale-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.product-sale-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.product-sale-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.product-sale-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="product-sale-reports-data">
@include('business::reports.product-sale.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,73 @@
@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="">{{ __('Product Wise Sale List') }}</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>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Customer') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Purchase QTY') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Total Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($product_sales as $product_sale)
@foreach ($product_sale->details as $detail)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($product_sale->saleDate) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product_sale->invoiceNumber }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $product_sale->party?->name }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $detail->product?->productName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $detail->quantities }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format(($detail->quantities) * (($detail->price)), currency: business_currency()) }}
</td>
</tr>
@endforeach
@endforeach
</tbody>
@if ($product_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;">
{{ $product_sales->sum(fn($sale) => $sale->details->sum('quantities')) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format(
$product_sales->sum(fn($sale) => $sale->details->sum(fn($detail) => $detail->quantities * $detail->price)),
currency: business_currency()
) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,78 @@
@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 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th>{{ __('Branch') }}</th>
@endif
<th>{{ __('Invoice No') }}</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Total') }}</th>
<th>{{ __('Paid') }}</th>
<th>{{ __('Return Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($purchases as $purchase)
@php
$total_return_amount = $purchase->purchaseReturns->sum('total_return_amount');
@endphp
<tr>
<td>{{ ($purchases->currentPage() - 1) * $purchases->perPage() + $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td>{{ $purchase->branch->name ?? '' }}</td>
@endif
<td>
<a href="{{ route('business.sales.invoice', $purchase->id) }}" target="_blank" class="text-primary">
{{ $purchase->invoiceNumber }}
</a>
</td>
<td>{{ formatted_date($purchase->purchaseDate) }}</td>
<td>{{ $purchase->party->name ?? '' }}</td>
<td>{{ currency_format($purchase->totalAmount, currency: business_currency()) }}</td>
<td>{{ currency_format($purchase->paidAmount, currency: business_currency()) }}</td>
<td>{{ currency_format($total_return_amount ?? 0, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($purchases->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td></td>
<td>
{{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($purchases->sum('paidAmount'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($purchases->sum(fn($purchase) => $purchase->purchaseReturns->sum('total_return_amount')), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $purchases->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,55 @@
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th>{{ __('Branch') }}</th>
@endif
<th>{{ __('Invoice No') }}</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Total') }}</th>
<th>{{ __('Paid') }}</th>
<th>{{ __('Return Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($purchases as $purchase)
@php
$total_return_amount = $purchase->purchaseReturns->sum('total_return_amount');
@endphp
<tr>
<td>{{ $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td>{{ $purchase->branch->name ?? '' }}</td>
@endif
<td>{{ $purchase->invoiceNumber }}</td>
<td>{{ formatted_date($purchase->purchaseDate) }}</td>
<td>{{ $purchase->party->name ?? '' }}</td>
<td>{{ currency_format($purchase->totalAmount, currency: business_currency()) }}</td>
<td>{{ currency_format($purchase->paidAmount, currency: business_currency()) }}</td>
<td>{{ currency_format($total_return_amount ?? 0, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($purchases->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td></td>
<td>
{{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($purchases->sum('paidAmount'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($purchases->sum(fn($purchase) => $purchase->purchaseReturns->sum('total_return_amount')), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,85 @@
@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="">{{ __('Purchase Return Report List') }}</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;">
@if (auth()->user()->accessToMultiBranch())
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Branch') }}</th>
@endif
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Invoice No') }}</th>
<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">{{ __('Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Total') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Paid') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Return Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($purchases as $purchase)
@php
$total_return_amount = $purchase->purchaseReturns->sum('total_return_amount');
@endphp
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center;">
{{ $purchase->branch->name ?? '' }}
</td>
@endif
<td style="border:1px solid gainsboro; text-align:center;">
{{ $purchase->invoiceNumber }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($purchase->purchaseDate) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $purchase->party?->name ?? 'Guest' }}
</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->paidAmount, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($total_return_amount ?? 0, currency: business_currency()) }}
</td>
</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>
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center; font-weight: 600;"></td>
@endif
<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('paidAmount'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($purchases->sum(fn($purchase) => $purchase->purchaseReturns->sum('total_return_amount')), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,138 @@
@extends('layouts.business.master')
@section('title')
{{ __('Purchase Return Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __('Total Purchase Return') }}</p>
<p class="stat-value" id="total_purchase_return">{{ currency_format($total_purchase_return, currency: business_currency()) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Purchase Return 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">{{ __('Purchase Return Report List') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.purchase-return-reports.index') }}" method="GET" class="report-filter-form" table="#purchase-return-report-data">
<div class="table-top-left d-flex gap-3 d-print-none flex-wrap">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
@if(auth()->user()->accessToMultiBranch())
<div class="table-search position-relative">
<div class="gpt-up-down-arrow position-relative">
<select name="branch_id" class="form-control">
<option value="">{{ __('Select Branch') }}</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(request('branch_id') == $branch->id) >{{ $branch->name }}</option>
@endforeach
</select>
<span></span>
</div>
</div>
@endif
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.purchase-return-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.purchase-return-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.purchase-return-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="purchase-return-report-data">
@include('business::reports.purchase-return.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,103 @@
@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 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Invoice No') }}</th>
<th class="text-start">{{ __('Party Name') }}</th>
<th class="text-start">{{ __('Total') }}</th>
<th class="text-start d-print-none">{{ __('Discount') }}</th>
<th class="text-start">{{ __('Paid') }}</th>
<th class="text-start">{{ __('Due') }}</th>
<th class="text-start d-print-none">{{ __('Vat') }}</th>
<th class="text-start d-print-none">{{ __('Payment Type') }}</th>
<th class="text-start">{{ __('Purchase Date') }}</th>
</tr>
</thead>
<tbody>
@foreach ($purchases as $purchase)
<tr>
<td>{{ ($purchases->currentPage() - 1) * $purchases->perPage() + $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $purchase->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $purchase->invoiceNumber }}</td>
<td class="text-start">{{ $purchase->party?->name }}</td>
<td class="text-start">{{ currency_format($purchase->totalAmount, currency: business_currency()) }}
</td>
<td class="text-start d-print-none">
{{ currency_format($purchase->discountAmount, currency: business_currency()) }}</td>
<td class="text-start">{{ currency_format($purchase->paidAmount, currency: business_currency()) }}
</td>
<td class="text-start">{{ currency_format($purchase->dueAmount, currency: business_currency()) }}
</td>
<td class="text-start d-print-none">{{ currency_format($purchase->vat_amount, currency: business_currency()) }}
</td>
<td class="text-start 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-start">{{ formatted_date($purchase->purchaseDate) }}</td>
</tr>
@endforeach
</tbody>
@if ($purchases->count() > 0)
<tr class="table-footer">
<td class=" text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td class="text-start">
{{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }}
</td>
<td class="text-start d-print-none">
{{ currency_format($purchases->sum('discountAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($purchases->sum('paidAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($purchases->sum('dueAmount'), currency: business_currency()) }}
</td>
<td class="d-print-none">
{{ currency_format($purchases->sum('vat_amount'), currency: business_currency()) }}
</td>
<td class="d-print-none"></td>
<td></td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $purchases->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,83 @@
<table class="table" id="datatable">
<thead>
<tr>
<th class="d-print-none">{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Invoice No') }}</th>
<th class="text-start">{{ __('Party Name') }}</th>
<th class="text-start">{{ __('Total') }}</th>
<th class="text-start">{{ __('Discount') }}</th>
<th class="text-start">{{ __('Paid') }}</th>
<th class="text-start">{{ __('Due') }}</th>
<th class="text-start">{{ __('Vat') }}</th>
<th class="text-start">{{ __('Payment Type') }}</th>
<th class="text-start">{{ __('Purchase Date') }}</th>
</tr>
</thead>
<tbody>
@foreach ($purchases as $purchase)
<tr>
<td class="d-print-none">{{ $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $purchase->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $purchase->invoiceNumber }}</td>
<td class="text-start">{{ $purchase->party?->name }}</td>
<td class="text-start">{{ currency_format($purchase->totalAmount, currency: business_currency()) }}
</td>
<td class="text-start d-print-none">
{{ currency_format($purchase->discountAmount, currency: business_currency()) }}</td>
<td class="text-start">{{ currency_format($purchase->paidAmount, currency: business_currency()) }}
</td>
<td class="text-start">{{ currency_format($purchase->dueAmount, currency: business_currency()) }}
</td>
<td class="text-start d-print-none">{{ currency_format($purchase->vat_amount, currency: business_currency()) }}
</td>
<td class="text-start 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-start">{{ formatted_date($purchase->purchaseDate) }}</td>
</tr>
@endforeach
</tbody>
@if ($purchases->count() > 0)
<tr class="table-footer" style="font-weight: bold; background: #F5F5F5;">
<td class=" text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td class="text-start">
{{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }}
</td>
<td class="text-start d-print-none">
{{ currency_format($purchases->sum('discountAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($purchases->sum('paidAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($purchases->sum('dueAmount'), currency: business_currency()) }}
</td>
<td class="d-print-none">
{{ currency_format($purchases->sum('vat_amount'), currency: business_currency()) }}
</td>
<td class="d-print-none"></td>
<td></td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,99 @@
@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="">{{ __('Purchase Report List') }}</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;">
@if (auth()->user()->accessToMultiBranch())
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Branch') }}</th>
@endif
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Invoice No') }}</th>
<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">{{ __('Party Name') }}</th>
<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') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Paid') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Due') }}</th>
</tr>
</thead>
<tbody>
@foreach ($purchases as $purchase)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center;">
{{ $purchase->branch->name ?? '' }}
</td>
@endif
<td style="border:1px solid gainsboro; text-align:center;">
{{ $purchase->invoiceNumber }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($purchase->purchaseDate) }}
</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->paidAmount, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($purchase->dueAmount, currency: business_currency()) }}
</td>
</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>
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center; font-weight: 600;"></td>
@endif
<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;" class="d-print-none"></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('paidAmount'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($purchases->sum('dueAmount'), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,141 @@
@extends('layouts.business.master')
@section('title')
{{ __('Purchase Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __('Total Purchase') }}</p>
<p class="stat-value" id="total_purchase">{{ currency_format($total_purchase, currency: business_currency()) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Purchase 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">{{ __('Purchase Report List') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.purchase-reports.index') }}" method="GET" class="report-filter-form" table="#purchase-report-data">
<div class="table-top-left d-flex gap-3 d-print-none flex-wrap">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
@if(auth()->user()->accessToMultiBranch())
<div class="table-search position-relative">
<div class="gpt-up-down-arrow position-relative">
<select name="branch_id" class="form-control">
<option value="">{{ __('Select Branch') }}</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(request('branch_id') == $branch->id) >{{ $branch->name }}</option>
@endforeach
</select>
<span></span>
</div>
</div>
@endif
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.purchase-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.purchase-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.purchase-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="purchase-report-data">
@include('business::reports.purchase.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,80 @@
@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 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th>{{ __('Branch') }}</th>
@endif
<th>{{ __('Invoice No') }}</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Total') }}</th>
<th>{{ __('Paid') }}</th>
<th>{{ __('Return Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($sales as $sale)
@php
$total_return_amount = $sale->saleReturns->sum('total_return_amount');
@endphp
<tr>
<td>{{ ($sales->currentPage() - 1) * $sales->perPage() + $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td>{{ $sale->branch->name ?? '' }}</td>
@endif
<td>
<a href="{{ route('business.sales.invoice', $sale->id) }}" target="_blank" class="text-primary">
{{ $sale->invoiceNumber }}
</a>
</td>
<td>{{ formatted_date($sale->saleDate) }}</td>
<td>{{ $sale->party->name ?? 'Guest' }}</td>
<td>{{ currency_format($sale->totalAmount, currency: business_currency()) }}</td>
<td>{{ currency_format($sale->paidAmount, currency: business_currency()) }}</td>
<td>{{ currency_format($total_return_amount ?? 0, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($sales->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td></td>
<td>
{{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($sales->sum('paidAmount'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($sales->sum(fn($sale) => $sale->saleReturns->sum('total_return_amount')), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $sales->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,56 @@
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th>{{ __('Branch') }}</th>
@endif
<th>{{ __('Invoice No') }}</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Total') }}</th>
<th>{{ __('Paid') }}</th>
<th>{{ __('Return Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($sales as $sale)
@php
$total_return_amount = $sale->saleReturns->sum('total_return_amount');
@endphp
<tr>
<td>{{ $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td>{{ $sale->branch->name ?? '' }}</td>
@endif
<td>{{ $sale->invoiceNumber }}</td>
<td>{{ formatted_date($sale->saleDate) }}</td>
<td>{{ $sale->party->name ?? 'Guest' }}</td>
<td>{{ currency_format($sale->totalAmount, currency: business_currency()) }}</td>
<td>{{ currency_format($sale->paidAmount, currency: business_currency()) }}</td>
<td>{{ currency_format($total_return_amount ?? 0, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($sales->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td></td>
<td>
{{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($sales->sum('paidAmount'), currency: business_currency()) }}
</td>
<td>
{{ currency_format($sales->sum(fn($sale) => $sale->saleReturns->sum('total_return_amount')), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,84 @@
@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="">{{ __('Sale Return Report List') }}</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;">
@if (auth()->user()->accessToMultiBranch())
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Branch') }}</th>
@endif
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Invoice No') }}</th>
<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">{{ __('Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Total') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Paid') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Return Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($sales as $sale)
@php
$total_return_amount = $sale->saleReturns->sum('total_return_amount');
@endphp
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center;">
{{ $sale->branch->name ?? '' }}
</td>
@endif
<td style="border:1px solid gainsboro; text-align:center;">
{{ $sale->invoiceNumber }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($sale->saleDate) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $sale->party?->name ?? 'Guest' }}
</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->paidAmount, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($total_return_amount ?? 0, currency: business_currency()) }}
</td>
</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>
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center; font-weight: 600;"></td>
@endif
<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('paidAmount'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($sales->sum(fn($sale) => $sale->saleReturns->sum('total_return_amount')), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,137 @@
@extends('layouts.business.master')
@section('title')
{{ __('Sale Return Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __('Total Sale Return') }}</p>
<p class="stat-value" id="total_sale_return">{{ currency_format($total_sale_return, currency: business_currency()) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Sale Return 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">{{ __('Sale Return Report List') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.sale-return-reports.index') }}" method="GET" class="report-filter-form" table="#sale-return-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none flex-wrap">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
@if(auth()->user()->accessToMultiBranch())
<div class="table-search position-relative">
<div class="gpt-up-down-arrow position-relative">
<select name="branch_id" class="form-control">
<option value="">{{ __('Select Branch') }}</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(request('branch_id') == $branch->id) >{{ $branch->name }}</option>
@endforeach
</select>
<span></span>
</div>
</div>
@endif
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.sale-return-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.sale-return-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.sale-return-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="sale-return-reports-data">
@include('business::reports.sales-return.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,99 @@
@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 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Invoice No') }}</th>
<th class="text-start">{{ __('Party Name') }}</th>
<th class="text-start">{{ __('Total') }}</th>
<th class="text-start d-print-none">{{ __('Discount Amount') }}</th>
<th class="text-start">{{ __('Paid') }}</th>
<th class="text-start">{{ __('Due') }}</th>
<th class="text-start d-print-none">{{ __('Vat') }}</th>
<th class="text-start d-print-none">{{ __('Payment Type') }}</th>
<th class="text-start">{{ __('Sale Date') }}</th>
</tr>
</thead>
<tbody>
@foreach ($sales as $sale)
<tr>
<td>{{ ($sales->currentPage() - 1) * $sales->perPage() + $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $sale->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $sale->invoiceNumber }}</td>
<td class="text-start">{{ $sale->party?->name }}</td>
<td class="text-start">{{ currency_format($sale->totalAmount, currency: business_currency()) }}</td>
<td class="text-start d-print-none">{{ currency_format($sale->discountAmount, currency: business_currency()) }}</td>
<td class="text-start">{{ currency_format($sale->paidAmount, currency: business_currency()) }}</td>
<td class="text-start">{{ currency_format($sale->dueAmount, currency: business_currency()) }}</td>
<td class="text-start d-print-none">{{ currency_format($sale->vat_amount, currency: business_currency()) }}</td>
<td class="text-start 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-start">{{ formatted_date($sale->saleDate) }}</td>
</tr>
@endforeach
</tbody>
@if ($sales->count() > 0)
<tfoot>
<tr class="table-footer">
<td class="text-start">{{ __('Total') }} </td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td></td>
<td></td>
<td class="text-start">
{{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }}
</td>
<td class="text-start d-print-none">
{{ currency_format($sales->sum('discountAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($sales->sum('paidAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($sales->sum('dueAmount'), currency: business_currency()) }}
</td>
<td class="text-start d-print-none">
{{ currency_format($sales->sum('vat_amount'), currency: business_currency()) }}
</td>
<td></td>
<td class="d-print-none"></td>
</tr>
</tfoot>
@endif
</table>
</div>
<div class="mt-3">
{{ $sales->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,79 @@
<table class="table" id="datatable">
<thead>
<tr>
<th class="d-print-none">{{ __('SL') }}.</th>
@if (auth()->user()->accessToMultiBranch())
<th class="text-start">{{ __('Branch') }}</th>
@endif
<th class="text-start">{{ __('Invoice No') }}</th>
<th class="text-start">{{ __('Party Name') }}</th>
<th class="text-start">{{ __('Total') }}</th>
<th class="text-start">{{ __('Discount Amount') }}</th>
<th class="text-start">{{ __('Paid') }}</th>
<th class="text-start">{{ __('Due') }}</th>
<th class="text-start">{{ __('Vat') }}</th>
<th class="text-start">{{ __('Payment Type') }}</th>
<th class="text-start">{{ __('Sale Date') }}</th>
</tr>
</thead>
<tbody>
@foreach ($sales as $sale)
<tr>
<td class="d-print-none">{{ $loop->iteration }}</td>
@if (auth()->user()->accessToMultiBranch())
<td class="text-start">{{ $sale->branch->name ?? '' }}</td>
@endif
<td class="text-start">{{ $sale->invoiceNumber }}</td>
<td class="text-start">{{ $sale->party?->name }}</td>
<td class="text-start">{{ currency_format($sale->totalAmount, currency: business_currency()) }}</td>
<td class="text-start d-print-none">{{ currency_format($sale->discountAmount, currency: business_currency()) }}</td>
<td class="text-start">{{ currency_format($sale->paidAmount, currency: business_currency()) }}</td>
<td class="text-start">{{ currency_format($sale->dueAmount, currency: business_currency()) }}</td>
<td class="text-start d-print-none">{{ currency_format($sale->vat_amount, currency: business_currency()) }}</td>
<td class="text-start 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-start">{{ formatted_date($sale->saleDate) }}</td>
</tr>
@endforeach
@if ($sales->count() > 0)
<tr class="table-footer">
<td class="d-print-none text-start">{{ __('Total') }} </td>
@if (auth()->user()->accessToMultiBranch())
<td></td>
@endif
<td class="text-start"></td>
<td class="text-start"></td>
<td class="text-start">
{{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }}
</td>
<td class="text-start d-print-none">
{{ currency_format($sales->sum('discountAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($sales->sum('paidAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($sales->sum('dueAmount'), currency: business_currency()) }}
</td>
<td class="text-start">
{{ currency_format($sales->sum('vat_amount'), currency: business_currency()) }}
</td>
<td class="d-print-none"></td>
<td class="d-print-none"></td>
<td></td>
</tr>
@endif
</tbody>
</table>

View File

@@ -0,0 +1,100 @@
@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="">{{ __('Sales Report List') }}</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;">
@if (auth()->user()->accessToMultiBranch())
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Branch') }}</th>
@endif
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Invoice No') }}</th>
<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">{{ __('Party Name') }}</th>
<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') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Paid') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Due') }}</th>
</tr>
</thead>
<tbody>
@foreach ($sales as $sale)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center;">
{{ $sale->branch->name ?? '' }}
</td>
@endif
<td style="border:1px solid gainsboro; text-align:center;">
{{ $sale->invoiceNumber }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($sale->saleDate) }}
</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->paidAmount, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($sale->dueAmount, currency: business_currency()) }}
</td>
</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>
@if (auth()->user()->accessToMultiBranch())
<td style="border:1px solid gainsboro; text-align:center; font-weight: 600;"></td>
@endif
<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;" class="d-print-none"></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('paidAmount'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($sales->sum('dueAmount'), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,139 @@
@extends('layouts.business.master')
@section('title')
{{ __('Sale Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __('Total Sale') }}</p>
<p class="stat-value" id="total_sale">{{ currency_format($total_sale, currency: business_currency()) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Sales 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">{{ __('Sales Report List') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.sale-reports.index') }}" method="GET" class="report-filter-form" table="#sale-report-data">
<div class="table-top-left d-flex gap-3 d-print-none flex-wrap">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
@if(auth()->user()->accessToMultiBranch())
<div class="table-search position-relative">
<div class="gpt-up-down-arrow position-relative">
<select name="branch_id" class="form-control">
<option value="">{{ __('Select Branch') }}</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(request('branch_id') == $branch->id) >{{ $branch->name }}</option>
@endforeach
</select>
<span></span>
</div>
</div>
@endif
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.sales.reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.sales.reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.sales.reports.pdf', ['custom_days' => request('custom_days')]) }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="sale-report-data">
@include('business::reports.sales.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,55 @@
<div class="responsive-table m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Product') }}</th>
<th class="text-start">{{ __('Cost') }}</th>
<th class="text-start">{{ __('Qty') }}</th>
<th class="text-start">{{ __('Sale') }}</th>
<th class="text-end">{{ __('Stock Value') }}</th>
</tr>
</thead>
<tbody>
@foreach ($stock_reports as $stock_report)
@php
$total_stock = $stock_report->stocks->sum('productStock');
$firstStock = $stock_report->stocks->first();
$total_value = $stock_report->stocks->sum(function ($stock) {
return $stock->productPurchasePrice * $stock->productStock;
});
@endphp
<tr>
<td>{{ ($stock_reports->currentPage() - 1) * $stock_reports->perPage() + $loop->iteration }}</td>
<td class="text-start">{{ $stock_report->productName }}</td>
<td class="text-start">{{ currency_format(optional($firstStock)->productPurchasePrice, currency: business_currency()) }}</td>
<td class="{{ $total_stock <= $stock_report->alert_qty ? 'text-danger' : 'text-success' }} text-start">{{ $total_stock }}</td>
<td class="text-start">{{ currency_format(optional($firstStock)->productSalePrice, currency: business_currency()) }}</td>
<td class="text-end">{{ currency_format($total_value, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($stock_reports->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="text-end">
{{ currency_format(
$stock_reports->sum(function ($stock_report) {
return $stock_report->stocks->sum(function ($stock) {
return $stock->productPurchasePrice * $stock->productStock;
});
}),
currency: business_currency()
) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $stock_reports->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,50 @@
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Product') }}</th>
<th class="text-start">{{ __('Cost') }}</th>
<th class="text-start">{{ __('Qty') }}</th>
<th class="text-start">{{ __('Sale') }}</th>
<th class="text-end">{{ __('Stock Value') }}</th>
</tr>
</thead>
<tbody>
@foreach ($stock_reports as $stock_report)
@php
$total_stock = $stock_report->stocks->sum('productStock');
$firstStock = $stock_report->stocks->first();
$total_value = $stock_report->stocks->sum(function ($stock) {
return $stock->productPurchasePrice * $stock->productStock;
});
@endphp
<tr>
<td>{{ $loop->iteration }}</td>
<td class="text-start">{{ $stock_report->productName }}</td>
<td class="text-start">{{ currency_format(optional($firstStock)->productPurchasePrice, currency: business_currency()) }}</td>
<td class="{{ $total_stock <= $stock_report->alert_qty ? 'text-danger' : 'text-success' }} text-start">{{ $total_stock }}</td>
<td class="text-start">{{ currency_format(optional($firstStock)->productSalePrice, currency: business_currency()) }}</td>
<td class="text-end">{{ currency_format($total_value, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($stock_reports->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="text-end">
{{ currency_format(
$stock_reports->sum(function ($stock_report) {
return $stock_report->stocks->sum(function ($stock) {
return $stock->productPurchasePrice * $stock->productStock;
});
}),
currency: business_currency()
) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,75 @@
@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="">{{ __('Stock Report List') }}</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">{{ __('Product') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Cost') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Quantity') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Sale') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Stock Value') }}</th>
</tr>
</thead>
<tbody>
@foreach ($stock_reports as $stock_report)
@php
$total_stock = $stock_report->stocks->sum('productStock');
$firstStock = $stock_report->stocks->first();
$total_value = $stock_report->stocks->sum(function ($stock) {
return $stock->productPurchasePrice * $stock->productStock;
});
@endphp
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ $stock_report->productName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format(optional($firstStock)->productPurchasePrice, currency: business_currency()) }}
</td>
<td class="{{ $total_stock <= $stock_report->alert_qty ? 'text-danger' : 'text-success' }}" style="border:1px solid gainsboro; text-align:center;">
{{ $total_stock }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format(optional($firstStock)->productSalePrice, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($total_value, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($stock_reports->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;" class="d-print-none"></td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format(
$stock_reports->sum(function ($stock_report) {
return $stock_report->stocks->sum(function ($stock) {
return $stock->productPurchasePrice * $stock->productStock;
});
}),
currency: business_currency()
) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,96 @@
@extends('layouts.business.master')
@section('title')
{{ __('Stock Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __('Total Quantity') }}</p>
<p class="stat-value">{{ $total_qty }}</p>
</div>
<div class="loss-card p-3 text-white">
<p class="stat-title">{{ __('Total Stock Value') }}</p>
<p class="stat-value">{{ currency_format($total_stock_value) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Stock 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">{{ __('Stock Report List') }}</h4>
</div>
<div class="table-top-form p-16">
<form action="{{ route('business.stock-reports.index') }}" method="GET" class="filter-form" table="#stock-reports-data">
<div class="table-top-left d-flex gap-3 ">
<div class="gpt-up-down-arrow position-relative d-print-none">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative d-print-none">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
</div>
</form>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.stock-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.stock-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.stock-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="stock-reports-data">
@include('business::reports.stocks.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,67 @@
@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 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Package') }}</th>
<th>{{ __('Started') }}</th>
<th>{{ __('End') }}</th>
<th>{{ __('Gateway Method') }}</th>
<th>{{ __('Status') }}</th>
<th class="d-print-none">{{ __('Action') }}</th>
</tr>
</thead>
<tbody>
@foreach ($subscribers as $subscriber)
<tr>
<td>{{ ($subscribers->currentPage() - 1) * $subscribers->perPage() + $loop->iteration }}</td>
<td>{{ formatted_date($subscriber->created_at) }}</td>
<td>{{ $subscriber->plan->subscriptionName ?? 'N/A' }}</td>
<td>{{ formatted_date($subscriber->created_at) }}</td>
<td>{{ $subscriber->created_at ? formatted_date($subscriber->created_at->addDays($subscriber->duration)) : '' }}
</td>
<td>{{ $subscriber->gateway->name ?? 'N/A' }}</td>
<td>
<div class="badge bg-{{ $subscriber->payment_status == 'unpaid' ? 'danger' : 'primary' }}">
{{ ucfirst($subscriber->payment_status) }}
</div>
</td>
<td class="d-print-none">
<div class="dropdown table-action">
<button type="button" data-bs-toggle="dropdown">
<i class="far fa-ellipsis-v"></i>
</button>
<ul class="dropdown-menu">
<li>
<a target="_blank"
href="{{ route('business.subscription-reports.invoice', $subscriber->id) }}">
<img src="{{ asset('assets/images/icons/Invoic.svg') }}" alt="">
{{ __('Invoice') }}
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="mt-3">
{{ $subscribers->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,28 @@
<table>
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Package') }}</th>
<th>{{ __('Started') }}</th>
<th>{{ __('End') }}</th>
<th>{{ __('Gateway Method') }}</th>
<th>{{ __('Status') }}</th>
</tr>
</thead>
<tbody>
@foreach ($subscribers as $subscriber)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ formatted_date($subscriber->created_at) }}</td>
<td>{{ $subscriber->plan->subscriptionName ?? 'N/A' }}</td>
<td>{{ formatted_date($subscriber->created_at) }}</td>
<td>{{ $subscriber->created_at ? formatted_date($subscriber->created_at->addDays($subscriber->duration)) : '' }}</td>
<td>{{ $subscriber->gateway->name ?? 'N/A' }}</td>
<td>
{{ ucfirst($subscriber->payment_status) }}
</td>
</tr>
@endforeach
</tbody>
</table>

View File

@@ -0,0 +1,119 @@
@extends('layouts.business.blank')
@section('title')
{{ __('Subscriptions Report') }}
@endsection
@section('main_content')
<div class="invoice-container">
<div class="invoice-content p-4 ">
<div class="row py-2 d-print-none d-flex align-items-start justify-content-between border-bottom print-container">
<div class="col-md-6 d-flex align-items-center p-2">
<span class="Money-Receipt">{{ __('Subscription Report') }}</span>
</div>
<div class="col-md-6 d-flex justify-content-end align-items-end">
<div class="d-flex gap-3">
<a class="print-btn-2 print-btn" onclick="window.print()"><img class="w-10 h-10"
src="{{ asset('assets/img/print.svg') }}">{{__('Print')}}</a>
</div>
</div>
</div>
<div class="d-flex justify-content-between align-items-center gap-3 print-logo-container">
<!-- Left Side: Logo and Content -->
<div class="d-flex align-items-center gap-2 logo">
@if ((get_business_option('business-settings')['show_a4_invoice_logo'] ?? 0) == 1 )
<img class="invoice-logo" src="{{ asset(get_business_option('business-settings')['a4_invoice_logo'] ?? 'assets/images/default.svg') ?? '' }}" alt="">
@endif
</div>
<!-- Right Side: Invoice -->
<div class="address-container">
@if (($subscriber->business->meta['show_address'] ?? 0) == 1)
<p> {{__('Address')}} : {{ $subscriber->branch?->address ?? $subscriber->business?->address ?? '' }}</p>
@endif
@if (($subscriber->business->meta['show_phone_number'] ?? 0) == 1)
<p> {{__('Mobile')}} : {{ $subscriber->branch?->phone ?? $subscriber->business?->phoneNumber ?? '' }}</p>
@endif
@if (($subscriber->business->meta['show_email'] ?? 0) == 1)
<p> {{__('Email')}} : {{ $subscriber->branch?->email ?? $subscriber->business?->email ?? '' }}</p>
@endif
</div>
</div>
<div class="d-flex align-items-start justify-content-between flex-wrap">
<div class="">
<table class="table">
<tbody>
<tr class="in-table-row">
<td class="text-start">{{ __('Bill To') }}</td>
<td class="text-start">: {{ $subscriber->business?->companyName ?? '' }}</td>
</tr>
<tr class="in-table-row">
<td class="text-start">{{ __('Mobile') }}</td>
<td class="text-start">: {{ $subscriber->business?->phoneNumber ?? '' }} </td>
</tr>
<tr class="in-table-row">
<td class="text-start">{{ __('Address') }}</td>
<td class="text-start">: {{ $subscriber->business?->address ?? '' }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="custom-invoice-table">
<table class="table table-striped">
<thead>
<tr class="in-table-header">
<th class="head-red text-center">{{ __('SL') }}</th>
<th class="head-red text-center">{{ __('Business Name') }}</th>
<th class="head-black text-center">{{ __('Package Name') }}</th>
<th class="head-black text-center">{{ __('Started') }}</th>
<th class="head-black text-center">{{ __('End') }}</th>
<th class="head-black text-center">{{ __('Gateway Method') }}</th>
</tr>
</thead>
<tbody class="in-table-body-container">
<tr class="in-table-body">
<td class="text-center">1</td>
<td class="text-center">{{ $subscriber->business->companyName ?? 'N/A' }}</td>
<td class="text-center">{{ $subscriber->plan->subscriptionName ?? 'N/A' }}</td>
<td class="text-center">{{ formatted_date($subscriber->created_at) }}</td>
<td class="text-center">
{{ $subscriber->created_at ? formatted_date($subscriber->created_at->addDays($subscriber->duration)) : '' }}
</td>
<td class="text-center">{{ $subscriber->gateway->name ?? 'N/A' }}</td>
</tr>
</tbody>
</table>
</div>
<div class="d-flex align-items-center justify-content-between position-relative">
<div>
<table class="table">
<tbody>
<tr class="in-table-row">
<td class="text-start"></td>
</tr>
<tr class="in-table-row">
<td class="text-start"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,50 @@
@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="">{{ __('Subscription Report List') }}</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">{{ __('Package') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Started') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Ended') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Gateway Method') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Status') }}</th>
</tr>
</thead>
<tbody>
@foreach ($subscribers as $subscriber)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($subscriber->created_at) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $subscriber->plan->subscriptionName ?? 'N/A' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($subscriber->created_at) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $subscriber->created_at ? formatted_date($subscriber->created_at->addDays($subscriber->duration)) : '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $subscriber->gateway->name ?? 'N/A' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ ucfirst($subscriber->payment_status) }}
</td>
</tr>
@endforeach
</tbody>
</table>
@endsection

View File

@@ -0,0 +1,121 @@
@extends('layouts.business.master')
@section('title')
{{ __('Subscription Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Subscription Reports') }}</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">{{ __('Subscription Reports') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.subscription-reports.index') }}" method="GET" class="report-filter-form" table="#subscription-report-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" />
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round" />
</svg>
</span>
</div>
<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>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.subscription-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.subscription-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.subscription-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="subscription-report-data">
@include('business::reports.subscription-reports.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,43 @@
<div class="responsive-table m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Name') }}</th>
<th class="text-start">{{ __('Phone') }}</th>
<th class="text-start">{{ __('Type') }}</th>
<th class="text-start">{{ __('Credit Limit') }}</th>
<th class="text-end">{{ __('Due Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($parties as $party)
<tr>
<td>{{ ($parties->currentPage() - 1) * $parties->perPage() + $loop->iteration }}</td>
<td class="text-start">{{ $party->name }}</td>
<td class="text-start">{{ $party->phone }}</td>
<td class="text-start">{{ $party->type }}</td>
<td class="text-start">{{ currency_format($party->credit_limit, currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($party->due, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($parties->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td class="text-start">{{ currency_format($parties->sum("credit_limit"), currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($parties->sum('due'), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $parties->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,93 @@
@extends('layouts.business.master')
@section('title')
{{ __('Supplier Due Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="mb-4 d-flex loss-flex gap-3 loss-profit-container d-print-none">
<div class="d-flex align-items-center justify-content-center gap-3">
<div class="profit-card p-3 text-white">
<p class="stat-title">{{ __("Total Due") }}</p>
<p class="stat-value">{{ currency_format($total_due, currency: business_currency()) }}</p>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Supplier Due 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">{{ __('Supplier Due List') }}</h4>
</div>
<div class="table-top-form p-16">
<form action="{{ route('business.supplier-due-reports.index') }}" method="GET" class="filter-form" table="#supplier-due-reports-data">
<div class="table-top-left d-flex gap-3 ">
<div class="gpt-up-down-arrow position-relative d-print-none">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative d-print-none">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
</div>
</form>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.supplier-due-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.supplier-due-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.supplier-due-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="supplier-due-reports-data">
@include('business::reports.supplier-due.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,38 @@
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Name') }}</th>
<th class="text-start">{{ __('Phone') }}</th>
<th class="text-start">{{ __('Type') }}</th>
<th class="text-start">{{ __('Credit Limit') }}</th>
<th class="text-end">{{ __('Due Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($parties as $party)
<tr>
<td>{{ $loop->iteration }}</td>
<td class="text-start">{{ $party->name }}</td>
<td class="text-start">{{ $party->phone }}</td>
<td class="text-start">{{ $party->type }}</td>
<td class="text-start">{{ currency_format($party->credit_limit, currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($party->due, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($parties->count() > 0)
<tr class="table-footer">
<td class="text-start">{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td class="text-start">{{ currency_format($parties->sum("credit_limit"), currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($parties->sum('due'), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,67 @@
@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="">{{ __('Supplier Due Report List') }}</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">{{ __('Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Phone') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Type ') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Credit Limit') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Due Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($parties as $party)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ $party->name }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $party->phone }}
</td>
@if ($party->type == 'Retailer')
<td style="border:1px solid gainsboro; text-align:center;">{{ __('Customer') }}</td>
@else
<td style="border:1px solid gainsboro; text-align:center;">
{{ $party->phone }}
</td>
@endif
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($party->credit_limit, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($party->due, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($parties->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; color: white; font-weight: 600;">
{{ currency_format($parties->sum('credit_limit'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($parties->sum('due'), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,37 @@
<div class="responsive-table m-0">
<table class="table">
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Product Code') }} </th>
<th>{{ __('Total Sales') }} </th>
<th class="text-end">{{ __('Total Amount') }} </th>
</tr>
</thead>
<tbody>
@foreach ($top_products as $top_product)
<tr>
<td>{{ $loop->index + 1 }}</td>
<td>{{ $top_product->product?->productName }}</td>
<td>{{ $top_product->product?->productCode }}</td>
<td>{{ $top_product->total_sold_qty ?? 0 }}</td>
<td class="text-end">{{ currency_format($top_product->total_sale_amount ?? 0, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($top_products->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td>
{{ $top_products->sum(fn($product) => $product->total_sold_qty ?? 0) }}
</td>
<td class="text-end">
{{ currency_format($top_products->sum(fn($product) => $product->total_sale_amount ?? 0), currency: business_currency()) }}
</td>
</tr>
@endif
</table>
</div>

View File

@@ -0,0 +1,35 @@
<table>
<thead>
<tr>
<th>{{ __('SL') }}. </th>
<th>{{ __('Product Name') }} </th>
<th>{{ __('Product Code') }} </th>
<th>{{ __('Total Sales') }} </th>
<th>{{ __('Total Amount') }} </th>
</tr>
</thead>
<tbody>
@foreach ($top_products as $top_product)
<tr>
<td>{{ $loop->index + 1 }}</td>
<td>{{ $top_product->product?->productName }}</td>
<td>{{ $top_product->product?->productCode }}</td>
<td>{{ $top_product->total_sold_qty ?? 0 }}</td>
<td>{{ currency_format($top_product->total_sale_amount ?? 0, currency: business_currency()) }}</td>
</tr>
@endforeach
</tbody>
@if ($top_products->count() > 0)
<tr class="table-footer">
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td>
{{ $top_products->sum(fn($product) => $product->total_sold_qty ?? 0) }}
</td>
<td class="text-end">
{{ currency_format($top_products->sum(fn($product) => $product->total_sale_amount ?? 0), currency: business_currency()) }}
</td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,74 @@
@extends('layouts.business.master')
@section('title')
{{ __('Top 5 Products') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card ">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Top 5 Products') }}</h4>
</div>
<div class="table-header justify-content-center border-0 text-center d-none d-block d-print-block">
@include('business::print.header')
<h4 class="mt-2">{{ __('Top 5 Products') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.top-product-reports.index') }}" method="GET" class="report-filter-form" table="#top-product-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
</div>
</form>
</div>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.top-product-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.top-product-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.top-product-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="top-product-reports-data">
@include('business::reports.top-products.datas')
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,58 @@
@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="">{{ __('Top 5 Product Report List') }}</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">{{ __('Product Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Product Code') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Total Sales') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Total Amount') }}</th>
</tr>
</thead>
<tbody>
@foreach ($top_products as $top_product)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ $top_product->product?->productName }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $top_product->product?->productCode }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $top_product->total_sold_qty ?? 0 }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($top_product->total_sale_amount ?? 0, currency: business_currency()) }}
</td>
</tr>
@endforeach
</tbody>
@if ($top_products->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; color: white; font-weight: 600;">
{{ $top_products->sum(fn($product) => $product->total_sold_qty ?? 0) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($top_products->sum(fn($product) => $product->total_sale_amount ?? 0), currency: business_currency()) }}
</td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,98 @@
@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 m-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Date') }}</th>
<th class="text-start">{{ __('Reference') }}</th>
<th class="text-start">{{ __('Party Name') }}</th>
<th class="text-start">{{ __('Party Type') }}</th>
<th class="text-start">{{ __('Total Due') }}</th>
<th class="text-center">{{ __('Pay Amount') }}</th>
<th class="text-start d-print-none">{{ __('Payment Type') }}</th>
</tr>
</thead>
<tbody>
@foreach ($transactions as $transaction)
<tr>
<td>{{ ($transactions->currentPage() - 1) * $transactions->perPage() + $loop->iteration }}</td>
<td class="text-start">{{ formatted_date($transaction->paymentDate) }}</td>
@if (!$transaction->party_id)
<td class="text-start">
<a href="{{ route('business.collect.walk-dues.invoice', $transaction->id ?? '') }}"
class="text-primary" target="_blank">
{{ $transaction->invoiceNumber }}
</a>
</td>
@else
<td class="text-start">
<a href="{{ route('business.collect.dues.invoice', $transaction->party_id) }}"
class="text-primary" target="_blank">
{{ $transaction->invoiceNumber }}
</a>
</td>
@endif
<td class="text-start">{{ $transaction->party?->name }}</td>
@if ($transaction->party?->type == 'Retailer')
<td class="text-start">{{ __('Customer') }}</td>
@else
<td class="text-start">{{ $transaction->party?->type }}</td>
@endif
<td class="text-start">{{ currency_format($transaction->totalDue, currency: business_currency()) }}
</td>
<td class="text-center">{{ currency_format($transaction->payDueAmount, currency: business_currency()) }}</td>
<td class="text-start d-print-none">
@if ($transaction->transactions && $transaction->transactions->isNotEmpty())
{{ $transaction->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 ($transaction->payment_type_id)
{{ $transaction->payment_type?->name }}
@else
{{ $transaction->paymentType }}
@endif
</td>
</tr>
@endforeach
</tbody>
<tr class="table-footer">
@if ($transactions->count() > 0)
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="text-start">
{{ currency_format($transactions->sum('totalDue'), currency: business_currency()) }}
</td>
<td class="text-center">
{{ currency_format($transactions->sum('payDueAmount'), currency: business_currency()) }}
</td>
<td class="d-print-none"></td>
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $transactions->links('vendor.pagination.bootstrap-5') }}
</div>

View File

@@ -0,0 +1,63 @@
<table>
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Date') }}</th>
<th class="text-start">{{ __('Reference') }}</th>
<th class="text-start">{{ __('Party Name') }}</th>
<th class="text-start">{{ __('Party Type') }}</th>
<th class="text-start">{{ __('Total Due') }}</th>
<th class="text-center">{{ __('Pay Amount') }}</th>
<th class="text-start">{{ __('Payment Type') }}</th>
</tr>
</thead>
<tbody>
@foreach ($transactions as $transaction)
<tr>
<td>{{ $loop->iteration }}</td>
<td class="text-start">{{ formatted_date($transaction->paymentDate) }}</td>
<td class="text-start">{{ $transaction->invoiceNumber }}</td>
<td class="text-start">{{ $transaction->party?->name }}</td>
@if ($transaction->party?->type == 'Retailer')
<td class="text-start">{{ __('Customer') }}</td>
@else
<td class="text-start">{{ $transaction->party?->type }}</td>
@endif
<td class="text-start">{{ currency_format($transaction->totalDue, currency: business_currency()) }}
</td>
<td class="text-center">
{{ currency_format($transaction->payDueAmount, currency: business_currency()) }}</td>
<td class="text-start">
@if ($transaction->transactions && $transaction->transactions->isNotEmpty())
{{ $transaction->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 ($transaction->payment_type_id)
{{ $transaction->payment_type?->name }}
@else
{{ $transaction->paymentType }}
@endif
</td>
</tr>
@endforeach
</tbody>
@if ($transactions->count() > 0)
<td>{{ __('Total') }}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="text-start">
{{ currency_format($transactions->sum('totalDue'), currency: business_currency()) }}
</td>
<td class="text-center">
{{ currency_format($transactions->sum('payDueAmount'), currency: business_currency()) }}
</td>
<td class="d-print-none"></td>
</tr>
@endif
</table>

View File

@@ -0,0 +1,81 @@
@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="">{{ __('Due Transaction Report List') }}</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">{{ __('Reference') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Party Name') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Total Due') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Pay Amount') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Payment Type') }}</th>
</tr>
</thead>
<tbody>
@foreach ($transactions as $transaction)
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
<td style="border:1px solid gainsboro; text-align:center;">
{{ formatted_date($transaction->paymentDate) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $transaction->invoiceNumber }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $transaction->party?->name }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($transaction->totalDue, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ currency_format($transaction->payDueAmount, currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;" class="d-print-none">
@if ($transaction->transactions && $transaction->transactions->isNotEmpty())
{{ $transaction->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 ($transaction->payment_type_id)
{{ $transaction->payment_type?->name }}
@else
{{ $transaction->paymentType }}
@endif
</td>
</tr>
@endforeach
</tbody>
@if ($transactions->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; color: white; font-weight: 600;">
{{ currency_format($transactions->sum('totalDue'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($transactions->sum('payDueAmount'), currency: business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center;"></td>
</tr>
</tfoot>
@endif
</table>
@endsection

View File

@@ -0,0 +1,146 @@
@extends('layouts.business.master')
@section('title')
{{ __('Transaction Reports') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="loss-profit-container d-print-none">
<div class="row">
<div class="col-lg-2 col-md-12 ">
<div class="loss-card p-3 m-2 text-white">
<p class="stat-title">{{ __('Due') }}</p>
<p class="stat-value" id="total_due">{{ currency_format($total_due, currency: business_currency()) }}</p>
</div>
</div>
<div class="col-lg-2 col-md-6 ">
<div class="profit-card p-3 m-2 text-white">
<p class="stat-title">{{ __('Paid') }}</p>
<p class="stat-value" id="total_paid">{{ currency_format($total_paid, currency: business_currency()) }}</p>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-bodys">
<div class="table-header p-16 d-print-none">
<h4>{{ __('Due Collection Transactions') }}</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">{{ __('Due Collection Transactions') }}</h4>
</div>
<div class="table-top-form p-16">
<div class="d-flex align-items-center gap-3 flex-wrap">
<form action="{{ route('business.transaction-history-reports.index') }}" method="GET" class="report-filter-form" table="#transactions-reports-data">
<div class="table-top-left d-flex gap-3 d-print-none">
<div class="gpt-up-down-arrow position-relative">
<select name="per_page" class="form-control">
<option @selected(request('per_page') == 20) value="20">{{ __('Show 20') }}</option>
<option @selected(request('per_page') == 50) value="50">{{ __('Show 50') }}</option>
<option @selected(request('per_page') == 100) value="100">{{ __('Show 100') }}</option>
<option @selected(request('per_page') == 500) value="500">{{ __('Show 500') }}</option>
</select>
<span></span>
</div>
<div class="table-search position-relative">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search...') }}" value="{{ request('search') }}">
<span class="position-absolute">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.582 14.582L18.332 18.332" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.668 9.16797C16.668 5.02584 13.3101 1.66797 9.16797 1.66797C5.02584 1.66797 1.66797 5.02584 1.66797 9.16797C1.66797 13.3101 5.02584 16.668 9.16797 16.668C13.3101 16.668 16.668 13.3101 16.668 9.16797Z" stroke="#4D4D4D" stroke-width="1.25" stroke-linejoin="round"/>
</svg>
</span>
</div>
<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 class="gpt-up-down-arrow position-relative d-print-none">
<select name="type" class="form-control employee-select">
<option value="">{{ __('Select party') }}</option>
<option value="Retailer" {{ request('type') == 'Retailer' ? 'selected' : '' }}>{{ __('Customer') }}</option>
<option value="Dealer" {{ request('type') == 'Dealer' ? 'selected' : '' }}>{{ __('Dealer') }}</option>
<option value="Wholesaler" {{ request('type') == 'Wholesaler' ? 'selected' : '' }}>{{ __('Wholesaler') }}</option>
<option value="Supplier" {{ request('type') == 'Supplier' ? 'selected' : '' }}>{{ __('Supplier') }}</option>
</select>
<span></span>
</div>
</div>
</form>
</div>
<div class="table-top-btn-group d-print-none">
<ul>
<li>
<a href="{{ route('business.transaction-history-reports.csv') }}">
<img src="{{ asset('assets/images/logo/csv.svg') }}" alt="">
</a>
</li>
<li>
<a href="{{ route('business.transaction-history-reports.excel') }}">
<img src="{{ asset('assets/images/logo/excel.svg') }}" alt="">
</a>
</li>
<li>
<a target="blank" href="{{ route('business.transaction-history-reports.pdf') }}">
<img src="{{ asset('assets/images/logo/pdf.svg') }}" alt="">
</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>
<div id="transactions-reports-data">
@include('business::reports.transaction-history.datas')
</div>
</div>
</div>
</div>
@endsection

View 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>

View 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

View 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

View File

@@ -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>

View File

@@ -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>