PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/beta/AR/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<%
 4response.buffer= true
 5Response.CharSet = "windows-1256" 
 6
 7if not Auth("C" , 7) then NotAllowdToViewThisPage()
 8
 9if request("id")<>"" then
10	Invoice = cdbl(request("id"))
11%>
12<center>
13<TABLE border="1" cellspacing="0" cellpadding="2" dir="RTL" borderColor="#888855" style="border:dashed 2px #888888;font-family:tahoma;font-size:8pt;">
14<TR bgcolor="#EEFFCC">
15	<TD width="65">����� ����</TD>
16	<TD width="60">�����</TD>
17	<TD width="155">��� �����</TD>
18	<TD width="250">��� ����</TD>
19	<TD width="70">����</TD>
20</TR>
21<%	
22mySQL="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 & ")"
23set RS1=Conn.Execute (mySQL)
24	if not RS1.eof then
25		while not RS1.eof
26			tmpCounter=0
27			if isnull(RS1("VoucherId")) then
28				priceText = "<FONT COLOR=""red"">������ ����</FONT>"
29			else
30				priceText = "<a target=""_blank"" title=""������ ���� ������"" href=""../AP/AccountReport.asp?act=showVoucher&voucher=" & RS1("VoucherID") & """>" & Separate(RS1("price")) & "</a>"
31			end if
32%>
33		<TR bgcolor="#FFFFFF">
34			<TD><a target="_blank" title="���� ����� ���� ������" href="../purchase/outServiceTrace.asp?od=<%=RS1("PurchaseOrderID")%>"><%=RS1("PurchaseOrderID")%></a></TD>
35			<TD DIR="LTR"><%=RS1("OrdDate")%></TD>
36			<TD><%=RS1("TypeName")%></TD>
37			<TD><a target="_blank" title="������ ����" href="../CRM/AccountInfo.asp?act=show&tab=3&selectedCustomer=<%=RS1("Vendor_ID")%>"><%=RS1("AccountTitle")%></a></TD>
38			<TD><%=priceText%>&nbsp;</TD>
39		</TR>
40
41<%
42		RS1.moveNext
43		wend
44	else
45%>		<TR>
46			<TD colspan="10" align="center" style="font-size:9pt;color:#888888">������� ���� ���� ��� ������ ��� �����</TD>
47		</TR>
48<%
49	end if 
50	RS1.close
51%>
52<TR bgcolor="#CCEEFF">
53	<TD>���� �� �����</TD>
54	<TD>&nbsp;</TD>
55	<TD colspan="2">��� ����</TD>
56	<TD>&nbsp;</TD>
57</TR>
58<%	
59mySQL="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 & ")"
60
61set RS1=Conn.Execute (mySQL)
62	if not RS1.eof then
63		while not RS1.eof
64			tmpCounter=0
65			if isnull(RS1("UnitPrice")) then
66				priceText = "<FONT COLOR=""red"">���� ����</FONT>"
67			else
68				priceText = "<a target=""_blank"" title=""������ ����� �����"" href=""../inventory/editItem.asp?itemDetail=" & RS1("ItemID") & """>" & Separate(cdbl(RS1("UnitPrice")) * cdbl(RS1("Qtty"))) & "</a>"
69			end if
70%>
71		<TR bgcolor="#FFFFFF">
72			<TD><a target="_blank" title="���� �� ����� ������" href="../inventory/default.asp?show=<%=RS1("PickupListID")%>"><%=RS1("PickupListID")%></a></TD>
73			<TD DIR="LTR"><%=RS1("CreationDate")%></TD>
74			<TD colspan="2"><a target="_blank" title="������ ����� �����" href="../inventory/editItem.asp?itemDetail=<%=RS1("ItemID")%>"><%=RS1("Qtty") & " " & RS1("Unit") & " " & RS1("ItemName")%></a></TD>
75			<TD><%=priceText%>&nbsp;</TD>
76		</TR>
77
78<%
79		RS1.moveNext
80		wend
81	else
82%>		<TR>
83			<TD colspan="10" align="center" style="font-size:9pt;color:#888888">������� ����� ���� ��� ������ ��� �����</TD>
84		</TR>
85<%
86	end if 
87	RS1.close
88%>
89</TABLE>
90</center>
91<%
92end if
93
94Conn.Close
95%>