G:
/
PleskVhosts
/
seeonsoft.com
/
hp.thefalconunited.com
/
up file
home
<?php session_start(); include ('config.php'); $fdate = $_POST['fdate']; $tdate = $_POST['tdate']; $vatstatus = 'Vatable'; ?> <!DOCTYPE html> <html lang="en"> <head> <title>VAT Puchase</title> <meta charset="utf-8" /> <style type="text/css"> @page { size: A4; margin: .6in; } @media print { #table{ max-width: 2480px; width:100%; } #table td{ width: auto; overflow: hidden; word-wrap: break-word; } .noprint {display:none;} } </style> <script> function myFunction() { window.print(); } </script> </head> <body> <div align="center" style="background-color:#FFF"> <img src="images/logodmc.png"><HR style="border-color:#5053FD" /> <!--<h3><b><u>VAT Puchase <?php echo $sname?> From <?php echo $fdate?> To <?php echo $tdate?></u></b></h3>--> <table style="border-collapse: collapse; " border="1" cellpadding="5" id = "table" width="100%"> <thead><tr style="background-color:#030303; color:#fff;"> <th width="11%">Invoice From</th> <th width="15%">Date</th> <th width="16%">Item Description</th> <th width="25%">Amount</th> <th width="16%">VAT Paid</th> <th width="22%">Total Amount</th> <!--<th>Entered By</th>--> </tr> </thead> <?php $totcredit = 0; $totdebit = 0; $c=1; $pmode = 'Cash'; $hotel = 'hotel'; $begin = new DateTime( $fdate ); $end = new DateTime( $tdate ); for($i = $begin; $i <= $end; $i->modify('+1 day')) { $sdates = $i->format("Y-m-d"); //echo $sdates."<br>"; $resultqex = $js->prepare('SELECT * FROM `customer_expense` WHERE paydate = :sdates AND `vatstatus` = :vatstatus AND pmode != :pmode AND payhead = :hotel '); $resultqex->execute(array(':sdates' => $sdates, ':vatstatus' => $vatstatus, ':pmode' => $pmode, ':hotel' => $hotel)); while($rowqq = $resultqex->fetch(PDO::FETCH_ASSOC)) { $sdate = date('d-m-Y', strtotime($rowqq['paydate'])); $voucherno = $rowqq['expid']; $qcust = $rowqq['custid']; $mode = $rowqq['pmode']; $remarks = $rowqq['premarks']; $pdescr = $rowqq['pdescription']; $payhead = strtoupper($rowqq['payhead']); $py = $rowqq['payhead']; if($py == 'hotel') { $hid = $rowqq['paysubhead']; $resultserp = $js->prepare('SELECT * FROM `hotelreservations` WHERE id = :hid ORDER BY `cindate` '); $resultserp->execute(array(':hid' => $hid)); while($rowser = $resultserp->fetch(PDO::FETCH_ASSOC)) { $qhot = $rowser['hotel']; } $sqlcqh = $js->prepare('SELECT * FROM hotelvendor WHERE id = :qhot'); $sqlcqh->execute(array(':qhot' => $qhot)); while($rowcqh = $sqlcqh->fetch(PDO::FETCH_ASSOC)) { $qhotname = $rowcqh['hotelname']; } } else{} $sqlcq = $js->prepare('SELECT * FROM customer_entry WHERE id = :qcust '); $sqlcq->execute(array(':qcust' => $qcust)); while($rowcq = $sqlcq->fetch(PDO::FETCH_ASSOC)) { $qcustname = strtoupper($rowcq['custname']); } $paidto = $rowqq['paidto']; $ramount = $rowqq['payamount']; $totdebit += $ramount; $balance = $pclosing + $totcredit - $totdebit; $expheads = $rowq['expheads']; $result1 = $js->prepare('SELECT * FROM `heads` WHERE headid = :expheads'); $result1->execute(array(':expheads' => $expheads)); while($row1 = $result1->fetch(PDO::FETCH_ASSOC)) { $heads = $row1['name']; } $expsubheads = $rowq['expsubheads']; if($expsubheads != '') { $result2 = $js->prepare('SELECT * FROM `subheads` WHERE subid = :expsubheads'); $result2->execute(array(':expsubheads' => $expsubheads)); while($row2 = $result2->fetch(PDO::FETCH_ASSOC)) { $subheads = $row2['subname']; $against = $heads." for ".$subheads; } } else { $against = $heads; } if($c % 2 == '0') { echo "<tr style='background-color:#EEEEEE'>"; } else { echo "<tr style='background-color:#CCC'>"; } echo "<td>$qhotname</td>"; // echo "<td>Paid for $payhead Against $qcustname To $qhotname</td>"; echo "<td align='center'>$sdate</td>"; echo "<td>$qcustname - $paidto</td>"; $amoutwovat = round($ramount / 1.05, 3); $vatamount = round($ramount - $amoutwovat, 3); $piecest = explode(".", $amoutwovat); $mainmenut = $piecest[0]; $submenut = $piecest[1]; $strt= strlen($submenut); if($strt == '1') $submenut .= '00'; elseif($strt == '2') $submenut .= '0'; elseif($strt == '0') $submenut .= '000'; else{} if($mainmenut == '0') $mainmenut = '00'; $amoutwovat = $mainmenut.".".$submenut; echo "<td align='right' style='padding-right:10px; color:#E62229'>$amoutwovat</td>"; $totamountwovat += $amoutwovat; $piecest = explode(".", $vatamount); $mainmenut = $piecest[0]; $submenut = $piecest[1]; $strt= strlen($submenut); if($strt == '1') $submenut .= '00'; elseif($strt == '2') $submenut .= '0'; elseif($strt == '0') $submenut .= '000'; else{} if($mainmenut == '0') $mainmenut = '00'; $vatamount = $mainmenut.".".$submenut; echo "<td>$vatamount</td>"; $totvatamount += $vatamount; $piecest = explode(".", $ramount); $mainmenut = $piecest[0]; $submenut = $piecest[1]; $strt= strlen($submenut); if($strt == '1') $submenut .= '00'; elseif($strt == '2') $submenut .= '0'; elseif($strt == '0') $submenut .= '000'; else{} if($mainmenut == '0') $mainmenut = '00'; $ramount = $mainmenut.".".$submenut; echo "<td align='right' style='padding-right:11px; color:green'><strong>$ramount</strong></td>"; $totramount += $ramount; echo "</tr>"; $c++; } } $invid = ''; $services = ''; $mode = ''; //echo "total credit".$totcredit."<br>"; //echo "total debit".$totdebit; $closing = $totcredit - $totdebit; ?> <tr style="line-height:30px;"> <th colspan="3" align="right" style="color:#FC4136">Total</th> <th align="right" style="padding-right:10px; color:#990066"><?php echo $totamountwovat; ?></th> <th align="right" style="padding-right:10px; color:#990066"><?php echo $totvatamount; ?></th> <th align="right" style="padding-right:10px; color:#990066"><?php echo $totramount; ?></th> </tr> </table> <div class="noprint"> <p align="center"> <a href="#" onClick="myFunction()" style="border:5px solid; background-color:#0B57D0; color:#FFF; padding:8px; text-decoration:none;">PRINT</a> <a href="excel_vatreportpurchase.php?fdate=<?php echo $fdate?>&&tdate=<?php echo $tdate?>" style="border:5px solid; background-color:#093; color:#FFF; padding:8px; text-decoration:none;">EXPORT TO EXCEL</a> <a href="search_ledgerstatement.php" style="border:5px solid; background-color:#F00; color:#FFF; padding:8px; text-decoration:none;">CLOSE</a> </p> </div> </div>