Breakout - SM- Customise Jiwa SM Email with Task Details
Posted: Mon Oct 27, 2008 2:39 pm
Breakout - SM- Customise Jiwa SM Email with Task Details
This is a breakout to add more information for an SM task that will be emailed to a technician, manager, or client. It appends all relevant information and also adds any current task notes that exist for the task from the notes tab. It similarly also adds all current labour lines associated with this task for technicians information with formatted time/date information and a duration for each labour line and the techician name that applies to each individual labour line (which can be different for each line)
from Jiwa :-
JIWA - Service Manager - Maintenance
Record Menu - Utilities - Manage Breakouts
Left-Click "Job Send Mail Before" Breakout
add this one line at the top :-
dont forget to leave the "End Sub" line at the end.
Click OK, Click Close, Close Service Manager and ReOpen Service Manager.
/Roy Adams
This is a breakout to add more information for an SM task that will be emailed to a technician, manager, or client. It appends all relevant information and also adds any current task notes that exist for the task from the notes tab. It similarly also adds all current labour lines associated with this task for technicians information with formatted time/date information and a duration for each labour line and the techician name that applies to each individual labour line (which can be different for each line)
from Jiwa :-
JIWA - Service Manager - Maintenance
Record Menu - Utilities - Manage Breakouts
Left-Click "Job Send Mail Before" Breakout
add this one line at the top :-
- Code: Select all
'
' Job Send Mail Before
'
Dim i, lc, sn, st, et, dur, bdn, ad1, ad2, adSub, adSt, pcd, cn, cnph, notes
lc = JobObject.Tasks(JobObject.SelectedTaskNo).Labours.Count
bdn = JobObject.Tasks(JobObject.SelectedTaskNo).BillingDebtorAccountName
Recipients = Recipients & " ; " & "[email protected]"
ad1 = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).Address1)
ad2 = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).Address2)
adSub = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).Address3)
adSt = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).Address4)
pcd = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).PostCode)
cn = Trim(JobObject.Contact)
cnph = Trim(JobObject.ContactPhoneNo)
notes = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).Comments)
If (ad1 = "") Then
ad1 = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).BillingAddress1)
ad2 = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).BillingAddress2)
adSub = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).BillingAddress3)
adSt = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).BillingAddress4)
pcd = Trim(JobObject.Tasks(JobObject.SelectedTaskNo).BillingPostCode)
End If
If (cnph = "") Then
cnph = Trim(JobObject.DebtorPhone)
End If
If (notes <> "") Then
Body = Body & VBCrLf & VBCrLf & "Notes so far : " & VBCrLf & notes
End If
If(ad2 = "") Then
Body = Body & VBCrLf & VBCrLf & "Address : " & ad1 & ", " & adSub & ", " & adSt & " " & pcd & VBCrLf
Else
Body = Body & VBCrLf & VBCrLf & "Address : " & ad1 & ", " & ad2 & ", " & adSub & ", " & adSt & " " & pcd & VBCrLf
End If
If (cn <> "") Then
Body = Body & VBCrLf & "Contact : " & cn
End If
Body = Body & VBCrLf & "Phone : " & cnph & VBCrLf
For i = 1 To lc
sn = JobObject.Tasks(JobObject.SelectedTaskNo).Labours.Item(i).StaffName
st = JobObject.Tasks(JobObject.SelectedTaskNo).Labours.Item(i).StartTime
et = JobObject.Tasks(JobObject.SelectedTaskNo).Labours.Item(i).EndTime
dur = JobObject.Tasks(JobObject.SelectedTaskNo).Labours.Item(i).ElapsedTime
Body = Body & VBCrLf & _
VBCrLf & "Tech:- " & sn & " " & _
VBCrLf & "Est Start:- " & FormatDateTime(st,4) & " " & FormatDateTime(st,1) & _
VBCrLf & "Est End:- " & FormatDateTime(et,4) & " " & FormatDateTime(et,1) & _
VBCrLf & "Duration:- " & CStr(dur) & " " & "Hrs" & _
VBCrLf & _
"http://jiwa.racs.com.au/JiwaJobSignoff.asp?" & _
"LabourID=" & JobObject.Tasks(JobObject.SelectedTaskNo).Labours.Item(i).LabourID & "&" & _
"QueryStartDate=" & DatePart("d",st) & "/" & MonthName(DatePart("m",st),True) & "/" & DatePart("yyyy",st) & "&" & _
"QueryStartHour=" & Left(FormatDateTime(st,4),2) & "&" & _
"QueryStartMinute=" & Right(FormatDateTime(st,4),2) & "&" & _
"QueryEndDate=" & DatePart("d",et) & "/" & MonthName(DatePart("m",et),True) & "/" & DatePart("yyyy",et) & "&" & _
"QueryEndHour=" & Left(FormatDateTime(et,4),2) & "&" & _
"QueryEndMinute=" & Right(FormatDateTime(et,4),2) & "&" & _
"JobDescriptionNotes=" & Trim(Replace(bdn & " - " & Subject," ","%20")) & _
VBCrLf
Next
End Sub
dont forget to leave the "End Sub" line at the end.
Click OK, Click Close, Close Service Manager and ReOpen Service Manager.
/Roy Adams