<style type="text/css">
    table {
        margin-bottom: 10px;
        width: 100%;
    }
    table td{
        padding-bottom: 12px;
        border-collapse:collapse;
        border:1px solid #aaa;
    }
</style>
    <?php
    echo '<table id="receipt" style="text-align:left;border-collapse:collapse;font-size: 12px;width: 100%;padding:8px;">'
    . '<tbody>';
    if ($closedcashdetails[0]->DATEEND == NULL) {
        echo '<tr>
                <td colspan="5" align="center" style="border:none;"><h3>Partial Cash Report</h3></td>
            </tr>';
    } else {
        echo '<tr>
                <td colspan="5" align="center" style="font-weight:bold;border:none;">Close Cash Report</td>
            </tr>';
    }
    echo '<tr>
            <td colspan="8" align="left" style="border:none;"><h3>Payments Report</h3></td>
        </tr>';
    echo '<tr><td colspan="5" align="right" style="font-size:14px;border:none;">Total</td></tr>';
    if ($closedcashamount != NULL) {
        echo '<tr><td colspan="3" align="left" style="width:60%;">Cash</td>'
            . '<td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedcashamount), "</td>"
            . "</tr>";
    }
    if ($closedcashinamount != NULL) {

        echo '<tr><td colspan="3" align="left">CashIn</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedcashinamount), "</td></tr>";
    }
    if ($closedcashoutamount != NULL) {

        echo '<tr><td colspan="3" align="left">CashOut</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedcashoutamount), "</td></tr>";
    }

    if ($closeddebtamount != NULL) {

        echo '<tr><td colspan="3" align="left">Debt</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closeddebtamount), "</td></tr>";
    }
    if ($closedcreditpaidamount != NULL) {
        echo '<tr><td colspan="3" align="left">Credit Paid</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedcreditpaidamount), "</td></tr>";
    }

    if ($closeddebtpaidamount != NULL) {
        echo '<tr><td colspan="3" align="left">Debt Paid</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closeddebtpaidamount), "</td></tr>";
    }
    if ($closedchequeamount != NULL) {
        echo '<tr><td colspan="3" align="left">Cheque</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedchequeamount), "</td></tr>";
    }
    if ($closedcardamount != NULL) {
        echo '<tr><td colspan="3" align="left">Card</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedcardamount), "</td></tr>";
    }
    if ($closedfreeamount != NULL) {
        echo '<tr><td colspan="3" align="left">Free</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedfreeamount), "</td></tr>";
    }
    if ($closedrefundamount != NULL) {
        echo '<tr><td colspan="3" align="left">Refund</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedrefundamount), "</td></tr>";
    }
    if ($closedonlineamount != NULL) {
        echo '<tr><td colspan="3" align="left">Online</td><td colspan="2" align="right">', $this->formatslist->formatCurrencywithHash($closedonlineamount), "</td></tr>";
    }
    
    if ($receiptscount != NULL) {
        echo '<tr><td colspan="3" align="left">Receipts:</td><td colspan="2" align="right">', $receiptscount, "</td></tr>";
    }
    if ($paymentscount != NULL) {
        echo '<tr><td colspan="3" align="left">Payments:</td><td colspan="2" align="right">', $paymentscount, "</td></tr>";
    }
    echo '<tr><td colspan="3" align="left">Total Sales</td><td colspan="2" style="text-align: right;">', $this->formatslist->formatCurrencywithHash(($closedcashamount) + ($closeddebtamount) + ($closeddebtpaidamount) + ($closedchequeamount) + ($closedcardamount) + ($closedfreeamount) + ($closedrefundamount)), "</td></tr>";
    echo "</tbody></table>";

    echo '<table id="receipt" style="font-size: 12px;width:100%;padding:8px;">';
    echo "<tbody>";
    echo '<tr><td align="left" style="width:60%;">Station</td><td align="right" style="width:40%;">', $closedcashdetails[0]->HOST, '</td></tr>';
    echo '<tr colspan="3"><td align="left">Sequence</td><td align="right">', $closedcashdetails[0]->HOSTSEQUENCE, '</td></tr>';
    echo '<tr colspan="3"><td align="left">StartDate</td><td align="right">', $closedcashdetails[0]->DATESTART, '</td></tr>';
    echo '<tr colspan="3"><td align="left">EndDate</td><td align="right">', $closedcashdetails[0]->DATEEND, '</td></tr>';
    echo '</tbody>';
    echo '</table>';
    ?>