Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
53
tasks_gen/eval/G0159/reference/camp_fee.func.abap
Normal file
53
tasks_gen/eval/G0159/reference/camp_fee.func.abap
Normal file
@@ -0,0 +1,53 @@
|
||||
FUNCTION {{p}}camp_fee
|
||||
IMPORTING
|
||||
iv_pitch_type TYPE string
|
||||
iv_nights TYPE i
|
||||
iv_adults TYPE i
|
||||
iv_electricity TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_discount TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_nights.
|
||||
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_adults TYPE i.
|
||||
DATA lv_subtotal TYPE decfloat34.
|
||||
|
||||
ev_discount = abap_false.
|
||||
cv_fee = 0.
|
||||
|
||||
IF iv_nights < 1.
|
||||
RAISE invalid_nights.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_pitch_type.
|
||||
WHEN 'STD'.
|
||||
lv_rate = 12.
|
||||
WHEN 'CMF'.
|
||||
lv_rate = 18.
|
||||
WHEN 'PRM'.
|
||||
lv_rate = 25.
|
||||
WHEN OTHERS.
|
||||
RETURN.
|
||||
ENDCASE.
|
||||
|
||||
lv_adults = iv_adults.
|
||||
IF lv_adults < 1.
|
||||
lv_adults = 1.
|
||||
ENDIF.
|
||||
|
||||
lv_subtotal = ( lv_rate + lv_adults * 4 ) * iv_nights.
|
||||
IF iv_electricity = abap_true.
|
||||
lv_subtotal = lv_subtotal + '3.50' * iv_nights.
|
||||
ENDIF.
|
||||
|
||||
IF iv_nights >= 7.
|
||||
lv_subtotal = lv_subtotal * 85 / 100.
|
||||
ev_discount = abap_true.
|
||||
ENDIF.
|
||||
|
||||
cv_fee = round( val = lv_subtotal dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
ENDFUNCTION.
|
||||
Reference in New Issue
Block a user