/beta/AR/ePayment.asp

http://github.com/khaneh/Orders · ASP · 187 lines · 151 code · 11 blank · 25 comment · 17 complexity · 9791a63387bc56c7697fb24bcf6818df MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
  2. <%
  3. response.buffer=true
  4. PageTitle=" "
  5. SubmenuItem=3
  6. %>
  7. <!--#include file="top.asp" -->
  8. <!--#include File="../include_farsiDateHandling.asp"-->
  9. <!--#include File="../include_JS_InputMasks.asp"-->
  10. <%
  11. InvoiceID = request("Invoice")
  12. if not(isnumeric(InvoiceID)) then
  13. response.write "<br>"
  14. call showAlert (" ",CONST_MSG_ERROR)
  15. response.end
  16. end if
  17. InvoiceID=clng(InvoiceID)
  18. mySQL="SELECT * FROM Invoices WHERE (Invoices.ID ='"& InvoiceID & "')"
  19. Set RS1 = conn.Execute(mySQL)
  20. if RS1.eof then
  21. response.write "<br>"
  22. call showAlert (" ",CONST_MSG_ERROR)
  23. response.end
  24. end if
  25. customerID= RS1("Customer")
  26. totalPrice= cdbl(RS1("totalPrice"))
  27. totalDiscount= cdbl(RS1("totalDiscount"))
  28. totalReverse= cdbl(RS1("totalReverse"))
  29. totalVat = cdbl(RS1("totalVat"))
  30. ' creationDate= RS1("CreatedDate")
  31. ' ApproveDate= RS1("ApprovedDate")
  32. ' issueDate= RS1("IssuedDate")
  33. ' VoidDate= RS1("VoidedDate")
  34. ' InvoiceNo= RS1("Number")
  35. ' Voided= RS1("Voided")
  36. ' Issued= RS1("Issued")
  37. ' Approved= RS1("Approved")
  38. ' IsReverse= RS1("IsReverse")
  39. ' if RS1("IsA") = TRUE then IsA=1 else IsA=0
  40. ' Creator = RS1("Creator")
  41. ' Approver = RS1("Approver")
  42. ' Issuer = RS1("Issuer")
  43. ' Voider = RS1("Voider")
  44. ' payable=request("Payable")
  45. ' custID=request("CustID")
  46. RS1.close
  47. TotalReceivable= totalPrice - totalDiscount - totalReverse + totalVat
  48. mySQL="SELECT * FROM Accounts WHERE (ID='"& customerID & "')"
  49. Set RS1 = conn.Execute(mySQL)
  50. if not RS1.EOF then
  51. customerName=RS1("AccountTitle")
  52. email1=RS1("EMail1")
  53. end if
  54. RS1.close
  55. %>
  56. <div style='direction:rtl;'>
  57. !
  58. <br/>
  59. ϡ
  60. <br/>
  61. .
  62. <br/>
  63. </div>
  64. <%
  65. %>
  66. <br/>
  67. <table>
  68. <tr>
  69. <td> :</td>
  70. <td><a href='/beta/CRM/AccountInfo.asp?act=show&selectedCustomer=<%=customerID%>'><%=customerName%></a></td>
  71. </tr>
  72. <tr>
  73. <td> :</td>
  74. <td><%=email1%></td>
  75. </tr>
  76. <tr>
  77. <td> :</td>
  78. <td align='left'><%=separate(TotalReceivable)%></td>
  79. </tr>
  80. </table>
  81. <div id='copytext' style='background-color:white;border:1px solid red;'>
  82. <br/>
  83. <br/>
  84. <%=customerName%>
  85. <br/>
  86. ǘ ϡ
  87. <U><%=InvoiceID%> </U>
  88. <U><%=separate(TotalReceivable)%></U>
  89. .
  90. <br/>
  91. <div style='direction:ltr;'>
  92. <a href='http://my.pdhco.com/payment/?InvoiceID=<%=mycode(InvoiceID,"93")%>&TotalRecivable=<%=mycode(TotalReceivable,"49")%>'>http://my.pdhco.com/payment</a>
  93. </div>
  94. <br/>
  95. ǘ
  96. <B><U><%=mycode(InvoiceID,"93")%></U></B>
  97. <B><U><%=mycode(TotalReceivable,"49")%></U></B>
  98. .
  99. <br/>
  100. ϡ ǘ .
  101. <br/>
  102. Ԙ
  103. <br/>
  104. ǁ
  105. <br/><br/>
  106. </div>
  107. <TEXTAREA ID="holdtext" STYLE="display:none;">
  108. </TEXTAREA>
  109. <div align='center'>
  110. <input onclick='ClipBoard();' class='GenButton' width='50' type='button' name='copy' style='border:1px solid black;' value=''>
  111. </div>
  112. <%
  113. function mycode(n,prefix)
  114. dim str,c,w,t
  115. 'n = 3 * n
  116. str=cstr(n)
  117. for i=1 to 10-len(cstr(n))
  118. str="0"+str
  119. next
  120. 'str="99"+str
  121. 'Prefix must be 2 digits
  122. str = prefix + str
  123. for i=1 to 12
  124. if i mod 2 = 0 then w=3 else w=1
  125. c = c + cdbl(mid(str,i,1)) * w
  126. c = (10 - (c mod 10)) mod 10
  127. next
  128. str=str+cstr(c)
  129. 'str="1234567890123"
  130. for i=1 to 13
  131. if i mod 2 = 1 then t=t+mid(str,i,1)
  132. next
  133. for i=1 to 13
  134. if i mod 2 = 0 then t=t+mid(str,i,1)
  135. next
  136. ' response.write(t)
  137. ' response.write("<BR/>")
  138. mycode=t
  139. end function
  140. function mydecode(n)
  141. dim str,c,w,num
  142. num=cstr(n)
  143. str=""
  144. for i=1 to 6
  145. str=str+mid(num,i,1)+mid(num,7+i,1)
  146. ' response.write(str)
  147. ' response.write("<br/>")
  148. next
  149. if len(num) mod 2 = 1 then str=str+mid(num,7,1)
  150. 'response.write(str)
  151. num=str
  152. str=mid(num,1,12)
  153. for i=1 to 12
  154. if i mod 2 = 0 then w=3 else w=1
  155. c = c + cdbl(mid(str,i,1)) * w
  156. c = (10 - (c mod 10)) mod 10
  157. next
  158. if c=cdbl(mid(num,13,1)) mod 10 and mid(str,1,2)="99" and clng(mid(str,3,10)) mod 5 = 0 then
  159. mydecode=cdbl(mid(str,3,10)) / 5
  160. else
  161. mydecode=" "
  162. end if
  163. end function
  164. %>
  165. <SCRIPT LANGUAGE="JavaScript">
  166. function ClipBoard()
  167. {
  168. holdtext.innerText = copytext.innerText;
  169. Copied = holdtext.createTextRange();
  170. Copied.execCommand("Copy");
  171. }
  172. </SCRIPT>
  173. <!--#include file="tah.asp" -->