PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 19
 20	  &nbsp;</Td></Tr>
 21	  <Tr>
 22		<Td colspan="3" valign="top" align="center"  width=500>
 23
 24				<BR><BR>
 25		</Td>
 26	  </Tr>
 27
 28  	  <Tr>
 29		<Td valign="top" align="left" height=300>
 30		</Td>
 31		<Td valign="top" align="center">
 32			<table class="CustTable" cellspacing='1'>
 33				<tr>
 34					<td colspan="4" class="CusTableHeader">������ ����� ����� �� �����</td>
 35				</tr>
 36				<tr>
 37					<TD class="CusTableHeader"><SMALL>��� ����</SMALL></A></TD>
 38					<TD class="CusTableHeader"><SMALL>�� ����</SMALL></A></TD>
 39					<TD class="CusTableHeader"><SMALL>�����</SMALL></A></TD>
 40					<TD class="CusTableHeader"><SMALL>����</SMALL></A></TD>
 41				</tr>
 42				<%
 43				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 & ""
 44				Set RSS = conn.execute(mySQL)
 45				if RSS.eof then
 46				%>
 47					<tr>
 48						<td class="CusTD3" colspan=4>���</td>
 49					</tr>
 50				<%
 51				end if
 52				tmpCounter=0
 53				while not RSS.eof 
 54					tmpCounter=tmpCounter+1
 55				%>
 56					<tr class="<%if (tmpCounter MOD 2) = 1 then response.write "CusTD3" else response.write "CusTD4" %>">
 57						<TD><%=RSS("name")%></TD>
 58						<TD align=center dir=ltr><%=RSS("OldItemID")%></TD>
 59						<TD align=center dir=ltr><%=RSS("sumQttys")%></TD>
 60						<TD align=center><%=RSS("Unit")%></TD>
 61					</tr>
 62				<%
 63					RSS.moveNext
 64				wend
 65				%>
 66			</table><BR><BR><BR>
 67
 68			
 69			<table class="CustTable" cellspacing='1'>
 70				<tr>
 71					<td colspan="8" class="CusTableHeader">����� ���� � ���� ������� ����� �� �����</td>
 72				</tr>
 73				<tr>
 74					<TD class="CusTableHeader"><SMALL>��� ����</SMALL></A></TD>
 75					<TD class="CusTableHeader"><SMALL>������</SMALL></A></TD>
 76					<TD class="CusTableHeader"><SMALL>����</SMALL></A></TD>
 77					<TD class="CusTableHeader"><SMALL>����</SMALL></A></TD>
 78					<TD class="CusTableHeader"><SMALL>����</SMALL></A></TD>
 79					<TD class="CusTableHeader" align=center><SMALL>����� </SMALL></A></TD>
 80					<TD class="CusTableHeader"><SMALL> ����� </SMALL></A></TD>
 81					<TD class="CusTableHeader"><SMALL>����</SMALL></A></TD>
 82				</tr>
 83
 84				<%
 85				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"
 86				Set RSS = conn.execute(mySQL)
 87				if RSS.eof then
 88				%>
 89					<tr>
 90						<td class="CusTD3" colspan="8">���</td>
 91					</tr>
 92				<%
 93				end if
 94				tmpCounter=0
 95				while not RSS.eof 
 96					tmpCounter=tmpCounter+1
 97				%>
 98					<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 %>>
 99						<TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("name")%></span></TD>
100						<TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("OldItemID")%></span></TD>
101						<TD align=right dir=ltr><span style="font-size:10pt"><% if RSS("IsInput") then %><%=RSS("Qtty")%><% end if %></span></TD>
102						<TD align=right dir=ltr><span style="font-size:10pt"><% if not RSS("IsInput") then %><%=RSS("Qtty")%><% end if %></span></TD>
103						<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>
104						<TD dir=ltr align=center><%=RSS("logDate")%></span></TD>
105						<TD><% if RSS("type")= "2" then
106									response.write "<font color=red><b>����� ������</b></font>"
107								elseif RSS("type")= "3" then
108									response.write "<font color=green><b>������</b></font>"
109								elseif RSS("type")= "4" then
110									response.write "<font color=blue><b>����� ����� ���� </b></font>"
111								elseif RSS("type")= "5" then
112									response.write "<font color=orang><b>������</b></font>"
113								elseif RSS("type")= "6" then
114									response.write "<font color=#6699CC><b>���� �� �����</b></font>"
115								elseif RSS("type")= "7" then
116									response.write "<font color=#FF9966><b>���� �� ����� ������</b></font>"
117								elseif RSS("RelatedID")= "-1" then %> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
118							   <% else 
119									if RSS("IsInput") then 
120										%> ����� ����� ����: <A HREF="../purchase/outServiceTrace.asp?od=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A><%
121									else
122										%><A HREF="../inventory/default.asp?ed=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A><%
123									end if
124								end if %>
125							<% if trim(RSS("comments"))<> "-" and RSS("comments")<> "" then
126								response.write " <br><br><B>�����:</B>  " & RSS("comments") 
127							   end if %>
128
129						</TD>
130						<TD><%=RSS("RealName")%></TD>
131					</tr>
132				<%
133					RSS.moveNext
134				wend
135				%>
136			</table><BR><BR>
137			
138			<table class="CustTable" cellspacing='1'>
139				<tr>
140					<td colspan="8" class="CusTableHeader">����� ���� � ���� ���� ���� ����ԝ��� ����� �� �����</td>
141				</tr>
142				<tr>
143					<TD class="CusTableHeader"><SMALL>��� ����</SMALL></A></TD>
144					<TD class="CusTableHeader"><SMALL>������</SMALL></A></TD>
145					<TD class="CusTableHeader"><SMALL>����</SMALL></A></TD>
146					<TD class="CusTableHeader"><SMALL>����</SMALL></A></TD>
147					<TD class="CusTableHeader" align=center><SMALL>����� </SMALL></A></TD>
148					<TD class="CusTableHeader"><SMALL> ����� </SMALL></A></TD>
149					<TD class="CusTableHeader"><SMALL>����</SMALL></A></TD>
150					<TD class="CusTableHeader"><SMALL>�����</SMALL></A></TD>
151				</tr>
152
153				<%
154				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"
155				Set RSS = conn.execute(mySQL)
156				if RSS.eof then
157				%>
158					<tr>
159						<td class="CusTD3" colspan="8">���</td>
160					</tr>
161				<%
162				end if
163				tmpCounter=0
164				while not RSS.eof 
165					tmpCounter=tmpCounter+1
166				%>
167					<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 %>>
168						<TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("name")%></span></TD>
169						<TD align=right dir=ltr><span style="font-size:10pt"><%=RSS("OldItemID")%></span></TD>
170						<TD align=right dir=ltr><span style="font-size:10pt"></span><%=RSS("Qtty")%></span></TD>
171						<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>
172						<TD dir=ltr align=center><%=RSS("logDate")%></span></TD>
173						<TD><% if RSS("type")= "2" then
174									response.write "<font color=red><b>����� ������</b></font>"
175								elseif RSS("type")= "3" then
176									response.write "<font color=green><b>������</b></font>"
177								elseif RSS("type")= "4" then
178									response.write "<font color=blue><b>����� ����� ���� </b></font>"
179								elseif RSS("type")= "5" then
180									response.write "<font color=orang><b>������</b></font>"
181								elseif RSS("type")= "6" then
182									response.write "<font color=#6699CC><b>���� �� �����</b></font>"
183								elseif RSS("type")= "7" then
184									response.write "<font color=#FF9966><b>���� �� ����� ������</b></font>"
185								elseif RSS("RelatedID")= "-1" then %> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
186							   <% else 
187									if RSS("IsInput") then 
188										%> ����� ����� ����: <A HREF="../purchase/outServiceTrace.asp?od=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A><%
189									else
190										%><A HREF="../inventory/default.asp?ed=<%=RSS("RelatedID")%>"><%=RSS("RelatedID")%></A><%
191									end if
192								end if %>
193							<% if trim(RSS("comments"))<> "-" and RSS("comments")<> "" then
194								response.write " <br><br><B>�����:</B>  " & RSS("comments") 
195							   end if %>
196
197						</TD>
198						<TD><%=RSS("RealName")%></TD>
199						<TD><a href="../order/TraceOrder.asp?act=show&order=<%=RSS("ord")%>"><%=RSS("ord")%></a></TD>
200					</tr>
201				<%
202					RSS.moveNext
203				wend
204				%>
205			</table><BR><BR>
206			
207			
208		</Td>
209		<Td valign="top" align="center">
210			&nbsp;
211		</Td>
212  	  </Tr>