...
FromDocType::"Return Order":
BEGIN
FromSalesHeader.GET(FromSalesLine."Document Type",FromSalesLine."Document No.");
ItemChargeAssgntNextLineNo := 0;
CopyLine(ToSalesHeader,ToSalesLine,FromSalesHeader,FromSalesLine,NextLineNo);
// Delete the following lines.
IF FromSalesLine.Type = FromSalesLine.Type::"Charge (Item)" THEN
CopyFromSalesDocAssgntToLine(ToSalesLine,FromSalesLine,ItemChargeAssgntNextLineNo);
END;
FromDocType::"Posted Shipment":
BEGIN
FromSalesShptHeader.GET(FromSalesLine."Document No.");
FromSalesHeader.TRANSFERFIELDS(FromSalesShptHeader);
CopyLine(ToSalesHeader,ToSalesLine,FromSalesHeader,FromSalesLine,NextLineNo);
END;
FromDocType::"Posted Invoice":
BEGIN
FromSalesInvHeader.GET(FromSalesLine."Document No.");
FromSalesHeader.TRANSFERFIELDS(FromSalesInvHeader);
CopyLine(ToSalesHeader,ToSalesLine,FromSalesHeader,FromSalesLine,NextLineNo);
// End of the lines.
END;
FromDocType::"Posted Return Order":
BEGIN
...
...
FromDocType::"Return Order":
BEGIN
FromSalesHeader.GET(FromSalesLine."Document Type",FromSalesLine."Document No.");
ItemChargeAssgntNextLineNo := 0;
CopyLine(ToSalesHeader,ToSalesLine,FromSalesHeader,FromSalesLine,NextLineNo);
// Add the following lines.
IF NOT (FromDocType IN ["Document Type"::"Credit Memo","Document Type"::"Return Order"]) THEN
CopytoKitLine.CopyFromKitSalesToLine(ToSalesLine,FromSalesLine);
IF FromSalesLine.Type = FromSalesLine.Type::"Charge (Item)" THEN BEGIN
CopyFromSalesDocAssgntToLine(ToSalesLine,FromSalesLine,ItemChargeAssgntNextLineNo);
CopytoKitLine.CopyFromKitSalesToLine(ToSalesLine,FromSalesLine);
END;
END;
FromDocType::"Posted Shipment":
BEGIN
FromSalesShptHeader.GET(FromSalesLine."Document No.");
FromSalesShptLine.GET(FromSalesLine."Document No.",FromSalesLine."Line No.");
FromSalesHeader.TRANSFERFIELDS(FromSalesShptHeader);
CopyLine(ToSalesHeader,ToSalesLine,FromSalesHeader,FromSalesLine,NextLineNo);
CopytoKitLine.CopyFromKitSalesShptToLine(ToSalesLine,FromSalesShptLine);
END;
FromDocType::"Posted Invoice":
BEGIN
FromSalesInvHeader.GET(FromSalesLine."Document No.");
FromSalesInvLine.GET(FromSalesLine."Document No.",FromSalesLine."Line No.");
FromSalesHeader.TRANSFERFIELDS(FromSalesInvHeader);
CopyLine(ToSalesHeader,ToSalesLine,FromSalesHeader,FromSalesLine,NextLineNo);
CopytoKitLine.CopyFromKitSalesInvToLine(ToSalesLine,FromSalesInvLine);
// End of the lines.
END;
FromDocType::"Posted Return Order":
BEGIN
...
...
FromDocType::"Archived Order":
BEGIN
FromSalesArchHeader.GET(FromSalesLine."Document Type",FromSalesLine."Document No.",
DocNoOccurrence,DocVersionNo);
// Delete the following lines.
FromSalesHeader.TRANSFERFIELDS(FromSalesArchHeader);
CopyLine(ToSalesHeader,ToSalesLine,FromSalesHeader,FromSalesLine,NextLineNo);
// End of the lines.
END;
END;
END;
...
...
FromDocType::"Archived Order":
BEGIN
FromSalesArchHeader.GET(FromSalesLine."Document Type",FromSalesLine."Document No.",
DocNoOccurrence,DocVersionNo);
// Add the following lines.
FromArchiveLine.GET(FromSalesLine."Document Type",FromSalesLine."Document No.",
DocNoOccurrence,DocVersionNo,FromSalesLine."Line No.");
FromSalesHeader.TRANSFERFIELDS(FromSalesArchHeader);
CopyLine(ToSalesHeader,ToSalesLine,FromSalesHeader,FromSalesLine,NextLineNo);
CopyFromKitArchiveToLine(ToSalesLine,FromArchiveLine);
// End of the lines.
END;
END;
END;
...