/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
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
- <!--#include file="../config.asp" -->
- <%
- response.buffer= true
- Response.CharSet = "windows-1256"
-
- if not Auth("C" , 7) then NotAllowdToViewThisPage()
-
- if request("id")<>"" then
- Invoice = cdbl(request("id"))
- %>
- <center>
- <TABLE border="1" cellspacing="0" cellpadding="2" dir="RTL" borderColor="#888855" style="border:dashed 2px #888888;font-family:tahoma;font-size:8pt;">
- <TR bgcolor="#EEFFCC">
- <TD width="65">ÓÝÇÑÔ ÎÑíÏ</TD>
- <TD width="60">ÊÇÑíÎ</TD>
- <TD width="155">äæÚ ÎÏãÇÊ</TD>
- <TD width="250">äÇã ÔÑßÊ</TD>
- <TD width="70">ÞíãÊ</TD>
- </TR>
- <%
- 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 & ")"
- set RS1=Conn.Execute (mySQL)
- if not RS1.eof then
- while not RS1.eof
- tmpCounter=0
- if isnull(RS1("VoucherId")) then
- priceText = "<FONT COLOR=""red"">ÝÇß澄 äÔÏå</FONT>"
- else
- priceText = "<a target=""_blank"" title=""ÝÇß澄 ÎÑíÏ ãÑÈæØå"" href=""../AP/AccountReport.asp?act=showVoucher&voucher=" & RS1("VoucherID") & """>" & Separate(RS1("price")) & "</a>"
- end if
- %>
- <TR bgcolor="#FFFFFF">
- <TD><a target="_blank" title="ÏíÏä ÓÝÇÑÔ ÎÑíÏ ãÑÈæØå" href="../purchase/outServiceTrace.asp?od=<%=RS1("PurchaseOrderID")%>"><%=RS1("PurchaseOrderID")%></a></TD>
- <TD DIR="LTR"><%=RS1("OrdDate")%></TD>
- <TD><%=RS1("TypeName")%></TD>
- <TD><a target="_blank" title="ãÔÎÕÇÊ ÍÓÇÈ" href="../CRM/AccountInfo.asp?act=show&tab=3&selectedCustomer=<%=RS1("Vendor_ID")%>"><%=RS1("AccountTitle")%></a></TD>
- <TD><%=priceText%> </TD>
- </TR>
-
- <%
- RS1.moveNext
- wend
- else
- %> <TR>
- <TD colspan="10" align="center" style="font-size:9pt;color:#888888">ÇØáÇÚÇÊ ÎÑíÏ ÈÑÇí Çíä ÝÇßÊæÑ ÌæÏ äÏÇÑÏ</TD>
- </TR>
- <%
- end if
- RS1.close
- %>
- <TR bgcolor="#CCEEFF">
- <TD>ÎÑæÌ ÇÒ ÇäÈÇÑ</TD>
- <TD> </TD>
- <TD colspan="2">äÇã ßÇáÇ</TD>
- <TD> </TD>
- </TR>
- <%
- 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 & ")"
-
- set RS1=Conn.Execute (mySQL)
- if not RS1.eof then
- while not RS1.eof
- tmpCounter=0
- if isnull(RS1("UnitPrice")) then
- priceText = "<FONT COLOR=""red"">ÈÏæä ÞíãÊ</FONT>"
- else
- priceText = "<a target=""_blank"" title=""ãÔÎÕÇÊ ßÇáÇí ÇäÈÇÑ"" href=""../inventory/editItem.asp?itemDetail=" & RS1("ItemID") & """>" & Separate(cdbl(RS1("UnitPrice")) * cdbl(RS1("Qtty"))) & "</a>"
- end if
- %>
- <TR bgcolor="#FFFFFF">
- <TD><a target="_blank" title="ÎÑæÌ ÇÒ ÇäÈÇÑ ãÑÈæØå" href="../inventory/default.asp?show=<%=RS1("PickupListID")%>"><%=RS1("PickupListID")%></a></TD>
- <TD DIR="LTR"><%=RS1("CreationDate")%></TD>
- <TD colspan="2"><a target="_blank" title="ãÔÎÕÇÊ ßÇáÇí ÇäÈÇÑ" href="../inventory/editItem.asp?itemDetail=<%=RS1("ItemID")%>"><%=RS1("Qtty") & " " & RS1("Unit") & " " & RS1("ItemName")%></a></TD>
- <TD><%=priceText%> </TD>
- </TR>
-
- <%
- RS1.moveNext
- wend
- else
- %> <TR>
- <TD colspan="10" align="center" style="font-size:9pt;color:#888888">ÇØáÇÚÇÊ ÇäÈÇÑ ÈÑÇí Çíä ÝÇßÊæÑ ÌæÏ äÏÇÑÏ</TD>
- </TR>
- <%
- end if
- RS1.close
- %>
- </TABLE>
- </center>
- <%
- end if
-
- Conn.Close
- %>