Path : /var/www/html/jewelry-pos/resources/views/sale-reports/ |
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
Current File : /var/www/html/jewelry-pos/resources/views/sale-reports/index.blade.php |
@extends('layouts.admin-main') @section('content') <div class="col-lg-12"> <div class="card-body shadow-1"> <form method="GET" action="{{ route('sale-report.index') }}" id="search-form" onsubmit=""> <div class="row" style=""> <div class="col-md-4 col-xs-12 col-sm-4 col-xl-3 mb-4"> <div class="input-group"> <input type="text" class="form-control rounded-0" placeholder="{{ __('message.select') }}" id="datepicker" name="date" readonly> <input type="hidden" name="paginate" value="{{$paginate}}"> <div class="input-group-append"> <span class="input-group-text fs-xl"> <i class="fal fa-calendar text-info "></i> </span> </div> </div> </div> <div class="col-xs-12 col-sm-8 col-md-8 col-xl-8 d-flex mb-4"> <form method="GET" class="" action="{{route('sale-report.index')}}?start_date={{$start_date}}&end_date={{$end_date}}&paginate={{$paginate}}" style="display: flex;justify-content: space-between;align-items: center;width: 100%"> <div class="input-group" style="width: 100%;height: fit-content;"> <input type="text" class="form-control rounded-0" placeholder="{{ __('message.search') }} ..." value="{{$search}}" name="search" id="search"> <div class="input-group-append"> <button type="submit" id="searches" class="input-group-text fs-xl "> <i class="fal fa-search text-success"></i> </button> </div> </div> {{-- <select onchange="this.form.submit()" name="product_category_id" id="product_category_id" class="form-control mr-2" required="" style="width: 25%;margin-left: 10px">--}} {{-- <option value="0">{{__('message.selected all')}}</option>--}} {{-- @foreach($productCategories as $productCategory)--}} {{-- <option value="{{$productCategory->id}}" @if($productCategory->id == $product_category_id) selected @endif @if($productCategory->parent_id == '') style="font-weight: bold" @endif>{{$productCategory->name}}</option>--}} {{-- @endforeach--}} {{-- <option value="{{$pigCategory->id}}" @if($pigCategory->id == $product_category_id) selected @endif>{{$pigCategory->name}}</option>--}} {{-- </select>--}} <select class="select2 form-control w-100 ml-4" id="product_category_id" name="product_category_id" onchange="submit()"> <option value="0">{{__('message.selected all')}}</option> @foreach($main_categories as $main) <option value="{{$main->id}}" style="font-weight: bold;font-size: 14px" @if($main->id == $product_category_id) selected @endif>{{$main->name}}</option> @foreach($main->children as $child) <option value="{{$child->id}}" @if($child->id == $product_category_id) selected @endif> {{$child->name}}</option> @endforeach @endforeach </select> @if($product_category_id) @if($productCategory->name == $platinume_Category->name || $productCategory->parent?->name == $platinume_Category->name) <div class="ml-2" style="width: 60%;"> <select class="form-control" name="check_fixed_price" onchange="this.form.submit();"> <option value="-1">{{__('message.selected all')}}</option> <option value="1" @if($check_fixed_price==1) selected @endif>{{__('message.fixed price')}}</option> <option value="2" @if($check_fixed_price==2) selected @endif>{{__('message.not fixed price')}}</option> </select> </div> @endif @endif <a href="{{route('sale-report.index')}}?start_date={{$start_date}}&end_date={{$end_date}}&paginate={{$paginate}}" type="rset" class="btn btn-sm btn-outline-info ml-4" style="width: 50%;"> <i class="fal fa-sync"></i> <span class="hidden-xs"> {{ __('message.refresh') }}</span> </a> </form> </div> <div class="col-xs-6 col-sm-6 col-md-6 col-xl-6 mb-4"> {{-- <a href="{{route('sale-report.print')}}?start_date={{$start_date}}&end_date={{$end_date}}&search={{$search}}&product_category_id={{$product_category_id}}" type="submit"--}} {{-- class="btn btn-info bg-info-800 float-center rounded-0 ml-2" style="width: 40%;"--}} {{-- title="{{ __('message.print') }}" name="">--}} {{-- <i class="fal fa-print"></i>--}} {{-- {{ __('message.print') }}--}} {{-- </a>--}} <a href="{{route('sale-report.export')}}?start_date={{$start_date}}&end_date={{$end_date}}&search={{$search}}&product_category_id={{$product_category_id}}" class="btn btn-success bg-success-800 search-date ml-2" id="download-button" onclick="return clickdownload()" style="width: 40%;"> <i class="fal fa-download"></i> {{ __('message.export excel') }} </a> {{-- <a href="{{route('sale-report.print-total-category')}}?start_date={{$start_date}}&end_date={{$end_date}}&search={{$search}}&product_category_id={{$product_category_id}}&check_fixed_price={{$check_fixed_price}}" type="submit"--}} {{-- class="btn btn-info bg-info-800 float-center rounded-0 ml-2" style="width: 30%;"--}} {{-- title="{{ __('message.print') }}" name="">--}} {{-- <i class="fal fa-print"></i>--}} {{-- {{ __('message.print') }}--}} {{-- </a>--}} <a href="#" id="printBtn" class="btn btn-info bg-info-800 float-center rounded-0 ml-2" style="width: 30%;" title="{{ __('message.print') }}"> <i class="fal fa-print"></i> {{ __('message.print') }} </a> </div> </div> </form> <div class="panel-container show table-responsive"> <div class="d-flex flex-column h-100"> <div class="h-auto"> <table id="example" class="table table-striped w-100"> <thead class="bg-fusion-400 text-center"> <tr> <th></th> <th>#</th> <th class="text-center">{{ __('message.part number') }}</th> <th>{{ __('message.name') }}</th> <th>{{ __('message.qty') }}</th> <th>{{ __('message.sales price') }}</th> <th>{{ __('message.discount') }}</th> <th>{{ __('message.net sale') }}</th> <th>{{ __('message.sale product') }}</th> {{-- <th>{{ __('message.user') }}</th>--}} {{-- <th>{{ __('message.sale date') }}</th>--}} </tr> </thead> <tbody id="accordionExample"> @foreach ($sales as $index => $sale) <tr class="text-center border-bottom" data-toggle="collapse" href="#row{{$index}}" role="button" aria-expanded="false" aria-controls="row{{$index}}"> <td>@if($sale->product?->for_sale == 0 || $sale->productCategory->name == 'ផលិតផលបន្ថែម')<input type="checkbox" class="form-check past_sale_checkbox" name="past_sale_id[]" value="{{ $sale->id }}"> @endif</td> <td>{{ $index+1 }} </td> <td class="text-center">{{$sale->part_number}}</td> <td> {{ $sale->name??'' }} </td> <td class=""> {{ $sale->qty??0}} </td> <td class="credit"> {{ number_format($sale->sales_price+$sale->discount , 2) }} {{$currency_->currency_symbol}} </td> <td class="credit"> {{number_format($sale->discount , 2)}} {{$currency_->currency_symbol}} </td> <td class="credit"> {{ number_format($sale->sales_price , 2) }} {{$currency_->currency_symbol}} </td> <td class="credit"> {{number_format(($sale->sales_price+$sale->discount)-$sale->wages , 2)}} {{$currency_->currency_symbol}} </td> {{-- <td>--}} {{-- <a href="{{route('users.show' , $sale->user_id)}}" class="text-dark" title="{{__('message.show user')}}">--}} {{-- {{$sale->user->name??''}}--}} {{-- </a>--}} {{-- </td>--}} {{-- <td>--}} {{-- {{ $sale->created_at->format('d/m/Y H:i') }}--}} {{-- </td>--}} </tr> <tr class="text-center border-bottom"> <td colspan="9"> <div class="collapse multi-collapse" id="row{{$index}}" data-parent="#accordionExample"> <div class="panel-content"> <ul class="nav nav-tabs" role="tablist"> <li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#detail{{$loop->index}}" role="tab">{{__('message.detail')}}</a></li> <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#member{{$loop->index}}" role="tab">{{__('message.customer')}}</a></li> <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#description{{$loop->index}}" role="tab">{{__('message.description')}}</a></li> </ul> <div class="tab-content border-top-0 p-3" style="border:1px solid #dee2e6!important; border-top:none !important;"> <div class="tab-pane fade show active" id="detail{{$loop->index}}" role="tabpanel"> <div class=""> <div class="card-body"> <div class="row"> <div class="col-3"> @if($sale->image) <img class="rounded" id="myImg{{$index}}" src="{{ asset($sale->image) }}" style="width:200px;max-width:300px;cursor:pointer;"> @else <img class="rounded" id="myImg{{$index}}" src="{{ asset('no_image.png') }}" style="width:200px;max-width:300px;cursor:pointer;"> @endif </div> <div class="col-4"> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.product category')}} </p> </div> <div class="col-6 text-left">: {{$sale->productCategory->name ?? '-'}}</div> {{-- <div class="col-6 text-left">: {{$sale->productCategoryNameUpgrade()??''}}</div>--}} </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.cost')}} </p> </div> <div class="col-6 text-left credit">: {{number_format($sale->cost()??0 , 2)}} {{$currency_->currency_symbol}}</div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.selling cost')}} </p> </div> <div class="col-6 text-left credit">: {{number_format($sale->selling_cost??0 , 2)}} {{$currency_->currency_symbol}}</div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.selling rate')}} </p> </div> <div class="col-6 text-left credit">: {{number_format($sale->selling_rate??0 , 4)}} {{$currency_->currency_symbol}}</div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.wages')}} </p> </div> <div class="col-6 text-left credit">: {{number_format($sale->wages??0 , 2)}} {{$currency_->currency_symbol}} </div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.original wages')}} </p> </div> <div class="col-6 text-left credit">: {{number_format($sale->original_wages??0 , 2)}} {{$currency_->currency_symbol}} </div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.gold weight')}} </p> </div> <div class="col-6 text-left">: {{number_format($sale->goldWeight() , 2)}}</div> </div> @if($sale->purity_upgrade_to) <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{ __('message.purity upgrade to') }} </p> </div> <div class="col-6 text-left">: {{$sale->purity_upgrade_to??''}}</div> </div> @endif @if($sale->selling_purity) <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.selling purity')}} </p> </div> <div class="col-6 text-left">: {{$sale->selling_purity??''}}</div> </div> @endif </div> <div class="col-4"> @if($sale->original_invoice) <div class="row mb-3"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.original invoice')}} </p> </div> <div class="col-6 text-left">: {{$sale->original_invoice??''}} </div> </div> @endif <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.supplier rate')}} </p> </div> <div class="col-6 text-left credit">: {{ number_format($sale->supplier_rate ?? 0 , 2)}} {{$currency_->currency_symbol}}</div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.user')}} </p> </div> <div class="col-6 text-left credit">: <a href="{{route('users.show' , $sale->user_id)}}" class="text-dark" title="{{__('message.show user')}}"> {{$sale->user->name??''}} </a> </div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.sale date')}} </p> </div> <div class="col-6 text-left">: {{ $sale->created_at->format('d/m/Y H:i') }} </div> </div> @if($sale->old_code) <div class="row mb-3"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.old code')}} </p> </div> <div class="col-6 text-left">: {{$sale->old_code??''}} </div> </div> @endif @if($sale->diamond_size) <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.diamond size')}} </p> </div> <div class="col-6 text-left">: {!!$sale->diamond_size??0!!}</div> </div> @endif </div> </div> @include('sale-reports.card-footer') </div> </div> </div> <div class="tab-pane fade" id="member{{$loop->index}}" role="tabpanel"> <div class="col-4"> <div class="row"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.customer name')}} </p> </div> <div class="col-6 text-left">: <a href="{{route('member.show' , $sale->member->id??0)}}" style="color: black"> {{$sale->member->name??''}} </a> </div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.customer phone')}} </p> </div> <div class="col-6 text-left">: {{$sale->member->phone??''}}</div> </div> <div class="row mb-2"> <div class="col-6"> <p class="fw-bolder credit text-left"> {{__('message.buy back')}} </p> </div> <div class="col-6 text-left">: <span class="badge {{$sale->already_buy_back == 1 ? 'badge-success' : 'badge-danger'}}"> {{$sale->already_buy_back==1? __('message.yes'): __('message.no')}} </span> </div> </div> <div class="row mb-2"> <div class="col-6"> @if($sale->already_buy_back == 1) <p class="fw-bolder credit text-left"> {{__('message.date buy back')}} </p> @endif </div> <div class="col-6 text-left"> @if($sale->already_buy_back == 1) : {{date('d-m-y' , strtotime($sale->date_buy_back))}} @endif </div> </div> </div> </div> <div class="tab-pane fade" id="description{{$loop->index}}" role="tabpanel"> @if($sale->description) {!! $sale->description !!} @else <div class="text-center"> <h3>{{__('message.description is empty')}}</h3> </div> @endif </div> </div> </div> </div> </td> </tr> @endforeach <?php $help = Clone ($sales); $wages = $help->sum('wages'); $cost = $help->sum('cost'); $usd_amount = $help->sum('usd_amount'); $khr_amount = $help->sum('khr_amount'); $thb_amount = $help->sum('thb_amount'); ?> </tbody> </table> </div> </div> </div> @if($sales->hasPages()) <div class="d-flex m-2 p-2" style="justify-content: space-between;align-items: start;width: 20%"> <select id="paginate" name="paginate" class="form-select text-center rounded mr-2 mt-1" aria-label="Default select example" style="width: 90px;font-size: 12px;border: 1px solid rebeccapurple"> <option selected hidden="hidden">{{$paginate}}</option> <option value="25">25</option> <option value="50">50</option> <option value="100">100</option> <option value="250">250</option> <option value="500">500</option> <option value="1000">1000</option> </select> <div class=""> {{ $sales->appends($_GET)->links() }} </div> </div> @endif </div> <div class="col-lg-12 fixed-bottom" style="position: relative;margin-bottom: 0;padding: 0;z-index: 0"> <div class="card-body shadow-lg" style="display: flex;justify-content: end;align-items: center"> <div class="panel-container show table-responsive" style="width: 100%;"> <div class="d-flex flex-column h-100"> <div class="h-auto"> <table class="table table-striped w-100" style="font-size: 14px !important;"> <thead class="bg-fusion-50 text-center" style="background-color: rgba(119,136,153,0.62) !important;"> <tr class=""> <th class="bg-warning-100" style="font-weight: bold">{{__('message.total sale price')}}</th> <th class="bg-secondary-100" style="font-weight: bold;color: black">{{__('message.total cost')}}</th> <th class="bg-secondary-100" style="font-weight: bold;color: black">{{__('message.total cost of sale')}}</th> <th class="bg-primary-100" style="font-weight: bold">{{__('message.total wages sale')}}</th> <th class="bg-primary-100" style="font-weight: bold">{{__('message.total original wage')}}</th> <th class="bg-danger-100" style="color: black;font-weight: bold">{{__('message.total discount')}}</th> <th class="bg-danger-100" style="color: black;font-weight: bold">{{__('message.total price')}}</th> <th class="bg-danger-100" style="color: black;font-weight: bold">{{__('message.total sale product')}}</th> <th class="bg-info-100" style="font-weight: bold">{{__('message.total profit')}}</th> </tr> </thead> <tbody> <tr class="border-bottom text-center" style="background-color: #efe9e9 !important;"> <td class="credit"> {{$currency_->currency_symbol}} {{number_format($total_sale_price+$total_sale_discount , 2)}} </td> <td class="credit">{{$currency_->currency_symbol}} {{number_format($total_sale_cost,2)}}</td> <td class="credit">{{$currency_->currency_symbol}} {{number_format($total_cost_of_sale,2)}}</td> <td class="credit">{{$currency_->currency_symbol}} {{number_format($total_sale_wage,2)}}</td> <td class="credit">{{$currency_->currency_symbol}} {{number_format($total_sale_original_wage,2)}}</td> <td class="credit">{{$currency_->currency_symbol}} {{number_format($total_sale_discount, 2)}}</td> <td class="credit"> {{$currency_->currency_symbol}} {{number_format($total_sale_price, 2)}} </td> <td class="credit"> {{$currency_->currency_symbol}} {{number_format(($total_sale_price+$total_sale_discount)-$total_sale_wage , 2)}} </td> <td class="credit">{{$currency_->currency_symbol}} {{ number_format($total_sale_profit, 2) }}</td> </tr> </tbody> </table> </div> </div> </div> </div> </div> </div> @endsection @section('scripts') @include('app.datepicker-js-config') <script> document.getElementById('printBtn').addEventListener('click', function(e) { e.preventDefault(); const selectedIds = Array.from(document.querySelectorAll('.past_sale_checkbox:checked')) .map(checkbox => checkbox.value); const baseUrl = "{{ route('sale-report.print-total-category') }}"; const startDate = "{{ $start_date }}"; const endDate = "{{ $end_date }}"; const search = "{{ $search }}"; const productCategoryId = "{{ $product_category_id }}"; const checkFixedPrice = "{{ $check_fixed_price }}"; const params = new URLSearchParams({ start_date: startDate, end_date: endDate, search: search, product_category_id: productCategoryId, check_fixed_price: checkFixedPrice, past_sale_ids: selectedIds.join(',') }); // const finalUrl = `${baseUrl}?${params.toString()}`; // Open print page in a new tab or same page // window.open(finalUrl, '_blank'); window.location.href = `${baseUrl}?${params.toString()}`; }); </script> <script> // date earchform strt_date to EndDate $(document).ready(function() { $(".ranges > ul > li").click(function() { setTimeout(function() { $('#search-form').submit(); }, 100); }); $("#datepicker").on("change.dp" , function (){ $("#search-form").submit(); }); }); // date var runDatePicker = function() { // enable clear button $('#datepicker').datepicker({ todayBtn: "linked", clearBtn: true, todayHighlight: true, templates: controls }); } // end date </script> <script> $(document).ready(function() { $("#js-nav-menu").removeClass('active'); $("#js-nav-menu li ul li").removeClass('active'); $("#menu_report_list").addClass('active open'); $("#collapse_report").addClass('collapse in') $("#menu_sale_report").addClass('active') }) </script> @endsection @section('meta') <title>{{ __('message.sale report') }} - {{$settings_->shop_name}}</title> @endsection