<? 
session_start();
$brcode = $_SESSION['brcode'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
$invno= $_REQUEST['invno'];
include("../opendb.php");
include("../test.php");
$result=mysqli_query($db,"select * from profinv where invno='$invno' and brcode='$brcode'");
$row=mysqli_fetch_array($result);

$re=mysqli_query($db,"select * from branch where brcode='$brcode'");
$brow=mysqli_fetch_array($re);

?>
<style>
td,body{font-family:arial;background-color:white;font-size:12}
</style>
<table width=100%>
<tr><td align=left><span style={letter-spacing:5}><u><img src="psn-logo-trans.png" alt="PSN Logo" width="140" height="80">
  </u></span></TD></tr>
<tr><td align='center'><font size='5'>PSN AUTOMOBILES PVT LTD</font></td></TR>
<tr><td align='center'><?echo $brow[braddr]?></td></tr>
<tr><td align='center'><?echo $brow[brcity]?></td></tr>
<tr><td align='center'>Tel No.:<?echo $brow[brphone]?></td></tr>
<tr><td align='center'>GSTIN :<?echo $brow[gst]?></td></tr>
<?
$brname=explode(',',$branch);
?>

</TABLE>

<br><br>

<center>
<TABLE width=100% border=0>
<tr><td colspan='2' width =50%><font size='3'><b>Proforma Invoice No. <?print $invno?></b></font></td><td colspan= '2' align=right width =50%>Date : <?print datetohtml($row[invdate])?></td>
</table>
</center>


To:
<blockquote>&nbsp;&nbsp;&nbsp;
<? print $row[cust].'<br>&nbsp;&nbsp;&nbsp;&nbsp;'.str_replace('-','<br>&nbsp;&nbsp;&nbsp;&nbsp;',$row[addr])?>
<br>&nbsp;&nbsp;&nbsp;&nbsp;<?if($row[type]>'') print "GSTIN :".$row[type]?>&nbsp;&nbsp;&nbsp;&nbsp;
</blockquote>
<TABLE align = center CELLSPACING=1 CELLPADDING=1 BGCOLOR=BLACK width=90% border=1>
<tr align=center><td>SL<br>No.</td><td>Description </td>
<td>Unit Price </td><td>Qty</td><td>Gross Value</td><td>Disc / unit</td><td>Basic Price</td><td>CGST%</td><td>CGST Amt</td><td>SGST%</td><td>SGST Amt</td>
<?
if($row[cessamt]>0)
{
?>
    <td>Cess</td>
<?}?>
<td>Grand Total</td></tr>

<tr valign=top><td>1</td><td><?print $row[config]?></td>
<td align=right><?print $row[unit]?></td><td align=right><?print $row[qty]?></td>
<td align=right><?print $row[unit]*$row[qty]?></td><td align='right'><?print $row[disc]?></td>
<?$cgstper = $row[taxp]/2;?>
<td align=right><?print $row[amt2]?></td><td align='right'><?print $cgstper.'%'?></td>
<?$cgstamt = round($row[amt2]*($row[taxp]/2/100),2);?>
<td align=right><?print $cgstamt?></td><td align='right'><?print $cgstper.'%'?></td><td align=right><?print $cgstamt?></td>
<?if($row[cessamt]>0)
{
?>
    <td align=right><?print $row[cessamt]?></td>
<?}
$net = $row[amt2]+$row[tax]+$row[cessamt]
?>
<td align=right><?print $net?></td><br><br></td></tr>
<?
$tcsamt=($row[amt2]+$row[tax]+$row[cessamt])*$row[tcsamt]/100;
$tcsamt=number_format($tcsamt, 2, '.', '');
$tcsamt=round($tcsamt);
$netamount=round($net+$tcsamt,0);


$tcsamt=number_format($tcsamt, 2, '.', '');
if($tcsamt>0)
{
    if($row[cessamt]>0)
    {?>
<tr><td>&nbsp;</td><td colspan=11 align=center>Tax Collected at Source (TCS) @<?print $row[tcsamt];?>%</TD>        
    <?}
    else
    {
    ?>
<tr><td>&nbsp;</td><td colspan=10 align=center>Tax Collected at Source (TCS) @<?print $row[tcsamt];?>%</TD>
<?}?>
<td align=right><?print $tcsamt ?></td>
</tr>

<?
}
?>




<tr><td>&nbsp;</td><td>T O T A L</TD><td>&nbsp;</td><td>&nbsp;</td>
<td align=right><?print $row[unit]*$row[qty]?></td><td align='right'><?print $row[disc]?></td><td align=right><?print $row[amt2]?><td></td><td align=right><?print $cgstamt?></td><td></td>
<td align=right><?print $cgstamt?></td>
<?if($row[cessamt]>0)
{
?>
    <td align=right><?print $row[cessamt]?></td>
<?}?>
<td align=right><font size=3><?print $netamount ?></td>
</tr>
</table>


<?
$gtot=$netamount+$row[regis_permit_amt]+$row[insurenceamt]+$row[speedgvr];
?>

<table width=100% cellspacing=4 border=0>
<tr><td>GVW :</td><td><b><? print $row[gvw] ?></b></td><td>Insurance charges :</td><td><b><? print $row[insurenceamt] ?></b></td><td width=160></td></tr>
<tr><td>Wheel Base :</td><td><b><? print $row[wheel] ?></b></td><td></td><td></td><td width=160></td></tr>
<tr><td>Tyre size :</td><td><b><? print $row[tyre] ?></b></td><td>Tax,Registration.permit <br> and Other expenses :</td><td><b><? print $row[regis_permit_amt] ?></b></td><td width=160></td><td><b>Total</b></td><td><font size='3'><b><? print $gtot ?></font></td></tr>
<?//<tr><td></td><td><b></b></td><td colspan=4 align='right'><b>Cost for FASTAG (will be extra)</td><td><font size='3'><b><? if($row[fastag]>0){ print $row[fastag].'/Veh.';}else { print '&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp/Veh'; }?></font></td></tr>

</table>
<table  width=100% cellspacing=4 border=0>
<tr><td width=100 valign=top>&nbsp;&nbsp;Remarks :</td><td><b><? print $row[remark] ?></b></td></tr>
<tr><td width=100 valign=top>&nbsp;&nbsp;Warranty :</td><td><? print $row[warranty] ?></td></tr>
<tr><td width=50 valign=top>&nbsp;&nbsp;&nbsp;Note :</td><td>
<?
$brname=explode(',',$branch);
?>
 
 <?
if($brcode=='Aut141')
{

print"<font size=1>1. The Full payment in advance by Electronic transfer to our </font><b><u> Bank A/c no.30440302994 </u>of SBI,SSI Branch Ernakulam<b> (IFSC Code.SBIN0005387)</b> <font size=1>or crossed Bank draft in favour of</font> <font size=1> <?print $brname[0]?>,</font><b><u> A/c No. 30440302994</u></b> payable at Ernakulam.";
}
else
{


print"<font size=1>1. The Full payment in advance by Electronic transfer to our </font><b><u> Bank A/c no.30728155988 </u>of SBI,SSI Branch Ernakulam<b> (IFSC Code.SBIN0005387)</b> <font size=1>or crossed Bank draft in favour of</font> <font size=1> <?print $brname[0]?>,</font><b><u> A/c No. 30728155988</u></b> payable at Ernakulam.";
  }
?>
</td></tr>
<tr><td></td><td><font size=1>2. Prices prevailing at the date of delivery will be applicable.</font></td></tr>
<tr><td></td><td><font size=1>3. The delivery of the vehicle will be effected within two weeks from the date of receipt of full payment for standard configuration. For builtups and non standard configurations, delivery will be effected in 4 to 6 weeks from the date of receipt of full payment. </font></td></tr>
<tr><td></td><td><font size=1>4. Arranging finance for new vehicle will be the sole responsibility of the customer.</font></td></tr>
<tr><td></td><td><font size=1>5. Advance payment will be refunded only after deducting Rs5000/- as Cancellation Charge, if the order is cancelled by the customer.</font></td></tr>
<tr><td></td><td><font size=1>6. In case of cancellation, cancellation request letter has to be forwarded along with the original order booking form and original receipt. Refund will be made with in one month with out  any interest</font></td></tr>
<tr><td></td><td><font size=1>7. In the case of exchange deal, Exchange price will be as per terms & conditions mentioned in the exchange vehicle agreement signed by customer and exchange vehicle in charge of the  company.</font></td></tr>
<tr><td></td><td><font size=1>8. Price allowed for exchanging old vehicle will be valid only if customer takes delivery of new vehicle from PSN.</font></td></tr>
<tr><td></td><td><font size=1>9. Vehicle once sold will not be taken back.</font></td></tr>
<tr><td></td><td><font size=1>10. Subject to Force Majeure clause</font></td></tr>
<tr><td></td><td><font size=1>11. Subject to jurisdiction of Courts at Ernakulam.</font></td></tr>
<tr><td></td><td><font size=1>12. The customer shall not be entitled to transfer the booking effected into the name of any other person and the vehicle. would be delivered, and invoiced only in the Name &Address of the person specified in the Delivery Order of the Financier.</font></td></tr>
<tr><td></td><td><font size=1>13. For registering vehicles under Company name, D&O license  issued by the local Government body is required and kindly submit the same during registration process.</font></td></tr>
</table>

