mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-07 15:46: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>
This commit is contained in:
parent
b91443beec
commit
9ac62e3967
34 changed files with 1244 additions and 10 deletions
|
|
@ -0,0 +1,33 @@
|
|||
namespace BCQuality.SCM.Samples;
|
||||
|
||||
using Microsoft.Foundation.Enums;
|
||||
using Microsoft.Inventory.Availability;
|
||||
using Microsoft.Inventory.Item;
|
||||
|
||||
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.';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue