...
JnlLineDim.SETRANGE("Journal Batch Name","Journal Batch Name");
JnlLineDim.SETRANGE("Journal Line No.","Line No.");
JnlLineDim.SETRANGE("Allocation Line No.",0);
TempJnlLineDim.DELETEALL;
DimMgt.CopyJnlLineDimToJnlLineDim(JnlLineDim,TempJnlLineDim);
JobJnlPostLine.RunWithCheck(JobJnlLine,TempJnlLineDim);
UNTIL NEXT = 0;
// Copy register no. and current journal batch name to the job journal
IF NOT JobReg.FIND('+') OR (JobReg."No." <> JobRegNo) THEN
JobRegNo := 0;
INIT;
"Line No." := JobRegNo;
...
...
JnlLineDim.SETRANGE("Journal Batch Name","Journal Batch Name");
JnlLineDim.SETRANGE("Journal Line No.","Line No.");
JnlLineDim.SETRANGE("Allocation Line No.",0);
TempJnlLineDim.DELETEALL;
DimMgt.CopyJnlLineDimToJnlLineDim(JnlLineDim,TempJnlLineDim);
JobJnlPostLine.RunWithCheck(JobJnlLine,TempJnlLineDim);
UNTIL NEXT = 0;
// Add the following lines.
InvtSetup.GET;
IF InvtSetup."Automatic Cost Adjustment" <> InvtSetup."Automatic Cost Adjustment"::Never THEN BEGIN
InvtAdjmt.SetProperties(TRUE,InvtSetup."Automatic Cost Posting");
InvtAdjmt.MakeMultiLevelAdjmt;
END;
// End of the lines.
// Copy register no. and current journal batch name to the job journal
IF NOT JobReg.FIND('+') OR (JobReg."No." <> JobRegNo) THEN
JobRegNo := 0;
INIT;
"Line No." := JobRegNo;
...