PK

ADDRLIN : /home/anibklip/vpgldh.com/2020-21/webmanager/print/
FLL :
Current File : /home/anibklip/vpgldh.com/2020-21/webmanager/print/invoice_print.php

<?php

include".././includes/dbconnect.php";

include".././includes/functions.php";



$sql1="SELECT * FROM invoices WHERE invid='$_GET[id]'";

$result1=mysql_query($sql1) or die('error in fetch');

$row1=mysql_fetch_array($result1);

//echo "sssssssssss".$row1['invstatus'];

if($row1['invstatus'] == 'dues'){

	include "../includes/dbconnect2.php";

	//$bk = mysql_select_db('vpgldh_bkp19-20') or die(mysql_error().' - Backup 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_gst17-18') or die(mysql_error().' - 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);

//print_r($row);

?>

<head>

	<style type="text/css">

		.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">

	

	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

</head>



<body onLoad="window.print(); window.close();"> 



<br><br>

 <p>&nbsp;</p> <p>&nbsp;</p>



<?php

if($row[cancel]){

	?>

	<div class="cancel_div"><img src="../cancelled.png" width="670" alt="Cancel" /></div>

	<?

}

?>

<p>&nbsp;</p>

<table border="1" width="95%" id="maintbl" cellpadding="0" style="">

  <tr>

	<td colspan="7" align="center">

		<p>&nbsp;</p><h2>INVOICE</h2>

	</td>

  </tr>

  <tr>

	<td colspan="3" align="left">

		Invoice No. : 

		<strong><?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 />

		Invoice Date: <strong><?php echo date("d-m-Y", strtotime($row1[dtd]))?></strong> <br />

		State: <strong>Punjab</strong> <br />



		<span style="float:right;">State Code <span style="border:1px solid #000000; padding:0px 8px;">03</span></span>

	</td>

	<td colspan="4" align="left">

		Trasnportaion Mode : <br />

		Vehicle No : <br />

		Date of Supply : <br />

		Place of Supply : <br />

	</td>

  </tr>

  <tr>

	<td colspan="7">Details of Receiver / Billed to: </td>

  </tr>

  <tr>

	<td colspan="3">

		<?php

		//echo $row1[invstatus];

		if($row1[invstatus]=="dues"){

			include "../includes/dbconnect2.php";

		}else{

		}



		if($row1['ajtid']==""){

			$exp1 = explode(',',$row1['clnid']);

			$ln1 = count($exp1);

			for($i=1; $i<$ln1; $i++){

				if($i==1){

					echo "<strong>".$exp1[$i]."</strong><br />";

				}else{

					echo $exp1[$i]."<br />";

				}

			}



			$q="select * from parties where headid='$row1[clnid]'";

			$q=mysql_query($q) or die(mysql_error());

			if($rr=mysql_fetch_array($q)){

				echo "GST: $rr[gst]";

			}

		}else{

			$exp1 = explode(',',$row1['ajtid']);

			$ln1 = count($exp1);

			for($i=1; $i<$ln1; $i++){

				if($i==1){

					echo "<strong>".$exp1[$i]."</strong><br />";

				}else{

					echo $exp1[$i]."<br />";

				}

			}



			$q="select * from agents where ajid='$row1[ajtid]'";

			$q=mysql_query($q) or die(mysql_error());

			if($rr=mysql_fetch_array($q)){

				echo "GST: $rr[ajdec]";

			}

		}

		?>

		<span style="float:right;">State Code:</span>

	</td>

  </tr>

  <tr>

	<th>Sr. No</th>

	<th>Name of Product/Service</th>

	<th>HSN/SAC</th>

	<th>UOM</th>

	<th>QTY</th>

	<th>Rate</th>

	<th>Amount</th>

  </tr>

  <tr>

	<td>1</td>

	<td><?php echo($row1['product']); ?>

		<!-- Certificate No:/<?php echo "VPC"." /$row[certificateno]";?>/<? echo $rowu['year'];?><br /><br />

		<?php

		if($row['conslinkno']==""){

			?>

			<strong>&nbsp;Charges for Fumigation Export Cargo<br /><br /><strong>&nbsp;as per Invoice No.:</strong>

			<?php echo $row['distmarks'];?>

			<?php

		}else{

			?>

			<strong>&nbsp;Charges of Fumigation Container No.</strong><br /><?php echo $row['conslinkno'];?><br /><br /><strong>&nbsp;as per Invoice No.:</strong>

			<?php echo $row['distmarks'];?>

			<?php

		}

		?><br /><br />

		<strong>&nbsp;Description of Goods:</strong> <?php echo $row['desgood'];?><br />

		<strong>&nbsp;Destination Country:</strong> <?php echo $row['countrydes'];?> -->

	</td>

	<td valign="top"><?php echo($row1['hsn']); ?></td>

	<td valign="top"><?php echo($row1['uom']); ?></td>

	<td valign="top" align="right"><?php echo($row1['qty']); ?></td>

	<td valign="top" align="right"><i class="fas fa-rupee-sign"></i> <?php echo number_format($row1['amount']/$row1['qty'],2); ?></td>

	<td valign="top" align="right"><i class="fas fa-rupee-sign"></i> <?php echo($row1['amount']); ?></td>

  </tr>



	<?php

	if($row1['ajtid']!=""){

		?>

		<tr>

			<td colspan="3" align="center">

			  <div align="left">&nbsp;

				<?php

				$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="7"><strong>Additional Declaration:</strong> <?php echo $row1[particular]?></td>

  </tr>

  <tr>

	<td colspan="3">

		<?php

		if($row['conslinkno']==""){

			?>

			<strong>&nbsp;Charges for Fumigation Export Cargo<br /><br /><strong>&nbsp;as per Invoice No.:</strong>

			<?php echo $row['distmarks'];?>

			<?php

		}else{

			?>

			<strong>&nbsp;Charges of Fumigation :</strong> <?php echo $row['conslinkno'];?><br /><br /><strong>&nbsp;as per Invoice No.:</strong>

			<?php echo $row['distmarks'];?>

			<?php

		}

		?>

	</strong></td>

	<td colspan="4"><strong>Description of Goods:</strong> <?php echo $row['desgood'];?></td>

  </tr>



    <tr>

	<td rowspan="<?php echo ($row1[gst_combine]==1?"3":"5")?>" colspan="3">

		<strong>Total Invoice Amount in words</strong><br /><br />

		<?php echo ucwords(numberTowords($row1['amount']+$row1['servicetax']));?> Only.

	</td>

	<td colspan="2">Total Amount Before Tax</td>

	<td colspan="2" align="right"><i class="fas fa-rupee-sign"></i> <strong><?php echo $row1['amount']?></strong></td>

  </tr>

	<?php

	if($row1[gst_combine]==0){

	  ?>

	  <tr>

		<td colspan="2">Add: CGST 9%</td>

		<td colspan="2" align="right"><i class="fas fa-rupee-sign"></i> <strong><?php echo $row1['servicetax']/2;?></strong></td>

	  </tr>

	  <tr>

		<td colspan="2">Add: SGST 9%</td>

		<td colspan="2" align="right"><i class="fas fa-rupee-sign"></i> <strong><?php echo $row1['servicetax']/2;?></strong></td>

	  </tr>

	  <?php

	}

	?>

  <tr>

	<td colspan="2">Tax Amount: <?php echo ($row1[gst_combine]==1?"I":"")?>GST 18%</td>

	<td colspan="2" align="right"><i class="fas fa-rupee-sign"></i> <strong><?php echo $row1['servicetax'];?></strong></td>



  </tr>

  <tr>

	<td colspan="2">Total Amount After Tax</td>

	<td colspan="2" align="right"><i class="fas fa-rupee-sign"></i> <strong><?php echo $row1['amount']+$row1['servicetax'];?></strong></td>

  </tr>



  <tr>

	<td colspan="3">

						<strong>Bank Details</strong><br /><br />

		Bank Name: Central Bank of India, LDH<br />  

		Bank Account Number: 3636974606<br />

		Bank Branch IFSC: CBIN0282415<br />

		PAN No.: AALHA2699Q<br />

		<strong> GST NO.:</strong><br />

		03AALHA2699Q1ZP

	</td>

	<td rowspan="2" colspan="4" align="right">

		<center><small>Certified that the Particulars Given Above are true and correct:</small></center><br /><br />

		<strong>For, VED PERKASH GOEL & COMPANY <br /><br /><br /><br /><br />Authorised Signatory</strong>

	</td>

  </tr>



  <tr>

	<td colspan="3" align="center"><strong>Terms and Conditions</strong></td>

  </tr>



</table>









<div style="display:none;">

  OLD INVOICE 

  <table width="95%">

	<tr>

		<td colspan="6" align="center"><p>&nbsp;</p> <p>&nbsp;</p>

		  <p>&nbsp;</p>

		  <h2>INVOICE</h2>

		  <p>&nbsp;</p>

		</tr>



	<tr>

		<td  width="50%" colspan="4"><strong>Invoice No.:

	<? 

	echo "VPC";

	$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></td>



	<td colspan="2" align="center" valign="top"><strong>Invoice Date: <?php echo "$row1[dtd]"; ?></strong>

		</td>

	</tr>

	</table>

	<?php

		if($row1['ajtid']=="")

		{

			$exp1 = explode(',',$row1['clnid']);

			$ln1 = count($exp1);

			for($i=1; $i<$ln1; $i++)

			{

				if($i==1)

				{

					echo "<strong>".$exp1[$i]."</strong><br />";

				}

				else

				{

				echo $exp1[$i]."<br />";

				}

			}

		}

		else

		{

			$exp1 = explode(',',$row1['ajtid']);

			$ln1 = count($exp1);

			for($i=1; $i<$ln1; $i++)

			{

				if($i==1)

				{

					echo "<strong>".$exp1[$i]."</strong><br />";

				}

				else

				{

				echo $exp1[$i]."<br />";

				}

			}

		}

	?>



	<br>

	<table width="95%" border=1px cellpadding="0px" cellspacing="0px" bordercolor="black">

	<tr>

		<th width="55%" align="left">

		&nbsp;Certificate No:/<?php echo "VPC"." /$row[certificateno]";?>/<? echo $rowu['year'];?></th>

		<th width="35%" align="left">&nbsp;Particulars </th>

		<th width="10%">Amount</th>

	</tr>

	<tr>

		<td width="55%" >

		<?php

			if($row['conslinkno']=="")

			{

			?>

				<strong>&nbsp;Charges for Fumigation Export Cargo<br /><br /><strong>&nbsp;as per Invoice No.:</strong>

			<?php echo $row['distmarks'];?>

			<?php

			}

			else

			{

			?>

			<strong>&nbsp;Charges of Fumigation Container No.</strong><br /><?php echo $row['conslinkno'];?><br /><br /><strong>&nbsp;as per Invoice No.:</strong>

			<?php echo $row['distmarks'];?>

			<?php

			}

		?>	</strong></td>

		<td>

			<strong>&nbsp;Description of Goods:</strong><br /><?php echo $row['desgood'];?><br /><br />

			<strong>&nbsp;Destination Country:</strong><br /><?php echo $row['countrydes'];?>	</td>

		<td align="center" valign="middle">

			<?php echo($row1['amount']); ?>	</td>

	</tr>



	<?php

		if($row1['ajtid']!="")

		{

	?>

		<tr bordercolor="#000000">

			<td colspan="3" align="center">

			  <div align="left">&nbsp;

				<?php

				$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 width="90%"colspan="2" align="left" bordercolordark="#333333">&nbsp;Remarks: <?php echo $row1['particular'];?></td>

		<td align="center" valign="middle">&nbsp;		</td>

	</tr>

	<tr>

		<td width="90%"colspan="2" align="right">

	  <strong>GST</strong> <td align="center" valign="middle"><?php echo $row1['servicetax'];?></td></tr>

	<tr>

		<td width="90%"colspan="2" align="right">

			<strong>Total &nbsp;&nbsp;</strong>	</td>

		<td align="center" valign="middle">

			<?php

			if($row1['grandtotal']==0)

			{

				echo"n/a";

			}

			else

			{

				echo $row1['grandtotal'];

			}

		?>	</td>

	</tr>

	</table>

	<br />

	<table width="95%" >

		<tr>

			<td>PAN No.: AALHA2699Q</td>

		</tr>

		<tr>

			<td>

				All Payments to be made A/c Payee cheque /D.D only<br />

				<strong>Bank Details</strong><br /><br />

		Bank Name: Central Bank of India, LDH<br />  

		Bank Account Number: 3636974606<br />

		Bank Branch IFSC: CBIN02824150<br /><strong> GST NO.:</strong><br />

				03AALHA2699Q1ZP

			</td>

		</tr>

		<tr>

			<td align="right">for VED PERKASH GOEL & COMPANY</td>

		</tr>

		<tr height="30px">

			<td></td>

		</tr>

		<tr>

			<td align="right">Authorised Signatory</td>

		</tr>

	</table>

</div>



</body>


PK 99