mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 10:41:32 +00:00
314 lines
19 KiB
PHP
314 lines
19 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="{{ app()->getLocale() }}">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
|
|
<!-- CSRF Token -->
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
|
|
<link rel="icon" type="image/png" sizes="16x16"
|
|
href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
|
<title>{{ config('app.name', 'Streamline') }}</title>
|
|
<!-- Bootstrap Core CSS -->
|
|
<link href="{{ asset('elite/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet">
|
|
<!-- Custom CSS -->
|
|
<link href="{{ asset('elite/css/style.css') }}" rel="stylesheet">
|
|
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
|
|
|
<style type="text/css">
|
|
body {
|
|
font-size: 14px;
|
|
}
|
|
|
|
strong {
|
|
font-weight: bold;
|
|
}
|
|
tr {
|
|
page-break-before: always;
|
|
page-break-after: always;
|
|
page-break-inside: avoid;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<!-- Preloader -->
|
|
<div class="preloader">
|
|
<div class="cssload-speeding-wheel"></div>
|
|
</div>
|
|
<div class="white-box">
|
|
<div class='col-md-12'>
|
|
@php
|
|
$second_col = "Account"; $end_col = "Budget Total";
|
|
$hospital_info = \Streamline\Models\HospitalInformation::find(1);
|
|
switch ($budget->period)
|
|
{
|
|
case 'months':
|
|
$period = "Months";
|
|
$budget_start_date = strtotime($budget->period_start);//y-m-d
|
|
$budget_end_date = date("Y-m-d", strtotime("+". $budget->period_count - 1 ." month", $budget_start_date));
|
|
$period_range = date("M-Y", $budget_start_date) . " to " . date("M-Y", strtotime($budget_end_date));
|
|
$interval = DateInterval::createFromDateString('1 month');
|
|
$period = new DatePeriod(new DateTime($budget->period_start), $interval, new DateTime(date("Y-m-d", strtotime("+". $budget->period_count ." month", $budget_start_date))));
|
|
foreach ($period as $dt) $months_data[] = $dt->format("M-Y");
|
|
|
|
$column_1 = [$second_col];
|
|
$columns = array_merge($column_1, $months_data);
|
|
array_push($columns, $end_col);
|
|
$collength = count($columns);
|
|
|
|
break;
|
|
|
|
case 'quarters':
|
|
$period = "Quarters";
|
|
$other_columns =[];$quarter_start_dates =['-01-01', '-04-01', '-07-01', '-10-01']; //m-d
|
|
$budget_start_date = $budget->period_start;//y-m-d
|
|
$budget_end_date = date("Y-m-d", strtotime("+". ($budget->period_count-1) * 3 ." month", strtotime('-1 day', strtotime($budget_start_date))));
|
|
$quarters_data = get_quarters($budget_start_date, $budget_end_date);
|
|
for($y =0; $y < count($quarters_data); $y++) $other_columns[] = $quarters_data[$y]->period;
|
|
$period_range = $other_columns[0] . " to " . $other_columns[count($other_columns)-1];
|
|
|
|
$column_1 = [$second_col];
|
|
$columns = array_merge($column_1, $other_columns);
|
|
array_push($columns, $end_col);
|
|
$collength = count($columns);
|
|
break;
|
|
|
|
case 'years':
|
|
$period = "Years";
|
|
$year=date('Y', strtotime($budget->period_start));
|
|
// if (is_numeric($year)) $period_range = $year . " to " . ($year + $budget->period_count-1);
|
|
|
|
$sec = substr($year, -2);
|
|
$years_data = [$year.'/'. ++$sec];
|
|
for ($i = 1; $i <$budget->period_count; $i++) array_push($years_data, $year + $i .'/'. ++$sec);
|
|
$period_range = $years_data[0] . " to " . $years_data[count($years_data)-1];
|
|
$column_1 = [$second_col];
|
|
$columns = array_merge($column_1, $years_data);
|
|
array_push($columns, $end_col);
|
|
$collength = count($columns);
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
@endphp
|
|
|
|
@if(is_null($hospital_info->pdf_print_header))
|
|
<img style="max-width: 300px; max-height: 100px;" src="{{ asset($hospital_info->logo) }}" class="mx-auto d-block mx-3" alt="Responsive image">
|
|
<p class="h6 text-center mt-0 font-weight-bold">
|
|
{{ $hospital_info->name . ' | ' . $hospital_info->phone_number . ' | ' .
|
|
$hospital_info->email . ' | ' . $hospital_info->address . ' ' .
|
|
$hospital_info->country }}
|
|
</p>
|
|
@else
|
|
<img style="max-height: 150px;" src="{{ asset($hospital_info->pdf_print_header) }}" class="mx-auto d-block mx-3" alt="Responsive image">
|
|
@endif
|
|
<div class="row text-center m-t-10">
|
|
<div class="col-md-12">
|
|
<p><h4>{{ __('budgets.budget_name') . ": " . $budget->name }}</h4></p>
|
|
<p><h4>{{ "Period(" .ucfirst($budget->period) . "): " . $period_range }}</h4></p>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<table class="table color-bordered-table success-bordered-table">
|
|
<thead>
|
|
<tr style='display:none;'>
|
|
<td colspan='<?php echo count($columns); ?>'>
|
|
Budget Name: {{ ucfirst($budget->name) . " - Period(" .ucfirst($budget->period) . "): " . $period_range }}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
@php
|
|
for ($i = 0; $i < count($columns); $i++) echo '<th>' .$columns[$i].'</th>';
|
|
$totals_budgets = $sub_accounts = $totals_budgets_colums = $income_column_totals = $expense_column_totals = $cost_of_goods_column_totals = [];
|
|
$sub_account_total= 0;
|
|
@endphp
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($options as $option)
|
|
<tr>
|
|
<td colspan='<?php echo $collength; ?>'>
|
|
<h5><strong>{{ $option['section_header'] }}</strong></h5>
|
|
</td>
|
|
</tr>
|
|
{{-- @foreach ($option['sub_accounts'] as $sub_account)
|
|
<tr>
|
|
<td colspan='<?php echo $collength; ?>'>
|
|
<h5>{{ get_name(key($option['sub_accounts']), 'id', 'name','chart_of_accounts') }}</h5>
|
|
</td>
|
|
</tr>
|
|
@foreach ($sub_account as $sub_account_entry)
|
|
<tr>
|
|
@php
|
|
for ($i =0; $i < $collength; $i++) {
|
|
$sum=0;
|
|
for ($j=0; $j < count($sub_account_entry['account_entries']); $j++) $sum +=(int)$sub_account_entry['account_entries'][$j];
|
|
if ($i==0) echo '<td>' .$sub_account_entry['name']. '</td>' ;
|
|
else if ($i==$collength - 1) echo "<td style='background-color: #34394D !important; color: #fff !important;'>" . ugandan_shillings($sum) . "</td>" ;
|
|
else echo "<td>" .ugandan_shillings($sub_account_entry['account_entries'][$i - 1]). "</td>" ;
|
|
}
|
|
@endphp
|
|
</tr>
|
|
@endforeach --}}
|
|
{{-- Sub Account Section column Totals --}}
|
|
{{-- <tr style='background-color: rgba(0, 0, 0, 0.075) !important;'>
|
|
@php
|
|
for ($i =0; $i < $collength; $i++) {
|
|
$sub_account_total_section = $sub_account_columnTotal_section=0; $keys = array_keys($option['sub_accounts']);
|
|
if ($i==0) echo '<td>'. get_name(key($option['sub_accounts']), 'id', 'name','chart_of_accounts') . ' Total</td>' ;
|
|
else if ($i==$collength - 1){ //Sub account totals
|
|
for($k=0; $k < $budget->period_count; $k++){
|
|
$columnTotal = 0;
|
|
for ($m = 0; $m < count($option['sub_accounts']); $m++) {
|
|
for ($l = 0; $l < count($option['sub_accounts'][$keys[$m]]); $l++) $columnTotal +=(int)($option['sub_accounts'][$keys[$m]][$l]['account_entries'][$k]);
|
|
}
|
|
$sub_account_total_section += $columnTotal;
|
|
}
|
|
echo "<td>" .ugandan_shillings($sub_account_total_section) . "</td>" ;
|
|
} else {
|
|
for ($b=0; $b < count($option['sub_accounts']); $b++) {
|
|
for ($l = 0; $l < count($option['sub_accounts'][$keys[$b]]); $l++) $sub_account_columnTotal_section +=(int)($option['sub_accounts'][$keys[$b]][$l]['account_entries'][$i - 1]);
|
|
|
|
}
|
|
echo "<td>" .ugandan_shillings($sub_account_columnTotal_section). "</td>" ;
|
|
}
|
|
}
|
|
@endphp
|
|
</tr>
|
|
@endforeach --}}
|
|
{{-- @if (!empty($option['sub_accounts']))
|
|
<tr>
|
|
<td colspan='<?php echo $collength; ?>'>
|
|
<h5>{{ 'Other '. $option['section_header'] }}</h5>
|
|
</td>
|
|
</tr>
|
|
@endif --}}
|
|
@foreach ($option['entries'] as $entry )
|
|
<tr>
|
|
@php
|
|
for ($i =0; $i < $collength; $i++) {
|
|
$sum=0;
|
|
for ($j=0; $j < count($entry['account_entries']); $j++) $sum +=(int)$entry['account_entries'][$j];
|
|
$total=ugandan_shillings($sum);
|
|
|
|
if ($i==0) echo '<td>' .$entry['name']. '</td>' ;
|
|
else if ($i==$collength - 1) echo "<td style='background-color: #34394D !important; color: #fff !important;'>" .$total. "</td>" ;
|
|
else echo "<td>" .ugandan_shillings($entry['account_entries'][$i - 1]). "</td>" ;
|
|
}
|
|
@endphp
|
|
</tr>
|
|
@endforeach
|
|
{{-- Other income Section column Totals --}}
|
|
{{-- @if (!empty($option['sub_accounts']))
|
|
|
|
<tr style='background-color: rgba(0, 0, 0, 0.075) !important;'>
|
|
@php
|
|
for ($i =0; $i < $collength; $i++) {
|
|
$budget_total_section=0; $columnTotal_section=0;
|
|
if ($i==0) echo '<td> Other '.$option['total_header']. '</td>' ;
|
|
else if ($i==$collength - 1){ //Budget totals for
|
|
for($k=0; $k < $budget->period_count; $k++){
|
|
$columnTotal = 0;
|
|
for ($m = 0; $m < count($option['entries']); $m++) {
|
|
$columnTotal +=(int)($option['entries'][$m]['account_entries'][$k]);
|
|
}
|
|
$budget_total_section +=$columnTotal;
|
|
}
|
|
echo "<td>" .ugandan_shillings($budget_total_section) . "</td>" ;
|
|
}
|
|
else {
|
|
for ($b=0; $b < count($option['entries']); $b++) {
|
|
$columnTotal_section +=(int)($option['entries'][$b]['account_entries'][$i - 1]);
|
|
}
|
|
|
|
echo "<td>" .ugandan_shillings($columnTotal_section). "</td>" ;
|
|
}
|
|
}
|
|
@endphp
|
|
</tr>
|
|
@endif --}}
|
|
{{-- Operating Budget Section Totals --}}
|
|
<tr style='background-color: #34394D !important; color: #fff !important;'>
|
|
@php
|
|
for ($i =0; $i < $collength; $i++) {
|
|
$budget_total_section=0; $columnTotal_section=0;
|
|
if ($i==0) echo '<td class="font-weight-bold">'.$option['total_header']. '</td>' ;
|
|
else if ($i==$collength - 1){ //Budget totals for
|
|
for($k=0; $k < $budget->period_count; $k++){
|
|
$columnTotal = 0;
|
|
for ($m = 0; $m < count($option['entries']); $m++) {
|
|
$columnTotal +=(int)($option['entries'][$m]['account_entries'][$k]);
|
|
}
|
|
$budget_total_section +=$columnTotal;
|
|
}
|
|
array_push($totals_budgets, $budget_total_section);
|
|
echo "<td>" .ugandan_shillings($budget_total_section) . "</td>" ;
|
|
} else {
|
|
for ($b=0; $b < count($option['entries']); $b++) {
|
|
$columnTotal_section +=(int)($option['entries'][$b]['account_entries'][$i - 1]);
|
|
}
|
|
//Push to column total arrays
|
|
if($entry['type'] == 'Income') array_push($income_column_totals, $columnTotal_section);
|
|
else if($entry['type'] == 'Expense') array_push($expense_column_totals, $columnTotal_section);
|
|
else array_push($cost_of_goods_column_totals, $columnTotal_section);
|
|
|
|
echo "<td>" .ugandan_shillings($columnTotal_section). "</td>" ;
|
|
}
|
|
}
|
|
@endphp
|
|
</tr>
|
|
@endforeach
|
|
|
|
{{-- Budget Projections --}}
|
|
<tr style='background-color: #34394D !important; color: #fff !important;'>
|
|
@php
|
|
for ($i =0; $i < $collength; $i++) {
|
|
if ($i==0) echo '<td>Projected Net Income</td>' ;
|
|
else if ($i==$collength - 1){ //Budget Totals
|
|
$overall_projection = $totals_budgets[0] - $totals_budgets[1] - $totals_budgets[2];
|
|
echo "<td>" . ugandan_shillings($overall_projection) . "</td>" ;
|
|
} else {
|
|
$columnTotal_projection=$income_column_totals[$i-1] - $expense_column_totals[$i-1] - $cost_of_goods_column_totals[$i-1];
|
|
echo "<td>".ugandan_shillings($columnTotal_projection). "</td>" ;
|
|
}
|
|
}
|
|
@endphp
|
|
|
|
</tr>
|
|
|
|
|
|
<tbody>
|
|
<tfoot>
|
|
<tr>
|
|
@php
|
|
for ($i = 0; $i < count($columns); $i++) echo '<th>' .$columns[$i].'</th>';
|
|
@endphp
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
<!-- /#wrapper -->
|
|
<!-- jQuery -->
|
|
<script src="{{ asset('elite/bower_components/jquery/dist/jquery.min.js') }}"></script>
|
|
<!-- Bootstrap Core JavaScript -->
|
|
<script src="{{ asset('elite/bootstrap/dist/js/tether.min.js') }}"></script>
|
|
<script src="{{ asset('elite/bootstrap/dist/js/bootstrap.min.js') }}"></script>
|
|
<script src="{{ asset('elite/bower_components/sidebar-nav/src/metisMenu.js') }}"></script>
|
|
<!--slimscroll JavaScript -->
|
|
<script src="{{ asset('elite/js/jquery.slimscroll.js') }}"></script>
|
|
<!-- Custom Theme JavaScript -->
|
|
<script src="{{ asset('elite/js/custom.min.js') }}"></script>
|
|
</body>
|
|
|
|
</html> |