<?php 
include 'connection.php';
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
	
$queryls2 = "select * from tax_invoice where tax_id ='".$_REQUEST['tax_id']."' ";
$resultls2 = mysqli_query($conn,$queryls2);	
while($row=mysqli_fetch_array($resultls2))
{
$invoice_no=$row['invoice_no'];
$invoice_date=$row['invoice_date'];	
$delivery_note = $row['delivery_note'];
$mode_of_payment = $row['mode_of_payment'];
$suppelier_ref = $row['suppelier_ref'];
$other_ref = $row['other_ref'];
$terms_of_delivery = $row['terms_of_delivery'];
$mode_transport = $row['mode_transport'];
$name_of_goods = $row['name_of_goods'];

}
	
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>

<body>
<table width="100%" border="1" style="border-collapse:collapse">
<tr>
<td colspan="3"><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:16px;"><strong>DELIVERY CHALLAN CUM ANNEXTURE</strong></div></td>
</tr>
<tr>
<td colspan="3"><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:24px;"><strong>DINESH INDUSTRIES </strong></div></td>
</tr>
<tr>
<td colspan="3"><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>PLOT NO-W-251(a), TTC INDL. AREA, MIDC RABALE, THANE BELAPUR ROAD, NAVI MUMBAI-708</strong></div></td>
</tr>
<tr>
<td colspan="3"><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>GST/UIN:27AGGPP3822R1ZR</strong></div></td>
</tr>
<tr>
<td width="50%" rowspan="3" valign="top"><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">TO,<br />BOMBAY METAL & STEEL TRADERS<br />A-81, T.T.C. INDUSTRIAL AREA, KHAIRNE. NEW BOMBAY<br />GST/UIN:27AAIPG3476A1ZZ</div></td>
<td width="20%"><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">Invoice No. : </div></td>
<td width="30%"><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $invoice_no?></div></td>
</tr>
<tr>
<td><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">Date : </div></td>
<td><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $invoice_date?></div></td>
</tr>
<tr>
<td><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">Delivery Note : </div></td>
<td><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $delivery_note?></div></td>
</tr>

<tr>
<td><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">Consignee,<br />
BOMBAY METAL &amp; STEEL TRADERS<br />
A-81,T.T.C. Industrial Area, Khairne, Navi Mumbai-400709. Maharashtra, Code: 27<br />E-Mail:-chintugoradia@hotmail.com<br />
GST/UIN:27AAIPG3476A1ZZ</div></td>
<td colspan="2"><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">Buyer(if other than Consignee),<br />
BOMBAY METAL &amp; STEEL TRADERS<br />
A-81,T.T.C. Industrial Area, Khairne, Navi Mumbai-400709. Maharashtra, Code: 27<br />
E-Mail:-chintugoradia@hotmail.com<br />
PAN/IT NO:-AAIPG3476A</div></td>
</tr>
<tr>
<td><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">TERMS OF DELIVERY :<?php echo $terms_of_delivery?> </div></td>
<td colspan="2"><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">NAME OF GOODS :<?php echo $name_of_goods?> </div></td>
</tr>
<tr>
<td><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">MODE OF TRANSPORT : <?php echo $mode_transport?></div></td>
<td colspan="2"><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">PART OF ELECTRIC MOTOR :<?php echo $description?> </div></td>
</tr>
<tr>
<td colspan="3"><table width="100%" border="1" style="border-collapse:collapse">
<tr>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>SR</strong></div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>Description of Goods</strong></div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>HSN/SAC</strong></div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>GST Rate</strong></div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>Quantity</strong></div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>Rate</strong></div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>Per</strong></div></td>
<td><div align="right"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>Amount</strong></div></td>
</tr>
<?php $i=1;

 $queryaapr = "SELECT * FROM  delivery_challan_more_product_02 where  tax_id='".$_REQUEST['tax_id']."' and  receipt_no!=''";
				
				
				$result1hsn = mysqli_query($conn,$queryaapr);
$num_rows2 = mysqli_num_rows($result1hsn);
while($row=mysqli_fetch_array($result1hsn))
{
$material_name = $row['material_name'];
$inward_challan_no = $row['inward_challan_no'];
$cust_more_row_id = $row['cust_more_row_id'];
$row_id = $row['row_id'];

 $finish_HSN_code=$row['finish_HSN_code'];
$delivery_challan_no = $row['delivery_challan_no'];
$componant = $row['componant'];
$cust_po = $row['cust_po'];
$qty = $row['qty'];
$rate_of_po = $row['rate_of_po'];
$total = $row['total'];
$IGST_finish=$row['IGST_finish'];
$SGST_finish=$row['SGST_finish'];
$CGST_finish=$row['CGST_finish'];
$total=$rate_of_po*$qty;
$delivery_challan_more_product_id=$row['delivery_challan_more_product_id'];
$sumoftotal+=$total;
$sumqty+=$qty;


$productamt= $sumoftotal;
$totalamount+=$total;

$CGSTamt = $totalamount*$CGST_finish/100;
$SGSTamt = $totalamount*$SGST_finish/100;



?>
<tr>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $i?></div></td>
<td valign="top"><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $componant?></div></td>
<td valign="top"><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $finish_HSN_code?></div></td>
<td valign="top"><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $IGST_finish; ?> %</div></td>
<td valign="top"><div align="center"    style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $qty?> pcs</div></td>
<td valign="top"><div align="center"    style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo $rate_of_po?> </div></td>

<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">pcs</div></td>
<td><div align="right"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/i", "$1,", $total)?></div></td>
</tr><?php $i++;}  $toatl = $totalamount+$CGSTamt+$SGSTamt; $roundtotal = round($toatl,0); $roundoff = $roundtotal-$toatl; ?>
<tr>
<td colspan="2" rowspan="5" valign="top"><div align="left" style="padding:2px; line-height:130%; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>ONLY LABOUR CHARGES</strong><br />
<strong>Company's PAN: </strong>AGGPP3822R</div>
<div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>Company's Bank Details</strong><br />
Bank Name: Kotak Mahindra Bank<br />
Branch: Navi Mumbai-400708<br />
A/c No.: 4947016544<br />
IFSC Code:KKBK0001360</div></td>
<td colspan="3"><div align="right" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>Sub Total</strong></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="right" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/i", "$1,", $totalamount);?></div></td>
</tr>
<tr>
<td colspan="3"><div align="right" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>CGST</strong></div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">9</div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">%</div></td>
<td><div align="right"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/i", "$1,", $CGSTamt);?></div></td>
</tr>
<tr>
<td colspan="3"><div align="right" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>SGST</strong></div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">9</div></td>
<td><div align="center"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">%</div></td>
<td><div align="right"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/i", "$1,", $SGSTamt);?></div></td>
</tr>
<tr>
<td colspan="3"><div align="right" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>ROUND OFF</strong></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="right"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php echo round($roundoff,2)?></div></td>
</tr>
<tr>
<td colspan="3"><div align="right" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><strong>Total</strong></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="right"  style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;"><?php  echo preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/i", "$1,", $roundtotal);?></div></td>
</tr>

<tr>
<td height="26" colspan="6"><div align="left" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">Amount Chargeable (In words)</div></td>
<td colspan="2"><div align="right" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">E. &amp; O.E</div></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><div align="left" style="padding:2px; line-height:150%; font-family:Arial, Helvetica, sans-serif; font-size:13px;">Delivery Note: <?php echo $delivery_note?><br>
Supplier's Ref.: <?php echo $suppelier_ref?><br>
Mode/Terms of Payment: <?php echo $mode_of_payment?><br>
Other Reference(S): <?php echo $other_ref?></div><br /></td>
<td colspan="2" valign="top"><div align="right" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:13px;">Receiver's signature<br /><br /><br />FOR :DINESH INDUSTRIES</div></td>
</tr>
<tr>
<td colspan="3" valign="top"><div align="center" style="padding:2px; font-family:Arial, Helvetica, sans-serif; font-size:11px;">Declaration:-We declare that this invoice shows the actual piece of goods
described  and that all particulars are true and correct<br />SUBJECT TO MUMBAI JURISDICTION</div></td>
</tr>
</table>



</body>
</html>
