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