<%@page contentType="text/html; charset=utf-8"%>
<%@page import="org.acts.common.*" %>
<%@page import="org.acts.common.html.*" %>
<%@page import="org.acts.member.*" %>
<%@include file="../include/check_login.jsp" %>

<%@include file="../include/header.jsp" %>
<%msbean.setCur_menu_node(MenuItem.MEMBER__RECEIPT);%>
<%@include file="../include/body.jsp" %>
<%
RecordList types=Member.getActiveReceiptSubTypes();
SelectMenu typeSM=new SelectMenu("rc_type",types,"name","code",msbean.getSData("rc_type"));
typeSM.setNilItem("--全部--","");

RecordList years=Member.getMemberReceiptYears(msbean.getMember_seq());
SelectMenu yearSM=new SelectMenu("rc_year",years,"name","year",msbean.getSData("rc_year"));
yearSM.setNilItemEnable(false);

HtmlTable t=new HtmlTable(new int[]{110,430,200,120,100});
t.addTitleCell(0,0,msbean.getCur_menu_node().getName());
t.addRCell(2,0,"收據類別 "+typeSM.toHtml());
t.addRCell(3,0,"年份 "+yearSM.toHtml());
t.addRCell(4,0,new Button("重新整理","javascript:opSubmit('member.MemberModuleAction.receipt.read')"));
t.toHtml(out);

int row=0;
t=new HtmlTable(new int[]{110,150,180,400,110});
t.addHeaderCell(0,row,"日期");
t.addHeaderCell(1,row,"收據編號");
t.addHeaderCell(2,row,"項目");
t.addHeaderCell(3,row,"摘要");
t.addHeaderCell(4,row,"金額");

RecordList r=Member.getReceipts(msbean.getMember_seq(),msbean.getSData("rc_year"),msbean.getSData("rc_type"));
for(int i=0;i<r.size();i++){
    r.setCurrentRow(i);
    row++;
    t.addLCell(0,row,TimeUtil.getStringByDate(r.getT("date")));
    t.addLCell(1,row,r.getS("id"));
    t.addLCell(2,row,r.getS("sub_type"));
    t.addLCell(3,row,r.getS("note"));
    t.addRCell(4,row,Arith.formatAmount(r.getD("amount")));
}

t.toHtml(out);
%>

<%@include file="../include/footer.jsp" %>