{{----}} {{-- @php $hostel = $item->room->hostel; @endphp--}}
--}} {{----}} {{--

{{ auth('backend')->user()->name }}

{{ $hostel->address_text }}
SĐT: {{ $item->room->hostel->getHotlinePhoneAttribute() }}
Ngày in: {{ \Carbon\Carbon::now()->format('d/m/Y') }}

Hóa đơn dịch vụ phòng {{ $item->room->name }}

Kỳ thanh toán: Tháng {{ $item->date_action->format('m/Y') }}
{{----}}
Tên khách hàng: @if($item->contract) {{ $item->contract->name }} - @endif Phòng {{ $item->room->name }}
Địa chỉ: {{ $hostel->address_text }}
--}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{----}} {{--
Số hợp đồng:1234234123423423A
Vị trí:12312
Mã kế toán:ÁA-1A12312
--}} {{--
{{-- --}} {{-- --}} {{-- --}} @php $sum = 0; @endphp @foreach($details as $detail) @php $item = $detail->moneyInfo; $electricPrice = 0; $waterPrice = 0; $hostelFee = \App\Models\HostelFee::where('type', \App\Models\HostelFee::ELECTRIC) ->where('hostel_id', $item->room->hostel->id) ->first(); $hostelFeeWater = \App\Models\HostelFee::where('type', \App\Models\HostelFee::WATER) ->where('hostel_id', $item->room->hostel->id) ->first(); if ($hostelFee) { $electric = \App\Models\ElectricQuota::where('hostel_id', $item->room->hostel->id) ->where('fee_id', $hostelFee->id) ->first(); if(!$electric) { $electric = \App\Models\ElectricQuota::where('hostel_id', $item->room->hostel->id)->first(); } } else { $electric = \App\Models\ElectricQuota::where('hostel_id', $item->room->hostel->id)->first(); // $water = \App\Models\WaterQuota::where('hostel_id', $item->room->hostel->id)->first(); } if($hostelFeeWater) { $water = \App\Models\WaterQuota::where('hostel_id', $item->room->hostel->id) ->where('fee_id', $hostelFeeWater->id) ->first(); if(!$water) { $water = \App\Models\WaterQuota::where('hostel_id', $item->room->hostel->id)->first(); } } else { $water = \App\Models\WaterQuota::where('hostel_id', $item->room->hostel->id)->first(); } if ($electric) { $electricPrice = $electric->price_quota_1; } if($water) { $waterPrice = $water->price_quota_1; } @endphp @php if(!empty($detail->sum_amount)) { $sum+= $detail->sum_amount; } else {$sum+= $detail->amount;} $hostelFee = \App\Models\HostelFee::find($detail->hostel_fee_id); @endphp {{-- --}} {{-- --}} @if(!empty($detail->start_end)) @php $startEnd = $detail->start_end @endphp @else @endif @if($detail->is_electric == true) @if(in_array($hostelFee->type, [\App\Models\HostelFee::ELECTRIC, \App\Models\HostelFee::ELECTRIC_BY_CLOCK, \App\Models\HostelFee::ELECTRIC_DYNAMIC ])) @else @endif @elseif($detail->is_water) @if(in_array($hostelFee->type, [\App\Models\HostelFee::WATER, \App\Models\HostelFee::WATER_BY_CLOCK, \App\Models\HostelFee::WATER_DYNAMIC ])) @else @endif @else @endif @if(!empty($hostelFee)) @if(!in_array($hostelFee->type, [\App\Models\HostelFee::WATER, \App\Models\HostelFee::ELECTRIC])) @if(in_array($hostelFee->type, [ \App\Models\HostelFee::WATER_BY_PEOPLE, \App\Models\HostelFee::WATER_BY_CLOCK, \App\Models\HostelFee::ELECTRIC_BY_PEOPLE, \App\Models\HostelFee::ELECTRIC_BY_CLOCK ])) @if($detail->value > 1) @else @endif @else @endif @else @if($detail->is_electric == true) @elseif($detail->is_water == true) @else @endif @endif @else @endif @if(!empty($detail->sum_amount)) @else @endif @endforeach
Khoản thuNgày tính phíChỉ số điện / nước Số lượng Đơn vị Đơn giá Thành tiền Diễn giải
Từ ngàyĐến ngàyĐầu Cuối Hệ số
{!! nl2br(ucfirst($detail->name)) !!} {{ $item->date_action->startOfMonth()->format('d/m/Y') }}{{ $item->date_action->endOfMonth()->format('d/m/Y') }}{{ $startEnd['start'] }} {{ $startEnd['end'] }} 1 {{ $startEnd['end'] - $startEnd['start'] }}0 0 1 {{ $detail->qty }}kwHngườim3người{{ number_format($detail->value, 0, '.', '.') }}{{ number_format($hostelFee->fee, 0, '.', '.') }}{{ number_format($detail->value, 0, '.', '.') }}{{ number_format($electricPrice, 0, '.', '.') }}{{ number_format($waterPrice, 0, '.', '.') }}1{{ number_format($detail->value, 0, '.', '.') }}{{ number_format($detail->sum_amount, 0, '.', '.') }}{{ number_format($detail->amount, 0, '.', '.') }}{{ $detail->note }}
Tổng cộng {{ number_format($sum, 0, '.', '.') }}
Giảm giá {{ number_format($discount, 0, '.', '.') }}
Đã trả {{ number_format($pay, 0, '.', '.') }}
Còn lại {{ number_format($sum - $pay - $discount, 0, '.', '.') }}
Tổng số tiền phải thanh toán kì này {{ number_format($sum, 0, '.', '.') }}đ
Tổng số tiền đã thanh toán trong kỳ {{ number_format($pay, 0, '.', '.') }}đ
Tổng số tiền còn phải thanh toán {{ number_format($sum - $pay - $discount, 0, '.', '.') }}đ Bằng chữ: {{ $f->format($sum - $pay- $discount) }} đồng
@if(isset($text))
{!! $text !!}
@endif {{----}}