/beta/inventory/default.asp

http://github.com/khaneh/Orders · ASP · 1041 lines · 908 code · 84 blank · 49 comment · 127 complexity · 60c7015833632af9d217a657780ea504 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'Inventory (5)
  3. PageTitle= " "
  4. SubmenuItem=1
  5. if not (Auth(5 , 1) or Auth(5 , 9)) 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. <SCRIPT LANGUAGE="JavaScript">
  12. <!--
  13. function boxChecked(obj)
  14. {
  15. theTR = obj.parentNode.parentNode
  16. rowNo = theTR.rowIndex - 2
  17. if(obj.checked)
  18. {
  19. document.getElementsByName("box")[rowNo].value = 1;
  20. }
  21. else
  22. {
  23. document.getElementsByName("box")[rowNo].value = 0;
  24. }
  25. }
  26. function conf()
  27. {
  28. var CusHavItemIDs=new Array(100);
  29. var CusHavItemNames=new Array(100);
  30. var CusHavQttys=new Array(100);
  31. var CusHavMax=new Array(100);
  32. var CusHavCount = 0;
  33. var CusHavFlag = true;
  34. var retValue = true;
  35. if (document.all.CustomerHaveInvItem[0]) {
  36. for(n=0;n<document.all.CustomerHaveInvItem.length;n++) {
  37. if(document.all.CustomerHaveInvItem[n].checked)
  38. {
  39. CusHavFlag = true;
  40. for(m=0; m<CusHavCount; m++) {
  41. if (CusHavItemIDs[m] == document.all.itemID[n].value) {
  42. CusHavQttys[m] += parseInt(document.all.qtty[n].value);
  43. CusHavFlag = false;
  44. }
  45. }
  46. if (CusHavFlag) {
  47. CusHavItemIDs[CusHavCount]=document.all.itemID[n].value;
  48. CusHavItemNames[CusHavCount]=document.all.itemName[n].value;
  49. CusHavQttys[CusHavCount] = parseInt(document.all.qtty[n].value);
  50. CusHavMax[CusHavCount] = parseInt(document.all.maxQtty[n].value);
  51. CusHavCount++;
  52. }
  53. }
  54. }
  55. for(m=0;m<CusHavCount;m++)
  56. if (CusHavQttys[m]>CusHavMax[m]) {
  57. alert("! " + CusHavItemNames[m]+" ")
  58. retValue = false
  59. }
  60. }
  61. else if (document.all.CustomerHaveInvItem) {
  62. if(document.all.CustomerHaveInvItem.checked)
  63. if (parseInt(document.all.qtty.value) > parseInt(document.all.maxQtty.value)) {
  64. alert("! " + document.all.itemName.value+" ")
  65. retValue = false
  66. }
  67. }
  68. return retValue;
  69. }
  70. //-->
  71. </SCRIPT>
  72. <%
  73. '-----------------------------------------------------------------------------------------------------
  74. '-------------------------------------------------------------------------- PIRAMOON Pickuplist Submit
  75. '-----------------------------------------------------------------------------------------------------
  76. if request.form("Submit")=" " then
  77. invoice_id = trim(request.form("invoice_id"))
  78. if not isnumeric(invoice_id) then
  79. response.write "<br><br>"
  80. call showAlert( " ." , CONST_MSG_ERROR)
  81. response.end
  82. end if
  83. 'vvvvvvv ------------------------------------------ start of check for current ItemOUT
  84. set RSS=Conn.Execute ("SELECT InventoryLog.ID, InventoryLog.comments, InventoryLog.Voided, InventoryLog.VoidedBy, InventoryLog.VoidedDate, InventoryItems.Unit, InventoryItems.Name, InventoryItems.OldItemID, InventoryLog.logDate, InventoryLog.Qtty, InventoryLog.RelatedID, InventoryLog.ItemID, InventoryLog.type, InventoryLog.ID AS Expr1, InventoryLog.CreatedBy, InventoryLog.owner, Users.RealName FROM InventoryLog INNER JOIN InventoryItems ON InventoryLog.ItemID = InventoryItems.ID INNER JOIN Users ON InventoryLog.CreatedBy = Users.ID WHERE (InventoryLog.RelatedInvoiceID = "& invoice_id & ") AND (InventoryLog.IsInput = 0) AND (InventoryLog.Voided = 0)")
  85. if not RSS.EOF then
  86. %>
  87. <br><br>
  88. <%
  89. call showAlert(" ", CONST_MSG_ALERT)
  90. response.write "<br><br>"
  91. %>
  92. <TABLE dir=rtl align=center width=600>
  93. <TR bgcolor="eeeeee" >
  94. <TD><SMALL> </SMALL></TD>
  95. <TD width=200><SMALL> </SMALL></TD>
  96. <TD><SMALL> </SMALL></TD>
  97. <TD><SMALL></SMALL></TD>
  98. <TD><SMALL> </SMALL></TD>
  99. <TD align=center><SMALL> </SMALL></TD>
  100. <TD><SMALL></SMALL></TD>
  101. </TR>
  102. <%
  103. tmpCounter=0
  104. do while not RSS.EOF
  105. tmpCounter = tmpCounter + 1
  106. if tmpCounter mod 2 = 1 then
  107. tmpColor="#FFFFFF"
  108. tmpColor2="#FFFFBB"
  109. Else
  110. tmpColor="#DDDDDD"
  111. tmpColor2="#EEEEBB"
  112. End if
  113. %>
  114. <TR bgcolor="<%=tmpColor%>" style="height:25pt" <% if RSS("voided") then%> disabled title=" <%=RSS("VoidedDate")%>"<% end if %>>
  115. <TD align=right dir=ltr><INPUT TYPE="hidden" name="id" value="<%=RSS("ID")%>"><A HREF="invReport.asp?oldItemID=<%=RSS("oldItemID")%>&logRowID=<%=RSS("ID")%>" target="_blank"><%=RSS("OldItemID")%></A></TD>
  116. <TD><% if RSS("voided") then%><div style="position:absolute;width:520;"><hr style="color:red;"></div><% end if %><!A HREF="default.asp?itemDetail=<%=RSS("ID")%>"><span style="font-size:10pt"><%=RSS("Name")%></A></TD>
  117. <TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("Qtty")%></span></TD>
  118. <TD align=right dir=ltr><%=RSS("Unit")%></TD>
  119. <TD dir=ltr><%=RSS("logDate")%></span></TD>
  120. <TD align=center><%
  121. if RSS("type")= "2" then
  122. response.write "<font color=red><b> </b></font>"
  123. elseif RSS("type")= "5" then
  124. response.write "<font color=orang><b></b></font>"
  125. else %>
  126. <A HREF="default.asp?ed=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A>
  127. <% end if %>
  128. <% if RSS("owner")<> "-1" and RSS("owner")<> "-2" then
  129. response.write " ( <a href='../CRM/AccountInfo.asp?act=show&selectedCustomer="& RSS("owner") &"' target='_blank'> " & RSS("owner") & "</a>)"
  130. end if %>
  131. <% if RSS("comments")<> "-" and RSS("comments")<> "" then
  132. response.write " <br><br><B>:</B> " & RSS("comments")
  133. end if %>
  134. </TD>
  135. <TD><%=RSS("RealName")%></TD>
  136. </TR>
  137. <%
  138. RSS.movenext
  139. loop
  140. response.write "</table><br><br>"
  141. response.end
  142. end if
  143. RSS.close
  144. set RSS = nothing
  145. '^^^^^^^ ------------------------------------------ end of check for current ItemOUT
  146. 'vvvvvvv ------------------------------------------ start of check for current Inv PickupList
  147. set RSS=Conn.Execute ("SELECT InventoryPickuplistItems.pickupListID FROM InventoryPickuplistItems INNER JOIN InventoryItemRequests ON InventoryPickuplistItems.RequestID = InventoryItemRequests.ID INNER JOIN InventoryPickuplists ON InventoryPickuplistItems.pickupListID = InventoryPickuplists.id LEFT OUTER JOIN Orders ON InventoryPickuplistItems.Order_ID = Orders.ID WHERE (InventoryItemRequests.RelatedInvoiceID = "& invoice_id & ") GROUP BY InventoryPickuplistItems.pickupListID, InventoryPickuplists.Status HAVING (InventoryPickuplists.Status <> N'del')" )
  148. if not RSS.EOF then
  149. str = " . <BR> <B></B> <BR><BR>"
  150. do while not RSS.EOF
  151. str = str & "&nbsp; <A target=_blank HREF='?show="& RSS("pickupListID") & "'>"& RSS("pickupListID") & "</A>"
  152. RSS.movenext
  153. loop
  154. %>
  155. <br><br>
  156. <%
  157. call showAlert(str, CONST_MSG_ALERT)
  158. response.write "<br><br>"
  159. response.end
  160. end if
  161. '^^^^^^^ ------------------------------------------ end of check for current Inv PickupList
  162. set RSS=Conn.Execute ("SELECT dbo.InventoryItems.Name, dbo.InvoiceLines.AppQtty, dbo.InventoryItems.ID as itemID, dbo.InvoiceItems.RelatedInventoryItemID, dbo.InventoryItems.Unit FROM dbo.InvoiceLines INNER JOIN dbo.InvoiceItems ON dbo.InvoiceLines.Item = dbo.InvoiceItems.ID INNER JOIN dbo.InventoryItems ON dbo.InvoiceItems.RelatedInventoryItemID = dbo.InventoryItems.OldItemID WHERE (dbo.InvoiceLines.Invoice = " & invoice_id & ")")
  163. st = ""
  164. do while not RSS.EOF
  165. mysql = "INSERT INTO dbo.InventoryItemRequests (Order_ID, ItemName, Comment, ReqDate, Status, ItemID, unit, CreatedBy, CustomerHaveInvItem, Qtty, RelatedInvoiceID) VALUES (-1,N'" & RSS("name") & "', N' "& invoice_id & "', N'" & shamsiToday() & "', 'new', " & RSS("itemID") & ", N'" & RSS("unit") & "', " & session("id") & ", 0 , " & RSS("AppQtty") & ", "& invoice_id & ")"
  166. Conn.Execute (mysql)
  167. 'response.write "<br>" & mysql
  168. set RSS2=Conn.Execute ("SELECT max(id) as itemReq from InventoryItemRequests")
  169. st = st & "&itemReq=" & RSS2("itemReq")
  170. RSS.movenext
  171. loop
  172. RSS.close
  173. set RSS = nothing
  174. response.redirect "?Submit=sodoor" & st
  175. response.end
  176. '-----------------------------------------------------------------------------------------------------
  177. '--------------------------------------------------------------- EDIT Inventory Item Pickuplist Submit
  178. '-----------------------------------------------------------------------------------------------------
  179. elseif request.form("Submit")=" " then
  180. GiveTo = request.form("GiveTo")
  181. PickupListID = request.form("PickupListID")
  182. set RST=Conn.Execute ("SELECT RealName FROM Users WHERE (ID = "& GiveTo & ")" )
  183. GiveToRealName = RST("RealName")
  184. set RSY=Conn.Execute ("UPDATE InventoryPickuplists SET GiveTo ="& GiveTo & ", LastEditTime =N'"& currentTime10() & "', LastEditDate =N'"& shamsitoday() & "', LastEditedBy ="& session("id") & " where id= "& PickupListID )
  185. response.write "<BR><BR><TABLE align=center style='border: solid 2pt black'><TR><TD>"
  186. response.write "<li> : " & CreationDate & " " & CreationTime
  187. response.write "<li> : " & GiveToRealName
  188. response.write "<hr>"
  189. for i=1 to request.form("ItemID").count
  190. ItemID = Clng(request.form("ItemID")(i))
  191. ID = Clng(request.form("ID")(i))
  192. ItemName = sqlSafe(request.form("ItemName")(i))
  193. unit = sqlSafe(request.form("unit")(i))
  194. qtty = cdbl(request.form("qtty")(i))
  195. box = sqlSafe(request.form("box")(i))
  196. mysql = "UPDATE InventoryPickuplistItems SET ItemName = N'"& ItemName & "', Qtty = '"& Qtty & "', CustomerHaveInvItem='" & box & "' WHERE (id = "& ID & ")"
  197. Conn.Execute (mysql)
  198. response.write "<li> " & ItemName & " (" & Qtty & " " & unit & ")"
  199. if box="1" then
  200. response.write "<b> </b>"
  201. end if
  202. next
  203. response.write "</TD></TR></TABLE><center>"
  204. response.write "<BR><BR> .</center>"
  205. response.redirect "default.asp?show=" & PickupListID
  206. response.end
  207. end if
  208. '-----------------------------------------------------------------------------------------------------
  209. '------------------------------------------------------------- Print or Show Inventory Item Pickuplist
  210. '-----------------------------------------------------------------------------------------------------
  211. if request("show")<>"" then
  212. PickupListID = request("show")
  213. %>
  214. <BR><BR><BR>
  215. <CENTER>
  216. <% ReportLogRow = PrepareReport ("InvPickupList.rpt", "InvItem_ID", PickupListID, "/beta/dialog_printManager.asp?act=Fin") %>
  217. <INPUT TYPE="button" value=" ǁ " Class="GenButton" style="border:1 solid blue;" onclick="printThisReport(this,<%=ReportLogRow%>);">
  218. <input type="button" value="" Class="GenButton" onclick="window.location='default.asp?ed=<%=PickupListID%>'">
  219. </CENTER>
  220. <BR>
  221. <iframe name=f1 id=f1 src="/CRReports/?Id=<%=ReportLogRow%>" align=center style="width:700; height:410; border-style: none" border=0 FRAMEBORDER=0 scrollbars=no></iframe>
  222. <%
  223. response.end
  224. end if
  225. '-----------------------------------------------------------------------------------------------------
  226. '---------------------------------------------------------------------- EDIT Inventory Item Pickuplist
  227. '-----------------------------------------------------------------------------------------------------
  228. if request("ed")<>"" then
  229. PickupListID = request("ed")
  230. set RSY=Conn.Execute ("SELECT * FROM InventoryPickuplists WHERE id = "& PickupListID )
  231. set RSW=Conn.Execute ("SELECT InventoryItemRequests.comment,InventoryItemRequests.ReqDate, dbo.InventoryItems.OldItemID AS OldItemID, dbo.InventoryPickuplistItems.*, dbo.Users.RealName AS RealName FROM dbo.InventoryItems INNER JOIN dbo.InventoryItemRequests INNER JOIN dbo.InventoryPickuplistItems ON dbo.InventoryItemRequests.ID = dbo.InventoryPickuplistItems.RequestID ON dbo.InventoryItems.ID = dbo.InventoryPickuplistItems.ItemID INNER JOIN dbo.Users ON dbo.InventoryItemRequests.CreatedBy = dbo.Users.ID WHERE (dbo.InventoryPickuplistItems.pickupListID = " & PickupListID & ")")
  232. if RSY.EOF or RSW.EOF then%>
  233. <div align=center dir=rtl><br><br><br><br><br><br><b>!!<br><h3> </h3></b><br></div>
  234. </body>
  235. </html>
  236. <%
  237. else
  238. %><br>
  239. <form method=post action="default.asp" <% if RSY("Status")="done" then %> disabled <% end if %> onsubmit="return confirm(' Ͽ')"><br>
  240. <INPUT TYPE="hidden" name=PickupListID value="<%=PickupListID%>">
  241. <TABLE dir=rtl align=center width=600>
  242. <TR bgcolor="eeeeee" >
  243. <TD align=center colspan=7><B> </B></TD>
  244. </TR>
  245. <TR bgcolor="eeeeee" >
  246. <TD style="width:160;"> </TD>
  247. <TD style="width:70;"> </TD>
  248. <TD style="width:70;"></TD>
  249. <TD style="width:60;"></TD>
  250. <TD> </TD>
  251. <TD style="width:160;"> </TD>
  252. </TR>
  253. <%
  254. tmpCounter=0
  255. totalQtty=0
  256. Do while not RSW.eof
  257. tmpCounter = tmpCounter + 1
  258. if tmpCounter mod 2 = 1 then
  259. tmpColor="#FFFFFF"
  260. tmpColor2="#FFFFBB"
  261. Else
  262. tmpColor="#FFFFFF"
  263. tmpColor2="#FFFFBB"
  264. End if
  265. %>
  266. <TR bgcolor="<%=tmpColor%>" title="<%
  267. response.write " : " & RSW("OldItemID") & " - "
  268. Comment = RSW("Comment")
  269. if Comment<>"-" then
  270. response.write ": " & Comment
  271. else
  272. response.write " "
  273. end if
  274. %>">
  275. <%
  276. myRequestID=RSW("RequestID")
  277. totalQtty = totalQtty + RSW("qtty")
  278. %>
  279. <TD><INPUT TYPE="hidden" name=ID value="<%=RSW("id")%>"><INPUT TYPE="hidden" name=itemID value="<%=RSW("itemid")%>"><INPUT TYPE="hidden" name=unit value="<%=RSW("unit")%>"><INPUT TYPE="text" NAME="itemName" readonly value="<%=RSW("ItemName")%>" style="width:160; border:0"></TD>
  280. <TD><%=RSW("ReqDate")%></TD>
  281. <TD><INPUT TYPE="text" NAME="qtty" value="<%=RSW("qtty")%>" size=7 style="width:45; border:0"> <%=RSW("unit")%></TD>
  282. <TD><%=RSW("RealName")%></TD>
  283. <TD>
  284. <% if RSW("order_ID")<>-1 then %>
  285. <a href="../order/order.asp?act=show&id=<%=RSW("order_ID")%>">
  286. <%=RSW("order_ID")%></a>
  287. <% end if %>
  288. </TD>
  289. <TD>
  290. <%
  291. set RST=Conn.Execute ("SELECT SUM((CONVERT(tinyint, dbo.InventoryLog.IsInput) - .5) * 2 * dbo.InventoryLog.Qtty) AS sumQtty, dbo.Accounts.AccountTitle FROM dbo.Orders INNER JOIN dbo.InventoryLog ON dbo.Orders.Customer = dbo.InventoryLog.owner INNER JOIN dbo.Accounts ON dbo.Orders.Customer = dbo.Accounts.ID WHERE (dbo.InventoryLog.ItemID = " & RSW("ItemID") & " and dbo.InventoryLog.voided=0) GROUP BY dbo.Orders.ID, dbo.Accounts.AccountTitle HAVING (dbo.Orders.ID = " & RSW("order_ID") & ")" )
  292. if not RST.EOF then
  293. if clng(RST("sumQtty")) < 0 then
  294. response.write "<b>!</b> . ʿ!"
  295. response.write "<INPUT TYPE='hidden' NAME='maxQtty'> <INPUT TYPE='hidden' NAME='CustomerHaveInvItem' value='-1'><INPUT TYPE='hidden' NAME='box' value='0'>"
  296. elseif clng(RST("sumQtty")) > 0 then
  297. if RSW("CustomerHaveInvItem") then
  298. response.write "<INPUT TYPE='hidden' NAME='maxQtty' value='" & RST("sumQtty") & "'> <INPUT TYPE='checkbox' NAME='CustomerHaveInvItem' checked value='" & RST("sumQtty") & "' onclick='boxChecked(this)'><INPUT TYPE='hidden' NAME='box' value='1'> " & RST("sumQtty") & " " & RSW("unit") & " " & RSW("ItemName") & " " & RST("AccountTitle") & " Ͽ"
  299. else
  300. response.write "<INPUT TYPE='hidden' NAME='maxQtty' value='" & RST("sumQtty") & "'> <INPUT TYPE='checkbox' NAME='CustomerHaveInvItem' value='" & RST("sumQtty") & "' onclick='boxChecked(this)'><INPUT TYPE='hidden' NAME='box' value='0'> " & RST("sumQtty") & " " & RSW("unit") & " " & RSW("ItemName") & " " & RST("AccountTitle") & " Ͽ"
  301. end if
  302. else
  303. response.write "<INPUT TYPE='hidden' NAME='maxQtty' > <INPUT TYPE='hidden' NAME='CustomerHaveInvItem' value='-1'><INPUT TYPE='hidden' NAME='box' value='0'>"
  304. end if
  305. else
  306. response.write "<INPUT TYPE='hidden' NAME='maxQtty' > <INPUT TYPE='hidden' NAME='CustomerHaveInvItem' value='-1'><INPUT TYPE='hidden' NAME='box' value='0'>"
  307. end if
  308. %>
  309. </TD>
  310. </TR>
  311. <%
  312. RSW.moveNext
  313. Loop
  314. CreatedBy = RSY("CreatedBy")
  315. %>
  316. <TR bgcolor="eeeeee" >
  317. <TD align=center colspan=7 height=10></TD>
  318. </TR>
  319. <TR >
  320. <TD colspan=7 align=center><BR> :
  321. <select name="GiveTo" class=inputBut <% if RSY("Status")="done" then %> disabled <% end if %>>
  322. <% set RSV=Conn.Execute ("SELECT * FROM Users WHERE Display=1 ORDER BY RealName")
  323. Do while not RSV.eof
  324. %>
  325. <option value="<%=RSV("ID")%>" <%
  326. if RSV("ID")=RSY("GiveTo") then
  327. response.write " selected "
  328. end if
  329. %>><%=RSV("RealName")%></option>
  330. <%
  331. RSV.moveNext
  332. Loop
  333. RSV.close
  334. %>
  335. </select><BR><BR>
  336. : <span dir=ltr bgcolor=red><%=RSY("CreationDate")%></span> - <%=RSY("CreationTime")%>
  337. <BR><BR>
  338. : <%=RSY("Status")%>
  339. <BR><BR>
  340. <% if RSY("Printed")<>"0" then%>
  341. ǁ: <%=RSY("Printed")%>
  342. <% end if %>
  343. <BR><BR>
  344. <INPUT TYPE="submit" class=inputBut Name="Submit" Value=" " style="width:100px;" tabIndex="14" <% if RSY("Status")="done" then %> disabled <% end if %> onclick="return conf()">
  345. <!INPUT TYPE="submit" class=inputBut Name="Submit" Value="ǁ " style="width:100px;" tabIndex="14" <% if RSY("Status")="done" then %> disabled <% end if %>>
  346. </TD>
  347. </TR>
  348. </FORM>
  349. </body>
  350. </html>
  351. <%
  352. end if
  353. response.end
  354. end if
  355. '-----------------------------------------------------------------------------------------------------
  356. '-------------------------------------------------------------------- Inventory Item Pickuplist Submit
  357. '-----------------------------------------------------------------------------------------------------
  358. if request.form("Submit")=" " then
  359. 'response.write "<br>" & replace(request.form,"&","<br>")
  360. 'esponse.end
  361. response.write "<BR><BR><TABLE align=center style='border: solid 2pt black'><TR><TD>"
  362. '===================================================
  363. 'create an pickuplist item
  364. '===================================================
  365. GiveTo = request.form("GiveTo")
  366. CreationDate = shamsiToday()
  367. CreationTime = currentTime10()
  368. CreatedBy = session("id")
  369. Status = "new"
  370. set RST=Conn.Execute ("SELECT RealName FROM Users WHERE (ID = "& GiveTo & ")" )
  371. GiveToRealName = RST("RealName")
  372. mysql = "INSERT INTO InventoryPickuplists (CreationTime, CreationDate, Status, CreatedBy, GiveTo) VALUES (N'"& CreationTime & "', N'"& CreationDate & "', N'new', "& CreatedBy & ", "& GiveTo & ")"
  373. Conn.Execute (mysql)
  374. 'response.write mysql
  375. response.write "<li> : " & CreationDate & " " & CreationTime
  376. response.write "<li> : " & GiveToRealName
  377. response.write "<hr>"
  378. '===================================================
  379. 'create many pickuplist lines for an pickuplist item
  380. '===================================================
  381. set RSX=Conn.Execute ("SELECT * FROM InventoryPickuplists WHERE CreationTime = N'"& CreationTime & "' and CreationDate=N'" & CreationDate & "' and GiveTo=" & GiveTo )
  382. pickupListID = RSX("id")
  383. RSX.close
  384. for i=1 to request.form("ItemID").count
  385. ItemID = request.form("ItemID")(i)
  386. ItemName = request.form("ItemName")(i)
  387. unit = request.form("unit")(i)
  388. qtty = request.form("qtty")(i)
  389. order_ID = request.form("Related_order_ID")(i)
  390. RequestID = request.form("RequestID")(i)
  391. box = request.form("box")(i)
  392. mysql = "INSERT INTO InventoryPickuplistItems (pickupListID, Order_ID, ItemName, ItemID, Qtty, unit, RequestID, CustomerHaveInvItem) VALUES ( "& pickupListID & ", "& order_ID & ", N'"& ItemName & "', "& ItemID & ", "& qtty & ", N'"& unit & "', "& RequestID & ", " & box & ")"
  393. Conn.Execute (mysql)
  394. 'response.write mysql
  395. response.write "<li> " & ItemName & " (" & Qtty & " " & unit & ")"
  396. if box="1" then
  397. response.write "<b> </b>"
  398. end if
  399. next
  400. '===================================================
  401. 'change status of related requests
  402. '===================================================
  403. for i=1 to request.form("RequestID").count
  404. RequestID = request.form("RequestID")(i)
  405. mysql = "UPDATE InventoryItemRequests SET Status = N'pick' WHERE (ID = "& RequestID & ")"
  406. Conn.Execute (mysql)
  407. 'response.write mysql
  408. next
  409. response.write "</TD></TR></TABLE><center>"
  410. %>
  411. <form method=post action="default.asp?PickupListID=<%=pickupListID%>" ><br>
  412. <INPUT TYPE="submit" class=inputBut Name="Submit" Value="ǁ " style="width:100px;" tabIndex="14">
  413. </form>
  414. <%
  415. response.write "<BR><BR> .</center>"
  416. response.redirect "default.asp?show=" & PickupListID
  417. response.end
  418. end if
  419. '-----------------------------------------------------------------------------------------------------
  420. '------------------------------------------------------------- Inventory Item Pickuplist Creation Form
  421. '-----------------------------------------------------------------------------------------------------
  422. if request("Submit")=" " then
  423. if request("itemReq").count < 1 then%>
  424. <br><br>
  425. <%
  426. call showAlert(" ", CONST_MSG_ERROR)
  427. else
  428. for i=1 to request("itemReq").count
  429. myRequestID=request("itemReq")(i)
  430. set RSX=Conn.Execute ("SELECT * from [dbo].[InventoryItemRequests] where id=" & myRequestID)
  431. itemName = RSX("Qtty") & " " & RSX("unit") & " " & RSX("ItemName")
  432. CSR = RSX("CreatedBy")
  433. set RSX=Conn.Execute ("update [dbo].[InventoryItemRequests] set status='del' where id=" & myRequestID)
  434. call InformRequestDenied(itemName, CSR)
  435. response.write "<br><br><center><li> " & itemName & " . </center>"
  436. next
  437. end if
  438. 'response.end
  439. end if
  440. '-----------------------------------------------------------------------------------------------------
  441. '------------------------------------------------------------- Inventory Item Pickuplist Creation Form
  442. '-----------------------------------------------------------------------------------------------------
  443. if request("Submit")=" " or request("Submit")="sodoor" then
  444. if request("itemReq").count < 1 then%>
  445. <div align=center dir=rtl><br><br><br><br><br><br><b>!!<br><h3> </h3></b><br></div>
  446. </body>
  447. </html>
  448. <%
  449. else
  450. %><br>
  451. <form method=post action="default.asp" onsubmit="return confirm(' Ͽ')">
  452. <TABLE dir=rtl align=center width=600>
  453. <TR bgcolor="eeeeee" >
  454. <TD align=center colspan=7><B> </B></TD>
  455. </TR>
  456. <TR bgcolor="eeeeee" >
  457. <TD style="width:160;"> </TD>
  458. <TD style="width:70;"> </TD>
  459. <TD style="width:70;"></TD>
  460. <TD style="width:60;"></TD>
  461. <TD> </TD>
  462. <TD style="width:160;"> </TD>
  463. </TR>
  464. <%
  465. tmpCounter=0
  466. totalQtty=0
  467. for i=1 to request("itemReq").count
  468. myRequestID=request("itemReq")(i)
  469. set RSX=Conn.Execute ("SELECT dbo.InventoryItems.OldItemID AS OldItemID, InventoryItems.name, dbo.InventoryItemRequests.*, dbo.Users.RealName AS RealName FROM dbo.InventoryItems INNER JOIN dbo.InventoryItemRequests ON dbo.InventoryItems.ID = dbo.InventoryItemRequests.ItemID INNER JOIN dbo.Users ON dbo.InventoryItemRequests.CreatedBy = dbo.Users.ID WHERE InventoryItemRequests.ID = "& myRequestID )
  470. totalQtty = totalQtty + RSX("qtty")
  471. tmpCounter = tmpCounter + 1
  472. if tmpCounter mod 2 = 1 then
  473. tmpColor="#FFFFFF"
  474. tmpColor2="#FFFFBB"
  475. Else
  476. tmpColor="#FFFFFF"
  477. tmpColor2="#FFFFBB"
  478. End if
  479. %>
  480. <TR bgcolor="<%=tmpColor%>" title="<%
  481. response.write " : " & RSX("OldItemID") & " - "
  482. Comment = RSX("Comment")
  483. if Comment<>"-" then
  484. response.write ": " & Comment
  485. else
  486. response.write " "
  487. end if
  488. %>">
  489. <TD >
  490. <INPUT TYPE="hidden" name=RequestID value="<%=RSX("id")%>">
  491. <INPUT TYPE="hidden" name=itemID value="<%=RSX("ItemID")%>">
  492. <INPUT TYPE="text" readonly NAME="itemName" value="<%=RSX("Name")%>" style="width:160; border:0">
  493. <br>
  494. <small> : <%=RSX("ItemName")%></small>
  495. </TD>
  496. <TD align=center>
  497. <span dir=ltr><%=shamsidate(RSX("ReqDate"))%></span>
  498. <span dir=ltr><%=DatePart("h",RSX("ReqDate")) &":"& DatePart("n",RSX("ReqDate"))%></span>
  499. </TD>
  500. <TD>
  501. <INPUT TYPE="text" NAME="qtty" value="<%=RSX("qtty")%>" size=7 style="width:45; border:0"> <%=RSX("unit")%>
  502. <INPUT TYPE="hidden" name=unit value="<%=RSX("unit")%>">
  503. </TD>
  504. <TD><%=RSX("RealName")%></TD>
  505. <TD><INPUT TYPE="hidden" name="Related_order_ID" value="<%=RSX("orderID")%>">
  506. <% if RSX("orderID")<>-1 then %>
  507. <a href="../order/order.asp?act=show&id=<%=RSX("orderID")%>">
  508. <%=RSX("orderID")%></a>
  509. <% end if %>
  510. </TD>
  511. <TD>
  512. <%
  513. set RST=Conn.Execute ("SELECT SUM((CONVERT(tinyint, dbo.InventoryLog.IsInput) - .5) * 2 * dbo.InventoryLog.Qtty) AS sumQtty, dbo.Accounts.AccountTitle FROM dbo.Orders INNER JOIN dbo.InventoryLog ON dbo.Orders.Customer = dbo.InventoryLog.owner INNER JOIN dbo.Accounts ON dbo.Orders.Customer = dbo.Accounts.ID WHERE (dbo.InventoryLog.ItemID = " & RSX("ItemID") & " and dbo.InventoryLog.voided=0) GROUP BY dbo.Orders.ID, dbo.Accounts.AccountTitle HAVING (dbo.Orders.ID = " & RSX("orderID") & ")" )
  514. if not RST.EOF then
  515. if clng(RST("sumQtty")) < 0 then
  516. response.write "<b>!</b> . ʿ!"
  517. response.write "<INPUT TYPE='hidden' NAME='maxQtty'> <INPUT TYPE='hidden' NAME='CustomerHaveInvItem' value='-1'><INPUT TYPE='hidden' NAME='box' value='0'>"
  518. elseif clng(RST("sumQtty")) > 0 then
  519. if RSX("CustomerHaveInvItem") then
  520. response.write "<INPUT TYPE='hidden' NAME='maxQtty' value='" & RST("sumQtty") & "'> <INPUT TYPE='checkbox' NAME='CustomerHaveInvItem' checked value='" & RST("sumQtty") & "' onclick='boxChecked(this)'><INPUT TYPE='hidden' NAME='box' value='1'> " & RST("sumQtty") & " " & RSX("unit") & " " & RSX("ItemName") & " " & RST("AccountTitle") & " Ͽ"
  521. else
  522. response.write "<INPUT TYPE='hidden' NAME='maxQtty' value='" & RST("sumQtty") & "'> <INPUT TYPE='checkbox' NAME='CustomerHaveInvItem' value='" & RST("sumQtty") & "' onclick='boxChecked(this)'><INPUT TYPE='hidden' NAME='box' value='0'> " & RST("sumQtty") & " " & RSX("unit") & " " & RSX("ItemName") & " " & RST("AccountTitle") & " Ͽ"
  523. end if
  524. else
  525. response.write "<INPUT TYPE='hidden' NAME='maxQtty' > <INPUT TYPE='hidden' NAME='CustomerHaveInvItem' value='-1'><INPUT TYPE='hidden' NAME='box' value='0'>"
  526. end if
  527. else
  528. response.write "<INPUT TYPE='hidden' NAME='maxQtty' > <INPUT TYPE='hidden' NAME='CustomerHaveInvItem' value='-1'><INPUT TYPE='hidden' NAME='box' value='0'>"
  529. end if
  530. %>
  531. </TD>
  532. </TR>
  533. <%
  534. CreatedBy = RSX("CreatedBy")
  535. LastRSX_typeID = RSX("ItemID")
  536. RSX.moveNext
  537. next
  538. %>
  539. <TR bgcolor="eeeeee" >
  540. <TD align=center colspan=7 height=10></TD>
  541. </TR>
  542. <TR >
  543. <TD colspan=7 align=center><BR> :
  544. <select name="GiveTo" class=inputBut>
  545. <% set RSV=Conn.Execute ("SELECT * FROM Users WHERE Display=1 ORDER BY RealName")
  546. Do while not RSV.eof
  547. %>
  548. <option value="<%=RSV("ID")%>" <%
  549. if RSV("ID")=CreatedBy then
  550. response.write " selected "
  551. end if
  552. %>><%=RSV("RealName")%></option>
  553. <%
  554. RSV.moveNext
  555. Loop
  556. RSV.close
  557. %>
  558. </select><BR><BR>
  559. : <span dir=ltr bgcolor=red><%=shamsitoday()%></span>
  560. <BR><BR>
  561. <INPUT TYPE="submit" class=inputBut Name="Submit" Value=" " style="width:100px;" tabIndex="14" onclick="return conf()">
  562. </TD>
  563. </TR>
  564. </FORM>
  565. </body>
  566. </html>
  567. <%
  568. end if
  569. response.end
  570. end if
  571. if Request("act")="waste" then
  572. if not Auth(5 , "K") then NotAllowdToViewThisPage()
  573. %>
  574. <div class="inPage">
  575. <span> : </span>
  576. <input id="orderID" size="6" class="boot"/>
  577. <div id="message" class="well well-small"><ul></ul></div>
  578. </div>
  579. <div id="orderHeader" class="well"></div>
  580. <div id="confirm">
  581. <h4></h4>
  582. <h5> </h5>
  583. <input name="comment" type="text" size="20"/>
  584. </div>
  585. <script type="text/javascript">
  586. $(document).ready(function(){
  587. $("#confirm").dialog({
  588. autoOpen: false,
  589. buttons: {"":function(){
  590. var thisLI = $("#message ul li input[name=add].btn-danger").closest("li");
  591. $.ajax({
  592. type:"POST",
  593. url:"/service/json_getInventory.asp",
  594. data:{
  595. act:"addWasteRequest",
  596. orderID:$("#orderID").val(),
  597. rowName: thisLI.find("input[name=rowName]").val(),
  598. rowID: thisLI.find("input[name=rowID]").val(),
  599. maxRowID: thisLI.find("input[name=maxRowID]").val(),
  600. groupName: thisLI.find("input[name=groupName]").val(),
  601. qtty: thisLI.find("input[name=qtty]").val(),
  602. reqID: thisLI.find("input[name=reqID]").val(),
  603. comment: $("#confirm input[name=comment]").val()
  604. },
  605. dataType:"json"
  606. }).done(function (data){
  607. $("#message").append(data.status);
  608. $(this).dialog("close");
  609. });
  610. //thisLI.find("input[name=add]").removeClass("btn-danger");
  611. //$("#message ul li input[name=add]").prop("disabled",false);
  612. }},
  613. title: ""
  614. });
  615. $("#orderID").blur(function(){
  616. var orderID = Number($("#orderID").val());
  617. $("#message ul").html("");
  618. if (!isNaN(orderID) && orderID!='') {
  619. loadXMLDoc("/service/xml_getOrderProperty.asp?act=showHead&id=" + orderID, function(orderXML){
  620. var isOrder = $(orderXML).find("status isOrder").text();
  621. var isClosed = $(orderXML).find("status isClosed").text();
  622. var isApproved = $(orderXML).find("status isApproved").text();
  623. var invoiceIssued = $(orderXML).find("status invoiceIssued").text();
  624. var invoiceApproved = $(orderXML).find("status invoiceApproved").text();
  625. var step = $(orderXML).find("status step").text();
  626. var dis="";
  627. if (isOrder=='0'){
  628. $("#message").html(" !!!!!");
  629. dis = "disabled='disabled'";
  630. } else
  631. if (isClosed!='0'){
  632. $("#message").html(" !");
  633. dis = "disabled='disabled'";
  634. } else if (isApproved=='0'){
  635. $("#message").html(" ");
  636. dis = "";
  637. } else if (invoiceIssued!='0') {
  638. $("#message").html("! !");
  639. dis = "disabled='disabled'";
  640. } else if (invoiceApproved!='0'){
  641. $("#message").html(" ");
  642. dis = "disabled='disabled'";
  643. } else {
  644. dis = "";
  645. }
  646. TransformXml(orderXML, "/xsl.<%=version%>/orderShowHeader.xsl", function(result){
  647. $("#orderHeader").html(result);
  648. $('a#customerID').click(function(e){
  649. window.open('../CRM/AccountInfo.asp?act=show&selectedCustomer='+$('a#customerID').attr("myID"), 'showCustomer');
  650. e.preventDefault();
  651. });
  652. });
  653. loadXMLDoc("/service/xml_getOrderProperty.asp?act=editOrder&id=" + orderID, function(propXML){
  654. loadXMLDoc("/service/xml_getOrderProperty.asp?act=stock&id=" + orderID, function(stockXML){
  655. $(propXML).find("group[hasStock=yes]").each(function(i){
  656. var rowName = $(this).closest("rows").attr("name");
  657. var groupName = $(this).attr("name");
  658. var invoiceItem = $(this).attr("item");
  659. var rowID = $(this).closest("row").attr("id");
  660. var req = $(stockXML).find("req/invoiceItem:contains(" + invoiceItem + ")").find("rowID:contains(" + rowID + ")").parent().find("reqStatus:not(:contains('del'))").parent();
  661. if (req.size()!=0){
  662. $("#message ul").append("<li><span name='itemName'>" + $(req).find("ItemName").text() +
  663. "</span><input name='qtty' value='" + $(req).find("Qtty").text() +
  664. "' size='4'/><input name='add' " + dis +
  665. " type='button' class='btn' value=' ' onclick='addRequest(this)'/><span name='unit'>" +
  666. $(req).find("unit").text() + "</span><input type='hidden' name='rowName' value='" +
  667. rowName + "'/><input type='hidden' name='reqID' value='" + $(req).find("ID").text() +
  668. "'/><input type='hidden' name='groupName' value='" + groupName +
  669. "'/><input type='hidden' name='rowID' value='" + rowID +
  670. "'/><input type='hidden' name='maxRowID' value='0'/></li>");
  671. }
  672. });
  673. $("#message ul li").each(function(i){
  674. var rowName = $(this).find("input[name=rowName]").val();
  675. var rowID = parseInt($(this).find("input[name=rowID]").val());
  676. var maxRowID = parseInt($(this).find("input[name=maxRowID]").val());
  677. if (rowID > maxRowID)
  678. $("#message ul li input[name=rowName]").parent().find("input[name=maxRowID]").val(rowID);
  679. });
  680. });
  681. });
  682. });
  683. }
  684. });
  685. });
  686. function addRequest(e){
  687. var thisLI = $(e).closest("li");
  688. $("#confirm h4").html(" " + thisLI.find("span[name=itemName]").text() + " " + thisLI.find("input[name=qtty]").val() + " " + thisLI.find("span[name=unit]").text() + " / Ͽ");
  689. thisLI.find("input[name=add]").addClass("btn-danger");
  690. $("#message ul li input[name=add]").prop("disabled",true);
  691. $("#confirm").dialog("open");
  692. }
  693. </script>
  694. <%
  695. Response.end
  696. end if
  697. '-----------------------------------------------------------------------------------------------------
  698. '--------------------------------------------------------------------- LIST Inventory Item Pickuplists
  699. '-----------------------------------------------------------------------------------------------------
  700. %>
  701. <style>
  702. .changeItem{cursor: pointer;}
  703. td.delBtn {position: relative;}
  704. td.delBtn span {position: absolute;opacity: .6;cursor: pointer;top:2px;left: 20px;font-size: 8px;font-family: tahoma;}
  705. </style>
  706. <script type="text/javascript">
  707. $(document).ready(function(){
  708. $.ajaxSetup({
  709. cache: false
  710. });
  711. $("td.delBtn span").css('display','none');
  712. $("td.delBtn").mouseover(function(event){
  713. $(this).find("span").css("display","block");
  714. });
  715. $("td.delBtn").mouseout(function(event){
  716. $(this).find("span").css("display","none");
  717. });
  718. $("td.delBtn span").click(function(){
  719. var requestID = $(this).closest("td").find("input[name=itemReq]").val();
  720. $("#comfirmDel input").val(requestID);
  721. if (parseInt($(this).closest("td").find("input[name=itemReq]").attr("invoiceitem")) > 0){
  722. $("#comfirmDel h3").html(" ");
  723. } else {
  724. $("#comfirmDel h3").html(" Ͽ");
  725. }
  726. $("#comfirmDel").dialog("open");
  727. });
  728. $('.changeItem').prop('title',' / ');
  729. $('.changeItem').click(function(){
  730. var myRow = $(this).closest("tr");
  731. var itemReq = myRow.find('input[name=itemReq]').val();
  732. var theInvoiceitem = myRow.find('input[name=itemReq]').attr('invoiceitem');
  733. $("#itemReq").val(itemReq);
  734. $.ajax({
  735. type:"POST",
  736. url:"/service/json_getInventory.asp",
  737. data:{act:"itemListFromInvoiceItem",invoiceItem:theInvoiceitem},
  738. dataType:"json"
  739. }).done(function (data){
  740. $("#itemID").children("option").remove();
  741. $.each(data,function(i,e){
  742. $("#itemID").append("<option value='" + e.inventoryItem + "' unit='" + e.unit + "'>" + e.name + "(" + e.unit + ")" + "</option>")
  743. });
  744. });
  745. $('#changeItemDlg').dialog("open");
  746. });
  747. $("#changeItemDlg").dialog({
  748. autoOpen: false,
  749. buttons: {"":function(){
  750. var invID=$("input[name=InvoiceID]").val();
  751. $.ajax({
  752. type:"POST",
  753. url:"/service/json_getInventory.asp",
  754. data:{act: "updateItemRequest" ,id: $("#itemReq").val(), unit: $("#itemID option:selected").attr("unit"), itemID:$("#itemID option:selected").val()},
  755. dataType:"json"
  756. }).done(function (data){
  757. if (data.status=="ok")
  758. $("[name=itemReq][value=" + $("#itemReq").val() + "]").prop("disabled",false);
  759. //location.reload();
  760. });
  761. $(this).dialog("close");
  762. }},
  763. title: " "
  764. });
  765. $("#comfirmDel").dialog({
  766. autoOpen: false,
  767. buttons: {"":function(){
  768. $.ajax({
  769. type:"POST",
  770. url:"/service/json_getInventory.asp",
  771. data:{act:"delInvRequest",id:$("#comfirmDel input").val()},
  772. dataType:"json"
  773. }).done(function(data){
  774. if (data.status=="ok")
  775. $("[name=itemReq][value=" + $("#comfirmDel input").val() + "]").closest("tr").remove();
  776. });
  777. $(this).dialog("close");
  778. }},
  779. title: " "
  780. });
  781. });
  782. </script>
  783. <div id='changeItemDlg'>
  784. <input type="hidden" id="itemReq"/>
  785. <select id='itemID'></select>
  786. </div>
  787. <div id='comfirmDel'>
  788. <h3></h3>
  789. <input type="hidden" name="reqID"/>
  790. </div>
  791. <BR><BR>
  792. <br>
  793. <FORM METHOD=POST ACTION="default.asp">
  794. <%
  795. sortBy=request("s")
  796. if sortBy="5" then
  797. sB="orderID"
  798. elseif sortBy="2" then
  799. sB="ReqDate"
  800. elseif sortBy="3" then
  801. sB="Qtty"
  802. elseif sortBy="4" then
  803. sB="CreatedBy"
  804. else
  805. sB="ItemName"
  806. end if
  807. if Auth(5 , 9) then
  808. set RSS=Conn.Execute ("SELECT dbo.InventoryItemRequests.*, dbo.Users.RealName AS RealName FROM dbo.InventoryItemRequests INNER JOIN dbo.Users ON dbo.InventoryItemRequests.CreatedBy = dbo.Users.ID WHERE (dbo.InventoryItemRequests.Status = 'new') AND (dbo.InventoryItemRequests.OrderID <> - 1) order by " & sB)
  809. if not RSS.eof then
  810. %>
  811. <TABLE dir=rtl align=center width=600>
  812. <TR bgcolor="eeeeee" height=20>
  813. <TD align=center colspan=6><INPUT TYPE="hidden" name=color1 value="#FFFFFF"><INPUT TYPE="hidden" name=color2 value="#FFFFBB"><B> </B></TD>
  814. </TR>
  815. <TR bgcolor="eeeeee" >
  816. <TD><INPUT TYPE="checkbox" NAME="" disabled><INPUT TYPE="hidden" name=color1 value="#FFFFFF"><INPUT TYPE="hidden" name=color2 value="#FFFFBB"</TD>
  817. <TD><A HREF="default.asp?s=1"><SMALL> </SMALL></A></TD>
  818. <TD><A HREF="default.asp?s=2"><SMALL> </SMALL></A></TD>
  819. <TD><A HREF="default.asp?s=3"><SMALL></SMALL></A></TD>
  820. <TD><A HREF="default.asp?s=4"><SMALL> </SMALL></A></TD>
  821. <TD><A HREF="default.asp?s=5"><SMALL> </SMALL></A></TD>
  822. </TR>
  823. <%
  824. tmpCounter=0
  825. Do while not RSS.eof
  826. tmpCounter = tmpCounter + 1
  827. if tmpCounter mod 2 = 1 then
  828. tmpColor="#FFFFFF"
  829. tmpColor2="#FFFFBB"
  830. Else
  831. tmpColor="#FFFFFF"
  832. tmpColor2="#FFFFBB"
  833. 'tmpColor="#DDDDDD"
  834. 'tmpColor2="#EEEEBB"
  835. End if
  836. %>
  837. <TR bgcolor="<%=tmpColor%>" >
  838. <TD class="delBtn">
  839. <INPUT TYPE="hidden" name=color1 value="<%=tmpColor%>"/>
  840. <INPUT TYPE="hidden" name=color2 value="<%=tmpColor2%>"/>
  841. <INPUT TYPE="checkbox" onclick="setPrice(this)" <%if IsNull(rss("itemID")) then response.write "disabled='disabled'"%> invoiceItem="<%=rss("invoiceItem")%>" NAME="itemReq" VALUE="<%=RSS("id")%>"/>
  842. <span class="label label-important">X</span>
  843. </TD>
  844. <TD <%if not IsNull(rss("invoiceItem")) then Response.write " class='changeItem'"%>><%=RSS("ItemName")%></TD>
  845. <TD><%=shamsidate(RSS("ReqDate"))%></small></TD>
  846. <TD><%=RSS("Qtty")%> <%=rss("unit")%></TD>
  847. <TD><%=RSS("RealName")%></TD>
  848. <TD><a href="../order/order.asp?act=show&id=<%=RSS("orderID")%>"><%=RSS("orderID")%></a>
  849. <% if RSS("CustomerHaveInvItem") then
  850. response.write " <b> () </b>"
  851. end if
  852. %>
  853. </small></TD>
  854. </TR>
  855. <!--TR bgcolor="<%=tmpColor%>" >
  856. <TD></TD>
  857. <TD colspan=5>: <%=RSS("comment")%></small></TD>
  858. </TR-->
  859. <%
  860. RSS.moveNext
  861. Loop
  862. %>
  863. <TR >
  864. <TD align=center colspan=6 height=50><INPUT TYPE="hidden" name=color1 value=""><INPUT TYPE="hidden" name=color2 value="">
  865. <center><INPUT TYPE="submit" Name="Submit" Value=" " style="width:150px;" tabIndex="14" class="btn" onclick="return confirm(' Ͽ')"> <INPUT TYPE="submit" Name="Submit" Value=" " style="width:150px;" class="btn" tabIndex="14">
  866. </center> <BR>
  867. </TD>
  868. </TR>
  869. </TABLE>
  870. <%
  871. end if
  872. end if
  873. if Auth(5 , 1) then
  874. set RSS=Conn.Execute ("SELECT dbo.InventoryItemRequests.*, dbo.Users.RealName AS RealName FROM dbo.InventoryItemRequests INNER JOIN dbo.Users ON dbo.InventoryItemRequests.CreatedBy = dbo.Users.ID WHERE (dbo.InventoryItemRequests.Status = 'new') AND (dbo.InventoryItemRequests.OrderID = - 1) order by " & sB)
  875. if not RSS.eof then
  876. %>
  877. <TABLE dir=rtl align=center width=600>
  878. <TR bgcolor="eeeeee" >
  879. <TD align=center colspan=6 height=20><INPUT TYPE="hidden" name=color1 value="#FFFFFF"><INPUT TYPE="hidden" name=color2 value="#FFFFBB"><B> </B></TD>
  880. </TR>
  881. <TR bgcolor="eeeeee" >
  882. <TD><INPUT TYPE="hidden" name=color1 value="#FFFFFF"><INPUT TYPE="hidden" name=color2 value="#FFFFBB"><INPUT TYPE="checkbox" NAME="" disabled></TD>
  883. <TD><A HREF="default.asp?s=1"><SMALL> </SMALL></A></TD>
  884. <TD><A HREF="default.asp?s=2"><SMALL> </SMALL></A></TD>
  885. <TD><A HREF="default.asp?s=3"><SMALL></SMALL></A></TD>
  886. <TD><A HREF="default.asp?s=4"><SMALL> </SMALL></A></TD>
  887. </TR>
  888. <%
  889. tmpCounter = tmpCounter + 1
  890. Do while not RSS.eof
  891. tmpCounter = tmpCounter + 1
  892. if tmpCounter mod 2 = 1 then
  893. tmpColor="#FFFFFF"
  894. tmpColor2="#FFFFBB"
  895. Else
  896. tmpColor="#FFFFFF"
  897. tmpColor2="#FFFFBB"
  898. 'tmpColor="#DDDDDD"
  899. 'tmpColor2="#EEEEBB"
  900. End if
  901. %>
  902. <TR bgcolor="<%=tmpColor%>" >
  903. <TD><INPUT TYPE="hidden" name=color1 value="<%=tmpColor%>"><INPUT TYPE="hidden" name=color2 value="<%=tmpColor2%>"><INPUT TYPE="checkbox" onclick="setPrice(this)" NAME="itemReq" VALUE="<%=RSS("id")%>"></TD>
  904. <TD><%=RSS("ItemName")%></TD>
  905. <TD><%=shamsidate(RSS("ReqDate"))%></small></TD>
  906. <TD><%=RSS("Qtty")%> <%=rss("unit")%></TD>
  907. <TD><%=RSS("RealName")%></TD>
  908. </TR>
  909. <!--TR bgcolor="<%=tmpColor%>" >
  910. <TD></TD>
  911. <TD colspan=5>: <%=RSS("comment")%></small></TD>
  912. </TR-->
  913. <%
  914. RSS.moveNext
  915. Loop
  916. %>
  917. </TABLE><br>
  918. <center>
  919. <INPUT TYPE="submit" Name="Submit" Value=" " style="width:150px;" tabIndex="14" class="btn" onclick="return confirm(' Ͽ')"/>
  920. <INPUT TYPE="submit" Name="Submit" Value=" " style="width:150px;" tabIndex="14" class="btn"/>
  921. <a href="?act=waste" class="btn" style="width:150px;"> ѐ</a>
  922. </center>
  923. </form>
  924. <% end if %>
  925. <BR><BR>
  926. <TABLE align=center width=50%>
  927. <TR>
  928. <TD align=center style="border:solid 1pt black">
  929. <BR>
  930. <FORM METHOD=POST ACTION="default.asp">
  931. <B> <BR></B><BR>
  932. : <INPUT TYPE="text" NAME="invoice_id" dir=ltr ><BR><BR> <INPUT TYPE="submit" name="submit" value=" ">
  933. <BR>
  934. </FORM>
  935. </TD>
  936. </TR>
  937. </TABLE><BR>
  938. <%
  939. end if
  940. %>
  941. <SCRIPT LANGUAGE="JavaScript">
  942. function setPrice(obj)
  943. {
  944. theTR = obj.parentNode.parentNode
  945. ii = theTR.rowIndex -1
  946. if(obj.checked)
  947. {
  948. //alert(ii)
  949. theTR.setAttribute("bgColor",document.getElementsByName('color2')[ii].value)
  950. }
  951. else
  952. {
  953. theTR.setAttribute("bgColor",document.getElementsByName('color1')[ii].value)
  954. }
  955. }
  956. </SCRIPT>
  957. <!--#include file="tah.asp" -->