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/exports/ |
Upload File : |
<table style="table-layout: auto;widtd: 100%;"> <thead> @if($companyInfo) <tr><td colspan="{{$colors->count()*3+5}}" style="text-align: center;"> {{$companyInfo->company_name ? $companyInfo->company_name: "MAKTEL LIMITED"}}</td></tr> <tr><td colspan="{{$colors->count()*3+5}}" style="text-align: center;"> {{$companyInfo->company_address ? $companyInfo->company_address : "House-277(Level-4),Lane-4,Baridhara DOHS,Dhaka-1206."}}</td></tr> <tr><td colspan="{{$colors->count()*3+5}}" style="text-align: center;"> Hotline: +{{$companyInfo->company_phone ? $companyInfo->company_phone: "88 01844241530"}}</td></tr> <tr><td colspan="{{$colors->count()*3+5}}" style="text-align: center;"> Email: {{$companyInfo->company_email ? $companyInfo->company_email : "info@maktel.com.bd"}}</td></tr> <tr><td colspan="{{$colors->count()*3+5}}" style="text-align: center;"> Web: {{$companyInfo->company_website ? $companyInfo->company_website : "www.maktel.com.bd"}}</td></tr> <tr><td colspan="{{$colors->count()*3+5}}" style="text-align: center;">Facebook: {{$companyInfo->company_facebook ? $companyInfo->company_facebook : "www.facebook.com/maktel"}}</td></tr> @else <tr><td colspan="{{$colors->count()+5}}">MAKTEL LIMITED</td></tr> <tr><td colspan="{{$colors->count()+5}}">House-277(Level-4),Lane-4,Baridhara DOHS,Dhaka-1206.</td></tr> <tr><td colspan="{{$colors->count()+5}}">Hotline:+88 01844241530</td></tr> <tr><td colspan="{{$colors->count()+5}}">Email:info@maktel.com.bd</td></tr> <tr><td colspan="{{$colors->count()+5}}">Web:www.maktel.com.bd</td></tr> <tr><td colspan="{{$colors->count()+5}}">Facebook:www.facebook.com/maktel</td></tr> @endif <tr > <th></th> <th></th> <th> </th> <th> </th> <th></th> <th colspan="{{$colors->count()+1}}">Stock In Qty</th> <th colspan="{{$colors->count()+1}}">Sold Qty</th> <th colspan="{{$colors->count()+1}}">Current Stock</th> </tr> <tr> <th>SL</th> <th>Brand</th> <th>Product Code</th> <th>Product Name</th> <th>Model</th> @foreach($colors as $color) <th>{{$color->color_name}}</th> @endforeach <th><b>Total</b></th> @foreach($colors as $color) <th>{{$color->color_name}}</th> @endforeach <th><b>Total</b></th> @foreach($colors as $color) <th>{{$color->color_name}}</th> @endforeach <th><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>