Time Phase Due Date <> Job Due Date

I found a few jobs where the Time Phase Due Date and Job Due Date dont match.
I noticed this when I had a date present in JobHead.DueDate, but PartDtl.DueDate was NULL.

Any ideas on why this happens?


Job created and scheduled, which will place the req date on the material.
If later the material is added and the job was not rescheduled, then the added material does not have a Req Date. Giving you a blank date.

We had this in e9 and this is the upgraded version onf E10…but I have this currently disabled.

Data Directive n JobMtl
When JobMtl.ReqDate is null

Erp.Tables.JobOper JobOper;
Erp.Tables.PartDtl PartDtl;
var ttJobMtl_xRow = (from ttJobMtl_Row in ttJobMtl
where (string.Equals(ttJobMtl_Row.RowMod, IceRow.ROWSTATE_ADDED, StringComparison.OrdinalIgnoreCase) || string.Equals(ttJobMtl_Row.RowMod, IceRow.ROWSTATE_UPDATED, StringComparison.OrdinalIgnoreCase))
select ttJobMtl_Row).FirstOrDefault();
if (ttJobMtl_xRow != null)
{
if (ttJobMtl_xRow.RelatedOperation > 0)
{
JobOper = (from JobOper_Row in Db.JobOper
where (JobOper_Row.Company == ttJobMtl_xRow.Company && JobOper_Row.JobNum == ttJobMtl_xRow.JobNum && JobOper_Row.AssemblySeq == ttJobMtl_xRow.AssemblySeq && JobOper_Row.OprSeq == ttJobMtl_xRow.RelatedOperation)
select JobOper_Row).FirstOrDefault();
if (JobOper != null)
{
ttJobMtl_xRow.ReqDate = JobOper.StartDate;
}
}
if (ttJobMtl_xRow.RelatedOperation == 0)
{
JobOper = (from JobOper_Row in Db.JobOper
where (JobOper_Row.Company == ttJobMtl_xRow.Company && JobOper_Row.JobNum == ttJobMtl_xRow.JobNum && JobOper_Row.AssemblySeq == ttJobMtl_xRow.AssemblySeq && JobOper_Row.OprSeq == 10)
select JobOper_Row).FirstOrDefault();
if (JobOper != null)
{
ttJobMtl_xRow.ReqDate = JobOper.StartDate;
}
}
using (var txscope = IceDataContext.CreateDefaultTransactionScope())
{
PartDtl = (from PartDtl_Row in Db.PartDtl.With(LockHint.UpdLock)
where PartDtl_Row.Company == Session.CompanyID &&
PartDtl_Row.JobNum == ttJobMtl_xRow.JobNum &&
PartDtl_Row.PartNum == ttJobMtl_xRow.PartNum &&
PartDtl_Row.RevisionNum == ttJobMtl_xRow.RevisionNum &&
PartDtl_Row.AssemblySeq == ttJobMtl_xRow.AssemblySeq &&
PartDtl_Row.JobSeq == ttJobMtl_xRow.MtlSeq
select PartDtl_Row).FirstOrDefault();
if (PartDtl != null)
{
PartDtl.DueDate = ttJobMtl_xRow.ReqDate;
Db.Validate();
}
txscope.Complete();
}
}

2 Likes

the due date for the job material is not the same as the due date for the job at the job header. the material due date comes from the job material related operation date. If the job material has no related operation then it can come in null.