PageRenderTime 30ms CodeModel.GetById 17ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/beta/admin/Reports.asp

http://github.com/khaneh/Orders
ASP | 236 lines | 228 code | 4 blank | 4 comment | 20 complexity | 7bb7e044ee4a3c711799a490abe18cb2 MD5 | raw file
  1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2' Admin
  3PageTitle="������� ���"
  4SubmenuItem=8
  5
  6
  7function Separate(inputTxt)
  8myMinus=""
  9input=inputTxt
 10t=instr(input, ".")
 11if t>0 then 
 12	expPart = mid(input, t+1, 2)
 13	input = left(input, t-1)
 14end if
 15if left(input,1)="-" then
 16	myMinus="-"
 17	input=right(input,len(input)-1)
 18end if
 19if len(input) > 3 then
 20	tmpr=right(input ,3)
 21	tmpl=left(input , len(input) - 3 )
 22	result = tmpr
 23	while len(tmpl) > 3
 24		tmpr=right(tmpl,3)
 25		result = tmpr & "," & result 
 26		tmpl=left(tmpl , len(tmpl) - 3 )
 27	wend
 28	if len(tmpl) > 0 then
 29		result = tmpl & "," & result
 30	end if 
 31else
 32	result = input
 33end if 
 34	if t>0 then 
 35		result = result & "." & expPart
 36	end if
 37
 38	Separate=myMinus & result
 39end function
 40
 41%>
 42<!--#include file="top.asp" -->
 43<STYLE>
 44	.GetCustTbl {font-family:tahoma; background-color: #DDDDDD; width:630; direction: RTL; }
 45	.GetCustTbl td {padding:2; font-size: 9pt; height:25;}
 46	.GetCustInp { font-family:tahoma; font-size: 9pt;}
 47	.CusTableHeader {background-color: #33AACC; text-align: center; font-weight:bold;}
 48	.CustContactTable {font-family:tahoma; width:100%; border:1 solid black; direction: RTL; background-color:#CCCCCC;}
 49	.CustContactTable td {padding:5;}
 50	.CustTable {font-family:tahoma; width:80%; border:1 solid black; direction: RTL; background-color:black;}
 51	.CustTable td {padding:5;}
 52	.CustTable a {text-decoration:none;color:#000088}
 53	.CustTable a:hover {text-decoration:underline;}
 54	.CusTD1 {background-color: #CCCC66; text-align: left; font-weight:bold;}
 55	.CusTD2 {background-color: #DDDDDD; direction: LTR; text-align: right; font-size:9pt;}
 56	.CusTD3 {background-color: #DDDDDD; direction: LTR; text-align: center; font-size:9pt;}
 57	.CusTD4 {background-color: #CCCC66; direction: LTR; text-align: center; font-size:9pt;}
 58	.CustTable4 {font-family:tahoma; direction: RTL; width:100%; height:100%; background-color:#C3DBEB;}
 59</STYLE>
 60	  <TaBlE class="CustTable4" cellspacing="2" cellspacing="2">
 61	  <Tr>
 62		<Td colspan="2" valign="top" align="center">
 63			<table class="CustTable" cellspacing='1' style='width:90%;'>
 64				<tr>
 65					<td colspan="9" class="CusTableHeader" style="text-align:right;">����� ���� �� ���� �ǘ��� ������</td>
 66				</tr>
 67				<%
 68				mySQL="SELECT Accounts.AccountTitle, orders_trace.radif_sefareshat, orders_trace.order_date, orders_trace.order_kind, orders_trace.order_title,  orders_trace.salesperson, orders_trace.vazyat, orders_trace.marhale FROM Orders INNER JOIN orders_trace ON Orders.ID = orders_trace.radif_sefareshat INNER JOIN Accounts ON Orders.Customer = Accounts.ID WHERE (Orders.Closed = 0) AND (Orders.ID NOT IN (SELECT [ORDER] FROM InvoiceOrderRelations)) ORDER BY Orders.CreatedDate DESC, Orders.ID"
 69				Set RS1 = conn.execute(mySQL)
 70				if RS1.eof then
 71%>
 72					<tr>
 73						<td colspan="8" class="CusTD3">���</td>
 74					</tr>
 75<%
 76				else
 77%>					<tr>
 78						<td class="CusTD3">#</td>
 79						<td class="CusTD3">�����</td>
 80						<td class="CusTD3">�����</td>
 81						<td class="CusTD3">�����</td>
 82						<td class="CusTD3">�����</td>
 83						<td class="CusTD3">���</td>
 84						<td class="CusTD3">�����</td>
 85						<td class="CusTD3">�����</td>
 86						<td class="CusTD3">�����</td>
 87					</tr>
 88<%					tmpCounter=0
 89					Do while not RS1.eof 
 90						tmpCounter = tmpCounter + 1
 91						if tmpCounter mod 2 = 1 then
 92							tmpColor="#FFFFFF"
 93							tmpColor2="#FFFFBB"
 94						Else
 95							tmpColor="#DDDDDD"
 96							tmpColor2="#EEEEBB"
 97						End if 
 98						'alert(this.getElementByTagName('td').items(0).data);
 99%>
100						<TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../order/TraceOrder.asp?act=show&order=<%=RS1("radif_sefareshat")%>');">
101							<TD style="height:30px;"><%=tmpCounter%></TD>
102							<TD style="height:30px;"><%=RS1("radif_sefareshat")%></TD>
103							<TD><%=RS1("salesperson")%>&nbsp;</TD>
104							<TD dir="LTR" align='right'><%=RS1("order_date")%>&nbsp;</TD>
105							<TD dir="LTR" align='right'><%=RS1("AccountTitle")%>&nbsp;</TD>
106							<TD><%=RS1("order_kind")%>&nbsp;</TD>
107							<TD><%=RS1("order_title")%>&nbsp;</TD>
108							<TD><%=RS1("marhale")%>&nbsp;</TD>
109							<TD><%=RS1("vazyat")%>&nbsp;</TD>
110						</TR>
111<%						RS1.moveNext
112					Loop
113				end if
114				%>
115			</table>
116		</Td>
117	  </Tr>
118	  <Tr>
119		<Td colspan="2" valign="top" align="center">
120			<hr>
121		</Td>
122	  </Tr>
123	  <Tr>
124		<Td colspan="2" valign="top" align="center">
125			<table class="CustTable" cellspacing='1' style='width:90%;'>
126				<tr>
127					<td colspan="8" class="CusTableHeader" style="text-align:right;">������ ��� �� ����� (����� ����)</td>
128				</tr>
129				<%
130				mySQL="SELECT Invoices.ID, Invoices.CreatedDate, Users.RealName AS Creator, Invoices.TotalReceivable, InvoiceOrderRelations.[Order], orders_trace.vazyat,  orders_trace.marhale FROM orders_trace RIGHT OUTER JOIN InvoiceOrderRelations ON orders_trace.radif_sefareshat = InvoiceOrderRelations.[Order] RIGHT OUTER JOIN Invoices INNER JOIN Users ON Invoices.CreatedBy = Users.ID ON InvoiceOrderRelations.Invoice = Invoices.ID WHERE (Invoices.Voided = 0) AND (Invoices.Approved = 0) ORDER BY Invoices.CreatedDate DESC, Invoices.ID"
131				Set RS1 = conn.execute(mySQL)
132				if RS1.eof then
133%>
134					<tr>
135						<td colspan="8" class="CusTD3">���</td>
136					</tr>
137<%
138				else
139%>					<tr>
140						<td class="CusTD3">#</td>
141						<td class="CusTD3">����� ������</td>
142						<td class="CusTD3">����� �����</td>
143						<td class="CusTD3">�����</td>
144						<td class="CusTD3">����� �� �����</td>
145						<td class="CusTD3">�����</td>
146						<td class="CusTD3">�����</td>
147						<td class="CusTD3">����</td>
148					</tr>
149<%					tmpCounter=0
150					Do while not RS1.eof 
151						tmpCounter = tmpCounter + 1
152						if tmpCounter mod 2 = 1 then
153							tmpColor="#FFFFFF"
154							tmpColor2="#FFFFBB"
155						Else
156							tmpColor="#DDDDDD"
157							tmpColor2="#EEEEBB"
158						End if 
159						'alert(this.getElementByTagName('td').items(0).data);
160%>
161						<TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../AR/AccountReport.asp?act=showInvoice&invoice=<%=RS1("ID")%>');">
162							<TD style="height:30px;"><%=tmpCounter%></TD>
163							<TD style="height:30px;"><%=RS1("ID")%></TD>
164							<TD><%=RS1("�Creator")%>&nbsp;</TD>
165							<TD dir="LTR" align='right'><%=RS1("CreatedDate")%>&nbsp;</TD>
166							<TD dir="LTR" align='right'><%=RS1("Order")%>&nbsp;</TD>
167							<TD dir="LTR" align='right'><%=RS1("vazyat")%>&nbsp;</TD>
168							<TD dir="LTR" align='right'><%=RS1("Marhale")%>&nbsp;</TD>
169							<TD><%=Separate(RS1("TotalReceivable"))%>&nbsp;</TD>
170						</TR>
171<%						RS1.moveNext
172					Loop
173				end if
174				%>
175			</table>
176		</Td>
177	  </Tr>
178	  <Tr>
179		<Td colspan="2" valign="top" align="center">
180			<hr>
181		</Td>
182	  </Tr>
183	  <Tr>
184		<Td colspan="2" valign="top" align="center">
185			<table class="CustTable" cellspacing='1' style='width:90%;'>
186				<tr>
187					<td colspan="7" class="CusTableHeader" style="text-align:right;">������ ��� ����� ��� (���� ����)</td>
188				</tr>
189				<%
190				mySQL="SELECT Invoices.ID, Invoices.CreatedDate, Users.RealName AS Creator, Invoices.ApprovedDate, Invoices.TotalReceivable, Users_1.RealName AS Approver FROM Invoices INNER JOIN Users ON Invoices.CreatedBy = Users.ID INNER JOIN Users Users_1 ON Invoices.ApprovedBy = Users_1.ID WHERE (Invoices.Voided = 0) AND (Invoices.Issued = 0) ORDER BY Invoices.CreatedDate DESC, Invoices.ID"
191				Set RS1 = conn.execute(mySQL)
192				if RS1.eof then
193%>
194					<tr>
195						<td colspan="7" class="CusTD3">���</td>
196					</tr>
197<%
198				else
199%>					<tr>
200						<td class="CusTD3">#</td>
201						<td class="CusTD3">����� ������</td>
202						<td class="CusTD3">����� �����</td>
203						<td class="CusTD3">�����</td>
204						<td class="CusTD3">����� �����</td>
205						<td class="CusTD3">����� �����</td>
206						<td class="CusTD3">����</td>
207					</tr>
208<%					tmpCounter=0
209					Do while not RS1.eof 
210						tmpCounter = tmpCounter + 1
211						if tmpCounter mod 2 = 1 then
212							tmpColor="#FFFFFF"
213							tmpColor2="#FFFFBB"
214						Else
215							tmpColor="#DDDDDD"
216							tmpColor2="#EEEEBB"
217						End if 
218						'alert(this.getElementByTagName('td').items(0).data);
219%>
220						<TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../AR/AccountReport.asp?act=showInvoice&invoice=<%=RS1("ID")%>');">
221							<TD style="height:30px;"><%=tmpCounter%></TD>
222							<TD style="height:30px;"><%=RS1("ID")%></TD>
223							<TD><%=RS1("�Creator")%>&nbsp;</TD>
224							<TD dir="LTR" align='right'><%=RS1("CreatedDate")%>&nbsp;</TD>
225							<TD><%=RS1("Approver")%>&nbsp;</TD>
226							<TD dir="LTR" align='right'><%=RS1("ApprovedDate")%>&nbsp;</TD>
227							<TD><%=Separate(RS1("TotalReceivable"))%>&nbsp;</TD>
228						</TR>
229<%						RS1.moveNext
230					Loop
231				end if
232				%>
233			</table>
234		</Td>
235	  </Tr>
236<!--#include file="tah.asp" -->