<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <link rel="stylesheet" href="<?php echo e(asset('vendor/bootstrap/dist/css/bootstrap.min.css')); ?>">
        <style type="text/css">
            @import  url("https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800");
            @import  url("https://fonts.googleapis.com/css?family=Open+Sans:400,600,700");
            @import  url("https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700");
            @import  url("https://fonts.googleapis.com/css?family=Roboto:400,500,700");
            @import  url("https://fonts.googleapis.com/css?family=Nunito:400,600,700");
        </style>
    </head>
    <body>
        <?php
            $ticket_date_crt = date("d-M-Y", strtotime($ticket_date));
        ?>
        <span style="text-align: center;"><u><b><?php echo e($org_name); ?></b></u><br></span>
        <span style="text-align: center;"><u><b>COUNTER COLLECTION REPORT FOR THE INVOICE DATE <?php echo e($ticket_date_crt); ?></b></u><br></span>
        <table width="100%" class="table" style="font-size: 70%;" border="1">
            <thead class="thead-info">
                <tr>
                    <th>#</th>
                    <th>Invoice #</th>
                    <th>Invoice Date</th>
                    <th>Show Date</th>
                    <th>Ticket #</th>
                    <th>Facility</th>
                    <th>Adults</th>
                    <th>Child</th>
                    <th>Method</th>
                    <th>Amount</th>
                    <th>User</th>
                    <th>Cash</th>
                    <th>Card</th>
                    <th>UPI</th>
                    <th>Cancelled(Cash)</th>
                </tr>
            </thead>
            <tbody>
                <?php
                    $n = 0;
                    $total_amount = 0;
                    $total_child_count = 0;
                    $total_adult_count = 0;
                    $total_cash_count = 0;
                    $total_card_count = 0;
                    $total_upi_count = 0;
                    $total_refund_amount = 0;
                ?>
                <?php $__currentLoopData = $ticket_arr; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ticket_id): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($invoice_array[$ticket_id]['invoice_number'])): ?>
                        <?php
                            $n++;
                        ?>
                        <tr>
                            <td><?php echo e($n); ?></td>
                            <td><?php echo e($invoice_array[$ticket_id]['invoice_number']); ?></td>
                            <td><?php echo e($invoice_array[$ticket_id]['invoice_date']); ?></td>
                            <td><?php echo e($invoice_array[$ticket_id]['show_date']); ?></td>
                            <td><?php echo e($invoice_array[$ticket_id]['ticket_no']); ?></td>
                            <td><?php echo e($invoice_array[$ticket_id]['facility_name']); ?></td>
                            <td style="text-align: center;">
                                <?php echo e($invoice_array[$ticket_id]['noofadult']); ?>

                                <?php if(isset($invoice_array[$ticket_id]['noofadult'])): ?>
                                    <?php
                                        $total_adult_count += $invoice_array[$ticket_id]['noofadult'];
                                    ?>
                                <?php endif; ?>
                            </td>
                            <td style="text-align: center;">
                                <?php echo e($invoice_array[$ticket_id]['noofchild']); ?>

                                <?php if(isset($invoice_array[$ticket_id]['noofchild'])): ?>
                                    <?php
                                        $total_child_count += $invoice_array[$ticket_id]['noofchild'];
                                    ?>
                                <?php endif; ?>
                            </td>
                            <td style="text-align: center;"><?php echo e($invoice_array[$ticket_id]['payment_method']); ?></td>
                            <td style="text-align: right;">
                                <?php echo e($invoice_array[$ticket_id]['amount']); ?>

                                <?php if(isset($invoice_array[$ticket_id]['amount'])): ?>
                                    <?php
                                        $total_amount += $invoice_array[$ticket_id]['amount'];
                                    ?>
                                <?php endif; ?>
                            </td>
                            <td><?php echo e($invoice_array[$ticket_id]['counter_user']); ?></td>
                            <td>
                                <?php if($invoice_array[$ticket_id]['payment_method']=="Cash"): ?>
                                    <?php echo e($invoice_array[$ticket_id]['amount']); ?>

                                    <?php if(isset($invoice_array[$ticket_id]['amount'])): ?>
                                    <?php
                                        $total_cash_count += $invoice_array[$ticket_id]['amount'];
                                    ?>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if($invoice_array[$ticket_id]['payment_method']=="Card"): ?>
                                    <?php echo e($invoice_array[$ticket_id]['amount']); ?>

                                    <?php if(isset($invoice_array[$ticket_id]['amount'])): ?>
                                    <?php
                                        $total_card_count += $invoice_array[$ticket_id]['amount'];
                                    ?>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if($invoice_array[$ticket_id]['payment_method']=="UPI"): ?>
                                    <?php echo e($invoice_array[$ticket_id]['amount']); ?>

                                    <?php if(isset($invoice_array[$ticket_id]['amount'])): ?>
                                    <?php
                                        $total_upi_count += $invoice_array[$ticket_id]['amount'];
                                    ?>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </td>
                            <td>
                                
                            </td>
                        </tr>
                    <?php endif; ?>
                    <?php if(isset($cancelled_array[$ticket_id]['invoice_number'])): ?>
                        <?php
                            $n++;
                        ?>
                        <tr>
                            <td><?php echo e($n); ?></td>
                            <td><?php echo e($cancelled_array[$ticket_id]['invoice_number']); ?></td>
                            <td><?php echo e($cancelled_array[$ticket_id]['invoice_date']); ?></td>
                            <td><?php echo e($cancelled_array[$ticket_id]['show_date']); ?></td>
                            <td><?php echo e($cancelled_array[$ticket_id]['ticket_no']); ?></td>
                            <td><?php echo e($cancelled_array[$ticket_id]['facility_name']); ?></td>
                            <td style="text-align: center;">
                                <?php echo e($cancelled_array[$ticket_id]['noofadult']); ?>

                                <?php if(isset($invoice_array[$ticket_id]['noofadult'])): ?>
                                <?php
                                    $total_adult_count += $cancelled_array[$ticket_id]['noofadult'];
                                ?>
                                <?php endif; ?>
                            </td>
                            <td style="text-align: center;">
                                <?php echo e($cancelled_array[$ticket_id]['noofchild']); ?>

                                <?php if(isset($invoice_array[$ticket_id]['noofchild'])): ?>
                                <?php
                                    $total_child_count += $cancelled_array[$ticket_id]['noofchild'];
                                ?>
                                <?php endif; ?>
                            </td>
                            <td style="text-align: center;"><?php echo e($cancelled_array[$ticket_id]['payment_method']); ?></td>
                            <td style="text-align: right;">
                                <?php echo e($cancelled_array[$ticket_id]['amount']); ?>

                                <?php if(isset($cancelled_array[$ticket_id]['amount'])): ?>
                                    <?php
                                        $total_amount += $cancelled_array[$ticket_id]['amount'];
                                    ?>
                                <?php endif; ?>
                            </td>
                            <td><?php echo e($cancelled_array[$ticket_id]['counter_user']); ?></td>
                            <td>
                                
                            </td>
                            <td>
                                
                            </td>
                            <td>
                                
                            </td>
                            <td>
                                <?php if($cancelled_array[$ticket_id]['payment_method']=="Cash"): ?>
                                    <?php echo e($cancelled_array[$ticket_id]['refund_amount']); ?>

                                    <?php if(isset($invoice_array[$ticket_id]['refund_amount'])): ?>
                                    <?php
                                        $total_refund_amount += $cancelled_array[$ticket_id]['refund_amount'];
                                    ?>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
            <tfoot class="tfoot-info">
                <tr>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th align="right"><?php echo e($total_adult_count); ?></th>
                    <th align="right"><?php echo e($total_child_count); ?></th>
                    <th>&nbsp;</th>
                    <th align="right"><?php echo e($total_amount); ?></th>
                    <th>&nbsp;</th>
                    <th align="right"><?php echo e($total_cash_count); ?></th>
                    <th align="right"><?php echo e($total_card_count); ?></th>
                    <th align="right"><?php echo e($total_upi_count); ?></th>
                    <th align="right"><?php echo e($total_refund_amount); ?></th>
                </tr>
            </tfoot>
        </table>
    </body>
</html>
                                    <?php /**PATH /var/www/html/ksstmprod/resources/views/Reports/download_counter_collection_report_pdf.blade.php ENDPATH**/ ?>