mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
Seed a new breaking-changes (AL API stability) knowledge domain with six articles plus good/bad AL samples, a new al-breaking-changes-review leaf skill, and minimal wiring into al-code-review and the README. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
22 lines
640 B
AL
22 lines
640 B
AL
codeunit 50316 "Pricing Api Bad"
|
|
{
|
|
// Anti-pattern: new surcharge logic is added inside a procedure already marked
|
|
// obsolete, and inside a #if not CLEAN25 block. Both are scheduled for removal,
|
|
// so this behaviour disappears the moment CLEAN25 is enabled.
|
|
[Obsolete('Use GetUnitPrice instead.', '25.0')]
|
|
procedure GetPrice(ItemNo: Code[20]): Decimal
|
|
var
|
|
Price: Decimal;
|
|
begin
|
|
Price := 100;
|
|
#if not CLEAN25
|
|
Price += CalculateSurcharge(ItemNo);
|
|
#endif
|
|
exit(Price);
|
|
end;
|
|
|
|
local procedure CalculateSurcharge(ItemNo: Code[20]): Decimal
|
|
begin
|
|
exit(5);
|
|
end;
|
|
}
|