<?php 
require_once ('../include/tc_calendar.php');
$start = strtotime($_SESSION['supply_date']);
$d = date("d", $start );
$m = date("m", $start );
$y = date("Y", $start );

$table_name = $_SESSION['db_prefix']."_cash_sales_lines_temp ";
$line_query = "SELECT * FROM $table_name  WHERE user_name = '".$_SESSION['username']."'";
$line_result = mySQL_query($line_query);
$line_num = mysql_num_rows($line_result);


$page = 'quote';
$temp_table_name = $_SESSION['db_prefix']."_quotation_lines_temp";
include('../include/store_item_select_header_no_price.php');

$table_name = $_SESSION['db_prefix']."_permissions";
$permission_query = "SELECT access_id  FROM  $table_name  WHERE access_id ='". $_SESSION['access_id']."' AND page_name = 'Sales-discount' ";
$permission_result = mySQL_query($permission_query);
$permission_num = mysql_num_rows($permission_result);
if ($permission_num>0) { 
		$discount_limit = 'no'; 
}
else {
	$discount_limit = 'yes'; 
}

?>


<script language="JavaScript" src="../jscript/numbers_only_decimal.js"  type="text/javascript"></script>  

</head>

<?php include('../include/wait.php') ?>

<body onLoad="MM_showHideLayers('wait','','hide'); initCS(); calc_M();" onFocus="MM_showHideLayers('wait','','hide');" >

<form id="form1" name="form1" method="get" action="newQuoteWizbase.php">


<div class="wizard_page_middle_frame">
<div class="wizard_frame">
          <table width="677" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="108" height="30"><label class="label_std">Supply date:</label></td>
              <td width="255"><?php

		$myCalendar = new tc_calendar("supply_date", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($d, $m, $y);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2014, 2090);
		$myCalendar->writeScript();
?></td>
              <td width="105">&nbsp;</td>
              <td width="209">&nbsp;</td>
            </tr>
            <tr>
              <td><label class="label_std">Receipt_no</label></td>
              <td><input type="text" name="receipt_no_text" id="receipt_no_text" onKeyUp="ToUpper(this)"  value="<?php echo $_SESSION['receipt_no']?>"></td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
          </table>
      </div>
<?php 
include('../include/store_item_select_table_no_price.php');
?>



 
<div class="wizard_frame">
  <table width="590" height="50" align="center" id="table_button_bar">
          <tr>
            <td width="117"><input type="button" name="lastprev_button" class="imagebutton" value="Prev" onClick="needToConfirm = false;MM_showHideLayers('wait','','show');MM_goToURL('parent','newQuoteWizbase.php?s=&amp;p=2'); return document.MM_returnValue; ;return document.MM_returnValue"/></td>
            <td width="115">&nbsp;</td>
            <td width="99"><span class="wizard">
              <input name="error" type="hidden" id="error" value="0" />
              <input name="p" type="hidden" id="p" value="3" />
              <input name="s" type="hidden" id="s" value="3" />
            </span></td>
            <td width="125" align="left"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false;  cancel_confirmation(1, '../sales/sales_main.php?date=&branch=');" value="Cancel" /></td>
            <td width="110" align="left"><input type="submit" name="next_button" class="imagebutton" value="Next" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" /></td>
          </tr>
      </table>
    </div>
  </div>
</form>
</div>

<!--form validation-->
 <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("receipt_no_text","req","Please enter receipt no.");   
  for (i = 0; i < 50; i++) {
	frmvalidator.addValidation("store_item_id"+i,"req","Store item on line "+(i+1)+".");
	frmvalidator.addValidation("quantity_text"+i,"req","Quantity  on line "+(i+1)+".");
  }
  </script>

</body>

