FnaRpLedger.jsp
9.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<%@ page import="weaver.general.Util,java.util.*,java.math.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ include file="/systeminfo/init_wev8.jsp" %>
<% if(!HrmUserVarify.checkUserRight("FnaTransaction:All",user)) {
response.sendRedirect("/notice/noright.jsp") ;
return ;
}
%>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="CurrencyComInfo" class="weaver.fna.maintenance.CurrencyComInfo" scope="page"/>
<jsp:useBean id="LedgerComInfo" class="weaver.fna.maintenance.LedgerComInfo" scope="page"/>
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="../../js/weaver_wev8.js"></script>
</head>
<%
char separator = Util.getSeparator() ;
String tranperiods = Util.null2String(request.getParameter("tranperiods"));
String ledgerid = Util.null2String(request.getParameter("ledgerid"));
String fnayearfrom = Util.null2String(request.getParameter("fnayearfrom"));
String periodsidfrom = Util.null2String(request.getParameter("periodsidfrom"));
String fnayearto = Util.null2String(request.getParameter("fnayearto"));
String periodsidto = Util.null2String(request.getParameter("periodsidto"));
String defcurrenyid = Util.null2String(request.getParameter("defcurrenyid"));
if(!tranperiods.equals("")) {
fnayearfrom = tranperiods.substring(0,4) ;
periodsidfrom = "" +Util.getIntValue(tranperiods.substring(4,6)) ;
fnayearto = fnayearfrom ;
periodsidto = periodsidfrom ;
}
if(defcurrenyid.equals("")) {
RecordSet.executeProc("FnaCurrency_SelectByDefault","");
RecordSet.next();
defcurrenyid = RecordSet.getString(1);
}
if(fnayearfrom.equals("") || fnayearto.equals("")) {
String currentyear = "" ;
RecordSet.executeProc("FnaYearsPeriods_SelectMaxYear","");
if(RecordSet.next()) currentyear = RecordSet.getString("fnayear") ;
if(currentyear.equals("")) {
Calendar today = Calendar.getInstance();
currentyear = Util.add0(today.get(Calendar.YEAR), 4) ;
}
if(fnayearfrom.equals("")) fnayearfrom = currentyear ;
if(fnayearto.equals("")) fnayearto = currentyear ;
}
if(periodsidfrom.equals("")) periodsidfrom = "1" ;
if(periodsidto.equals("")) periodsidto = "12" ;
String dbperiodsfrom = fnayearfrom + Util.add0(Util.getIntValue(periodsidfrom),2) ;
String dbperiodsto = fnayearto + Util.add0(Util.getIntValue(periodsidto),2) ;
if(dbperiodsfrom.compareTo(dbperiodsto) > 0) {
String tempperiods = dbperiodsfrom ; dbperiodsfrom = dbperiodsto ; dbperiodsto = tempperiods ;
tempperiods = fnayearfrom ; fnayearfrom = fnayearto ; fnayearto = tempperiods ;
tempperiods = periodsidfrom ; periodsidfrom = periodsidto ; periodsidto = tempperiods ;
}
String para = ledgerid + separator + dbperiodsfrom + separator + dbperiodsto ;
String imagefilename = "/images/hdReport_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(667,user.getLanguage());
String needfav ="1";
String needhelp ="";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
<tr>
<td height="10" colspan="3"></td>
</tr>
<tr>
<td ></td>
<td valign="top">
<TABLE class=Shadow>
<tr>
<td valign="top">
<FORM id=frmMain name=frmMain action=FnaRpLedger.jsp method=post>
<div>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(354,user.getLanguage())+",javascript:frmMain.submit(),_top} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<BUTTON class=btnRefresh id=button1 accessKey=R name=button1 style="display:none" type=submit><U>R</U>-<%=SystemEnv.getHtmlLabelName(354,user.getLanguage())%></BUTTON>
</div>
<input id=defcurrenyid type=hidden name=defcurrenyid value="<%=defcurrenyid%>">
<TABLE class=ViewForm>
<COLGROUP>
<COL width="10%"></COL>
<COL width="25%"></COL>
<COL width="10%"></COL>
<COL width="25%"></COL>
<COL width="10%"></COL>
<COL width="25%"></COL>
<THEAD>
<TR class=Title>
<TH colSpan=6><%=SystemEnv.getHtmlLabelName(324,user.getLanguage())%></TH></TR></THEAD>
<TBODY>
<TR class=Spacing>
<TD class=Line1 colSpan=6></TD></TR>
<TBODY>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(585,user.getLanguage())%></TD>
<TD class=Field><button class=Browser id=SelectLedger onClick='onShowLedger(ledgeridspan,ledgerid)'></button>
<span class=InputStyle id=ledgeridspan>
<% if(!ledgerid.equals("")) {%>
<%=Util.toScreen(LedgerComInfo.getLedgermark(ledgerid),user.getLanguage())%>-<%=Util.toScreen(LedgerComInfo.getLedgername(ledgerid),user.getLanguage())%>
<%}%>
</span>
<input id=ledgerid type=hidden name=ledgerid>
</TD>
<TD><%=SystemEnv.getHtmlLabelName(1812,user.getLanguage())%></TD>
<TD class=Field>
<select class=InputStyle name="fnayearfrom">
<%
RecordSet.executeProc("FnaYearsPeriods_Select","");
while(RecordSet.next()) {
String thefnayear = RecordSet.getString("fnayear") ;
%>
<option value="<%=thefnayear%>" <% if(thefnayear.equals(fnayearfrom)) {%>selected<%}%>><%=thefnayear%></option>
<%}
RecordSet.beforFirst() ;
%>
</select>
<INPUT class=InputStyle id=periodsidfrom name=periodsidfrom maxlength="2" onKeyPress="ItemCount_KeyPress()" onBlur='checknumber("periodsidfrom")' size="8" value="<%=periodsidfrom%>">
</TD>
<TD><%=SystemEnv.getHtmlLabelName(1813,user.getLanguage())%></TD>
<TD class=Field>
<select class=InputStyle name="fnayearto">
<%
while(RecordSet.next()) {
String thefnayear = RecordSet.getString("fnayear") ;
%>
<option value="<%=thefnayear%>" <% if(thefnayear.equals(fnayearto)) {%>selected<%}%>><%=thefnayear%></option>
<%}%>
</select>
<INPUT class=InputStyle id=periodsidto name=periodsidto maxlength="2" onKeyPress="ItemCount_KeyPress()" onBlur='checknumber("periodsidto")' size="8" value="<%=periodsidto%>">
</TD></TR><TR><TD class=Line colSpan=6></TD></TR></TBODY></TABLE>
<br>
</FORM>
<table class=ListStyle cellspacing=1>
<colgroup>
<col width="10%">
<col width="10%">
<col width="15%">
<col width="20%">
<col align=right width="15%">
<col align=right width="15%">
<col align=right width="15%">
<tbody> <thead>
<tr class=header>
<th colspan=4 style="TEXT-ALIGN: left"> <%=SystemEnv.getHtmlLabelName(667,user.getLanguage())%>
</th>
<th colspan=3 style="TEXT-ALIGN: right"><%=SystemEnv.getHtmlLabelName(406,user.getLanguage())%>: <%=Util.toScreen(CurrencyComInfo.getCurrencyname(defcurrenyid),user.getLanguage())%></th>
</tr>
<tr class=Header>
<td align="left"><%=SystemEnv.getHtmlLabelName(585,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(714,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(97,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(341,user.getLanguage())%></td>
<td style="TEXT-ALIGN: right"><%=SystemEnv.getHtmlLabelName(1465,user.getLanguage())%></td>
<td style="TEXT-ALIGN: right"><%=SystemEnv.getHtmlLabelName(1466,user.getLanguage())%></td>
<td style="TEXT-ALIGN: right"><%=SystemEnv.getHtmlLabelName(1811,user.getLanguage())%></td>
</tr><TR class=Line><TD colSpan=7></TD></TR>
</thead> <tbody>
<%
int i=0 ;
String tempid = "" ;
BigDecimal tranremains = new BigDecimal("0") ;
BigDecimal tempzero = new BigDecimal("0") ;
RecordSet.executeProc("FnaAccountList_Select",para);
while(RecordSet.next()){
String ids = Util.null2String(RecordSet.getString("ledgerid")) ;
String tranids = Util.null2String(RecordSet.getString("tranid")) ;
String tranmarks = Util.null2String(RecordSet.getString("tranmark")) ;
String trandates = Util.null2String(RecordSet.getString("trandate")) ;
String tranremarks = Util.toScreen(RecordSet.getString("tranremark"),user.getLanguage()) ;
String tranaccounts = Util.null2String(RecordSet.getString("tranaccount")) ;
String tranbalances = Util.null2String(RecordSet.getString("tranbalance")) ;
if(tranmarks.equals("0")) {
tranremains = new BigDecimal(tranaccounts) ;
tranaccounts = "";
}
else {
if(!tranaccounts.equals("")) {
BigDecimal tempaccount = new BigDecimal(tranaccounts) ;
if(tempaccount.compareTo(tempzero) == 0) tranaccounts = "" ;
else {
if(LedgerComInfo.getLedgerbalance(ids).equals(tranbalances)) tranremains = tranremains.add(tempaccount) ;
else tranremains = tranremains.subtract(tempaccount) ;
}
}
}
if(i==0){
i=1;
%>
<TR class=DataLight>
<%
}else{
i=0;
%>
<TR class=DataDark>
<%
}
%>
<td>
<% if(!tempid.equals(ids)) { %>
<%=Util.toScreen(LedgerComInfo.getLedgermark(ids),user.getLanguage())%>-<%=Util.toScreen(LedgerComInfo.getLedgername(ids),user.getLanguage())%>
<%tempid = ids; }%>
</td>
<td><% if(!tranmarks.equals("0")) {%>
<a href="/fna/transaction/FnaTransactionEdit.jsp?id=<%=tranids%>"><%=tranmarks%></a>
<%}%>
</td>
<td><%=trandates%></td>
<td>
<% if(tranmarks.equals("0")) {%><%=SystemEnv.getHtmlLabelName(1810,user.getLanguage())%>
<%} else {%><%=tranremarks%><%}%>
</td>
<td>
<%if(tranbalances.equals("1") && !tranaccounts.equals("")) {%>
<%=Util.getFloatStr(tranaccounts,3)%>
<%}%>
</td>
<td>
<%if(tranbalances.equals("2") && !tranaccounts.equals("")) {%>
<%=Util.getFloatStr(tranaccounts,3)%>
<%}%>
</td>
<td><%=Util.getFloatStr(tranremains.toString(),3)%></td>
</tr>
<%}%>
</tbody>
</table>
<script language=vbs>
sub onShowLedger(spanname, inputname)
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/fna/maintenance/FnaLedgerAllBrowser.jsp")
if NOT isempty(id) then
if id(0)<> "" then
spanname.innerHtml = id(1)
inputname.value=id(0)
else
spanname.innerHtml = ""
inputname.value=""
end if
end if
end sub
</script>
</td>
</tr>
</TABLE>
</td>
<td></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
</table>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
</BODY></HTML>