Stage 2 summary at 50 accepted trajectories

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 18:02:52 +02:00
parent 332fb4601d
commit 5bcd1bf9cd
1230 changed files with 77563 additions and 33 deletions

View File

@@ -0,0 +1,51 @@
FUNCTION {{p}}bind_fee
IMPORTING
iv_binding TYPE string
iv_pages TYPE i
iv_member TYPE abap_bool
EXPORTING
ev_rush TYPE abap_bool
CHANGING
cv_fee TYPE decfloat34
EXCEPTIONS
invalid_pages.
CONSTANTS: lc_rate_pb TYPE decfloat34 VALUE '0.05',
lc_rate_hb TYPE decfloat34 VALUE '0.12',
lc_rate_ex TYPE decfloat34 VALUE '0.20',
lc_min_hb TYPE decfloat34 VALUE '15.00',
lc_discount TYPE decfloat34 VALUE '0.9'.
ev_rush = abap_false.
IF iv_pages < 1.
RAISE invalid_pages.
ENDIF.
CASE iv_binding.
WHEN 'PB'.
cv_fee = round( val = iv_pages * lc_rate_pb
dec = 2
mode = cl_abap_math=>round_half_up ).
WHEN 'HB'.
cv_fee = round( val = iv_pages * lc_rate_hb
dec = 2
mode = cl_abap_math=>round_half_up ).
IF cv_fee < lc_min_hb.
cv_fee = lc_min_hb.
ENDIF.
WHEN 'EX'.
ev_rush = abap_true.
cv_fee = round( val = iv_pages * lc_rate_ex
dec = 2
mode = cl_abap_math=>round_half_up ).
WHEN OTHERS.
cv_fee = 0.
ENDCASE.
IF iv_member = abap_true AND cv_fee > 0.
cv_fee = round( val = cv_fee * lc_discount
dec = 2
mode = cl_abap_math=>round_half_up ).
ENDIF.
ENDFUNCTION.