/beta/Inquiry/include_JS_for_Inquiries.asp

http://github.com/khaneh/Orders · ASP · 506 lines · 450 code · 56 blank · 0 comment · 79 complexity · b668c6600600c98714fdc04e98e9d406 MD5 · raw file

  1. <script language="JavaScript">
  2. <!--
  3. function setCurrentRow(rowNo){
  4. if (rowNo == -1) rowNo=0;
  5. invTable=document.getElementById("InquiryLines");
  6. theTD=invTable.getElementsByTagName("tr")[currentRow].getElementsByTagName("td")[0];
  7. theTD.setAttribute("bgColor", '#F0F0F0');
  8. currentRow=rowNo;
  9. invTable=document.getElementById("InquiryLines");
  10. theTD=invTable.getElementsByTagName("tr")[currentRow].getElementsByTagName("td")[0];
  11. theTD.setAttribute("bgColor", '#FFB0B0');
  12. }
  13. function delRow(rowNo){
  14. invTable=document.getElementById("InquiryLines");
  15. theRow=invTable.getElementsByTagName("tr")[rowNo];
  16. invTable.removeChild(theRow);
  17. rowsCount=document.getElementsByName("Items").length;
  18. for (rowNo=0; rowNo < rowsCount ; rowNo++){
  19. tempTD=invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[0]
  20. tempTD.bgColor= '#F0F0F0';
  21. tempTD.innerText= rowNo+1;
  22. }
  23. }
  24. function addRow(){
  25. rowNo = currentRow
  26. invTable=document.getElementById("InquiryLines");
  27. theRow=invTable.getElementsByTagName("tr")[rowNo];
  28. newRow=document.createElement("tr");
  29. newRow.setAttribute("bgColor", '#f0f0f0');
  30. newRow.setAttribute("onclick", theRow.getAttribute("onclick"));
  31. tempTD=document.createElement("td");
  32. tempTD.innerHTML=rowNo+1
  33. tempTD.setAttribute("align", 'center');
  34. tempTD.setAttribute("width", '25');
  35. newRow.appendChild(tempTD);
  36. tempTD=document.createElement("td");
  37. tempTD.setAttribute("dir", 'LTR');
  38. tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='Items' size='3' Maxlength='6' onKeyPress='return mask(this);' onChange='return check(this);' onfocus='setCurrentRow(this.parentNode.parentNode.rowIndex);'><INPUT TYPE='hidden' name='type' value=0><INPUT TYPE='hidden' name='fee' value=0><INPUT type='hidden' name='hasVat' value=0>"
  39. newRow.appendChild(tempTD);
  40. tempTD=document.createElement("td");
  41. tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Descriptions' size='30'>"
  42. newRow.appendChild(tempTD);
  43. tempTD=document.createElement("td");
  44. tempTD.setAttribute("dir", 'LTR');
  45. tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Lengths' size='2' onBlur='setFeeQtty(this);'>"
  46. newRow.appendChild(tempTD);
  47. tempTD=document.createElement("td");
  48. tempTD.setAttribute("dir", 'LTR');
  49. tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Widths' size='2' onBlur='setFeeQtty(this);'>"
  50. newRow.appendChild(tempTD);
  51. tempTD=document.createElement("td");
  52. tempTD.setAttribute("dir", 'LTR');
  53. tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Qttys' size='3' onBlur='setFeeQtty(this);'>"
  54. newRow.appendChild(tempTD);
  55. tempTD=document.createElement("td");
  56. tempTD.setAttribute("dir", 'LTR');
  57. tempTD.innerHTML="<INPUT class='InvRowInput2' TYPE='text' NAME='Sets' size='2' onBlur='setFeeQtty(this);'>"
  58. newRow.appendChild(tempTD);
  59. tempTD=document.createElement("td");
  60. tempTD.setAttribute("dir", 'LTR');
  61. tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='AppQttys' size='6' onBlur='setPrice(this);'>"
  62. newRow.appendChild(tempTD);
  63. tempTD=document.createElement("td");
  64. tempTD.setAttribute("dir", 'LTR');
  65. tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='Fees' size='7' onBlur='setPrice(this);'>"
  66. newRow.appendChild(tempTD);
  67. tempTD=document.createElement("td");
  68. tempTD.setAttribute("dir", 'LTR');
  69. tempTD.innerHTML="<INPUT tabIndex='9999' class='InvRowInput' TYPE='text' NAME='Prices' size='9'>"
  70. newRow.appendChild(tempTD);
  71. tempTD=document.createElement("td");
  72. tempTD.setAttribute("dir", 'LTR');
  73. tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='Discounts' size='7' onBlur='setPrice(this);'>"
  74. newRow.appendChild(tempTD);
  75. tempTD=document.createElement("td");
  76. tempTD.setAttribute("dir", 'LTR');
  77. tempTD.innerHTML="<INPUT class='InvRowInput' TYPE='text' NAME='Reverses' size='5' onBlur='setPrice(this);' onfocus='setCurrentRow(this.parentNode.parentNode.rowIndex);'>"
  78. newRow.appendChild(tempTD);
  79. // S A M
  80. tempTD=document.createElement("td");
  81. tempTD.setAttribute("dir", 'LTR');
  82. tempTD.innerHTML="<INPUT tabIndex='9998' class='InvRowInput' TYPE='text' NAME='Vat' size='6' readonly>"
  83. //tempTD.appendChild(tempTD);
  84. newRow.appendChild(tempTD);
  85. tempTD=document.createElement("td");
  86. tempTD.setAttribute("dir", 'LTR');
  87. tempTD.innerHTML="<INPUT tabIndex='9999' class='InvRowInput2' TYPE='text' NAME='AppPrices' size='9'>"
  88. newRow.appendChild(tempTD);
  89. invTable.insertBefore(newRow,theRow);
  90. rowsCount=document.getElementsByName("Items").length;
  91. for (rowNo=0; rowNo < rowsCount ; rowNo++){
  92. tempTD=invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[0]
  93. tempTD.bgColor= '#F0F0F0';
  94. tempTD.innerText= rowNo+1;
  95. }
  96. invTable.getElementsByTagName("tr")[currentRow].getElementsByTagName("td")[1].getElementsByTagName("Input")[0].focus();
  97. }
  98. //--------------------------------------------------------------------------------------------------------------------------------------------------
  99. function setPrice(src){
  100. // alert(src.name);
  101. if (src.name=="Discounts" || src.name=="Reverses"){
  102. if (src.value.substr(src.value.length-1)=='%'){
  103. src.value=val2txt(txt2val(src.value));
  104. rowNo=src.parentNode.parentNode.rowIndex;
  105. src.value=val2txt(parseInt(txt2val(document.getElementsByName("Prices")[rowNo].value) * txt2val(src.value) / 100))
  106. }
  107. else{
  108. src.value=val2txt(txt2val(src.value));
  109. }
  110. }
  111. else{
  112. src.value=val2txt(txt2val(src.value));
  113. }
  114. isA = document.getElementsByName("IsA")[0].checked;
  115. //alert(isA);
  116. rowNo=src.parentNode.parentNode.rowIndex;
  117. tmpFee=txt2val(document.getElementsByName("Fees")[rowNo].value);
  118. tmpAppQtty=txt2val(document.getElementsByName("AppQttys")[rowNo].value);
  119. tmpDiscount=txt2val(document.getElementsByName("Discounts")[rowNo].value);
  120. tmpReverse=txt2val(document.getElementsByName("Reverses")[rowNo].value);
  121. tmpPrice= tmpFee * tmpAppQtty;
  122. tmpAppPrice=tmpPrice - tmpDiscount - tmpReverse;
  123. // S A M
  124. if (txt2val(document.getElementsByName("hasVat")[rowNo].value) == 1 && isA)
  125. tmpVat = tmpAppPrice * .03;
  126. else
  127. tmpVat = 0;
  128. tmpAppPrice += tmpVat;
  129. document.getElementsByName("Prices")[rowNo].value = val2txt(parseInt(tmpPrice));
  130. document.getElementsByName("AppPrices")[rowNo].value = val2txt(parseInt(tmpAppPrice));
  131. document.getElementsByName("Vat")[rowNo].value = val2txt(parseInt(tmpVat));
  132. var totalPrice = 0;
  133. var totalDiscount = 0;
  134. var totalReverse = 0;
  135. var totalAppPrice = 0;
  136. var payable = 0;
  137. var totalVat = 0;
  138. for (rowNo=0; rowNo < document.getElementsByName("Fees").length; rowNo++){
  139. totalPrice += parseInt(txt2val(document.getElementsByName("Prices")[rowNo].value));
  140. totalDiscount += parseInt(txt2val(document.getElementsByName("Discounts")[rowNo].value));
  141. totalReverse += parseInt(txt2val(document.getElementsByName("Reverses")[rowNo].value));
  142. totalAppPrice += parseInt(txt2val(document.getElementsByName("AppPrices")[rowNo].value));
  143. if (isA) {
  144. totalVat += parseInt(txt2val(document.getElementsByName("Vat")[rowNo].value));}
  145. }
  146. payable = Math.floor(totalAppPrice/1000) * 1000;
  147. document.all.TotalPrice.value = val2txt(totalPrice);
  148. document.all.TotalDiscount.value = val2txt(totalDiscount);
  149. document.all.TotalReverse.value = val2txt(totalReverse);
  150. document.all.Payable.value = val2txt(payable);
  151. document.all.TotalVat.value = val2txt(totalVat);
  152. if (totalPrice==0){
  153. document.all.TPDiscount.value = "- "+'%';
  154. document.all.TPReverse.value = "- "+'%ѐ';
  155. }
  156. else{
  157. document.all.TPDiscount.value = Math.round(totalDiscount/totalPrice * 100)+'%';
  158. document.all.TPReverse.value = Math.round(totalReverse/totalPrice * 100)+'%ѐ';
  159. }
  160. }
  161. function checkIsA(){
  162. isA = document.getElementsByName("IsA")[0].checked;
  163. var totalPrice = 0;
  164. var totalDiscount = 0;
  165. var totalReverse = 0;
  166. var totalAppPrice = 0;
  167. var payable = 0;
  168. var totalVat = 0;
  169. for (rowNo=0; rowNo < document.getElementsByName("Fees").length; rowNo++){
  170. tmpFee=txt2val(document.getElementsByName("Fees")[rowNo].value);
  171. tmpAppQtty=txt2val(document.getElementsByName("AppQttys")[rowNo].value);
  172. tmpDiscount=txt2val(document.getElementsByName("Discounts")[rowNo].value);
  173. tmpReverse=txt2val(document.getElementsByName("Reverses")[rowNo].value);
  174. tmpPrice= tmpFee * tmpAppQtty;
  175. tmpAppPrice=tmpPrice - tmpDiscount - tmpReverse;
  176. // S A M
  177. if (txt2val(document.getElementsByName("hasVat")[rowNo].value) == 1 && isA)
  178. tmpVat = tmpAppPrice * .03;
  179. else
  180. tmpVat = 0;
  181. tmpAppPrice += tmpVat;
  182. document.getElementsByName("Prices")[rowNo].value = val2txt(parseInt(tmpPrice));
  183. document.getElementsByName("AppPrices")[rowNo].value = val2txt(parseInt(tmpAppPrice));
  184. document.getElementsByName("Vat")[rowNo].value = val2txt(parseInt(tmpVat));
  185. // ---------------------------------------------
  186. totalPrice += parseInt(txt2val(document.getElementsByName("Prices")[rowNo].value));
  187. totalDiscount += parseInt(txt2val(document.getElementsByName("Discounts")[rowNo].value));
  188. totalReverse += parseInt(txt2val(document.getElementsByName("Reverses")[rowNo].value));
  189. totalAppPrice += parseInt(txt2val(document.getElementsByName("AppPrices")[rowNo].value));
  190. if (isA) {
  191. totalVat += parseInt(txt2val(document.getElementsByName("Vat")[rowNo].value));}
  192. }
  193. payable = Math.floor(totalAppPrice/1000) * 1000;
  194. document.all.TotalPrice.value = val2txt(totalPrice);
  195. document.all.TotalDiscount.value = val2txt(totalDiscount);
  196. document.all.TotalReverse.value = val2txt(totalReverse);
  197. document.all.Payable.value = val2txt(payable);
  198. document.all.TotalVat.value = val2txt(totalVat);
  199. if (totalPrice==0){
  200. document.all.TPDiscount.value = "- "+'%';
  201. document.all.TPReverse.value = "- "+'%ѐ';
  202. }
  203. else{
  204. document.all.TPDiscount.value = Math.round(totalDiscount/totalPrice * 100)+'%';
  205. document.all.TPReverse.value = Math.round(totalReverse/totalPrice * 100)+'%ѐ';
  206. }
  207. }
  208. //--------------------------------------------------------------------------------------------------------------------------------------------------
  209. var dialogActive=false;
  210. var badCode = false;
  211. var A = 90 // DuplexFee Add-in
  212. var ProofSimplex = 3000
  213. var ProofDuplex = 4500
  214. Qtt = Array ( 0 , 1, 50, 150, 300 )
  215. /*SimplexFee*/ SF = Array ( ProofSimplex, 200, 144, 112, 100 )
  216. /*DuplexFee*/ DF = Array ( ProofDuplex, SF[1]+A, SF[2]+A, SF[3]+A, SF[4]+A)
  217. //-----------------------------------------------------------------------------------------------------------------------------------------
  218. function setFeeQtty(src){
  219. rowNo=src.parentNode.parentNode.rowIndex;
  220. itemType=parseInt(txt2val(document.getElementsByName("type")[rowNo].value));
  221. itemFee=document.getElementsByName("fee")[rowNo].value;
  222. if (!document.getElementsByName("Qttys")[rowNo].value == "")
  223. document.getElementsByName("Qttys")[rowNo].value = parseInt(document.getElementsByName("Qttys")[rowNo].value);
  224. if (!document.getElementsByName("Sets")[rowNo].value == "")
  225. document.getElementsByName("Sets")[rowNo].value = parseInt(document.getElementsByName("Sets")[rowNo].value);
  226. //////////////// Type =1 ---> General //////////////////
  227. if (itemType==1 || itemType==5){
  228. document.getElementsByName("AppQttys")[rowNo].value = parseInt(txt2val(document.getElementsByName("Qttys")[rowNo].value)) * parseInt(txt2val(document.getElementsByName("Sets")[rowNo].value));
  229. document.getElementsByName("Fees")[rowNo].value = parseInt(txt2val(itemFee))
  230. if (''+document.getElementsByName("AppQttys")[rowNo].value=='NaN')
  231. document.getElementsByName("AppQttys")[rowNo].value = 0
  232. }
  233. //////////////// Type =2 ---> Digital //////////////////
  234. if (itemType==2 && itemFee!="0"){
  235. PF = parseInt(txt2val(itemFee.substr(1)));
  236. tmp = itemFee.substr(0,1);
  237. if (tmp == "s" )
  238. SoD = false
  239. else
  240. SoD = true
  241. Tirag = Math.round(parseInt(txt2val(document.getElementsByName("Qttys")[rowNo].value)));
  242. h = parseInt(txt2val(document.getElementsByName("Lengths")[rowNo].value));
  243. Price = 0
  244. i = 1
  245. document.getElementsByName("Widths")[rowNo].value = 30
  246. if (h ==0 )
  247. {
  248. document.getElementsByName("Lengths")[rowNo].value=21
  249. h=21
  250. }
  251. /*while ( Tirag >= Qtt[ i -1] )
  252. {
  253. a1 = Tirag - Qtt[ i - 1 ]
  254. a2 = Tirag - Qtt[ i ]
  255. if (a2>0)
  256. a3 = a1 - a2
  257. else
  258. a3 = a1
  259. if ( SoD == false )
  260. Price += ( SF[ i-1 ] + PF ) * a3
  261. else
  262. Price += ( DF[ i-1 ] + PF ) * a3
  263. i++
  264. }
  265. */
  266. Price = ( 200 + PF ) * Tirag
  267. if ( SoD == false )
  268. Price = Price * 1
  269. else
  270. Price = Price * 2
  271. Price = Math.round(Price / 21 * h)
  272. unitPrice = Math.round(Price / Tirag) * 10
  273. document.getElementsByName("Fees")[rowNo].value = unitPrice
  274. document.getElementsByName("AppQttys")[rowNo].value = parseInt(txt2val(document.getElementsByName("Qttys")[rowNo].value)) * parseInt(txt2val(document.getElementsByName("Sets")[rowNo].value));
  275. if (''+document.getElementsByName("AppQttys")[rowNo].value=='NaN')
  276. document.getElementsByName("AppQttys")[rowNo].value = 0
  277. if (''+document.getElementsByName("Fees")[rowNo].value=='NaN')
  278. document.getElementsByName("Fees")[rowNo].value = 0
  279. }
  280. //////////////// Type =3 ---> Film /////////////////////
  281. if (itemType==3){
  282. h = txt2val(document.getElementsByName("Lengths")[rowNo].value);
  283. w = txt2val(document.getElementsByName("Widths")[rowNo].value);
  284. document.getElementsByName("Fees")[rowNo].value = parseInt(txt2val(itemFee))
  285. document.getElementsByName("AppQttys")[rowNo].value = val2txt(txt2val(document.getElementsByName("Qttys")[rowNo].value) * txt2val(document.getElementsByName("Sets")[rowNo].value) * h * w);
  286. }
  287. //////////////// Type =4 ---> Piramon //////////////////
  288. if (itemType==4){
  289. document.getElementsByName("Fees")[rowNo].value = parseInt(txt2val(itemFee))
  290. //document.getElementsByName("AppQttys")[rowNo].focus();
  291. //document.getElementsByName("AppQttys")[rowNo].select();
  292. }
  293. setPrice(document.getElementsByName("Fees")[rowNo]);
  294. }
  295. //--------------------------------------------------------------------------------------------------------------------------------------------------
  296. function mask(src){
  297. var theKey=event.keyCode;
  298. rowNo=src.parentNode.parentNode.rowIndex;
  299. invTable=document.getElementById("InquiryLines");
  300. theRow=invTable.getElementsByTagName("tr")[rowNo];
  301. if (src.name=="Items"){
  302. if (theKey==13){
  303. event.keyCode=9
  304. dialogActive=true
  305. document.all.tmpDlgArg.value="#"
  306. document.all.tmpDlgTxt.value=" :"
  307. var myTinyWindow = window.showModalDialog('dialog_FindInvItem.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
  308. if (document.all.tmpDlgTxt.value !="") {
  309. var myTinyWindow = window.showModalDialog('dialog_inquiryItems.asp?act=select&name='+escape(document.all.tmpDlgTxt.value),document.all.tmpDlgArg,'dialogHeight:500px; dialogWidth:380px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
  310. if (document.all.tmpDlgArg.value!="#"){
  311. Arguments=document.all.tmpDlgArg.value.split("#")
  312. src.value=Arguments[0];
  313. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0].value=Arguments[1];
  314. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[1].value=Arguments[2];
  315. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[2].value=Arguments[3];
  316. if (Arguments[4] == "") // VAT
  317. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[3].value = 1;
  318. else
  319. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[3].value = 0;
  320. }
  321. //setFeeQtty(invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0])
  322. a=invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0];
  323. if (a){
  324. setFeeQtty(a)
  325. a.focus();
  326. }
  327. }
  328. dialogActive=false
  329. }
  330. else if (theKey >= 48 && theKey <= 57 ) {
  331. //alert(theKey)
  332. //src.value=''
  333. return true;
  334. }
  335. else {
  336. return false;
  337. }
  338. }
  339. }
  340. //--------------------------------------------------------------------------------------------------------------------------------------------------
  341. function check(src){
  342. if (src.name=="Items"){
  343. rowNo=src.parentNode.parentNode.rowIndex;
  344. rowsCount=document.getElementsByName("Items").length;
  345. if (!dialogActive){
  346. if (src.value=='0'){
  347. if (confirm(" Ͽ")){
  348. delRow(rowNo);
  349. if (rowNo != rowsCount ){
  350. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[0].focus();
  351. }else{
  352. invTable.getElementsByTagName("tr")[rowNo-1].getElementsByTagName("td")[1].getElementsByTagName("Input")[0].focus();
  353. }
  354. return false;
  355. }
  356. else{
  357. src.focus();
  358. }
  359. }
  360. else {
  361. badCode = false;
  362. if (window.XMLHttpRequest) {
  363. var objHTTP=new XMLHttpRequest();
  364. } else if (window.ActiveXObject) {
  365. var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
  366. }
  367. objHTTP.open('GET','xml2.asp?id='+src.value,false)
  368. objHTTP.send()
  369. tmpStr = unescape( objHTTP.responseText)
  370. ar = tmpStr.split("#")
  371. if (ar[0]==" ")
  372. {
  373. //src.value="";
  374. //src.focus();
  375. alert(" ");
  376. return false;
  377. }
  378. else{
  379. //document.all['A1'].innerText= objHTTP.status
  380. //document.all['A2'].innerText= objHTTP.statusText
  381. //document.all['A3'].innerText= objHTTP.responseText
  382. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0].value = ar[0];
  383. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[1].value = ar[1];
  384. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[2].value = ar[2];
  385. // VAT
  386. if (ar[3] == "True")
  387. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[3].value = 1;
  388. else
  389. invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[1].getElementsByTagName("Input")[3].value = 0;
  390. setFeeQtty(invTable.getElementsByTagName("tr")[rowNo].getElementsByTagName("td")[2].getElementsByTagName("Input")[0]);
  391. }
  392. }
  393. }
  394. }
  395. }
  396. function js_Link2Trace(num){
  397. return "<A HREF='../order/orderEdit.asp?e=n&radif="+ num + "' target='_balnk'>"+ num + "</A>"
  398. }
  399. function selectOrder(){
  400. theSpan=document.getElementById("orders");
  401. document.all.tmpDlgArg.value="";
  402. window.showModalDialog('Orders.asp?act=select&customer='+document.all.customerID.value,document.all.tmpDlgArg,'dialogHeight:500px; dialogWidth:380px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
  403. if (document.all.tmpDlgArg.value!="[Esc]"){
  404. theSpan.innerHTML="";
  405. Arguments=document.all.tmpDlgArg.value.split("#")
  406. tempWriteAnd=""
  407. for (i=1;i<=Arguments[0];i++){
  408. theSpan.innerHTML += "<input type='hidden' name='selectedOrders' value='"+Arguments[i]+"'>" + tempWriteAnd + js_Link2Trace(Arguments[i])
  409. tempWriteAnd=" "
  410. }
  411. }
  412. }
  413. function selectCustomer(){
  414. document.all.tmpDlgArg.value="#"
  415. document.all.tmpDlgTxt.value=" :"
  416. window.showModalDialog('../dialog_GenInput.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
  417. if (document.all.tmpDlgTxt.value !="") {
  418. window.showModalDialog('../AR/dialog_SelectAccount.asp?act=select&search='+escape(document.all.tmpDlgTxt.value), document.all.tmpDlgArg, 'dialogWidth:780px; dialogHeight:500px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
  419. if (document.all.tmpDlgArg.value!="#"){
  420. Arguments=document.all.tmpDlgArg.value.split("#")
  421. theSpan=document.getElementById("customer");
  422. theSpan.getElementsByTagName("input")[0].value=Arguments[0];
  423. theSpan.getElementsByTagName("span")[0].innerText=Arguments[1];
  424. }
  425. }
  426. }
  427. function submitOperations(){
  428. setCurrentRow(0);
  429. var okGo=true;
  430. for (rowNo=0; rowNo < document.getElementsByName("Items").length; rowNo++){
  431. if (document.getElementsByName('Items')[rowNo].value==''){
  432. delRow(rowNo);
  433. rowNo=rowNo-1;
  434. okGo=false;
  435. }
  436. }
  437. if (okGo && document.getElementsByName('Items')[0]) {
  438. checkIsA();
  439. document.forms[0].submit();
  440. }
  441. else{
  442. alert(". \n\n . ")
  443. currentRow=0;
  444. setCurrentRow(0);
  445. if (document.getElementsByName('Items')[0])
  446. document.getElementsByName('Items')[0].focus();
  447. }
  448. }
  449. //-->
  450. </script>