# Business Logic — FUW05401SFLogic.getOptPackPrcList() [189 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW05401SF.FUW05401SFLogic` |
| Layer | Service Logic (Web-tier business logic class) |
| Module | `FUW05401SF` (Package: `eo.web.webview.FUW05401SF`) |

## 1. Role

### FUW05401SFLogic.getOptPackPrcList()

This method assembles a comprehensive list of **option pricing information** (price code + pricing plan code) for all applicable phone optional services associated with a fiber-optic (Hikari) service contract. It is the core pricing aggregator for the "Optical Phone Option Application/Cancellation" screen (FUW05401), which handles telephone-related optional services such as Call Forwarding (割込電話), Call Forwarding Selection (転送電話選択), Caller ID Display Blocking (非通知着信拒否), Confused Call Rejection (迷惑電話拒否), Designated Number Ringing Selection (指定番号着信選択), Call Detail Notification (通信明細送付), 050 Namba Plaus (050ナンバープラス), and their sub-options.

The method implements a **dual-pass iteration pattern**: it first processes **main (top-level) optional services** and then processes **sub-optional services** (サブオプション). For each service record, it applies four sequential filters: (1) cancellation-in-progress exclusion when `tran_div` = "2", (2) telephone-option-package membership check, (3) canceled/cancelled status with reservation application date check, and (4) a price code lookup against the static `OP_PRC_LIST` mapping table. The result is an `ArrayList<HashMap<String, String>>` where each map contains a `pcrs_cd` (price code) and `pplan_cd` (pricing plan code).

Additionally, when the transaction division (`tran_div`) equals `"1"` (Apply/申込), the method also appends the pricing information for the **newly applied option** by delegating to `getPcrsCdKK0601` and `getPplanCdKK0601`, using the ronri screen ID to resolve the correct pricing codes. This method serves as a shared utility — its direct caller `getPackScreenWribSvcCd` uses this list to determine the applicable discount service code for the "Optical Phone Option Discount Determination" (お得判定) process.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getOptPackPrcList(bean)"])
    CHECK_OPE_DATE["Get online operation date"]
    GET_COMMON["Get common info bean"]
    GET_RONRI["Get ronri screen ID"]
    CHECK_SCREEN_OP["Check screenOpSvcCd mapping"]
    GET_TRAN_DIV["Get tran_div from bean"]
    INIT_PRCLIST["Initialize prcList"]
    GET_SVC_LIST["Get svcKeiInfoList from bean"]
    GET_COUNT["Get iCount"]
    LOOP_OP["Loop over services i-0 to iCount"]
    GET_SERVICE_BEAN["Get service bean"]
    GET_OP_SVC_CD["Get opSvcCd"]
    GET_OP_STAT["Get opSvcKeiStat"]
    GET_RSV_APLY["Get kk0351RsvAplyYmd"]
    CHECK_DSL_CANCEL["tran_div = 2 (Cancellation) AND screenOpSvcCd matches"]
    SKIP_DSL["Skip record"]
    CHECK_TEL_PACK["Is opSvcCd in TEL_PACK_OPT_LIST?"]
    SKIP_NOT_PACK["Skip record"]
    CHECK_STAT_CANCELED["opSvcKeiStat = 910 (Canceled) AND rsvAply >= opeDate"]
    CHECK_STAT_CANCELLED["opSvcKeiStat = 920 (Cancelled) AND rsvAply >= opeDate"]
    SKIP_CANCELED["Skip record"]
    LOOP_PRC["Loop OP_PRC_LIST j-0 to length"]
    MATCH_PRCD["opSvcCd matches OP_PRC_LIST[j][0]"]
    ASSIGN_PRCD["Set opPcrsCd, opPplanCd"]
    BREAK_MATCH["Break loop"]
    ADD_TO_PRCLIST["Add prc map to prcList"]
    LOOP_SBOP["Loop over services i-0 to iCount"]
    GET_SBOP_BEAN["Get service bean"]
    GET_SBOP_CD["Get sbopSvcCd"]
    GET_SBOP_STAT["Get sbopSvcKeiStat"]
    GET_SBOP_RSV["Get kk0401RsvAplyYmd"]
    CHECK_SBOP_DSL["tran_div = 2 AND sbop matches screenOpSvcCd or delSbopSvcCd"]
    SKIP_SBOP_DSL["Skip record"]
    CHECK_SBOP_TEL["Is sbopSvcCd in TEL_PACK_OPT_LIST?"]
    SKIP_SBOP_NOT_PACK["Skip record"]
    CHECK_SBOP_STAT["sbopSvcKeiStat = 910 or 920 AND rsvAply >= opeDate"]
    SKIP_SBOP_CANCELED["Skip record"]
    LOOP_SBOP_PRC["Loop OP_PRC_LIST j-0 to length"]
    MATCH_SBOP_PRCD["sbopSvcCd matches OP_PRC_LIST[j][0]"]
    ASSIGN_SBOP_PRCD["Set sbopPcrsCd, sbopPplanCd"]
    ADD_SBOP_TO_PRCLIST["Add sbop prc map to prcList"]
    CHECK_MSKM["tran_div = 1 (Apply)?"]
    GET_PCRS_CD["Get pcrsCd for ronriScreenId"]
    GET_PPLAN_CD["Get pplanCd for ronriScreenId"]
    ADD_NEW_MAP["Add new option prc map to prcList"]
    END_RETURN["Return prcList"]

    START --> CHECK_OPE_DATE
    CHECK_OPE_DATE --> GET_COMMON
    GET_COMMON --> GET_RONRI
    GET_RONRI --> CHECK_SCREEN_OP
    CHECK_SCREEN_OP --> GET_TRAN_DIV
    GET_TRAN_DIV --> INIT_PRCLIST
    INIT_PRCLIST --> GET_SVC_LIST
    GET_SVC_LIST --> GET_COUNT
    GET_COUNT --> LOOP_OP
    LOOP_OP --> GET_SERVICE_BEAN
    GET_SERVICE_BEAN --> GET_OP_SVC_CD
    GET_OP_SVC_CD --> GET_OP_STAT
    GET_OP_STAT --> GET_RSV_APLY
    GET_RSV_APLY --> CHECK_DSL_CANCEL
    CHECK_DSL_CANCEL -->|Yes| SKIP_DSL
    CHECK_DSL_CANCEL -->|No| CHECK_TEL_PACK
    SKIP_DSL --> CHECK_TEL_PACK
    CHECK_TEL_PACK -->|No| SKIP_NOT_PACK
    CHECK_TEL_PACK -->|Yes| CHECK_STAT_CANCELED
    SKIP_NOT_PACK --> CHECK_STAT_CANCELED
    CHECK_STAT_CANCELED -->|Yes| CHECK_STAT_CANCELLED
    CHECK_STAT_CANCELED -->|No| CHECK_STAT_CANCELLED
    CHECK_STAT_CANCELLED -->|Yes| SKIP_CANCELED
    CHECK_STAT_CANCELLED -->|No| LOOP_PRC
    SKIP_CANCELED --> LOOP_PRC
    LOOP_PRC --> MATCH_PRCD
    MATCH_PRCD -->|No| BREAK_MATCH
    MATCH_PRCD -->|Yes| ASSIGN_PRCD
    ASSIGN_PRCD --> BREAK_MATCH
    BREAK_MATCH --> ADD_TO_PRCLIST
    ADD_TO_PRCLIST --> LOOP_SBOP
    LOOP_SBOP --> GET_SBOP_BEAN
    GET_SBOP_BEAN --> GET_SBOP_CD
    GET_SBOP_CD --> GET_SBOP_STAT
    GET_SBOP_STAT --> GET_SBOP_RSV
    GET_SBOP_RSV --> CHECK_SBOP_DSL
    CHECK_SBOP_DSL -->|Yes| SKIP_SBOP_DSL
    CHECK_SBOP_DSL -->|No| CHECK_SBOP_TEL
    SKIP_SBOP_DSL --> CHECK_SBOP_TEL
    CHECK_SBOP_TEL -->|No| SKIP_SBOP_NOT_PACK
    CHECK_SBOP_TEL -->|Yes| CHECK_SBOP_STAT
    SKIP_SBOP_NOT_PACK --> CHECK_SBOP_STAT
    CHECK_SBOP_STAT -->|Yes| SKIP_SBOP_CANCELED
    CHECK_SBOP_STAT -->|No| LOOP_SBOP_PRC
    SKIP_SBOP_CANCELED --> LOOP_SBOP_PRC
    LOOP_SBOP_PRC --> MATCH_SBOP_PRCD
    MATCH_SBOP_PRCD -->|No| ADD_SBOP_TO_PRCLIST
    MATCH_SBOP_PRCD -->|Yes| ASSIGN_SBOP_PRCD
    ASSIGN_SBOP_PRCD --> ADD_SBOP_TO_PRCLIST
    ADD_SBOP_TO_PRCLIST --> CHECK_MSKM
    CHECK_MSKM -->|Yes| GET_PCRS_CD
    CHECK_MSKM -->|No| END_RETURN
    GET_PCRS_CD --> GET_PPLAN_CD
    GET_PPLAN_CD --> ADD_NEW_MAP
    ADD_NEW_MAP --> END_RETURN
```

**Branch descriptions:**

- **DSL cancellation-in-progress block** (Block 1.1): When `tran_div = "2"` (Cancellation processing), the method resolves the sub-option service code being cancelled and skips any main or sub-option that matches, to avoid double-counting prices during cancellation workflows.
- **Telephone-option-package filter** (Block 1.2): Only options that belong to the `TEL_PACK_OPT_LIST` (7 predefined phone optional services) are included — other option types are skipped.
- **Cancellation status filters** (Block 1.3 / 1.4): If the service status is `"910"` (Canceled/解約済) or `"920"` (Cancelled/キャンセル済) AND the reservation application date (`kk0351RsvAplyYmd`) is >= the online operation date (`opeDate`), the record is skipped. This ensures that already-cancelled options with effective dates at or past today do not appear in the price list.
- **Main-loop price lookup** (Block 1.5): Iterates the `OP_PRC_LIST` static mapping (7 entries) to find the matching price code (`pcrs_cd`) and pricing plan code (`pplan_cd`) for the option service code.
- **Sub-option dual-pass** (Block 2): Repeats the same filtering and lookup logic for sub-optional services (サブオプション), with additional DSL exclusion logic that checks both `screenOpSvcCd` and `delSbopSvcCd`.
- **Apply-branch** (Block 3): When `tran_div = "1"` (Apply/申込), delegates to `getPcrsCdKK0601` and `getPplanCdKK0601` to append pricing for the newly applied option.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `serviceFormBean` | `X31SDataBeanAccess` | The service form data bean containing the current screen state, including the service contract information list (`svcKeiInfoList`) and transaction division (`tran_div`). Represents the complete UI-bound data model for the Optical Phone Option screen. |

**Instance fields / external state read:**

| Name | Type | Business Description |
|------|------|---------------------|
| `SBOP_SVC_CD_MAPPING_MAP` | `Map<String, String>` | Mapping from ronri screen IDs to sub-option service codes. Used to determine which sub-option service code corresponds to a given ronri screen. |
| `OP_SVC_CD_MAPPING_MAP` | `Map<String, String>` | Mapping from ronri screen IDs to main-option service codes. Used as fallback when sub-option mapping is not found. |
| `TEL_PACK_OPT_LIST` | `List<String>` | Static list of 7 telephone option service codes that belong to the phone optional package (B025, B023, B024, D07, D08, B026, B027). |
| `OP_PRC_LIST` | `String[][]` | 7-entry static price mapping table — each row maps [option service code, price code, pricing plan code] for options. |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| # | CRUD | SC / CBS | Operation Description |
|---|------|----------|----------------------|
| 1 | R | `JFUWebCommon.getOpeDate` | Retrieves the current online operation date (yyyyMMDD format) — used as the reference date for cancellation-effective date comparison. |
| 2 | R | `getRonriScreenId(commonInfoBean)` | Internal method — resolves the ronri (logic/論理) screen ID from the common info bean, identifying which optional service screen is active. |
| 3 | R | `getSbopSvcCd(ronriScreenId)` | Internal method — maps the ronri screen ID to the sub-option service code via `SBOP_SVC_CD_MAPPING_MAP`. |
| 4 | R | `getOpSvcCd(ronriScreenId)` | Internal method — maps the ronri screen ID to the main-option service code via `OP_SVC_CD_MAPPING_MAP`. |
| 5 | R | `getChildRonriScreenId(ronriScreenId)` | Internal method — retrieves the sub-option ronri screen ID for DSL cancellation exclusion logic. |
| 6 | R | `JFUWebCommon.getDataBeanItemByPath(bean, TRAN_DIV)` | Reads the `tran_div` field (transaction division) from the service form bean — determines whether this is Apply (1), Cancellation (2), or Change (3). |
| 7 | R | `serviceFormBean.getDataBeanArray(SVC_KEI_INFO_LIST)` | Reads the list of service contract information records (主契約情報リスト) from the data bean array. |
| 8 | R | `svcKeiInfoList.getCount()` | Returns the total count of service contract information records — drives the iteration count. |
| 9 | R | `svcKeiInfoList.getDataBean(i)` | Retrieves the i-th service contract record from the list for per-record processing. |
| 10 | R | `bean.sendMessageString(OP_SVC_CD_01, GET)` | Extracts the option service code (オプションサービスコード) from the current service record. |
| 11 | R | `bean.sendMessageString(OP_SVC_KEI_STAT_01, GET)` | Extracts the option service contract status (オプションサービス契約ステータス) — e.g., "910" (Canceled/解約済), "920" (Cancelled/キャンセル済). |
| 12 | R | `bean.sendMessageString(KK0351_RSV_APLY_YMD_01, GET)` | Extracts the reservation application date (予約適用年月日) for the option service — compared against `opeDate` for effective date filtering. |
| 13 | R | `bean.sendMessageString(SBOP_SVC_CD_01, GET)` | Extracts the sub-option service code (サブオプションサービスコード) from the service record. |
| 14 | R | `bean.sendMessageString(SBOP_SVC_KEI_STAT_01, GET)` | Extracts the sub-option service contract status. |
| 15 | R | `bean.sendMessageString(KK0401_RSV_APLY_YMD_01, GET)` | Extracts the reservation application date for the sub-option service. |
| 16 | R | `JPCUtilCommon.isPastDate(kk0351RsvAplyYmd, opeDate, "1")` | Date comparison utility — checks if `kk0351RsvAplyYmd >= opeDate` (with "today inclusive" flag). Used to determine if a cancelled option has become effective. |
| 17 | R | `JPCUtilCommon.isPastDate(kk0401RsvAplyYmd, opeDate, "1")` | Date comparison utility — same as above but for sub-option reservation application date. |
| 18 | R | `getPcrsCdKK0601(ronriScreenId)` | Internal method — resolves the price code (料金コード) for the newly applied option based on the ronri screen ID. |
| 19 | R | `getPplanCdKK0601(ronriScreenId)` | Internal method — resolves the pricing plan code (料金プランコード) for the newly applied option based on the ronri screen ID. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `getPackScreenWribSvcCd` (Internal) | `getPackScreenWribSvcCd(bean)` -> `getOptPackPrcList(bean)` -> `JFUWebCommon.getTelOptPack(baseDate, prcList)` (discount determination) | `getPcrsCdKK0601 [R]`, `getPplanCdKK0601 [R]`, `isPastDate [R]`, `sendMessageString [R]`, `getDataBean [R]` |

**Note:** The method `getOptPackPrcList` is a private method called exclusively by `getPackScreenWribSvcCd` within the same class. The `getPackScreenWribSvcCd` method itself is used by multiple screens (FUW05301, FUW05401, etc.) for determining the applicable discount service code (割込サービスコード) when a phone optional package is involved. There are **no direct screen/batch entry points** into this method — it is a supporting method within the FUW05401SF logic chain.

## 6. Per-Branch Detail Blocks

### Block 1 — SETUP (L2984-3011)
> Initialize variables: get operation date, common info bean, ronri screen ID, screen option service code, transaction division, and prepare the pricing list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `opeDate = JFUWebCommon.getOpeDate(this, null)` // Get online operation date (yyyyMMDD) |
| 2 | SET | `commonInfoBean = super.getCommonInfoBean()` // Get shared form bean access |
| 3 | CALL | `ronriScreenId = getRonriScreenId(commonInfoBean)` // Get ronri screen ID |
| 4 | SET | `screenOpSvcCd = ""` // Initialize screen option service code |
| 5 | IF | `(SBOP_SVC_CD_MAPPING_MAP.containsKey(ronriScreenId))` [L3004] |
| 5.1 | CALL | `screenOpSvcCd = getSbopSvcCd(ronriScreenId)` // Get sub-option service code mapping |
| 6 | ELSE | `[L3007]` |
| 6.1 | IF | `(OP_SVC_CD_MAPPING_MAP.containsKey(ronriScreenId))` |
| 6.1.1 | CALL | `screenOpSvcCd = getOpSvcCd(ronriScreenId)` // Get main-option service code mapping |
| 7 | SET | `delSbopSvcCd = ""` // Initialize deleted sub-option service code |
| 8 | CALL | `tran_div = JFUWebCommon.getDataBeanItemByPath(serviceFormBean, FUW05401SFConst.TRAN_DIV)` // Get transaction division |
| 9 | SET | `prcList = new ArrayList<HashMap<String, String>>()` // Initialize result list |
| 10 | CALL | `svcKeiInfoList = serviceFormBean.getDataBeanArray(FUW05401SFConst.SVC_KEI_INFO_LIST)` // Get service contract info list |
| 11 | SET | `iCount = svcKeiInfoList.getCount()` // Count of service records |

### Block 2 — MAIN-OPTION PASS: OUTER LOOP (L3013-3090)
> Iterate over each service contract record to process main (top-level) optional services.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int i = 0; i < iCount; i++)` |
| 2 | CALL | `bean = svcKeiInfoList.getDataBean(i)` // Get i-th service record |

### Block 2.1 — MAIN-OPTION PASS: EXTRACT FIELDS (L3015-3030)
> Extract option service code, status, and reservation application date from the service record.

| # | Type | Code |
|---|------|------|
| 1 | SET | `opSvcCd = bean.sendMessageString(FUW05401SFConst.OP_SVC_CD_01, X31CWebConst.DATABEAN_GET_VALUE)` // Option service code |
| 2 | SET | `opSvcKeiStat = bean.sendMessageString(FUW05401SFConst.OP_SVC_KEI_STAT_01, X31CWebConst.DATABEAN_GET_VALUE)` // Option service contract status |
| 3 | SET | `kk0351RsvAplyYmd = bean.sendMessageString(FUW05401SFConst.KK0351_RSV_APLY_YMD_01, X31CWebConst.DATABEAN_GET_VALUE)` // Reservation application date |
| 4 | SET | `opPcrsCd = ""` // Initialize price code |
| 5 | SET | `opPplanCd = ""` // Initialize pricing plan code |

### Block 2.2 — MAIN-OPTION PASS: DSL CANCELLATION IN PROGRESS CHECK (L3032-3044)
> When `tran_div = "2"` (Cancellation/解約), exclude the option service being cancelled from the price list.

**Block 2.2** — IF `(TRAN_DIV_DSL.equals(tran_div) && screenOpSvcCd.equals(opSvcCd))` `[TRAN_DIV_DSL = "2"]` (L3032)

> If this is a cancellation operation and the current option matches the screen's option service code (the one being cancelled), get the sub-option ronri screen ID and its service code, then skip this record.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `sbScreenId = getChildRonriScreenId(ronriScreenId)` // Get sub-option ronri screen ID |
| 2 | CALL | `delSbopSvcCd = getSbopSvcCd(sbScreenId)` // Get deleted sub-option service code |
| 3 | RETURN | `continue;` // Skip this record — cancellation-in-progress option excluded |

### Block 2.3 — MAIN-OPTION PASS: TELEPHONE OPTION PACKAGE FILTER (L3046-3050)
> Skip options that are NOT part of the telephone optional package list.

**Block 2.3** — IF `(!TEL_PACK_OPT_LIST.contains(opSvcCd))` (L3046)

> `TEL_PACK_OPT_LIST` = `[B025, B023, B024, D07, D08, B026, B027]` — 7 phone optional service codes.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `continue;` // Skip — not a telephone option package |

### Block 2.4 — MAIN-OPTION PASS: CANCELED STATUS CHECK (L3052-3062)
> Skip records where the option is cancelled AND the reservation application date is at or past the operation date.

**Block 2.4** — IF `(JFUStrConst.CD00037_910.equals(opSvcKeiStat) && JPCUtilCommon.isPastDate(kk0351RsvAplyYmd, opeDate, DOJITSU_HUKUMU))` (L3052)

> `CD00037_910 = "910"` (Canceled/解約済) — `DOJITSU_HUKUMU = "1"` (include same day).
> When the option service status is "910" (Canceled) AND the reservation application date >= operation date, skip this record as it is already canceled and effective.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `continue;` // Skip — canceled and effective |

### Block 2.5 — MAIN-OPTION PASS: CANCELLED STATUS CHECK (L3060-3070)
> Skip records where the option is cancelled AND the reservation application date is at or past the operation date.

**Block 2.5** — IF `(JFUStrConst.CD00037_920.equals(opSvcKeiStat) && JPCUtilCommon.isPastDate(kk0351RsvAplyYmd, opeDate, DOJITSU_HUKUMU))` (L3060)

> `CD00037_920 = "920"` (Cancelled/キャンセル済).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `continue;` // Skip — cancelled and effective |

### Block 2.6 — MAIN-OPTION PASS: PRICE CODE LOOKUP (L3072-3085)
> Look up the price code and pricing plan code from the static `OP_PRC_LIST` mapping.

**Block 2.6** — FOR `(int j = 0; j < OP_PRC_LIST.length; j++)` (L3072)

> `OP_PRC_LIST` contains 7 entries mapping [service code, price code, pricing plan code].

| # | Type | Code |
|---|------|------|
| 1 | IF | `OP_PRC_LIST[j][0].equals(opSvcCd)` (L3077) |
| 1.1 | SET | `opPcrsCd = OP_PRC_LIST[j][1]` // Price code |
| 1.2 | SET | `opPplanCd = OP_PRC_LIST[j][2]` // Pricing plan code |
| 1.3 | RETURN | `break;` // Found match, exit loop |

### Block 2.7 — MAIN-OPTION PASS: ADD TO RESULT (L3087-3090)
> Add the resolved pricing information to the result list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = new HashMap<String, String>()` |
| 2 | SET | `map.put("pcrs_cd", opPcrsCd)` |
| 3 | SET | `map.put("pplan_cd", opPplanCd)` |
| 4 | EXEC | `prcList.add(map)` // Add to result list |

### Block 3 — SUB-OPTION PASS: OUTER LOOP (L3092-3168)
> Iterate over each service contract record to process sub-optional services (サブオプション). This mirrors the main-option pass with additional DSL exclusion checks.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int i = 0; i < iCount; i++)` |
| 2 | CALL | `bean = svcKeiInfoList.getDataBean(i)` // Get i-th service record |

### Block 3.1 — SUB-OPTION PASS: EXTRACT FIELDS (L3094-3112)
> Extract sub-option service code, status, and reservation application date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sbopSvcCd = bean.sendMessageString(FUW05401SFConst.SBOP_SVC_CD_01, X31CWebConst.DATABEAN_GET_VALUE)` // Sub-option service code |
| 2 | SET | `sbopSvcKeiStat = bean.sendMessageString(FUW05401SFConst.SBOP_SVC_KEI_STAT_01, X31CWebConst.DATABEAN_GET_VALUE)` // Sub-option contract status |
| 3 | SET | `kk0401RsvAplyYmd = bean.sendMessageString(FUW05401SFConst.KK0401_RSV_APLY_YMD_01, X31CWebConst.DATABEAN_GET_VALUE)` // Sub-option reservation application date |
| 4 | SET | `sbopPcrsCd = ""` // Initialize price code |
| 5 | SET | `sbopPplanCd = ""` // Initialize pricing plan code |

### Block 3.2 — SUB-OPTION PASS: DSL CANCELLATION IN PROGRESS CHECK (L3114-3121)
> When `tran_div = "2"` (Cancellation), skip sub-options that match the screen option or deleted sub-option service codes.

**Block 3.2** — IF `(TRAN_DIV_DSL.equals(tran_div))` (L3114)

**Block 3.2.1** — IF `(screenOpSvcCd.equals(sbopSvcCd) || delSbopSvcCd.equals(sbopSvcCd))` (L3118)

> If the sub-option matches either the screen option code or the deleted sub-option code, skip.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `continue;` // Skip — sub-option involved in cancellation |

### Block 3.3 — SUB-OPTION PASS: TELEPHONE OPTION PACKAGE FILTER (L3123-3127)
> Same telephone option package filter as the main-option pass.

**Block 3.3** — IF `(!TEL_PACK_OPT_LIST.contains(sbopSvcCd))` (L3123)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `continue;` // Skip — not a telephone option package |

### Block 3.4 — SUB-OPTION PASS: CANCELED/CANCELLED STATUS CHECK (L3129-3137)
> Skip sub-options that are cancelled/cancelled AND have reservation application date >= operation date.

**Block 3.4** — IF `((JFUStrConst.CD00037_910.equals(sbopSvcKeiStat) || JFUStrConst.CD00037_920.equals(sbopSvcKeiStat)) && JPCUtilCommon.isPastDate(kk0401RsvAplyYmd, opeDate, DOJITSU_HUKUMU))` (L3129)

> Either status "910" (Canceled) or "920" (Cancelled) with effective date check.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `continue;` // Skip — cancelled or cancelled-effective |

### Block 3.5 — SUB-OPTION PASS: PRICE CODE LOOKUP (L3139-3152)
> Same price code lookup as the main-option pass, using sub-option service code.

**Block 3.5** — FOR `(int j = 0; j < OP_PRC_LIST.length; j++)` (L3139)

| # | Type | Code |
|---|------|------|
| 1 | IF | `OP_PRC_LIST[j][0].equals(sbopSvcCd)` (L3141) |
| 1.1 | SET | `sbopPcrsCd = OP_PRC_LIST[j][1]` // Price code |
| 1.2 | SET | `sbopPplanCd = OP_PRC_LIST[j][2]` // Pricing plan code |
| 1.3 | RETURN | `break;` // Found match |

### Block 3.6 — SUB-OPTION PASS: ADD TO RESULT (L3154-3168)
> Add the resolved sub-option pricing to the result list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = new HashMap<String, String>()` |
| 2 | SET | `map.put("pcrs_cd", sbopPcrsCd)` |
| 3 | SET | `map.put("pplan_cd", sbopPplanCd)` |
| 4 | EXEC | `prcList.add(map)` // Add sub-option pricing |

### Block 4 — APPLY BRANCH (L3170-3179)
> When the transaction division is `"1"` (Apply/申込), append the pricing information for the newly applied option.

**Block 4** — IF `(TRAN_DIV_MSKM.equals(tran_div))` `[TRAN_DIV_MSKM = "1"]` (L3170)

> This handles the case where a new option is being applied — the pricing for the new option needs to be included in the list.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `pcrsCd = getPcrsCdKK0601(ronriScreenId)` // Get price code for new option |
| 2 | CALL | `pplanCd = getPplanCdKK0601(ronriScreenId)` // Get pricing plan code for new option |
| 3 | SET | `map = new HashMap<String, String>()` |
| 4 | SET | `map.put("pcrs_cd", pcrsCd)` |
| 5 | SET | `map.put("pplan_cd", pplanCd)` |
| 6 | EXEC | `prcList.add(map)` // Add new option pricing |

### Block 5 — RETURN (L3181)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return prcList;` // Return assembled price list |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `tran_div` | Field | Transaction division — classifies the operation type: "1" = Apply (申込), "2" = Cancellation (解約), "3" = Change (変更) |
| `opeDate` | Field | Online operation date — current system date in yyyyMMDD format used as reference for effective date comparisons |
| `svcKeiInfoList` | Field | Service contract information list — contains all service contract records (main + sub-options) displayed on the screen |
| `opSvcCd` | Field | Option service code — identifies the type of optional service (e.g., B025 = Fiber Optic Internet, D07 = Call Forwarding Selection) |
| `opSvcKeiStat` | Field | Option service contract status — current state of the option subscription (e.g., "910" = Canceled/解約済, "920" = Cancelled/キャンセル済) |
| `kk0351RsvAplyYmd` | Field | Reservation application date (option service) — the date from which the option service becomes effective |
| `sbopSvcCd` | Field | Sub-option service code — identifies sub-optional services linked to a main option |
| `sbopSvcKeiStat` | Field | Sub-option service contract status — same status codes as `opSvcKeiStat` but for sub-options |
| `kk0401RsvAplyYmd` | Field | Reservation application date (sub-option service) — effective date for the sub-option |
| `pcrs_cd` | Field | Price code (料金コード) — identifies the pricing structure for an option service |
| `pplan_cd` | Field | Pricing plan code (料金プランコード) — identifies the specific pricing plan within a price code |
| `ronriScreenId` | Field | Ronri (logic/論理) screen ID — internal identifier for the optional service screen context |
| `screenOpSvcCd` | Field | Screen option service code — the option service code associated with the current screen context |
| `delSbopSvcCd` | Field | Deleted sub-option service code — sub-option code being cancelled during a DSL (cancellation) operation |
| `TEL_PACK_OPT_LIST` | Constant | Telephone option package list — 7 predefined optional service codes: B025 (Fiber Optic Internet), B023 (Optional Pack), B024 (Optional Pack), D07 (Call Forwarding Selection), D08 (Call Forwarding Selection Sub), B026 (Confused Call Rejection), B027 (Designated Number Ringing Selection) |
| `OP_PRC_LIST` | Constant | Option price mapping table — 7 entries mapping [option service code, price code, pricing plan code] |
| `TRAN_DIV_MSKM` | Constant | Transaction division value "1" (Apply/申込) |
| `TRAN_DIV_DSL` | Constant | Transaction division value "2" (Cancellation/解約) |
| `CD00037_910` | Constant | Service contract status code "910" (Canceled/解約済) |
| `CD00037_920` | Constant | Service contract status code "920" (Cancelled/キャンセル済) |
| `DOJITSU_HUKUMU` | Constant | Date comparison parameter "1" (include same day/同日を含む) — when true, `isPastDate` treats equal dates as past |
| CD00136_B025 | Constant | Option service code for Fiber Optic Internet (光インターネット) |
| CD00136_B023 | Constant | Option service code for Optional Pack (オプションパック) |
| CD00136_B024 | Constant | Option service code for Optional Pack |
| CD00137_D07 | Constant | Option service code for Call Forwarding Selection (転送電話選択) |
| CD00137_D08 | Constant | Option service code for Call Forwarding Selection Sub (転送電話選択のサブ) |
| CD00136_B026 | Constant | Option service code for Confused Call Rejection (迷惑電話拒否) |
| CD00136_B027 | Constant | Option service code for Designated Number Ringing Selection (指定番号着信選択) |
| CD00134_B29 | Constant | Price code for Fiber Optic Internet discount (光インターネット割引) |
| CD00134_B27 | Constant | Price code for Optional Pack 1 discount (オプションパック1割引) |
| CD00134_B28 | Constant | Price code for Optional Pack 2 discount (オプションパック2割引) |
| CD00134_D07 | Constant | Price code for Call Forwarding Selection discount (転送電話選択割引) |
| CD00134_B30 | Constant | Price code for Confused Call Rejection discount (迷惑電話拒否割引) |
| CD00134_B31 | Constant | Price code for Designated Number Ringing Selection discount (指定番号着信選択割引) |
| CD00565_PB2901 | Constant | Pricing plan code for Fiber Optic Internet (光インターネット固定単価) |
| CD00565_PB2701 | Constant | Pricing plan code for Optional Pack 1 (オプションパック1) |
| CD00565_PB2801 | Constant | Pricing plan code for Optional Pack 2 (オプションパック2) |
| CD00565_PD0701 | Constant | Pricing plan code for Call Forwarding Selection (転送電話選択) |
| CD00565_PB3001 | Constant | Pricing plan code for Confused Call Rejection (迷惑電話拒否) |
| CD00565_PB3101 | Constant | Pricing plan code for Designated Number Ringing Selection (指定番号着信選択) |
| OPT | Acronym | Optional — phone optional services (オプションサービス) — add-on telecommunication services |
| DSL | Acronym | Dismantle/Cancellation (解約) — in this codebase, refers to cancellation operations |
| MSKM | Acronym | Moshikomi/Application (申込) — refers to new subscription applications |
| RSV APLY YMD | Acronym | Reservation Application Year-Month-Day — the effective date when a service contract reservation takes effect |
| PRCD | Acronym | Price Code (料金コード) — identifies the pricing structure for an optional service |
| PPLAN | Acronym | Pricing Plan Code (料金プランコード) — identifies the specific pricing plan within a price code |
| RONRI | Acronym | Ronri (論理) — "logic" in Japanese, refers to screen routing/identification by service type |
| SBOP | Acronym | Sub-Option (サブオプション) — optional services that are child/nested under a main option |
| X31SDataBeanAccess | Class | Service-side data bean access — the primary data transfer object holding screen-form data and service contract information |
| X31SDataBeanAccessArray | Class | Array wrapper for data bean access — provides indexed access (getCount, getDataBean) to lists of service records |
| X31CWebConst.DATABEAN_GET_VALUE | Constant | Web constant for data bean get-value operation |
