#BLOCK("Pager", #CouponCodes)
#WITH_ERROR(#FormError)
#IF(#INPUT.Page) #ENDIF#IF(#INPUT.PageSize) #ENDIF #IF(#FormError AND #FormErrors.Form.GenerateCouponCodes) #IF(#FormErrors.Form.GenerateCouponCodes.Reason.INTEGER_TOO_LARGE)

{InputError}

#LOOP(#FormErrors.Errors)#IF(#Reason EQ "INTEGER_TOO_LARGE") {CouponCodeCountTooLarge}#ENDIF #ENDLOOP
#ELSE

{InputError}

{PleaseCorrectErrors}
#ENDIF #ELSIF(#FormError)

{InputError}

#IF(#FormErrors.Reason.CouponCodesLengthToShortForThisNumberOfCodes)

{CouponCodesLengthToShortForThisNumberOfCodes}

#ENDIF #IF(NOT #FormErrors.Reason.CouponCodesLengthToShortForThisNumberOfCodes)

{PleaseCorrectErrors}

#IF(#FormErrors.Reason.OBJECT_EXISTS)

{DoubleObject}

#ENDIF #ENDIF
#ENDIF #IF(#DELETE)

{Warning}

{AcceptAction}
#LOOP(#DeleteObjects)#ENDLOOP #ELSIF(#DELETEALL)

{Warning}

{AcceptAction}
#ELSE #IF(#DEFINED(#ValidCouponCount) AND #ValidCouponCount==0)

{Notification}

{NoValidCoupons}

#ELSIF(#DEFINED(#ValidCouponCount) AND #RedeemCount==#ValidCouponCount)

{Notification}

{ValidCouponCountReached}

#ENDIF #ENDIF #IF(NOT #DELETEALL) #INCLUDE("INC-PagerHeader") #LOCAL("OrderBy",#INPUT.OrderBy)#IF(NOT #DEFINED(#OrderBy))#SET("OrderBy","")#ENDIF #IF(#OrderBy NE "Alias") #ELSIF(#INPUT.OrderDesc) #ELSE #ENDIF #IF(#OrderBy NE "RedeemCount") #ELSIF(#INPUT.OrderDesc) #ELSE #ENDIF #IF(#OrderBy NE "IsInvalidated") #ELSIF(#INPUT.OrderDesc) #ELSE #ENDIF #IF(#OrderBy NE "Type") #ELSIF(#INPUT.OrderDesc) #ELSE #ENDIF #ENDLOCAL #IF(#DELETE) #LOOP(#DeleteObjects) #ENDLOOP #ELSE #IF(#COUNT(#Pager.Items)) #LOOP(#Pager.Items) #ENDLOOP #ENDIF #ENDIF #IF(NOT #DELETE) #ENDIF
{CouponCode}{CouponCode}{CouponCode}{RedeemCount}{RedeemCount}{RedeemCount}{IsInvalidated}{IsInvalidated}{IsInvalidated}{Type}{Type}{Type}
#IF(NOT #DELETE)#INCLUDE("Pager")#ENDIF
#Alias #RedeemCount[integer] #IF(#Type EQ "NEWSLETTER") {Newsletter} #ELSIF(#Type EQ "MANUAL") {Manual} #ELSIF(#Type EQ "GENERATED") {Generated} #ENDIF
#Alias #RedeemCount[integer] #IF(#Type EQ "NEWSLETTER") {Newsletter} #ELSIF(#Type EQ "MANUAL") {Manual} #ELSIF(#Type EQ "GENERATED") {Generated} #ENDIF
#WITH_ERROR(#FormError) {CountItems} #ENDWITH_ERROR
#ENDIF
#IF(#DELETE) #ELSIF(NOT #DELETEALL)

#ENDIF
#IF(#DELETEALL)
#ENDIF #ENDWITH_ERROR
#ENDBLOCK