@php $serv_today = $serv_budget = $serv_variance = $serv_mtd = $serv_mtd_budget = $serv_mtd_variance = $serv_ytd = 0; $tax_today = $tax_budget = $tax_variance = $tax_mtd = $tax_mtd_budget = $tax_mtd_variance = $tax_ytd = 0; $lodging_day = $lodging_bdy = $lodging_vdy = $lodging_mtd = $lodging_bud = $lodging_var = $lodging_ytd = 0; @endphp
@if (!str_contains(request()->url(), 'cetak')) @else @endif
  {{-- --}} DAILY REVENUE REPORT    
DAILY REVENUE REPORT
{{namaHotel()}}
   
    Report Date
Printed
: {{ date('d-m-y', strtotime($date_now)) }}
: {{ date('d-m-y') }}

@php $jml_room_day = $jml_rvnu_day = 0; $jml_room_mon = $jml_rvnu_mon = 0; $jml_room_yer = $jml_rvnu_yer = 0; @endphp @foreach($segments as $segment) @if (in_array($segment->segment_id, ['10','11']) ) @continue @endif @php // if ($segment->segment_id == 4) { // $segment->revenue = $segment->revenue - $data_ota_total_tdy; // $segment->revenue_mtd = $segment->revenue_mtd - $data_ota_total_mtd; // $segment->revenue_ytd = $segment->revenue_ytd - $data_ota_total_ytd; // $segment->tax = $segment->tax - $data_ota_tax_tdy; // $segment->tax_mtd = $segment->tax_mtd - $data_ota_tax_mtd; // $segment->tax_ytd = $segment->tax_ytd - $data_ota_tax_ytd; // $segment->service = $segment->service - $data_ota_serv_tdy; // $segment->service_mtd = $segment->service_mtd - $data_ota_serv_mtd; // $segment->service_ytd = $segment->service_ytd - $data_ota_serv_ytd; // } @endphp @php $jml_room_day += @$segment->room; $jml_rvnu_day += @$segment->revenue; $jml_room_mon += @$segment->room_mtd; $jml_rvnu_mon += @$segment->revenue_mtd; $jml_room_yer += @$segment->room_ytd; $jml_rvnu_yer += @$segment->revenue_ytd; $serv_today += @$segment->service; $serv_mtd += @$segment->service_mtd; // dump('segment:'.@$segment->service_mtd); $serv_ytd += @$segment->service_ytd; $tax_today += @$segment->tax; $tax_mtd += @$segment->tax_mtd; $tax_ytd += @$segment->tax_ytd; @endphp @endforeach
MARKET SEGMENT TODAY MONTH TO DATE YEAR TO DATE
ROOMS REVENUE ROOMS REVENUE ROOMS REVENUE
{{ config('custom.segment_ratecodes.'.$segment->segment_id) }} {{ @$segment->room ? ribuanWithComma($segment->room) : '-' }} {{ @$segment->revenue ? ribuanWithComma($segment->revenue) : '-' }} {{ @$segment->room_mtd ? ribuanWithComma($segment->room_mtd) : '-' }} {{ @$segment->revenue_mtd ? ribuanWithComma($segment->revenue_mtd) : '-'}} {{ @$segment->room_ytd ? ribuanWithComma($segment->room_ytd) : '-' }} {{ @$segment->revenue_ytd ? ribuanWithComma($segment->revenue_ytd) : '-'}}
TOTAL ROOM SALES {{ ribuanWithComma($jml_room_day) }} {{ ribuanWithComma($jml_rvnu_day) }} {{ ribuanWithComma($jml_room_mon) }} {{ ribuanWithComma($jml_rvnu_mon) }} {{ ribuanWithComma($jml_room_yer) }} {{ ribuanWithComma($jml_rvnu_yer) }}

@php $jml_room_day_com = $jml_rvnu_day_com = 0; $jml_room_mon_com = $jml_rvnu_mon_com = 0; $jml_room_yer_com = $jml_rvnu_yer_com = 0; $serv_today_com = $serv_mtd_com = $serv_ytd_com = 0; $tax_today_com = $tax_mtd_com = $tax_ytd_com = 0; @endphp @foreach($segments as $segment) @if (!in_array($segment->segment_id, ['10','11']) ) @continue @endif @php $jml_room_day_com += @$segment->room; $jml_rvnu_day_com += @$segment->revenue; $jml_room_mon_com += @$segment->room_mtd; $jml_rvnu_mon_com += @$segment->revenue_mtd; $jml_room_yer_com += @$segment->room_ytd; $jml_rvnu_yer_com += @$segment->revenue_ytd; $serv_today_com += @$segment->service; $serv_mtd_com += @$segment->service_mtd; // dump('segment:'.@$segment->service_mtd); $serv_ytd_com += @$segment->service_ytd; $tax_today_com += @$segment->tax; $tax_mtd_com += @$segment->tax_mtd; $tax_ytd_com += @$segment->tax_ytd; @endphp @endforeach
ADDITIONAL SEGMENT TODAY MONTH TO DATE YEAR TO DATE
ROOMS REVENUE ROOMS REVENUE ROOMS REVENUE
{{ config('custom.segment_ratecodes.'.$segment->segment_id) }} {{ @$segment->room ? ribuanWithComma($segment->room) : '-' }} {{ @$segment->revenue ? ribuanWithComma($segment->revenue) : '-' }} {{ @$segment->room_mtd ? ribuanWithComma($segment->room_mtd) : '-' }} {{ @$segment->revenue_mtd ? ribuanWithComma($segment->revenue_mtd) : '-'}} {{ @$segment->room_ytd ? ribuanWithComma($segment->room_ytd) : '-' }} {{ @$segment->revenue_ytd ? ribuanWithComma($segment->revenue_ytd) : '-'}}
TOTAL ROOM SALES {{ ribuanWithComma($jml_room_day_com) }} {{ ribuanWithComma($jml_rvnu_day_com) }} {{ ribuanWithComma($jml_room_mon_com) }} {{ ribuanWithComma($jml_rvnu_mon_com) }} {{ ribuanWithComma($jml_room_yer_com) }} {{ ribuanWithComma($jml_rvnu_yer_com) }}

@php $rev_ota_tdy = $rev_ota_mtd = $rev_ota_ytd = 0; @endphp @foreach($array_price_per_ota as $ota) @php $rev_ota_tdy += @$ota->price; $rev_ota_mtd += @$ota->price_ota_mtd; $rev_ota_ytd += @$ota->price_ota_ytd; @endphp @endforeach
OTA LIST TODAY MONTH TO DATE YEAR TO DATE
{{ @$ota->company->name }} {{ @$ota->price ? ribuanWithComma($ota->price) : '-' }} {{ @$ota->price_ota_mtd ? ribuanWithComma($ota->price_ota_mtd) : '-' }} {{ @$ota->price_ota_ytd ? ribuanWithComma($ota->price_ota_ytd) : '-' }}
TOTAL REVENUE {{ ribuanWithComma($rev_ota_tdy) }} {{ ribuanWithComma($rev_ota_mtd) }} {{ ribuanWithComma($rev_ota_ytd) }}

@php $budget_room_available = $budget_room_occupied = $budget_room_occupied_pay_only = 0; $var_today_occupied = $var_today_occupied_paying = $comp_tdy = 0; $b_tdy=$b_mtd=$v_tdy=$v_mtd=0; foreach($room_statistics as $room_stat_hidden){ if ($room_stat_hidden->statistic_id == 20) { $b_tdy = $room_stat_hidden->budget; $b_mtd = $room_stat_hidden->budget_mtd; $v_tdy = $room_inventory - $b_tdy; $v_mtd = $room_inventory - $b_mtd; } } @endphp @php $room_occupied_variable_hidden_tdy = $room_occupied_variable_hidden_mtd = $room_occupied_variable_hidden_ytd = 0; $room_ava_variable_hidden_tdy = $room_ava_variable_hidden_mtd = $room_ava_variable_hidden_ytd = 0; $room_g_in_variable_hidden_tdy = $room_g_in_variable_hidden_mtd = $room_g_in_variable_hidden_ytd = 0; foreach($room_statistics as $room_stat_hidden){ if ($room_stat_hidden->statistic_id == 8) { $room_occupied_variable_hidden_tdy = $room_stat_hidden->today; $room_occupied_variable_hidden_mtd = $room_stat_hidden->mtd; $room_occupied_variable_hidden_ytd = $room_stat_hidden->ytd; } if ($room_stat_hidden->statistic_id == 1) { $room_ava_variable_hidden_tdy = $room_stat_hidden->today; $room_ava_variable_hidden_mtd = $room_stat_hidden->mtd; $room_ava_variable_hidden_ytd = $room_stat_hidden->ytd; } if ($room_stat_hidden->statistic_id == 13) { $room_g_in_variable_hidden_tdy = $room_stat_hidden->today; $room_g_in_variable_hidden_mtd = $room_stat_hidden->mtd; $room_g_in_variable_hidden_ytd = $room_stat_hidden->ytd; } // if ($room_stat_hidden->statistic_id == 16) { // $room_stat_hidden->today = $room_stat_hidden->today - $data_ota_total_tdy; // $room_stat_hidden->mtd = $room_stat_hidden->mtd - $data_ota_total_mtd; // $room_stat_hidden->ytd = $room_stat_hidden->ytd - $data_ota_total_ytd; // } if ($room_stat_hidden->statistic_id == 19) { $house_mtd = $room_stat_hidden->mtd; $house_bud = $room_stat_hidden->budget_mtd; $house_var = ($room_stat_hidden->mtd - $room_stat_hidden->budget_mtd); $house_ytd = $room_stat_hidden->ytd; $house_tdy = $room_stat_hidden->today; } } // dump($jml_rvnu_day/$room_occupied_variable_hidden_tdy); @endphp @foreach($room_statistics as $room_stat) @if($room_stat->statistic_id>0 && $room_stat->statistic_id != 20) @php if($room_stat->statistic_id==1) { //room available $room_mtd = $room_stat->mtd; $room_bud = $room_stat->budget_mtd; $room_var = ($room_stat->mtd - $room_stat->budget_mtd); $room_ytd = $room_stat->ytd; $budget_room_available = $room_stat->budget; //ambil budget room available $var_room_available = $room_stat->today - $room_stat->budget; //Variance room available } elseif($room_stat->statistic_id==3) { //compliment $comp_mtd = $room_stat->mtd; $comp_bud = $room_stat->budget_mtd; $comp_var = ($room_stat->mtd - $room_stat->budget_mtd); $comp_ytd = $room_stat->ytd; $comp_tdy = $room_stat->today; } elseif($room_stat->statistic_id==7) { //room occupied $occu_mtd = $room_stat->mtd; $occu_bud = $room_stat->budget_mtd; $occu_var = ($room_stat->mtd - $room_stat->budget_mtd); $occu_ytd = $room_stat->ytd; $budget_room_occupied = $room_stat->budget; //Ambil Budget Room Occupied }elseif ($room_stat->statistic_id==8) { // Room Occupied (Paying Only) $budget_room_occupied_pay_only = $room_stat->budget; } elseif ($room_stat->statistic_id==19) { // House Use $house_mtd = $room_stat->mtd; $house_bud = $room_stat->budget_mtd; $house_var = ($room_stat->mtd - $room_stat->budget_mtd); $house_ytd = $room_stat->ytd; $house_tdy = $room_stat->today; }elseif ($room_stat->statistic_id==18) { // Average Room Rates $average_room_rates_tdy = ($room_occupied_variable_hidden_tdy > 0) ? ($lodgin_tdy_pre_view-@$jml_rvnu_day_com)/$room_occupied_variable_hidden_tdy : 0; $average_room_rates_mtd = ($room_occupied_variable_hidden_mtd > 0) ? ($lodgin_mtd_pre_view-@$jml_rvnu_mon_com)/$room_occupied_variable_hidden_mtd : 0; $average_room_rates_ytd = ($room_occupied_variable_hidden_ytd > 0) ? ($lodgin_ytd_pre_view-@$jml_rvnu_yer_com)/$room_occupied_variable_hidden_ytd : 0; }elseif ($room_stat->statistic_id==15) { $revpar_tdy = ($room_ava_variable_hidden_tdy > 0) ? ($lodgin_tdy_pre_view-@$jml_rvnu_day_com)/$room_ava_variable_hidden_tdy : 0; $revpar_mtd = ($room_ava_variable_hidden_mtd > 0) ? ($lodgin_mtd_pre_view-@$jml_rvnu_mon_com)/$room_ava_variable_hidden_mtd : 0; $revpar_ytd = ($room_ava_variable_hidden_ytd > 0) ? $lodgin_ytd_pre_view/$room_ava_variable_hidden_ytd : 0; }elseif ($room_stat->statistic_id==16) { $revpar_tdy = ($room_g_in_variable_hidden_tdy > 0) ? ($lodgin_tdy_pre_view-@$jml_rvnu_day_com)/$room_g_in_variable_hidden_tdy : 0; $revpar_mtd = ($room_g_in_variable_hidden_mtd > 0) ? ($lodgin_mtd_pre_view-@$jml_rvnu_mon_com)/$room_g_in_variable_hidden_mtd : 0; $revpar_ytd = ($room_g_in_variable_hidden_ytd > 0) ? ($lodgin_ytd_pre_view-@$jml_rvnu_yer_com)/$room_g_in_variable_hidden_ytd : 0; } @endphp @if($room_stat->statistic_id==9) @php $mtd = $room_mtd>0 ? (($occu_mtd/$room_mtd)*100) : 0; $bud = $room_bud>0 ? (($occu_bud/$room_bud)*100) : 0; $var = $room_var>0 ? (($occu_var/$room_var)*100) : 0; $ytd = $room_ytd>0 ? (($occu_ytd/$room_ytd)*100) : 0; // Calculate budget today room occupied % $budget_today_perc = ($budget_room_available>0 ? (($budget_room_occupied>0) ? (($budget_room_occupied/$budget_room_available)*100): 0) : 0); // Calculate variance today room occupied % $var_today = $room_stat->today - $room_stat->budget; // $var_today_perc = ($room_var>0) ? ((($var_today)/$room_var)*100) : 0; $var_today_perc = $var_today; @endphp @elseif($room_stat->statistic_id==10) @php $mtd = $room_mtd>0 ? ((($occu_mtd-$comp_mtd-$house_mtd)/$room_mtd)*100) : 0; $bud = $room_bud>0 ? ((($occu_bud-$comp_bud-$house_bud)/$room_bud)*100) : 0; $var = $room_var>0 ? ((($occu_var-$comp_var-$house_var)/$room_var)*100) : 0; $ytd = $room_ytd>0 ? ((($occu_ytd-$comp_ytd-$house_ytd)/$room_ytd)*100) : 0; // Calculate budget today room occupied paying_only % $budget_today_perc = ($budget_room_available>0 ? (($budget_room_occupied_pay_only>0) ? (($budget_room_occupied_pay_only/$budget_room_available)*100) : 0) : 0); // Calculate variance today room occupied paying_only % $var_today = $room_stat->today - $room_stat->budget; // $var_today_perc = ($var_room_available>0) ? ((($var_today-$comp_tdy-$house_tdy)/$var_room_available)*100) : 0; $var_today_perc = $var_today; $var_mtd_perc = $mtd - $bud; @endphp @elseif ($room_stat->statistic_id==17) @php $lentgh_st_mtd = $room_stat->mtd / $room_stat->count_data_mtd; $lentgh_st_ytd = $room_stat->ytd / $room_stat->count_data_ytd; @endphp @elseif ($room_stat->statistic_id == 18) @elseif ($room_stat->statistic_id == 15 || $room_stat->statistic_id == 16) @else @endif @else @php if($room_stat->statistic_id==1) { //room available $room_mtd = $room_stat->mtd; $room_bud = $room_stat->budget_mtd; $room_var = ($room_stat->mtd - $room_stat->budget_mtd); $room_ytd = $room_stat->ytd; } elseif($room_stat->statistic_id==3) { //compliment $comp_mtd = $room_stat->mtd; $comp_bud = $room_stat->budget_mtd; $comp_var = ($room_stat->mtd - $room_stat->budget_mtd); $comp_ytd = $room_stat->ytd; } elseif($room_stat->statistic_id==7) { //room occupied $occu_mtd = $room_stat->mtd; $occu_bud = $room_stat->budget_mtd; $occu_var = ($room_stat->mtd - $room_stat->budget_mtd); $occu_ytd = $room_stat->ytd; } if ($room_stat->statistic_id == 0) { $lodging_day += $room_stat->today; $lodging_bdy += $room_stat->budget; $lodging_vdy += ($room_stat->today - $room_stat->budget); $lodging_mtd += $room_stat->mtd; $lodging_bud += $room_stat->budget_mtd; $lodging_var += ($room_stat->mtd - $room_stat->budget_mtd); $lodging_ytd += $room_stat->ytd; } @endphp @endif @endforeach
ROOM STATISTIC TODAY MONTH TO DATE YTD
TODAY BUDGET VARIANCE MTD BUDGET VARIANCE
Room Inventory {{ number_format($room_inventory) }} {{ number_format($b_tdy) }} {{ number_format($v_tdy) }} {{ number_format($room_inventory) }} {{ number_format($b_tdy) }} {{ number_format($v_mtd) }} {{ number_format($room_inventory) }}
{{ config('custom.room_statistic.'.$room_stat->statistic_id) }}{{ number_format($room_stat->today, 2, ".", ",") }}% {{ number_format($budget_today_perc, 2, ".", ",") }}% {{ number_format($var_today_perc, 2, ".", ",") }}% {{ number_format($mtd, 2, ".", ",") }}% {{ number_format($bud, 2, ".", ",") }}% {{ number_format($var, 2, ".", ",") }}% {{ number_format($ytd, 2, ".", ",") }}%{{ number_format($room_stat->today, 2, ".", ",") }}% {{ number_format($budget_today_perc, 2, ".", ",") }}% {{ number_format($var_today_perc, 2, ".", ",") }}% {{ number_format($mtd, 2, ".", ",") }}% {{ number_format($bud, 2, ".", ",") }}% {{ number_format($var_mtd_perc, 2, ".", ",") }}% {{ number_format($ytd, 2, ".", ",") }}%{{ number_format($room_stat->today, 2, ".", "") }} {{ number_format($room_stat->budget, 2, ".", "") }} {{ $room_stat->today - $room_stat->budget < 0 ? '('.number_format(($room_stat->today - $room_stat->budget) * -1, 2, ".", "").')' : number_format($room_stat->today - $room_stat->budget, 2, ".", "") }} {{ number_format($lentgh_st_mtd, 2, ".", "") }} {{ number_format($room_stat->budget_mtd, 2, ".", "") }} {{ $lentgh_st_mtd - $room_stat->budget_mtd < 0 ? '('.number_format(($lentgh_st_mtd - $room_stat->budget_mtd) * -1, 2, ".", "").')' : number_format($lentgh_st_mtd - $room_stat->budget_mtd, 2, ".", "") }} {{ number_format($lentgh_st_ytd, 2, ".", " ") }}{{ ribuanWithComma($average_room_rates_tdy, 2, ".", "") }} {{ ($average_room_rates_tdy - $room_stat->budget < 0 ? '('.number_format(($average_room_rates_tdy - $room_stat->budget) * -1, 2, ".", "").')' : number_format($average_room_rates_tdy - $room_stat->budget, 2, ".", "")) }} {{ ribuanWithComma($average_room_rates_tdy, 2, ".", "") }} {{ ribuanWithComma($average_room_rates_mtd, 2, ".", "") }} {{ ($average_room_rates_mtd - $room_stat->budget < 0 ? '('.number_format(($average_room_rates_mtd - $room_stat->budget_mtd) * -1, 2, ".", "").')' : number_format($average_room_rates_mtd - $room_stat->budget_mtd, 2, ".", "")) }} {{ ribuanWithComma($average_room_rates_mtd, 2, ".", "") }} {{ ribuanWithComma($average_room_rates_ytd, 2, ".", " ") }}{{ ribuanWithComma($revpar_tdy, 2, ".", "") }} {{ ribuanWithComma($room_stat->budget, 2, ".", "") }} {{ (($revpar_tdy - $room_stat->budget < 0 ? '('.ribuanDuaAngkaBelakangKomaIndo(($revpar_tdy - $room_stat->budget) * -1).')' : ribuanDuaAngkaBelakangKomaIndo($revpar_tdy - $room_stat->budget))) }} {{ ribuanWithComma($revpar_mtd, 2, ".", "") }} {{ ribuanWithComma($room_stat->budget_mtd, 2, ".", "") }} {{ (($revpar_mtd - $room_stat->budget_mtd < 0 ? '('.ribuanDuaAngkaBelakangKomaIndo(($revpar_mtd - $room_stat->budget_mtd) * -1).')' : ribuanDuaAngkaBelakangKomaIndo($revpar_mtd - $room_stat->budget_mtd))) }} {{ ribuanWithComma($revpar_ytd, 2, ".", " ") }}{{ ribuanWithComma($room_stat->today) }} {{ ribuanWithComma($room_stat->budget) }} {{ ($room_stat->today - $room_stat->budget) < 0 ? '('.ribuanWithComma(($room_stat->today - $room_stat->budget) *-1).')' : ribuanWithComma($room_stat->today - $room_stat->budget) }} {{ ribuanWithComma($room_stat->mtd) }} {{ ribuanWithComma($room_stat->budget_mtd) }} {{ $room_stat->mtd - $room_stat->budget_mtd < 0 ? '('.ribuanWithComma(($room_stat->mtd - $room_stat->budget_mtd) *-1).')' : ribuanWithComma($room_stat->mtd - $room_stat->budget_mtd) }} {{ ribuanWithComma($room_stat->ytd) }}

@php $rm_rv_disc_tdy = $rm_rv_disc_mtd = $rm_rv_disc_ytd = 0; // substract hu/comp nominal $lodging_day = $lodging_day - $jml_rvnu_day_com; $lodging_vdy = $lodging_day - $lodging_bdy; $lodging_mtd = $lodging_mtd - $jml_rvnu_mon_com; $lodging_var = $lodging_mtd - $lodging_bud; $lodging_ytd = $lodging_ytd - $jml_rvnu_yer_com; @endphp @foreach($room_revenue_items as $shop_room_idx=>$shop_room ) @php $shop_room['today'] = round($shop_room['today'] - (@$payable_to_substracts_per_item[$shop_room_idx]['today_pay']) - (@$payable_to_substracts_per_item[$shop_room_idx]['today_serv']) - (@$payable_to_substracts_per_item[$shop_room_idx]['today_tax'])); $shop_room['mtd'] = $shop_room['mtd'] - (@$payable_to_substracts_per_item[$shop_room_idx]['mtd_pay']) - (@$payable_to_substracts_per_item[$shop_room_idx]['mtd_serv']) - (@$payable_to_substracts_per_item[$shop_room_idx]['mtd_tax']); $shop_room['ytd'] = $shop_room['ytd'] - (@$payable_to_substracts_per_item[$shop_room_idx]['ytd_pay']) - (@$payable_to_substracts_per_item[$shop_room_idx]['ytd_serv']) - (@$payable_to_substracts_per_item[$shop_room_idx]['ytd_tax']); // skip yang data kosong if ($shop_room['today'] === 0 && $shop_room['mtd'] === 0 && $shop_room['ytd'] === 0) { continue; } $shop_room['service'] = $shop_room['service']; $shop_room['service_mtd'] = $shop_room['service_mtd']; $shop_room['service_ytd'] = $shop_room['service_ytd']; $shop_room['tax'] = $shop_room['tax']; $shop_room['tax_mtd'] = $shop_room['tax_mtd']; $shop_room['tax_ytd'] = $shop_room['tax_ytd']; // dump('serv:'.$shop_room['service_mtd'].' tax:'.$shop_room['tax_mtd']); @endphp {{-- @foreach($shop_statistics_room as $shop_room) --}} {{-- @if ($shop_room->revenue_group != 1) --}} @php $lodging_day += $shop_room['today']; $lodging_bdy += $shop_room['budget']; $lodging_vdy += ($shop_room['today'] - $shop_room['budget']); // total budget today $lodging_mtd += $shop_room['mtd']; $lodging_bud += $shop_room['budget_mtd']; $lodging_var += ($shop_room['mtd'] - $shop_room['budget_mtd']); // total budget MTD $lodging_ytd += $shop_room['ytd']; $serv_today += @$shop_room['service']; $serv_mtd += @$shop_room['service_mtd']; // dump('roomrev:'.$serv_mtd); $serv_ytd += @$shop_room['service_ytd']; $tax_today += @$shop_room['tax']; $tax_mtd += @$shop_room['tax_mtd']; $tax_ytd += @$shop_room['tax_ytd']; $rm_rv_disc_tdy += @$shop_room['diskon'] ?? 0; $rm_rv_disc_mtd += @$shop_room['diskon_mtd'] ?? 0; $rm_rv_disc_ytd += @$shop_room['diskon_ytd'] ?? 0; @endphp {{-- @endif --}} @endforeach @php $rm_rv_disc_tdy = $rm_rv_disc_tdy *-1; $rm_rv_disc_mtd = $rm_rv_disc_mtd *-1; $rm_rv_disc_ytd = $rm_rv_disc_ytd *-1; $lodging_day += $rm_rv_disc_tdy; $lodging_vdy += $rm_rv_disc_tdy; $lodging_mtd += $rm_rv_disc_mtd; $lodging_var += $rm_rv_disc_mtd; $lodging_ytd += $rm_rv_disc_ytd; @endphp {{-- Discount & Allowance --}} @php $shopid = 0; $total_today = $total_food = $total_beverages = $total_other_fb = 0; $total_budget_day = $total_food_budget = $total_beverages_budget = $total_other_fb_budget =0; $total_variance_day = $total_food_variance_today = $total_beverages_variance_today = $total_other_fb_variance_today =0; $total_mtd = $total_food_mtd = $total_beverages_mtd = $total_other_fb_mtd =0; $total_budget_mtd = $total_food_budget_mtd = $total_beverages_budget_mtd = $total_other_fb_budget_mtd =0; $total_variance_mtd = $total_food_variance_mtd = $total_beverages_variance_mtd = $total_other_fb_variance_mtd = 0; $total_ytd = $total_food_ytd = $total_beverages_ytd = $total_other_fb_ytd =0; $shop_name=''; $gtotal_today=0; $gtotal_budget_day=0; $gtotal_variance_day=0; $gtotal_mtd=0; $gtotal_budget_mtd=0; $gtotal_variance_mtd=0; $gtotal_ytd=0; @endphp {{-- @foreach($shop_statistics as $shop_stats) --}} {{-- --}} {{-- @foreach ($shop_statistics as $shop_key=>$shop_statis ) --}} @php $shopid = 0; $total_today = $total_food = $total_beverages = $total_other_fb = 0; $total_budget_day = $total_food_budget = $total_beverages_budget = $total_other_fb_budget =0; $total_variance_day = $total_food_variance_today = $total_beverages_variance_today = $total_other_fb_variance_today =0; $total_mtd = $total_food_mtd = $total_beverages_mtd = $total_other_fb_mtd =0; $total_budget_mtd = $total_food_budget_mtd = $total_beverages_budget_mtd = $total_other_fb_budget_mtd =0; $total_variance_mtd = $total_food_variance_mtd = $total_beverages_variance_mtd = $total_other_fb_variance_mtd = 0; $total_ytd = $total_food_ytd = $total_beverages_ytd = $total_other_fb_ytd =0; $shop_name=''; @endphp @if ($shop_statistics[1]) {{-- --}} @php $b_fast_today = 0; $b_fast_mtd = 0; $b_fast_ytd = 0; $b_fast_tbdgt = 0; $b_fast_tvar = 0; $b_fast_bdgtmtd = 0; $serv_bfast_tdy = 0; $serv_bfast_mtd = 0; $serv_bfast_ytd = 0; $tax_bfast_tdy = 0; $tax_bfast_mtd = 0; $tax_bfast_ytd = 0; @endphp {{-- @foreach($shop_statistics_room_breakfast as $shop_room) @if ($shop_room->revenue_group == 1) @php $b_fast_today += $shop_room->today;// total tdy $b_fast_tbdgt += $shop_room->budget;// total budget $b_fast_mtd += ($shop_room->mtd); // total mtd $b_fast_bdgtmtd += ($shop_room->budget_mtd); // total budget mtd $b_fast_ytd += ($shop_room->ytd); // total ytd $serv_today += @$shop_room->service; $serv_mtd += @$shop_room->service_mtd; $serv_ytd += @$shop_room->service_ytd; $tax_today += @$shop_room->tax; $tax_mtd += @$shop_room->tax_mtd; $tax_ytd += @$shop_room->tax_ytd; @endphp @endif @endforeach --}} {{-- @php $total_today += $b_fast_today; $total_budget_day += $b_fast_tbdgt; $total_variance_day += ($b_fast_today - $b_fast_tbdgt); $total_mtd += $b_fast_mtd; $total_budget_mtd += $b_fast_bdgtmtd; $total_variance_mtd += ($b_fast_mtd - $b_fast_bdgtmtd); $total_ytd += $b_fast_ytd; $total_food += $b_fast_today; $total_food_budget += $b_fast_tbdgt; $total_food_variance_today += ($b_fast_today - $b_fast_tbdgt); $total_food_mtd += $b_fast_mtd; $total_food_budget_mtd += $b_fast_bdgtmtd; $total_food_variance_mtd += ($b_fast_mtd - $b_fast_bdgtmtd); $total_food_ytd += $b_fast_ytd; @endphp --}} {{-- --}} @foreach ($shop_statistics[1] as $title=>$shop_stats) @php $food_discount_allowance = $food_discount_allowance_mtd = $food_discount_allowance_ytd = 0; $shop_tdy = $shop_bud_tdy = $shop_mtd = $shop_bud_mtd = $shop_ytd = $shop_var_tdy = $shop_var_mtd = 0; @endphp @foreach ($shop_stats as $shop_stat) @php $this_today = $shop_stat->today - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_tax']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_serv']); $this_mtd = $shop_stat->mtd - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_serv']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_tax']) ; $this_ytd = $shop_stat->ytd - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_serv']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_tax']); // skip yang data kosong if ($this_today === 0 && $this_mtd === 0 && $this_ytd === 0) { continue; } $shop_stat->service = $shop_stat->service; $shop_stat->serv_mtd = $shop_stat->service_mtd; $shop_stat->serv_ytd = $shop_stat->service_ytd; $shop_stat->tax = $shop_stat->tax; $shop_stat->tax_mtd = $shop_stat->tax_mtd; $shop_stat->tax_ytd = $shop_stat->tax_ytd; $food_discount_allowance += @$shop_stat->diskon; $food_discount_allowance_mtd += @$shop_stat->diskon_mtd; $food_discount_allowance_ytd += @$shop_stat->diskon_ytd; // get total from this shop $shop_tdy += @$this_today; $shop_mtd += @$this_mtd; $shop_ytd += @$this_ytd; $shop_bud_tdy += @$shop_stat->budget; $shop_bud_mtd += @$shop_stat->budget_mtd; $shop_var_tdy += @$this_today - $shop_stat->budget; $shop_var_mtd += @$this_mtd - $shop_stat->budget_mtd; @endphp @php $total_today += $this_today; $total_budget_day += $shop_stat->budget; $total_variance_day += ($this_today - $shop_stat->budget); $total_mtd += $this_mtd; $total_budget_mtd += $shop_stat->budget_mtd; $total_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $total_ytd += $this_ytd; $total_food += $this_today; $total_food_budget += $shop_stat->budget; $total_food_variance_today += ($this_today - $shop_stat->budget); $total_food_mtd += $this_mtd; $total_food_budget_mtd += $shop_stat->budget_mtd; $total_food_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $total_food_ytd += $this_ytd; $serv_today += @$shop_stat->service; $serv_mtd += @$shop_stat->service_mtd; // dump('shopstat1:'.$serv_mtd); $serv_ytd += @$shop_stat->service_ytd; $tax_today += @$shop_stat->tax; $tax_mtd += @$shop_stat->tax_mtd; $tax_ytd += @$shop_stat->tax_ytd; @endphp @endforeach {{-- Discount & Allowance --}} {{-- Total Per Shop --}} @php // total food subsctract by discount n allowance $total_food = $total_food - $food_discount_allowance; $total_food_mtd = $total_food_mtd - $food_discount_allowance_mtd; $total_food_ytd = $total_food_ytd - $food_discount_allowance_ytd; $total_food_variance_today = $total_food_variance_today - $food_discount_allowance; $total_food_variance_mtd = $total_food_variance_mtd - $food_discount_allowance_mtd; $total_today = $total_today - $food_discount_allowance; $total_mtd = $total_mtd - $food_discount_allowance_mtd; $total_ytd = $total_ytd - $food_discount_allowance_ytd; $total_variance_day = $total_variance_day - $food_discount_allowance; $total_variance_mtd = $total_variance_mtd - $food_discount_allowance_mtd; @endphp @endforeach @endif @if ($shop_statistics[2]) @foreach ($shop_statistics[2] as $title=>$shop_stats ) @php // ?define variable that store discount and allowance $beverages_discount_allowance = $beverages_discount_allowance_mtd = $beverages_discount_allowance_ytd = 0; $shop_tdy = $shop_bud_tdy = $shop_mtd = $shop_bud_mtd = $shop_ytd = $shop_var_tdy = $shop_var_mtd = 0; @endphp @foreach ($shop_stats as $shop_stat) @php $this_today = $shop_stat->today - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_tax']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_serv']); $this_mtd = $shop_stat->mtd - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_serv']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_tax']) ; $this_ytd = $shop_stat->ytd - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_serv']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_tax']); // skip yang data kosong if ($this_today === 0 && $this_mtd === 0 && $this_ytd === 0) { continue; } $shop_stat->service = $shop_stat->service; $shop_stat->serv_mtd = $shop_stat->service_mtd; $shop_stat->serv_ytd = $shop_stat->service_ytd; $shop_stat->tax = $shop_stat->tax; $shop_stat->tax_mtd = $shop_stat->tax_mtd; $shop_stat->tax_ytd = $shop_stat->tax_ytd; // discount and allowance store $beverages_discount_allowance += @$shop_stat->diskon; $beverages_discount_allowance_mtd += @$shop_stat->diskon_mtd; $beverages_discount_allowance_ytd += @$shop_stat->diskon_ytd; // get total from this shop $shop_tdy += @$this_today; $shop_mtd += @$this_mtd; $shop_ytd += @$this_ytd; $shop_bud_tdy += @$shop_stat->budget; $shop_bud_mtd += @$shop_stat->budget_mtd; $shop_var_tdy += @$this_today - $shop_stat->budget; $shop_var_mtd += @$this_mtd - $shop_stat->budget_mtd; @endphp @php $total_today += $this_today; $total_budget_day += $shop_stat->budget; $total_variance_day += ($this_today - $shop_stat->budget); $total_mtd += $this_mtd; $total_budget_mtd += $shop_stat->budget_mtd; $total_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $total_ytd += $this_ytd; $total_beverages += $this_today; $total_beverages_budget += $shop_stat->budget; $total_beverages_variance_today += ($this_today - $shop_stat->budget); $total_beverages_mtd += $this_mtd; $total_beverages_budget_mtd += $shop_stat->budget_mtd; $total_beverages_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $total_beverages_ytd += $this_ytd; $serv_today += @$shop_stat->service; $serv_mtd += @$shop_stat->service_mtd; // dump('shopstat2:'.$shop_stat->service_mtd); $serv_ytd += @$shop_stat->service_ytd; $tax_today += @$shop_stat->tax; $tax_mtd += @$shop_stat->tax_mtd; $tax_ytd += @$shop_stat->tax_ytd; @endphp @endforeach {{-- Discount & Allowance --}} {{-- Total Per Shop --}} @php // total beverages subsctract by discount n allowance $total_beverages = $total_beverages - $beverages_discount_allowance; $total_beverages_mtd = $total_beverages_mtd - $beverages_discount_allowance_mtd; $total_beverages_ytd = $total_beverages_ytd - $beverages_discount_allowance_ytd; $total_beverages_variance_today = $total_beverages_variance_today - $beverages_discount_allowance; $total_beverages_variance_mtd = $total_beverages_variance_mtd - $beverages_discount_allowance_mtd; $total_today = $total_today - $beverages_discount_allowance; $total_mtd = $total_mtd - $beverages_discount_allowance_mtd; $total_ytd = $total_ytd - $beverages_discount_allowance_ytd; $total_variance_day = $total_variance_day - $beverages_discount_allowance; $total_variance_mtd = $total_variance_mtd - $beverages_discount_allowance_mtd; @endphp @endforeach @endif @php // ?define variable that store discount and allowance $other_discount_allowance = $other_discount_allowance_mtd = $other_discount_allowance_ytd = 0; $shop_tdy = $shop_bud_tdy = $shop_mtd = $shop_bud_mtd = $shop_ytd = $shop_var_tdy = $shop_var_mtd = 0; @endphp @if ($shop_statistics[3] || $shop_statistics[99]) @if ($shop_statistics[3]) @foreach ($shop_statistics[3] as $title=>$shop_stats ) @foreach ($shop_stats as $shop_stat) @php $this_today = $shop_stat->today - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_tax']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_serv']); $this_mtd = $shop_stat->mtd - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_serv']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_tax']) ; $this_ytd = $shop_stat->ytd - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_serv']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_tax']); // skip yang data kosong if ($this_today === 0 && $this_mtd === 0 && $this_ytd === 0) { continue; } $shop_stat->service = $shop_stat->service; $shop_stat->serv_mtd = $shop_stat->service_mtd; $shop_stat->serv_ytd = $shop_stat->service_ytd; $shop_stat->tax = $shop_stat->tax; $shop_stat->tax_mtd = $shop_stat->tax_mtd; $shop_stat->tax_ytd = $shop_stat->tax_ytd; // discount and allowance store $other_discount_allowance += @$shop_stat->diskon; $other_discount_allowance_mtd += @$shop_stat->diskon_mtd; $other_discount_allowance_ytd += @$shop_stat->diskon_ytd; // get total from this shop $shop_tdy += @$this_today; $shop_mtd += @$this_mtd; $shop_ytd += @$this_ytd; $shop_bud_tdy += @$shop_stat->budget; $shop_bud_mtd += @$shop_stat->budget_mtd; $shop_var_tdy += @$this_today - $shop_stat->budget; $shop_var_mtd += @$this_mtd - $shop_stat->budget_mtd; @endphp @php $total_today += $this_today; $total_budget_day += $shop_stat->budget; $total_variance_day += ($this_today - $shop_stat->budget); $total_mtd += $this_mtd; $total_budget_mtd += $shop_stat->budget_mtd; $total_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $total_ytd += $this_ytd; $total_other_fb += $this_today; $total_other_fb_budget += $shop_stat->budget; $total_other_fb_variance_today += ($this_today - $shop_stat->budget); $total_other_fb_mtd += $this_mtd; $total_other_fb_budget_mtd += $shop_stat->budget_mtd; $total_other_fb_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $total_other_fb_ytd += $this_ytd; $serv_today += @$shop_stat->service; $serv_mtd += @$shop_stat->service_mtd; // dump('shopstat3:'.$shop_stat->service_mtd); $serv_ytd += @$shop_stat->service_ytd; $tax_today += @$shop_stat->tax; $tax_mtd += @$shop_stat->tax_mtd; $tax_ytd += @$shop_stat->tax_ytd; @endphp @endforeach {{-- Discount & Allowance --}} @endforeach @endif @if ($shop_statistics[99]) @foreach ($shop_statistics[99] as $title=>$shop_stats ) @foreach ($shop_stats as $shop_stat) @if ($shop_stat->tipe_menu_id===0||$shop_stat->tipe_menu_id>0) @php $this_today = $shop_stat->today - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_tax']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['today_serv']); $this_mtd = $shop_stat->mtd - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_serv']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['mtd_tax']) ; $this_ytd = $shop_stat->ytd - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_pay']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_serv']) - (@$payable_to_substracts[$shop_stat->tipe_category_id][$shop_stat->tipe_menu_id]['ytd_tax']); // skip yang data kosong if ($this_today === 0 && $this_mtd === 0 && $this_ytd === 0) { continue; } $shop_stat->service = $shop_stat->service; $shop_stat->serv_mtd = $shop_stat->service_mtd; $shop_stat->serv_ytd = $shop_stat->service_ytd; $shop_stat->tax = $shop_stat->tax; $shop_stat->tax_mtd = $shop_stat->tax_mtd; $shop_stat->tax_ytd = $shop_stat->tax_ytd; // discount and allowance store $other_discount_allowance += @$shop_stat->diskon; $other_discount_allowance_mtd += @$shop_stat->diskon_mtd; $other_discount_allowance_ytd += @$shop_stat->diskon_ytd; // get total from this shop $shop_tdy += @$this_today; $shop_mtd += @$this_mtd; $shop_ytd += @$this_ytd; $shop_bud_tdy += @$shop_stat->budget; $shop_bud_mtd += @$shop_stat->budget_mtd; $shop_var_tdy += @$this_today - $shop_stat->budget; $shop_var_mtd += @$this_mtd - $shop_stat->budget_mtd; @endphp @php $total_today += $this_today; $total_budget_day += $shop_stat->budget; $total_variance_day += ($this_today - $shop_stat->budget); $total_mtd += $this_mtd; $total_budget_mtd += $shop_stat->budget_mtd; $total_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $total_ytd += $this_ytd; $total_other_fb += $this_today; $total_other_fb_budget += $shop_stat->budget; $total_other_fb_variance_today += ($this_today - $shop_stat->budget); $total_other_fb_mtd += $this_mtd; $total_other_fb_budget_mtd += $shop_stat->budget_mtd; $total_other_fb_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $total_other_fb_ytd += $this_ytd; $serv_today += @$shop_stat->service; $serv_mtd += @$shop_stat->service_mtd; // dump('shopstat99:'.$shop_stat->service_mtd); $serv_ytd += @$shop_stat->service_ytd; $tax_today += @$shop_stat->tax; $tax_mtd += @$shop_stat->tax_mtd; $tax_ytd += @$shop_stat->tax_ytd; @endphp @endif @endforeach {{-- Discount & Allowance --}} @endforeach @endif @php // total other subsctract by discount n allowance $total_other_fb = $total_other_fb - $other_discount_allowance; $total_other_fb_mtd = $total_other_fb_mtd - $other_discount_allowance_mtd; $total_other_fb_ytd = $total_other_fb_ytd - $other_discount_allowance_ytd; $total_other_fb_variance_today = $total_other_fb_variance_today - $other_discount_allowance; $total_other_fb_variance_mtd = $total_other_fb_variance_mtd - $other_discount_allowance_mtd; $total_today = $total_today - $other_discount_allowance; $total_mtd = $total_mtd - $other_discount_allowance_mtd; $total_ytd = $total_ytd - $other_discount_allowance_ytd; $total_variance_day = $total_variance_day - $other_discount_allowance; $total_variance_mtd = $total_variance_mtd - $other_discount_allowance_mtd; @endphp {{-- Total Per Shop --}} @endif {{-- @endforeach --}} @php $gtotal_today += $total_today; $gtotal_budget_day += $total_budget_day; $gtotal_variance_day += $total_variance_day; $gtotal_mtd += $total_mtd; $gtotal_budget_mtd += $total_budget_mtd; $gtotal_variance_mtd += $total_variance_mtd; $gtotal_ytd += $total_ytd; @endphp {{-- @endforeach --}} @php $other_shopid = 0; $other_total_today=0; $other_total_budget_day=0; $other_total_variance_day=0; $other_total_mtd=0; $other_total_budget_mtd=0; $other_total_variance_mtd=0; $other_total_ytd=0; $other_shop_name=''; @endphp {{-- @foreach($shop_statistics_others as $shop_stat) --}} @foreach($shop_statistics_per_shops as $shop_stat) {{-- @if($shop_stat->tipe_menu_id>0) --}} @php $this_today = $shop_stat->today - ((@$payable_per_shops[$shop_stat->shop_id]->payable) - (@$payable_per_shops[$shop_stat->shop_id]->tax) - (@$payable_per_shops[$shop_stat->shop_id]->services)); $this_mtd = $shop_stat->mtd - ((@$payable_per_shops[$shop_stat->shop_id]->mtd_pay) - (@$payable_per_shops[$shop_stat->shop_id]->mtd_tax) - (@$payable_per_shops[$shop_stat->shop_id]->mtd_serv)); $this_ytd = $shop_stat->ytd - ((@$payable_per_shops[$shop_stat->shop_id]->ytd_pay) - (@$payable_per_shops[$shop_stat->shop_id]->ytd_tax) - (@$payable_per_shops[$shop_stat->shop_id]->ytd_serv)); // skip yang data kosong if ($this_today === 0 && $this_mtd === 0 && $this_ytd === 0) { continue; } @endphp @php $other_total_today += $this_today; $other_total_budget_day += $shop_stat->budget; $other_total_variance_day += ($this_today - $shop_stat->budget); $other_total_mtd += $this_mtd; $other_total_budget_mtd += $shop_stat->budget_mtd; $other_total_variance_mtd += ($this_mtd - $shop_stat->budget_mtd); $other_total_ytd += $this_ytd; $serv_today += @$shop_stat->service; $serv_mtd += @$shop_stat->service_mtd; // dump('otherrev:'.$shop_stat->service_mtd); $serv_ytd += @$shop_stat->service_ytd; $tax_today += @$shop_stat->tax; $tax_mtd += @$shop_stat->tax_mtd; $tax_ytd += @$shop_stat->tax_ytd; @endphp {{-- @endif --}} @endforeach @php $gtotal_today += $other_total_today; $gtotal_budget_day += $other_total_budget_day; $gtotal_variance_day += $other_total_variance_day; $gtotal_mtd += $other_total_mtd; $gtotal_budget_mtd += $other_total_budget_mtd; $gtotal_variance_mtd += $other_total_variance_mtd; $gtotal_ytd += $other_total_ytd; $gtotal_today += $lodging_day ?? 0; $gtotal_budget_day += $lodging_bdy ?? 0; $gtotal_variance_day += $lodging_vdy ?? 0; $gtotal_mtd += $lodging_mtd ?? 0; $gtotal_budget_mtd += $lodging_bud ?? 0; $gtotal_variance_mtd += $lodging_var ?? 0; $gtotal_ytd += $lodging_ytd ?? 0; // Calculate serv & tax budget today $serv_budget = $gtotal_budget_day * $global_services / 100; $tax_budget = ($gtotal_budget_day + $serv_budget) * $global_tax / 100; // Calculate serv & tax budget MTD $serv_mtd_budget = $gtotal_budget_mtd * $global_services /100; $tax_mtd_budget = ($gtotal_budget_mtd + $serv_mtd_budget) * $global_tax /100; @endphp {{-- Service & Tax --}}
DESCRIPTION TODAY MONTH TO DATE YTD
TODAY BUDGET VARIANCE MTD BUDGET VARIANCE
Room Revenue
    Lodging {{ ribuanWithComma(@$lodging_day) }} {{ ribuanWithComma(@$lodging_bdy) }} {{ @$lodging_vdy < 0 ? '('.ribuanWithComma(@$lodging_vdy *-1).')' : ribuanWithComma(@$lodging_vdy) }} {{ ribuanWithComma(@$lodging_mtd) }} {{ ribuanWithComma(@$lodging_bud) }} {{ @$lodging_var < 0 ? '('.ribuanWithComma(@$lodging_var *-1).')' : ribuanWithComma(@$lodging_var) }} {{ ribuanWithComma(@$lodging_ytd) }}
    @if($shop_room->nama ?? $shop_room['item']) {{$shop_room->nama ?? $shop_room['item']}} @else Custom Menu @endif {{-- @if($shop_room->menu_id>0) {{ $shop_room->menu_id ? $shop_room->item->nama : ' - ' }} {{ @$shop_stat->shop ? "(".@$shop_stat->shop->nama.")" : '' }} @elseif($shop_room->menu_id===0) Custom Menu {{ @$shop_stat->shop ? "(".@$shop_stat->shop->nama.")" : '' }} @elseif(!$shop_room->menu_id) Discount {{ @$shop_stat->shop ? "(".@$shop_stat->shop->nama.")" : '' }} @endif --}} {{ ribuanWithComma($shop_room['today']) }} {{ ribuanWithComma($shop_room['budget']) }} {{ $shop_room['today'] - $shop_room['budget'] < 0 ? '('.ribuanWithComma(($shop_room['today'] - $shop_room['budget']) *-1).')' : ribuanWithComma($shop_room['today'] - $shop_room['budget']) }} {{ ribuanWithComma($shop_room['mtd']) }} {{ ribuanWithComma($shop_room['budget_mtd']) }} {{ $shop_room['mtd'] - $shop_room['budget_mtd'] < 0 ? '('.ribuanWithComma(($shop_room['mtd'] - $shop_room['budget_mtd']) *-1).')' : ribuanWithComma($shop_room['mtd'] - $shop_room['budget_mtd']) }} {{ ribuanWithComma($shop_room['ytd']) }}
    Discount & Allowance {{ $rm_rv_disc_tdy < 0 ? '('.ribuanWithComma($rm_rv_disc_tdy *-1).')' : ribuanWithComma($rm_rv_disc_tdy) }} {{ '-' }} {{ $rm_rv_disc_tdy < 0 ? '('.ribuanWithComma($rm_rv_disc_tdy *-1).')' : ribuanWithComma($rm_rv_disc_tdy) }} {{ $rm_rv_disc_mtd < 0 ? '('.ribuanWithComma($rm_rv_disc_mtd *-1).')' : ribuanWithComma($rm_rv_disc_mtd) }} {{ '-' }} {{ $rm_rv_disc_mtd < 0 ? '('.ribuanWithComma($rm_rv_disc_mtd *-1).')' : ribuanWithComma($rm_rv_disc_mtd) }} {{ $rm_rv_disc_ytd < 0 ? '('.ribuanWithComma($rm_rv_disc_ytd *-1).')' : ribuanWithComma($rm_rv_disc_ytd) }}
TOTAL ROOM REVENUE {{ ribuanWithComma(@$lodging_day) }} {{ ribuanWithComma(@$lodging_bdy) }} {{ $lodging_vdy < 0 ? '('.ribuanWithComma(@$lodging_vdy *-1).')' : ribuanWithComma(@$lodging_vdy) }} {{ ribuanWithComma(@$lodging_mtd) }} {{ ribuanWithComma(@$lodging_bud) }} {{ $lodging_var < 0 ? '('.ribuanWithComma(@$lodging_var *-1).')' : ribuanWithComma(@$lodging_var) }} {{ ribuanWithComma(@$lodging_ytd) }}
 
F&B
 Food F&B
    B'fast Restaurant (Room) {{ ribuanWithComma($b_fast_today) }} {{ ribuanWithComma($b_fast_tbdgt) }} {{ $b_fast_today - $b_fast_tbdgt < 0 ? '('.ribuanWithComma(($b_fast_today - $b_fast_tbdgt) *-1).')' : ribuanWithComma($b_fast_today - $b_fast_tbdgt) }} {{ ribuanWithComma($b_fast_mtd) }} {{ ribuanWithComma($b_fast_bdgtmtd) }} {{ $b_fast_mtd - $b_fast_bdgtmtd < 0 ? '('.ribuanWithComma(($b_fast_mtd - $b_fast_bdgtmtd) *-1).')' : ribuanWithComma($b_fast_mtd - $b_fast_bdgtmtd) }} {{ ribuanWithComma($b_fast_ytd) }}
  {{$title}}
     {{-- @if($shop_stat->tipe) {{ config('custom.jenis_tipe_item')[@$shop_stat->tipe->type_category_id] }} {{ @$shop_stat->shop ? @$shop_stat->shop->nama : '' }} @elseif($shop_stat->tipe_menu_id===0) Custom Menu {{ @$shop_stat->shop ? @$shop_stat->shop->nama : '' }} @elseif(!$shop_stat->tipe_menu_id) Discount {{ @$shop_stat->shop ? @$shop_stat->shop->nama : '' }} @else - {{@$shop_stat->shop->nama}} @endif --}} @if($shop_stat->tipe) {{-- {{ config('custom.jenis_tipe_item')[@$shop_stat->tipe->type_category_id] }} {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} --}} {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @elseif($shop_stat->tipe_menu_id===0) Custom Menu {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @elseif(!$shop_stat->tipe_menu_id) Discount {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @else - {{@$shop_stat->tipe->nama_tipe}} @endif {{ ribuanWithComma($this_today) }} {{ ribuanWithComma($shop_stat->budget) }} {{ $this_today - $shop_stat->budget < 0 ? '('.ribuanWithComma(($this_today - $shop_stat->budget) *-1).')' : ribuanWithComma($this_today - $shop_stat->budget) }} {{ ribuanWithComma($this_mtd) }} {{ ribuanWithComma($shop_stat->budget_mtd) }} {{ $this_mtd - $shop_stat->budget_mtd < 0 ? '('.ribuanWithComma(($this_mtd - $shop_stat->budget_mtd) *-1).')' : ribuanWithComma($this_mtd - $shop_stat->budget_mtd) }} {{ ribuanWithComma($this_ytd) }}
    Discount & Allowance {{ '('.ribuanWithComma($food_discount_allowance*(1)).')' }} {{ '-' }} {{ '('.ribuanWithComma($food_discount_allowance*(1)).')' }} {{ '('.ribuanWithComma($food_discount_allowance_mtd*(1)).')' }} {{ '-' }} {{ '('.ribuanWithComma($food_discount_allowance_mtd*(1)).')' }} {{ '('.ribuanWithComma($food_discount_allowance_ytd*(1)).')' }}
    Total {{$title}} {{ ribuanWithComma(@$shop_tdy-$food_discount_allowance) }} {{ ribuanWithComma(@$shop_bud_tdy) }} {{ $shop_var_tdy < 0 ? '('.ribuanWithComma(@$shop_var_tdy *-1).')' : ribuanWithComma(@$shop_var_tdy-$food_discount_allowance) }} {{ ribuanWithComma(@$shop_mtd-$food_discount_allowance_mtd) }} {{ ribuanWithComma(@$shop_bud_mtd) }} {{ $shop_var_mtd < 0 ? '('.ribuanWithComma(@$shop_var_mtd *-1).')' : ribuanWithComma(@$shop_var_mtd-$food_discount_allowance_mtd) }} {{ ribuanWithComma(@$shop_ytd-$food_discount_allowance_ytd) }}
TOTAL FOOD F&B {{ ribuanWithComma($total_food) }} {{ ribuanWithComma($total_food_budget) }} {{ $total_food_variance_today < 0 ? '('.ribuanWithComma($total_food_variance_today *-1).')' : ribuanWithComma($total_food_variance_today) }} {{ ribuanWithComma($total_food_mtd) }} {{ ribuanWithComma($total_food_budget_mtd) }} {{ $total_food_variance_mtd < 0 ? '('.ribuanWithComma($total_food_variance_mtd *-1).')' : ribuanWithComma($total_food_variance_mtd) }} {{ ribuanWithComma($total_food_ytd) }}
   Beverages F&B
  {{$title}}
    @if($shop_stat->tipe) @if ($shop_stat->tipe->type_category_id != null) {{-- {{ config('custom.jenis_tipe_item')[@$shop_stat->tipe->type_category_id] }} {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} --}} {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @endif @elseif($shop_stat->tipe_menu_id===0) Custom Menu {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @elseif(!$shop_stat->tipe_menu_id) Discount {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @else - {{@$shop_stat->tipe->nama_tipe}} @endif {{ ribuanWithComma($this_today) }} {{ ribuanWithComma($shop_stat->budget) }} {{ $this_today - $shop_stat->budget < 0 ? '('.ribuanWithComma(($this_today - $shop_stat->budget) *-1).')' : ribuanWithComma($this_today - $shop_stat->budget) }} {{ ribuanWithComma($this_mtd) }} {{ ribuanWithComma($shop_stat->budget_mtd) }} {{ $this_mtd - $shop_stat->budget_mtd < 0 ? '('.ribuanWithComma(($this_mtd - $shop_stat->budget_mtd) *-1).')' : ribuanWithComma($this_mtd - $shop_stat->budget_mtd) }} {{ ribuanWithComma($this_ytd) }}
    Discount & Allowance {{ '('.(ribuanWithComma($beverages_discount_allowance*(1))).')' }} {{ '-' }} {{ '('.(ribuanWithComma($beverages_discount_allowance*(1))).')' }} {{ '('.(ribuanWithComma($beverages_discount_allowance_mtd*(1))).')' }} {{ '-' }} {{ '('.(ribuanWithComma($beverages_discount_allowance_mtd*(1))).')' }} {{ '('.ribuanWithComma($beverages_discount_allowance_ytd*(1)).')' }}
    Total {{$title}} {{ ribuanWithComma(@$shop_tdy-$beverages_discount_allowance) }} {{ ribuanWithComma(@$shop_bud_tdy) }} {{ $shop_var_tdy < 0 ? '('.ribuanWithComma(@$shop_var_tdy *-1).')' : ribuanWithComma(@$shop_var_tdy-$beverages_discount_allowance) }} {{ ribuanWithComma(@$shop_mtd) }} {{ ribuanWithComma(@$shop_bud_mtd-$beverages_discount_allowance_mtd) }} {{ $shop_var_mtd < 0 ? '('.ribuanWithComma(@$shop_var_mtd *-1).')' : ribuanWithComma(@$shop_var_mtd-$beverages_discount_allowance_mtd) }} {{ ribuanWithComma(@$shop_ytd-$beverages_discount_allowance_ytd) }}
TOTAL BEVERAGES F&B {{ ribuanWithComma($total_beverages) }} {{ ribuanWithComma($total_beverages_budget) }} {{ $total_beverages_variance_today < 0 ? '('.ribuanWithComma($total_beverages_variance_today *-1).')' : ribuanWithComma($total_beverages_variance_today) }} {{ ribuanWithComma($total_beverages_mtd) }} {{ ribuanWithComma($total_beverages_budget_mtd) }} {{ $total_beverages_variance_mtd < 0 ? '('.ribuanWithComma($total_beverages_variance_mtd *-1).')' : ribuanWithComma($total_beverages_variance_mtd) }} {{ ribuanWithComma($total_beverages_ytd) }}
   Other F&B
  {{$title}}
    @if($shop_stat->tipe) @if ($shop_stat->tipe->type_category_id != null) {{-- {{ config('custom.jenis_tipe_item')[@$shop_stat->tipe->type_category_id] }} {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} --}} {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @endif @elseif($shop_stat->tipe_menu_id===0) Custom Menu {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @elseif(!$shop_stat->tipe_menu_id) Discount {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @else - {{@$shop_stat->tipe->nama_tipe}} @endif {{ ribuanWithComma($this_today) }} {{ ribuanWithComma($shop_stat->budget) }} {{ $this_today - $shop_stat->budget < 0 ? '('.ribuanWithComma(($this_today - $shop_stat->budget) *-1).')' : ribuanWithComma($this_today - $shop_stat->budget) }} {{ ribuanWithComma($this_mtd) }} {{ ribuanWithComma($shop_stat->budget_mtd) }} {{ $this_mtd - $shop_stat->budget_mtd < 0 ? '('.ribuanWithComma(($this_mtd - $shop_stat->budget_mtd) *-1).')' : ribuanWithComma($this_mtd - $shop_stat->budget_mtd) }} {{ ribuanWithComma($this_ytd) }}
    Discount & Allowance {{ ribuanWithComma(0) }} {{ ribuanWithComma(0) }} {{ ribuanWithComma(0) }} {{ ribuanWithComma(0) }} {{ ribuanWithComma(0) }} {{ ribuanWithComma(0) }} {{ ribuanWithComma(0) }}
  {{$title}}
    @if($shop_stat->tipe) @if ($shop_stat->tipe->type_category_id != null) {{-- {{ config('custom.jenis_tipe_item')[@$shop_stat->tipe->type_category_id] }} {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} --}} {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @endif @elseif($shop_stat->tipe_menu_id===0) Custom Menu {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @elseif(!$shop_stat->tipe_menu_id) Discount {{ @$shop_stat->tipe ? @$shop_stat->tipe->nama_tipe : '' }} @else - {{@$shop_stat->tipe->nama_tipe}} @endif {{ ribuanWithComma($this_today) }} {{ ribuanWithComma($shop_stat->budget) }} {{ $this_today - $shop_stat->budget < 0 ? '('.ribuanWithComma(($this_today - $shop_stat->budget) *-1).')' : ribuanWithComma($this_today - $shop_stat->budget) }} {{ ribuanWithComma($this_mtd) }} {{ ribuanWithComma($shop_stat->budget_mtd) }} {{ $this_mtd - $shop_stat->budget_mtd < 0 ? '('.ribuanWithComma(($this_mtd - $shop_stat->budget_mtd) *-1).')' : ribuanWithComma($this_mtd - $shop_stat->budget_mtd) }} {{ ribuanWithComma($this_ytd) }}
    Discount & Allowance {{ '('.ribuanWithComma($other_discount_allowance*(1)).')' }} {{ '-' }} {{ '('.ribuanWithComma($other_discount_allowance*(1)).')' }} {{ ribuanWithComma($other_discount_allowance_mtd*(1)).')' }} {{ '-' }} {{ '('.ribuanWithComma($other_discount_allowance_mtd*(1)).')' }} {{ '('.ribuanWithComma($other_discount_allowance_ytd*(1)).')' }}
    Total {{$title}} {{ ribuanWithComma(@$shop_tdy) }} {{ ribuanWithComma(@$shop_bud_tdy) }} {{ $shop_var_tdy < 0 ? '('.ribuanWithComma(@$shop_var_tdy *-1).')' : ribuanWithComma(@$shop_var_tdy) }} {{ ribuanWithComma(@$shop_mtd) }} {{ ribuanWithComma(@$shop_bud_mtd) }} {{ $shop_var_mtd < 0 ? '('.ribuanWithComma(@$shop_var_mtd *-1).')' : ribuanWithComma(@$shop_var_mtd) }} {{ ribuanWithComma(@$shop_ytd) }}
TOTAL OTHER F&B {{ ribuanWithComma($total_other_fb-$other_discount_allowance) }} {{ ribuanWithComma($total_other_fb_budget) }} {{ $total_other_fb_variance_today < 0 ? '('.ribuanWithComma(($total_other_fb_variance_today) *-1).')' : ribuanWithComma($total_other_fb_variance_today-$other_discount_allowance) }} {{ ribuanWithComma($total_other_fb_mtd-$other_discount_allowance_mtd) }} {{ ribuanWithComma($total_other_fb_budget_mtd) }} {{ $total_other_fb_variance_mtd < 0 ? '('.ribuanWithComma(($total_other_fb_variance_mtd) *-1).')' : ribuanWithComma($total_other_fb_variance_mtd-$other_discount_allowance_mtd) }} {{ ribuanWithComma($total_other_fb_ytd-$other_discount_allowance_ytd) }}
TOTAL F&B REVENUE {{ ribuanWithComma($total_today) }} {{ ribuanWithComma($total_budget_day) }} {{ $total_variance_day < 0 ? '('.ribuanWithComma($total_variance_day).')' : ribuanWithComma($total_variance_day) }} {{ ribuanWithComma($total_mtd) }} {{ ribuanWithComma($total_budget_mtd) }} {{ $total_variance_mtd < 0 ? '('.ribuanWithComma($total_variance_mtd).')' : ribuanWithComma($total_variance_mtd) }} {{ ribuanWithComma($total_ytd) }}
Other Revenue
    {{ @$shop_stat->tipe->nama_tipe }} {{ @$shop_stat->shop ? "(".@$shop_stat->shop->nama.")" : '' }} {{ ribuanWithComma($this_today) }} {{ ribuanWithComma($shop_stat->budget) }} {{ $this_today - $shop_stat->budget < 0 ? '('.ribuanWithComma($this_today - $shop_stat->budget).')' : ribuanWithComma($this_today - $shop_stat->budget) }} {{ ribuanWithComma($this_mtd) }} {{ ribuanWithComma($shop_stat->budget_mtd) }} {{ $this_mtd - $shop_stat->budget_mtd < 0 ? '('.ribuanWithComma($this_mtd - $shop_stat->budget_mtd).')' : ribuanWithComma($this_mtd - $shop_stat->budget_mtd) }} {{ ribuanWithComma($this_ytd) }}
TOTAL OTHER REVENUE {{ ribuanWithComma($other_total_today) }} {{ ribuanWithComma($other_total_budget_day) }} {{ $other_total_variance_day < 0 ? '('.ribuanWithComma(($other_total_variance_day) *-1).')' : ribuanWithComma($other_total_variance_day) }} {{ ribuanWithComma($other_total_mtd) }} {{ ribuanWithComma($other_total_budget_mtd) }} {{ $other_total_variance_mtd < 0 ? '('.ribuanWithComma(($other_total_variance_day) *-1).')' : ribuanWithComma($other_total_variance_mtd) }} {{ ribuanWithComma($other_total_ytd) }}
TOTAL NET REVENUE {{ ribuanWithComma($gtotal_today) }} {{ ribuanWithComma($gtotal_budget_day) }} {{ $gtotal_variance_day < 0 ? '('.ribuanWithComma(($gtotal_variance_day) *-1).')' : ribuanWithComma($gtotal_variance_day) }} {{ ribuanWithComma($gtotal_mtd) }} {{ ribuanWithComma($gtotal_budget_mtd) }} {{ $gtotal_variance_mtd < 0 ? '('.ribuanWithComma(($gtotal_variance_mtd) *-1).')' : ribuanWithComma($gtotal_variance_mtd) }} {{ ribuanWithComma($gtotal_ytd) }}
   Service Charge {{ ribuanWithComma($serv_today) }} {{ ribuanWithComma($serv_budget) }} {{ $serv_today - $serv_budget < 0 ? '('.ribuanWithComma(($serv_variance = $serv_today - $serv_budget) *-1).')' : ribuanWithComma($serv_variance = $serv_today - $serv_budget) }} {{ ribuanWithComma($serv_mtd) }} {{ ribuanWithComma($serv_mtd_budget) }} {{ $serv_mtd - $serv_mtd_budget < 0 ? '('.ribuanWithComma(($serv_mtd_variance = $serv_mtd - $serv_mtd_budget) *-1).')' : ribuanWithComma($serv_mtd_variance = $serv_mtd - $serv_mtd_budget) }} {{ ribuanWithComma($serv_ytd) }}
   Government Tax {{ ribuanWithComma($tax_today) }} {{ ribuanWithComma($tax_budget) }} {{ $tax_today - $tax_budget < 0 ? '('.ribuanWithComma(($tax_variance = $tax_today - $tax_budget) *-1).')' : ribuanWithComma($tax_variance = $tax_today - $tax_budget) }} {{ ribuanWithComma($tax_mtd) }} {{ ribuanWithComma($tax_mtd_budget) }} {{ $tax_mtd - $tax_mtd_budget < 0 ? '('.ribuanWithComma(($tax_mtd_variance = $tax_mtd - $tax_mtd_budget) *-1).')' : ribuanWithComma($tax_mtd_variance = $tax_mtd - $tax_mtd_budget) }} {{ ribuanWithComma($tax_ytd) }}
TOTAL GROSS REVENUE {{-- @php $today_guest_ledger += $gtotal_today + $serv_today + $tax_today; @endphp --}} {{ ribuanWithComma($gtotal_today+$serv_today+$tax_today) }} {{ ribuanWithComma($gtotal_budget_day+$serv_budget+$tax_budget) }} {{ $gtotal_variance_day+$serv_variance+$tax_variance < 0 ? '('.ribuanWithComma(($gtotal_variance_day+$serv_variance+$tax_variance) *-1).')' : ribuanWithComma($gtotal_variance_day+$serv_variance+$tax_variance) }} {{ ribuanWithComma($gtotal_mtd+$serv_mtd+$tax_mtd) }} {{ ribuanWithComma($gtotal_budget_mtd+$serv_mtd_budget+$tax_mtd_budget) }} {{ $gtotal_variance_mtd+$serv_mtd_variance+$tax_mtd_variance < 0 ? '('.ribuanWithComma(($gtotal_variance_mtd+$serv_mtd_variance+$tax_mtd_variance) *-1).')' : ribuanWithComma($gtotal_variance_mtd+$serv_mtd_variance+$tax_mtd_variance) }} {{ ribuanWithComma($gtotal_ytd+$serv_ytd+$tax_ytd) }}

@php $total_pay_tdy = $total_pay_mtd = $total_pay_ytd = 0; $total_bpay_tdy = $total_bpay_mtd = 0; $total_tdy_var = $total_mtd_var = 0; @endphp {{-- @foreach ($payable_stats as $pay) --}} {{-- @foreach ($payable_stats_new as $pay) --}} {{-- @foreach ($payable_per_shops as $pay) --}} @foreach ($payable_stats_2 as $pay) @php // skip yang data kosong if ($pay->payable === 0 && $pay->mtd_pay === 0 && $pay->ytd_pay === 0) { continue; } $this_pay_tdy = $pay->payable - @$pay->tax - @$pay->services; $this_pay_mtd = $pay->mtd_pay - @$pay->tax_mtd - @$pay->services_mtd; $this_pay_ytd = $pay->ytd_pay - @$pay->tax_ytd - @$pay->services_ytd; // pay $total_pay_tdy += $this_pay_tdy; $total_pay_mtd += $this_pay_mtd; $total_pay_ytd += $this_pay_ytd; // budget $total_bpay_tdy += $pay->budget; $total_bpay_mtd += $pay->budget_mtd; // variance $total_tdy_var += ($pay->payable - $pay->budget); $total_mtd_var += ($pay->mtd_pay - $pay->budget_mtd); @endphp {{-- --}} @endforeach
DESCRIPTION TODAY MONTH TO DATE YTD
TODAY BUDGET VARIANCE MTD BUDGET VARIANCE
   ({{@$pay->tipeMenu->nama_tipe}} - {{@$pay->tipeMenu->nama_tipe}}) {{$pay->label ?? ' payable '}}   {{@$pay->tipeMenu->revenue_partner_label}} {{ ribuanWithComma($this_pay_tdy) }} {{ ribuanWithComma($pay->budget) }} {{ $this_pay_tdy - $pay->budget < 0 ? '('. ribuanWithComma(($this_pay_tdy - $pay->budget) *-1).')' : ribuanWithComma($this_pay_tdy - $pay->budget) }} {{ ribuanWithComma($this_pay_mtd) }} {{ ribuanWithComma($pay->budget_mtd) }} {{ $this_pay_mtd - $pay->budget_mtd < 0 ? '('.ribuanWithComma(($this_pay_mtd - $pay->budget_mtd) *-1).')' : ribuanWithComma($this_pay_mtd - $pay->budget_mtd) }} {{ ribuanWithComma($this_pay_ytd) }}
TOTAL PAYABLE {{-- @php $today_guest_ledger += $total_pay_tdy; @endphp --}} {{ ribuanWithComma($total_pay_tdy) }} {{ ribuanWithComma($total_bpay_tdy) }} {{ $total_tdy_var < 0 ? '('.ribuanWithComma(($total_tdy_var) *-1).')' : ribuanWithComma($total_tdy_var) }} {{ ribuanWithComma($total_pay_mtd) }} {{ ribuanWithComma($total_bpay_mtd) }} {{ $total_mtd_var < 0 ? '('.ribuanWithComma(($total_mtd_var) *-1).')' : ribuanWithComma($total_mtd_var) }} {{ ribuanWithComma($total_pay_ytd) }}

{{-- --}} @php $total_cash_today = 0; $total_cash_mtd = 0; $total_cash_ytd = 0; @endphp @foreach(config('custom.jenis_cash') as $key => $jenis_cash) @php $total_cash_today += $cash_today[$key]; $total_cash_mtd += $cash_mtd[$key]; $total_cash_ytd += $cash_ytd[$key]; @endphp @endforeach @php $total_credit_card_today = 0; $total_credit_card_mtd = 0; $total_credit_card_ytd = 0; @endphp @foreach($platform_headers as $platform_header) @php $cc_today = array_key_exists('1_'.$platform_header->id, $credit_card_today) ? array_sum($credit_card_today['1_'.$platform_header->id]) : 0; $cc_mtd = array_key_exists('1_'.$platform_header->id, $credit_card_mtd) ? array_sum($credit_card_mtd['1_'.$platform_header->id]) : 0; $cc_ytd = array_key_exists('1_'.$platform_header->id, $credit_card_ytd) ? array_sum($credit_card_ytd['1_'.$platform_header->id]) : 0; @endphp @php $total_credit_card_today += $cc_today; $total_credit_card_mtd += $cc_mtd; $total_credit_card_ytd += $cc_ytd; @endphp @endforeach @foreach($platforms as $platform) @php $cc_today = array_key_exists('2_'.$platform->id, $credit_card_today) ? array_sum($credit_card_today['2_'.$platform->id]) : 0; $cc_mtd = array_key_exists('2_'.$platform->id, $credit_card_mtd) ? array_sum($credit_card_mtd['2_'.$platform->id]) : 0; $cc_ytd = array_key_exists('2_'.$platform->id, $credit_card_ytd) ? array_sum($credit_card_ytd['2_'.$platform->id]) : 0; @endphp @php $total_credit_card_today += $cc_today; $total_credit_card_mtd += $cc_mtd; $total_credit_card_ytd += $cc_ytd; @endphp @endforeach @php $cc_today = array_key_exists('3_', $credit_card_today) ? array_sum($credit_card_today['3_']) : 0; $cc_mtd = array_key_exists('3_', $credit_card_mtd) ? array_sum($credit_card_mtd['3_']) : 0; $cc_ytd = array_key_exists('3_', $credit_card_ytd) ? array_sum($credit_card_ytd['3_']) : 0; @endphp {{-- --}} {{-- @php $total_credit_card_today += $cc_today; $total_credit_card_mtd += $cc_mtd; $total_credit_card_ytd += $cc_ytd; @endphp --}} @php $total_today_cl = 0; $total_mtd_cl = 0; $total_ytd_cl = 0; @endphp @foreach($other_city_ledgers as $other_city_ledger) @php $today_cl = isset($today_other_city_ledgers[$other_city_ledger->id]) ? $today_other_city_ledgers[$other_city_ledger->id]->total_ledger : 0; $mtd_cl = isset($mtd_other_city_ledgers[$other_city_ledger->id]) ? $mtd_other_city_ledgers[$other_city_ledger->id]->total_ledger : 0; $ytd_cl = isset($ytd_other_city_ledgers[$other_city_ledger->id]) ? $ytd_other_city_ledgers[$other_city_ledger->id]->total_ledger : 0; @endphp @php $total_today_cl += $today_cl; $total_mtd_cl += $mtd_cl; $total_ytd_cl += $ytd_cl; @endphp @endforeach @foreach(config('custom.segment_ratecodes') as $key => $segment_ratecode) @if(in_array($key, [1,7,10,11,12,13])) @php continue; @endphp @endif @php $today_cl = isset($today_city_ledgers[$key]) ? $today_city_ledgers[$key]->total_ledger : 0; $mtd_cl = isset($mtd_city_ledgers[$key]) ? $mtd_city_ledgers[$key]->total_ledger : 0; $ytd_cl = isset($ytd_city_ledgers[$key]) ? $ytd_city_ledgers[$key]->total_ledger : 0; @endphp @php $total_today_cl += $today_cl; $total_mtd_cl += $mtd_cl; $total_ytd_cl += $ytd_cl; @endphp @endforeach @php $total_today_payment = $advance_deposit_today + $total_cash_today + $total_credit_card_today + $total_today_cl; $total_mtd_payment = $advance_deposit_mtd + $total_cash_mtd + $total_credit_card_mtd + $total_mtd_cl; $total_ytd_payment = $advance_deposit_ytd + $total_cash_ytd + $total_credit_card_ytd + $total_ytd_cl; @endphp @php $paid_out_tdy = $paid_out_mtd = $paid_out_ytd = 0;// defining @endphp @foreach($paid_out_datas as $paid) @php $paid_out_tdy += $paid->today*-1;// total tdy $paid_out_mtd = ($paid->mtd)*-1; // total mtd $paid_out_ytd = ($paid->ytd)*-1; // total ytd @endphp @endforeach @php // Total Cash Min paid Out $total_cash_today = $total_cash_today + $paid_out_tdy; // paid out sudah minus/negatif $total_cash_mtd = $total_cash_mtd + $paid_out_mtd; // paid out sudah minus/negatif $total_cash_ytd = $total_cash_ytd + $paid_out_ytd; // paid out sudah minus/negatif @endphp @php $paid_out_pos_tdy = $paid_out_pos_mtd = $paid_out_pos_ytd = 0;// defining @endphp @foreach($paid_out_pos_datas as $paid) @php $paid_out_pos_tdy = $paid->change_tdy*-1;// total tdy $paid_out_pos_mtd = ($paid->change_mtd)*-1; // total mtd $paid_out_pos_ytd = ($paid->change_ytd)*-1; // total ytd @endphp @endforeach @php // Total Cash Min paid Out $total_cash_today = $total_cash_today - $paid_out_pos_tdy; // paid out sudah minus/negatif $total_cash_mtd = $total_cash_mtd - $paid_out_pos_mtd; // paid out sudah minus/negatif $total_cash_ytd = $total_cash_ytd - $paid_out_pos_ytd; // paid out sudah minus/negatif @endphp @php $total_today_payment = $advance_deposit_today + $total_cash_today + $total_credit_card_today + $total_today_cl; $total_mtd_payment = $advance_deposit_mtd + $total_cash_mtd + $total_credit_card_mtd + $total_mtd_cl; $total_ytd_payment = $advance_deposit_ytd + $total_cash_ytd + $total_credit_card_ytd + $total_ytd_cl; @endphp
DESCRIPTION SUMMARY OF PAYMENT
TODAY MONTH TO DATE YTD
Advance Deposit {{ $advance_deposit_today ? '('.number_format($advance_deposit_today, 2, ".", ",").')' : '-' }} {{ $advance_deposit_mtd ? '('.number_format($advance_deposit_mtd, 2, ".", ",").')' : '-' }} {{ $advance_deposit_ytd ? '('.number_format($advance_deposit_ytd, 2, ".", ",").')' : '-' }}
Total Deposit {{ $advance_deposit_today ? '('.number_format($advance_deposit_today, 2, ".", ",").')' : '-'}} {{ $advance_deposit_mtd ? '('.number_format($advance_deposit_mtd, 2, ".", ",").')' : '-'}} {{ $advance_deposit_ytd ? '('.number_format($advance_deposit_ytd, 2, ".", ",").')' : '-'}}
{{ $jenis_cash }} {{$cash_today[$key] ? '('.number_format($cash_today[$key], 2, '.', ',').')' : '-' }} {{$cash_mtd[$key] ? '('.number_format($cash_mtd[$key], 2, '.', ',').')' : '-' }} {{$cash_ytd[$key] ? '('.number_format($cash_ytd[$key], 2, '.', ',').')' : '-' }}
Total Cash {{$total_cash_today ? '('.number_format($total_cash_today, 2, '.', ',').')' : '-' }} {{$total_cash_mtd ? '('.number_format($total_cash_mtd, 2, '.', ',').')' : '-'}} {{$total_cash_ytd ? '('.number_format($total_cash_ytd, 2, '.', ',').')' : '-'}}
{{$platform_header->name}} {{ $cc_today ? '('.number_format($cc_today, 2, '.', ',').')' : '-' }} {{ $cc_mtd ? '('.number_format($cc_mtd, 2, '.', ',').')' : '-' }} {{ $cc_ytd ? '('.number_format($cc_ytd, 2, '.', ',').')' : '-' }}
{{$platform->nama}} {{$cc_today ? '('.number_format($cc_today, 2, '.', ',').')' : '-' }} {{$cc_mtd ? '('.number_format($cc_mtd, 2, '.', ',').')' : '-' }} {{$cc_ytd ? '('.number_format($cc_ytd, 2, '.', ',').')' : '-' }}
Bank Transfer {{ $cc_today ? '('.number_format($cc_today, 2, '.', ',').')' : '-' }} {{ $cc_today ? '('.number_format($cc_mtd, 2, '.', ',').')' : '-' }} {{ $cc_today ? '('.number_format($cc_ytd, 2, '.', ',').')' : '-' }}
Total Credit Card {{ $total_credit_card_today ? '('.number_format($total_credit_card_today, 2, '.', ',').')' : '-'}} {{ $total_credit_card_mtd ? '('.number_format($total_credit_card_mtd, 2, '.', ',').')' : '-'}} {{ $total_credit_card_ytd ? '('.number_format($total_credit_card_ytd, 2, '.', ',').')' : '-'}}
{{ $other_city_ledger->name }} {{ $today_cl ? '('.number_format($today_cl, 2, '.', ',').')' : '-'}} {{ $mtd_cl ? '('.number_format($mtd_cl, 2, '.', ',').')' : '-'}} {{ $ytd_cl ? '('.number_format($ytd_cl, 2, '.', ',').')' : '-'}}
{{ $segment_ratecode }} {{in_array($key,[14,15]) ? '' : 'Ledger'}} {{ $today_cl ? '('.number_format($today_cl, 2, '.', ',').')' : '-' }} {{ $mtd_cl ? '('.number_format($mtd_cl, 2, '.', ',').')' : '-' }} {{ $ytd_cl ? '('.number_format($ytd_cl, 2, '.', ',').')' : '-' }}
Total City Ledger {{$total_today_cl ? '('.number_format($total_today_cl, 2, '.', ',').')' : '-' }} {{$total_mtd_cl ? '('.number_format($total_mtd_cl, 2, '.', ',').')' : '-' }} {{$total_ytd_cl ? '('.number_format($total_ytd_cl, 2, '.', ',').')' : '-' }}
TOTAL {{ $total_today_payment ? '('.number_format($total_today_payment, 2, '.', ',').')' : '-' }} @php // $today_guest_ledger -= $total_today_payment; @endphp {{ $total_mtd_payment ? '('.number_format($total_mtd_payment, 2, '.', ',').')' : '-' }} {{ $total_mtd_payment ? '('.number_format($total_ytd_payment, 2, '.', ',').')' : '-' }}
Paid Out {{ $paid_out_tdy ? '('.number_format($paid_out_tdy, 2, '.', ',').')' : '-'}} {{ $paid_out_mtd ? '('.number_format($paid_out_mtd, 2, '.', ',').')' : '-'}} {{ $paid_out_ytd ? '('.number_format($paid_out_ytd, 2, '.', ',').')' : '-'}}
Paid Out POS {{ $paid_out_pos_tdy ? '('.number_format($paid_out_pos_tdy*-1, 2, '.', ',').')' : '-'}} {{ $paid_out_pos_mtd ? '('.number_format($paid_out_pos_mtd*-1, 2, '.', ',').')' : '-'}} {{ $paid_out_pos_ytd ? '('.number_format($paid_out_pos_ytd*-1, 2, '.', ',').')' : '-'}}
TOTAL PAYMENT {{ $total_today_payment ? '('.number_format($total_today_payment, 2, '.', ',').')' : '-' }} @php // $today_guest_ledger -= $total_today_payment; @endphp {{ $total_mtd_payment ? '('.number_format($total_mtd_payment, 2, '.', ',').')' : '-' }} {{ $total_mtd_payment ? '('.number_format($total_ytd_payment, 2, '.', ',').')' : '-' }}

Guest Ledger as Date TODAY MONTH TO DATE YTD
{{ $new_gl_tdy ? number_format($new_gl_tdy, 2, '.', ',') : '-'}} {{ $new_gl_mtd ? number_format($new_gl_mtd, 2, '.', ',') : '-'}} {{ $new_gl_ytd ? number_format($new_gl_ytd, 2, '.', ',') : '-'}}

GUEST LEDGER
Today Guest Ledger {{ number_format($today_guest_ledger, 2, ".", ",") }}
Yesterday Guest Ledger {{ number_format($yesterday_guest_ledger, 2, ".", ",") }}
TODAY BALANCE @php $today_balance_guest_ledger = $today_guest_ledger + $yesterday_guest_ledger; @endphp {{ number_format($today_balance_guest_ledger, 2, ".", ",") }}