@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', 'car.name as carrier_name', 'p.date', 'p.insurance_amt', 'p.remakrs', 'clnt.weight_in_mails as clientWeight', 'clnt.charge_in_mails as clientCharge', ])->orderBy('p.date')->orderBy('p.consignment_no')->get(); $final_value = ($parcels[0]->total_amount - $bill->amount); if($final_value > 0){ $value = 'Positive'; }else{ $value = 'Negative'; } sleep(1); @endphp

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

Franchisee Of SHREE MAHAVIR EXPRESS SERVICES PVT. LTD.

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

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

Tax Invoice

Name: {{$bill->name}}

GTS Number:

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

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

Pan no:

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

Bill No:

{{$bill->billno}}

Bill Date:

{{date("d/m/Y", strtotime($bill->created_at))}}

A/c GST Number:  {{@$bill->gstno}}

Bill Duration:

{{strtoupper(date("d/m/Y", strtotime($bill->start_date)))}} To {{strtoupper(date("d/m/Y", strtotime($bill->end_last)))}}

@if(count($all_parcels) > 0) @php $total_booking_amount = 0; @endphp @foreach($all_parcels as $parcels) @php $total_booking_amount = $total_booking_amount+ @$parcels->net_amt; @endphp @endforeach
Date Receiver Destination Cons. No. Remark Weight Amout
{{date("d/m/y", strtotime(@$parcels->date))}} {{@$parcels->receiver_name}} {{@$parcels->city_name}} {{@$parcels->consignment_no}} {{@$parcels->remakrs}} {{@$parcels->weight}} {{Laracore::showPrice(@$parcels->net_amt)}}
@endif @if($bill->igstpercent > 0) @endif @if($roundValue != '0' && $roundValue < 0.50) @endif
Gross Amount: {{Laracore::showPrice($total_booking_amount)}}
Fuel Surcharge: {{$bill->fchpercent}}% {{Laracore::showPrice(($bill->amount * $bill->fchpercent)/100)}}
Net Taxable Amount: {{Laracore::showPrice($totAmount)}}
SGST / UT.GST Tax: {{$bill->sgstpercent}}% {{Laracore::showPrice(($totAmount * $bill->sgstpercent)/100)}}
CGST Tax: {{$bill->cgstpercent}}% {{Laracore::showPrice(($totAmount * $bill->cgstpercent)/100)}}
IGST Tax: {{$bill->igstpercent}}% {{Laracore::showPrice(($totAmount * $bill->igstpercent)/100)}}
Round Of: {{Laracore::showPrice($roundValue)}}
Bill Amount: {{$roundValue < 0.50 ? Laracore::showPrice($ceilAmount) : Laracore::showPrice($floorAmount)}}
Rupees: {{$roundValue < 0.50 ? getIndianCurrency($ceilAmount) : getIndianCurrency($floorAmount)}}
SAC Code: 996812 -- Type of Service: Courier Services For, {{@$branch['name']}}
Remark :
Please Make Payment in favour of
{{@$branch['name']}} Authorised Signature
@endforeach