What tables does Epicor store which raw material lots and quantities have been issued to a job?
The JobMtl table has the IssuedQty but it doesn’t store which lot it came from. If a job has multiple lots of raw material issued to it, where do I see which lots and how much from each was used?
Is PartTran the only solution? That seems inefficient to have to scan that table each time I want to check which lots and materials were issued.
There are quite a few indexes on PartTran. If your query provides the values for the leading keys, the retrieval isn’t an SQL scan in SQL Server terms. Providing Company and JobNum should give you fairly good response.
And if material is returned… doesn’t that show up in the part tran table as a negative?
So I’ll have to do a SUM and group by part and lot (among other things). Ugh.
Thank you for the info about the indexes. So we’ll need to know the tran date to take advantage of the job index? Bummer, because that’s not something I’d be supplying on my report.
I think a fairly common user stories would be:
Show me all the mtls that have been issued to a job. (Company & JobNum)
Show me all the mtls that have been issued to a specific job operation. (Company, JobNum, AssemblySeq, OprSeq)
No, the index is sorted first by company, then jobbnum, then lotnum then Trandate. If you have the first 3, it can still use the index. Like @Mark_Wonsil said, company and jobnum should get things trimmed down to a fairly small number of rows and then be able to go from there.