Server : Apache System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 User : vapecompany ( 2719) PHP Version : 7.4.33 Disable Function : NONE Directory : /proc/thread-self/root/home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/pdf/reports/sells/ |
Upload File : |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Sells Report</title> @include('backend.pdf.layouts.css') </head> <body > @include('backend.pdf.layouts.report-header') <main> <div id="details" class="clearfix"> <div id="client"class="mt-10"> <h2 class="name">Target vs Achievement Report</h2> <div class="address"> @if($s_date == $ss_date && $e_date == $ee_date) {{\Carbon\Carbon::parse($s_date.'-'.$e_date.'-01')->format('F , Y')}} @else {{\Carbon\Carbon::parse($s_date.'-'.$e_date.'-01')->format('F , Y')}} To {{\Carbon\Carbon::parse($ss_date.'-'.$ee_date.'-01')->format('F , Y')}} @endif </div> </div> </div> <table class="table" width="100%" cellspacing="0"> <thead> <tr class="bg-secondary text-white"> <th style="color:white;">SL</th> <th style="color:white;">Month</th> <th style="color:white;">Employee Name</th> <th style="color:white;">Designation</th> <th style="color:white;">Region</th> <th style="color:white;">Division</th> <th style="color:white;">District</th> <th style="color:white;">Target Product</th> <th style="color:white;">Target Quantity</th> <th style="color:white;">Total Target Quantity</th> <th style="color:white;">Target Value</th> <th style="color:white;">Total Target Value</th> <th style="color:white;">Sales Quantity</th> <th style="color:white;">Total Sales Quantity</th> <th style="color:white;">Sales Value</th> <th style="color:white;">Total Sales Value</th> <th style="color:white;">Progress</th> </tr> </thead> <tbody> @foreach($sales_target as $sales) @php $m=str_split($sales->month,4); $d=date('M',strtotime($m[0].'-'.$m[1].'-01')); @endphp @foreach($sales->details as $k=>$detail) @php if($detail->target_quantity > $detail->sales_quantity){ $percentage=($detail->sales_quantity/$detail->target_quantity)*100; }else{ $percentage=100; } @endphp @if($k == 0) <tr > @else <tr> @endif @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{$sales->sale_target_id}}</td> <td rowspan="{{$sales->details->count()}}">{{$d.','.$m[0]}}</td> <td rowspan="{{$sales->details->count()}}">{{$sales->employee->employee_name}}</td> <td rowspan="{{$sales->details->count()}}">{{$sales->designation ? $sales->designation->designation_name : ''}}</td> <td rowspan="{{$sales->details->count()}}">{{$sales->region->region_name}}</td> <td rowspan="{{$sales->details->count()}}">@php $c=json_decode($sales->division_id); $division=""; $i=0; foreach ($c as $key => $value) { if($i == 0){ $division .= \App\Models\Division::where('division_id',$value)->first()->division_name; }else{ $division .= ','; $division .=\App\Models\Division::where('division_id',$value)->first()->division_name; } $i++; } @endphp {{$division}}</td> <td rowspan="{{$sales->details->count()}}">@php $c=json_decode($sales->district); $district=""; $i=0; foreach ($c as $key => $value) { if($i == 0){ $district .= \App\Models\District::where('district_id',$value)->first()->district_name; }else{ $district .= ','; $district .=\App\Models\District::where('district_id',$value)->first()->district_name; } $i++; } @endphp {{$district}} </td> @endif <td >{{$detail->product->product_name}}</td> <td>{{$detail->target_quantity}}</td> @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{$sales->details->sum('target_quantity')}}</td> @endif <td>{{number_format($detail->target_amount,2)}}</td> @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{number_format($sales->details->sum('target_amount'),2)}}</td> @endif <td>{{$detail->sales_quantity}}</td> @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{$sales->details->sum('sales_quantity')}}</td> @endif <td>{{number_format($detail->sales_amount,2)}}</td> @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{number_format($sales->details->sum('sales_amount'),2)}}</td> @endif <td> <div class="bar-one bar-con"> <div class="bar" data-percent="{{$percentage}}">{{$percentage}}%</div> </div> </td> </tr> @endforeach @endforeach </tbody> </table> </main> @include('backend.pdf.layouts.footer') </body> </html>