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

/beta/cashReg/InvoicePrintForm.asp

http://github.com/khaneh/Orders
ASP | 893 lines | 825 code | 51 blank | 17 comment | 59 complexity | 6f10a5f2df17c84c91985f0e6b03d1e8 MD5 | raw file
  1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2'CashRegister (9)
  3PageTitle="�ǁ ��� ������"
  4SubmenuItem=8
  5if not Auth(9 , 8) then NotAllowdToViewThisPage()
  6%>
  7<!--#include file="top.asp" -->
  8<!--#include File="../include_farsiDateHandling.asp"-->
  9<!--#include File="../include_JS_InputMasks.asp"-->
 10<!--#include File="../include_UtilFunctions.asp"-->
 11<%
 12function Link2Trace(OrderNo)
 13	Link2Trace="<A HREF='../order/TraceOrder.asp?act=show&order="& OrderNo & "' target='_balnk'>"& OrderNo & "</A>"
 14end function
 15
 16%>
 17<style>
 18	Table { font-size: 9pt;}
 19	.InvRowInput { font-family:tahoma; font-size: 9pt; border: none; background-color: #F0F0F0; text-align:right;}
 20	.InvHeadInput { font-family:tahoma; font-size: 9pt; border: none; background-color: #CCCC88; text-align:center;}
 21	.InvRowInput2 { font-family:tahoma; font-size: 9pt; border: none; background-color: #F0FFF0; text-align:right;}
 22	.InvRowInput3 { font-family:tahoma; font-size: 9pt; border: none; background-color: #F0FFF0; direction:LTR; text-align:right;}
 23	.InvRowInput4 { font-family:tahoma; font-size: 9pt; border: none; background-color: #FFD3A8; direction:LTR; text-align:right;}
 24	.InvHeadInput2 { font-family:tahoma; font-size: 9pt; border: none; background-color: #AACC77; text-align:center;}
 25	.InvHeadInput4 { font-family:tahoma; font-size: 9pt; border: none; background-color: #FF9900; text-align:center;}
 26	.InvHeadInput3 { font-family:tahoma; font-size: 9pt; border: none; background-color: #F0F0F0; text-align:right;}
 27	.InvGenInput  { font-family:tahoma; font-size: 9pt; border: none; }
 28	.InvGenButton { font-family:tahoma; font-size: 9pt; border: 1px solid black; }
 29</style>
 30<SCRIPT LANGUAGE="JavaScript">
 31<!--
 32/* var selectedRow=-1; */
 33function selectAndDelete(td){
 34	console.log($(td).html());
 35	var tr = $(td).closest("tr");
 36	if ($(td).prop("bgColor")=="red"){
 37		$(td).prop("bgColor","");
 38		for(trNext=tr;trNext.next().size()>0;trNext=trNext.next()){
 39			trNext.find("input[name=Descriptions]").val(trNext.next().find("input[name=Descriptions]").val());
 40			trNext.find("input[name=Qttys]").val(trNext.next().find("input[name=Qttys]").val());
 41			trNext.find("input[name=Fees]").val(trNext.next().find("input[name=Fees]").val());
 42			trNext.find("input[name=Prices]").val(trNext.next().find("input[name=Prices]").val());
 43			trNext.find("input[name=Dis]").val(trNext.next().find("input[name=Dis]").val());
 44			trNext.find("input[name=Vat]").val(trNext.next().find("input[name=Vat]").val());
 45		}
 46		$($("#InvoiceLines tr")[9]).find("input[name=Descriptions]").val("");
 47		$($("#InvoiceLines tr")[9]).find("input[name=Qttys]").val("");
 48		$($("#InvoiceLines tr")[9]).find("input[name=Fees]").val("");
 49		$($("#InvoiceLines tr")[9]).find("input[name=Prices]").val("");
 50		$($("#InvoiceLines tr")[9]).find("input[name=Dis]").val("");
 51		$($("#InvoiceLines tr")[9]).find("input[name=Vat]").val("");
 52	} else {
 53		$("#InvoiceLines tr").find("td:first").prop("bgColor","");
 54		$(td).prop("bgColor","red");
 55	}
 56	calcAndCheck();
 57}
 58
 59function setPrice(src){
 60	var name = $(src).attr("name");
 61	var tr = $(src).closest("tr");
 62	if (name == "Qttys" || name == "Fees" || name == "Dis"){
 63		$(src).val(echoNum(getNum($(src).val())));
 64		var tmpFee = getNum(tr.find("input[name=Fees]").val());
 65		var tmpQtty = getNum(tr.find("input[name=Qttys]").val());
 66		var vat = getNum(tr.find("input[name=Vat]").val());
 67		var dis = getNum(tr.find("input[name=Dis]").val());		
 68		var tmpPrice= tmpFee * tmpQtty - dis;
 69		//alert(val2txt(tmpPrice * .03));
 70		if (vat > 0){
 71			tr.find("input[name=Vat]").val(echoNum(Math.floor(tmpPrice * parseFloat($('input[name=VatRate]').val()/100))));
 72		}
 73		tr.find("input[name=Prices]").val(echoNum(parseInt(tmpPrice)));
 74	}
 75
 76	calcAndCheck();
 77}
 78function calcAndCheck(){
 79	var total=0;
 80	var dis=0;
 81	var payable=0;
 82	var vat=0;
 83	var checkVat=false;
 84/* 	console.log("calcAndCheck"); */
 85	$("#InvoiceLines tr").each(function(i){
 86		total += getNum($(this).find("[name=Prices]").val());
 87		dis += getNum($(this).find("[name=Dis]").val());
 88		vat += getNum($(this).find("[name=Vat]").val());
 89	});
 90	if (getNum($("input[name=totalVat]").val()) !=vat){
 91//	console.log('calc vat: '+ vat + ' get vat: ' + getNum($("input[name=totalVat]").val()))
 92		$("input[name=message]").val("�����! ��� ������ ������ ������.");
 93		$("input[name=totalVat]").css("backgroundColor","#FF4848");
 94		checkVat = false;
 95	} else {
 96		$("input[name=message]").val("");
 97		$("input[name=totalVat]").css("backgroundColor","#F0F0F0");
 98		checkVat = true;
 99	}
100	$("input[name=TotalPrice]").val(echoNum(total + vat));
101	$("input[name=Discount]").val(echoNum(dis));
102	payable = total + vat;
103	$("input[name=Payable]").val(echoNum(payable));
104	if (getNum($("input[name=Payable]").val()) == getNum($("input[name=MustBe]").val())){
105		$("input[name=Payable]").css("backgroundColor","#00FF00");
106		if (checkVat)
107			return true;
108		else
109			return false;
110	} else {
111		$("input[name=Payable]").css("backgroundColor","#FF0000");
112		return false;
113	}
114}
115function autoComplete(src){
116	if (src.value==""){
117//		alert(event.keyCode);
118		switch (event.keyCode){
119		case 1576: // �
120			src.value="�ѐ";
121			event.keyCode=0;
122			break;
123		case 1608: // �
124			src.value="���";
125			event.keyCode=0;
126			break;
127		}
128	}
129	else if (src.value=="�") {
130		switch (event.keyCode){
131		case 1585: // �
132			src.value="���";
133			event.keyCode=0;
134			break;
135		case 1575: // �
136			src.value="��������";
137			event.keyCode=0;
138			break;
139		}
140	}
141}
142function combine()
143{
144	var priceVat = 0;
145	var priceNoVat = 0;
146	var totalVat = 0;
147	var totalDisOnVat = 0;
148	var totalDisNoVat = 0;
149	var rfd = 0;
150	$("#InvoiceLines tr").each(function(i){
151		if (getNum($(this).find("input[name=Vat]").val())==0){
152			if (getNum($(this).find("input[name=Prices]").val()) <= 0){
153				rfd += getNum($(this).find("input[name=Dis]").val());
154			} else {
155				totalDisNoVat += getNum($(this).find("input[name=Dis]").val());
156				priceNoVat += getNum($(this).find("input[name=Fees]").val()) * getNum($(this).find("input[name=Qttys]").val());
157			}
158		} else {
159			priceVat += getNum($(this).find("input[name=Fees]").val()) * getNum($(this).find("input[name=Qttys]").val());
160			totalVat += getNum($(this).find("input[name=Vat]").val());
161			if (getNum($(this).find("input[name=Prices]").val()) <= 0){
162				rfd += getNum($(this).find("input[name=Dis]").val());
163			} else {
164				totalDisOnVat += getNum($(this).find("input[name=Dis]").val());
165			}
166		}
167		$(this).find("input[name=Descriptions]").val("");
168		$(this).find("input[name=Qttys]").val("");
169		$(this).find("input[name=Units]").val("");
170		$(this).find("input[name=Fees]").val("");
171		$(this).find("input[name=Prices]").val("");
172		$(this).find("input[name=Vat]").val("");
173		$(this).find("input[name=Dis]").val("");
174	});
175	
176	var tr;
177	if (priceNoVat > 0){
178		tr = $($("#InvoiceLines tr")[1]);
179		tr.find("input[name=Descriptions]").val("���� � ���� ��� �ǁ");
180		tr.find("input[name=Qttys]").val("1");
181		tr.find("input[name=Units]").val("");
182		tr.find("input[name=Fees]").val(echoNum(priceNoVat));
183		tr.find("input[name=Prices]").val(echoNum(priceNoVat - totalDisNoVat));
184		tr.find("input[name=Vat]").val("0");
185		tr.find("input[name=Dis]").val(echoNum(totalDisNoVat));
186	}
187	tr = $($("#InvoiceLines tr")[0]);
188	tr.find("input[name=Descriptions]").val("����� �ǁ");
189	tr.find("input[name=Qttys]").val("1");
190	tr.find("input[name=Units]").val("");
191	tr.find("input[name=Fees]").val(echoNum(priceVat));
192	tr.find("input[name=Prices]").val(echoNum(priceVat - totalDisOnVat));
193	tr.find("input[name=Vat]").val(echoNum(totalVat));
194	tr.find("input[name=Dis]").val(echoNum(totalDisOnVat));
195	tr = $($("#InvoiceLines tr")[2]);
196	//---------------------------
197	tr.find("input[name=Descriptions]").val("����� ��� ������");
198	tr.find("input[name=Qttys]").val("1");
199	tr.find("input[name=Units]").val("");
200	tr.find("input[name=Fees]").val("0");
201	tr.find("input[name=Prices]").val(echoNum(-rfd));
202	tr.find("input[name=Vat]").val("0");
203	tr.find("input[name=Dis]").val(echoNum(rfd));
204	calcAndCheck();
205}
206//-->
207</SCRIPT>
208<%
209Dim Descriptions(10)
210Dim Qttys(10)
211Dim Units(10) ' Always empty!
212Dim Fees(10)
213Dim Prices(10)
214Dim Vat(10)
215Dim Dis(10)
216
217if request("act")="submitsearch" then
218	if isnumeric(request("invoice")) then
219		InvoiceID=clng(request("invoice"))
220		mySQL="SELECT * FROM InvoicePrintForms WHERE (InvoiceID='"& InvoiceID & "')"
221		Set RS1 = conn.Execute(mySQL)
222		if RS1.eof then
223			conn.close
224			response.redirect "?act=getPrintForm&invoice=" & InvoiceID
225		else
226			conn.close
227			response.redirect "?act=showPrintForm&invoice=" & InvoiceID & "&msg=" & Server.URLEncode("���� ���� ��� ������ ��� �ǁ� ����� ��� ���.<br>����� �� �� ������ �� ���� � �� ������ ����� ����.")
228		end if
229	else
230		if request("query")<>"" then
231			response.redirect "?msg=" & Server.URLEncode("������ ���� ����� ����� ����� ��� ����.")
232		else
233			response.redirect "?errmsg=" & Server.URLEncode("����� ������ ���� ���� ��� ����.")
234		end if
235	end if
236elseif request("act")="getPrintForm" then
237	if isnumeric(request("invoice")) then
238		InvoiceID=clng(request("invoice"))
239		mySQL="SELECT * FROM Invoices WHERE (ID='"& InvoiceID & "')"
240		Set RS1 = conn.Execute(mySQL)
241		if RS1.eof then
242			conn.close
243			response.redirect "?errmsg=" & Server.URLEncode("������ ���� ���.")
244		end if
245	else
246		response.redirect "?errmsg=" & Server.URLEncode("����� ������ ���� ���� ��� ����.")
247	end if
248	set rsVat=conn.Execute("select isnull(GLs.Vat,0) as Vat from ARItems inner join GLs on ARItems.GL=GLs.ID where Type=1 AND Link="&InvoiceID)
249	customerID=		RS1("Customer")
250	totalPrice=		cdbl(RS1("totalPrice"))
251	totalDiscount=	cdbl(RS1("totalDiscount"))+cdbl(RS1("totalReverse"))
252	totalReceivable=cdbl(RS1("totalReceivable"))
253	totalVat =		cdbl(RS1("totalVat")) ' S A M
254	Voided=			RS1("Voided")
255	Issued=			RS1("Issued")
256	Approved=		RS1("Approved")
257	isReverse=		RS1("IsReverse")
258	IsA=			RS1("IsA")
259	InvoiceNo=		RS1("Number")
260	VatRate=		rsVat("Vat")
261	rsVat.close
262	if Voided then
263		Conn.close
264		response.redirect "?errmsg=" & Server.URLEncode("��� ������ ���� ��� ���.")
265	elseif isReverse then
266		Conn.close
267		response.redirect "?errmsg=" & Server.URLEncode("����� ������ ����� ����.")
268	end if 
269
270	mySQL="SELECT ID,IsPersonal,AccountTitle,CompanyName,Address1,Tel1,PostCode1,EconomicalCode, NorRCode FROM Accounts WHERE (ID='"& customerID & "')"
271	Set RS1 = conn.Execute(mySQL)
272	if RS1("IsPersonal") then
273		customerName=RS1("AccountTitle")
274	else
275		customerName=RS1("CompanyName")
276	end if
277	customerAddress=RS1("Address1")
278	customerTel=RS1("Tel1")
279	customerPostCode=RS1("PostCode1")
280	customerEcCode=RS1("EconomicalCode")
281	NorRCode = RS1("NorRCode")
282
283	RS1.close
284
285	creationDate=shamsiToday()
286'	creationTime=Hour(creationTime)&":"&Minute(creationTime)
287'	if instr(creationTime,":")<3 then creationTime="0" & creationTime
288'	if len(creationTime)<5 then creationTime=Left(creationTime,3) & "0" & Right(creationTime,1)
289
290%>
291<!-- ���� ������� ��� ������ -->
292	<br>
293	<input type="hidden" Name='tmpDlgArg' value=''>
294	<input type="hidden" Name='tmpDlgTxt' value=''>
295	<table Border="0" align="center" Width="100%" Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#558855">
296	<FORM METHOD=POST ACTION="?act=submitPrintForm">
297	<tr bgcolor='#C3C300'>
298		<td align="left"><TABLE>
299			<TR>   
300				<TD align="left">�����:</td>
301				<TD dir="LTR">
302					<INPUT class="InvGenInput" NAME="InvoiceDate" TYPE="text" maxlength="10" size="10" value="<%=CreationDate%>"></td>
303					<INPUT TYPE="hidden" NAME="InvoiceID" value="<%=InvoiceID%>">
304				<TD dir="RTL"><%=weekdayname(weekday(date))%></td>
305			</TR>  
306			</TABLE>
307		</td>
308	</tr>
309	<tr bgcolor='#C3C300'>
310		<td>
311			<TABLE border="0" width="100%" >
312			<TR>   
313				<TD align="left">��� ������:</TD>
314				<TD><TEXTAREA readonly style="font-family:tahoma;font-size:9pt;direction:RTL;border:1 solid black;width:450px;" NAME="CustomerName" rows="1" cols="50"><%=CustomerName%></TEXTAREA></TD>
315				<TD align="left">����� �������:</TD>
316				<TD><INPUT class="InvGenInput" style="border:1 solid black;width:100px;direction:LTR;text-align:left;" NAME="customerEcCode" TYPE="text" size="10" value="<%=customerEcCode%>"></TD>
317			</TR>  
318			<TR>   
319				<TD align="left" rowspan="2">�����:</TD>
320				<TD rowspan="2"><TEXTAREA readonly style="font-family:tahoma;font-size:9pt;direction:RTL;border:1 solid black;width:450px;" NAME="customerAddress" rows="2" cols="50"><%=customerAddress%></TEXTAREA></TD>
321				<TD align="left">�� ����:</TD>
322				<TD><INPUT class="InvGenInput" style="border:1 solid black;width:100px;" NAME="customerPostCode" TYPE="text" size="10" value="<%=customerPostCode%>"></TD>
323			</TR>  
324			<tr>
325				<td align='left'>����� ���/����� ���:</td>
326				<td><input class='InvGenInput' style='border:1 solid black;width:100px;' name="NorRCode" type='text' size='10' value='<%=NorRCode%>'></td>
327			</tr>
328			<TR>   
329				<TD align="left">����:</TD>
330				<TD><TEXTAREA style="font-family:tahoma;font-size:9pt;direction:RTL;border:1 solid black;width:450px;" NAME="customerTel" rows="1" cols="50"><%=customerTel%></TEXTAREA></TD>
331				<TD align="left">����� ����:</TD>
332				<TD align=left><INPUT TYPE="radio" NAME="CashPayment" Value="1">����  <INPUT TYPE="radio" NAME="CashPayment" Value="0" checked>�������</TD>
333			</TR>  
334			</TABLE>
335		</td>
336	</tr>
337	<tr bgcolor='#CCCC88'>
338		<td><div>
339		<input type='hidden' id='VatRate' name='VatRate' value='<%=VatRate%>'>
340			<TABLE Border="0" Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#558855">
341			<TR bgcolor='#CCCC88'>
342				<TD align='center' width="25px"> # </td>
343				<TD><INPUT class="InvHeadInput2" readOnly TYPE="text" value="��� �����" size="65" ></TD>       
344				<TD><INPUT class="InvHeadInput" readOnly TYPE="text" value="�����" size="5"></TD> <!--S A M-->   
345				<TD><INPUT class="InvHeadInput" readOnly TYPE="text" Value="���� ����" size="8"></TD>        
346				<TD><INPUT class="InvHeadInput" readOnly TYPE="text" Value="���� ����" size="8"></TD>        
347				<TD><Input class="InvHeadInput" readOnly type="text" Value="�����" size="8"><TD>
348				<TD><INPUT class="InvHeadInput2" readOnly TYPE="text" Value="����" size="13"></TD>      
349				<TD><INPUT class="InvHeadInput4" readOnly TYPE="text" Value="������" size="8"></TD>
350			</TR>
351			</TABLE></div>
352		</td>
353	</tr>
354	<tr bgcolor='#CCCC88'>
355		<td>
356			<TABLE Border="0" Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#558855">
357			<TBODY id="InvoiceLines">
358<%		
359		i = 0
360		totalNoVat = 0
361		totalSumDis = 0
362
363		totalVatAfter9Vat = 0
364		totalSumAfter9noVat = 0
365		totalSumAfter9Vat = 0
366		totalDisAfter9noVat = 0
367		totalDisAfter9Vat = 0
368		after9Vat=False
369		after9noVat=false
370		mySQL="SELECT * FROM InvoiceLines left outer join invoiceItems on InvoiceLines.item = invoiceItems.ID WHERE (Invoice="& InvoiceID & ")"
371		Set RS1 = conn.Execute(mySQL)
372		Do While NOT RS1.eof 
373			i = i + 1
374			If i < 10 Then 
375				item =	cdbl(RS1("Item")) 
376		'	if item = 39999 then 
377		'		RS1.moveNext
378		'	else
379				'i=i+1			
380				Descriptions(i)=RS1("Description")
381				Qttys(i)=Separate(RS1("AppQtty"))
382				Vat(i) = RS1("Vat")
383				
384				if RS1("AppQtty") <> 0 then 
385					Fees(i)=Separate((RS1("Price") - RS1("Reverse"))/RS1("AppQtty")) 
386				else 
387					Fees(i)="0"
388				end if
389				Prices(i)=Separate(RS1("Price") - RS1("Reverse"))
390				Dis(i)=Separate(RS1("Discount"))
391			Else 
392				If RS1("Vat")=0 Then 
393					totalSumAfter9noVat = RS1("Price") + totalSumAfter9noVat
394					totalDisAfter9noVat = RS1("Discount") + totalDisAfter9noVat
395					after9noVat = true
396				Else
397					totalVatAfter9Vat = RS1("Vat") + totalVatAfter9Vat
398					totalSumAfter9Vat = RS1("Price") - RS1("Reverse") + totalSumAfter9Vat
399					totalDisAfter9Vat = RS1("Discount") + totalDisAfter9Vat
400					after9Vat = true
401				End If 
402			End If 
403			totalNoVat = totalNoVat + cdbl(RS1("Price") - RS1("Reverse"))
404			totalSumDis = totalSumDis + CDbl(RS1("Discount"))
405			RS1.moveNext
406		'	end if
407		Loop
408		RS1.close
409		If totalSumDis = 0 Then 
410			Dis(1) = totalDiscount
411		End if
412		If (after9noVat or after9Vat) Then 
413			'clean & insert two line for other line of my invoice
414			'first step is check line 8,9 for vat
415			If Vat(8) = 0 Then 
416				totalSumAfter9noVat = totalSumAfter9noVat + Prices(8)
417				totalDisAfter9noVat = totalDisAfter9noVat + Dis(8)
418			Else
419				totalVatAfter9Vat = totalVatAfter9Vat + Vat(8)
420				totalSumAfter9Vat = totalSumAfter9Vat + Prices(8)
421				totalDisAfter9Vat = totalDisAfter9Vat + Dis(8)
422			End If
423			If Vat(9) = 0 Then 
424				totalSumAfter9noVat = totalSumAfter9noVat + Prices(9)
425				totalDisAfter9noVat = totalDisAfter9noVat + Dis(9)
426			Else
427				totalVatAfter9Vat = totalVatAfter9Vat + Vat(9)
428				totalSumAfter9Vat = totalSumAfter9Vat + Prices(9)
429				totalDisAfter9Vat = totalDisAfter9Vat + Dis(9)
430			End If
431			'next step is make pare miter for print :)
432			Descriptions(8) = "���� ����� ������"
433			Prices(8) = totalSumAfter9Vat
434			Dis(8) = totalDisAfter9Vat
435			Vat(8) = totalVatAfter9Vat
436			Fees(8) = Prices(8)
437			Qttys(8) = 1
438			Descriptions(9) = "���� ����� ���� ������ ������"
439			Prices(9) = totalSumAfter9noVat
440			Dis(9) = totalDisAfter9noVat
441			Vat(9) = 0
442			Fees(9) = Prices(9)
443			Qttys(9) = 1
444		End If 
445			
446		for i=1 to 10
447			%>
448			<TR bgcolor="#F0F0F0">
449				<TD align="center" width="25px" onclick="selectAndDelete(this);"><%=i%></TD>
450				<TD><INPUT class="InvRowInput2" TYPE="text" Name="Descriptions" value="<%=Descriptions(i)%>" size="65"></TD>
451				<TD><INPUT class="InvRowInput"  TYPE="text" Name="Qttys" value="<%=Qttys(i)%>" size="5" onBlur="setPrice(this);"></TD>   
452				<TD><INPUT class="InvRowInput"  TYPE="text" Name="Units" Value="<%=Units(i)%>" size="8" onKeyPress="autoComplete(this);"></TD>       
453				<TD><INPUT class="InvRowInput"  TYPE="text" Name="Fees" Value="<%=Fees(i)%>" size="8" onBlur="setPrice(this);"></TD>        
454				<TD><input class="InvRowInput" type="text" name="Dis" value="<%=Dis(i)%>" Size="8" onBlur="setPrice(this);"></TD>
455				<TD><INPUT readonly class="InvRowInput3" TYPE="text" Name="Prices" Value="<%=Separate(Prices(i) - Dis(i))%>" size="13" onBlur="this.value=echoNum(getNum(this.value));calcAndCheck();"></TD>
456				<TD><input readonly class='InvRowInput4' type='text' name='Vat' value='<%=Vat(i)%>' size='8'></TD>
457			</TR>
458<%
459		next
460%>
461			</Tbody>
462			</TABLE>
463		</td>
464	</tr>
465	<tr bgcolor='#CCCC88'>
466		<td colspan="10">
467		<div>
468			<TABLE align='left' Border="0" Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#CCCC88">
469			<TR bgcolor='#CCCC88'>      
470				<TD align='left'>���:</TD>        
471				<TD style="border:1 solid black;"><INPUT class="InvRowInput2" readOnly TYPE="text" Name="TotalNoVatPrice" Value="<%=Separate(totalNoVat)%>" size="20"></TD>      
472			</TR>
473			<TR bgcolor='#CCCC88'><!--S A M--> 
474				<TD align='left'>������ �� ���� ������:</TD>        
475				<TD><INPUT class="InvHeadInput3" style="color:gray;" readOnly TYPE="text" Name="totalVat" Value="<%=Separate(totalVat)%>" size="20"></TD>      
476			</TR>
477			<TR bgcolor='#CCCC88'>      
478				<TD align='left'>��� ��:</TD>        
479				<TD style="border:1 solid black;"><INPUT class="InvRowInput2" readOnly TYPE="text" Name="TotalPrice" Value="<%=Separate(totalPrice)%>" size="20"></TD>      
480			</TR>
481			<TR bgcolor='#CCCC88'>        
482				<TD align='left'>�����:</TD>        
483				<TD style="border:1 solid black;"><INPUT class="InvRowInput3" readOnly TYPE="text" Name="Discount" Value="<%=Separate(totalDiscount)%>" size="20"></TD>      
484			</TR>
485			</TR>
486			<TR bgcolor='#CCCC88'>
487				<TD align='right'><input class="InvHeadInput" type='text' readonly name='message' value='' size='30'></TD>        
488				<TD style="border:1 solid black;"><INPUT class="InvRowInput3" readOnly TYPE="text" Name="Payable" Value="<%=Separate(totalReceivable)%>" size="20"></TD>      
489			</TR>
490			
491			<TR bgcolor='#CCCC88'>
492				<TD align='left'>���� ������:</TD>        
493				<TD><INPUT class="InvHeadInput3" style="color:gray;" readOnly TYPE="text" Name="MustBe" Value="<%=Separate(totalReceivable)%>" size="20"></TD>      
494			</TR>			
495			</TABLE>
496		</div>
497		</td>
498	</tr>
499	<tr>
500		<td align='center'>
501			<INPUT class="InvGenButton" TYPE="submit" value=" ��� " onclick="return calcAndCheck();">
502			<input class='InvGenButton' type='button' Value='�� ��� ��� ������' onclick='combine();'>
503		</td>
504	</tr>
505	</table>
506	</FORM>
507	<br>
508	<SCRIPT LANGUAGE="JavaScript">
509$(document).ready(function(){
510		calcAndCheck();
511});
512	</SCRIPT>
513<%
514'------------------------------------------------------------------------------------------------------------------------------------------------------
515'------------------------------------------------------------------------------------------------------------------------------------------------------
516'------------------------------------------------------------------------------------------------------------------------------------------------------
517elseif request("act")="submitPrintForm" then
518
519	InvoiceID=clng(request.form("InvoiceID"))
520		
521	if isnumeric(InvoiceID) then
522		mySQL="SELECT * FROM InvoicePrintForms WHERE (InvoiceID='"& InvoiceID & "')"
523		Set RS1 = conn.Execute(mySQL)
524		if not RS1.eof then
525			conn.close
526			response.redirect "?act=showPrintForm&invoice=" & InvoiceID & "&errmsg=" & Server.URLEncode("���� ���� ��� ������ ��� �ǁ� ����� ��� ���.")
527		end if
528	else
529		response.redirect "?errmsg=" & Server.URLEncode("����� ������ ���� ���� ��� ����.")
530	end if
531
532	creationDate=		shamsiToday()
533
534	InvoiceDate=		request.form("InvoiceDate")
535	CustomerName=		request.form("CustomerName")
536	customerEcCode=		request.form("customerEcCode")
537	customerAddress=	request.form("customerAddress")
538	customerPostCode=	request.form("customerPostCode")
539	customerTel=		request.form("customerTel")
540	NorRCode =			request.Form("NorRCode")
541	if request.form("CashPayment") then
542		CashPayment=1
543	else
544		CashPayment=0
545	end if
546	
547	TotalPrice=	text2value(request.form("TotalPrice"))
548	Discount=	text2value(request.form("Discount"))
549	Payable=	text2value(request.form("Payable"))
550	tmpPay = Payable
551	PayableText=ConvertIT(tmpPay)
552	
553	MustBe=text2value(request.form("MustBe"))
554	totalVat = text2value(request.form("totalVat"))
555
556	if Payable<>MustBe then
557		response.redirect "?act=getPrintForm&invoice="& InvoiceID & "&errMsg=" & Server.URLEncode("��� ������ ���� ����.")
558	end if
559
560	mySQL="INSERT INTO InvoicePrintForms (CreatedDate, CreatedBy, InvoiceID, PaperNo, [Date], Name, Address, Tel, EcCode, PostCode, TotalPrice, Discount, Payable, PayableText, CashPayment, Vat, NorRCode) VALUES (N'"& creationDate & "', '"& session("ID") & "', '"& InvoiceID & "', 0, N'"& InvoiceDate & "', N'"& CustomerName & "', N'"& customerAddress & "', N'"& customerTel & "', N'"& customerEcCode & "', N'"& customerPostCode & "', '"& TotalPrice & "', '"& Discount & "', '"& Payable & "', N'"& PayableText & "', '"& CashPayment & "', '" & totalVat & "','" & NorRCode & "'); SELECT @@Identity AS NewInvoicePrintForm"
561	Set RS1 = conn.Execute(mySQL).NextRecordSet
562	NewInvoicePrintForm = RS1("NewInvoicePrintForm")
563
564	RS1.close
565	
566	for i=request.form("Descriptions").count to 1 step -1
567		if request.form("Descriptions")(i)<>"" OR request.form("Qttys")(i)<>"" OR request.form("Units")(i)<>"" OR request.form("Fees")(i)<>"" OR request.form("Prices")(i)<>"" then exit for
568	next
569	lastIndex = i
570
571	for i=1 to lastIndex
572		theDescription =	request.form("Descriptions")(i)
573		theQtty =			text2value(request.form("Qttys")(i))
574		theUnit =			request.form("Units")(i)
575		theFee =			text2value(request.form("Fees")(i))
576		thePrice =			text2value(request.form("Prices")(i))
577		theVat =			text2value(request.form("Vat")(i))
578		theDis =			text2Value(request.Form("Dis")(i))
579
580		mySQL="INSERT INTO InvoicePrintFormLines (InvoicePrintForm, Description, Qtty, Unit, Fee, Price, Vat, Discount) VALUES ('"& NewInvoicePrintForm & "', N'" & theDescription & "', " & theQtty & ", N'" & theUnit & "', " & theFee & ", " & thePrice & ", " & theVat &", " & theDis & ")"
581		conn.Execute(mySQL)
582	next 
583
584		response.redirect "?act=showPrintForm&invoice=" & InvoiceID & "&msg=" & Server.URLEncode("������� ��� ������ ��� ��.")
585
586elseif request("act")="submitPrintFormEdit" then
587
588	InvoiceID=clng(request.form("InvoiceID"))
589		
590	if isnumeric(InvoiceID) then
591		mySQL="SELECT ID FROM InvoicePrintForms WHERE (InvoiceID='"& InvoiceID & "')"
592		Set RS1 = conn.Execute(mySQL)
593		if RS1.eof then
594			conn.close
595			response.redirect "?act=showPrintForm&invoice=" & InvoiceID & "&errmsg=" & Server.URLEncode("���� ���� ��� ������ ��� �ǁ� ����� ���� ���.")
596		end if
597		InvoicePrintFormID=RS1("ID")
598		RS1.close
599	else
600		response.redirect "?errmsg=" & Server.URLEncode("����� ������ ���� ���� ��� ����.")
601	end if
602
603	editDate=		shamsiToday()
604
605	InvoiceDate=		request.form("InvoiceDate")
606	CustomerName=		request.form("CustomerName")
607	customerEcCode=		request.form("customerEcCode")
608	customerAddress=	request.form("customerAddress")
609	customerPostCode=	request.form("customerPostCode")
610	customerTel=		request.form("customerTel")
611	NorRCode =			request.Form("NorRCode")
612	if request.form("CashPayment") then
613		CashPayment=1
614	else
615		CashPayment=0
616	end if
617	
618	TotalPrice=	text2value(request.form("TotalPrice"))
619	Discount=	text2value(request.form("Discount"))
620	Payable=	text2value(request.form("Payable"))
621	totalVat=		text2value(request.form("totalVat"))
622	tmpPay=Payable
623	PayableText=ConvertIT(tmpPay)
624	
625	MustBe=text2value(request.form("MustBe"))
626	if Payable<>MustBe then
627		response.redirect "?act=getPrintForm&invoice="& InvoiceID & "&errMsg=" & Server.URLEncode("��� ������ ���� ����.")
628	end if
629
630	mySQL="UPDATE InvoicePrintForms SET LastEditedDate=N'"& editDate & "', LastEditedBy='"& session("ID") & "', InvoiceID='"& InvoiceID & "', [Date]=N'"& InvoiceDate & "', Name=N'"& CustomerName & "', Address=N'"& customerAddress & "', Tel=N'"& customerTel & "', EcCode=N'"& customerEcCode & "', PostCode=N'"& customerPostCode & "', TotalPrice='"& TotalPrice & "', Discount='"& Discount & "', Payable='"& Payable & "', PayableText=N'"& PayableText & "', CashPayment='"& CashPayment & "', Vat='" & totalVat & "', NorRCode='" & NorRCode & "' WHERE (ID = "& InvoicePrintFormID & ")"
631'response.write "<br>" & mySQL
632'response.end
633	conn.Execute(mySQL)
634	
635	mySQL="DELETE FROM InvoicePrintFormLines WHERE (InvoicePrintForm = "& InvoicePrintFormID & ")"
636	conn.Execute(mySQL)
637
638	for i=request.form("Descriptions").count to 1 step -1
639		if request.form("Descriptions")(i)<>"" OR request.form("Qttys")(i)<>"" OR request.form("Units")(i)<>"" OR request.form("Fees")(i)<>"" OR request.form("Prices")(i)<>"" then exit for
640	next
641	lastIndex = i
642
643	for i=1 to lastIndex
644
645		theDescription =	request.form("Descriptions")(i)
646		theQtty =			text2value(request.form("Qttys")(i))
647		theUnit =			request.form("Units")(i)
648		theFee =			text2value(request.form("Fees")(i))
649		thePrice =			text2value(request.form("Prices")(i))
650		theVat =			text2value(request.form("Vat")(i))
651		theDis =			text2value(request.Form("Dis")(i))
652
653		mySQL="INSERT INTO InvoicePrintFormLines (InvoicePrintForm, Description, Qtty, Unit, Fee, Price, Vat, Discount) VALUES ("& InvoicePrintFormID & ", N'" & theDescription & "', " & theQtty & ", N'" & theUnit & "', " & theFee & ", " & thePrice & ", " & theVat & ", " & theDis & ")"
654		conn.Execute(mySQL)
655	next 
656
657		response.redirect "?act=showPrintForm&invoice=" & InvoiceID & "&msg=" & Server.URLEncode("������� ��� ������ �� ��� ��.")
658
659elseif request("act")="showPrintForm" then
660	if isnumeric(request("invoice")) then
661		InvoiceID=clng(request("invoice"))
662		mySQL="SELECT * FROM InvoicePrintForms WHERE (InvoiceID="& InvoiceID & ")"
663		Set RS1 = conn.Execute(mySQL)
664		if RS1.eof then
665			conn.close
666			response.redirect "?act=getPrintForm&invoice=" & InvoiceID & "&errmsg=" & Server.URLEncode("���� ���� ��� ������ ��� �ǁ� ����� ���� ���.")
667		end if
668	else
669		response.redirect "?errmsg=" & Server.URLEncode("����� ������ ���� ���� ��� ����.")
670	end if
671	set rsVat=conn.Execute("select isnull(GLs.Vat,0) as Vat from ARItems inner join GLs on ARItems.GL=GLs.ID where Type=1 AND Link="&InvoiceID)
672	PrintFormID=		RS1("ID")
673	InvoiceDate=		RS1("Date")
674
675	totalPrice=			cdbl(RS1("totalPrice"))
676	totalDiscount=		cdbl(RS1("Discount"))
677	totalReceivable=	cdbl(RS1("Payable"))
678	totalVat =			cdbl(RS1("Vat"))
679
680	customerName=		RS1("Name")
681	customerAddress=	RS1("Address")
682	customerTel=		RS1("Tel")
683	customerPostCode=	RS1("PostCode")
684	customerEcCode=		RS1("EcCode")
685	cashPayment=		RS1("cashPayment")
686	NorRCode =			RS1("NorRCode")
687	VatRate =			rsVat("Vat")
688	RS1.close
689
690%>
691<!-- ����� ������� ��� ������ -->
692	<br>
693	<input type="hidden" Name='tmpDlgArg' value=''>
694	<input type="hidden" Name='tmpDlgTxt' value=''>
695	<table Border="0" align="center" Width="100%" Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#558855">
696	<FORM METHOD=POST ACTION="?act=submitPrintFormEdit">
697	<tr bgcolor='#C3C300'>
698		<td align="left"><TABLE>
699			<TR>   
700				<TD align="left">�����:</td>
701				<TD dir="LTR">
702					<INPUT class="InvGenInput" NAME="InvoiceDate" TYPE="text" maxlength="10" size="10" value="<%=InvoiceDate%>"></td>
703					<INPUT TYPE="hidden" NAME="customerID" value="<%=customerID%>">
704					<INPUT TYPE="hidden" NAME="InvoiceID" value="<%=InvoiceID%>">
705				<TD dir="RTL"><%=weekdayname(weekday(date))%></td>
706			</TR>  
707			</TABLE>
708		</td>
709	</tr>
710	<tr bgcolor='#C3C300'>
711		<td>
712			<TABLE border="0" width="100%" >
713			<TR>   
714				<TD align="left">��� ������:</TD>
715				<TD><TEXTAREA style="font-family:tahoma;font-size:9pt;direction:RTL;border:1 solid black;width:450px;" NAME="CustomerName" rows="1" cols="50"><%=CustomerName%></TEXTAREA></TD>
716				<TD align="left">����� �������:</TD>
717				<TD><INPUT class="InvGenInput" style="border:1 solid black;width:100px;direction:LTR;text-align:left;" NAME="customerEcCode" TYPE="text" size="10" value="<%=customerEcCode%>"></TD>
718			</TR>  
719			<TR>   
720				<TD align="left" rowspan="2">�����:</TD>
721				<TD rowspan="2"><TEXTAREA style="font-family:tahoma;font-size:9pt;direction:RTL;border:1 solid black;width:450px;" NAME="customerAddress" rows="2" cols="50"><%=customerAddress%></TEXTAREA></TD>
722				<TD align="left">�� ����:</TD>
723				<TD><INPUT class="InvGenInput" style="border:1 solid black;width:100px;" NAME="customerPostCode" TYPE="text" size="10" value="<%=customerPostCode%>"></TD>
724			</TR>
725			<tr>
726				<td align='left'>����� ���/����� ���:</td>
727				<td><input class='InvGenInput' style='border:1 solid black;width:100px;' name="NorRCode" type='text' size='10' value='<%=NorRCode%>'></td>
728			</tr>
729			<TR>   
730				<TD align="left">����:</TD>
731				<TD><TEXTAREA style="font-family:tahoma;font-size:9pt;direction:RTL;border:1 solid black;width:450px;" NAME="customerTel" rows="1" cols="50"><%=customerTel%></TEXTAREA></TD>
732				<TD align="left">����� ����:</TD>
733				<TD align=left><INPUT TYPE="radio" NAME="CashPayment" Value="1" <%if cashPayment then response.write "checked"%>>����  <INPUT TYPE="radio" NAME="CashPayment" Value="0" <%if not cashPayment then response.write "checked"%>>�������</TD>
734			</TR>  
735			</TABLE>
736		</td>
737	</tr>
738	<tr bgcolor='#CCCC88'>
739		<td><div>
740		<input type='hidden' id='VatRate' name='VatRate' value='<%=VatRate%>'>
741			<TABLE Border="0" Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#558855">
742			<TR bgcolor='#CCCC88'>
743				<TD align='center' width="25px"> # </td>
744				<TD><INPUT class="InvHeadInput2" readOnly TYPE="text" value="��� �����" size="65" ></TD>       
745				<TD><INPUT class="InvHeadInput" readOnly TYPE="text" value="�����" size="5"></TD>   
746				<TD><INPUT class="InvHeadInput" readOnly TYPE="text" Value="���� ����" size="8"></TD>        
747				<TD><INPUT class="InvHeadInput" readOnly TYPE="text" Value="���� ����" size="8"></TD>
748				<TD><input class="InvHeadInput" readOnly type="text" value="�����" size="8"></TD>
749				<TD><INPUT class="InvHeadInput2" readOnly TYPE="text" Value="����" size="13"></TD> 
750				<TD><INPUT class="InvHeadInput4" readOnly TYPE="text" Value="������" size="8"></TD>
751			</TR>
752			</TABLE></div>
753		</td>
754	</tr>
755	<tr bgcolor='#CCCC88'>
756		<td>
757			<TABLE Border="0" Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#558855">
758			<TBODY id="InvoiceLines">
759<%		
760		i=0
761		totalNoVat = 0
762		totalSumDis = 0
763
764		mySQL="SELECT * FROM InvoicePrintFormLines WHERE (InvoicePrintForm='"& PrintFormID & "')"
765		Set RS1 = conn.Execute(mySQL)
766		Do While NOT RS1.eof AND i<10
767			i=i+1
768			Descriptions(i)=	RS1("Description")
769			Qttys(i)=			Separate(RS1("Qtty"))
770			Fees(i)=			Separate(RS1("Fee")) 
771			Units(i)=			RS1("Unit")
772			Prices(i)=			Separate(RS1("Price"))
773			Vat(i) =			separate(RS1("Vat"))
774			Dis(i) =			separate(RS1("Discount"))
775			totalSumDis =		CDbl(RS1("Discount")) + totalSumDis
776			totalNoVat =		totalNoVat + cdbl(RS1("Price"))
777			RS1.moveNext
778		Loop
779		RS1.close
780		If totalSumDis = 0 Then
781			Dis(1) = totalDiscount
782		End if
783
784		for i=1 to 10
785			%>
786			<TR bgcolor='#F0F0F0'>
787				<TD align='center' width="25px" onclick="selectAndDelete(this);"><%=i%></TD>
788				<TD><INPUT class="InvRowInput2" TYPE="text" Name="Descriptions" value="<%=Descriptions(i)%>" size="65"></TD>
789				<TD><INPUT class="InvRowInput"  TYPE="text" Name="Qttys" value="<%=Qttys(i)%>" size="5" onBlur="setPrice(this);"></TD>   
790				<TD><INPUT class="InvRowInput"  TYPE="text" Name="Units" Value="<%=Units(i)%>" size="8" onKeyPress="autoComplete(this);"></TD>        
791				<TD><INPUT class="InvRowInput"  TYPE="text" Name="Fees" Value="<%=Fees(i)%>" size="8" onBlur="setPrice(this);"></TD>  
792				<TD><input class="InvRowInput" type="text" name="Dis" value="<%=Dis(i)%>" size="8" onBlur="setPrice(this);"><TD>
793				<TD><INPUT readonly class="InvRowInput3" TYPE="text" Name="Prices" Value="<%=Prices(i)%>" size="13" onBlur="this.value=echoNum(getNum(this.value));calcAndCheck();"></TD>    
794				<TD><input readonly class='InvRowInput4' type='text' name='Vat' value='<%=Vat(i)%>' size='8'></TD>
795			</TR>
796<%
797		next
798%>
799			</Tbody>
800			</TABLE>
801		</td>
802	</tr>
803	<tr bgcolor='#CCCC88'>
804		<td colspan="10">
805		<div>
806			<TABLE align='left' Border="0" Cellspacing="1" Cellpadding="0" Dir="RTL" bgcolor="#CCCC88">
807			<TR bgcolor='#CCCC88'>      
808				<TD align='left'>���:</TD>        
809				<TD style="border:1 solid black;"><INPUT class="InvRowInput2" readOnly TYPE="text" Name="TotalNoVatPrice" Value="<%=Separate(totalNoVat)%>" size="20"></TD>      
810			</TR>
811			<TR bgcolor='#CCCC88'><!--S A M--> 
812				<TD align='left'>������ �� ���� ������:</TD>        
813				<TD><INPUT class="InvHeadInput3" style="color:gray;" readOnly TYPE="text" Name="totalVat" Value="<%=Separate(totalVat)%>" size="20"></TD>      
814			</TR>
815			<TR bgcolor='#CCCC88'>      
816				<TD align='left'>��� ��:</TD>        
817				<TD style="border:1 solid black;"><INPUT class="InvRowInput2" readOnly TYPE="text" Name="TotalPrice" Value="<%=Separate(totalPrice)%>" size="20"></TD>      
818			</TR>
819			<TR bgcolor='#CCCC88'>        
820				<TD align='left'>�����:</TD>        
821				<TD style="border:1 solid black;"><INPUT class="InvRowInput3" readOnly TYPE="text" Name="Discount" Value="<%=Separate(totalDiscount)%>" size="20"></TD>      
822			</TR>
823			</TR>
824			<TR bgcolor='#CCCC88'>
825				<TD align='right'><input class="InvHeadInput" type='text' readonly name='message' value='' size='30'></TD>        
826				<TD style="border:1 solid black;"><INPUT class="InvRowInput3" readOnly TYPE="text" Name="Payable" Value="<%=Separate(totalReceivable)%>" size="20"></TD>      
827			</TR>
828			
829			<TR bgcolor='#CCCC88'>
830				<TD align='left'>���� ������:</TD>        
831				<TD><INPUT class="InvHeadInput3" style="color:gray;" readOnly TYPE="text" Name="MustBe" Value="<%=Separate(totalReceivable)%>" size="20"></TD>      
832			</TR>			
833			</TABLE>
834		</div>
835		</td>
836	</tr>
837	<tr>
838		<td align='center'>
839			<% 	
840				mySQL="SELECT * FROM Invoices WHERE (ID="& InvoiceID & ")"
841				Set RS1 = conn.Execute(mySQL)
842				If CInt(mid(RS1("IssuedDate"),3,2)) >= 88 Then
843					reportStr = "InvoicePrintForm88.rpt"
844				Else
845					reportStr = "InvoicePrintForm.rpt"
846				End If 
847				RS1.close
848				ReportLogRow = PrepareReport (reportStr, "InvoiceID", InvoiceID, "/beta/dialog_printManager.asp?act=Fin") 
849			%>
850			<INPUT class="InvGenButton" TYPE="submit" value=" ��� ������� " onclick="return calcAndCheck();">
851			<INPUT class="InvGenButton" TYPE="button" value=" �ǁ " onclick="printThisReport(this,<%=ReportLogRow%>);">
852			<INPUT class="InvGenButton" TYPE="button" value=" ������ " onclick="window.location='?';">
853		</td>
854	</tr>
855	</table>
856	</FORM>
857	<SCRIPT LANGUAGE="JavaScript">
858	
859//		document.getElementsByName("Items")[0].focus();
860		calcAndCheck();
861	
862	</SCRIPT>
863<%
864else
865%>
866	<br>
867	<FORM METHOD=POST ACTION="?act=submitsearch">
868	<div dir='rtl'><B><FONT SIZE="" COLOR="red"> &nbsp;������ ������: </FONT></B>
869		<BR><BR>����� ������:<INPUT style="font-family:Tahoma;width:100px;" TYPE="text" NAME="invoice">&nbsp;<INPUT class="GenButton" TYPE="submit" Name="submitShow" value="�����">
870		<BR>�� <BR>����� �����:<INPUT TYPE="text" NAME="query" onfocus="document.getElementsByName('invoice')[0].value='';">&nbsp;
871		
872	</div>
873	</FORM>
874	<%
875	set rs=Conn.Execute("select top 50 Invoices.ID,Invoices.Customer,Invoices.IssuedDate,Users.RealName,Accounts.AccountTitle,Invoices.TotalReceivable from Invoices inner join Users on Invoices.IssuedBy=Users.ID inner join Accounts on Invoices.Customer=Accounts.ID where Invoices.Voided=0 and Invoices.Issued=1 and Invoices.IsA=1 and Invoices.ID not in (select InvoiceID from InvoicePrintForms where Voided=0) order by IssuedDate desc")
876	
877	do while not rs.eof
878		%>
879		������ ����� <a href='../AR/AccountReport.asp?act=showInvoice&invoice=<%=rs("ID")%>'><%=rs("ID")%></a> �� ���� <%=Separate(rs("TotalReceivable"))%> ����� �� <a href='../CRM/AccountInfo.asp?act=show&selectedCustomer=<%=rs("Customer")%>'><%=rs("AccountTitle")%></a> �� ����� <%=rs("IssuedDate")%> ���� ��� � ���� ��� ������ �� <a  href='InvoicePrintForm.asp?act=getPrintForm&invoice=<%=rs("ID")%>'>�ǁ</a> ����.<br>
880		<%
881		rs.moveNext
882	loop
883	%>
884	<SCRIPT LANGUAGE="JavaScript">
885	<!--
886		document.getElementsByName("invoice")[0].focus();
887	//-->
888	</SCRIPT>
889<%
890end if
891conn.Close
892%>
893<!--#include file="tah.asp" -->