PageRenderTime 14ms CodeModel.GetById 8ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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