mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 22:56:55 +01:00
* Add SCM functional knowledge domain 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> * Normalize SCM knowledge and review ownership Align article and AL sample conventions, keep BC facts separate from review mechanics, and clarify reciprocal Finance ownership without bespoke shared test assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
27 lines
1.2 KiB
AL
27 lines
1.2 KiB
AL
codeunit 50115 "SCM Additional Promise Good"
|
|
{
|
|
procedure CanPromiseAdditionalDemand(ItemNo: Code[20]; LocationCode: Code[10]; VariantCode: Code[10]; ShipmentDate: Date; RequestedAdditionalQuantityBase: Decimal; LookaheadDateFormula: DateFormula): Boolean
|
|
var
|
|
Item: Record Item;
|
|
AvailableToPromise: Codeunit "Available to Promise";
|
|
GrossRequirement: Decimal;
|
|
ScheduledReceipt: Decimal;
|
|
PromisableQuantityBase: Decimal;
|
|
begin
|
|
if (ShipmentDate = 0D) or (RequestedAdditionalQuantityBase <= 0) then
|
|
Error(DemandInputErr);
|
|
Item.Get(ItemNo);
|
|
Item.TestField(Type, Item.Type::Inventory);
|
|
Item.SetRange("Location Filter", LocationCode);
|
|
Item.SetRange("Variant Filter", VariantCode);
|
|
Item.SetRange("Date Filter", 0D, ShipmentDate);
|
|
|
|
PromisableQuantityBase := AvailableToPromise.CalcQtyAvailableToPromise(
|
|
Item, GrossRequirement, ScheduledReceipt, ShipmentDate,
|
|
Enum::"Analysis Period Type"::Day, LookaheadDateFormula);
|
|
exit(PromisableQuantityBase >= RequestedAdditionalQuantityBase);
|
|
end;
|
|
|
|
var
|
|
DemandInputErr: Label 'Enter a shipment date and a positive additional base quantity.';
|
|
}
|