/beta/CRM/include_CRM_Inv.asp

http://github.com/khaneh/Orders · ASP · 212 lines · 199 code · 13 blank · 0 comment · 33 complexity · eca2c8d1df914a73510d480d03a87f2f MD5 · raw file

  1. <Tr><Td colspan="3" height="10px">
  2. <STYLE>
  3. .GetCustTbl {font-family:tahoma; background-color: #DDDDDD; width:630; direction: RTL; }
  4. .GetCustTbl td {padding:2; font-size: 9pt; height:25;}
  5. .GetCustInp { font-family:tahoma; font-size: 9pt;}
  6. .CusTableHeader {background-color: #33AACC; text-align: center; font-weight:bold;}
  7. .CustContactTable {font-family:tahoma; width:100%; border:1 solid black; direction: RTL; background-color:#CCCCCC;}
  8. .CustContactTable td {padding:5;}
  9. .CustTable {font-family:tahoma; width:90%; border:1 solid black; direction: RTL; background-color:black;}
  10. .CustTable td {padding:5;}
  11. .CustTable a {text-decoration:none;color:#000088}
  12. .CustTable a:hover {text-decoration:underline;}
  13. .CusTD1 {background-color: #CCCC66; text-align: left; font-weight:bold;}
  14. .CusTD2 {background-color: #DDDDDD; direction: LTR; text-align: right; font-size:9pt;}
  15. .CusTD3 {background-color: #DDDDDD; direction: LTR; text-align: center; font-size:9pt;}
  16. .CusTD4 {background-color: #CCCC66; direction: LTR; text-align: center; font-size:9pt;}
  17. </STYLE>
  18. &nbsp;</Td></Tr>
  19. <Tr>
  20. <Td colspan="3" valign="top" align="center" width=500>
  21. <BR><BR>
  22. </Td>
  23. </Tr>
  24. <Tr>
  25. <Td valign="top" align="left" height=300>
  26. </Td>
  27. <Td valign="top" align="center">
  28. <table class="CustTable" cellspacing='1'>
  29. <tr>
  30. <td colspan="4" class="CusTableHeader"> </td>
  31. </tr>
  32. <tr>
  33. <TD class="CusTableHeader"><SMALL> </SMALL></A></TD>
  34. <TD class="CusTableHeader"><SMALL> </SMALL></A></TD>
  35. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  36. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  37. </tr>
  38. <%
  39. mySQL="SELECT SUM(DERIVEDTBL.sumQtty) AS sumQttys, DERIVEDTBL.AccountID, Accounts.AccountTitle, InventoryItems.Name, InventoryItems.OldItemID, InventoryItems.Unit FROM (SELECT SUM((CONVERT(tinyint, dbo.InventoryLog.IsInput) - .5) * 2 * dbo.InventoryLog.Qtty) AS sumQtty, dbo.InventoryLog.owner AS AccountID, InventoryLog.itemid AS invid FROM dbo.InventoryLog where dbo.InventoryLog.voided=0 GROUP BY dbo.InventoryLog.owner, InventoryLog.itemid) DERIVEDTBL INNER JOIN Accounts ON DERIVEDTBL.AccountID = Accounts.ID INNER JOIN InventoryItems ON DERIVEDTBL.invid = InventoryItems.ID GROUP BY DERIVEDTBL.AccountID, Accounts.AccountTitle, InventoryItems.Name, InventoryItems.OldItemID, InventoryItems.Unit having SUM(DERIVEDTBL.sumQtty) <> 0 and DERIVEDTBL.AccountID="& cusID & ""
  40. Set RSS = conn.execute(mySQL)
  41. if RSS.eof then
  42. %>
  43. <tr>
  44. <td class="CusTD3" colspan=4></td>
  45. </tr>
  46. <%
  47. end if
  48. tmpCounter=0
  49. while not RSS.eof
  50. tmpCounter=tmpCounter+1
  51. %>
  52. <tr class="<%if (tmpCounter MOD 2) = 1 then response.write "CusTD3" else response.write "CusTD4" %>">
  53. <TD><%=RSS("name")%></TD>
  54. <TD align=center dir=ltr><%=RSS("OldItemID")%></TD>
  55. <TD align=center dir=ltr><%=RSS("sumQttys")%></TD>
  56. <TD align=center><%=RSS("Unit")%></TD>
  57. </tr>
  58. <%
  59. RSS.moveNext
  60. wend
  61. %>
  62. </table><BR><BR><BR>
  63. <table class="CustTable" cellspacing='1'>
  64. <tr>
  65. <td colspan="8" class="CusTableHeader"> </td>
  66. </tr>
  67. <tr>
  68. <TD class="CusTableHeader"><SMALL> </SMALL></A></TD>
  69. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  70. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  71. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  72. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  73. <TD class="CusTableHeader" align=center><SMALL> </SMALL></A></TD>
  74. <TD class="CusTableHeader"><SMALL> </SMALL></A></TD>
  75. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  76. </tr>
  77. <%
  78. mySQL="SELECT InventoryLog.type, InventoryLog.Voided, InventoryLog.VoidedBy, InventoryLog.comments, InventoryLog.VoidedDate, InventoryLog.IsInput, InventoryItems.Unit, InventoryItems.Name, InventoryItems.OldItemID, InventoryLog.logDate, InventoryLog.Qtty, InventoryLog.RelatedID, InventoryLog.ItemID, InventoryLog.ID, 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.owner = "& cusID & ") ORDER BY InventoryLog.ID DESC"
  79. Set RSS = conn.execute(mySQL)
  80. if RSS.eof then
  81. %>
  82. <tr>
  83. <td class="CusTD3" colspan="8"></td>
  84. </tr>
  85. <%
  86. end if
  87. tmpCounter=0
  88. while not RSS.eof
  89. tmpCounter=tmpCounter+1
  90. %>
  91. <tr class="<%if (tmpCounter MOD 2) = 1 then response.write "CusTD3" else response.write "CusTD4" %>" <% if RSS("voided") then%> disabled title=" <%=RSS("VoidedDate")%>"<% end if %>>
  92. <TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("name")%></span></TD>
  93. <TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("OldItemID")%></span></TD>
  94. <TD align=right dir=ltr><span style="font-size:10pt"><% if RSS("IsInput") then %><%=RSS("Qtty")%><% end if %></span></TD>
  95. <TD align=right dir=ltr><span style="font-size:10pt"><% if not RSS("IsInput") then %><%=RSS("Qtty")%><% end if %></span></TD>
  96. <TD align=right dir=ltr><% if RSS("voided") then%><div style="position:absolute;width:520;"><hr style="color:red;"></div><% end if %><%=RSS("Unit")%></TD>
  97. <TD dir=ltr align=center><%=RSS("logDate")%></span></TD>
  98. <TD><% if RSS("type")= "2" then
  99. response.write "<font color=red><b> </b></font>"
  100. elseif RSS("type")= "3" then
  101. response.write "<font color=green><b></b></font>"
  102. elseif RSS("type")= "4" then
  103. response.write "<font color=blue><b> </b></font>"
  104. elseif RSS("type")= "5" then
  105. response.write "<font color=orang><b></b></font>"
  106. elseif RSS("type")= "6" then
  107. response.write "<font color=#6699CC><b> </b></font>"
  108. elseif RSS("type")= "7" then
  109. response.write "<font color=#FF9966><b> </b></font>"
  110. elseif RSS("RelatedID")= "-1" then %> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  111. <% else
  112. if RSS("IsInput") then
  113. %> : <A HREF="../purchase/outServiceTrace.asp?od=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A><%
  114. else
  115. %><A HREF="../inventory/default.asp?ed=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A><%
  116. end if
  117. end if %>
  118. <% if trim(RSS("comments"))<> "-" and RSS("comments")<> "" then
  119. response.write " <br><br><B>:</B> " & RSS("comments")
  120. end if %>
  121. </TD>
  122. <TD><%=RSS("RealName")%></TD>
  123. </tr>
  124. <%
  125. RSS.moveNext
  126. wend
  127. %>
  128. </table><BR><BR>
  129. <table class="CustTable" cellspacing='1'>
  130. <tr>
  131. <td colspan="8" class="CusTableHeader"> ԝ </td>
  132. </tr>
  133. <tr>
  134. <TD class="CusTableHeader"><SMALL> </SMALL></A></TD>
  135. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  136. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  137. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  138. <TD class="CusTableHeader" align=center><SMALL> </SMALL></A></TD>
  139. <TD class="CusTableHeader"><SMALL> </SMALL></A></TD>
  140. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  141. <TD class="CusTableHeader"><SMALL></SMALL></A></TD>
  142. </tr>
  143. <%
  144. mySQL="select InventoryLog.type, InventoryLog.Voided, InventoryLog.VoidedBy, InventoryLog.comments, InventoryLog.VoidedDate, InventoryLog.IsInput, InventoryItems.Unit, InventoryItems.Name, InventoryItems.OldItemID, InventoryLog.logDate, InventoryLog.Qtty, InventoryLog.RelatedID, InventoryLog.ItemID, InventoryLog.ID, InventoryLog.CreatedBy, InventoryLog.owner, Users.RealName,Orders.id as ord FROM InventoryItemRequests inner join Orders on Orders.id = InventoryItemRequests.OrderID inner join InventoryPickuplistItems on InventoryItemRequests.ID=InventoryPickuplistItems.RequestID inner join InventoryLog on InventoryPickuplistItems.pickupListID=InventoryLog.RelatedID INNER JOIN InventoryItems ON InventoryLog.ItemID = InventoryItems.ID INNER JOIN Users ON InventoryLog.CreatedBy = Users.ID where orders.Customer=" & cusID & " and InventoryLog.owner = -1 and InventoryLog.isInput=0 ORDER BY InventoryLog.ID DESC"
  145. Set RSS = conn.execute(mySQL)
  146. if RSS.eof then
  147. %>
  148. <tr>
  149. <td class="CusTD3" colspan="8"></td>
  150. </tr>
  151. <%
  152. end if
  153. tmpCounter=0
  154. while not RSS.eof
  155. tmpCounter=tmpCounter+1
  156. %>
  157. <tr class="<%if (tmpCounter MOD 2) = 1 then response.write "CusTD3" else response.write "CusTD4" %>" <% if RSS("voided") then%> disabled title=" <%=RSS("VoidedDate")%>"<% end if %>>
  158. <TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("name")%></span></TD>
  159. <TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("OldItemID")%></span></TD>
  160. <TD align=right dir=ltr><span style="font-size:10pt"></span><%=RSS("Qtty")%></span></TD>
  161. <TD align=right dir=ltr><% if RSS("voided") then%><div style="position:absolute;width:520;"><hr style="color:red;"></div><% end if %><%=RSS("Unit")%></TD>
  162. <TD dir=ltr align=center><%=RSS("logDate")%></span></TD>
  163. <TD><% if RSS("type")= "2" then
  164. response.write "<font color=red><b> </b></font>"
  165. elseif RSS("type")= "3" then
  166. response.write "<font color=green><b></b></font>"
  167. elseif RSS("type")= "4" then
  168. response.write "<font color=blue><b> </b></font>"
  169. elseif RSS("type")= "5" then
  170. response.write "<font color=orang><b></b></font>"
  171. elseif RSS("type")= "6" then
  172. response.write "<font color=#6699CC><b> </b></font>"
  173. elseif RSS("type")= "7" then
  174. response.write "<font color=#FF9966><b> </b></font>"
  175. elseif RSS("RelatedID")= "-1" then %> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  176. <% else
  177. if RSS("IsInput") then
  178. %> : <A HREF="../purchase/outServiceTrace.asp?od=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A><%
  179. else
  180. %><A HREF="../inventory/default.asp?ed=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A><%
  181. end if
  182. end if %>
  183. <% if trim(RSS("comments"))<> "-" and RSS("comments")<> "" then
  184. response.write " <br><br><B>:</B> " & RSS("comments")
  185. end if %>
  186. </TD>
  187. <TD><%=RSS("RealName")%></TD>
  188. <TD><a href="../order/TraceOrder.asp?act=show&order=<%=RSS("ord")%>"><%=RSS("ord")%></a></TD>
  189. </tr>
  190. <%
  191. RSS.moveNext
  192. wend
  193. %>
  194. </table><BR><BR>
  195. </Td>
  196. <Td valign="top" align="center">
  197. &nbsp;
  198. </Td>
  199. </Tr>