<?php require('includes/finance/finance_functions.php');
//////////////////////////
/// PAYMENT STATUS     ///
/// 1 - Unpaid         ///
/// 2 - Reminder       ///
/// 3 - Paid           ///
/// 4 - Refund         ///
/// 5 - Archive        ///
//////////////////////////

?>

<p class="blockquote mt-n5"><span class="float-right remove"><a class="btn btn-secondary" href="index.php?t=includes/finance&p=vat_reports.php"><i class="fal fa-file-invoice"></i> View Reports </a></span>VAT Reporting</p>

<div class="row">
    <div class="col-md-4">
        <div class="input-group row">
            <div class="col-md-3"><label class="lead control-label" for="date">Start date</label></div>
            <div class="col-md-6 input-group"><input class="form-control datepicker" type="text" name="sdate" id="sdate" value="<?php echo $date?>" placeholder="DD-MM-YYYY" /></div>
        </div>
    </div>

    <div class="col-md-4">
        <div class="input-group row">
            <div class="col-md-3"><label class="lead control-label" for="date">End date</label></div>
            <div class="col-md-6 input-group"><input class="form-control datepicker" type="text" name="edate" id="edate" value="<?php echo $date?>" placeholder="DD-MM-YYYY" /></div>
        </div>
    </div>

    <div class="col-md-2">
        <div class="input-group row">
        <div class="col-md-3"><label class="lead control-label" for="date">Type</label></div>
        <div class="col-md-6 input-group">
        <select class="form-control" id="type">
        <option value="receipts">Input</option>
        <option value="expenditure">Output</option>
        </select>
        </div>
        </div>
    </div>

    <div class="col-md-2">
        <div class="input-group row">
            <button id="genButton" class="btn btn-info m-0 px-3 py-2"><i class="fal fa-money-check"></i> Load entries</button>
        </div>
    </div>
</div>
<hr>
<div id="resultBox"></div>



<script>
$('#genButton').click(function(){
var s=$('#sdate').val()
var e=$('#edate').val()
var t=$('#type').val()
if(s==="" || e===""){response('danger','<strong>SELECT COMPLETE DATE RANGE</strong>')}
else{
$('#resultBox').load('includes/finance/finance_vat_data.php',{start:s, end:e, type:t},function(){})

}

})

$('#calandarToday').click(function(){$('#edate').val('<?php echo date('d-m-Y')?>')})
$('#navBox').html('<li class="breadrumb-item"><a href="index.php?t=includes/finance&p=finance_invoices.php">Finance</a><i class="fad fa-angle-double-right mx-2 mt-1"" aria-hidden="true"></i></li><li class="breadrumb-item active">VAT</li>')

</script>