/beta/CRM/include_CRM_APData.asp
http://github.com/khaneh/Orders · ASP · 208 lines · 194 code · 4 blank · 10 comment · 17 complexity · f63aada0bc70b12268fc421c5108f8ae MD5 · raw file
- <%'
- 'This Include file needs the variables below:
- '
- ' Conn
- ' cusID (Customer ID)
- '
- %>
- <STYLE>
- .GetCustTbl {font-family:tahoma; background-color: #DDDDDD; width:630; direction: RTL; }
- .GetCustTbl td {padding:2; font-size: 9pt; height:25;}
- .GetCustInp { font-family:tahoma; font-size: 9pt;}
- .CusTableHeader {background-color: #33AACC; text-align: center; font-weight:bold;height:30;}
- .CustContactTable {font-family:tahoma; width:100%; border:1 solid black; direction: RTL; background-color:#CCCCCC;}
- .CustContactTable td {padding:5;}
- .CustTable {font-family:tahoma; width:80%; border:1 solid black; direction: RTL; background-color:black;}
- .CustTable td {padding:5;}
- .CustTable a {text-decoration:none;color:#000088}
- .CustTable a:hover {text-decoration:underline;}
- .CusTD1 {background-color: #CCCC66; text-align: left; font-weight:bold;}
- .CusTD2 {background-color: #DDDDDD; direction: LTR; text-align: right; font-size:9pt;}
- .CusTD3 {background-color: #DDDDDD; direction: LTR; text-align: center; font-size:9pt;}
- .CusTD4 {background-color: #CCCC66; direction: LTR; text-align: center; font-size:9pt;}
- </STYLE>
- <Tr>
- <Td colspan="2" valign="center" align="center">
- <BR>
- <% if Auth(7 , 1) then %><input class="GenButton" type="button" value=" " onclick="window.open('../AP/voucherInput.asp?act=show&selectedCustomer=<%=cusID%>');" <% if AccountIsDisabled then %> disabled <% end if %>> <% end if %>
- <% if Auth(7 , 4) then %><input class="GenButton" type="button" value=" " onclick="window.open('../AP/MemoInput.asp?act=getMemo&selectedCustomer=<%=cusID%>');" <% if AccountIsDisabled then %> disabled <% end if %>> <% end if %>
- <% if Auth(7 , 6) then %><input class="GenButton" type="button" value="" onclick="window.open('../AP/ItemsRelation.asp?sys=AR&act=relate&selectedCustomer=<%=CusID%>');"> <% end if %>
- <% if Auth(7 , 5) then %><input class="GenButton" type="button" value=" " onclick="window.open('../AP/AccountReport.asp?sys=AR&act=show&selectedCustomer=<%=CusID%>');"> <% end if %>
- <% if Auth(7 , 3) then %><input class="GenButton" type="button" value=" " onclick="window.open('../AP/IsA-VouchersReport.asp?selectedCustomer=<%=CusID%>');"> <% end if %>
-
- <BR><BR>
- </Td>
- </Tr>
- <Tr>
- <Td colspan="2" valign="top" align="center">
- <table class="CustTable" cellspacing='1' style='width:90%;'>
- <tr>
- <td colspan="5" class="CusTableHeader"> ( )</td>
- </tr>
- <%
- mySQL="SELECT * FROM PurchaseOrders WHERE (Vendor_ID = '"& cusID & "') AND (Status <> N'OK' AND Status <> N'CANCEL') ORDER BY OrdDate DESC, ID"
- Set RS1 = conn.execute(mySQL)
- if RS1.eof then
- %>
- <tr>
- <td colspan="5" class="CusTD3"></td>
- </tr>
- <%
- else
- %> <tr>
- <td class="CusTD3">#</td>
- <td class="CusTD3"></td>
- <td class="CusTD3"></td>
- <td class="CusTD3"></td>
- <td class="CusTD3"></td>
- </tr>
- <% tmpCounter=0
- Do while not RS1.eof
- tmpCounter = tmpCounter + 1
- if tmpCounter mod 2 = 1 then
- tmpColor="#FFFFFF"
- tmpColor2="#FFFFBB"
- Else
- tmpColor="#DDDDDD"
- tmpColor2="#EEEEBB"
- End if
- 'alert(this.getElementByTagName('td').items(0).data);
- %>
- <TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../purchase/outServiceTrace.asp?od=<%=RS1("ID")%>');">
- <TD style="height:30px;"><%=tmpCounter%></TD>
- <TD style="height:30px;"><%=RS1("ID")%></TD>
- <TD dir="LTR" align='right'><%=RS1("OrdDate")%> </TD>
- <TD><%=RS1("TypeName")%> </TD>
- <TD><%=RS1("Status")%> </TD>
- </TR>
- <% RS1.moveNext
- Loop
- end if
- %>
- </table>
- </Td>
- </Tr>
- <Tr>
- <Td colspan="2" valign="top" align="center">
- <table class="CustTable" cellspacing='1' style='width:90%;'>
- <tr>
- <td colspan="7" class="CusTableHeader" style="background-color:#CCCC99;"> ( )</td>
- </tr>
- <%
- mySQL="SELECT Vouchers.id, Vouchers.CreationDate, Users.RealName AS Creator, Vouchers.TotalPrice FROM Vouchers INNER JOIN Users ON Vouchers.CreatedBy = Users.ID WHERE (Vouchers.Voided = 0) AND (Vouchers.VendorID = '"& cusID & "') AND (Vouchers.Verified = 0) ORDER BY Vouchers.CreationDate DESC, Vouchers.id"
- Set RS1 = conn.execute(mySQL)
- if RS1.eof then
- %>
- <tr>
- <td colspan="7" class="CusTD3"></td>
- </tr>
- <%
- else
- %> <tr>
- <td class="CusTD3">#</td>
- <td class="CusTD3"># </td>
- <td class="CusTD3"> </td>
- <td class="CusTD3"> </td>
- <td class="CusTD3"> </td>
- <td class="CusTD3"></td>
- </tr>
- <% tmpCounter=0
- Do while not RS1.eof
- RelatedPurchaseOrders = ""
- tmpsep=""
-
- mySQL="SELECT RelatedPurchaseOrderID FROM VoucherLines WHERE (Voucher_ID = '"& RS1("ID") & "')"
-
- Set RS2 = conn.execute(mySQL)
- Do While not RS2.eof
- RelatedPurchaseOrders = RelatedPurchaseOrders & tmpsep & RS2("RelatedPurchaseOrderID")
- tmpsep=", "
- RS2.Movenext
- Loop
- RS2.close
- Set Rs2=Nothing
- tmpCounter = tmpCounter + 1
- if tmpCounter mod 2 = 1 then
- tmpColor="#FFFFFF"
- tmpColor2="#FFFFBB"
- Else
- tmpColor="#DDDDDD"
- tmpColor2="#EEEEBB"
- End if
- 'alert(this.getElementByTagName('td').items(0).data);
- %>
- <TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../AP/AccountReport.asp?act=showVoucher&voucher=<%=RS1("ID")%>');">
- <TD style="height:30px;"><%=tmpCounter%></TD>
- <TD style="height:30px;"><%=RS1("ID")%></TD>
- <TD><%=RS1("Creator")%> </TD>
- <TD dir="LTR" align='right'><%=RS1("CreationDate")%> </TD>
- <TD dir="LTR" align='right'><%=RelatedPurchaseOrders%> </TD>
- <TD><%=Separate(RS1("TotalPrice"))%> </TD>
- </TR>
- <% RS1.moveNext
- Loop
- end if
- %>
- </table>
- </Td>
- </Tr>
- <Tr>
- <Td colspan="2" valign="top" align="center">
- <table class="CustTable" cellspacing='1' style='width:90%;'>
- <tr>
- <td colspan="10" class="CusTableHeader" style="background-color:#CCAA99;"> ( )</td>
- </tr>
- <%
- mySQL="SELECT Vouchers.id, Vouchers.CreationDate, Users.RealName AS Creator, Vouchers.TotalPrice, Users_1.RealName AS Approver, APItems.CreatedDate AS ApprovedDate, APItems.RemainedAmount, APItems.EffectiveDate FROM Vouchers INNER JOIN Users ON Vouchers.CreatedBy = Users.ID INNER JOIN APItems ON Vouchers.id = APItems.Link INNER JOIN Users Users_1 ON APItems.CreatedBy = Users_1.ID WHERE (Vouchers.VendorID = '"& cusID & "') AND (Vouchers.Voided = 0) AND (Vouchers.Verified = 1) AND (APItems.RemainedAmount > 0) AND (APItems.Type = 6) ORDER BY Vouchers.CreationDate DESC, Vouchers.id"
-
- 'response.write mySQL
- 'response.end
- Set RS1 = conn.execute(mySQL)
- if RS1.eof then
- %>
- <tr>
- <td colspan="10" class="CusTD3"></td>
- </tr>
- <%
- else
- %> <tr>
- <td class="CusTD3">#</td>
- <td class="CusTD3"></td>
- <td class="CusTD3"></td>
- <td class="CusTD3"> </td>
- <td class="CusTD3"></td>
- <td class="CusTD3"> </td>
- <td class="CusTD3"> </td>
- <td class="CusTD3"></td>
- <td class="CusTD3"></td>
- </tr>
- <% tmpCounter=0
- Do while not RS1.eof
- tmpCounter = tmpCounter + 1
- if tmpCounter mod 2 = 1 then
- tmpColor="#FFFFFF"
- tmpColor2="#FFFFBB"
- Else
- tmpColor="#DDDDDD"
- tmpColor2="#EEEEBB"
- End if
- 'alert(this.getElementByTagName('td').items(0).data);
- %>
- <TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="window.open('../AP/AccountReport.asp?act=showVoucher&voucher=<%=RS1("ID")%>');">
- <TD style="height:30px;"><%=tmpCounter%></TD>
- <TD style="height:30px;"><%=RS1("ID")%></TD>
- <TD><%=RS1("Creator")%> </TD>
- <TD dir="LTR" align='right'><%=RS1("CreationDate")%> </TD>
- <TD><%=RS1("Approver")%> </TD>
- <TD dir="LTR" align='right'><%=RS1("ApprovedDate")%> </TD>
- <TD dir="LTR" align='right'><%=RS1("EffectiveDate")%> </TD>
- <TD><%=Separate(RS1("TotalPrice"))%> </TD>
- <TD><%=Separate(RS1("RemainedAmount"))%> </TD>
- </TR>
- <% RS1.moveNext
- Loop
- end if
- %>
- </table>
- </Td>
- </Tr>