@extends('layouts.report_pdf') @section('title') {{__('Discounts report')}}-{{date('Y-m-d')}} @endsection @section('content')
{{-- --}} {{__('Discounts report')}} {{__('Date')}} : {{date('Y-m-d H:i')}}
{{__('Date range')}} : {{date('Y-m-d H:i',strtotime($data['from']))}} - {{date('Y-m-d H:i',strtotime($data['to']))}}
@if(count($data['invoices'])&&request()->has('print.invoices')) @foreach($data['invoices'] as $invoice) @endforeach
{{__('Invoices')}}
# {{__('Status')}} {{__('Branch')}} {{__('Created by')}} {{__('Date')}} {{__('Patient Name')}} {{__('Referral')}} {{__('Laboratory')}} {{__('Contract')}} {{__('Subtotal')}} {{__('Discount')}} {{__('Total')}} {{__('Paid')}} {{__('Due')}} {{__('Discount note')}}
{{$invoice['id']}} @if($invoice['canceled']) @else @endif @if(isset($invoice['branch'])) {{$invoice['branch']['name_'.app()->getLocale()]}} @endif @if(isset($invoice['created_by_user'])) {{$invoice['created_by_user']['name']}} @elseif(isset($invoice['created_by_laboratory'])) {{$invoice['created_by_laboratory']['name']}} @elseif(isset($invoice['created_by_contract'])) {{$invoice['created_by_contract']['name']}} @elseif(isset($invoice['created_by_referral'])) {{$invoice['created_by_referral']['name']}} @endif {{date('Y-m-d H:i',strtotime($invoice['created_at']))}} @if(isset($invoice['patient'])) {{$invoice['patient']['name']}} @endif @if(isset($invoice['referral'])) {{$invoice['referral']['name']}} @endif @if(isset($invoice['from_laboratory'])) {{$invoice['from_laboratory']['name']}} @endif @if(isset($invoice['contract'])) {{$invoice['contract']['name']}} @endif {{format_money($invoice['subtotal'])}} {{format_money($invoice['discount_total'])}} {{format_money($invoice['total'])}} {{format_money($invoice['paid'])}} {{format_money($invoice['due'])}} @if(isset($invoice['discount_note'])) {{$invoice['discount_note']['name']}} @endif
{{__('Summary')}} {{format_money($data['invoices']->where('canceled',false)->sum('subtotal'))}} {{format_money($data['invoices']->where('canceled',false)->sum('discount_total'))}} {{format_money($data['invoices']->where('canceled',false)->sum('total'))}} {{format_money($data['invoices']->where('canceled',false)->sum('paid'))}} {{format_money($data['invoices']->where('canceled',false)->sum('due'))}}
@endif @if(count($data['discount_notes'])&&request()->has('print.discount_notes')) @foreach($data['discount_notes'] as $discount_note) @endforeach
{{__('Discount notes')}}
{{__('Discount note')}} {{__('Visits count')}} {{__('Subtotal')}} {{__('Discount')}} {{__('Total')}} {{__('Paid')}} {{__('Due')}}
{{$discount_note['name']}} {{format_money($discount_note['count'])}} {{format_money($discount_note['subtotal'])}} {{format_money($discount_note['discount'])}} {{format_money($discount_note['total'])}} {{format_money($discount_note['paid'])}} {{format_money($discount_note['due'])}}
{{__('Summary')}} {{format_money($data['discount_notes']->sum('count'))}} {{format_money($data['discount_notes']->sum('subtotal'))}} {{format_money($data['discount_notes']->sum('discount'))}} {{format_money($data['discount_notes']->sum('total'))}} {{format_money($data['discount_notes']->sum('paid'))}} {{format_money($data['discount_notes']->sum('due'))}}
@endif @if(request()->has('print.summary'))
{{__('Summary')}}
{{__('Visits count')}} {{format_money($data['count'])}}
{{__('Subtotal')}} {{format_money($data['subtotal'])}}
{{__('Discount')}} {{format_money($data['discount'])}}
{{__('Total')}} {{format_money($data['total'])}}
{{__('Paid')}} {{format_money($data['paid'])}}
{{__('Due')}} {{format_money($data['due'])}}
@endif @endsection