@foreach($bills as $bill) @php $isNewBill = isset($bill->rounding_amount) && !is_null($bill->rounding_amount) && $bill->rounding_amount != 0; if ($isRoundingEnabled) { if ($isNewBill) { $finalGrandTotal = $bill->grandtotal; $roundValue = $bill->rounding_amount; } else { $grandAmount = $bill->grandtotal; $ceilAmount = ceil($grandAmount); $floorAmount = floor($grandAmount); $roundValue = $ceilAmount - $grandAmount; $finalGrandTotal = ($roundValue > 0 && $roundValue <= 0.50) ? $ceilAmount : $floorAmount; } } else { $finalGrandTotal = $isNewBill ? $bill->grandtotal - $bill->rounding_amount : $bill->grandtotal; $roundValue = 0; } $billAmount = $bill->amount; $serviceChAmount = ($billAmount * $bill->service_charge_percent)/100; $amountAndService = $billAmount + $serviceChAmount; $fuelAmount = ($amountAndService * $bill->fchpercent)/100; $otherChAmount = $bill->other_charge; $totAmount = $amountAndService + $fuelAmount + $otherChAmount; $billitems = DB::table('bill_item_preferences')->where(['client_id'=>$bill->client_id])->where(['branch_id'=>$branchId])->select(['bill_item'])->first(); $billitempreferences = ''; if ($billitems !="" || $billitems != NULL || $billitems != null) { $billitempreferences = json_decode($billitems->bill_item, true); } else { $billitems = DB::table('bill_item_preferences')->where(['client_id'=>'0'])->where(['branch_id'=>$branchId])->select(['bill_item'])->first(); $billitempreferences = json_decode($billitems->bill_item, true); } $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]) ->whereBetween('p.date', array($bill->start_date, $bill->end_last)) ->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, 'is_period'=>1]) ->whereBetween('p.date', array($bill->start_date, $bill->end_last)) ->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 = number_format((double)($parcels[0]->total_amount - $bill->amount), 2); if($final_value > 0){ $value = 'Positive'; }else{ $value = 'Negative'; } sleep(1); @endphp @if($billitempreferences['logo'] == 1 && $billitempreferences['address'] == 1) @endif @if($branch['bill_terms_and_conditions'] != '') @endif
@if($branch['image'] != '' || $branch['image'] != null) logo @endif {{strtoupper(@$branch['name'])}}

{{@$branch['address']}} {{@$branch['city']}} {{@$branch['zipcode']}} -- PH No: {{@$branch['contact_no']}}

{{$bill->name}} {{@$bill->address1.' '.@$bill->address2.' '.@$bill->city}} TAX INVOICE Bill NO. : {{$bill->billno}} Date : {{date("d/m/Y", strtotime($bill->created_at))}} Bill Period : {{date("d/m/Y", strtotime($bill->start_date))}} To {{date("d/m/Y", strtotime($bill->end_last))}}
{{-- --}} @foreach($all_parcels as $parcel) {{-- --}} @endforeach
Date Doc No Type Party Name Remark Center Weight Amount
{{date("d/m/y", strtotime(@$parcel->date))}} {{@$parcel->consignment_no}} {{@$parcel->dp_name}} {{@$parcel->receiver_name}}{{@$parcel->remakrs}}{{@$parcel->city_name}} {{@$parcel->weight}} {{Laracore::showPrice(@$parcel->net_amt)}}

SAC Code : 996812

@if(isset($branch['msme_no']) && $branch['msme_no'] != '')

MSME No : {{$branch['msme_no']}}

@endif Type Of Service

COURIER SERVICES

BANK DETAILS

Bank: {{@$branch['bank_address']}}

{{--

Branch: PANVEL-410206

--}}

A/c.No.: {{@$branch['bank_acno']}}

IFS Code: {{@$branch['ifsc_code']}}

@if($value == 'Positive') @endif @if($bill->service_charge_percent > 0) @endif @if($roundValue > 0 && $roundValue <= 0.50) @endif
Gross Amount: {{Laracore::showPrice($parcels[0]->total_amount)}}
Discount: - {{Laracore::showPrice($parcels[0]->total_amount - $bill->amount)}}
Service .Ch. : {{$bill->service_charge_percent}}% {{Laracore::showPrice($serviceChAmount)}}
Fuel SurCharge : {{$bill->fchpercent}}% {{Laracore::showPrice($fuelAmount)}}
Net Taxable Amount {{Laracore::showPrice($totAmount)}}
Round Of {{Laracore::showPrice($roundValue)}}
Bill Amount : {{ Laracore::showPrice($finalGrandTotal) }}
{{ getIndianCurrency($finalGrandTotal) }}...
@if($digital_signature == 1) @elseif($digital_signature == 2 && $branch['stamp'] != '') @else @endif @if($branch['payment_qr_code']) @endif

Note : Cheque should be issued in the name of

{{strtoupper(@$branch['name'])}}

Please make the payment with in 7 days from the receipt of

the bill

Digitally signed by {{strtoupper(@$branch['name'])}}

Date: {{date("d/m/Y", strtotime($bill->created_at))}}
Location: {{@$branch['city']}}
For, {{strtoupper(@$branch['name'])}}

Stamp

For, {{strtoupper(@$branch['name'])}}

Propritor

Payment QR Code
 
Terms and Conditions
    @php $termsAndConditionsArr = explode("\n", str_replace("\r", "", @$branch['bill_terms_and_conditions'])); @endphp @foreach($termsAndConditionsArr as $termsAndConditions)
  • {{$termsAndConditions}}
  • @endforeach
@endforeach