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