<?php
$txt="";
/*if(isset($_POST['invoicejson']))
{
$txt=trim($_POST['invoicejson']);	
echo $_POST['invoicejson'];
}
print_r($_GET);
*/

?>
<html>
<script type="text/javascript">//<![CDATA[
var PageInfo = [0,12];
var BookmarksOnPage = new Array();

function BodyClickHandler() {
	var window = document.parentWindow;
	if (!window) { window = document.contentWindow; }
	if (!window) { window = document.defaultView; }
	var frameElement = (window) ? window.frameElement : null;
	if (frameElement) {
		var viewer = frameElement.Viewer;
		if (viewer && viewer.HideEditorPopup) { viewer.HideEditorPopup(); }
	}
}

function GetReportViewer() {
	var window = document.parentWindow;
	if (!window) { window = document.contentWindow; }
	if (!window) { window = document.defaultView; }
	var frameElement = (window) ? window.frameElement : null;
	if (frameElement) { return frameElement.Viewer; }
	return null;
}

function NavigateToUrl(Url, target) {
	window.open(Url, target);
}

function NavigateToBookmark(bookmarkId) {
	var viewer = GetReportViewer();
	if (viewer) { viewer.NavigateToBookmark(bookmarkId); }
}

function NavigateToReport(reportAddress) {
	var viewer = GetReportViewer();
	if (viewer) { viewer.NavigateToReport(reportAddress); }
}

//]]></script><style type="text/css">/*<![CDATA[*/
div.html-root>ol, div.html-root>ul, div.html-root>p 
{
	margin-top: 0px;
}
body
{
	font-family: arial;
}
.underlinebox
{
/*	text-decoration: underline;*/
	border-bottom:1px solid black;
}
.sheet .error 
{
	border: 1px solid red;
	color: red;
}
	#company td
	{
		font-weight: normal;
		white-space: pre;
    word-wrap: normal;
    font-size: 14pt;
	}
	#invoiceMaster th
	{
		   font-family: Arial;
    font-size: 9pt;
				text-align: left;

	}
	#headertop
	{
		font-size: 9px;
	}
	#details th
	{
		height: 30px;
		color:white;
   font-family: Arial;
    font-size: 9pt;
    color: White;
    text-align: center;
    word-wrap: break-word;
    padding-left: 3px;
    padding-right: 3px;
    padding-top: 2px;
    padding-bottom: 0px;
    border-left: 0px solid black;
    border-top: 0px solid black;
    border-right: 0.3px solid white;
    border-bottom: 0px solid black;
    background-color: #4099ff;
}
		#details td
		{
    font-family: Arial;
    font-size: 9pt;
    color: Black;
    height: 25px;
    text-align: right;
    word-wrap: break-word;
    padding-left: 0px;
    padding-right: 5px;
    padding-top: 0px;
    padding-bottom: 0px;
    border-left: 0px solid silver;
    border-top: 0px solid silver;
    border-right: 0px solid silver;
   border-bottom: 0.1px solid silver;

		}

		#otherdetail td
		{
			font-size: 9pt;
	padding:6px;
		font-family: arial;
		}


		h2,h3,h4
		{
			margin:0px;
			font-family: arial;
		}
.all
{
	background-color: #ffc;
}
.all td,.all th
{
	/*border-right:silver 1px solid;*/
}
/*		#logo
		{
			width:123px;
			height: 96	px;
		}*/
/* interactive page */
.interactive-page .sheet
{
	margin: 10px;
}
/* print preview page */
.print-page 
{
	background-color: #ccc;	
}
@media print 
{
.print-page 
{
	background-color: white;	
}
.print-page > .sheet
{
	border: 0px solid white;
}
table
{
	width:100%;
}

}
.print-page > .sheet
{
	border: 0px solid darkblue;
	/* centers the DIV horizontally */
	margin-left: auto;
	margin-right: auto;
	margin-top: 10px;
	margin-bottom: 10px;
/*	-moz-box-shadow: 5px 5px 5px #888;
	-webkit-box-shadow: 5px 5px 5px #888;
	box-shadow: 5px 5px 5px #888;*/
	font-size: 9px !important;
}
.sheet .layer
{
	position: absolute;
	width: 100%;
	height: 100%;
	left: 0px;
	top: 20px;
}
.sheet .action
{
	cursor: pointer;
}
.sheet div.action:hover
{
	border: 1px solid #ddd;
	/*
	-moz-box-shadow: 1px 1px 3px #888 inset
	-webkit-box-shadow: 1px 1px 3px #888 inset
	box-shadow: 1px 1px 3px #888 inset
	z-index: 99
	*/
}
.sheet
{
	position: relative;
}
.sheet {background-color:White}
.s31- {
    font-family: Arial;
    font-size: 10pt;
    color: Red;
    word-wrap: normal;
}
.s35- {
    font-family: Arial;
    font-size: 13.2pt;
    color: Red;
    font-weight: bold;
    word-wrap: normal;
}
.s38- {
    font-family: Arial;
    font-size: 14pt;
    color: Red;
    direction: rtl;
    word-wrap: break-word;
    padding-left: 0px;
    padding-right: 5px;
    padding-top: 0px;
    padding-bottom: 0px;
}
.s0- {padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px}
.s1- {font-family:Arial;font-size:10pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:1px;padding-bottom:0px;border-left:1px solid Black;border-top:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black;background-color:White}
.s2- {font-family:Arial;font-size:10pt;color:Black;text-align:center;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:1px;padding-bottom:0px;border-left:1px solid Black;border-top:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black}
.s3- {font-family:Arial;font-size:10pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;border-left:1px solid Black;border-top:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black;background-color:White}
.s4- {font-family:Arial;font-size:10pt;color:Black;text-align:center;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;border-left:1px solid Black;border-top:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black}
.s5- {font-family:Arial;font-size:10pt;color:Black;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;border-left:1px solid Black;border-top:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black}
.s6- {font-family:Arial;font-size:10pt;color:Black;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:1px;padding-bottom:0px;}
.s7- {font-family:Arial;font-size:18pt;color:Black;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;border-bottom:1px solid Black}
.s8- {font-family:Arial;font-size:10pt;color:Black;font-weight:bold;text-align:center;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:3px;padding-bottom:0px;border-left:1px solid Black;border-top:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black;background-color:Silver}
.s9- {font-family:Arial;font-size:10pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:3px;padding-bottom:0px;border-left:1px solid Black;border-top:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black;background-color:Silver}
.s10- {
    font-family: Arial;
    font-size: 9pt;
    color: Black;
    font-weight: bold;
    word-wrap: break-word;
    padding-left: 2px;
    padding-right: 3px;
    padding-top: 12px;
    padding-bottom: 0px;
}
.s11- {font-family:Arial;font-size:8pt;color:Black;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:12px;padding-bottom:0px}
.s12- {font-family:Arial;font-size:8pt;color:Black;text-align:right;word-wrap:break-word;padding-left:0px;padding-right:0px;padding-top:12px;padding-bottom:0px}
.s51- {
    font-family: Arial;
    font-size: 10pt;
    color: Black;
    font-weight: bold;
    word-wrap: break-word;
    padding-left: 3px;
    padding-right: 2px;
    padding-top: 2px;
    padding-bottom: 0px;
}
.s52- {
    font-family: Arial;
    font-size: 9pt;
    color: Black;
    word-wrap: break-word;
    padding-left: 3px;
    padding-right: 2px;
    padding-top: 3px;
    padding-bottom: 0px;
}
.s19- {
    font-family: Arial !important;
    font-size: 9pt !important;
    color: Black;
    font-weight: bold !important;
    word-wrap: break-word;
    padding-left: 3px;
    padding-right: 3px;
    padding-top: 0px;
    padding-bottom: 0px;
}
.s20- {
    font-family: Arial !important;
    font-size: 9pt !important;
    color: Black;
    word-wrap: break-word;
    padding-left: 3px;
    padding-right: 3px;
    padding-top: 3px;
    padding-bottom: 0px;
}
/*]]>*/</style></head>
<!-- <div class="modal fade" id="printModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
        aria-hidden="true">
        <div class="modal-dialog modal-lg modal-reporting">
            <div class="modal-content modal-reporting">
                <div class="modal-header">
                    <h4 class="modal-title" id="myLargeModalLabel">Print Document</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">
                    <iframe id="reportPreview" class="container-fluid"></iframe>

                </div>
            </div>
        </div>
    </div> -->
<body class="print-page">
	<textarea style="width:0px;height: 0px;" name="invoicejson" id="invoicejson" >
		<?php echo trim($txt);?>
		</textarea>
		
		
	<div class="sheet page1" style="padding-left:86px;padding-right:86px;padding-top:6px;padding-bottom:26px;width:744px;height:1097px;margin-bottom: 0px;"><div class="layer">
<div id="headertop" class="row">
	<table border="0" width="96%" align="center">
	<tr>
		<th  width="25%"  align="left" height="100"><div class="s51-" style='white-space: pre;
    word-wrap: normal;color:#4099ff;font-size: 18px;'>Property Bill</div>  <span id="invoicedate" class="s52-"></span></th><th valign="top" rowspan="2"  ><img style="border:red 0px solid;height: 70px;"  src='#' id='logo'> </th><td  valign="middle" height="20" align="right" width="27%" id="barcode" style="text-align: right;"><span id="barcode3">BARCODE HERE</span><!-- <span id="keyfield" style="border:red 1px solid !important;"></span> --></td></tr>
		<tr>
			<td  align="left" valign="top" align="left" colspan="1" width="300">
	<table id="company" width="300" align="center" border="0">
		<tr>
			<td class="companyname" width="300" class="s19-" style="font-size:12pt !important;font=weight:bold;left:3px;white-space:normal;word-wrap:normal;top:0px;">Company Name </td>
		</tr>
		<tr>
			<td id="Address" class="s20-" style="left:3px;white-space:pre;word-wrap:normal;top:0px;">Company Name </td>
		</tr>
		<tr>
			<td id="POBox" class="s20-" style="left:3px;white-space:pre;word-wrap:normal;top:0px;">Company Name </td>
		</tr>
		<tr>
			<td id="Tel" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>
		</tr>
		<tr>
			<td id="Fax" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>
		</tr>
		<tr>
			<td id="Email" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>
		</tr>
		<tr>
			<td id="Website" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>
		</tr>
				<tr>
			<td id="TRNNo" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>
		</tr>		
	</table>
</td>
<td  align="right" valign="top">
		<table align="right" width="100%" cellpadding="5" cellspacing="5" border="0">
			<tr>
			<td id="customername" align="right" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Customer Name </td>
			</tr>
		<tr>
			<td id="customeremail" align="right" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Email </td>
		</tr>
		<tr>
			<td id="customerphone" align="right" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">056-434343434 </td>
		</tr>
		<tr>
			<td id="trnno" align="right" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">TRN NO </td>
		</tr>

		</table>
	</td>
</tr>
</table>
	<br><br>
	<table id="invoiceMaster" width="96%" align="center" border="0">
	<!-- <tr><th class="s10-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;border:0px solid;">Chassis #</th><td  colspan="3" width="30%"><span id="ChassisNo" class="barcode" style="overflow:hidden;left:115px;top:325px;width:290px;height:39px;"></span> </td><th class="s10-">Plate No</th><td  colspan="3" width="18%"><span id="PlateNo"></span></td><th class="s10-">Manufacture Year</th><th class="s10-" id="ManufactureYear">0000</th></tr> -->
	</table>
	<table width="96%" align="center" id="otherdetail" border="0" cellpadding="0" cellspacing="0">
	<!-- <tr><td class="s10-">Model</td><td id="vehiclemodel"> </td><td class="s10-">Vehicle Type</td><td id="vehicletype"></td><td class="s10-">Vehile Color</td><td id="VehicleColor">0000</td><td class="s10-">Checkin </td><td id="checkin">0000</td></tr> -->
	
	<!-- <tr><td class="s10-">Mile or KM Run</td><td id="kmrun"> </td><td class="s10-">Promised Date</td><td id="promisedate"></td><td class="s10-">Mulkiya No.</td><td id="mulkiyano" class="s10-">0000</td><td class="s10-">Check Out</td><td id="checkout">0000</td></tr> -->
	</table>
	<br>
	<table id="details" width="96%" align="center" border="0" cellpadding="0" cellspacing="0">
		<tr><th> S#</th><th>Image</th><th>Product/Service </th><th>Qty</th><th>Rate</th><th>Amount</th><th>Discount Amount </th><th>Vat Amount </th><th>Net Amount </th></tr>

	</table>
	<br><br>
	<table width="96%" border="0" align="center">
		<tr>
			<td colspan="2" style="border-bottom:silver 1px solid;">
	<h4 style="background: #4099ff;color:white;">Remarks</h4>
	</td>
		<td style="background: #4099ff;color:white;">Grand Total</td>
	</tr>
	<tr>
		<td width="60%" style="border-bottom:silver 1px solid;">
	<div id="remarks" style="font-size:10pt;font-family: arial;border:silver 0px solid;">
		
	</div>
</td>
<td width="5%" style="border-bottom:silver 1px solid;"></td>
<td width="35%" valign="top">
	<table cellspacing="1" align="right" width="100%" style="font-size:10pt;font-family: arial;border:silver 0px solid;">
		<tr>
		<th align="left" style="border-bottom: silver 1px solid;">Service Charges</th><td style="border-bottom: silver 1px solid;text-align: right;" id="totallabour"></td>
	</tr><tr>
		<th align="left" style="border-bottom: silver 1px solid;">ITEMS</th><td style="border-bottom: silver 1px solid;text-align: right;" id="totalsparepart"></td>
	</tr>
	<tr>
		<th align="left" style="border-bottom: silver 1px solid;"> Amount</th><td style="border-bottom: silver 1px solid;text-align: right;" id="totalamount"></td>
	</tr>
	<tr>
<th align="left" style="border-bottom: silver 1px solid;">VAT</th><td style="text-align: right;border-bottom: silver 1px solid;" id="totalvat"></td>
</tr>
<tr>		
		<th align="left" style="border-bottom: silver 1px solid;">Discount</th><td style="border-bottom: silver 1px solid;text-align: right;" id="discount"></td>	
</tr>
<tr>	
		<th align="left" style="background: #4099ff;color:white;">Net Amount</th><td style="text-align: right;background: #4099ff;color:white;" id="grandtotal"></td>
		</tr>					
	</table>
	</td>
 </tr>
</table>
<!-- 	<table width="96%" align="center">
		<tr>
			<td>
	<h4>Remarks</h4>
	</td>
	</tr>
	<tr>
		<td>
	<div id="remarks" style="font-size:10pt;font-family: arial;border:silver 0px solid;">
		
	</div>
</td>
 </tr>
</table> -->
<br><br><br><br>
<!-- 	<table class="all" align="center" width="96%" style="font-size:10pt;font-family: arial;border:silver 0px solid;">
		<tr>
		<th align="left">Total Labour</th><td id="totallabour"></td>
		<th align="left">Total Spare Parts</th><td id="totalsparepart"></td>
		<th align="left">Total Amount</th><td id="totalamount"></td>
		<th align="left">Discount</th><td id="discount"></td>	
		<th align="left">Grand Total</th><td id="grandtotal"></td>
		</tr>					
	</table> -->
	<br><br><br><br>
	<table width="96%" >
	<tr><th>Checked by</th><td id="salesman"></td><th>Reference Number </th><td id="parkingno"></th><th>Key Number </th><td id="keyno"></th></tr>
	</table>
</Br></Br></Br>
	<!-- <table width="98%" style="color:red;font-size:14pt;" cellpadding="5" align="center">
		<tr>
			<td class="s31-">We are not responsible for the gear status after changing thegear oil or gear filter or both together
			</td>
			<td align="right" class="38-">حن غير مسؤلين عن حالة الجير (علبة التروس ) بعد تبديل الزيت أ , الزيت والفلتر معا</td>
		</tr>
		<tr>
			<Td class="s31-"><h3 style='color:red' class="s35-">Car Control / Royal / Pasha </h3>We are not responsible for valuable things left in the car. We arenot responsible for the defect of electrical & electronic partswhile washing operation</Td>
			<td align="right">
	<h3 align="right" class="38-">	كار كنترول / رويال بولشينغ / باشا ووش
</h3>
نحن غير مسؤلين عن فقدان الاشياء الثمينة داخل السيارة نحن غير مسؤلين عن جميع الاعطال الكهربائية والالكترونية الناتجة عن عملية الغسيل
			</td>
		</tr>
		<tr>
			<td class="s31-">The engine wash responsibility only under the customer request</td>
			<td align="right" class="38-">غسيل المحركات بناء على طلب الزبون وهو المسؤول عن الاعطال الناتجة<</td>
		</tr>
	</table> -->




</div>
</div>
</div>
<div id="footer" class="sheet" style="width:874px;background-color: white;padding-left:21px;padding-right:21px;margin:0 auto;padding-bottom: 10px;">
	<table width="100%" border=0 align="center" cellpadding="0" cellspacing="0">
		<tr>
			<td align="center" width="20%">_________________</td>
			<td align="center" width="20%" class="underlinebox" id="regno">____________</td>
			<td align="center" width="20%">____________</td>
			<td align="center" width="20%">_______________</td>
			<td align="center" width="20%">_______________</td>			
		</tr>
		<tr>
			<td align="center" class="s20-" width="20%">Customer's Sign</td>
			<td align="center" class="s20-" width="20%">Reg No.</td>
			<td align="center" class="s20-" width="20%">Delivery Time</td>
			<td align="center" class="s20-" width="20%">Service Advisor</td>
			<td align="center" class="s20-" width="20%">Mobile No</td>			
		</tr>
	</table>
</div>
<style type="text/css">/*<![CDATA[*/

.sheet {background-color:White}
.s0- {padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px}

.s60- {font-family:Arial;font-size:10pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:3px;padding-right:2px;padding-top:6px;padding-bottom:0px}
.s61- {font-family:Arial;font-size:10pt;color:Black;word-wrap:break-word;padding-left:3px;padding-right:2px;padding-top:7px;padding-bottom:0px}
.s62- {font-family:Arial;font-size:12pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:3px;padding-right:3px;padding-top:6px;padding-bottom:0px}
.s63- {font-family:Arial;font-size:10pt;color:Red;font-weight:bold;word-wrap:break-word;padding-left:2px;padding-right:2px;padding-top:7px;padding-bottom:0px;border-left:1px solid Black;border-top:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black}
.s64- {font-family:Arial;font-size:10pt;color:Black;word-wrap:break-word;padding-left:3px;padding-right:3px;padding-top:7px;padding-bottom:0px}
.s65- {font-family:Arial;font-size:16pt;color:Black;direction:rtl;word-wrap:break-word;padding-left:3px;padding-right:3px;padding-top:2px;padding-bottom:0px}
.s66- {font-family:Arial;font-size:14pt;color:Black;direction:rtl;word-wrap:break-word;padding-left:3px;padding-right:3px;padding-top:4px;padding-bottom:0px}
.s67- {font-family:Arial;font-size:10pt;color:Black;word-wrap:break-word;padding-left:3px;padding-right:2px;padding-top:6px;padding-bottom:0px}
.s68- {font-family:Arial;font-size:14pt;color:Black;direction:rtl;word-wrap:break-word;padding-left:3px;padding-right:3px;padding-top:3px;padding-bottom:0px}
.s69- {font-family:Arial;font-size:10pt;color:Black;word-wrap:break-word;padding-left:3px;padding-right:2px;padding-top:4px;padding-bottom:0px}
.s70- {font-family:Arial;font-size:12pt;color:Black;direction:rtl;word-wrap:break-word;padding-left:0px;padding-right:5px;padding-top:1px;padding-bottom:0px}
.s71- {font-family:Arial;font-size:12pt;color:Black;direction:rtl;word-wrap:break-word;padding-left:0px;padding-right:5px;padding-top:5px;padding-bottom:0px}
.s72- {font-family:Arial;font-size:9pt;color:Black;word-wrap:break-word;padding-left:2px;padding-right:3px;padding-top:13px;padding-bottom:0px}
.s73- {font-family:Arial;font-size:9pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:3px;padding-right:2px;padding-top:13px;padding-bottom:0px}
.s74- {font-family:Arial;font-size:9pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:2px;padding-right:2px;padding-top:13px;padding-bottom:0px}
.s75- {font-family:Arial;font-size:9pt;color:Black;word-wrap:break-word;padding-left:2px;padding-right:2px;padding-top:0px;padding-bottom:0px}
.s76- {font-family:Arial;font-size:9pt;color:#0D0D0D;word-wrap:break-word;padding-left:2px;padding-right:3px;padding-top:0px;padding-bottom:0px}
.s77- {font-family:Arial;font-size:9pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:2px;padding-right:3px;padding-top:13px;padding-bottom:0px}
.s78- {font-family:Arial;font-size:9pt;color:Black;word-wrap:break-word;padding-left:2px;padding-right:3px;padding-top:0px;padding-bottom:0px}
.s79- {font-family:Arial;font-size:9pt;color:Black;font-weight:bold;word-wrap:break-word;padding-left:3px;padding-right:3px;padding-top:2px;padding-bottom:0px}
.s80- {font-family:Arial;font-size:9pt;color:Black;word-wrap:break-word;padding-left:3px;padding-right:3px;padding-top:0px;padding-bottom:0px;border-left:1px solid Black;border-right:1px solid Black;border-bottom:1px solid Black}

/*]]>*/</style></head>
	<!-- <div class="sheet page2" style="padding-left:38px;padding-right:12px;padding-top:48px;padding-bottom:48px;width:868px;height:1027px;">
	<div class="layer">
		<br>
		<table border="0" width="90%" align="center" height="70" cellpadding="0">
	<tr><th colspan="2" width="25%" rowspan="2" align="left" valign="middle"><div class="s51-" style='white-space: pre;
    word-wrap: normal;'>JOB CARD</div>  <span id="invoicedate" class="s52-"></span></th><th width="45%" rowspan="2" colspan="3"><img   src='#' id='logo1'> </th><td  valign="middle"align="right" height="10px" width="18%" id="barcode" style="text-align: right;"><span id="barcode3">BARCODE HERE</span>
    </td></tr>
	</table>
	<br><br><br><br><br><br><br><br><br>
	<table border="0" width="90%" align="center">
		<tr><td><div title="" class="textBox56 s65-" style="overflow:hidden;left:38px;top:154px;width:273px;height:27px;">
	<div style="white-space:pre;word-wrap:normal;left:13px;top:2px;"> الرجاء تقديم هذا الايصال عند الاستلام </div></div></td></tr>
	<tr><td class="textBox55 s64-" style="overflow:hidden;left:38px;width:273px;height:22px;">
	<div style="white-space:pre;word-wrap:normal;left:3px;top:7px;">Please present this at delivery centre Counter.</div></td><td width="70%" align="right" class="textBox53 s62-" style="overflow:hidden;height:23px;">
	<div style="white-space:pre;word-wrap:normal;left:3px;top:6px;" align="right">Job Card No</div></td>
	<td  width="15%">
<div id="keyfield" title="" class="textBox54 s63-" style="overflow:hidden;top:173px;width:119px;height:21px;">
CCL-00001</div></td></tr>
	<tr>
	<Td align="left" title="" class="textBox57 s61-" style="overflow:hidden;width:158px;height:22px;">
	<div style="white-space:pre;word-wrap:normal;left:3px;top:7px;">8-00 A.M TO 11-00 P.M.</div></div>
</td>
		<td colspan="2" align="right" title="" class="textBox58 s66-" style="overflow:hidden;left:374px;top:212px;width:206px;height:25px;">
	<div style="white-space:pre;word-wrap:normal;left:4px;top:4px;">الدوام من 8 صباحا حتى 11 مساء</div></td>
	</tr>
	<tr><td><div title="" class="textBox59 s67-" style="overflow:hidden;left:211px;top:241px;width:158px;height:22px;">
	<div style="white-space:pre;word-wrap:normal;left:3px;top:6px;">Cheques not Accepted</div></div></td>
	<td colspan="2" align="right"><div style="white-space:pre;word-wrap:normal;left:4px;top:4px;">الدوام من 8 صباحا حتى 11 مساء</div></td>
</tr>
	<tr>
		<td><div title="" class="textBox61 s69-" style="overflow:hidden;left:38px;top:269px;width:331px;height:35px;">
	<div style="white-space:pre;word-wrap:normal;left:3px;top:4px;">PARKING CHARGE 30/- DHS. DAILY FOR VEHICLES </div>
<div style="white-space:pre;word-wrap:normal;left:3px;top:19px;">NOT TAKEN AFTER DELIVERY TIME</div></div></td>

<td colspan="2" align="right"><div title="" class="textBox62 s70-" style="overflow:hidden;left:374px;top:269px;width:379px;height:38px;">
	<div style="white-space:pre;word-wrap:normal;left:5px;top:1px;">يتم احتساب مبلغ - : 30 درهم اضافية عن كل يوم تأخير عن موعد استلام </div>
<div style="white-space:pre;word-wrap:normal;left:343px;top:19px;">السيارة </div></div></td>
	</tr>
	<tr>
		<td>

<div title="" class="textBox63 s61-" style="overflow:hidden;left:38px;top:308px;width:331px;height:22px;">
	<div style="white-space:pre;word-wrap:normal;left:3px;top:7px;">5% VAT will be added on the Grand Total</div>
		</td>
		<td colspan="2" align="right">
			<div style="white-space:pre;word-wrap:normal;left:68px;top:5px;">سيتم اضافة  5% ضريبة القيمة المضافة على المبلغ الاجمالي</div>
		</td>
	</tr>
	</table>
<br>
<table width="96%" align="center" class="s72-"  border="0" style="font-family: arial;font-size:10pt;">
	<tr><th align="right">Prepared By</th><td id="preparedby"></td><th align="right">Print By</th><td id="printby">---</td><td align="right">Print Time</td><td><span id="printdate"></span> <span id="printtime"></span></td></tr>
	</table>
	</div></div> -->

</body></html>

<script type="text/javascript" src="../assets2/js/jquery-3.2.1.min.js"></script>
<!-- <script src="http://code.jquery.com/jquery-latest.min.js"></script>
 -->
<script type="text/javascript" src="../assets/js/jquery-barcode.js"></script>
<script type="text/javascript" src="../assets/js/jquery-barcode1.js"></script>

<script>
	 var COAID=localStorage.getItem("COAID");
	 console.log('local');
	 console.log(COAID);
	var globalWebServiceInventoryPath='../';
        function getUrlParams(url) {
            var lastURL1 = "";
            var urlParams = {} // return value
            var queryString = getQueryString()

            if (queryString) {
                var keyValuePairs = queryString.split('&')
                for (var i = 0; i < keyValuePairs.length; i++) {
                    var keyValuePair = keyValuePairs[i].split('=')
                    var paramName = keyValuePair[0]
                    var paramValue = keyValuePair[1] || ''
                    urlParams[paramName] = decodeURIComponent(paramValue.replace(/\+/g, ' '))
                }
            }
            return urlParams // functions below
            function getQueryString() {
                var reducedUrl = lastURL1 || url || window.location.search

                reducedUrl = reducedUrl.split('#')[0] // Discard fragment identifier.
                var queryString = reducedUrl.split('?')[1]
                if (!queryString) {
                    if (reducedUrl.search('=') !== false) { // URL is a query string.
                        queryString = reducedUrl
                    }
                }
                return queryString
            } // getQueryString
        } // getUrlParams

/*
        var TextBoxName = getUrlParams()["TextBoxName"];
        var CurrentCompanyID = getUrlParams()["CompanyID"];*/
        var InvoiceID = getUrlParams()["InvoiceID"];
        var company = getUrlParams()["company"];
//alert(company);
	$(document).ready(function(){
		var d=new Date();
$("#printdate").html(d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate());
$("#printtime").html(d.getHours()+':'+(d.getMinutes())+':'+d.getSeconds());
	});
	function DisplayCompany(GodownID)
	{
var condition="degree=1 and active=1 and GodownID="+GodownID;

		$.ajax({


                url: globalWebServiceInventoryPath + 'getmastervalue.php?action=viewlist&TextBoxName=Godowns&fields=GodownID,Name,Address,Address2,EmailAddress1,TRNNo,ContactNO,Website,FAX,AdditionalInfo2&condition='+condition,

                type: 'post',
                dataType: 'json',
                // timeout: 2000,
                data: $(this).serialize(document.forms[0]),
         
                success: function (data) {
             //   	console.log(data);
                	var Company = data[0].Name;
                	var Address = data[0].Address;
                	var Address2 = data[0].Address2;  //pobox
                	var ContactNO  =data[0].ContactNO;  
                	var EmailAddress1 =data[0].EmailAddress1; 
                	var Website =data[0].Website;    
                	var TRNNo=data[0].TRNNo;
                	var Fax =data[0].FAX;               
                	var AdditionalInfo2=data[0].AdditionalInfo2+'logo.png';  	        	
                	$(".companyname").html(Company);
                	$(".Address").html(Address);    //POBox
                	$(".POBox").html(Address2);   
                	$(".Tel").html('Tel:'+ContactNO);   
                	$(".Email").html(EmailAddress1);   
                	$(".Website").html(Website);
                	$(".TRNNo").html('TRN:'+TRNNo);                	 
                	$(".Fax").html('Fax:'+Fax);                   	
                	$(".logo").attr('src','../images/'+AdditionalInfo2);  
                	$("#logo1").attr('src','../images/'+AdditionalInfo2);                  	                 	
                /*	console.log(JSON.stringify(allinvoice));
                	$("span#invoicedate").html(allinvoice.invoicedate);
                	$("span#keyfield").html(allinvoice.keyfield);
         $("th#barcode").barcode(allinvoice.keyfield,"code39");
*/
                //	$('#ReportViewer1ReportFrame').attr('src','../login.html?dataid=3');
                	//parent.$("body").find("#ReportViewer1ReportFrame").html(data);
                
                }
            
            });

	}
	var txtjson=JSON.parse(COAID);//JSON.parse($("#invoicejson").val());
	console.log(txtjson);
for(a=0;a<txtjson.length;a++)
{
//	console.log();
	GenerateBill(txtjson[a].COAID);

}
/*SupplierID=1506;//'[{"SupplierID":1541},{"SupplierID":1545}]';
SupplierID=1475;
GenerateBill(SupplierID);*/
function GenerateBill(SupplierID)
{
		$.ajax({


                url: globalWebServiceInventoryPath + 'getvoucherdata.php?action=getClientBill&InvoiceID='+InvoiceID+'&InvoiceType=55&COAID='+SupplierID+'&startdate=2021-01-01&enddate=2021-05-31',

                type: 'post',
                dataType: 'json',
                // timeout: 2000,
                data: 'SupplierID='+SupplierID,// $(this).serialize(document.forms[0]),
         
                success: function (data) {

                	//alert(data);
                	console.log(data);
         //       	var allinvoice = data[0][0];
                //	console.log(JSON.stringify(allinvoice));
                	var details=data.details;//items;
                	/*if(details!="undefined")
                	{*/
                	console.log(details);
                	//allinvoice.godownid
                	DisplayCompany(1);
                	
                	var totallabour=0;
                	var totalsparepart=0;
                	var discount=0;
                	var vatamount=0;
                	var Serial=0;
                	var Balance=0;
                	var row1='';
                	            var GrandPaid=0;
             var GrandTotal=0;
             var GrandBalance=0;
                	var Balance=0;
                	var Discount=0;
                	var GrandDebit=0;
                	var GrandCredit=0;
  //              	var details=data;
                	var SupplierID='';
                	var opening=data.opening;
               var d=new Date();
var printdate=d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate(); 	//
var header='<div class="sheet page1" style="padding-left:86px;padding-right:86px;padding-top:6px;padding-bottom:26px;width:744px;height:1097px;margin-bottom: 0px;"><div class="layer"><div id="headertop" class="row">	<table border="0" width="96%" align="center"><tr>		<th  width="25%"  align="left" height="100"><div class="s51-" style="white-space: pre;word-wrap: normal;color:#4099ff;font-size: 18px;">Property Bill</div>  <span id="invoicedate" class="s52-">'+printdate+'</span></th><th valign="top" rowspan="2"  ><img style="border:red 0px solid;height: 70px;"  src="#" class="logo"> </th><td  valign="middle" height="20" align="right" width="27%" id="barcode" style="text-align: right;"><span id="barcode3">BARCODE HERE</span></td></tr>		<tr>			<td  align="left" valign="top" align="left" colspan="1" width="300">	<table id="company" width="300" align="center" border="0">		<tr>			<td class="companyname" width="300" class="s19-" style="font-size:12pt !important;font=weight:bold;left:3px;white-space:normal;word-wrap:normal;top:0px;">Company Name </td>		</tr>		<tr>			<td class="Address" class="s20-" style="left:3px;white-space:pre;word-wrap:normal;top:0px;">Company Name </td>		</tr>		<tr><td class="POBox" class="s20-" style="left:3px;white-space:pre;word-wrap:normal;top:0px;">Company Name </td>		</tr>		<tr>			<td class="Tel" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>		</tr>		<tr>			<td class="Fax" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>		</tr>		<tr>			<td class="Email" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>		</tr>		<tr>			<td class="Website" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>		</tr>				<tr>			<td class="TRNNo" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">Company Name </td>		</tr>			</table></td><td  align="right" valign="top">		<table align="right" width="100%" cellpadding="5" cellspacing="5" border="0">			<tr>			<td id="customername" align="right" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">'+SupplierID+'</td>			</tr>		<tr>			<td id="customeremail" align="right" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">'+SupplierID+' </td>		</tr>		<tr>			<td id="customerphone" align="right" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">'+SupplierID+'</td>		</tr>		<tr>			<td id="trnno" align="right" class="s20-" style="white-space:pre;word-wrap:normal;left:3px;top:0px;">'+SupplierID+'</td>		</tr>		</table>	</td></tr></table>';
var detailsdata='<br>	<table id="details" width="96%" align="center" border="0" cellpadding="0" cellspacing="0">		<thead>		<tr>		<th class="s2-" width="70">Serial</th>	<th class="s2-" width="70">Date</th>					<th class="s2-">Against Ledger</th>				<th class="s2-">Description</th>		<th class="s2-">Cost Center</th>		<th class="s2-">Voucher No.</th>		<th class="s2-">Debit</th>		<th class="s2-">Credit	</th>		<th class="s2-" width="100">Balance </th>	</tr>	</thead>';
                	if(opening!=null && opening!="undefined")
                	{

                	                	Balance=parseFloat(Balance)+parseFloat(opening.balance);
                	                	GrandDebit=parseFloat(opening.Debit);
                	                	GrandCredit=parseFloat(opening.Credit);
 	var openrow='<tr><td>----</td>'+'<td colspan=5><strong>'+opening.Narration+'</strong></td><td class="cur">'+opening.Debit+'</td><td class="cur">'+opening.Credit+'</td><td class="cur">'+(opening.balance)+'</td></tr>';
                	//console.log(opening[a].itemname);
               // 	$("body").append(row1);

                	}
                	else
                	{
				var openrow='<tr><td>----</td>'+'<td colspan=5 align=left><strong>Opening Balance</strong></td><td>'+0+'</td><td>'+0+'</td><td>'+0+'</td></tr>';
                	//console.log(opening[a].itemname);
                //	$("#all").append(row);

                	}
if(details)
                	{
                for(a=0;a<details.length;a++)
                {
                	Serial++;
             var Amount=parseFloat(details[a].Debit)+parseFloat((details[a].Credit*-1));
             Balance=parseFloat(Balance)+Amount;
             var Balance1=Balance.toFixed(2);
      //       if(details[a].TotalPaid=="")details[a].TotalPaid=0; 
		//	details[a].Balance= details[a].NetAmount- details[a].TotalPaid;        


CreditLedgerID=details[a].CreditLedgerID;
LedgerID=details[a].LedgerID;
if(details[a].COAID==CreditLedgerID)
{
	//show debit
		againstledger=details[a].debitaccount;
}
else
{
	//show credit
	againstledger=details[a].creditaccount;
}
var vd=details[a].VoucherDate1;
vd=vd.split('-');
var temp=vd[0];
 vd[0]=vd[2];
vd[2]=temp;

details[a].VoucherDate1=vd[0]+'-'+vd[1]+'-'+vd[2];



                       row1=row1+'<tr><td>'+Serial+'</td><td width=90>'+details[a].VoucherDate1+'</td><td width=10%>'+againstledger+'</td><td align=left width=39% style="font-size:8pt;">'+details[a].Narration+''+details[a].InvoiceInfo+'</td><td width=50>'+details[a].CostCenter+'</td><td width=90>&nbsp;'+details[a].VoucherNo+'</td><td align=right class="cur">'+formatNumber(details[a].Debit)+'</td><td align=right class="cur">'+formatNumber(details[a].Credit)+'</td><td width=100 align=right class="cur">'+formatNumber(Balance1)+'</td></tr>';
GrandDebit += parseFloat(details[a].Debit);            

GrandCredit +=parseFloat(details[a].Credit);
GrandBalance +=parseFloat(Balance);
                }
GrandDebit1=GrandDebit.toFixed(2);
GrandCredit1=GrandCredit.toFixed(2);
GrandBalance1=GrandDebit-GrandCredit;// GrandBalance.toFixed(2);
GrandBalance1=GrandBalance1.toFixed(2);
Balance=0;      

                	//console.log(details[a].itemname);
                	var detailFooter='<tr><td colspan=2></td></tr><tr><td colspan="6" align="right" style="border:1px black solid;">Grand Balance &nbsp;</td><th class="s2-" align="right" style="text-align:right !important;">'+formatNumber(GrandDebit1)+'</th><th style="text-align:right !important;" class="s2-" align="right">'+formatNumber(GrandCredit1)+'</th><td class="s2-" style="border:black 1px solid;text-align:right !important;color:black;font-weight:bold;" align=right>'+formatNumber(GrandBalance1)+'</td></tr>';
//                               	$("#all").append(row);
}
                	detailsdata=detailsdata+openrow+row1+detailFooter+'</table>';
var detailFooter1='<table width="96%" border="0" align="center">		<tr>			<td colspan="2" style="border-bottom:silver 1px solid;">	<h4 style="background: #4099ff;color:white;">Remarks</h4>	</td>		<td style="background: #4099ff;color:white;">Grand Total</td>	</tr>	<tr>		<td width="60%" style="border-bottom:silver 1px solid;">	<div id="remarks" style="font-size:10pt;font-family: arial;border:silver 0px solid;">	</div></td><td width="5%" style="border-bottom:silver 1px solid;"></td><td width="35%" valign="top">	<table cellspacing="1" align="right" width="100%" style="font-size:10pt;font-family: arial;border:silver 0px solid;">		<tr>		<th align="left" style="border-bottom: silver 1px solid;">Service Charges</th><td style="border-bottom: silver 1px solid;text-align: right;" id="totallabour"></td>	</tr><tr><th align="left" style="border-bottom: silver 1px solid;">ITEMS</th><td style="border-bottom: silver 1px solid;text-align: right;" id="totalsparepart"></td>	</tr>	<tr>		<th align="left" style="border-bottom: silver 1px solid;"> Amount</th><td style="border-bottom: silver 1px solid;text-align: right;" id="totalamount"></td>	</tr>	<tr><th align="left" style="border-bottom: silver 1px solid;">VAT</th><td style="text-align: right;border-bottom: silver 1px solid;" id="totalvat"></td></tr><tr>				<th align="left" style="border-bottom: silver 1px solid;">Discount</th><td style="border-bottom: silver 1px solid;text-align: right;" id="discount"></td>	</tr><tr>			<th align="left" style="background: #4099ff;color:white;">Net Amount</th><td style="text-align: right;background: #4099ff;color:white;" id="grandtotal"></td>		</tr>						</table>	</td> </tr></table>';
var Footer='<table width="96%" >	<tr><th>Checked by</th><td id="salesman"></td><th>Reference Number </th><td id="parkingno"></th><th>Key Number </th><td id="keyno"></th></tr>	</table></Br></Br></Br></div></div></div><div id="footer" class="sheet" style="width:874px;background-color: white;padding-left:21px;padding-right:21px;margin:0 auto;padding-bottom: 10px;"><table width="100%" border=0 align="center" cellpadding="0" cellspacing="0">		<tr>			<td align="center" width="20%">_________________</td>			<td align="center" width="20%" class="underlinebox" id="regno">____________</td>			<td align="center" width="20%">____________</td>			<td align="center" width="20%">_______________</td>			<td align="center" width="20%">_______________</td>		</tr>		<tr>			<td align="center" class="s20-" width="20%">Customers Sign</td>			<td align="center" class="s20-" width="20%">Reg No.</td>			<td align="center" class="s20-" width="20%">Delivery Time</td>			<td align="center" class="s20-" width="20%">Service Advisor</td>			<td align="center" class="s20-" width="20%">Mobile No</td>				</tr>	</table><br><br><br>';
var row=header+detailsdata+'<br><br>	<br><br><br><br>	<br><br><br><br>'+Footer+'	</div>';                	
//console.log(row);
$("body").append(row);

                
} //end success
            
            });//end ajax
}//end Generate Bill
function formatNumber(num) {
  return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
}
function viewMasterReport(InvoiceID,ItemID)
{
	/*top.window.openReport(this,\'report_files/reportViewer.html?refresh=1&reportFileName=tailorMaster_Report.html&InvoiceID=' + InvoiceID + '\',\'Inspection Report\''); */
	top.window.navigateTo(this, './reportViewer.html?&refresh=1&amp;reportFileName=tailorMaster_Report.html&amp;InvoiceID=' + InvoiceID+'&amp;ItemID='+ItemID+'','Master Report', '15', '')
}
</script>