@foreach($bills as $bill) @php $grandAlount = $bill->grandtotal; $ceilAmount = ceil($grandAlount); $floorAmount = floor($grandAlount); $roundValue = $ceilAmount - $grandAlount; $fuelAmount = ($bill->amount * $bill->fchpercent)/100; $totAmount = $bill->amount + $fuelAmount; $parcels = DB::table('bills as bl') ->leftJoin('parcels as p','p.client_id','=','bl.clientid') ->leftJoin('receivers as r','r.id','=','p.receiver_id') ->where(['bl.id'=>$bill->id, 'p.bill_id'=>$bill->id, 'p.is_international'=>0, 'bl.branch_id'=>$branchId]) ->where(DB::raw('DATE_FORMAT(p.date,"%Y-%m")'), '=', DB::raw("'$month'")) ->select([DB::raw('SUM(p.net_amt) as total_amount')])->get(); $all_parcels = DB::table('bills as bl') ->leftJoin('parcels as p','p.client_id','=','bl.clientid') ->leftJoin('receivers as r','r.id','=','p.receiver_id') ->leftJoin('centers as c','c.id','=','p.center_id') ->leftJoin('carriers as car','car.id','=','p.carrier_id') ->leftJoin('clients as clnt','clnt.id','=','bl.clientid') ->leftJoin('default_packagetypes as dp','dp.id','=','p.package_type') ->where(['bl.id'=>$bill->id, 'p.bill_id'=>$bill->id, 'p.is_international'=>0, 'bl.branch_id'=>$branchId]) ->where(DB::raw('DATE_FORMAT(p.date,"%Y-%m")'), '=', DB::raw("'$month'")) ->select([ 'p.net_amt', 'p.weight', 'dp.name as dp_name', 'p.consignment_no', 'r.name as receiver_name', 'c.name as city_name', 'p.remakrs', 'car.name as carrier_name', 'p.date', 'p.insurance_amt', 'clnt.weight_in_mails as clientWeight', 'clnt.charge_in_mails as clientCharge', ])->orderBy('p.date')->orderBy('p.consignment_no')->get(); $final_value = number_format((double)($parcels[0]->total_amount - $bill->amount), 2); if($final_value > 0){ $value = 'Positive'; }else{ $value = 'Negative'; } sleep(2); @endphp

{{@$branch['name']}}

{{@$branch['address']}}, {{@$branch['city']}} - {{@$branch['zipcode']}}

MOBILE : {{@$branch['contact_no']}}

EMAIL : {{@$branch_email}}

Place of Service:

{{$bill->name}}

{{@$bill->address1.' '.@$bill->address2.' '.@$bill->city}}

GSTIN : {{@$bill->gstno}} State Code : {{ (@$bill->gstno) ? substr(@$bill->gstno,0,2) : '' }}

TAX INVOICE Original for recipient
Bill No. : @php $generator = new \Picqer\Barcode\BarcodeGeneratorPNG(); @endphp {{-- --}} barcode

{{$bill->billno}}

Bill Date : {{date("d-M-y", strtotime($bill->created_at))}} Duration : {{strtoupper(date("d-M-y", strtotime($bill->start_date)))}} ~ {{strtoupper(date("d-M-y", strtotime($bill->end_last)))}}

GSTIN : {{@$branch['gstno']}} State Code : {{ (@$branch['gstno']) ? substr(@$branch['gstno'],0,2) : '' }}

SAC : 996812 P.A.N. : {{@$branch['pancard']}}

@if(count($all_parcels) > 0) @php $previousDate = ''; $skipDate = false; @endphp @foreach($all_parcels as $parcels) @php $checkDate = strtotime(@$parcels->date); if ($previousDate != '' && $previousDate == $checkDate) { $skipDate = true; } else { $skipDate = false; $previousDate = $checkDate; } @endphp @if($skipDate == false) @endif @endforeach
Name of Consignee Destination Remarks Ref. No Type Consignment No Weight Charges
Booking Date : {{date("d-M-Y", strtotime(@$parcels->date))}}
{{@$parcels->receiver_name}} {{@$parcels->city_name}} {{@$parcels->remakrs}} {{@$parcels->dp_name}} {{@$parcels->consignment_no}} {{@$parcels->weight}} gms {{Laracore::showPrice(@$parcels->net_amt)}}
@endif
BANK DETAILS
  • Bank Name :{{@$branch['bank_address']}}
  • Account No :{{@$branch['bank_acno']}}
  • IFSCode :{{@$branch['ifsc_code']}}
  • MICRCode :{{@$branch['micr_code']}}
Total Consignments: {{count($all_parcels)}}

Abbreviations

  • PA :Parcel By Air
  • ES :Express Service
  • PC :Parcel By Surface
  • D :Document

Amount in Words: {{$roundValue < 0.50 ? getIndianCurrency($ceilAmount) : getIndianCurrency($floorAmount)}}.

  • Gross Total :{{Laracore::showPrice($bill->amount)}}
  • Fuel Charges :{{Laracore::showPrice(($bill->amount * $bill->fchpercent)/100)}}
  • Total Taxable Value :{{Laracore::showPrice($totAmount)}}
  • CGST: ({{$bill->cgstpercent}}) %{{Laracore::showPrice(($totAmount * $bill->cgstpercent)/100)}}
  • SGST: ({{$bill->sgstpercent}}) %{{Laracore::showPrice(($totAmount * $bill->sgstpercent)/100)}}
  • @if($bill->igstpercent > 0)
  • IGST: ({{$bill->igstpercent}}) %{{Laracore::showPrice(($totAmount * $bill->igstpercent)/100)}}
  • @endif
  • Net Amount :{{$roundValue < 0.50 ? Laracore::showPrice($ceilAmount) : Laracore::showPrice($floorAmount)}}
@endforeach