Why doesn't copying project planning lines reset their picked quantity?

cegekaJG
cegekaJG Member Posts: 1

I noticed that when copying project tasks to a new project in Business Central 25.2, the copied planning lines won't reset their fields related to their warehouse pick ("Qty. Picked", "Completely Picked" etc). I thought this was a bug, but even 25.12 has this behavior.

This occurs in the codeunit Copy Job, specifically the procedure CopyJobPlanningLines. Here is the relevant code:

TargetJobPlanningLine.Init();
TargetJobPlanningLine.Validate("Job No.", TargetJobTask."Job No.");
TargetJobPlanningLine.Validate("Job Task No.", TargetJobTask."Job Task No.");
if NextPlanningLineNo = 0 then
NextPlanningLineNo := FindLastJobPlanningLine(TargetJobPlanningLine);
NextPlanningLineNo += 10000;
TargetJobPlanningLine.Validate("Line No.", NextPlanningLineNo);
TargetJobPlanningLine.TransferFields(SourceJobPlanningLine, false);
if not CopyPrices then
TargetJobPlanningLine.UpdateAllAmounts();

TargetJobPlanningLine."Remaining Qty." := 0;
TargetJobPlanningLine."Remaining Qty. (Base)" := 0;
TargetJobPlanningLine."Remaining Total Cost" := 0;
TargetJobPlanningLine."Remaining Total Cost (LCY)" := 0;
TargetJobPlanningLine."Remaining Line Amount" := 0;
TargetJobPlanningLine."Remaining Line Amount (LCY)" := 0;
TargetJobPlanningLine."Qty. Posted" := 0;
TargetJobPlanningLine."Qty. to Transfer to Journal" := 0;
TargetJobPlanningLine."Posted Total Cost" := 0;
TargetJobPlanningLine."Posted Total Cost (LCY)" := 0;
TargetJobPlanningLine."Posted Line Amount" := 0;
TargetJobPlanningLine."Posted Line Amount (LCY)" := 0;
TargetJobPlanningLine."Qty. to Transfer to Invoice" := 0;
TargetJobPlanningLine."Qty. to Invoice" := 0;
TargetJobPlanningLine."Ledger Entry No." := 0;
TargetJobPlanningLine."Ledger Entry Type" := TargetJobPlanningLine."Ledger Entry Type"::" ";
OnCopyJobPlanningLinesOnBeforeTargetJobPlanningLineInsert(TargetJobPlanningLine, SourceJobPlanningLine);
TargetJobPlanningLine.Insert(true);

It looks like the fields aren't being reset on purpose, but why? Since the system can only find related warehouse activity by looking for the planning line's primary key, there will be no activity despite the line saying otherwise.

Am I missing something, or is this a bug that hasn't been fixed?