mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-06 23:26:55 +01:00
Introduce nine source-backed rules with original AL sample pairs, bounded SCM review routing, and complete positive/clean evaluation coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
29 lines
1.2 KiB
AL
29 lines
1.2 KiB
AL
namespace BCQuality.SCM.Samples;
|
|
|
|
using Microsoft.Inventory.Journal;
|
|
using Microsoft.Inventory.Location;
|
|
using Microsoft.Inventory.Posting;
|
|
using Microsoft.Inventory.Transfer;
|
|
|
|
codeunit 50112 "SCM Transfer Posting Bad"
|
|
{
|
|
procedure ShipTransferOrder(TransferOrderNo: Code[20]; var ItemJournalLine: Record "Item Journal Line")
|
|
var
|
|
TransferHeader: Record "Transfer Header";
|
|
Location: Record Location;
|
|
ItemJnlPostLine: Codeunit "Item Jnl.-Post Line";
|
|
begin
|
|
TransferHeader.Get(TransferOrderNo);
|
|
TransferHeader.TestField("Direct Transfer", false);
|
|
TransferHeader.TestField("In-Transit Code");
|
|
Location.Get(TransferHeader."Transfer-from Code");
|
|
Location.TestField("Require Shipment", false);
|
|
ItemJournalLine.TestField("Entry Type", ItemJournalLine."Entry Type"::Transfer);
|
|
ItemJournalLine.TestField("Location Code", TransferHeader."Transfer-from Code");
|
|
ItemJournalLine.TestField("New Location Code", TransferHeader."In-Transit Code");
|
|
|
|
ItemJnlPostLine.RunWithCheck(ItemJournalLine);
|
|
TransferHeader."Last Shipment No." := ItemJournalLine."Document No.";
|
|
TransferHeader.Modify(true);
|
|
end;
|
|
}
|