<? 
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}

include("../opendb.php");
include("../test.php");
$result=mysqli_query($db,"select * from crnote where ret_num='$no' and brcode='$brcode'");
$row=mysqli_fetch_array($result);
$re=mysqli_query($db,"select * from branch where brcode='$brcode'");
$brow=mysqli_fetch_array($re);

$brname=explode(',',$branch);
?>
<style>
th,td,body{font-family:arial;background-color:white;font-size:12}
</style>
<table width=100% BORDER=0>
<tr><td>TIN: <?print $brow[tin]?><BR>TAX PAYERS IDENTIFICATION NO.

</td><td align=right>CST Reg. No.:25016212<br></td></tr>
<tr><td align=center COLSPAN=2><span style={letter-spacing:5}><?print STRTOUPPER($brname[0])?> </span> <br>AUTHORISED DEALER FOR EICHER VEHICLES<BR>
<?Print $brow[braddr].','.$brow[brcity].',Phone:'.$brow[brphone]?></td></tr>
</TABLE>

<center>
<?
if($brcode=='Aut141')
print"THE KERALA VALUE ADDED TAX RULES, 2005";
else
print"THE KARNATAKA VALUE ADDED TAX RULES, 2005";
?>

<BR> FORM NO 9 <BR><BR>
<SPAN STYLE={LETTER-SPACING:5}><U>CREDIT NOTE</U></SPAN> <BR><BR>
Date:<?print datetohtml($row[date])?><BR>
</CENTER>
NO: <?print $row[ret_num]?><br>DISCOUNT
<TABLE WIDTH=100% border=0>
<TR><TD WIDTH=250>&nbsp;</td><td valign=top width=75>TO M/S</td><td>
<?
$r=mysqli_query($db,"select * from cust_master where code='$row[retfrom]' and branch='$brcode'");
$cusrow=mysqli_fetch_array($r);
print "$cusrow[custname]<br>$cusrow[addr1]<br>$cusrow[addr2]<br>$cusrow[city]";
print "Pin: $cusrow[pin]<br>$cusrow[stat]<br>KGST NO:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CST NO:</td></tr>";
?>
<tr><td colspan=3><p align=justify>This is to certify that we have credited your account with value of goodds sold amounts together with taxes related thereto as specified hereunder and that similar document has not been issued before in respect of same transaction(s)</p></td></tr>
</table>
<br>
<table width=80% cellspacing=1 cellpadding=1 bgcolor=black border=1>
<th>Particulars of<br>Credit Note <th>Description <th>Amount <th>Related<br>Tax <th>Total

<tr height=50><td>Discount <br> on Sales</td><td>
DISCOUNT ALLOWED ON INV.NO:<?print $row[sale_invoice]?> DT.<?print datetohtml($row[date])?><br>
TO <?print $cusrow[custname].','. $cusrow[dist]?></td>

<td align=right><?print $row[amt2]?></td><td align=right><?print $row[tax]?></td><td align=right><?print $row[netamt]?></td></tr>

<tr height=50><td ALIGN=CENTER><b>T O T A L</td><td>&nbsp; </td>
<td align=right><b><?print $row[amt2]?></td><td align=right><b><?print $row[tax]?></td><td align=right><b><?print $row[netamt]?></td></tr>
</table>
RUPEES <?print word($row[netamt]);?> ONLY
<br><br><br>
<table width=100% border=0>
<tr align=center><td align=left>NOTE <br> &nbsp; </TD><TD width=100>(SEAL)</TD><TD>Signature & Status of Authorised Signatory </td></tr>
<tr></tr>
<br>
<tr><td colspan=3>1. Every debit will have equivalent credit and vice versa.<br>
2. Every credit note would bear corresponding debite note and vice versa.<br>
3. Sellar and Buyer will exchange credit/debit notes mutually. <br>
4. Time limit as per Rules apply to only sales/purchase returns.
</td></tr>
<tr><td><p>&nbsp;<p>&nbsp;<b><blockquote>Customer Signature</td></tr>
<tr><td colspan=4 align=center><br>PSN - 85 YEARS OF REPUTATION & TRUST </td></tr>
</table>
<br>&nbsp;

