PK

ADDRLIN : /home/anibklip/aaravpest.in/print/
FLL :
Current File : /home/anibklip/aaravpest.in/print/invoice_print old.php

<?php
include".././includes/dbconnect.php";
include".././includes/functions.php";
include".././include/constants.php";

$sql1="SELECT * FROM invoices WHERE invid='$_GET[id]'";
$result1=mysql_query($sql1) or die('error in fetch');
$row1=mysql_fetch_array($result1);

if($row1['invstatus'] == 'Dues'){	
	//$bk = mysql_select_db('vpgldh_backup17-18') or die('Database NOT SELECTED');
	//$sql="SELECT * FROM certificates WHERE certificateno='$row1[certid]'";
	//$result=mysql_query($sql) or die('error in fetch');
	//mysql_close($bk);

	//mysql_select_db('vpgldh_17-18') or die('Database NOT SELECTED');
}else{
	$sql="SELECT * FROM certificates WHERE certificateno='$row1[certid]'";
	$result=mysql_query($sql) or die('error in fetch');
}

//$sql="SELECT * FROM certificates WHERE certificateno='$row1[certid]'";
//$result=mysql_query($sql) or die('error in fetch');
$row=mysql_fetch_array($result);
?>
<head>
	<style type="text/css">
		table td{
			padding:3px;
		}
		.printo {
			border: solid
		}
		
		.cancel_div {
			z-index: 1;
			position: absolute;
			opacity: 0.2;
			padding: 140px 8px;
		}
		
		body {
			margin-left: 70px;
		}
		
		#maintbl {
			border-collapse: collapse;
		}
		
		#maintbl td {
			font-family: arial;
			font-size: 13px;
		}
	</style>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body onLoad1="window.print(); window.close();">
	<table border="1" width="95%" id="maintbl" cellpadding="0" style="">
		<tr>
			<td colspan="4" align="center">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="4" valign="middle" align="center">
				<h2>TAX INVOICE</h2>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="left">
				Invoice No. :
				<strong>
				AFPMS/
				<?php
				$sqlu="SELECT * FROM signature";
				$resultu=mysql_query($sqlu) or die('error in fetch');
				$rowu=mysql_fetch_array($resultu);
				?>
				<?php echo "$_GET[id]";?>/<? echo $rowu['year'];?></strong><br /><br />

				<strong>
					M/s. <?php
					if(trim($row1[ajtid])){
						$parr=explode(",",$row1[ajtid]);
						$ajtid=$parr[0];
						for($i=1;$i<=sizeof($parr);$i++){
							echo $parr[$i].", ";
						}

						//echo nl2br($row1[ajtid]);
						echo "<br />GST: ".getColumn("agents","ajid",$ajtid,"ajdec");
					}else{
						$parr=explode(",",$row1[clnid]);
						$clnid=$parr[0];
						for($i=1;$i<=sizeof($parr);$i++){
							echo $parr[$i].", ";
						}
						echo "<br />GST: ".getColumn("parties","headid",$clnid,"gst");
					}
					//echo "<br /><br /><br />".$clnid."<br />-----".$row1[clnid]."<br>";
					?>
				</strong><br />
				<!-- Certificate No: <?php echo $row[certno]?> --> <br />
			</td>
			<td colspan="2" align="right" valign="top">
				Invoice Date: <strong><?php echo date("d-m-Y", strtotime($row1[dtd]))?></strong>
			</td>
		</tr>

		<tr>
			<th>Fumigation of</th>
			<th>Destination Port</th>
			<th>Particulars</th>
			<th>Amount</th>
		</tr>
		<tr>
			<td valign="top" style="height:100px !important;">
				<?php
				if($row1['container']){
					echo "Container No: ".$row1['container']; 
				}elseif($row1['quantitydeclared']){
					echo "Quantity Declared: ".$row1['quantitydeclared']; 
				}
				?>
			</td>
			<td valign="top">
				<?php echo($row1['portcountry']); ?>
			</td>
			<td valign="top" align="left">
				<div style="border-bottom:1px solid #000000;">Fumigation Charges<br>
			    SAC(998531) </div><br>
			    Travel Expenses <br>Other Expenses
			    <br /></td>
			<td valign="top" align="right">
			<?php echo($row1['amount']); ?><br>
			<br><br>
			<?php echo $row1['travel_exp']?><br>			<?php echo $row1['other_exp'];?></td>
		</tr>

		<?php
		if($row1['ajtid']!=""){
			?>
			<tr>
				<td colspan="3" align="center">
					<div align="left">
						A/C:<?php
						$row1['clnid']=str_replace("<BR>"," ", $row1['clnid']);
						$row1['clnid']=str_replace("<br>"," ", $row1['clnid']);
						$exp1 = explode(',',$row1['clnid']);
						$ln1 = count($exp1);
						for($i=1; $i<$ln1; $i++){
							if($i==1){
								echo "<strong>".$exp1[$i]."</strong>";
							}else{
								echo ", ".$exp1[$i];
							}
						}
						?>
					</div>
				</td>
			</tr>
			<?php
		}
		?>

		<tr>
			<td colspan="4"><strong>Additional Declaration:</strong>
				<?php echo $row1[particular]?>
			</td>
		</tr>
		<tr>
			<td>
				<?php
				if($row['conslinkno']==""){
					?>
					<strong>&nbsp;Charges for Fumigation Export Cargo<br /><br /><strong>&nbsp;as per your :</strong>
					<?php echo $row['distmarks'];?>
					<?php
				}else{
					?>
					<!-- <strong>&nbsp;Charges of Fumigation Container No.</strong>
					<?php echo $row['conslinkno'];?>
					<br /><br /> -->
					<strong>as per your:</strong>
					<?php 
					//echo $row['distmarks'];

					$qq="SELECT * from certificates where parent_cert='$row[certificateno]' ";
					$qq=mysql_query($qq) or die('Error in getting Certificates');
					while($r1=mysql_fetch_array($qq, MYSQL_ASSOC)){
						echo "$r1[distmarks] | ";
					}

					$arr=explode(",",$row1[certid]);
					foreach($arr as $k=>$v){
						$whr.=" certificateno='$v' or ";
					}
					$whr=substr($whr,0,-3);
					$qq="SELECT * from certificates where $whr  ";
					$qq=mysql_query($qq) or die('Error in getting Certificates');
					while($r1=mysql_fetch_array($qq, MYSQL_ASSOC)){
						echo "$r1[distmarks] | ";
					}
				}
				$amount=$row1['amount']+$row1['travel_exp']+$row1['other_exp'];
				$tax=($amount/100)*$row1['servicetax'];
				?>
			</td>
		</tr>

		<?php
		$qq="SELECT * from certificates where parent_cert='$row[certificateno]' ";
		$qq=mysql_query($qq) or die('Error in getting Certificates');
		if(mysql_num_rows($qq)){
			?>
			<tr>
				<td colspan="4"><strong>A/C: </strong>
					<?php
					$ac=explode(",",$row[nameaddress]);
					echo "$ac[1] $ac[2] $ac[3] | ";
					
					while($r1=mysql_fetch_array($qq, MYSQL_ASSOC)){
						$ac=explode(",",$r1[nameaddress]);
						echo "$ac[1] $ac[2] $ac[3] | ";
					}
					?>
				</td>
			</tr>
			<?php
		}
		?>

		
		<tr>
			<td rowspan="<?php echo ($row1[gst_combine]==1?" 4 ":"6 ")?>" colspan="2">
				<strong>Total Invoice Amount in words</strong><br /><br />
				<?php echo ucwords(numberTowords($row1['amount']+$tax));?> Only.
			</td>
			<!-- <td>Total Amount Before Tax</td>
			<td align="right"><strong><?php echo $row1['amount']?></strong></td> -->
			<td>Total Amount Before Tax</td>
			<td align="right"><?php echo $row1['amount']?></td>
		</tr>
 
		<tr>
			<!--<td>&nbsp;</td>
			<td align="right">&nbsp;</td>-->
		</tr> 
		
		<?php
		if($row1[gst_combine]==0){
			?>
			<tr>
				<td>Add: CGST 9%</td>
				<td align="right"><?php echo $tax/2;?></td>
			</tr>
			<tr>
				<td>Add: SGST 9%</td>
				<td align="right"><?php echo $tax/2;?></td>
			</tr>
			<?php
		}
		?>
		<tr>
			<td>Tax Amount:<?php echo ($row1[gst_combine]==1?"I":"")?>GST 18%</td>
			<td align="right"><?php echo $tax;?></td>
		</tr>
		<tr>
			<td><strong>Total Amount <!-- After Tax --></strong></td>
			<td align="right"><strong><?php echo $row1['amount']+$tax;?></strong></td>
		</tr>
		<tr>
			<td colspan="2">
				<strong>Bank Details</strong>
				<br />
				<br /> Bank Name: INDUSIND Bank, LDH
				<br /> Bank Account Number: 201001129008
				<br /> Bank Branch IFSC: INDB0000520
				<br /> PAN No.: ABHFA3554H
				<br />
				<strong> GST NO.:</strong>
				<br /> 03ABHFA3554HIZQ <br /><br />

				E. & O E.
			</td>
			<td colspan="2" align="right">
				<!-- <center><small>Certified that the Particulars Given Above are true and correct:</small></center> -->
				<br />
				<br />
				<strong>For, ARYAN FUMIGATION & PEST MANAGEMENT SERVICES<br /><br /><br /><br /><br />Authorised Signatory</strong>
			</td>
		</tr>
	</table>
</body>


PK 99