PageRenderTime 24ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/beta/accounting/Approve.asp

http://github.com/khaneh/Orders
ASP | 166 lines | 137 code | 16 blank | 13 comment | 12 complexity | 7c4ffd96787beb163a7f0839cd2ce058 MD5 | raw file
  1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2'Accounting (8)
  3PageTitle= "����� ���"
  4SubmenuItem=2
  5if not Auth(8 , 2) then NotAllowdToViewThisPage()
  6
  7%>
  8<!--#include file="top.asp" -->
  9<!--#include File="../include_farsiDateHandling.asp"-->
 10<!--#include File="../include_JS_InputMasks.asp"-->
 11
 12<%
 13
 14
 15'-----------------------------------------------------------------------------------------------------
 16'------------------------------------------------------------------------------------ List ALl GL Docs
 17'-----------------------------------------------------------------------------------------------------
 18if request("act")="" then
 19	response.write "<BR><BR><BLOCKQUOTE>"
 20
 21	set RSS=Conn.Execute ("SELECT GLDocID, GLDocDate FROM GLDocs WHERE (deleted = 0) and (IsChecked = 0) GROUP BY GLDocID, GLDocDate, GL HAVING (GL = "& OpenGL & ")")
 22	
 23	Do while not RSS.eof
 24		response.write "<li class=alak2> <A HREF='Approve.asp?act=ShowDoc&id="& RSS("GLDocID") & "'>��� ����� " & RSS("GLDocID") & " �� ����� <span dir=ltr>"  & RSS("GLDocDate") & "</span></A>"
 25	RSS.moveNext
 26	Loop
 27	response.write "</BLOCKQUOTE>"
 28
 29'-----------------------------------------------------------------------------------------------------
 30'-------------------------------------------------------------------------------- List GL Super Groups
 31'-----------------------------------------------------------------------------------------------------
 32elseif request("act")="submit" then
 33	'----- Check GL is closed
 34	if (session("IsClosed")="True") then
 35		Conn.close
 36		response.redirect "?errMsg=" & Server.URLEncode("���! ��� ���� ���� ���� ��� � ��� ���� �� ����� �� �� ������.")
 37	end if 
 38	'----
 39	id=request("id")
 40	if id="" or not(isnumeric(id)) then
 41		%>
 42		<BR><BR><CENTER>
 43		���! ����� ��� ���� ���� ���
 44		</CENTER>
 45		<%
 46		response.end
 47	end if
 48
 49	if request("submit")="�����" then
 50		Conn.Execute ("UPDATE GLDocs SET IsChecked = 1 WHERE (GLDocID = "& id & ")  AND (GL = "& OpenGL & ")")
 51		response.write "<BR><BR><BR><CENTER><H2>����� ��</H2></CENTER>"
 52	else
 53		response.redirect "GLMemoInput.asp?act=editDoc&id="& id 
 54		response.write "<BR><BR><BR><CENTER><H2>Under Construction</H2></CENTER>"
 55	end if
 56
 57'-----------------------------------------------------------------------------------------------------
 58'-------------------------------------------------------------------------------- List GL Super Groups
 59'-----------------------------------------------------------------------------------------------------
 60elseif request("act")="ShowDoc" then
 61id=request("id")
 62if id="" or not(isnumeric(id)) then
 63	%>
 64	<BR><BR><CENTER>
 65	���! ����� ��� ���� ���� ���
 66	</CENTER>
 67	<%
 68	response.end
 69end if
 70%>
 71<br><br>
 72<%
 73	mySQL="SELECT * FROM GLDocs WHERE (GLDocID = "& id & ")  AND (GL = "& OpenGL & ") and (deleted = 0)"
 74	set RS1=conn.execute(mySQL)
 75	if RS1.eof then
 76		response.write "���! ���� ���� ���� �����"
 77		response.end
 78	end if 
 79
 80	GLDoc = RS1("ID")
 81	GLDocDate = RS1("GLDocDate")
 82	GLDocID = RS1("GLDocID")
 83
 84	mySQL="SELECT GLAccounts.Name AS accTitle, GLRows.Description, GLRows.Amount, GLRows.IsCredit, GLRows.Tafsil, GLRows.GLAccount FROM GLAccounts INNER JOIN GLRows ON GLAccounts.ID = GLRows.GLAccount WHERE (GLRows.GLDoc = "& GLDoc & ") and (GLRows.deleted = 0)  AND (GLAccounts.GL = "& OpenGL & ")"
 85	set RS2=conn.execute(mySQL)
 86
 87	%>
 88<CENTER><H2>��� ����� <%=id%> </H2>
 89<H4>����� ���: <span dir=ltr><%=GLDocDate%></span></H4>
 90<br>
 91
 92</CENTER>
 93<TABLE class="GLTable2" Cellspacing="0" Cellpadding="0" width=90% align=center  Dir="RTL">
 94<tr>
 95	<td style="width:26; border-right:none;"> # </td>
 96	<td style="width:50; ">����</td>
 97	<td style="width:170;">��� ����</td>
 98	<td style="width:300;">���</td>
 99	<!--td style="width:100;">����� ���</td-->
100	<td style="width:80;">������</td>
101	<td style="width:80;">��������</td>
102</tr>
103</table>
104<TABLE Border="0" width=90%  align=center Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#558855" class="GLTable3">
105<Tbody id="GLrows">
106	<%
107
108	Do while not RS2.eof
109		i = i + 1
110		'CreatedDate = RS1("CreatedDate")
111		GLAccount = RS2("GLAccount")
112		accTitle = RS2("accTitle")
113		theDescription = RS2("Description")
114		Amount = RS2("Amount")
115		IsCredit = RS2("IsCredit")
116
117		credit = ""
118		debit = ""
119		if IsCredit  then 
120			credit = Amount 
121			totalCredit = totalCredit + clng(Amount)
122		else
123			debit = Amount 
124			totalDebit = totalDebit + clng(Amount)
125		end if
126
127		%>
128		<tr bgcolor='#F0F0F0' >
129		<td style="width:25; border-right:none;"> <%=i%> </td>
130		<td style="width:50;"><%=GLAccount%></td>
131		<td style="width:170;"><%=accTitle%></td>
132		<td style="width:300;"><%=theDescription%></td>
133		<!--td style="width:100;" > <span dir=ltr><%=CreatedDate%></span></td-->
134		<td style="width:80;"><%=debit%></td>
135		<td style="width:80;"><%=credit%></td>
136		</tr>
137		<%
138	RS2.movenext
139	loop	
140%>
141</Tbody></TABLE>
142<table  width=90% align="center" Cellspacing="0" Cellpadding="0"  align=center dir=rtl>
143<tr style="border:none;">
144	<td style="width:26;"></td>
145	<td style="width:50;"></td>
146	<td style="width:170;"></td>
147	<td style="width:300;">���</td>
148	<td style="width:100;"></td>
149	<td style="width:80;"><%=totalDebit%></td>
150	<td style="width:80;"><%=totalCredit%></td>
151</tr>
152</TABLE>	
153<BR><BR>
154<CENTER>
155<FORM METHOD=POST ACTION="Approve.asp?act=submit">
156<INPUT TYPE="hidden" name="id" value="<%=id%>">
157<INPUT TYPE="submit" name="submit" value="�����" class="GenButton" onclick="return confirm('������ �� ������ ��� ��� �� ����� ���Ͽ�')">
158<INPUT TYPE="submit" name="submit" value="������" class="GenButton">
159<INPUT TYPE="button" name="submit" value="�ѐ��" class="GenButton" onclick="window.location='Approve.asp'">
160</FORM>
161</CENTER>
162<BR><BR>
163<%
164end if
165%>
166<!--#include file="tah.asp" -->