@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; } $fuelAmount = ($bill->amount * $bill->fchpercent)/100; $totAmount = $bill->amount + $fuelAmount; $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]) ->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', 'dp.weight_type as weight_type', 'p.consignment_no', 'p.number_of_box', '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(); $totalAmount = isset($parcels[0]) ? $parcels[0]->total_amount : 0; $grandAlount = $bill->grandtotal; $final_value = number_format((double)($totalAmount - $bill->amount), 2); if ($final_value > 0) { $value = 'Positive'; } else { $value = 'Negative'; } sleep(2); @endphp @if($billitempreferences['logo'] == 1 && $billitempreferences['address'] == 1) @endif @if($digital_signature == 1) @elseif($digital_signature == 2 && $branch['stamp'] != '') @else @endif @if($branch['bill_terms_and_conditions'] != '') @endif
logo

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

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

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

EMAIL : {{@$branch_email}}

{{--

WEB: {{@$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
Invoice No : {{-- @php $generator = new \Picqer\Barcode\BarcodeGeneratorPNG(); @endphp --}} {{-- barcode --}}

{{$bill->billno}}

INVOICE 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 $key => $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 Consignment No Type Weight Charges
Booking Date : {{date("d-M-Y", strtotime(@$parcels->date))}}
{{@$parcels->receiver_name}} {{@$parcels->city_name}} {{@$parcels->remakrs}} {{@$parcels->consignment_no}} {{@$parcels->dp_name}} {{@$parcels->weight}} {{strtoupper(@$parcels->weight_type)}} @if($parcels->number_of_box != null)
({{$parcels->number_of_box}} Box)
@endif
{{Laracore::showPrice(@$parcels->net_amt)}}
@endif
@if(isset($branch['msme_no']) && $branch['msme_no'] != '') @endif
bank details
Bank Name {{@$branch['bank_address']}}
Account No {{@$branch['bank_acno']}}
IFSC Code {{@$branch['ifsc_code']}}
MICRCode {{@$branch['micr_code']}}
MSME No {{$branch['msme_no']}}

Total Consignments : {{count($all_parcels)}}

Abbreviations

PA : Parcel By Air

ES : Express Service

PC : Parcel By Surface

D : Document

@if($value == 'Positive') @endif @if($bill->igstpercent > 0) @endif
Gross Total: {{Laracore::showPrice($bill->amount)}}
Discount: - {{ Laracore::showPrice($totalAmount - $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)}}
IGST: {{$bill->igstpercent}}% {{Laracore::showPrice(($totAmount * $bill->igstpercent)/100)}}
Amount in Words : {{ getIndianCurrency($finalGrandTotal) }}.

Net Amount:

{{ Laracore::showPrice($finalGrandTotal) }}

Please make payments in favor of {{@$branch['name']}} @if($digital_signature != 1) FOR, {{@$branch['name']}} @endif
@if(@$branch['payment_qr_code']) Payment code @endif

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

Date: {{date("d/m/Y", strtotime($bill->created_at))}}
Location: {{@$branch['city']}}
@if(@$branch['payment_qr_code']) Payment code @endif Stamp
@if(@$branch['payment_qr_code']) Payment code @endif
Authorized Signature
 

Terms and Conditions

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