generateInvoice1.jsp
<%@ page contentType="text/html; charset=euc-jp" %>
<html>
<% String invoiceDate = allaire.samples.invoice.ParameterUtil.getParameterWithEncoding(request, response, "invoiceDate");
String weekEnding = allaire.samples.invoice.ParameterUtil.getParameterWithEncoding(request, response, "weekSelector");
String clientCompany = allaire.samples.invoice.ParameterUtil.getParameterWithEncoding(request, response, "companySelector"); %>
<head>
<title>PSG 請求書: 週: <%= weekEnding %> </title>
</head>
<center>
<p>
<%@ include file="psgHeader.html" %>
<p>
<table border=1 cellspacing=3 cellpadding=5>
<tr><th align="right">請求書発効日:</th><td><%= invoiceDate %></td></tr>
<tr>
<th align="right">コンサルティング サービス発注元:</td>
<td><%= clientCompany %></td>
</tr>
<tr>
<th align="right">住所: </td>
<td>
<% if ( clientCompany.equals("Allaire") ) { %>
275 Grove Street<br>Newton, MA 02466
<% } %>
</td>
</tr>
<tr><th align="right">発注番号:</th><td>4791</td></tr>
<tr><th align="right">週:</th><td><%= weekEnding %></td></tr>
<tr><th align="right">開発者:</th><td>Paul Michael Reilly</td></tr>
<tr><th align="right">レート:</th><td>一時間 $90</td></tr>
</table>
<p> 実働時間:
<% String[] hours = new String[7];
hours[0] = request.getParameter("monHours");
hours[1] = request.getParameter("tueHours");
hours[2] = request.getParameter("wedHours");
hours[3] = request.getParameter("thuHours");
hours[4] = request.getParameter("friHours");
hours[5] = request.getParameter("satHours");
hours[6] = request.getParameter("sunHours");
double sum = 0;
for (int i = 0; i < 7; i++) {
if ( hours[i] == null || hours[i].equals( "" ) ) {
hours[i] = "0.0";
}
sum += (new Double(hours[i])).doubleValue();
}
double rate = 90.00;
double balance = sum * rate; %>
<table border=1 cellspacing=3 cellpadding=5>
<tr>
<th align="right">月曜日: </th>
<td><%= hours[0] %></td>
</tr>
<tr>
<th align="right">火曜日: </th>
<td><%= hours[1] %></td>
</tr>
<tr>
<th align="right">水曜日: </th>
<td><%= hours[2] %></td>
</tr>
<tr>
<th align="right">木曜日: </th>
<td><%= hours[3] %></td>
</tr>
<tr>
<th align="right">金曜日: </th>
<td><%= hours[4] %></td>
</tr>
<tr>
<th align="right">土曜日: </th>
<td><%= hours[5] %></td>
</tr>
<tr>
<th align="right">日曜日: </th>
<td><%= hours[6] %></td>
</tr>
<tr>
<th align="right">合計時間: </th>
<td><%= sum %></td>
</tr>
<tr><th></th><td></td></tr>
<tr>
<th align="right">合計額: </th>
<td><%= "$" + balance %></td>
</tr>
</table>
</html>