The CreatePacktSetupWithGiftToleranceQty helper function's main purpose is to set GiftToleranceQty on the extension setup, and is given by the following code:
local procedure
CreatePacktSetupWithGiftToleranceQty(
GiftToleranceQtySet: Decimal)
var
PacktExtensionSetup: Record "Packt Extension Setup";
begin
with PacktExtensionSetup do begin
if not Get() then
Insert();
Validate("Gift Tolerance Qty", GiftToleranceQtySet);
Modify();
end;
end;