Skip to content

Instantly share code, notes, and snippets.

@deletosh
Last active May 11, 2017 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deletosh/a6627fcd4bd7f9616529f51e0f409d92 to your computer and use it in GitHub Desktop.
Save deletosh/a6627fcd4bd7f9616529f51e0f409d92 to your computer and use it in GitHub Desktop.
report_asp.asp
<!-- #include virtual="/ajaxed/bootstrap.asp" -->
<!-- #include virtual="/class/bulk_mail.inc" -->
<!-- depedance class -->
<!--#include virtual="/class/split.inc" -->
<style>
a.button {
-webkit-appearance: button;
-moz-appearance: button;
appearance: button;
text-decoration: none;
color: initial;
font-size: 1.6em;
}
a.button:link, a.button:active, a.button:visited{
text-decoration: none;
}
</style>
<%
Server.ScriptTimeout = 2147483647
db.openDefault()
If Request.querystring("referral")<>"" Then
referral = Request.querystring("referral")
End If
%>
<!--#include file="report_session_inc.asp"-->
<!--#include file="report_functions_inc.asp"-->
<% Dim oRSMailerMap, emailaddress, recipient, commenthide, c, detailnumber, rsCheck
actiondetail = Request.Querystring("actiondetail")
emailType = Request.Querystring("emailType")
detailnumber = replace(Request.Querystring("detailnumber"),"-","") 'this cleans up the number...'
detailcompany = Request.Querystring("detailcompany")
%>
<!--#include virtual="/helpdesk/default_builder.asp" -->
<!--#include file="report_connection_inc.asp"-->
<!--#include file="report_access_level_inc.asp"-->
<!--#include file="report_get_inc.asp"-->
<%
If actiondetail = "process" Then
'Let's be sure that this isn't searching for ALL companies --
if detailcompany = "%" OR detailcompany = "" then
'Let let's get the company:
Set oRSCompanyGet = db.getRS("SELECT Company FROM allocations WHERE `Mobile Number` = '"& detailnumber &"' LIMIT 1","")
Company = oRSCompanyGet("Company")
'set the newer value of Company Detail'
detailcompany = Company
end if
Else
Company = Request.Querystring("c")
End If
%>
<%
cur_page = "report_detail"
MaxSQL = "SELECT Max(allocations.`Bill Month`) AS `MaxOfBill Month` FROM allocations"
If Mobile_Number <> "%" or Company <> " %" Then
MaxSQL = MaxSQL & " Where "
If Mobile_Number <> "%" Then
if emailType = "iPassEmailOk" then
MaxSQL = MaxSQL & "allocations.`Mobile Number` LIKE '" & StripNonNumeric(Mobile_Number) & "'"
else
MaxSQL = MaxSQL & "allocations.`Mobile Number` LIKE '" & StripNonNumeric(Mobile_Number) & "'"
end if
If Company <> "%" Then
MaxSQL = MaxSQL & " and "
End If
End If
If Company <> "%" Then
MaxSQL = MaxSQL & "allocations.company LIKE '" & Company & "'"
End If
End If
set rsmaxmonth= db.getRS(MaxSQL,"")
If request("m") <> "0" Then
Bill_Month = request("m")
Else
Bill_Month = rsmaxmonth("maxofbill month")
End If
'let's jump out sooner -- this users doesn't have an allocation...
if isNUll(Bill_Month) then
URL_NA="no_record.asp"
Response.redirect (URL_NA)
end if
'check to see if user should have access to this page
if emailType = "iPassEmailOk" then
Set oRSReport_NA = db.getRS("SELECT allocations.*, CONCAT(DATE_FORMAT(`Bill Cycle End Date`,'%b %D, %Y'),' - ',DATE_FORMAT(DATE_SUB(DATE_SUB(`Bill Cycle End Date`, INTERVAL 1 MONTH), INTERVAL -1 DAY),'%b %D, %Y' ) ) `Bill Period` FROM allocations " & strAccessLevelWhereClause & " and allocations.`mobile number` LIKE '" & Mobile_Number & "' and allocations.`Bill Month` = '" & dbformat_mysqldate( Bill_Month ) & "' ", "")
else
Set oRSReport_NA = db.getRS("SELECT allocations.*, CONCAT(DATE_FORMAT(`Bill Cycle End Date`,'%b %D, %Y'),' - ',DATE_FORMAT(DATE_SUB(DATE_SUB(`Bill Cycle End Date`, INTERVAL 1 MONTH), INTERVAL -1 DAY),'%b %D, %Y' ) ) `Bill Period` FROM allocations " & strAccessLevelWhereClause & " and allocations.`mobile number` LIKE '" & StripNonNumeric(Mobile_Number) & "' and allocations.`Bill Month` = '" & dbformat_mysqldate( Bill_Month ) & "' ", "")
end if
' re-directs users who can't see any records
If (oRSReport_NA.EOF or oRSReport_NA.BOF) then
URL_NA="no_record.asp"
Response.redirect (URL_NA)
End If
If actiondetail = "process" Then
Mobile_Number = detailnumber
Else
If request("n") <> "" Then
Mobile_Number = request("n")
Else
Mobile_Number = "%"
End If
End If
If Request.querystring("Carrier")<>"" Then
Carrier = Request.querystring("Carrier")
Else
Carrier="%"
End If
If Request.querystring("bcc")<>"" Then
bcc = Request.querystring("bcc")
End If
If Request.querystring("dev")<>"" Then
dev = Request.querystring("dev")
Else
dev="%"
End If
If Request.querystring("customemailaddress")<>"" Then
custom_email = Request.QueryString("customemailaddress")
bcc = "lazparking@wirelessanalytics.com"
End If
If Request.querystring("udl1")<>"" Then
UDL1 = Request.querystring("udl1")
Else
UDL1="%"
End If
If Request.querystring("overide_exemption")<>"" Then
overide_exemption = Request.querystring("overide_exemption")
Else
overide_exemption="no"
End If
If Request.querystring("exempt_datacards")<>"" Then
exempt_datacards = Request.querystring("exempt_datacards")
Else
exempt_datacards="no"
End If
emailaddress = "%@%"
suspended = "%susp%"
deact = "%deact%"
commenthide = "%Email Exempt%"
transfer = "%To be Transferred%"
sent_time = FormatDateTime(now,vbLongDateTime)
task_id = Request.Querystring("job_id")
sent_by = Request.Querystring("requestor")
' build report where clause
if emailType = "iPassEmailOk" then
strReportWhereClause = " where allocations.`mobile number` LIKE '" & Mobile_Number & "'"
else
strReportWhereClause = " where allocations.`mobile number` LIKE '" & StripNonNumeric(Mobile_Number) & "'"
end if
strReportWhereClause = strReportWhereClause & " and ((allocations.`Company`) LIKE '"& Company & "')"
strReportWhereClause = strReportWhereClause & " and ((allocations.`UDL1`) LIKE '"& UDL1 & "')"
strReportWhereClause = strReportWhereClause & " and ((allocations.`Bill Month`)= '"& dbformat_mysqldate( Bill_Month ) & "')"
If mail_ok = 1 Then
If custom_email = "" Then
strReportWhereClause = strReportWhereClause & " and allocations.`Employee Email` LIKE '" & emailaddress & "'"
End If
'@depreciate this for now 24/04/13
'strReportWhereClause = strReportWhereClause & " and allocations.`Total Allocated Charge` > 10"
strReportWhereClause = strReportWhereClause & " and allocations.`Carrier` LIKE '" & Carrier & "'"
if overide_exemption <> "1" then
strReportWhereClause = strReportWhereClause & " and allocations.Comments Not LIKE '" & commenthide & "'"
end if
if exempt_datacards = "1" then
strReportWhereClause = strReportWhereClause & " and allocations.`Data Cards` < 1"
end if
strReportWhereClause = strReportWhereClause & " and allocations.Comments Not LIKE '" & suspended & "'"
strReportWhereClause = strReportWhereClause & " and allocations.Comments Not LIKE '" & deact & "'"
strReportWhereClause = strReportWhereClause & " and allocations.Comments Not LIKE '" & transfer & "'"
if emailType <> "iPassEmailOk" then
strReportWhereClause = strReportWhereClause & " AND allocations.Carrier <> 'iPass'"
end if
End If
strReportSql = "SELECT allocations.*, CONCAT(DATE_FORMAT(DATE_SUB(DATE_SUB(`Bill Cycle End Date`, INTERVAL 1 MONTH), INTERVAL -1 DAY),'%b %D, %Y' ),' - ', DATE_FORMAT(`Bill Cycle End Date`,'%b %D, %Y') ) `Bill Period` FROM allocations " & strReportWhereClause
Set oRSReport = db.getRS(strReportSql,"")
if emailType = "iPassEmailOk" then
Set oRSBillMonth = db.getRS("Select allocations.`Bill Month` From Allocations where allocations.`mobile number` LIKE '" & Mobile_Number & "' order by allocations.`Bill Month` DESC","")
else
Set oRSBillMonth = db.getRS("Select allocations.`Bill Month` From Allocations where allocations.`mobile number` LIKE '" & StripNonNumeric(Mobile_Number) & "' order by allocations.`Bill Month` DESC","")
end if
Dim Line_Type, LDPlan, RMPlan, Line_Status, i
Dim fCarrier, fUserName, fEmployeeEmail, fMobileNumber, fUDLField, fHandsetModel, fESNIMEI
dim recordCount : recordCount = 0
if NOT oRSReport.EOF then
if NOT isEmpty(oRSReport("Comments") ) then
If Left( oRSReport("Comments"), 7 ) = "suspend" then
Line_Status = "Suspended"
ElseIf Left(oRSReport("Comments"), 5) = "deact" then
Line_Status = "Deact"
Else
Line_Status = "Active"
End If
end if
fCarrier = oRSReport("Carrier")
fEmployeeEmail = oRSReport("User Name")
fEmployeeEmail = oRSReport("Employee Email")
fMobileNumber = oRSReport("Mobile Number")
'fUDLField = oRSReport("UDLField")
fHandsetModel = oRSReport("Handset Model")
fESNIMEI = oRSReport("ESN/IMEI")
end if
Set oRSSplits = db.getRS("Select split_bill_method, splits_percent, splits_value, splits, `User Name` from allocations_splits where `mobile number` = '" & Mobile_Number & "' and Company = '" & Company & "' and `Bill Month` = '" & dbformat_mysqldate( Bill_Month ) & "' ", "")
set getMaxSplitMonth = db.getRS("SELECT MAX(OpenBillMonth) AS MaxMonth FROM splitcycle WHERE CloseBillMonth IS NULL","")
If Request.QueryString("billing_split") <> "" Then
billingsplit = Request.QueryString("billing_split")
split_amount = Request.QueryString("amt")
name = Request.QueryString("override")
End If
%>
<!--#include file="report_udl_inc.asp"-->
<!--#include file="report_header_inc.asp"-->
<% dim report_menu
report_menu= "clean"
%>
<table width="100%">
<tr>
<td align="center" style="padding-left: 5px;" width="15%">
<% if Session("access_level") = 1 then %>
<br>
<form action="/helpdesk/case_show.asp" method="get">
<input type="hidden" name="case_status" value="All">
<input type="hidden" name="assigned_to" value="All">
<input type="hidden" name="cell_number" value="<%= Mobile_Number %>">
<input type="submit" value="View Tickets For User">
</form><br><br><br>
<form action="/helpdesk/case_add_n.asp" method="get">
<input type="hidden" name="company" value="<%= Company %>">
<input type="hidden" name="carrier" value="<%= fCarrier %>">
<input type="hidden" name="first_name" value="<%= fUserName %>">
<input type="hidden" name="case_user" value="<%= fEmployeeEmail %>">
<input type="hidden" name="created_by" value="report_detail">
<input type="hidden" name="refpage" value="report_detail">
<input type="hidden" name="cell_number" value="<%= fMobileNumber %>"">
<%
dim UDLDisplay(6)
oRSUDLMap.MoveFirst
i = 0
j = 0
Do While Not oRSUDLMap.EOF
If oRSUDLMap("Display_Table") = "1" Then
UDLField = oRSUDLMap("UDL_Field")
UDLMapping = oRSUDLMap("UDL_Mapping")
UDLDisplay(j) = UDLField
j = j + 1
End If 'Display_Table
oRSUDLMap.MoveNext
i = Abs(i - 1)
Loop
department_name = UDLDisplay(0)
location_description = UDLDisplay(1)
%>
<% If department_name <> "" Then %>
<input type="hidden" name="department_name" value="<%= department_name %>"">
<% End If %>
<% If location_description <> "" Then %>
<input type="hidden" name="location_description" value="<%= location_description %>">
<% End If %>
<input type="hidden" name="make_model" value="<%= fHandsetModel %>">
<input type="hidden" name="esn_imei" value="<%= fESNIMEI %>">
<label>Ticket Type:</label>
<SELECT name="case_category" class="casecopy">
<% If Session("access_level") =1 then %>
<OPTION SELECTED VALUE="General Support">General Support
<!-- #include virtual="/helpdesk/ticket_types.asp" -->
<% End If %>
</select>
<input type="submit" value="New Case">
</form><br><br><br>
<form action="report_detail.asp" method="get">
<input type="hidden" name="c" value="<%= Company %>">
<input type="hidden" name="n" value="<%= Mobile_Number %>">
<label>Bill Cycle:</label>
<select name="m" onchange="this.form.submit();">
<%
Do While Not oRSBillMonth.EOF
%>
<option value="<%=oRSBillMonth("Bill Month") %>" <%If Bill_Month = CStr(oRSBillMonth("Bill Month")) Then %>selected="true"<% End If %>><%=oRSBillMonth("Bill Month") %></option>
<%
oRSBillMonth.MoveNext
Loop
%>
<%
' cj add
oRSBillMonth.close
set oRSBillMonth=nothing
%>
</select>
<input type="submit" value="Change Month">
</form>
<br><br><br>
<form action="report_detail.asp" method="get">
<input type="hidden" name="actiondetail" value="process">
<input type="hidden" name="m" value="0">
<table class="detail_search">
<tr><td><strong>Search</strong></td></tr>
<tr><td><select name="detailcompany">
<!--#include virtual="/helpdesk/company_inc.asp" -->
</select></td></tr>
<tr><td><label>New Mobile Number</label></td></tr>
<tr><td><input type="text" name="detailnumber" value=""></td></tr>
<tr><td><input type="submit" value="Search"></td></tr>
</table>
</form>
<% end if %>
<% if oRSDefault("report_detail_email") = "Yes" then %>
<br><br><br>
<table class="detail_search">
<tr><td><strong>E-Mail Usage Statement</strong></td></tr>
<tr><td>&nbsp;</td></tr>
<form action="report_detail.asp" method="get">
<input type="hidden" name="actiondetail" value="process">
<input type="hidden" name="m" value="<%= Bill_Month %>">
<input type="hidden" name="detailnumber" value="<%= Mobile_Number %>">
<input type="hidden" name="detailcompany" value="<%= Company %>">
<input type="hidden" name="customemailaddress" value="<%= fEmployeeEmail %>">
<input type="hidden" name="mail_ok" value="1" >
<tr><td align="left">Option 1) <input type="submit" value="Send Statement to End User" <% if fEmployeeEmail = "" then%> disabled <%end if%>></td></tr>
</form>
<form action="report_detail.asp" method="get">
<input type="hidden" name="actiondetail" value="process">
<input type="hidden" name="m" value="<%= Bill_Month %>">
<input type="hidden" name="detailnumber" value="<%= Mobile_Number %>">
<input type="hidden" name="detailcompany" value="<%= Company %>">
<input type="hidden" name="mail_ok" value="1">
<tr><td>&nbsp;</td></tr>
<tr><td align="left">Option 2) <input type="text" name="customemailaddress" value=""></td></tr>
<tr><td><input type="submit" value="Send Statement to E-Mail Address"></td></tr>
</form>
</table>
<% End If %>
<% If Not oRSSplits.EOF Then %>
<br><br><br>
<table class="detail_search">
<tr><td colspan="3"><strong>View Split Statement</strong></td></tr>
<tr>
<td><strong>Amount</strong></td>
<td><strong>Location</strong></td>
<td>&nbsp;</td>
</tr>
<% Do While Not oRSSplits.EOF %>
<tr>
<%
If oRSSplits("split_bill_method") = "Percent" Then
amount = ( CDbl( oRSReport("Total Allocated Charge") ) * CDbl( oRSSplits("splits_percent")) )
split_type = "P"
ElseIf oRSSplits("split_bill_method") = "Fixed" Then
amount = oRSSplits("splits_value")
split_type = "F"
ElseIf oRSSplits("split_bill_method") = "Fixed Carryover" Then
amount = oRSSplits("splits_value")
split_type = "FC"
End If
%>
<td align="right"> (<%= split_type %>) <%= FormatCurrencyInline(amount, fCarrier) %></td>
<td><%= oRSSplits("splits") %></td>
<td><a href="report_detail.asp?m=<%= Bill_Month %>&n=<%= Mobile_Number %>&c=<%= Company %>&amt=<%= amount %>&override=<%= oRSSplits("User Name") %>&billing_split=<%= oRSSplits("splits") %>">View</a></td>
</tr>
<% oRSSplits.MoveNext
Loop %>
<tr>
<td align="right"><%= FormatCurrencyInline(oRSReport("Total Allocated Charge"), fCarrier )%></td>
<td>&nbsp;</td>
<td><a href="report_detail.asp?m=<%= Bill_Month %>&n=<%= Mobile_Number %>&c=<%= Company %>">View Total</a></td>
<tr><td align="left" colspan="3">F = Fixed Charge Split</td></tr>
<tr><td align="left" colspan="3">FC = Fixed Carryover Charge Split</td></tr>
<tr><td align="left" colspan="3">P = Percentage Split</td></tr>
</table>
<% End If %>
</td>
<br><td width="70%">
<% dim msgBody, Mail, SenderEmail, SenderName, bcc, ErrStr, mail_ok
if actiondetail <> "process" then
Company = request("c")
If Company= "Rogers" Then
Company = "Rogers Corporation"
ElseIf Company= "Thermo" Then
Company = "Thermo Fisher"
End If
end if
companyAlias = Company
'override thermo fisher lsg naming
If companyAlias = "Thermo Fisher - LSG" Then
companyAlias = "Thermo Fisher"
End If
'get the base
dim iSp : iSp = 0
Do Until oRSReport.EOF
'this is used for just the Splitting purposes...
AccountNumber = oRSReport("Account Number")
iSp = iSp + 1
'Start Splits Process --------------------------------------------------
' 1 == percentage
' 4 == fixed
' 5 == fixed carry over
splitSQL = "SELECT"&_
" CASE"&_
" WHEN spl.BillMethodId = 1 THEN CONCAT( '$',ROUND(alloc.`Total Allocated Charge` * spl.SplitValue , 2) )"&_
" WHEN spl.BillMethodId = 4 THEN CONCAT( '$',ROUND(spl.SplitValue , 2) )"&_
" WHEN spl.BillMethodId = 5 THEN CONCAT( '$',ROUND(spl.SplitValue , 2) )"&_
" END AS Ratio, spl.BillMethodId,"&_
" sp.LocationCode FROM split AS spl "&_
" INNER JOIN splitproject AS sp ON sp.id = spl.ProjectCode"&_
" INNER JOIN allocations AS alloc ON alloc.`Mobile Number` = spl.MobileNumber "&_
" WHERE spl.LastUpdated IS NULL AND spl.MobileNumber = '{0}' AND alloc.`Bill Month` = '{1}' AND alloc.`Account Number` = '{2}'"
set oRSSplitProjects = db.getRS(splitSQL, array(Mobile_Number, formatDateToSQL(Bill_Month), AccountNumber) )
'set up splits ONLY if this line is a split Line infact
dim isSplitLine : isSplitLine = false 'will save us some trips later
if not oRSSplitProjects.EOF then
'we have multiple Account numbers,
'because we would enter this split again
if iSp > 1 then
set sp2 = new Splits
with sp2
.setMobileNumber(Mobile_Number)
.setBillMonth(Bill_Month)
.setCompany(company)
.setup()
end with
else
set sp = new Splits
with sp
.setMobileNumber(Mobile_Number)
.setBillMonth(Bill_Month)
.setCompany(company)
.setup()
end with
end if
isSplitLine = true
end if
'--------------------- END Splits
'if mail_ok <> 1 then
Set rsLastPhone = db.getRS("select case_open from `case` where((cell_number= '" & oRSReport("Mobile Number") & "') AND (case_category ='Phone Replacement' Or case_category='New Phone' Or case_category='New Service' or case_category = 'Line Port' or case_category= 'Line Port - Corp Liable')) order by case_open desc","")
If rsLastPhone.EOF Then
Set rsInvRestock = db.getRS("select case_open from `case` where((cell_number= '" & oRSReport("Mobile Number") & "') AND (case_category ='Inventory Restock')) order by case_open desc","")
If rsInvRestock.EOF Then
If oRSReport("Contract End Date") = "" or oRSReport("Contract End Date") = "1/1/1900" or oRSReport("Contract End Date") = "12/31/2099" Then
last_upgrade = "N/A"
Else
If oRSReport("Contract Term") = "0" Then
last_upgrade = "N/A"
Else
last_upgrade = DateAdd("m",-FormatNumber(oRSReport("Contract Term"),0),oRSReport("Contract End Date"))
End If
End If
Else
last_upgrade = "N/A"
End If
Else
last_upgrade = FormatDateTime(rsLastPhone("case_open"),2)
End If
'End If
if oRSReport( "BB") = "1" OR oRSReport("PDA") = "1" OR oRSReport("iPhone") = "1" then
Line_Type = "Smartphone"
if (oRSReport("line_type") = "Tablet") then Line_Type = "Tablet" end if
Elseif oRSReport("line_type") = "Tablet" and oRSReport("Voice") ="0" then
Line_Type = "Tablet"
Elseif oRSReport("Data Cards") = "1" AND oRSReport("line_type") <> "Machine2Machine" then
Line_Type = "Data Card"
Elseif oRSReport("line_type") = "Machine2Machine" then
Line_Type = "M2M"
Elseif oRSReport("BB") + oRSReport("PDA") + oRSReport("iPhone") + oRSReport("Data Cards") = "0" AND oRSReport("Carrier") <> "iPass" then
Line_Type = "Voice"
Elseif oRSReport("Carrier") = "iPass" then
Line_Type = "iPass"
End if
If oRSReport("BB") = 1 Then
oldLine_Type = "Blackberry device"
ElseIf oRSReport("PDA") = 1 Then
oldLine_Type = "PDA device"
ElseIf oRSReport("Data Cards") = 1 Then
oldLine_Type = "Data Card device"
ElseIf oRSReport("iPhone") = 1 AND oRSReport("line_type") <> "Tablet" Then
oldLine_Type = "iPhone device"
Elseif oRSReport("iPhone") = 1 AND Line_Type = "Tablet" then
oldLine_Type = "iPad device"
Elseif oRSReport("Carrier") = "iPass" then
oldLine_Type = "service"
ElseIF oRSReport("BB") <> 1 and oRSReport("PDA") <> 1 and oRSReport("iPhone") <> 1 and oRsReport("Data Cards") <> 1 Then
oldLine_Type = "Voice device"
End If
'show thw appropraite service types
dim deviceType : deviceType = DisplayServiceType(oRSReport("BB"),oRSReport("PDA"), oRSReport("iPhone"), oRSReport("Data Cards") )
If mail_ok = 1 Then
msgBody = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html>"
msgBody = msgBody & "<head>"
msgBody = msgBody & " <title>Report Mailer</title>"
msgBody = msgBody & "<STYLE type='text/css'>"
msgBody = msgBody & "#interface { width: 100%; margin: 0 0 10px 0; background-color: #ffffff;}"
msgBody = msgBody & "#interface #reportdetailudl { width: 997px ; margin-left: auto ; margin-right: auto; }"
msgBody = msgBody & "#interface #reportdetailudl img {margin-top: 2.5px}"
msgBody = msgBody & "#interface #reportdetailudl a {margin-left: 470px}"
msgBody = msgBody & "#interface #reportdetailudl tr .alt { background-color: #d0e1f8;}"
msgBody = msgBody & "#interface #reportdetailudl tr .alt h1{ color: #003366;}"
msgBody = msgBody & "#interface #reportdetailudl td .alt { color: #ff690a;}"
msgBody = msgBody & "#interface #reportdetailudl td.highlight { background-color: #FAFF00;}"
msgBody = msgBody & ".reportdetailudlnew { width: 991px; border-collapse: collapse; margin-left: auto ; margin-right: auto;}"
msgBody = msgBody & ".reportdetailudlnew td{LINE-HEIGHT: 16px; FONT-FAMILY: verdana, arial, helvetica, sans-serif; COLOR: #333333; FONT-SIZE: 8pt; padding: .5px .5px .5px .5px; border-bottom:1px dotted #bbccdd;}"
msgBody = msgBody & ".reportdetailudlbottom td{LINE-HEIGHT: 16px; FONT-FAMILY: verdana, arial, helvetica, sans-serif; COLOR: #333333; FONT-SIZE: 8pt; padding: .5px .5px .5px .5px; }"
msgBody = msgBody & ".reportdetailudlnew h1{color: #000000; font-size: 14px; }"
msgBody = msgBody & ".reportdetailudlnew h4{color: #000000; FONT-SIZE: 8pt; font-weight: bold;}"
msgBody = msgBody & ".reportdetailudlhead {color:#003366; font-size: 14px; font-weight: bold;}"
msgBody = msgBody & "tr.altdetail {background-color: #d0e1f8;}"
msgBody = msgBody & "</STYLE>"
msgBody = msgBody & " </head>"
msgBody = msgBody & " <body>"
End If
If mail_ok = 1 Then
msgBody = msgBody & "<div id='interface'>"
Else
msgBody = "<div id='interface'>"
if company = "Thermo Fisher" then
msgBody = msgBody & "" &_
"<table width='100%'>" &_
"<tr> <td align='center'>"&_
"<a class='button' style='font-size: 1.4em' href='mailto:billing@wirelessanalytics.com?Subject=Billing%20Request%3A%20"&company&"%20-%20"&Bill_Month&"%20Statement%20-%20"&Mobile_Number&"&Body=Please%20send%20detailed%20statement%20for%3A%20%0AName%3A%20" & oRSReport("User Name") &"%20%0AMobile%20Number%3A%20"&FormatPhoneNumber(Mobile_Number)&"%20%0ABill%20Month%3A%20"& Bill_Month&"'>" &_
"For more detailed information about these charges, please click Here</a>" &_
"</td>" &_
"<tr>" &_
"<tr><td>&nbsp;</td></tr>" &_
"</table>"
end if
End If
msgBody = msgBody & "<div id='reportdetailudl'>"
msgBody = msgBody & "<div id='t'><div id='b'><div id='l'><div id='r'><div id='bl'><div id='br'><div id='tl'><div id='tr'>"
If mail_ok = 1 Then
msgBody = msgBody & "<table style='border: 1px solid black;'><tr><td>"
End If
msgBody = msgBody & "<table class='reportdetailudlnew'>"
If mail_ok = 1 Then
if Company = "Babcock Power" Then
msgBody = msgBody & "<tr><td colspan='4' align='left'><span style='font-size: 14px; font-weight: bold; color: #FF0000;'>Babcock Power Monthly Usage Statement</span></td></tr>"
else
msgBody = msgBody & "<tr><td colspan='4'><img src='cid:banner'></td></tr>"
end if
msgBody = msgBody & "<tr><td colspan='4'>You are receiving this Wireless Device Usage and Cost Notification because our records show that you are registered to the below "& companyAlias &" "& oldLine_Type &". This will be sent to you each month in order to help you understand and monitor your wireless costs. "& companyAlias &" requests your assistance in reducing the cost of wireless services to the company. Please review your usage and costs each month and make every effort to manage your costs effectively. <br><br><span style='color: #FF0000; font-weight: bold;'>PLEASE NOTE THAT THIS IS NOT AN INVOICE.</span>"
msgBody = msgBody & "<br><strong>Questions about this statement?</strong> Email <a href='mailto:billing@wirelessanalytics.com?Subject=Billing Request: " & Company & " - " & oRSReport("Bill Month") & " Statement - " & oRSReport("Mobile Number") & "'>billing@wirelessanalytics.com</a><br>"
msgBody = msgBody & "<strong>Need other assistance?</strong> For technical support, questions about device ordering, or plan/feature changes, email <a href='mailto:support@wirelessanalytics.com?Subject=Support Request: " & Company & " - " & oRSReport("Bill Month") & " Statement - " & oRSReport("Mobile Number") & "'>support@wirelessanalytics.com</a> or log in to your <a href='https://www.wirelessanalytics.com/platform/login.asp'>Wireless Portal</a>.<br><br>"
If Line_Type = "Data Card" Then
msgBody = msgBody & "<br><br><span style='color: #FF0000; font-weight: bold;'>ALL DATA CARDS HAVE A UNIQUE MOBILE NUMBER.</span><br><br></td></tr>"
Else
msgBody = msgBody & "</td></tr>"
End If
Else
msgBody = msgBody & "<tr><td colspan='4'><img src='" &cf_formatLink(oRSDefault("Header_Image_mailer"),"local") &"'></td></tr>"
End If
msgBody = msgBody & "<tr class='alt'><td colspan='2' align='left' ><h1>"
If billingsplit <> "" Then
msgBody = msgBody & name &": "
msgBody = msgBody & FormatPhoneNumber(oRSReport("Mobile Number"))& "</h1></td><td colspan ='2'align='right' ><h1>Total Allocated Charge: " & FormatCurrencyInline(split_amount, oRSReport("Carrier")) &"</h1></td></tr>"
Else
If oRSReport("User Name") <> "" AND emailType <> "iPassEmailOk" Then
msgBody = msgBody & oRSReport("User Name") &": "
Elseif emailType = "iPassEmailOk" then
msgBody = msgBody
Else
msgBody = msgBody & "Mobile #: "
End IF
msgBody = msgBody & FormatPhoneNumber(oRSReport("Mobile Number"))& " </h1></td>"
'Show if line has been inactive for more than 2 months'
If oRSReport("Months Zero Use") >= 2 then
msgBody = msgBody & "<td><h1>Months Of Zero Use:" & oRSReport("Months Zero Use") & "</h1></td>"
End if
msgBody = msgBody & "<td colspan ='2'align='right' ><h1>Total Allocated Charge: " & FormatCurrencyInline(oRSReport("Total Allocated Charge"), oRSReport("Carrier")) &" (" & GetCurrencyISO(oRSReport("Carrier")) & ")</h1></td></tr>"
End If
dim billMonth : billMonth = split(oRSReport("Bill Month"),"/")
dim readableBillMonth : readableBillMonth = MonthName(billMonth(0)) & " " & Year(oRSReport("Bill Month"))
dim readableUsername : readableUsername = oRSReport("User Name")
dim readableMobileNumber : readableMobileNumber = FormatPhoneNumber(oRSReport("Mobile Number"))
msgBody = msgBody & "<tr><td width='25%'><h4>Bill Month</h4></td><td width='25%'>"& MonthName(billMonth(0)) & " " & Year(oRSReport("Bill Month")) &"</td><td width='25%' style='background-color: #FAFF00'><h4>Service Coverage within Billing Cycle</h4></td><td width='25%' style='background-color: #FAFF00'>" & oRSReport("Bill Period") & "</td></tr>"
msgBody = msgBody & "<tr><td width='25%'><h4>Carrier</h4></td><td width='25%'>"&oRSReport("Carrier")&"</td><td width='25%'><h4>Line Type</h4></td><td width='25%'>" & Line_Type & "</td></tr>"
If oRSReport("Handset Model") <> "" Then
msgBody = msgBody & "<tr><td><h4>Handset Model</h4></td><td>" & FormatSimDevice(oRSReport("Handset Model")) & "</td>"
Else
msgBody = msgBody & "<tr><td><h4>Handset Model</h4></td><td> - </td>"
End If
If oRSReport("SIM") <> "" Then
If InStr(oRSReport("SIM"),"|") Then
'lets find out how many devices we have
deviceCount = GetSubstringCount(oRSReport("ESN/IMEI"), "|", FALSE)
If deviceCount > 0 Then
'add one to pipes found to get number of devies, and number of breaks to add into cell
brkNumber = deviceCount
brkHold = ""
iHold = 1
Do While iHold <= brkNumber
brkHold = brkHold & "<br />"
iHold = iHold + 1
Loop
End If
'add one to pipes found to get number of devies, and number of breaks to add into cell
brkNumber = deviceCount + 1
msgBody = msgBody & "<td><h4>IMEI/ESN</h4>" & brkHold & "<h4>Primary SIM</h4><h4>UltraSIM's</h4></td><td>" & FormatSimDevice(oRSReport("ESN/IMEI")) & FormatSimDevice(oRSReport("SIM")) & " </td>"
Else
msgBody = msgBody & "<td><h4>IMEI/ESN - SIM</h4></td><td>" & oRSReport("ESN/IMEI") & " - " & oRSReport("SIM") & " </td>"
End If
Elseif oRSReport("ESN/IMEI") = "" AND oRSReport("SIM") = "" then
msgBody = msgBody & "<td><h4>IMEI/ESN - SIM</h4></td><td> - </td>"
Else
msgBody = msgBody & "<td><h4>IMEI/ESN - SIM</h4></td><td>" & oRSReport("ESN/IMEI") & "</td>"
end if
msgBody = msgBody & "</tr>"
If billingsplit <> "" Then
laz_location = "<strong>Location:</strong> " & billingsplit
Else
laz_location = ""
End If
If mail_ok = 1 Then
msgBody = msgBody & "<tr ><td><h4>Status</h4></td><td>" & Line_Status & " :: " & laz_location & "</td>"
Else
If access_level > 1 Then
msgBody = msgBody & "<tr ><td><h4>Status</h4></td><td>" & Line_Status & " :: " & laz_location & "</td>"
Else
if oRSReport("Comments") <> "" then
msgBody = msgBody & "<tr><td><h4>Status</h4></td><td>" & oRSReport("Comments") & " :: " & laz_location & "</td></tr>"
Else
msgBody = msgBody & "<tr><td><h4>Status</h4></td><td> - " & laz_location & "</td></tr>"
End if
End If
End If
If mail_ok <> 1 then
If Session("access_level") < 2 then
msgBody = msgBody & "<tr><td><h4>Account</h4></td><td>" & oRSReport("Account Number") & "</td><td></tr>"
End if
End if
' If mail_ok <> 1 then
if last_upgrade <> "N/A" then
msgBody = msgBody & "<tr><td><strong>Last Upgraded</strong></td><td>"& DateDiff("m",last_upgrade, Date()) & " months ago (" & last_upgrade &")</td></tr>"
Else
msgBody = msgBody & "<tr><td><strong>Last Upgraded</strong></td><td>-</td></tr>"
End if
' End if
if Session("access_level") = 1 AND mail_ok <> 1 then
if oRSReport("Contract Term") <> "1/1/1900" then
msgBody = msgBody & "<tr><td><strong>Contract Term</strong></td><td>"& oRSReport("Contract Term") &" months</td>"
Else
msgBody = msgBody & "<tr><td><strong>Contract Term</strong></td><td> N/A </td>"
End if
if oRSReport("Contract End Date") <> 0 then
msgBody = msgBody & "<td><strong>End Date</td><td>" & oRSReport("Contract End Date") &"</td></tr>"
Else
msgBody = msgBody & "<td><strong>End Date</td><td> N/A </td></tr>"
End if
End if
If billingsplit = "" Then 'Splits Hide Start
if mail_ok <> 1 then
msgBody = msgBody & "<tr class='altdetail'><td><span class='reportdetailudlhead'>User Details <img style='cursor:pointer' border='0' src='//" & server_path &"/assets/images/help.png' title='This information is gathered from your company census report' /></span></td><td colspan='3' align='center'>&nbsp;</td></tr>"
Else
msgBody = msgBody & "<tr class='altdetail'><td><span class='reportdetailudlhead'>User Details</span></td><td colspan='3' align='center'>&nbsp;</td></tr>"
End if
msgBody = msgBody & "<tr><td><h4>Employee Email</h4></td><td>"
If oRSReport("Employee Email")<> "" Then
msgBody = msgBody & oRSReport("Employee Email")
Else
msgBody = msgBody & "N/A"
End If
msgBody = msgBody & "</td><td><h4>Employee ID</h4></td><td>"
If oRSReport("PersonID")<> "" Then
msgBody = msgBody & oRSReport("PersonID")
Else
msgBody = msgBody & "N/A"
End If
msgBody = msgBody & "</td></tr>"
msgBody = msgBody & "<tr><td><h4>Supervisor Email</h4></td><td>"
If oRSReport("Supervisor Email Address")<> "" Then
msgBody = msgBody & oRSReport("Supervisor Email Address")
Else
msgBody = msgBody & "N/A"
End If
msgBody = msgBody & "</td><td colspan='2'>&nbsp;</td></tr>"
oRSUDLMap.MoveFirst
i = 0
Do While Not oRSUDLMap.EOF
If oRSUDLMap("Display_Table") = "1" Then
UDLField = oRSUDLMap("UDL_Field")
UDLMapping = oRSUDLMap("UDL_Mapping")
If i = 0 Then
msgBody = msgBody & "<tr><td ><h4> "& UDLMapping &"</h4></td><td> "& oRSReport(UDLField) &"</td>"
Else
msgBody = msgBody & "<td ><h4> "& UDLMapping &"</h4></td><td >" & oRSReport(UDLField) &"</td></tr>"
End If
End If 'Display_Table
oRSUDLMap.MoveNext
i = Abs(i - 1)
Loop
if mail_ok <> 1 then
msgBody = msgBody & "<tr class='altdetail'><td align='left' width='25%'><span class='reportdetailudlhead'>Monthly Plan Charges <img style='cursor:pointer' border='0' src='//" & server_path &"/assets/images/help.png' title='These are the monthly recurring charges for your mobile device' /></span></td><td width='50%' colspan='2' align='center'>&nbsp;</td><td class='highlight' width='25%' align='right'><h4>Category Total: "& FormatCurrencyInline( CDbl(oRSReport("Adjusted Access $"))+CDbl(oRSReport("BB $"))+CDbl(oRSReport("PDA $"))+CDbl(oRSReport("iPhone $"))+CDbl(oRSReport("Features $"))+CDbl(oRSReport("Data Cards $")), oRsReport("Carrier") ) &"</h4></td></tr>"
Else
msgBody = msgBody & "<tr class='altdetail'><td align='left' width='25%'><span class='reportdetailudlhead'>Monthly Plan Charges</span></td><td width='50%' colspan='2' align='center'>&nbsp;</td><td class='highlight' width='25%' align='right'><h4>Category Total: "& FormatCurrencyInline( CDbl(oRSReport("Adjusted Access $"))+CDbl(oRSReport("BB $"))+CDbl(oRSReport("PDA $"))+CDbl(oRSReport("iPhone $"))+CDbl(oRSReport("Features $"))+CDbl(oRSReport("Data Cards $")), oRsReport("Carrier") ) &"</h4></td></tr>"
End if
msgBody = msgBody & "<tr><td>"
If oRSReport("Pool Group")="-9" or oRSReport("Pool Group")="-8" or oRSReport("Pool Group")="-7" or oRSReport("Pool Group")="-6" or oRSReport("Pool Group")="-2" or oRSReport("Pool Group")="-1" or oRSReport("Pool Group")="0" Then
if oRSReport("Carrier") = "iPass" then
msgBody = msgBody & "<h4>Adjusted Access</h4>"
else
msgBody = msgBody & "<h4>Voice Plan </h4>"
end if
Elseif (Line_Type = "Tablet" OR Line_Type = "Data Card") Then
if oRSReport("iPhone") = 1 then Line_Type = "iPad" End if
msgBody = msgBody & "<h4>"&Line_Type&"</h4>"
ElseIF oRSReport("Pool Group") > 0 Then
msgBody = msgBody & "<h4>Pooled Minute Usage </h4>"
End If
msgBody = msgBody & "</td><td width='25%'>"
If Line_Type = "Data Card" Then
msgBody = msgBody & FormatCurrencyInline(oRSReport("Data Cards $"), oRSReport("Carrier"))
'Elseif Line_Type = "Smartphone" AND oRSReport("Data Cards") <> 1 AND oRSReport("Pool Group") > 0 then
'' msgBody = msgBody & FormatCurrencyInline(oRSReport("Adjusted Access $"), oRSReport("Carrier"))
Elseif Line_Type = "Tablet" OR Line_Type = "iPad" then
if Line_Type = "iPad" OR oRSReport("iPhone") = 1 then
msgBody = msgBody & FormatCurrencyInline(oRSReport("iPhone $"), oRSReport("Carrier"))
Else
msgBody = msgBody & FormatCurrencyInline(oRSReport("PDA $"), oRSReport("Carrier"))
End if
Else
msgBody = msgBody & FormatCurrencyInline(oRSReport("Adjusted Access $"), oRSReport("Carrier"))
End If
msgBody = msgBody & "</td><td colspan=2><strong>&nbsp;</strong> "
if Line_Type <> "Data Card" then
If access_level = 1 Then
If mail_ok = 1 Then
If oRSReport("Pool Group")> 0 Then
msgBody = msgBody & "Corporate Pool Plan"
Else
msgBody = msgBody & oRSReport("Plan Name")
End If
Else
msgBody = msgBody & oRSReport("Plan Name")
End If
Else
If oRSReport("Pool Group") > 0 Then
msgBody = msgBody & "Corporate Pool Plan"
Else
msgBody = msgBody & oRSReport("Plan Name")
End If
End If
Else
If Company = "PAREXEL" Then
msgBody = msgBody & "</tr>"
msgBody = msgBody & "<tr>"
msgBody = msgBody & "<td>&nbsp;&nbsp;<strong>Domestic</strong></td>"
msgBody = msgBody & "<td>" & FormatCurrencyInline(CDbl( oRSReport("Data Cards $") ) - CDbl( oRSReport("Data Add-On Int $") ) , oRSReport("Carrier")) & "</td>"
msgBody = msgBody & "<td colspan='3'>" & oRSReport("Plan Name") & "</td>"
msgBody = msgBody & "</tr>"
msgBody = msgBody & "</tr>"
If oRSReport("Feature KB Email Int") + oRSReport("Plan KB Int") > 0 Then
msgBody = msgBody & "<tr>"
msgBody = msgBody & "<td>&nbsp;&nbsp;<strong>International</strong></td>"
msgBody = msgBody & "<td>" & FormatCurrencyInline(CDbl(oRSReport("Data Add-On Int $")) , oRSReport("Carrier"))& "</td>"
msgBody = msgBody & "<td colspan='2'>"& deviceType &"</td>"
msgBody = msgBody & "</tr>"
End If
Else
msgBody = msgBody & deviceType
End If
End if
msgBody = msgBody & "</tr>"
If (oldLine_Type = "Blackberry device" or oldLine_Type = "PDA device" or oldLine_Type = "iPhone device") AND Line_Type <> "Tablet" OR oldLine_Type = "iPad device" Then
msgBody = msgBody & "<tr>"
msgBody = msgBody & "<td colspan='4'><strong>Data Feature</strong></td>"
msgBody = msgBody & "</tr>"
msgBody = msgBody & "<tr>"
msgBody = msgBody & "<td>&nbsp;&nbsp;<strong>Domestic</strong></td>"
If oldLine_Type = "Blackberry device" Then
msgBody = msgBody & "<td>" & FormatCurrencyInline(CDbl( oRSReport("BB $") ) - CDbl( oRSReport("Data Add-On Int $") ) , oRSReport("Carrier")) & "</td>"
ElseIf oldLine_Type = "PDA device" AND Line_Type <> "Tablet" Then
msgBody = msgBody & "<td>" & FormatCurrencyInline(CDbl( oRSReport("PDA $") ) - CDbl( oRSReport("Data Add-On Int $") ) , oRSReport("Carrier")) & "</td>"
ElseIf oldLine_Type = "iPhone device" AND Line_Type <> "Tablet" Then
if( isNull( oRSReport("iPhone $") ) ) then siPhone = 0 else siPhone = oRSReport("iPhone $") end if
if( isNull(oRSReport("Data Add-On Int $"))) then sDataAddOn = 0 else sDataAddOn = oRSReport("Data Add-On Int $") end if
msgBody = msgBody & "<td>" & FormatCurrencyInline( CDbl(siPhone) - CDbl(sDataAddOn) , oRSReport("Carrier")) & "</td>"
ElseIf oldLine_Type = "iPad device" Then
msgBody = msgBody & "<td>" & FormatCurrencyInline(CDbl( oRSReport("iPhone $") ) - CDbl( oRSReport("Data Add-On Int $") ) , oRSReport("Carrier")) & "</td>"
End If
msgBody = msgBody & "<td colspan='2'>&nbsp;&nbsp;" & DisplayDomesticData() & "</td>"
msgBody = msgBody & "</tr>"
If ( oRSReport("Feature KB Email Int") + oRSReport("Plan KB Int") ) > 0 OR CDbl( oRSReport("Data Add-On Int $") ) > 0 Then
msgBody = msgBody & "<tr>"
msgBody = msgBody & "<td>&nbsp;&nbsp;<strong>International</strong></td>"
msgBody = msgBody & "<td>" & FormatCurrencyInline(CDbl(oRSReport("Data Add-On Int $")) , oRSReport("Carrier"))& "</td>"
msgBody = msgBody & "<td colspan='2'>&nbsp;&nbsp;"& DisplayIntlData() &"</td>"
msgBody = msgBody & "</tr>"
End If
msgBody = msgBody & "</tr>"
End If
If oldLine_Type = "Voice device" and CDbl( oRSReport("Tethering $") ) > 0 Then
msgBody = msgBody & "<tr><td><h4>Laptop Tethering $</h4></td><td>"& FormatCurrencyInline(oRSReport("Tethering $"), oRSReport("Carrier")) &"</td><td colspan='2'>&nbsp;</td></tr>"
End If
If CDbl( oRSReport("Txt Msg Plan $") ) <> 0 or CDbl( CDbl( oRSReport("Text Plan Allowance") ) ) <> 0 OR CDbl( oRSReport("Txt Msg Plan $") ) <> 0 Then
msgBody = msgBody & "<tr><td><h4>Text Message Feature</h4></td><td>"& FormatCurrencyInline(oRSReport("Txt Msg Plan $"), oRSReport("Carrier")) &"</td><td colspan='2'>&nbsp;&nbsp;" & DisplayTextMsg() &"</td></tr>"
End If
If CDbl( oRSReport("Int RM Plan $") ) <> 0 OR oRSReport("Int RM Plan") <> "N" AND emailType <> "iPassEmailOk" Then
msgBody = msgBody & "<tr><td><h4>International Roaming</h4></td><td>"& FormatCurrencyInline(oRSReport("Int RM Plan $"), oRSReport("Carrier")) &"</td><td colspan='2'>&nbsp;&nbsp;"& oRSReport("Int RM Plan") &"</td></tr>"
End If
If CDbl( oRSReport("Int LD Plan $") ) <> 0 OR oRSReport("Int LD Plan") <> "N" AND emailType <> "iPassEmailOk" Then
msgBody = msgBody & "<tr><td><h4>International Long Distance</h4></td><td>"& FormatCurrencyInline(oRSReport("Int LD Plan $"), oRSReport("Carrier")) &"</td><td colspan='2'>&nbsp;&nbsp;"& oRSReport("Int LD Plan")&"</td></tr>"
End If
If CDbl( oRSReport("Insurance $") ) <> 0 Then
msgBody = msgBody & "<tr><td><h4>Insurance</h4></td><td>"& FormatCurrencyInline(oRSReport("Insurance $"), oRSReport("Carrier")) &"</td><td colspan='2'>&nbsp;</td></tr>"
End If
If CDbl( oRSReport("GPS $") ) <> 0 Then
msgBody = msgBody & "<tr><td><h4>GPS</h4></td><td>"& FormatCurrencyInline(oRSReport("GPS $"), oRSReport("Carrier")) &"</td><td colspan='2'>&nbsp;</td></tr>"
End If
msgBody = msgBody & "<tr><td>&nbsp;</td></tr>"
'>> Usage and Other Charges
if mail_ok <> 1 then
msgBody = msgBody & "<tr class='altdetail'><td align='left' width='25%'><span class='reportdetailudlhead'>Usage and Overage Charges <img style='cursor:pointer' border='0' src='//" & server_path &"/assets/images/help.png' title='This details the allowances and usage for the last bill cycle, as well as any overage charges incurred' /></span></td><td width='50%' colspan='2' align='center'>&nbsp;</td><td class='highlight' width='25%' align='right'><h4>Category Total: "& FormatCurrencyInline( CDbl(oRSReport("Direct Connect $"))+CDbl(CDbl( oRSReport("Text Msg $") ))+CDbl(oRSReport("Data $"))+CDbl( oRSReport("Usage Discount $") )+ CDbl(oRSReport("Intl Roaming $"))+CDbl(oRSReport("Intl Long Distance $"))+CDbl(oRSReport("Directory Asst"))+CDbl(oRSReport("Call Forward $"))+CDbl(oRSReport("Airtime $")), oRSReport("Carrier")) &"</h4></td></tr>"
Else
msgBody = msgBody & "<tr class='altdetail'><td align='left' width='25%'><span class='reportdetailudlhead'>Usage and Overage Charges </span></td><td width='50%' colspan='2' align='center'>&nbsp;</td><td class='highlight' width='25%' align='right'><h4>Category Total: "& FormatCurrencyInline(CDbl(oRSReport("Direct Connect $"))+ CDbl( oRSReport("Usage Discount $") ) +CDbl(CDbl( oRSReport("Text Msg $") ))+CDbl(oRSReport("Data $"))+CDbl(oRSReport("Intl Roaming $"))+CDbl(oRSReport("Intl Long Distance $"))+CDbl(oRSReport("Directory Asst"))+CDbl(oRSReport("Call Forward $"))+CDbl(oRSReport("Airtime $")), oRSReport("Carrier")) &"</h4></td></tr>"
End if
msgBody = msgBody & "<td><h4>&nbsp;</h4></td><td><h4><span style='text-decoration:underline;'>Charge</span></h4></td><td ><h4><span style='text-decoration:underline;'>Usage</span></h4></td><td><h4><span style='text-decoration:underline;'>Allowance</span></h4></td></tr>"
'----------------------VOICE SECTION --------------------'
'category total (Voice)
dim VoiceChargeTtl : VoiceChargeTtl = CDbl( oRSReport("Airtime $") ) + CDbl( oRSReport("US Add-On plan $") ) + CDbl( oRSReport("Intl Roaming $") ) + CDbl( oRSReport("Intl Long Distance $") ) + CDbl( oRSReport("Directory Asst")) + CDbl( oRSReport("Call Forward $") )
dim VoiceUsageTtl : VoiceUsageTtl = CDbl( oRSReport("Directory Asst") ) + CDbl( oRSReport("Pool Minutes Used")) + CDbl( oRSReport("Total Minutes Used") )+ CDbl( oRSReport("Intl Roam Mins") )+ CDbl( oRSReport("Intl LD Mins") )+ CDbl( oRSReport("Can LD Minutes Used") )
if line_type <> "Data Card" AND ( CDbl(VoiceUsageTtl) <> 0 OR CDbl(VoiceChargeTtl) <> 0 ) AND emailType <> "iPassEmailOk" then
msgBody = msgBody & "<tr bgcolor='#E6EFFB'><td><h4>Voice</h4></td><td colspan=3>&nbsp;</td></tr>"
If Line_Type <> "Data Card" Then
if oRSReport("Pool Group") > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Pooled Minutes</h4></td><td>" & FormatCurrencyInline(oRSReport("Airtime $"), oRSReport("Carrier")) &"</td><td>"
Else
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Anytime Minutes</h4></td><td>" & FormatCurrencyInline(oRSReport("Airtime $"), oRSReport("Carrier")) &"</td><td>"
End if
If oRSReport("Pool Group")="-9" or oRSReport("Pool Group")="-8" or oRSReport("Pool Group")="-7" or oRSReport("Pool Group")="-6" or oRSReport("Pool Group")="-2" or oRSReport("Pool Group")="-1" or oRSReport("Pool Group")="0" Then
'msgBody = msgBody & FormatMinutesPlan(oRSReport("Anytime minutes"))
msgBody = msgBody & FormatMinutesPlan(lib.iif(isNull(oRSReport("Anytime minutes")), 0, oRSReport("Anytime minutes")))
ElseIF oRSReport("Pool Group") > 0 Then
'msgBody = msgBody & FormatMinutesPlan(oRSReport("Pool Minutes Used"))
msgBody = msgBody & FormatMinutesPlan(lib.iif(isNull(oRSReport("Pool Minutes Used")), 0, oRSReport("Pool Minutes Used")))
End If
msgBody = msgBody & "</td><td>"
If oRSReport("Pool Group") > 0 Then
msgBody = msgBody & "Pooled Plan"
Else
'msgBody = msgBody & FormatNumber(oRSReport("Pool Plan Minutes"),0) &" Minutes"
msgBody = msgBody & FormatMinutesPlan(lib.iif(isNull(oRSReport("Pool Plan Minutes")), 0, oRSReport("Pool Plan Minutes")))
End If
End If
if CDbl( oRSReport("US Add-On plan $") ) > 0 then
msgBody = msgBody & "<tr><td><h4>US Voice Roaming Feature</h4></td><td>" & FormatCurrencyInline(oRSReport("US Add-On plan $"), oRSReport("Carrier")) &"</td><td>"
End if
if CDbl( oRSReport("Intl Roaming $") ) > 0 OR CDbl( oRSReport("Intl Roam Mins") ) > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;International Roaming</h4></td><td>" & FormatCurrencyInline(oRSReport("Intl Roaming $"), oRSReport("Carrier")) &"</td><td>" & FormatNumber((oRSReport("Intl Roam Mins")),0) &" Minutes</td><td>" & oRSReport("Int RM Plan") &"</td></tr>"
End if
if CDbl( oRSReport("Intl Long Distance $") ) > 0 OR CDbl( oRSReport("Intl LD Mins") ) > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;International Long Distance</h4></td><td>" & FormatCurrencyInline(oRSReport("Intl Long Distance $"), oRSReport("Carrier"))&"</td><td>" & FormatNumber((oRSReport("Intl LD Mins")),0) &" Minutes</td><td>" & oRSReport("Int LD Plan") &"</td></tr>"
End if
if CDbl( oRSReport("Directory Asst") ) > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Directory Assistance</h4></td><td>" & FormatCurrencyInline(oRSReport("Directory Asst"), oRSReport("Carrier")) &"</td><td>N/A</td><td>N/A</td></tr>"
End if
if CDbl( oRSReport("Call Forward $") ) > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Call Forwarding</h4></td><td>" & FormatCurrencyInline(oRSReport("Call Forward $"), oRSReport("Carrier")) &"</td><td>N/A</td><td>N/A</td></tr>"
End if
msgBody = msgBody & "<tr ><td><strong>&nbsp;&nbsp;</strong></td><td><strong style='text-decoration:overline'>" & FormatCurrencyInline(VoiceChargeTtl, oRsReport("carrier")) & "</strong></td><td><strong>&nbsp;</strong></td><td>&nbsp;</td></tr>"
End if
'----------------------IPASS SECTION --------------------'
if emailType = "iPassEmailOk" then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Airtime</h4></td><td>" & FormatCurrencyInline(oRSReport("Airtime $"), oRSReport("Carrier")) &"</td><td>" & oRSReport("Total Minutes Used")&" minutes</td><td>N/A</td></tr>"
end if
'----------------------DATA SECTION --------------------'
If CDbl( oRSReport("Total KB") )> 0 or Line_Type = "Data Card" or CDbl(oRSReport("Data $")) > 0 or oRSReport("Feature KB Email int") > 0 or CDbl( oRSReport("Plan KB Domestic") ) > 0 Then
msgBody = msgBody & "<tr><td colspan='4'>&nbsp;</td></tr>"
msgBody = msgBody & "<tr bgcolor='#E6EFFB'><td><h4>Data</h4></td><td colspan=3>&nbsp;</td></tr>"
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Domestic</h4></td><td>" & FormatCurrencyInline(oRSReport("Domestic Data $"), oRSReport("Carrier")) &"</td><td>" & FormatDataPlan( oRSReport("Domestic Kbs") ) & "</td><td>"
If Line_Type = "Data Card" OR Line_Type = "iPad" OR Line_Type = "Tablet" Then
msgBody = msgBody & FormatDataPlan( CDbl( oRSReport("Plan KB Domestic") ) )
Else
msgBody = msgBody & FormatDataPlan( oRSReport("Feature KB Email Domestic") )
End If
msgBody = msgBody & "</td></tr>"
if CDbl( oRSReport("Int Kbs") ) > 0 OR CDbl( oRSReport("Plan KB Int") ) > 0 OR CDbl( oRSReport("Feature KB Email Int") ) > 0 OR CDbl( oRSReport("Int Data $") ) > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;International Roam</h4></td><td>" & FormatCurrencyInline(oRSReport("Int Data $"), oRSReport("Carrier")) &"</td><td>" & FormatDataPlan( oRSReport("Int Kbs") ) & "</td><td>"
If Line_Type = "Data Card" Then
msgBody = msgBody & FormatDataPlan( oRSReport("Plan KB Int") )
Else
msgBody = msgBody & FormatDataPlan( oRSReport("Feature KB Email Int") )
End If
msgBody = msgBody & "</td></tr>"
End if
if CDbl( oRSReport("Canada Kbs") ) > 0 OR CDbl( oRSReport("Plan KB Canada") ) > 0 OR CDbl( oRSReport("Canada Data $") )then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Canada Roam</h4></td><td>" & FormatCurrencyInline(oRSReport("Canada Data $"), oRSReport("Carrier")) &"</td><td>" & FormatDataPlan( oRSReport("Canada Kbs") ) &"</td><td>"
If Line_Type = "Data Card" Then
msgBody = msgBody & FormatDataPlan( oRSReport("Plan KB Canada") )
Else
msgBody = msgBody & "N/A"
End If
msgBody = msgBody & "</td></tr>"
End if
If ( CDbl( oRSReport("Plan KB Domestic") ) <> 0 AND Line_Type <> "Data Card" ) AND Line_Type <> "iPad" then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Laptop Tethering</h4></td><td>&nbsp;</td><td>" & FormatDataPlan( oRSReport("Domestic Tether Kbs") ) &"</td><td>" & FormatDataPlan( CDbl( oRSReport("Plan KB Domestic") ) ) & "</td></tr>"
End If
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;</h4></td><td><h4 style='text-decoration:overline'>" & FormatCurrencyInline(oRSReport("Data $"), oRSReport("Carrier")) &"</h4></td><td ><h4>&nbsp;</h4></td><td>&nbsp;</td></tr>"
msgBody = msgBody & "<tr><td colspan='4'>&nbsp;</td></tr>"
End If
'domesticTextMsgCostTotal: domesticTextMsgCostTotal = CDbl(oRSReport("Text Msg $")) - CDbl( oRSReport("MMS Msg $") )
'domesticTextMsgUsageTotal: domesticTextMsgUsageTotal = CDbl( oRSReport("Domestic Text Msgs") ) - CDbl( oRSReport("MMS Msg") )
If CDbl( oRSReport("Text Msgs") ) > 0 OR CDbl( oRSReport("Text Plan Allowance") ) > 0 OR CDbl( oRSReport("Domestic Text Msgs") ) > 0 OR CDbl( oRSReport("Text Msg $") ) > 0 Then
msgBody = msgBody & "<tr bgcolor='#E6EFFB'><td><h4>Messaging</h4></td><td colspan='3'>&nbsp;</td></tr>"
msgBody = msgBody & "<tr><td class='reportdetailnew2'><h4>&nbsp;&nbsp;Domestic</h4></td><td>" & FormatCurrencyInline(CDbl(oRSReport("Domestic Text Msg $")) - CDbl( oRSReport("MMS Msg $") ), oRSReport("Carrier")) &"</td><td>" & FormatTextMsg( CDbl( oRSReport("Domestic Text Msgs") ) - CDbl( oRSReport("MMS Msg") ) ) & "</td><td>"
msgBody = msgBody & FormatTextMsg( CDbl( oRSReport("Text Plan Allowance") ) )
msgBody = msgBody & "</td></tr>"
If( oRSReport("MMS Msg") > 0) then
msgBody = msgBody & "<tr><td class='reportdetailnew2'><h4>&nbsp;&nbsp;MMS</h4></td><td>" & FormatCurrencyInline(oRSReport("MMS Msg $"), oRSReport("Carrier")) &"</td><td>" & FormatTextMsg( CDbl( oRSReport("MMS Msg") ) ) & "</td><td>"
msgBody = msgBody & "&nbsp;"
msgBody = msgBody & "</td></tr>"
end if
if CDbl( oRSReport("Int Text Msgs") ) > 0 OR CDbl( oRSReport("Text Plan Allowance Int RM") ) > 0 OR CDbl( oRSReport("Int Text Msg $") ) > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;International Roam</h4></td><td>" & FormatCurrencyInline(CDbl( oRSReport("Int Text Msg $") ), oRSReport("Carrier")) &"</td><td>" & FormatTextMsg( CDbl( oRSReport("Int Text Msgs") ) ) & "</td><td>" & FormatTextMsg( CDbl( oRSReport("Text Plan Allowance Int RM") ) ) & "</td></tr>"
End if
if CDbl( oRSReport("Int LD Text") ) > 0 OR CDbl( oRSReport("Text Plan Allowance Int") ) > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;International LD</h4></td><td>" & FormatCurrencyInline(oRSReport("Int LD Text $"), oRSReport("Carrier")) &"</td><td>" & FormatTextMsg( CDbl( oRSReport("Int LD Text") ) ) & "</td><td>" & FormatTextMsg( CDbl( oRSReport("Text Plan Allowance Int") ) ) &" </td></tr>"
End if
if CDbl( oRSReport("M2M Msg") ) > 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Mobile To Mobile </h4></td><td>" & FormatCurrencyInline(oRSReport("M2M Msg $"), oRSReport("Carrier")) &"</td><td>" & FormatTextMsg( CDbl( oRSReport("M2M Msg") ) ) & "</td><td>N/A</td></tr>"
End if
'' Section totals
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;</h4></td><td><h4 style='text-decoration:overline'>" & FormatCurrencyInline(CDbl( oRSReport("Text Msg $") ), oRSReport("Carrier")) &"</h4></td><td ><h4>&nbsp;</h4></td><td>&nbsp;</td></tr>"
If CDbl( oRSReport("Direct Connect Minutes") ) > 0 or CDbl( oRSReport("Total KB") ) > 0 Then
msgBody = msgBody & "<tr><td colspan='4'>&nbsp;</td></tr>"
End If
End If
If CDbl( oRSReport("Direct Connect Minutes") ) > 0 Then
msgBody = msgBody & "<tr><td><h4>Direct Connect</h4></td><td colspan=3>&nbsp;</td></tr>"
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Direct Connect Private</h4></td><td>" & FormatCurrencyInline(oRSReport("Direct Connect Private $"), oRSReport("Carrier")) &"</td><td>" & oRSReport("Direct Connect Private Minutes") &"</td><td>N/A</td></tr>"
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;International Direct Connect</h4></td><td>" & FormatCurrencyInline(oRSReport("International DC $"), oRSReport("Carrier")) &"</td><td>" & oRSReport("International DC Minutes") &"</td><td>N/A</td></tr>"
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Group Direct Connect</h4></td><td>" & FormatCurrencyInline(oRSReport("Direct Connect Group $"), oRSReport("Carrier")) &"</td><td>" & oRSReport("Direct Connect Group Minutes") &"</td><td>N/A</td></tr>"
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;</h4></td><td style='border-top:1px solid #000'>" & FormatCurrencyInline(oRSReport("Direct Connect $"), oRSReport("Carrier")) &"</td><td >" & CDbl( oRSReport("Direct Connect Minutes") ) &"</td><td>N/A</td></tr>"
If CDbl( oRSReport("Total KB") ) > 0 Then
msgBody = msgBody & "<tr><td colspan='4'>&nbsp;</td></tr>"
End If
End If
if CDbl( oRSReport("Usage Discount $") ) <> 0 then
msgBody = msgBody & "<tr><td><h4>&nbsp;&nbsp;Usage Discount</h4></td><td><strong>" & FormatCurrencyInline(oRSReport("Usage Discount $"), oRSReport("Carrier")) &"</strong></td>&nbsp;<td></td><td>&nbsp;</td></tr>"
End if
if isSplitLine then
if CStr(trim(getMaxSplitMonth("MaxMonth"))) = CStr(trim(Bill_Month)) AND (Session("email") = oRSReport("Mobile Number") OR aut.isUser("CoopAdmin") OR aut.isUser("admin")) AND mail_ok <> 1 then
msgBody = msgBody & "<tr class='altdetail'><td width='25%'><span class='reportdetailudlhead'>Splits</span> </td><td width='50%' colspan='2' align='center'><a href='//"&server_path&"/platform/splits/Default.asp?mobile_number="& Mobile_Number&"&bill_month="& Bill_Month&"&company="&company&"&account_number="&oRSReport("Account Number") &"' target='_blank'>(edit)</a></td><td width='25%' align='right'></td></tr>"
else
msgBody = msgBody & "<tr class='altdetail'><td width='25%'><span class='reportdetailudlhead'>Splits</span> </td><td width='50%' colspan='2' align='center'>&nbsp;</td><td width='25%' align='right'></td></tr>"
end if
msgBody = msgBody & "<tr ><td style='border-bottom:1px solid #000;'><h4>Amount</h4></td><td>&nbsp;</td><td style='border-bottom:1px solid #000;'><h4>Locations</h4></td><td>&nbsp;</td></tr>"
do while not oRSSplitProjects.EOF
msgBody = msgBody & "<tr><td ><h4>"& oRSSplitProjects("Ratio") &"</h4></td><td>&nbsp;</td><td><h4>"&oRSSplitProjects("LocationCode")&"</h4></td><td>&nbsp;</td></tr>"
oRSSplitProjects.MoveNext
Loop
msgBody = msgBody & "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>"
end if
'--- Skip block on iPass Email'
if emailType <> "iPassEmailOk" then
if mail_ok <> 1 then
msgBody = msgBody & "<tr class='altdetail'><td width='25%'><span class='reportdetailudlhead'> One Time Charges <img style='cursor:pointer' border='0' src='//" & server_path &"/assets/images/help.png' title='This covers any charges that are not part of your monthly plan or usage' /></span></td><td width='50%' colspan='2' align='center'>&nbsp;</td><td class='highlight' width='25%' align='right'><h4>Category Total: " & FormatCurrencyInline( CDbl(CDbl(oRSReport("Equipment $")))+CDbl(CDbl(oRSReport("Other $ (discounts / other charges)")))+CDbl(CDbl(oRSReport("Taxes")))+CDbl(CDbl(oRSReport("3rd Party $"))), oRSReport("Carrier") ) &"</h4></td></tr>"
Else
msgBody = msgBody & "<tr class='altdetail'><td width='25%'><span class='reportdetailudlhead'> One Time Charges</span></td><td width='50%' colspan='2' align='center'>&nbsp;</td><td class='highlight' width='25%' align='right'><h4>Category Total: " & FormatCurrencyInline(CDbl(CDbl(oRSReport("Equipment $")))+CDbl(CDbl(oRSReport("Other $ (discounts / other charges)")))+CDbl(CDbl(oRSReport("Taxes")))+CDbl(CDbl(oRSReport("3rd Party $"))), oRSReport("Carrier")) &"</h4></td></tr>"
End if
msgBody = msgBody & "<tr><td><h4>Equipment</h4></td><td>" & FormatCurrencyInline(CDbl(oRSReport("Equipment $")), oRSReport("Carrier")) &"</td><td><h4>3rd Party</h4></td><td>" & FormatCurrencyInline(CDbl(oRSReport("3rd Party $")), oRsReport("Carrier")) &"</td></tr>"
msgBody = msgBody & "<tr><td><h4>Taxes</h4></td><td>" & FormatCurrencyInline(CDbl(oRSReport("Taxes")), oRSReport("Carrier")) &"</td><td><h4>Other Charges and Discounts</h4></td><td>" & FormatCurrencyInline(CDbl(oRSReport("Other $ (discounts / other charges)")), oRsReport("Carrier")) &"</td></tr>"
If Company="ACME" and Mobile_Number="5592211266" Then
msgBody = msgBody & "<form name='calldetail' action='call_detail.asp' method='post'><input type='hidden' name='Mobile_Number' value='"&Mobile_Number&"'><tr><td colspan='4' align='left' ><a href='javascript:calldetail("& Mobile_Number &")' >View Call Detail</a></form></td></tr>"
End If
End If 'Splits Hide End
end if '//--- End Skip block
If line_type = "voice_only" or line_type = "BB_V" or line_type = "PDA_V" Then
End If
If mail_ok = 1 Then
msgBody = msgBody & "</table><br>"
if emailType <> "iPassEmailOk" then
If Company = "Thermo Fisher" Then
msgBody = msgBody & "<table width='995' cellpadding='2' class='reportdetailudlbottom'><tr><td><strong>Are you aware?</strong><br>Each month your wireless service plan and features are proactively managed based upon your historical usage patterns regarding such variables as domestic voice usage, texting, international roaming, international long distance, international data, etc.. If you foresee changes in how you use your wireless device (i.e. an increase in Text Messaging or International Travel/Calling), please alert Wireless Analytics promptly so your plan can be adjusted accordingly. Also, if you are unsure what your plan includes please reach out to Wireless Analytics for an explanation.<br><br><strong>International Users:</strong><br>Voice, data, and text messaging service outside your home country can be extremely expensive. Before traveling outside your home country please make sure that you work with your Wireless Telecom Administrator (WTA) or Wireless Analytics to:<ul><li>review your anticipated wireless voice, email and data connectivity requirements</li><li>confirm whether your current Thermo Fisher provided wireless device(s) meets these requirements and whether changes will need to be made to your service plan</li><li>determine the costs associated with your anticipated international usage</li></ul><br><strong>***Consider a Thermo Fisher Wireless Loaner to reduce these usage costs. A wireless loaner device can save up to 80% in North America and Europe!***</strong>"
if oRSReport("carrier") = "Vodafone UK" Then
msgBody = msgBody & "<br><br><a href='http://www.wirelessanalytics.com/assets/docs/Thermo_international_call_detail.pdf'>Click here</a> to get instructions on how to log-in to view your Call Detail Records (CDR's)."
end if
if oRSReport("UDL11") = "Life Technologies" Then
msgBody = msgBody & "<br><br>For a description of how to understand your Wireless Usage Statement, click <a href='https://lifelink.lifetech.com/docs/DOC-309769'>HERE</a>.<br><br>For any other questions regarding the support of your mobile devices, visit the <a href='https://lifelink.lifetech.com/community/tools_%26_information/information_technology/mobile_devices'>LifeLink Mobile Devices Space</a>.<br><br>"
end if
msgBody = msgBody & "</td></tr></table>"
ElseIf Company = "Thermo Fisher - LSG" Then
msgBody = msgBody & "<table width='995' cellpadding='2' class='reportdetailudlbottom'><tr><td><strong>Are you aware?</strong><br>Each month your wireless service plan and features are proactively managed based upon your historical usage patterns regarding such variables as domestic voice usage, texting, international roaming, international long distance, international data, etc.. If you foresee changes in how you use your wireless device (i.e. an increase in Text Messaging or International Travel/Calling), please alert Wireless Analytics promptly so your plan can be adjusted accordingly. Also, if you are unsure what your plan includes please reach out to Wireless Analytics for an explanation.</td></tr></table><br>"
ElseIf Company = "Vicor" Then
msgBody = msgBody & "<table width='995' class='reportdetailudlbottom'><tr><td><strong>Tip of the Month:</strong></td></tr><tr><td><ul compact><li><strong>Stop dialing 411!</strong> </li><br>Instead of paying up to $1.99 to call 411 to get a number try using one of these free services: 1-800-FREE-411 (1-800-3733-411) is a free service, as is Google 411, which can be reached at 1-800-GOOG-411 (1-800-4664-411). If you have a Blackberry, you could also use the browser on the device and search for the number using Google, Yellowpages.com, or another search tool.<br><li><strong>Smartphone Troubleshooting:</strong> </li><br>Are you experiencing intermittent problems with your Smartphone? A good first step to resolving email, Calendar, Address Book, or even general voice service problems is to remove and reinsert the battery. This can be done by opening the back cover of your device, removing the battery, and reinserting it after 10 seconds. It is also good practice to do this on a weekly basis as a way of preventing issues from arising.<br><li><strong>International Roaming:</strong></li><br>Voice, data, or SMS service outside the US can be extremely expensive. To help us reduce these costs, please make sure that your service is provisioned with the proper features while you're travelling and that you request to have these international features removed when you no longer need them. Also, understand that international wireless use is expensive even if you do have that most appropriate international features offered by your respective carrier. If you plan to travel internationally please consider contacting Wireless Analytics for international usage rates and feature information.</ul></td></tr></table>"
ElseIf Company = "PAREXEL" Then
msgBody = msgBody & "<table width='995' class='reportdetailudlbottom'><tr><td><strong>International Users:</strong><br>Voice, data, and text messaging service outside the US can be extremely expensive. Before traveling outside the US please make sure that you work with Wireless Analytics to:<ul compact><li>Review your anticipated wireless voice, email and data connectivity requirements</li><li>Confirm whether your current PAREXEL provided wireless device(s) meets these requirements and whether changes will need to be made to your service plan</li><li>Determine the costs associated with your anticipated international usage</li></ul><br>Also, please be aware that Wireless Analytics is available Monday – Friday from 8:00 am to 8:00 pm EST. If you need assistance with your wireless device outside of these hours please contact the PAREXEL Service Desk:<ul compact><li><a href='http://service.pxl.int'>http://service.pxl.int</a></li><li>Global Service Desk Extension : #555</li><li>N. America: +1 978 495-4411 (US toll free +1-855-486-2332)</li><li>Uxbridge/UK: +44 1895 614999</li><li>Berlin: +49 30 30685 777</li><li>Kobe (Japan): +81 (0)78-262-4370</li><li>Tokyo (Japan): +81 (0)3-3537-5520</li><li>Taipei: +886(0)2-2176-9698</li><li>India: +000-800440-1913</li><li><a href='mailto:ITExternalRequests@parexel.com'>ITExternalRequests@parexel.com</a></li></ul></td></tr></table>"
End if
End if
If oRSReport("carrier") <> "" AND Company = "PAREXEL" then
msgBody = msgBody & "<table width='995' class = 'reportdetailudlbottom'><tr><td colspan='4'>Please click here for <a href='http://www.wirelessanalytics.com/helpdesk/faqs_wireless_statement.htm' target='_blank'>Frequently Asked Questions</a> or contact Wireless Analytics for more information about your wireless charges or for wireless support in general:"
ElseIf (Company = "PAREXEL") then
msgBody = msgBody & "<table width='995' class = 'reportdetailudlbottom'><tr><td colspan='4'>If you have any questions regarding the above statement or if you would like to make changes please open an internal Service Desk ticket and make sure to use “Wireless” as a key identifier. A local PAREXEL Wireless Telecom Administrator will reply to your inquiry and will be able to assist with any changes. Please note that Wireless Analytics is only providing visibility into your charges and is unable to make any changes with your local wireless carrier"
End if
msgBody = msgBody & "<table width='995' class = 'reportdetailudlbottom'><tr><td colspan='4'>For Support:<ul type='disc' compact class='reportdetailudlbottom'>"
If Company = "Thermo Fisher" Then
msgBody = msgBody & "<li>Go to the wireless portal at <a href='http://www.wirelessanalytics.com'>www.wirelessanalytics.com</a>, click the Login tab and follow the instructions to log in, or to get a new password.</li>"
msgBody = msgBody & "<li>Send an email to <a href='mailto:wireless.support@thermofisher.com '>wireless.support@thermofisher.com</a></li>"
msgBody = msgBody & "<li>Mail to Wireless Analytics, 230 North Street, Danvers, MA 01923</li>"
ElseIf Company = "PAREXEL" then
msgBody = msgBody & "<li>Go to the wireless portal at <a href='http://www.wirelessanalytics.com'>www.wirelessanalytics.com</a>, click the Login tab and follow the instructions to log in, or to get a new password.</li>"
msgBody = msgBody & "<li>Send an email to <a href='mailto:support@wirelessanalytics.com '>support@wirelessanalytics.com</a></li>"
msgBody = msgBody & "<li>Mail to Wireless Analytics, 230 North Street, Danvers, MA 01923</li>"
ElseIf Company = "Thermo Fisher - LSG" then
msgBody = msgBody & "<li>Send an email to <a href='mailto:"&oRSDefault("Contact_Email")&"'>"&oRSDefault("Contact_Email")&"</a></li>"
msgBody = msgBody & "<li>Call the Service Desk at 866-643-0360 and select option 6</li>"
Else
If Company = "SharkNinja" or Company = "Lonza" or Company = "SoundBite" or Company = "Vicor" Then
msgBody = msgBody & "<li>Go to the wireless portal at <a href='http://www.wirelessanalytics.com'>www.wirelessanalytics.com</a>, click the Login tab and follow the instructions to log in, or to get a new password.</li>"
End If
if isUSCarrier(oRSReport("carrier")) then
msgBody = msgBody & "<li>Send an email to <a href='mailto:"&oRSDefault("Contact_Email")&"'>"&oRSDefault("Contact_Email")&"</a></li>"
End if
End If
msgBody = msgBody & "</ul></td></tr></table>"
End If
msgBody = msgBody & "</table></div></div></div></div></div></div></div></div>"
If mail_ok = 1 then
dim mailerType
If emailType = "iPassEmailOk" then
mailerType = "iPass"
else
mailerType = "Wireless Device"
end if
recipient = oRSReport("Employee Email")
SenderEmail = ""&oRSDefault("Contact_Email")&""
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtp.sendgrid.net"
Mail.RegKey = "59931-06309-76540"
Mail.Queue = True 'Queues all messages by default'
Mail.IsHTML = True 'Sends as HTML by default'
Mail.From = "support@wirelessanalytics.com"
Mail.FromName = "WA Support"
Mail.Username = "wirelessanalytics"
Mail.Password = "w1reless"
Mail.Port = 587
Mail.FromName = "Wireless Analytics"
Mail.From = "noreply@wirelessanalytics.com"
If dev = "1" Then
Mail.AddAddress "dev@wirelessanalytics.com"
ElseIf custom_email <> "" Then
Mail.AddAddress custom_email
Else
Mail.AddAddress recipient
End If
Mail.Subject = ""& companyAlias &" Employee "& mailerType & " Usage and Cost Notification " & MonthName(Month(oRSReport("Bill Month"))) &" " & Year(oRSReport("Bill Month")) & ""
Mail.IsHTML = True
Mail.Queue = True
Mail.Body = msgBody
If bcc <> "" Then
Mail.AddBcc bcc
End If
if Company <> "Babcock Power" then
Mail.AddEmbeddedImage root_path & oRSDefault("Header_Image_mailer"), "banner"
end if
On Error Resume Next
Mail.Send
If Err.Description <> "" Then
ErrStr = Err.Description
status = Err.Description
lib.logger.error("Send Error" & status)
Else
ErrStr = oRSReport("Mobile Number")
status = "sent_ok"
End If
On Error Goto 0 ' cancel On Error Resume Next
' clean up
Set Mail = Nothing
'Response.Write ErrStr & "<br />"
If dev = "1" Then
sent_to = "dev@wirelessanalytics.com"
mail_type = "dev"
ElseIf custom_email <> "" Then
sent_to = custom_email
mail_type = "user generated detail page"
Else
sent_to = recipient
mail_type = "end user mailout"
End If
sent_time = FormatDateTime(now,vbLongDateTime)
task_id = Request.Querystring("job_id")
sent_by = Request.Querystring("requestor")
If sent_by <> "" Then
sent_by = escape_apostrophe(sent_by)
Else
sent_by = escape_apostrophe(session("email"))
End If
mailInsert="INSERT INTO mailouts (bill_month, company, mobile_number, carrier, subject, recipient, sent_time, sent_by, mail_type, mail_mtid, status ) "
mailInsert=mailInsert & "VALUES ("
mailInsert=mailInsert & "'" & dbformat_mysqldate(oRSReport("Bill Month")) & "' , "
mailInsert=mailInsert & "'" & oRSReport("Company") & "' , "
mailInsert=mailInsert & "'" & oRSReport("Mobile Number") & "' , "
mailInsert=mailInsert & "'" & oRSReport("Carrier") & "' , "
mailInsert=mailInsert & "'" & companyAlias & " Employee Wireless Device Usage and Cost Notification " & MonthName(Month(oRSReport("Bill Month"))) &" " & Year(oRSReport("Bill Month")) & "' , "
mailInsert=mailInsert & "'" & escape_apostrophe(sent_to) & "' , "
mailInsert=mailInsert & "'" & dbformat_mysqldate(sent_time) & "' , "
mailInsert=mailInsert & "'" & sent_by & "' , "
mailInsert=mailInsert & "'" & mail_type & "' , "
mailInsert=mailInsert & "'" & task_id & "' , "
mailInsert=mailInsert & "'" & status & "' ) "
' Set oConnMail = db.getRS(mailInsert, "")
db.getRS mailInsert, ""
Else
Response.Write msgBody
End If
carrierHold = oRSReport("Carrier")
recordCount = recordCount + 1
oRSReport.MoveNext
If oRSReport.EOF Then Exit Do
Loop
If mail_ok = 1 then
'cleanup mail
Set bm = new BulkMail
bm.update_job_status task_id,2 'mark the job as complete
If Request.Querystring("requestor") <> "" Then 'only update status if it's a job that we queued up
bm.notify_complete task_id, Request.Querystring("requestor"), recordCount 'notify the user
End If
Set bm = Nothing
End If
'If mail_ok = 1 Then
' oConnMail.Close
' Set oConnMail = Nothing
' oConnHelp.Close
' Set oConnHelp = nothing
'End If
'Variables for mail template
%></td><td width="15%">&nbsp;</td></tr>
<tr>
<td colspan="3" align="center">
<% if carrierHold = "Vodafone UK" then %>
<a href='http://www.wirelessanalytics.com/assets/docs/Thermo_international_call_detail.pdf'>Click here</a> to get instructions on how to log-in to view your Call Detail Records (CDR's).<br><br>
<% end if %>
<A HREF="javascript:PrintContent()">Click Here</a> to print a printer friendly version of this page.<br><a href="javascript:history.go(-1)" ><img src="/assets/images/back.png" width="50" height="16" alt="back" /></a>
</td>
</tr></table>
<!-- END: interface -->
</form>
</div><!-- END: report -->
<!--#include virtual="helpdesk/default_footer.asp"-->
<% db.close() %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment