<%@ page language="java" contentType="text/html; charset=UTF-8"		%>
<%@ taglib uri="/WEB-INF/struts-bean.tld"		prefix="bean"		%>
<%@ taglib uri="/WEB-INF/struts-html.tld"		prefix="html"		%>
<%@ taglib uri="/WEB-INF/displaytag-12.tld"		prefix="display"	%>
<%@ taglib uri="/WEB-INF/struts-logic.tld"		prefix="logic" 		%>
<jsp:include page="/ampiere/jsp/common/includeYAHOOUI.jsp" flush="true" /> 
<jsp:include page="/ampiere/jsp/common/includeCalendar.jsp" flush="true" /> 
<html>
<head>
	<title><bean:write name="PaymentSelectionForm" property="pageTitle"/></title>
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/import.css" />
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/window.css"/>
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/displaytag.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/ampiere/js/window.js"></script>
</head>

<body id="main" onload="" onunload="closeMyChildren();">

<html:form	style	= "margin:0;"
			target	= "_self"
			action	= "/ampiere/PaymentSelectionAction.do"
			enctype	= "application/x-www-form-urlencoded"
			method	= "POST"
			onsubmit="document.getElementById('progressMsg').style.display='block'">

<html:hidden name="PaymentSelectionForm" property="changedColumn"/>
<input type="hidden" name="PCommand" value="MenuOnOff">


	<table cellspacing="0" width="100%" border="0" cellpadding="0">
	<tr>
		<td>
		<div id="header">
			<h1><bean:write name="PaymentSelectionForm" property="pageTitle"/></h1>
		</div>
		</td>
	    <td valign="top" width="18">
	    	<div id="progressMsg" style="padding-top:1px;display:none;">
				<html:img alt="Wait a moment..." align="right" page = "/ampiere/images/Loading-0.gif"/>
	    	</div>
	    </td>
    </tr>
    <tr>
		<td>
			<img	src="/compiere/ampiere/images/MenuOnOff24.gif"
					onmouseout="btnMouseOut('MenuOnOff');"
					class="imgButton"
					id="MenuOnOff"
					name="MenuOnOff"
					onclick="document.PaymentSelectionForm.PCommand.value='MenuOnOff';menuSwitch();"
					alt="MenuOnOff"
					onmouseover="btnMouseOver('MenuOnOff');"/>
		</td>
    </tr>
	</table>


<!-- body -->
<div id="body" >
    <table class="popupInfoTable">
    <tr>
    	<td>&nbsp;</td>
    </tr>
    <tr>
    	<td align="center">
		    <table class="windowTable" align="center">
		    <tr>
			    <td align="right" valign="middle">
			    	<bean:write name='PaymentSelectionForm' property='bankAccountLabel'/>
			    </td>
			    <td align="left" valign="middle">
			    	<html:select property="bankAccount"
			    				 styleClass="w240"
			    				 onchange="document.PaymentSelectionForm.changedColumn.value=this.name;
			    				 		   document.PaymentSelectionForm.submit();
			    				 		   ">
			    		<html:optionsCollection	name="PaymentSelectionForm"
			    								property="bankAccountList"
			    								value="key"
			    								label="value"/>
			    	</html:select>
			    </td>
			    <td align="right" valign="middle" nowrap>
			    	<bean:write name='PaymentSelectionForm' property='currentBalanceLabel'/>
			    </td>
			    <td align="left" valign="middle" nowrap>
			    	<bean:write name='PaymentSelectionForm' property='currentBalance'/>
			    </td>
			    <td align="left" valign="middle" nowrap>
			    	<bean:write name='PaymentSelectionForm' property='currentCurrency'/>
			    </td>
		    </tr>
		    <tr>
			    <td align="right" valign="middle">
			    	<bean:write name='PaymentSelectionForm' property='businessPartnerLabel'/>
			    </td>
			    <td align="left" valign="middle">
			    	<html:select property="businessPartner"
			    				 styleClass="w240"
			    				 onchange="document.PaymentSelectionForm.changedColumn.value=this.name;
			    				 		   document.PaymentSelectionForm.submit();
			    				 		   ">
			    		<html:optionsCollection	name="PaymentSelectionForm"
			    								property="businessPartnerList"
			    								value="key"
			    								label="value"/>
			    	</html:select>
			    </td>
			    <td align="left" valign="middle" nowrap>
			    	&nbsp;
			    </td>
			    <td align="right" valign="middle" nowrap colspan="2">
			    	<html:checkbox	name="PaymentSelectionForm"
			    					property="onlyDueInvoices"
			    				    onclick="document.PaymentSelectionForm.changedColumn.value=this.name;
				    				 		 document.PaymentSelectionForm.submit();
			    							">
			    		<bean:write name="PaymentSelectionForm" property="onlyDueInvoicesLabel"/>
			    	</html:checkbox>
			    </td>
		    </tr>
		    <tr>
			    <td align="right" valign="middle">
			    	<bean:write name='PaymentSelectionForm' property='paymentDateLabel'/>
			    </td>
			    <td align="left" valign="middle">
			    	<html:text	name="PaymentSelectionForm"
			    				property="paymentDate"				
								styleId="DateF"
			    				onchange="checkDateValidation(this, paraInvalidDateMsg);startUpdate(this);
										  document.PaymentSelectionForm.changedColumn.value=this.name;
				    				 	  document.PaymentSelectionForm.submit();
				    				 	  "/>
					<img	src="/compiere/ampiere/images/Calendar16.png"
							class="popupButton"
							name="DateSelector"
							id="DateP"
							/>
					<div>
					<script type="text/javascript" language="JavaScript1.2">
					InputCalendar.createOnLoaded('DateF',{format: 'yyyy/mm/dd',enableHourMinute: false,lang: 'ja',triggers: ['DateP'],inputReadOnly: true});
					</script>
					</div>
			    </td>
			    <td align="right" valign="middle" nowrap>
			    	<bean:write name='PaymentSelectionForm' property='paymentRuleLabel'/>
			    </td>
			    <td align="left" valign="middle" nowrap colspan="2">
			    	<html:select property="paymentRule"
			    				 styleClass="w240"
			    				 onchange="document.PaymentSelectionForm.changedColumn.value=this.name;
			    				 		   document.PaymentSelectionForm.submit();
			    				 		   ">
			    		<html:optionsCollection	name="PaymentSelectionForm"
			    								property="paymentRuleList"
			    								value="key"
			    								label="value"/>
			    	</html:select>
			    </td>
		    </tr>
		    </table>
		</td>
    </tr>
    <tr>
    	<td align="center">
		    <table align="center" cellspacing="0" class="displaytag" border="0">
			<logic:iterate	name="PaymentSelectionForm"
							id="data"
							property="invoiceList"
							scope="request"
							type="java.util.HashMap">
				<logic:equal name="data" property="RowType" value="title">
				<tr>
					<th>&nbsp;</th>
					<th><bean:write name="data" property="DateDue"/></th>
					<th><bean:write name="data" property="BPartner"/></th>
					<th><bean:write name="data" property="DocumentNo"/></th>
					<th><bean:write name="data" property="Currency"/></th>
					<th><bean:write name="data" property="GrandTotal"/></th>
					<th><bean:write name="data" property="DiscountAmt"/></th>
					<th><bean:write name="data" property="DiscountDate"/></th>
					<th><bean:write name="data" property="AmountDue"/></th>
					<th><bean:write name="data" property="AmountPay"/></th>
				</tr>
				</logic:equal>
				<logic:equal name="data" property="RowType" value="even">
				<tr class="even">
					<td>
						<html:multibox	name="PaymentSelectionForm" property="invoiceIdList">
							<bean:write name="data" property="C_Invoice_ID"/>
						</html:multibox>
					</td>
					<td><bean:write name="data" property="DateDue"/></td>
					<td><bean:write name="data" property="BPartner"/></td>
					<td><bean:write name="data" property="DocumentNo"/></td>
					<td><bean:write name="data" property="Currency"/></td>
					<td><bean:write name="data" property="GrandTotal"/></td>
					<td><bean:write name="data" property="DiscountAmt"/></td>
					<td><bean:write name="data" property="DiscountDate"/></td>
					<td><bean:write name="data" property="AmountDue"/></td>
					<td><bean:write name="data" property="AmountPay"/></td>
				</tr>
				</logic:equal>
				<logic:equal name="data" property="RowType" value="odd">
				<tr class="odd">
					<td>
						<html:multibox	name="PaymentSelectionForm" property="invoiceIdList">
							<bean:write name="data" property="C_Invoice_ID"/>
						</html:multibox>
					</td>
					<td><bean:write name="data" property="DateDue"/></td>
					<td><bean:write name="data" property="BPartner"/></td>
					<td><bean:write name="data" property="DocumentNo"/></td>
					<td><bean:write name="data" property="Currency"/></td>
					<td><bean:write name="data" property="GrandTotal"/></td>
					<td><bean:write name="data" property="DiscountAmt"/></td>
					<td><bean:write name="data" property="DiscountDate"/></td>
					<td><bean:write name="data" property="AmountDue"/></td>
					<td><bean:write name="data" property="AmountPay"/></td>
				</tr>
				</logic:equal>
			</logic:iterate>
			    <tr>
				    <td style="padding-right:5px;" colspan="10" align="right">
						<input	id="ok"
								type="image"
								src="${pageContext.request.contextPath}/ampiere/images/Ok32.png"
								onclick="document.ChargeAccountForm.changedColumn.value='ok';
										 document.ChargeAccountForm.submit();
										"/>
						<span>OK</span>	
				    </td>
				</tr>
			</table>
    	</td>
    </tr>
    </table>
</div>
<!-- /body -->
</html:form>
<script type="text/javascript" language="JavaScript1.2">
	<bean:write name="PaymentSelectionForm" property="resultInfo" filter="false"/>
</script>
</body>
</html>
