/beta/bank/xml_AXItemReasonGLAccountRelations.asp

http://github.com/khaneh/Orders · ASP · 44 lines · 37 code · 6 blank · 1 comment · 6 complexity · 40750846eaf98b182d50d4cb5440ec85 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
  2. <!--#include file="../config.asp" -->
  3. <%
  4. if request("id")="" then
  5. response.write escape (" " )
  6. response.end
  7. end if
  8. if not isnumeric(request("id")) then
  9. response.write escape (" " )
  10. response.end
  11. end if
  12. mySQL = "SELECT ID,name FROM GLAccounts WHERE (HasAppendix = 1) AND (GL = "& openGL & ") AND (ID = "& request("id") & ")"
  13. Set RS1=Conn.execute(mySQL)
  14. if RS1.eof then
  15. response.write escape (" " )
  16. response.end
  17. accountName = ""
  18. else
  19. accountName = RS1("name")
  20. end if
  21. RS1.close
  22. mySQL = "SELECT ItemReason FROM AXItemReasonGLAccountRelations WHERE (GL = "& openGL & ") AND (GLAccount = "& request("id") & ")"
  23. Set RS1=Conn.execute(mySQL)
  24. if RS1.eof then
  25. 'Using default reason (sys: AO, reason: Misc.)
  26. Reason=6
  27. else
  28. Reason= cint(RS1("ItemReason"))
  29. end if
  30. RS1.close
  31. mySQL="SELECT * FROM AXItemReasons WHERE (ID="& Reason & ")"
  32. Set RS1=Conn.execute(mySQL)
  33. sys= RS1("Acron")
  34. ReasonName = RS1("Name")
  35. response.write escape( Reason & "-" & ReasonName & " (" & accountName & ")")
  36. RS1.close
  37. conn.close
  38. %>