Merged PR 19430: Fix references to old supplement system.

This commit is contained in:
Mitchem Dakota (CSC FI SPS MESLEO External)
2025-06-24 21:20:40 +02:00
parent 1db89a3d3f
commit 52499b7616
5 changed files with 88 additions and 59 deletions

View File

@ -239,6 +239,57 @@ Service GetLotsWithSupplements(LotType)
end service
//----------------------------------------------------------------------------------------------------------------------
// HasSupplements
//
// LotType - [Required]
// LotID - [Required]
// Stage = [Optional]
//
// Returns a boolean response for whether or not a lot has any supplements assigned.
//
//----------------------------------------------------------------------------------------------------------------------
Service HasSupplements(LotType=LOTTYPES, LotID, Stage=STAGES)
Response = ''
Supplements = Supplement_Services('GetSupplementsForLot', LotType, LotID, Stage)
If Supplements EQ False$ then
Response = Supplements
end else
Response = True$
end
end service
//----------------------------------------------------------------------------------------------------------------------
// CopySupplementsToNewLot
//
// LotType - [Required]
// OldLotID - [Required]
// NewLotID - [Required]
//
// Returns a boolean response for whether or not a lot has any supplements assigned.
//
//----------------------------------------------------------------------------------------------------------------------
Service CopySupplementsToNewLot(LotType=LOTTYPES, OldLotID, NewLotID)
If Supplement_Services('HasSupplements', LotType, OldLotID, '') then
SupplementKeys = Supplement_Services('GetSupplementsForLot', LotType, OldLotID, '')
SuppCount = Dcount(SupplementKeys, @FM)
For I = 1 to SuppCount
OldSuppRec = Xlate('SUPPLEMENTS', SupplementKeys<I>, '', 'X')
SupplText = OldSuppRec<SUPPLEMENTS_SUPPL_TEXT$>
EntryUser = OldSuppRec<SUPPLEMENTS_ENTRY_USER$>
Stage = OldSuppRec<SUPPLEMENTS_STAGE$>
Supplement_Services('CreateSupplement', LotType, NewLotID, Stage, SupplText, EntryUser)
Next I
end else
Error_Services('Add', 'The lot associatied with this OldLotID does not contain any supplements.')
end
end service
//----------------------------------------------------------------------------------------------------------------------
// GetSupplementsForLot
@ -633,3 +684,5 @@ Service SendNotifications(RDSList, EditEvent, Instructions, EntryUser)
end service