Page 1 of 1

Creating Service Job line items

PostPosted: Mon Aug 03, 2015 11:49 am
by neil.interactit
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.

Re: Creating Service Job line items

PostPosted: Thu Aug 06, 2015 11:56 am
by neil.interactit
Bump

Re: Creating Service Job line items  Topic is solved

PostPosted: Tue Aug 11, 2015 9:05 am
by Scott.Pearce
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.