@extends('_version_02.commons.layouts.admin') @section('content') {!! Form::model($model, ['class'=>'form-horizontal','method'=>'get']) !!}
{{App\Language::trans('Filter By')}}

{!! Form::label('leaf_house_id', App\Language::trans('Date Range'), ['class'=>'control-label col-md-4']) !!}
{!!$errors->first('leaf_house_id', '')!!}
{!! Form::label('leaf_house_id', App\Language::trans('Unit No.'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('leaf_house_id', App\PowerMeterModel\MeterRegister::houses_combobox(), null, ['class'=>'form-control','required','onchange'=>'init_room_combobox(this)']) !!} {!!$errors->first('leaf_house_id', '')!!}
{!! Form::label('leaf_room_id', App\Language::trans('Room No.'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('leaf_room_id', App\PowerMeterModel\MeterRegister::rooms_combobox((old('leaf_house_id') ? old('leaf_house_id'):$model->leaf_house_id)), null, ['class'=>'form-control','onchange'=>'init_room_status(this)']) !!} {!!$errors->first('leaf_room_id', '')!!}
{!! Form::label('export_by', App\Language::trans('Exported By'), ['class'=>'control-label col-md-4']) !!}
{!!$errors->first('export_by', '')!!}
@include('_version_02.commons.layouts.partials._form_floating_footer_report') {!! Form::close() !!} @if(count($listing) > 0)
{{App\Language::trans('Result')}}

@php ini_set('max_execution_time', 0); $total = 0; $sub_total = 0; $grand_total = 0; $total_payable_amount = 0 ; $setting = new App\Setting(); @endphp @foreach($houses_detail as $house) @php $total = 0; @endphp @foreach($house['house_rooms'] as $room) @if($leaf_room_id !=0) @if($room['id_house_room'] != $leaf_room_id) @php continue; @endphp @endif @endif @php $sub_total = 0; $isMeterRegister = false; $isFirstRoomHeader = true; $rowNo = 0; $index = 0; $reading_data = isset($listing[$room['meter']['id']]) ? $listing[$room['meter']['id']] : array(); @endphp @foreach($reading_data as $row) @if($row->meter_register_id == $room['meter']['id']) @if($isFirstRoomHeader == true) @endif @php $payable_amount = App\Setting::calculate_utility_fee($row->total_usage); $isFirstRoomHeader = false; $isMeterRegister = true; $total_payable_amount += $payable_amount; @endphp @php $total += $row->current_usage; $sub_total += $row->current_usage; $grand_total += $row->current_usage; $index++; @endphp @endif @endforeach @if($isMeterRegister == false) @else @endif @php $isMeterRegister = false; @endphp @endforeach @endforeach

# {{App\Language::trans('Date')}} {{App\Language::trans('From Time')}} {{App\Language::trans('To Time')}} {{App\Language::trans('Last Meter Reading')}} {{App\Language::trans('Current Meter Reading')}} {{App\Language::trans('Current Usage')}}
{{App\Language::trans('Unit')}} : {{$house['house_unit']}}
{{App\Language::trans('Room') . ' : ' . $room['house_room_name']}} {{App\Language::trans('Meter Id').' : '.$room['meter']['id']}}
{{($index + 1)}} {{$setting->convert_encoding($setting->getDate($row->current_date))}} {{$setting->convert_encoding($row->time_started)}} {{$setting->convert_encoding($row->time_ended)}} {{$setting->convert_encoding($row->last_meter_reading)}} {{$setting->convert_encoding($row->current_meter_reading)}} {{$setting->convert_encoding($row->current_usage)}}
{{App\Language::trans('Room') . " " . $room['house_room_name']}} {{App\Language::trans(App\Setting::SUNWAY_NO_METER_FOUND_LABEL)}}
{{$setting->convert_encoding(App\Language::trans('Sub-total')) . ' : '}} {{$setting->convert_encoding($setting->getDouble($sub_total))}}
{{App\Language::trans('Total')}}: {{number_format($grand_total, 2)}}
@elseif(count($listing) == 0 && $is_search_result == true) @include('_version_02.commons.report_modules.no_data_found') @endif @stop @section('script') @stop