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 : /home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/pdf/reports/stock/ |
Upload File : |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Sales Report</title> @include('backend.pdf.layouts.css') </head> <body > @include('backend.pdf.layouts.report-header') <main> <div id="details" class="clearfix" style="margin-bottom: 15px!important;"> <div id="client"> <h2 class="name">Stock Report</h2> <div class="address"> </div> </div> </div> <table class="table" width="100%" cellspacing="0"> <thead> <tr class="bg-secondary text-white"> <th></th> <th></th> <th> </th> <th> </th> <th></th> <th style="color:white;" colspan="{{$colors->count()+1}}">Stock In Qty</th> <th style="color:white;" colspan="{{$colors->count()+1}}">Sold Qty</th> <th style="color:white;" colspan="{{$colors->count()+1}}">Current Stock</th> </tr> <tr class="bg-secondary text-white"> <th style="color:white;">SL</th> <th style="color:white;">Brand</th> <th style="color:white;">Product Code</th> <th style="color:white;">Product Name</th> <th style="color:white;">Model</th> @foreach($colors as $color) <th style="color:white;">{{$color->color_name}}</th> @endforeach <th style="color:white;"><b>Total</b></th> @foreach($colors as $color) <th style="color:white;">{{$color->color_name}}</th> @endforeach <th style="color:white;"><b>Total</b></th> @foreach($colors as $color) <th style="color:white;">{{$color->color_name}}</th> @endforeach <th style="color:white;"><b>Total</b></th> </tr> </thead> <tbody> @php $i=1;$sin_arr=array();$sin_total=0;$sold_arr=array();$sold_total=0;$cu_arr=array();$cu_total=0; @endphp @if($stock_type == 'low') @foreach($chalans as $chalan) @if($chalan->barcodes->sum('quantity') > 0 && $chalan->barcodes->sum('quantity') <= $minstock || $chalan->barcodes->sum('quantity') == 0) @if($chalan->barcodes->sum('quantity') > 0 && $chalan->barcodes->sum('quantity') <= $minstock) <tr> @elseif($chalan->barcodes->sum('quantity') == 0) <tr> @else <tr> @endif <td>{{$i}}</td> <td>{{$chalan->brand->brand_name}}</td> <td>{{$chalan->product_code}}</td> <td>{{$chalan->product_name}}</td> <td>{{$chalan->model->model_name}}</td> @php $total=0; @endphp @foreach($colors as $color) <td> @php $q= $chalan->stock_colors->where('color_id',$color->color_id)->whereBetween('stock_date', [date('Y-m-d H:i:s',strtotime($start_date)), date('Y-m-d H:i:s',strtotime($end_date))])->sum('product_quantity'); $exstr=$chalan->stock_colors->where('color_id',$color->color_id)->whereBetween('stock_date', [date('Y-m-d H:i:s',strtotime($start_date)), date('Y-m-d H:i:s',strtotime($end_date))]); $m=0; if(isset($exstr[0])){ $m=$exstr[0]->stock->doa ? $chalan->stock_colors[0]->stock->doa->details->where('product_id',$chalan->product_id)->where('color_id',$color->color_id)->sum('missing') : 0; } $total += $q-$m; if(!isset($sin_arr[$color->color_id])){ $sin_arr[$color->color_id]=0; } $sin_arr[$color->color_id] += $q-$m; @endphp {{$q-$m}} </td> @endforeach <td >{{$total}}</td> @php $sin_total += $total; $total2=0; @endphp @foreach($colors as $color) <td> @php $q= $chalan->chalan_details->where('color_id',$color->color_id)->whereBetween('chalan_date', [date('Y-m-d H:i:s',strtotime($start_date)), date('Y-m-d H:i:s',strtotime($end_date))])->sum('product_quantity'); $exstr=$chalan->return_details->where('color_id',$color->color_id)->whereBetween('central_return_date', [date('Y-m-d H:i:s',strtotime($start_date)), date('Y-m-d H:i:s',strtotime($end_date))]); $m=0; if(isset($exstr[0])){ $m=$exstr->sum('quantity'); } if(!isset($sold_arr[$color->color_id])){ $sold_arr[$color->color_id]=0; } $c_q =0; if($q != 0){ $sold_arr[$color->color_id] += $q-$m; $total2 += $q-$m; $c_q = $q-$m; } @endphp {{$c_q}} </td> @endforeach <td >{{$total2}}</td> @php $sold_total += $total2;$total3=0; @endphp @foreach($colors as $color) <td> @php $q= $chalan->barcodes->where('color_id',$color->color_id)->sum('quantity'); if(!isset($cu_arr[$color->color_id])){ $cu_arr[$color->color_id]=0; } $cu_arr[$color->color_id] += $q; $total3 += $q; @endphp {{$q}} </td> @endforeach <td >{{$total3}}</td> </tr> @php $cu_total += $total3;$i++; @endphp @endif @endforeach @else @foreach($chalans as $chalan) @if($chalan->barcodes->sum('quantity') > 0 && $chalan->barcodes->sum('quantity') <= $minstock) <tr> @elseif($chalan->barcodes->sum('quantity') == 0) <tr> @else <tr> @endif <td >{{$i}}</td> <td >{{$chalan->brand->brand_name}}</td> <td >{{$chalan->product_code}}</td> <td>{{$chalan->product_name}}</td> <td>{{$chalan->model->model_name}}</td> @php $total=0; @endphp @foreach($colors as $color) <td> @php $q= $chalan->stock_colors->where('color_id',$color->color_id)->whereBetween('stock_date', [date('Y-m-d H:i:s',strtotime($start_date)), date('Y-m-d H:i:s',strtotime($end_date))])->sum('product_quantity'); $exstr=$chalan->stock_colors->where('color_id',$color->color_id)->whereBetween('stock_date', [date('Y-m-d H:i:s',strtotime($start_date)), date('Y-m-d H:i:s',strtotime($end_date))]); $m=0; if(isset($exstr[0])){ $m=$exstr[0]->stock->doa ? $chalan->stock_colors[0]->stock->doa->details->where('product_id',$chalan->product_id)->where('color_id',$color->color_id)->sum('missing') : 0; } $total += $q-$m; if(!isset($sin_arr[$color->color_id])){ $sin_arr[$color->color_id]=0; } $sin_arr[$color->color_id] += $q-$m; @endphp {{$q-$m}} </td> @endforeach <td >{{$total}}</td> @php $sin_total += $total; $total2=0; @endphp @foreach($colors as $color) <td> @php $q= $chalan->chalan_details->where('color_id',$color->color_id)->whereBetween('chalan_date', [date('Y-m-d H:i:s',strtotime($start_date)), date('Y-m-d H:i:s',strtotime($end_date))])->sum('product_quantity'); $exstr=$chalan->return_details->where('color_id',$color->color_id)->whereBetween('central_return_date', [date('Y-m-d H:i:s',strtotime($start_date)), date('Y-m-d H:i:s',strtotime($end_date))]); $m=0; if(isset($exstr[0])){ $m=$exstr->sum('quantity'); } if(!isset($sold_arr[$color->color_id])){ $sold_arr[$color->color_id]=0; } $c_q =0; if($q != 0){ $sold_arr[$color->color_id] += $q-$m; $total2 += $q-$m; $c_q = $q-$m; } @endphp {{$c_q}} </td> @endforeach <td >{{$total2}}</td> @php $sold_total += $total2;$total3=0; @endphp @foreach($colors as $color) <td> @php $q= $chalan->barcodes->where('color_id',$color->color_id)->sum('quantity'); if(!isset($cu_arr[$color->color_id])){ $cu_arr[$color->color_id]=0; } $cu_arr[$color->color_id] += $q; $total3 += $q; @endphp {{$q}} </td> @endforeach <td >{{$total3}}</td> </tr> @php $cu_total +=$total3; $i++; @endphp @endforeach @endif <tr > <td colspan="5" style="text-align:right;"><strong>Total:</strong></td> @foreach($colors as $color) <td><strong>{{$sin_arr[$color->color_id]}}</strong></td> @endforeach <td><strong>{{$sin_total}}</strong></td> @foreach($colors as $color) <td><strong>{{$sold_arr[$color->color_id]}}</strong></td> @endforeach <td><strong>{{$sold_total}}</strong></td> @foreach($colors as $color) <td><strong>{{$cu_arr[$color->color_id]}}</strong></td> @endforeach <td><strong>{{$cu_total}}</strong></td> </tr> </tbody> </table> </main> @include('backend.pdf.layouts.footer') </body> </html>