Creating Service Job line items  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Creating Service Job line items

Postby neil.interactit » Mon Aug 03, 2015 11:49 am

Gday guys,

I have an external app which interfaces with Outlook and generates SOEs in Jiwa based on staff time allocation recorded in Outlook ... all working beautifully!

I now have an additional requirement on this utility to also be able to add labour line items to a service job ... so (from Outlook) I have the job no, part no, dates, hours - and need to generate a line item based on this detail. I have explored JiwaFinancials.Jiwa.JiwaServiceManager.Job, but can't quite get a handle on retrieving an existing Job and then adding the appropriate line item to it.

Cheers,
Neil.
neil.interactit
Kohai
Kohai
 
Posts: 232
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: Creating Service Job line items

Postby neil.interactit » Thu Aug 06, 2015 11:56 am

Bump
neil.interactit
Kohai
Kohai
 
Posts: 232
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: Creating Service Job line items  Topic is solved

Postby Scott.Pearce » Tue Aug 11, 2015 9:05 am

Well, I guess we need to start by reading in the job to which we want to add labour:

Code: Select all
Dim myJobNo as string = "0000000001"
Dim _Job As JiwaFinancials.Jiwa.JiwaServiceManager.Job = JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(Of JiwaFinancials.Jiwa.JiwaServiceManager.Job)(nothing)
'Read based on JobNo
_Job.Find(JiwaApplication.IJiwaNavigable.ReadModes.Actual, "JobNo", myJobNo, "" )


Now we select the task on the job to which we want to add labour:

Code: Select all
_Job.SelectedTaskNo = 2


Now we construct the new labour line and add it to the job:

Code: Select all
Dim myPartNo as string = "11802"
Dim myStartDate as date = "2015-08-01"
Dim myStartTime as date = "13:00"
Dim newLabourLine As New JiwaFinancials.Jiwa.JiwaServiceManager.LabourLine

newLabourLine.Inventory.ReadRecordFromPartNo(myPartNo)

'Set your values
newLabourLine.StartTime = startDate.ToShortDateString + " " + startTime.ToString("HH:mm")
newLabourLine.BillingTime = 2

_Job.Tasks(_Job.SelectedTaskNo).LabourLines.Add(newLabourLine)


Finally, we save:

Code: Select all
_Job.Save


Always re-read after saving to make sure you have the latest data in the business logic:

Code: Select all
_Job.Read(_Job.RecID)


This is all off the top of my head, so let me know if anything doesn't work for you.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests