
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta charset="utf-8">
  <!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
  <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">-->
  <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>-->
  <!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>-->
    <title>Quatation Print</title>

    <style>
        .center {
            text-align: center;
        }
        .style2{
            font-size:18px;
        }
        .right {
            text-align: right;
        }

        .tb  {
           width: 1050px;
           border: 1px solid black;


           border-collapse: collapse;
       }
       .tb td  {

           border-top: 1px solid black;
           border-left: 1px solid black;


           border-collapse: collapse;
       }
       .tb th  {

           border-top: 1px solid black;
           border-left: 1px solid black;


           border-collapse: collapse;
       }

       .tb1 {

           border: 1px solid #000000;
       }

   </style>

</head>
<?php
session_start();
    if ($_SESSION['company'] == "") { 
        exit("Please Login");
    }
    if ($_SESSION['CURRENT_USER'] == "") { 
        exit("Please Login");
    }
 require_once("connectioni.php");

$sql = "SELECT * from view_quomas_quotrn_s_mas where REF_NO= '" . trim($_GET["invno"]) . "'   ";
            $result = mysqli_query($GLOBALS['dbinv'], $sql);
            $row = mysqli_fetch_array($result);

             $sql_para = "SELECT * from invpara where flag='".$_SESSION['company']."'";  
            $result_para = mysqli_query($GLOBALS['dbinv'], $sql_para);
            $row_invpara = mysqli_fetch_array($result_para);

            if ($_GET["Op_vat"] == "false") {
                $txtvatstatus = "Inclusive Of The VAT";
                $Text14 = "Vat No =" . $row_para["VAT"];
            } else {
                $txtvatstatus = "Exclusive Of The VAT";
            }
            $txtdes = $_GET["TXTREMARK"];
            $txthead = "QUOTATION FOR " . trim($_GET["COM_GROUPS"]);





            $sql = "Select * from s_quomas where REF_NO='" . $_GET["invno"] . "'";
            $result = mysqli_query($GLOBALS['dbinv'], $sql);
            $row = mysqli_fetch_array($result);
            
            $grandtot = $row["GRAND_TOT"];
            
            $sql4 = "Select * from s_salrep where REPCODE='" . $row["SAL_EX"] . "'";
            $result4 = mysqli_query($GLOBALS['dbinv'], $sql4);
            $row4 = mysqli_fetch_array($result4);
            
            $sql5 = "Select * from s_stomas where CODE='" . $row["DEPARTMENT"] . "'";
            $result5 = mysqli_query($GLOBALS['dbinv'], $sql5);
            $row_dep = mysqli_fetch_array($result5);

            $sql1 = "Select * from vendor where CODE='" . $row["C_CODE"] . "'";
            $result1 = mysqli_query($GLOBALS['dbinv'], $sql1);
            $row1 = mysqli_fetch_array($result1);

            $sql2 = "Select * from s_quotrn where REF_NO='" . $_GET["invno"] . "'";
            $result2 = mysqli_query($GLOBALS['dbinv'], $sql2);
            $row2 = mysqli_fetch_array($result2);

 
            
            
            if ($row["VAT"] == "1") { 
                $txtcusvat = "Customer VAT  " . $row["vat_no"];
                $txtcomvat = "VAT Reg. " . $row_para["VAT"];
                $RTXTVAT = "VAT " . $row["GST"] . "%  ";
                $RTXVATAMU = $row["BTT"];
                $txttaxinv = "<b>TAX INVOICE</b>";
                $txtsubtot = $row["AMOUNT"];
                $txtsubtotdes = "Sub Total";
            }else if ($row["SVAT"] != "0") { 
                $txtcusvat = "Customer VAT  " . $row["vat_no"];
                $txtcomvat = "VAT Reg. " . $row_invpara ['vatrate'];
                $RTXTVAT = "Suspended VAT " . $row["GST"] . "%  ";
                $RTXVATAMU = $row["BTT"];
                $txttaxinv = "<b>SUSPENDED TAX INVOICE</b>";
                $txtsubtot = $row["AMOUNT"];
                $txtsubtotdes = "Nett Total";

                $txtoursvat = "SVAT Reg. " . $row_invpara["svatno"];
                $txtcussavat = "Customer SVAT " . $row["s_vat_no"];
            }


?>
<body style="font-family:  "Times New Roman", Times, serif;">
 
    <table width="1050px;" cellspacing="0" border="0">
        <tr>
             <td style='width: 100px;'>
                 <!--<img style="width: 225px;margin-top:-20px;height:109px" src="new/img/logonew.png"/> -->
            </td>
            <td>
                <center><p style="margin: 0px;margin-left:-67px !important;font-size: 30px;" ><b><?php echo $row_invpara["COMPANY"] ; ?></b></p> </center>
                <center><p style="margin: 0px;margin-left:-93px !important;font-size: 18px;" ><b><?php echo $row_invpara["ADD1"].','.$row_invpara["ADD2"] ; ?></b></p></center>
                <center><p style="margin: 0px;margin-left:-78px !important;font-size: 18px;" ><b><?php echo "Telephone -".$row_invpara["TELE"] ; ?></b></p></center>
                <center><p style="margin: 0px;margin-left:-100px !important;font-size: 18px;" ><b><?php echo "E-mail -  ".$row_invpara["EMAIL"] ; ?></b></p></center>
                <center><p style="margin: 0px;margin-left:-112px !important;font-size: 18px;" ><b><?php if($row["VAT"]=="1"){ 
               echo "VAT Registration No. - " . $row_invpara["VAT"];
                  }?></b></i></p></center>
                <br>
            </td> 
        </tr>
    </table> 
      
    <table width="1050px;" cellspacing="0" border="0">
        <tr>
            <td> 
                 <!--<img style="  width: 245px;margin-top:-20px;" src="img/lassa.jpg"/> -->
            </td>
            <td align="right" style=" margin-top:-20px;">
               
                <?php
                 
                 if($row['CANCELL'] =="1"){?>
                 <center><p style="margin: 0px;font-size:24px;color:red" ></p></center>
              <?php  }else{?>
                    <center><p style="margin: 0px;font-size:24px;" >
                <?php   }?>
                
                    <b><u>
                        <?php 
                                    if($row["VAT"]=="1"){
                                        if($row['CANCELL'] =="1"){
                                            echo "CANCELED  QUOTATION";
                                        }else{
                                             echo " QUOTATION";
                                        }
                                       
                                    }else{
                                         if($row['CANCELL'] =="1"){
                                            echo "CANCELED QUOTATION    ";
                                        }else{
                                              echo "QUOTATION   ";
                                        }
                                      
                                          
                                    }
                        ?> 
                </u></b></p></center>
            </td>
            <td align="right">
                 <!--<img style="  width: 245px;margin-top:-20px;" src="img/radar.png"/> -->
            </td>
            
        </tr>
        <tr>
           <td>&nbsp;</td>
        </tr>  
        <tr>
           <td>&nbsp;</td>
        </tr>  
    </table>
     
    <table width="1050px;" cellspacing="0" border="0"> 
        <tr>
            <td colspan="5" class="style2"><b>CUSTOMER:</b> <?php echo $row['CUS_NAME']; ?></td>
            
            <td width="150"><span class="style2"><b>QUO DATE:</b></span></td>  
            <td width="30" align="right" class="style2"><?php echo $row['SDATE']; ?></td>
        </tr>
        <tr> 
            <td colspan="4" ><span class="style2" ><?php echo  strtoupper($row1['ADD1'])?></span></td>
            <td width="10" height="21" align="left"><span class="style2"> </span></td>
            <td width="20"><span class="style2"><b>QUO NO:</b></span></td> 
            <td width="200" align="right" ><span class="style2"><?php echo $row['REF_NO'] ?></span></td> 
        </tr>
         
        <tr>
            <td width="500" height="21" align="left"><span class="style2"><b>TEL </b>- <?php echo $row1['TELE1'] ?> </span></td>
            <td colspan="4"></td> 
            <td width="180"><span class="style2"><b>DEPARTMENT:</b></span></td> 
            <td width="30" align="right"><span class="style2"><?php echo $row_dep["DESCRIPTION"]; ?></span></td> 
        </tr>
        
        <tr>
            <td colspan="4" class="style2"><?php if($row["VAT"]=="1"){?>VAT REG. NO. -
                           <?php echo $row1["vatno"];
                            }?></td> 
            <td width="10" height="21" align="left"><span class="style2"> </span></td>
            <td width="180"><span class="style2"><b>SALES.EX :</b></span></td> 
            <td width="30"align="right" class="style2"><span><?php echo $row4['Name']; ?></span></td> 
        </tr>
        <tr> 
            <td colspan="4" ><span class="style2" ><b>PAYMENT TERM - </b><?php echo $row['pay_type']; ?></span></td>
            <td width="10" height="21" align="left"><span class="style2"> </span></td>
            <td width="20"><span class="style2"><b>VALID DATES:</b></span></td> 
            <td width="200" align="right" ><span class="style2"><?php echo $row['validity']; ?></span></td> 
        </tr>
       <tr> 
            <td colspan="4" ><span class="style2" ><b>CREDIT PERIOD - </b><?php echo $row['cre_pe']; ?></span></td>
            <td width="10" height="21" align="left"><span class="style2"></span></td>
            <td width="20"><span class="style2"><b></b></span></td> 
            <td width="200" align="right" ><span class="style2"></span></td> 
        </tr>
        
         <tr>
            <td width="10" height="21" align="left"><span class="style2"> </span></td>
            <td colspan="4"></td> 
            <td><span>&nbsp;</span></td> 
        </tr> 
         <tr>
            <td colspan="12"  class="style2"><b>We submit herewith our sales Quotation for the below mentioned tyres. Prices quoted are discounted with Manufacturing Warranty.</b> </td>   
        </tr>
        <tr>
            <td colspan="12"  class="style2"><b>&nbsp;</b> </td>   
        </tr>
    </table>
     
    <table   width="1050px;" >
        
        <?php if(($row["VAT"] == "1") or ($row["VAT"] == "2")){?>
        <tr style="font-size:15px;">
             <th width="30px;"></th>
             <td width="850"><b><u>ITEM DESCRIPTION</u></b></td>
             <td width="135" align="right"><b><u>UNIT PRICE<u></b> </td>
             <td width="180" align="right"><b><u>UNIT VAT<u></b></td>
             <td width="130" align="right"><b><u>UNIT PRICE<u></b></td>
             <td width="80" align="right"><b><u>QTY<u></b></td>
             <!--<td width="50" align="right"><b><u>DIS(%)<u></b></td>-->
             <td width="145" align="right"><b><u>TOTAL<u></b></td>
        </tr>
        <tr style="font-size:18px;">
             <th width="30px;"></th>
             <td width="850"><b>&nbsp;</b></td>
             <td width="50" align="center" style="font-size:11px;"><b>(WITHOUT VAT)</b></td>
             <td width="145" align="right" style="font-size:11px;"><b>(<?php echo number_format($row["GST"],0);?>%)</b></td>
             <td width="50" align="center" style="font-size:11px;"><b>(WITH VAT)</b></td>
             <td width="135" align="right"><b>&nbsp;</b></td>
             <!--<td width="90" align="right"><b>&nbsp;</b></td>-->
             <td width="145" align="right" style="font-size:11px;"><b>(WITH VAT)</b></td>
        </tr>
        <?php } else{ ?>
        <tr style="font-size:18px;">
             <th width="30px;"></th>
             <td width="850"><b><u>ITEM DESCRIPTION</u></b></td>
             <td width="80" align="right"><b><u>QTY<u></b></td>
             <td width="135" align="right"><b><u>UNIT PRICE<u></b></td>
             <!--<td width="70" align="right"><b><u>DIS(%)<u></b></td>-->
             <!--<td width="80" align="right"><b><u>Q DIS(%)<u></b></td>-->
             <td width="145" align="right"><b><u>TOTAL<u></b></td>
        </tr>
        <tr style="font-size:18px;">
             <th width="30px;"></th>
             <td width="850"><b>&nbsp;</b></td>
             <td width="80" align="right"><b>&nbsp;</b></td>
             <td width="135" align="right"><b>&nbsp;</b></td>
             <!--<td width="50" align="right"><b>&nbsp;</b></td>-->
             <td width="145" align="right"><b>&nbsp;</b></td>
        </tr>
        <?php } ?>
        
        <?php
        $i=1;  
        $part="";
        $qty=0;
        $TOTPRICE=0;
        $unittot=0;
        $distot=0;
        $disgtot=0;
        $unitgtot=0;
        $rr=0;
        $rrtot=0; 
        $sql1 = "Select * from s_quotrn where REF_NO='" . $_GET["invno"] . "' ORDER BY ID DESC";
        $result1 = mysqli_query($GLOBALS['dbinv'], $sql1);

        while ($row1 = mysqli_fetch_array($result1)) {
            $sql_part = "Select * from s_mas where STK_NO='" . $row1["STK_NO"] . "'";
            $result_part = mysqli_query($GLOBALS['dbinv'], $sql_part);
            $row_part = mysqli_fetch_array($result_part);

            
            if (($row["VAT"] == "1") or ($row["VAT"] == "2")) {
                $vatr = 100 + $row["GST"];
                // $PRICE = $row1["PRICE"] / $vatr * 100;
                $PRICE1 = $row1["PRICE"] / $vatr * 100;
                $PRICE = $row1["PRICE"] ; 
                $unittot=$PRICE*$row1['QTY']-($PRICE*$row1['QTY']*$row1["DIS_per"]/100);
                $distot=$PRICE*$row1['QTY']*$row1["DIS_per"]/100;
                $rr=$PRICE*$row1['QTY'];
                $vatamo=$PRICE1*$row["GST"]/100;
            } else {
                $PRICE = $row1["PRICE"];
                $PRICE1 = $row1["PRICE"];
                $unittot=$PRICE*$row1['QTY']-($PRICE*$row1['QTY']*$row1["DIS_per"]/100);
                $distot=$PRICE*$row1['QTY']*$row1["DIS_per"]/100;
                $rr=$PRICE*$row1['QTY'];
            }
            
            if (($row["VAT"] == "1") or ($row["VAT"] == "2")) {
            ?>
            <tr style="font-size:19px;">  
                <td class="center"><?php echo $i.'.' ?></td>  
                <td class="left" ><?php echo $row1['DESCRIPT']; ?> </td>
                <td class="right"><?php echo number_format($PRICE1, 2, ".", ","); ?></td> 
                <td class="right"><?php echo number_format($vatamo, 2, ".", ","); ?></td> 
                <td class="right"><?php echo number_format(($PRICE1+$vatamo), 2, ".", ","); ?></td>
                <td class="right"><?php echo number_format($row1['QTY'], 2, ".", ","); ?></td>
                <!--<td class="right"><?php echo number_format($row1["Print_dis1"], 2, ".", ","); ?></td> -->
                <td class="right"><?php echo number_format($unittot, 2, ".", ","); ?></td> 
            </tr>
            
            <?php } else{ ?>
            <tr style="font-size:19px;">  
                <td class="center"><?php echo $i.'.' ?></td>  
                <td class="left" ><?php echo $row1['DESCRIPT']; ?> </td>
                <td class="right"><?php echo number_format($row1['QTY'], 2, ".", ","); ?></td>
                <td class="right"><?php echo number_format($PRICE1, 2, ".", ","); ?></td> 
                <!--<td class="right"><?php echo number_format($row1["Print_dis1"], 2, ".", ","); ?></td> -->
                <!--<td class="right"><?php echo number_format($row1["Print_dis2"], 2, ".", ","); ?></td> -->
                <td class="right"><?php echo number_format($unittot, 2, ".", ","); ?></td> 
            </tr>
            <?php }?>
            <?php
             $i=$i+1;  
             $TOTPRICE=$TOTPRICE+($PRICE*$row1['QTY']);
             $unitgtot=$unitgtot+$unittot;
             $disgtot=$disgtot+$distot;
             $rrtot=+$rrtot+$rr;
        }
        ?>

        <?php
if ($row["VAT"] == "1"){
     $t=15;
}else{
     $t=17;
}
       
        while ($i <$t) {

         echo "<tr>

         <td>&nbsp;</td>
         <td></td>
         <td></td>
         <td></td> 
         <td></td> 
         <td></td> 
         </tr>";
         $i=$i+1;
     }
 
     ?>
      
   
    <?php
        if ($row["VAT"] =="1"){?>
            <!--<tr> -->
                  
                <!--<td  class="right" colspan='4' style="font-size:19px;"><b>
                <?php
                // echo  $RTXTVAT 
                ?> 
                :</b></td>  -->
                <!--<td class="right" style="font-size:19px;"><b>-->
                <?php
                                    if ($RTXVATAMU > 0) {
                                        // echo number_format($RTXVATAMU, 2, ".", ",");
                                    }
                                    ?></b>
                 <!--</td>-->
            <!--</tr>-->
       <?php }?>
 
    <!--<tr>-->

       
         
        <!--<td  class="right" colspan='4' style="font-size:24px;"><b>GRAND TOTAL: </b></td>  -->
        <!--<td class="right" style="font-size:28px;"><b>-->
        <?php
                                        if ($unitgtot > 0) {
                                            // echo number_format($RTXVATAMU+$unitgtot, 2, ".", ",");
                                        }
                                        ?>
                                        <!--</b></td>-->
    <!--</tr>-->
    
</table>


</table> 
<table width="1050px;">
        <tr>
            <td colspan="12"  class="style2"><b>REMARK:</b> <?php echo $row['REMARK']; ?></td>   
        </tr> 
        <tr>
            <td colspan="12"  class="style2">&nbsp;</td>   
        </tr> 
        <tr>
            <td colspan="12"  class="style2">&nbsp;</td>   
        </tr> 
</table>         
<!--<div style='height:34px;'></div>-->
<table width="1050px;">
    
    
    <tr> 
        <td colspan="8" style="font-size:17px;"><p><b><u>NOTE</u></b></p></td>
</tr>
<!--<tr> -->
<!--        <td colspan="8" style="font-size:17px;"><p>1. Tyre changing Free.</p></td>-->
<!--</tr>-->
<tr> 
        <td colspan="8" style="font-size:17px;"><p>1. Nitrogone Ari Free.</p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>2. Warranty valid only for manufacturing defects.</p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>3. Tyre Expires within a usage period of 3 years.</p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>4. Mileage of the tyre may variable due to different road & vehicle conditions.</p></td>
</tr>

<tr> 
        <td colspan="8" style="font-size:17px;"><p><b><u>TERMS AND CONDITIONS</u></b></p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>1. Customer will be billed after indication acceptance of this quote.</p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>Customer Acceptance (Sing below):</p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>2. Payment will be due prior to delivery of service and goods.</p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>3. Please fax or mail the signed price quote to the address above.</p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>4. All cheques to be drawn in favour of <?php echo $row_invpara["COMPANY"] ; ?> & crossed.</p></td>
</tr>

 
<tr> 
        <td colspan="8" style="font-size:17px;"><p><b><u>NOTE</u></b></p></td>
</tr>
 
<tr> 
        <td colspan="8" style="font-size:17px;"><p>If you have any questions about this price quote, </p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p> <?php echo $row["hotlinedetails"] ; ?> </p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:17px;"><p>&nbsp;</p></td>
</tr>
<tr> 
        <td colspan="8" style="font-size:20px;"><p><center><b>Thank You For Your Business!</b></center></p></td>
</tr>

</table>
<table width="1050px;">
    <tr>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;</td>
    </tr>
    
</table>
<table cellpadding="0" cellspacing="0" border="0" width="1050px;">
    <tr> 
        <td>
            <table border="0" bordercolor="#000000" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <table border="0" >
                            
                            <tr>
                                <td><span><b>&nbsp;</b></span></td> 
                                <td align="center"><span><b>....................................................................</b></span></td> 
                                <td><span><b>&nbsp;</b></span></td> 
                                <td align="center"><span><b>...........................................................................</b></span></td>
                                <td><span><b>&nbsp;</b></span></td> 
                            </tr>
                            <tr>
                                <td><span><b>&nbsp;</b></span></td> 
                                <td align="center"><span style="font-size:16px;"><b>PREPARED BY</b></span></td> 
                                <td><span><b>&nbsp;</b></span></td> 
                                <td align="center"><span style="font-size:16px;"><b>AUTHORIZED BY</b></span></td> 
                                <td><span><b>&nbsp;</b></span></td> 
                                
                            </tr>
                        </table>
                    </td>
                </tr>
             </table>
        </td>
        <td>
            <table border="0" bordercolor="#000000" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <table border="0" >
                            <tr>
                                 <td><span><b>&nbsp;</b></span></td> 
                            </tr> 
                            
                        </table>
                    </td>
                </tr>
             </table>
        </td> 
         
        
        <td>
            <table border="0" bordercolor="#000000" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <table border="0" >
                            
                            <tr>
                                <td align="center"><span><b>...................................................................................................</b></span></td>   
                            </tr>
                            <tr>
                                <td align="center"><span style="font-size:16px;"><b>CUSTOMER SIGNATURE & RUBBER STAMP</b></span></td>   
                                
                            </tr>
                        </table>
                    </td>
                </tr>
             </table>
        </td> 
         
    </tr>  
</table>
<!-- ************************************************************************** -->
</body>

</html>







 