/beta/Inquiry/Rep_COGS_mini.asp

http://github.com/khaneh/Orders · ASP · 95 lines · 89 code · 6 blank · 0 comment · 10 complexity · f9434c0c68274c6934daea10d40d8351 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
  2. <!--#include file="../config.asp" -->
  3. <%
  4. response.buffer= true
  5. Response.CharSet = "windows-1256"
  6. if not Auth("C" , 7) then NotAllowdToViewThisPage()
  7. if request("id")<>"" then
  8. Invoice = cdbl(request("id"))
  9. %>
  10. <center>
  11. <TABLE border="1" cellspacing="0" cellpadding="2" dir="RTL" borderColor="#888855" style="border:dashed 2px #888888;font-family:tahoma;font-size:8pt;">
  12. <TR bgcolor="#EEFFCC">
  13. <TD width="65">ÓÝÇÑÔ ÎÑíÏ</TD>
  14. <TD width="60">ÊÇÑíÎ</TD>
  15. <TD width="155">äæÚ ÎÏãÇÊ</TD>
  16. <TD width="250">äÇã ÔÑßÊ</TD>
  17. <TD width="70">ÞíãÊ</TD>
  18. </TR>
  19. <%
  20. mySQL="SELECT InvoiceOrderRelations.Invoice, PurchaseOrders.ID AS PurchaseOrderID, PurchaseOrders.TypeName, PurchaseOrders.OrdDate, PurchaseOrders.Vendor_ID, Accounts.AccountTitle, VoucherLines.price, Vouchers.Id AS VoucherID FROM InvoiceOrderRelations INNER JOIN PurchaseOrders INNER JOIN PurchaseRequestOrderRelations INNER JOIN PurchaseRequests ON PurchaseRequestOrderRelations.Req_ID = PurchaseRequests.ID ON PurchaseOrders.ID = PurchaseRequestOrderRelations.Ord_ID ON InvoiceOrderRelations.[Order] = PurchaseRequests.Order_ID LEFT OUTER JOIN Accounts ON PurchaseOrders.Vendor_ID = Accounts.ID LEFT OUTER JOIN Vouchers INNER JOIN VoucherLines ON Vouchers.id = VoucherLines.Voucher_ID ON Vouchers.Voided = 0 AND PurchaseOrders.ID = VoucherLines.RelatedPurchaseOrderID WHERE (PurchaseRequests.Status <> N'del') AND (PurchaseOrders.Status <> N'CANCEL') AND (InvoiceOrderRelations.Invoice = " & Invoice & ")"
  21. set RS1=Conn.Execute (mySQL)
  22. if not RS1.eof then
  23. while not RS1.eof
  24. tmpCounter=0
  25. if isnull(RS1("VoucherId")) then
  26. priceText = "<FONT COLOR=""red"">ÝÇß澄 äÔÏå</FONT>"
  27. else
  28. priceText = "<a target=""_blank"" title=""ÝÇß澄 ÎÑíÏ ãÑÈæØå"" href=""../AP/AccountReport.asp?act=showVoucher&voucher=" & RS1("VoucherID") & """>" & Separate(RS1("price")) & "</a>"
  29. end if
  30. %>
  31. <TR bgcolor="#FFFFFF">
  32. <TD><a target="_blank" title="ÏíÏä ÓÝÇÑÔ ÎÑíÏ ãÑÈæØå" href="../purchase/outServiceTrace.asp?od=<%=RS1("PurchaseOrderID")%>"><%=RS1("PurchaseOrderID")%></a></TD>
  33. <TD DIR="LTR"><%=RS1("OrdDate")%></TD>
  34. <TD><%=RS1("TypeName")%></TD>
  35. <TD><a target="_blank" title="ãÔÎÕÇÊ ÍÓÇÈ" href="../CRM/AccountInfo.asp?act=show&tab=3&selectedCustomer=<%=RS1("Vendor_ID")%>"><%=RS1("AccountTitle")%></a></TD>
  36. <TD><%=priceText%>&nbsp;</TD>
  37. </TR>
  38. <%
  39. RS1.moveNext
  40. wend
  41. else
  42. %> <TR>
  43. <TD colspan="10" align="center" style="font-size:9pt;color:#888888">ÇØáÇÚÇÊ ÎÑíÏ ÈÑÇí Çíä ÝÇßÊæÑ ÌæÏ äÏÇÑÏ</TD>
  44. </TR>
  45. <%
  46. end if
  47. RS1.close
  48. %>
  49. <TR bgcolor="#CCEEFF">
  50. <TD>ÎÑæÌ ÇÒ ÇäÈÇÑ</TD>
  51. <TD>&nbsp;</TD>
  52. <TD colspan="2">äÇã ßÇáÇ</TD>
  53. <TD>&nbsp;</TD>
  54. </TR>
  55. <%
  56. mySQL="SELECT InvoiceOrderRelations.Invoice, InventoryPickuplists.id AS PickupListID, InventoryPickuplists.CreationDate, InventoryPickuplistItems.ItemID, InventoryPickuplistItems.ItemName, InventoryPickuplistItems.Qtty, InventoryPickuplistItems.unit, InventoryItemsUnitPrice.UnitPrice FROM InventoryPickuplistItems INNER JOIN InventoryPickuplists ON InventoryPickuplistItems.pickupListID = InventoryPickuplists.id INNER JOIN InvoiceOrderRelations ON InventoryPickuplistItems.Order_ID = InvoiceOrderRelations.[Order] LEFT OUTER JOIN InventoryItemsUnitPrice ON InventoryPickuplists.CreationDate >= InventoryItemsUnitPrice.StartDate AND InventoryPickuplists.CreationDate <= InventoryItemsUnitPrice.EndDate AND InventoryPickuplistItems.ItemID = InventoryItemsUnitPrice.InventoryItem WHERE (InventoryPickuplistItems.CustomerHaveInvItem = 0) AND (NOT (InventoryPickuplists.Status = N'del')) AND (InvoiceOrderRelations.Invoice = " & Invoice & ")"
  57. set RS1=Conn.Execute (mySQL)
  58. if not RS1.eof then
  59. while not RS1.eof
  60. tmpCounter=0
  61. if isnull(RS1("UnitPrice")) then
  62. priceText = "<FONT COLOR=""red"">ÈÏæä ÞíãÊ</FONT>"
  63. else
  64. priceText = "<a target=""_blank"" title=""ãÔÎÕÇÊ ßÇáÇí ÇäÈÇÑ"" href=""../inventory/editItem.asp?itemDetail=" & RS1("ItemID") & """>" & Separate(cdbl(RS1("UnitPrice")) * cdbl(RS1("Qtty"))) & "</a>"
  65. end if
  66. %>
  67. <TR bgcolor="#FFFFFF">
  68. <TD><a target="_blank" title="ÎÑæÌ ÇÒ ÇäÈÇÑ ãÑÈæØå" href="../inventory/default.asp?show=<%=RS1("PickupListID")%>"><%=RS1("PickupListID")%></a></TD>
  69. <TD DIR="LTR"><%=RS1("CreationDate")%></TD>
  70. <TD colspan="2"><a target="_blank" title="ãÔÎÕÇÊ ßÇáÇí ÇäÈÇÑ" href="../inventory/editItem.asp?itemDetail=<%=RS1("ItemID")%>"><%=RS1("Qtty") & " " & RS1("Unit") & " " & RS1("ItemName")%></a></TD>
  71. <TD><%=priceText%>&nbsp;</TD>
  72. </TR>
  73. <%
  74. RS1.moveNext
  75. wend
  76. else
  77. %> <TR>
  78. <TD colspan="10" align="center" style="font-size:9pt;color:#888888">ÇØáÇÚÇÊ ÇäÈÇÑ ÈÑÇí Çíä ÝÇßÊæÑ ÌæÏ äÏÇÑÏ</TD>
  79. </TR>
  80. <%
  81. end if
  82. RS1.close
  83. %>
  84. </TABLE>
  85. </center>
  86. <%
  87. end if
  88. Conn.Close
  89. %>