/beta/admin/Reports.asp

http://github.com/khaneh/Orders · ASP · 236 lines · 228 code · 4 blank · 4 comment · 20 complexity · 7bb7e044ee4a3c711799a490abe18cb2 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. ' Admin
  3. PageTitle=" "
  4. SubmenuItem=8
  5. function Separate(inputTxt)
  6. myMinus=""
  7. input=inputTxt
  8. t=instr(input, ".")
  9. if t>0 then
  10. expPart = mid(input, t+1, 2)
  11. input = left(input, t-1)
  12. end if
  13. if left(input,1)="-" then
  14. myMinus="-"
  15. input=right(input,len(input)-1)
  16. end if
  17. if len(input) > 3 then
  18. tmpr=right(input ,3)
  19. tmpl=left(input , len(input) - 3 )
  20. result = tmpr
  21. while len(tmpl) > 3
  22. tmpr=right(tmpl,3)
  23. result = tmpr & "," & result
  24. tmpl=left(tmpl , len(tmpl) - 3 )
  25. wend
  26. if len(tmpl) > 0 then
  27. result = tmpl & "," & result
  28. end if
  29. else
  30. result = input
  31. end if
  32. if t>0 then
  33. result = result & "." & expPart
  34. end if
  35. Separate=myMinus & result
  36. end function
  37. %>
  38. <!--#include file="top.asp" -->
  39. <STYLE>
  40. .GetCustTbl {font-family:tahoma; background-color: #DDDDDD; width:630; direction: RTL; }
  41. .GetCustTbl td {padding:2; font-size: 9pt; height:25;}
  42. .GetCustInp { font-family:tahoma; font-size: 9pt;}
  43. .CusTableHeader {background-color: #33AACC; text-align: center; font-weight:bold;}
  44. .CustContactTable {font-family:tahoma; width:100%; border:1 solid black; direction: RTL; background-color:#CCCCCC;}
  45. .CustContactTable td {padding:5;}
  46. .CustTable {font-family:tahoma; width:80%; border:1 solid black; direction: RTL; background-color:black;}
  47. .CustTable td {padding:5;}
  48. .CustTable a {text-decoration:none;color:#000088}
  49. .CustTable a:hover {text-decoration:underline;}
  50. .CusTD1 {background-color: #CCCC66; text-align: left; font-weight:bold;}
  51. .CusTD2 {background-color: #DDDDDD; direction: LTR; text-align: right; font-size:9pt;}
  52. .CusTD3 {background-color: #DDDDDD; direction: LTR; text-align: center; font-size:9pt;}
  53. .CusTD4 {background-color: #CCCC66; direction: LTR; text-align: center; font-size:9pt;}
  54. .CustTable4 {font-family:tahoma; direction: RTL; width:100%; height:100%; background-color:#C3DBEB;}
  55. </STYLE>
  56. <TaBlE class="CustTable4" cellspacing="2" cellspacing="2">
  57. <Tr>
  58. <Td colspan="2" valign="top" align="center">
  59. <table class="CustTable" cellspacing='1' style='width:90%;'>
  60. <tr>
  61. <td colspan="9" class="CusTableHeader" style="text-align:right;"> ǘ </td>
  62. </tr>
  63. <%
  64. mySQL="SELECT Accounts.AccountTitle, orders_trace.radif_sefareshat, orders_trace.order_date, orders_trace.order_kind, orders_trace.order_title, orders_trace.salesperson, orders_trace.vazyat, orders_trace.marhale FROM Orders INNER JOIN orders_trace ON Orders.ID = orders_trace.radif_sefareshat INNER JOIN Accounts ON Orders.Customer = Accounts.ID WHERE (Orders.Closed = 0) AND (Orders.ID NOT IN (SELECT [ORDER] FROM InvoiceOrderRelations)) ORDER BY Orders.CreatedDate DESC, Orders.ID"
  65. Set RS1 = conn.execute(mySQL)
  66. if RS1.eof then
  67. %>
  68. <tr>
  69. <td colspan="8" class="CusTD3"></td>
  70. </tr>
  71. <%
  72. else
  73. %> <tr>
  74. <td class="CusTD3">#</td>
  75. <td class="CusTD3"></td>
  76. <td class="CusTD3"></td>
  77. <td class="CusTD3"></td>
  78. <td class="CusTD3"></td>
  79. <td class="CusTD3"></td>
  80. <td class="CusTD3"></td>
  81. <td class="CusTD3"></td>
  82. <td class="CusTD3"></td>
  83. </tr>
  84. <% tmpCounter=0
  85. Do while not RS1.eof
  86. tmpCounter = tmpCounter + 1
  87. if tmpCounter mod 2 = 1 then
  88. tmpColor="#FFFFFF"
  89. tmpColor2="#FFFFBB"
  90. Else
  91. tmpColor="#DDDDDD"
  92. tmpColor2="#EEEEBB"
  93. End if
  94. 'alert(this.getElementByTagName('td').items(0).data);
  95. %>
  96. <TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../order/TraceOrder.asp?act=show&order=<%=RS1("radif_sefareshat")%>');">
  97. <TD style="height:30px;"><%=tmpCounter%></TD>
  98. <TD style="height:30px;"><%=RS1("radif_sefareshat")%></TD>
  99. <TD><%=RS1("salesperson")%>&nbsp;</TD>
  100. <TD dir="LTR" align='right'><%=RS1("order_date")%>&nbsp;</TD>
  101. <TD dir="LTR" align='right'><%=RS1("AccountTitle")%>&nbsp;</TD>
  102. <TD><%=RS1("order_kind")%>&nbsp;</TD>
  103. <TD><%=RS1("order_title")%>&nbsp;</TD>
  104. <TD><%=RS1("marhale")%>&nbsp;</TD>
  105. <TD><%=RS1("vazyat")%>&nbsp;</TD>
  106. </TR>
  107. <% RS1.moveNext
  108. Loop
  109. end if
  110. %>
  111. </table>
  112. </Td>
  113. </Tr>
  114. <Tr>
  115. <Td colspan="2" valign="top" align="center">
  116. <hr>
  117. </Td>
  118. </Tr>
  119. <Tr>
  120. <Td colspan="2" valign="top" align="center">
  121. <table class="CustTable" cellspacing='1' style='width:90%;'>
  122. <tr>
  123. <td colspan="8" class="CusTableHeader" style="text-align:right;"> ( )</td>
  124. </tr>
  125. <%
  126. mySQL="SELECT Invoices.ID, Invoices.CreatedDate, Users.RealName AS Creator, Invoices.TotalReceivable, InvoiceOrderRelations.[Order], orders_trace.vazyat, orders_trace.marhale FROM orders_trace RIGHT OUTER JOIN InvoiceOrderRelations ON orders_trace.radif_sefareshat = InvoiceOrderRelations.[Order] RIGHT OUTER JOIN Invoices INNER JOIN Users ON Invoices.CreatedBy = Users.ID ON InvoiceOrderRelations.Invoice = Invoices.ID WHERE (Invoices.Voided = 0) AND (Invoices.Approved = 0) ORDER BY Invoices.CreatedDate DESC, Invoices.ID"
  127. Set RS1 = conn.execute(mySQL)
  128. if RS1.eof then
  129. %>
  130. <tr>
  131. <td colspan="8" class="CusTD3"></td>
  132. </tr>
  133. <%
  134. else
  135. %> <tr>
  136. <td class="CusTD3">#</td>
  137. <td class="CusTD3"> </td>
  138. <td class="CusTD3"> </td>
  139. <td class="CusTD3"></td>
  140. <td class="CusTD3"> </td>
  141. <td class="CusTD3"></td>
  142. <td class="CusTD3"></td>
  143. <td class="CusTD3"></td>
  144. </tr>
  145. <% tmpCounter=0
  146. Do while not RS1.eof
  147. tmpCounter = tmpCounter + 1
  148. if tmpCounter mod 2 = 1 then
  149. tmpColor="#FFFFFF"
  150. tmpColor2="#FFFFBB"
  151. Else
  152. tmpColor="#DDDDDD"
  153. tmpColor2="#EEEEBB"
  154. End if
  155. 'alert(this.getElementByTagName('td').items(0).data);
  156. %>
  157. <TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../AR/AccountReport.asp?act=showInvoice&invoice=<%=RS1("ID")%>');">
  158. <TD style="height:30px;"><%=tmpCounter%></TD>
  159. <TD style="height:30px;"><%=RS1("ID")%></TD>
  160. <TD><%=RS1("Creator")%>&nbsp;</TD>
  161. <TD dir="LTR" align='right'><%=RS1("CreatedDate")%>&nbsp;</TD>
  162. <TD dir="LTR" align='right'><%=RS1("Order")%>&nbsp;</TD>
  163. <TD dir="LTR" align='right'><%=RS1("vazyat")%>&nbsp;</TD>
  164. <TD dir="LTR" align='right'><%=RS1("Marhale")%>&nbsp;</TD>
  165. <TD><%=Separate(RS1("TotalReceivable"))%>&nbsp;</TD>
  166. </TR>
  167. <% RS1.moveNext
  168. Loop
  169. end if
  170. %>
  171. </table>
  172. </Td>
  173. </Tr>
  174. <Tr>
  175. <Td colspan="2" valign="top" align="center">
  176. <hr>
  177. </Td>
  178. </Tr>
  179. <Tr>
  180. <Td colspan="2" valign="top" align="center">
  181. <table class="CustTable" cellspacing='1' style='width:90%;'>
  182. <tr>
  183. <td colspan="7" class="CusTableHeader" style="text-align:right;"> ( )</td>
  184. </tr>
  185. <%
  186. mySQL="SELECT Invoices.ID, Invoices.CreatedDate, Users.RealName AS Creator, Invoices.ApprovedDate, Invoices.TotalReceivable, Users_1.RealName AS Approver FROM Invoices INNER JOIN Users ON Invoices.CreatedBy = Users.ID INNER JOIN Users Users_1 ON Invoices.ApprovedBy = Users_1.ID WHERE (Invoices.Voided = 0) AND (Invoices.Issued = 0) ORDER BY Invoices.CreatedDate DESC, Invoices.ID"
  187. Set RS1 = conn.execute(mySQL)
  188. if RS1.eof then
  189. %>
  190. <tr>
  191. <td colspan="7" class="CusTD3"></td>
  192. </tr>
  193. <%
  194. else
  195. %> <tr>
  196. <td class="CusTD3">#</td>
  197. <td class="CusTD3"> </td>
  198. <td class="CusTD3"> </td>
  199. <td class="CusTD3"></td>
  200. <td class="CusTD3"> </td>
  201. <td class="CusTD3"> </td>
  202. <td class="CusTD3"></td>
  203. </tr>
  204. <% tmpCounter=0
  205. Do while not RS1.eof
  206. tmpCounter = tmpCounter + 1
  207. if tmpCounter mod 2 = 1 then
  208. tmpColor="#FFFFFF"
  209. tmpColor2="#FFFFBB"
  210. Else
  211. tmpColor="#DDDDDD"
  212. tmpColor2="#EEEEBB"
  213. End if
  214. 'alert(this.getElementByTagName('td').items(0).data);
  215. %>
  216. <TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../AR/AccountReport.asp?act=showInvoice&invoice=<%=RS1("ID")%>');">
  217. <TD style="height:30px;"><%=tmpCounter%></TD>
  218. <TD style="height:30px;"><%=RS1("ID")%></TD>
  219. <TD><%=RS1("Creator")%>&nbsp;</TD>
  220. <TD dir="LTR" align='right'><%=RS1("CreatedDate")%>&nbsp;</TD>
  221. <TD><%=RS1("Approver")%>&nbsp;</TD>
  222. <TD dir="LTR" align='right'><%=RS1("ApprovedDate")%>&nbsp;</TD>
  223. <TD><%=Separate(RS1("TotalReceivable"))%>&nbsp;</TD>
  224. </TR>
  225. <% RS1.moveNext
  226. Loop
  227. end if
  228. %>
  229. </table>
  230. </Td>
  231. </Tr>
  232. <!--#include file="tah.asp" -->