mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-07 07:36:54 +01:00
Add BC performance knowledge from OptimAL learnings
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
07e324ddbc
commit
af94c135ad
37 changed files with 881 additions and 36 deletions
|
|
@ -0,0 +1,43 @@
|
|||
// The only supported read filters customer/date and displays item, quantity, and amount.
|
||||
// No consumer needs ordering on the displayed fields or a SIFT aggregate.
|
||||
table 50362 "Perf Document Entry"
|
||||
{
|
||||
DataClassification = CustomerContent;
|
||||
|
||||
fields
|
||||
{
|
||||
field(1; "Entry No."; Integer) { }
|
||||
field(2; "Customer No."; Code[20]) { }
|
||||
field(3; "Posting Date"; Date) { }
|
||||
field(4; "Item No."; Code[20]) { }
|
||||
field(5; Quantity; Decimal) { }
|
||||
field(6; Amount; Decimal) { }
|
||||
}
|
||||
|
||||
keys
|
||||
{
|
||||
key(PK; "Entry No.") { Clustered = true; }
|
||||
key(CustomerDate; "Customer No.", "Posting Date") { }
|
||||
key(CustomerDateItem; "Customer No.", "Posting Date", "Item No.") { }
|
||||
key(CustomerDateQuantity; "Customer No.", "Posting Date", Quantity) { }
|
||||
key(CustomerDateAmount; "Customer No.", "Posting Date", Amount) { }
|
||||
}
|
||||
}
|
||||
|
||||
codeunit 50375 "Perf Document Reader Bad"
|
||||
{
|
||||
procedure CustomerDateTotals(CustomerNo: Code[20]; FromDate: Date; ToDate: Date; var ItemNos: List of [Code[20]]; var TotalAmount: Decimal; var TotalQuantity: Decimal)
|
||||
var
|
||||
Entry: Record "Perf Document Entry";
|
||||
begin
|
||||
Entry.SetRange("Customer No.", CustomerNo);
|
||||
Entry.SetRange("Posting Date", FromDate, ToDate);
|
||||
Entry.SetLoadFields("Item No.", Quantity, Amount);
|
||||
if Entry.FindSet() then
|
||||
repeat
|
||||
ItemNos.Add(Entry."Item No.");
|
||||
TotalQuantity += Entry.Quantity;
|
||||
TotalAmount += Entry.Amount;
|
||||
until Entry.Next() = 0;
|
||||
end;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue