<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Mail Template</title>
    <style type="text/css">
        img {
            max-width: 100%;
        }
        body {
            -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
        }
        body {
            background-color: #f6f6f6;
            color: #7d7b7b;
        }
        @media  only screen and (max-width: 640px) {
            body {
                padding: 0 !important;
            }
            h1 {
                font-weight: 800 !important; margin: 20px 0 5px !important;
            }
            h2 {
                font-weight: 800 !important; margin: 20px 0 5px !important;
            }
            h3 {
                font-weight: 800 !important; margin: 20px 0 5px !important;
            }
            h4 {
                font-weight: 800 !important; margin: 20px 0 5px !important;
            }
            h1 {
                font-size: 22px !important;
            }
            h2 {
                font-size: 18px !important;
            }
            h3 {
                font-size: 16px !important;
            }
            .container {
                padding: 0 !important; width: 100% !important;
            }
            .content {
                padding: 0 !important;
            }
            .content-wrap {
                padding: 10px !important;
            }
            .invoice {
                width: 100% !important;
            }
        }
    </style>
</head>
<body style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6">
<table class="body-wrap" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6">
    <tr style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
        <td style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
        <td class="container" width="800" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 800px !important; clear: both !important; margin: 0 auto;" valign="top">
            <div class="content" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 800px; display: block; margin: 0 auto; padding: 20px;">
                <table class="main" width="100%" cellpadding="0" cellspacing="0" itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;" bgcolor="#fff">
                    <tr style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
                        <td class="content-wrap" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; border-bottom: 1px solid #f1efef; font-size: 14px; text-align: center; vertical-align: top; margin: 0; padding: 20px;" valign="top">
                            <a href="https://www.extranetwork.com" target="_blank">
                                <img src="https://app.extranetwork.com/assets/img/logo/mini-logo.png" height="30" />
                            </a>
                        </td>
                    </tr>
                    <tr style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
                        <td class="content-wrap" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;" valign="top">
                            <meta itemprop="name" content="Confirm Email" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;" />
                            <table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
                                <tr style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
                                    <td class="content-block" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
                                        <h2 class="aligncenter" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 24px; color: #d71f26; line-height: 1.2em; font-weight: 400; text-align: left; margin: 10px 0 0; letter-spacing: -1px;">Summary Report</h2>
                                    </td>
                                </tr>
                                <tr style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
                                    <td class="content-block" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">

                                        <table width="100%">

                                            <tr>
                                                <td colspan="2" style="font-weight: bold;padding-top: 10px;">{{$params['daily']['title']}}</td>
                                                <td style="font-weight: bold;padding-top: 10px; text-align: right;">{{$params['daily']['period']}}</td>
                                            </tr>
                                            <tr>
                                                <td colspan="3"><hr style="border: 1px solid #f1efef;"></td>
                                            </tr>
                                            @if(empty($params['daily']['data']))
                                                <tr>
                                                    <td colspan="3">No Record!</td>
                                                </tr>
                                            @else
                                                @foreach($params['daily']['data'] as $currencyCode => $data)
                                                <tr>
                                                    <td>{{$data['count']}}</td>
                                                    <td style="text-align: right;">{{moneyDoubleFormatDecimal($data['total'])}} {{$currencyCode}}</td>
                                                    <td style="text-align: right;">{{moneyDoubleFormatDecimal($data['commission'])}} {{$currencyCode}}</td>
                                                </tr>
                                                @endforeach
                                                    <td colspan="3"><hr style="border: 1px dashed #f1efef;"></td>
                                                    <tr>
                                                        <td style="font-weight: bold;">{{$params['daily']['summary']['count']}}</td>
                                                        <td style="text-align: right; font-weight: bold;">{{moneyDoubleFormatDecimal($params['daily']['summary']['total'])}} EUR</td>
                                                        <td style="text-align: right; font-weight: bold;">{{moneyDoubleFormatDecimal($params['daily']['summary']['commission'])}} EUR</td>
                                                    </tr>
                                            @endif

                                            <tr>
                                                <td colspan="3">&nbsp;</td>
                                            </tr>

                                            <tr>
                                                <td colspan="2" style="font-weight: bold;padding-top: 10px;">{{$params['monthly']['title']}}</td>
                                                <td style="font-weight: bold;padding-top: 10px; text-align: right;">{{$params['monthly']['period']}}</td>
                                            </tr>
                                            <tr>
                                                <td colspan="3"><hr style="border: 1px solid #f1efef;"></td>
                                            </tr>
                                            @if(empty($params['monthly']['data']))
                                                <tr>
                                                    <td colspan="3">No Record!</td>
                                                </tr>
                                            @else
                                                @foreach($params['monthly']['data'] as $currencyCode => $data)
                                                    <tr>
                                                        <td>{{$data['count']}}</td>
                                                        <td style="text-align: right;">{{moneyDoubleFormatDecimal($data['total'])}} {{$currencyCode}}</td>
                                                        <td style="text-align: right;">{{moneyDoubleFormatDecimal($data['commission'])}} {{$currencyCode}}</td>
                                                    </tr>
                                                @endforeach
                                                    <td colspan="3"><hr style="border: 1px dashed #f1efef;"></td>
                                                    <tr>
                                                        <td style="font-weight: bold;">{{$params['monthly']['summary']['count']}}</td>
                                                        <td style="text-align: right; font-weight: bold;">{{moneyDoubleFormatDecimal($params['monthly']['summary']['total'])}} EUR</td>
                                                        <td style="text-align: right; font-weight: bold;">{{moneyDoubleFormatDecimal($params['monthly']['summary']['commission'])}} EUR</td>
                                                    </tr>
                                                    <td colspan="3"><hr style="border: 1px dashed #f1efef;"></td>
                                                    <tr>
                                                        <td style="font-weight: bold; color: #41ad0a;">{{$params['monthly']['summaryCheckout']['count']}}</td>
                                                        <td style="text-align: right; font-weight: bold; color: #41ad0a;">{{moneyDoubleFormatDecimal($params['monthly']['summaryCheckout']['total'])}} EUR</td>
                                                        <td style="text-align: right; font-weight: bold; color: #41ad0a;">{{moneyDoubleFormatDecimal($params['monthly']['summaryCheckout']['commission'])}} EUR</td>
                                                    </tr>
                                            @endif

                                            <tr><td colspan="3">&nbsp;</td></tr>
                                            <tr>
                                                <td colspan="3" style="font-weight: bold;padding-top: 10px;">Monthly Summary Report</td>
                                            </tr>
                                            <tr>
                                                <td colspan="3"><hr style="border: 1px solid #f1efef;"></td>
                                            </tr>
                                            @if(empty($params['monthlySummary']))
                                                <tr>
                                                    <td colspan="3">No Record!</td>
                                                </tr>
                                            @else
                                                <tr>
                                                    <td style="font-weight: bold;">Period</td>
                                                    <td style="font-weight: bold;text-align: right;">Transaction</td>
                                                    <td style="font-weight: bold;text-align: right;color: #41ad0a;">Checkout</td>
                                                </tr>
                                                @foreach($params['monthlySummary']['month'] as $month)
                                                    <tr>
                                                        <td style="font-weight: bold;">{{$month}}</td>
                                                        <td style="font-weight: bold;text-align: right;">{{moneyDoubleFormatDecimal($params['monthlySummary']['transaction'][$month]['commission'])}} EUR</td>
                                                        <td style="font-weight: bold;text-align: right;color: #41ad0a;">{{moneyDoubleFormatDecimal($params['monthlySummary']['checkout'][$month]['commission'])}} EUR</td>
                                                    </tr>
                                                @endforeach
                                                <td colspan="3"><hr style="border: 1px dashed #f1efef;"></td>
                                                <tr>
                                                    <td style="font-weight: bold;">&nbsp;</td>
                                                    <td style="font-weight: bold;text-align: right;">{{moneyDoubleFormatDecimal(collect($params['monthlySummary']['transaction'])->sum('commission'))}} EUR</td>
                                                    <td style="font-weight: bold;text-align: right;color: #41ad0a;">{{moneyDoubleFormatDecimal(collect($params['monthlySummary']['checkout'])->sum('commission'))}} EUR</td>
                                                </tr>
                                            @endif


                                            <tr>
                                                <td colspan="3">&nbsp;</td>
                                            </tr>

                                            <tr>
                                                <td colspan="2" style="font-weight: bold;padding-top: 10px;">{{$params['annually']['title']}}</td>
                                                <td style="font-weight: bold;padding-top: 10px; text-align: right;">{{$params['annually']['period']}}</td>
                                            </tr>
                                            <tr>
                                                <td colspan="3"><hr style="border: 1px solid #f1efef;"></td>
                                            </tr>
                                            @if(empty($params['annually']['data']))
                                                <tr>
                                                    <td colspan="3">No Record!</td>
                                                </tr>
                                            @else
                                                @foreach($params['annually']['data'] as $currencyCode => $data)
                                                    <tr>
                                                        <td>{{$data['count']}}</td>
                                                        <td style="text-align: right;">{{moneyDoubleFormatDecimal($data['total'])}} {{$currencyCode}}</td>
                                                        <td style="text-align: right;">{{moneyDoubleFormatDecimal($data['commission'])}} {{$currencyCode}}</td>
                                                    </tr>
                                                @endforeach
                                                    <td colspan="3"><hr style="border: 1px dashed #f1efef;"></td>
                                                    <tr>
                                                        <td style="font-weight: bold;">{{$params['annually']['summary']['count']}}</td>
                                                        <td style="text-align: right; font-weight: bold;">{{moneyDoubleFormatDecimal($params['annually']['summary']['total'])}} EUR</td>
                                                        <td style="text-align: right; font-weight: bold;">{{moneyDoubleFormatDecimal($params['annually']['summary']['commission'])}} EUR</td>
                                                    </tr>
                                                    <td colspan="3"><hr style="border: 1px dashed #f1efef;"></td>
                                                    <tr>
                                                        <td style="font-weight: bold; color: #41ad0a;">{{$params['annually']['summaryCheckout']['count']}}</td>
                                                        <td style="text-align: right; font-weight: bold; color: #41ad0a;">{{moneyDoubleFormatDecimal($params['annually']['summaryCheckout']['total'])}} EUR</td>
                                                        <td style="text-align: right; font-weight: bold; color: #41ad0a;">{{moneyDoubleFormatDecimal($params['annually']['summaryCheckout']['commission'])}} EUR</td>
                                                    </tr>
                                            @endif
                                            <tr>
                                                <td colspan="3">&nbsp;</td>
                                            </tr>



                                        </table>

                                        <hr style="border: 1px solid #f1efef;">

                                        <table width="100%">
                                            <tr><td colspan="4">&nbsp;</td></tr>
                                            <tr>
                                                <td colspan="4" style="font-weight: bold;padding-top: 10px;">Monthly Invoice Comparative Report</td>
                                            </tr>
                                            <tr>
                                                <td colspan="4"><hr style="border: 1px solid #f1efef;"></td>
                                            </tr>
                                            @if(empty($params['comparative']))
                                                <tr>
                                                    <td colspan="4">No Record!</td>
                                                </tr>
                                            @else
                                                <tr>
                                                    <td style="font-weight: bold;">Month</td>
                                                    <td style="font-weight: bold;text-align: right;">{{$params['comparative']['yearList'][0]}}</td>
                                                    <td style="font-weight: bold;text-align: right;">{{$params['comparative']['yearList'][1]}}</td>
                                                    <td style="font-weight: bold;text-align: right;">Status</td>
                                                </tr>


                                                @foreach($params['comparative']['monthList'] as $monthKey => $month)
                                                    <tr>
                                                        <td style="font-weight: bold;">{{$month}}</td>
                                                        <td style="font-weight: bold;text-align: right;">{{moneyDoubleFormatDecimal($params['comparative']['data'][$params['comparative']['yearList'][0]][$monthKey])}} EUR</td>
                                                        <td style="font-weight: bold;text-align: right;">{{moneyDoubleFormatDecimal($params['comparative']['data'][$params['comparative']['yearList'][1]][$monthKey])}} EUR</td>
                                                        @if($params['comparative']['diff'][$monthKey]['amount'] > 0)
                                                            <td style="font-weight: bold;text-align: right; color: #41ad0a;">+{{moneyDoubleFormatDecimal($params['comparative']['diff'][$monthKey]['amount'])}} EUR</td>
                                                        @else($params['comparative']['diff'][$monthKey]['amount'] > 0)
                                                            <td style="font-weight: bold;text-align: right; color: #d71f26;">{{moneyDoubleFormatDecimal($params['comparative']['diff'][$monthKey]['amount'])}} EUR</td>
                                                        @endif
                                                    </tr>
                                                @endforeach

                                                <td colspan="4"><hr style="border: 1px dashed #f1efef;"></td>
                                                <tr>
                                                    <td style="font-weight: bold;">&nbsp;</td>
                                                    <td style="font-weight: bold;text-align: right;">{{moneyDoubleFormatDecimal(array_sum($params['comparative']['data'][$params['comparative']['yearList'][0]]))}} EUR</td>
                                                    <td style="font-weight: bold;text-align: right;">{{moneyDoubleFormatDecimal(array_sum($params['comparative']['data'][$params['comparative']['yearList'][1]]))}} EUR</td>

                                                    @if(collect($params['comparative']['diff'])->sum('amount') > 0)
                                                        <td style="font-weight: bold;text-align: right; color: #41ad0a;">+{{moneyDoubleFormatDecimal(collect($params['comparative']['diff'])->sum('amount'))}} EUR</td>
                                                    @else($params['comparative']['diff'][$monthKey]['amount'] > 0)
                                                        <td style="font-weight: bold;text-align: right; color: #d71f26;">{{moneyDoubleFormatDecimal(collect($params['comparative']['diff'])->sum('amount'))}} EUR</td>
                                                    @endif

                                                </tr>
                                            @endif
                                            <tr>
                                                <td colspan="4">&nbsp;</td>
                                            </tr>
                                        </table>

                                        <hr style="border: 1px solid #f1efef;">

                                        <table width="100%">

                                            <tr>
                                                <td colspan="3" style="font-weight: bold;padding-top: 10px;"><h2 class="aligncenter" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 24px; color: #d71f26; line-height: 1.2em; font-weight: 400; text-align: left; margin: 10px 0 0; letter-spacing: -1px;">Active Hotel List</h2></td>
                                            </tr>

                                            <tr>
                                                <td colspan="2" style="font-weight: bold;padding-top: 10px;">Number of Active Hotels</td>
                                                <td style="font-weight: bold;padding-top: 10px; text-align: right;">{{$params['activeProperty']['count']}}</td>
                                            </tr>

                                            <tr>
                                                <td colspan="3"><hr style="border: 1px dashed #f1efef;"></td>
                                            </tr>

                                            @if(empty($params['activeProperty']['lastMonth']))
                                                <tr>
                                                    <td colspan="3">No Record!</td>
                                                </tr>
                                            @else
                                                @foreach($params['activeProperty']['lastMonth'] as $period => $lastMonthGroup)

                                                    <tr>
                                                        <td colspan="2" style="font-weight: bold;padding-top: 10px;">{{$period}}</td>
                                                        <td style="font-weight: bold;padding-top: 10px; text-align: right;">{{count($lastMonthGroup)}}</td>
                                                    </tr>
                                                        @foreach($lastMonthGroup as $property)
                                                        <tr>
                                                            <td>{{$property['name']}}</td>
                                                            <td style="text-align: right; font-weight: bold;">%{{$property['commission']}}</td>
                                                            <td style="text-align: right; font-weight: bold;">@if($property['fee']) {{$property['fee']}} EUR @else - @endif</td>
                                                        </tr>
                                                        @endforeach
                                                @endforeach
                                            @endif

                                            <tr>
                                                <td colspan="3"><hr style="border: 1px dashed #f1efef;"></td>
                                            </tr>


                                            <tr>
                                                <td colspan="3" style="font-weight: bold;padding-top: 10px;">Number of Periodic Active Hotels</td>
                                            </tr>

                                            @if(empty($params['activeProperty']['groupByMonth']))
                                                <tr>
                                                    <td colspan="3">No Record!</td>
                                                </tr>
                                            @else
                                                @foreach($params['activeProperty']['groupByMonth'] as $period => $periodMonthly)
                                                    <tr>
                                                        <td colspan="2">{{$period}}</td>
                                                        <td style="text-align: right; font-weight: bold;">{{count($periodMonthly)}}</td>
                                                    </tr>
                                                @endforeach
                                            @endif


                                            <tr>
                                                <td colspan="3">&nbsp;</td>
                                            </tr>

                                        </table>

                                    </td>
                                </tr>
                                <tr style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
                                    <td class="content-block" style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
                                        <p>
                                            <span>{{date('Y-m-d H:i:s')}}</span>
                                        </p>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
        </td>
        <td style="font-family: 'Calibri', Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
    </tr>
</table>
</body>
</html>
