I am trying to create a subcontract ship list as a BAQ because I can’t seem to find anywhere in Epicor that shows this.
Basically what I’m looking for in the BAQ is -
-Job status is open
-Job operations is marked subcontract
-Job operations is not complete
This is the hardest one for me -
-No open PO lines/releases for the job/ sequence number. (We don’t use subcontract shipment entry so I’m using this as that. If there is an open PO for that job/ seq the subcontract op has been shipped, and does not need to appear on this list.)
I’ve tried PO.Rel and used job number = job number, op seq = op seq. With criteria of line/ release = open, but the issue is if there is not PO, than the job doesn’t show up at all in the BAQ.
Ah crap… I missed that part… ummm… the above may not work in that case. The above would basically filter out the mfg-Ven transactions. But since you’re not using subcontract shipments… you wouldn’t have those anyway.
So, sorry, that approach may not work in your case.
This is not a real query being executed, but a simplified version for general vision.
Executing it with any other tool may produce a different result.
*/
select
[JobHead].[JobNum] as [JobHead_JobNum],
[JobHead].[PartNum] as [JobHead_PartNum],
[Vendor].[Name] as [Vendor_Name],
[JobOper].[PurPoint] as [JobOper_PurPoint],
[JobOper].[CommentText] as [JobOper_CommentText],
[JobOper].[StartDate] as [JobOper_StartDate],
[JobOper].[DaysOut] as [JobOper_DaysOut],
[JobOper].[DueDate] as [JobOper_DueDate],
[PORel].[PONum] as [PORel_PONum]
from Erp.JobHead as JobHead
inner join Erp.JobOper as JobOper on
JobHead.Company = JobOper.Company
and JobHead.JobNum = JobOper.JobNum
and ( JobOper.SubContract = 1 and JobOper.OpComplete = 0 )
inner join Erp.Vendor as Vendor on
JobOper.Company = Vendor.Company
and JobOper.VendorNum = Vendor.VendorNum
inner join Erp.PORel as PORel on
JobOper.Company = PORel.Company
and JobOper.JobNum = PORel.JobNum
and JobOper.OprSeq = PORel.JobSeq
and ( PORel.PONum is null )
where (JobHead.JobComplete = 0)
order by JobOper.StartDate