# Business Logic — JKKSeikyKeiBunkatsuCC.editInMsg_EKK0491D010() [395 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKSeikyKeiBunkatsuCC` |
| Layer | CC / Common Component (EJB business component) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKSeikyKeiBunkatsuCC.editInMsg_EKK0491D010()

This method constructs the inbound message payload (`CAANMsg`) for the **Invoice Contract Registration** service (Screen EKK0491D010 — Request Invoice Contract Registration). It acts as the **message builder** in a request/response messaging pattern, bridging the screen-layer request parameters with the CBS (Central Billing System) interface schema defined by `EKK0491D010CBSMsg`.

The method performs a **mapping-and-routing** design: it extracts billing and invoicing contract data from the request parameter map (`dataMap` and `childMap`) and transfers each field into a `CAANMsg` template following the CBS message contract. This includes billing method codes (bank account / credit card), payment method codes, contract details (effective date, cycle, name), sender/invoice-recipient address information (approximately 20+ fields), and first-payment remittance metadata.

Its **role in the larger system** is as a shared message-conversion utility. The calling method `execEKK0491D010()` uses this built message to invoke a service component (SC) that handles the invoice contract agreement — a core workflow in the customer billing subsystem. The method does not perform any database or business validation itself; it is purely a data-transfer layer that ensures the screen request is faithfully mapped into the CBS message format before invocation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsg_EKK0491D010"])
    STEP1["editInMsg param - common area setup"]
    STEP2["Create CAANMsg template EKK0491D010CBSMsg"]
    STEP3["Set templateID, FUNC_CODE, operatorID, dates"]
    STEP4["Get workMap from param"]
    STEP5{"mskm_dtl_no_out not null and not empty?"}
    STEP6["Set MSKM_DTL_NO from dataMap"]
    STEP7{"kksv040314_mskm_dtl_no is empty?"}
    STEP8{"FUNC_CODE equals 2 AND mskm_dtl_no equals 999999999999?"}
    STEP9["Set MSKM_DTL_NO to null (blank flag)"]
    STEP10["Set MSKM_DTL_NO from childMap"]
    STEP11{"seiky_way_no_koza_work exists and not empty?"}
    STEP12["Set SEIKY_WAY_NO_KOZA or null"]
    STEP13{"seiky_way_no_crecard_work exists and not empty?"}
    STEP14["Set SEIKY_WAY_NO_CRECARD or null"]
    STEP15["Set FUNC_CODE from dataMap"]
    STEP16{"sysid is empty?"}
    STEP17["Set SYSID or null"]
    STEP18["Map mansion_ownr_id, payway_cd, kei_cnc_ymd, seiky_cycle_cd"]
    STEP19["Map seiky_kei_kana, info_dsp_cd, seikyus_hakko_yh"]
    STEP20["Map sender address fields: sks_shs_ksh_ad_sai_flg through sohus_mlad"]
    STEP21["Map sohus_ad_chk_lv, seikyus_sohus_chge_ymd, rsv_tsta_kibo_ymd"]
    STEP22["Map ido_div, first_pay fields, seiky_way_aply_adj_ymd, first_seiky_ym"]
    STEP23["Wrap template in array, set TEMPLATE_LIST_KEY, return paramMap"]
    END_RETURN(["Return paramMap"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5
    STEP5 -- Yes --> STEP6 --> STEP7
    STEP5 -- No --> STEP7
    STEP7 -- Yes --> STEP8
    STEP8 -- Yes --> STEP9 --> STEP11
    STEP8 -- No --> STEP10 --> STEP11
    STEP7 -- No --> STEP11
    STEP11 --> STEP12 --> STEP13 --> STEP14 --> STEP15 --> STEP16 --> STEP17 --> STEP18 --> STEP19 --> STEP20 --> STEP21 --> STEP22 --> STEP23 --> END_RETURN
```

**Processing Overview:**

1. **Common Area Setup** — Delegates to `editInMsg(param)` to populate the standard common-area fields (operator ID, operation date/time, etc.).
2. **Template Creation** — Creates a new `CAANMsg` instance based on the `EKK0491D010CBSMsg` schema and sets fixed template metadata: template ID (`"EKK0491D010"`), function code (`"1"`), operator ID, and operation date/time.
3. **Work Map Extraction** — Retrieves the work area mapping from the request parameter.
4. **Detail Number Routing** — Branches on whether `mskm_dtl_no_out` is present in `dataMap`. If present, uses it directly. Otherwise, branches on whether the detail number field from `childMap` is empty, and further handles the "ALL9" blank-flag override (`JUDGE_MSKM_DTL_ALL9 = "999999999999"`) when function code is `"2"` (update confirmation).
5. **Billing Method Mapping** — Maps the bank account billing method number and credit card billing method number from `dataMap`.
6. **Core Contract Field Mapping** — Maps SYSID, mansion owner ID, payment method code, contract effective date, billing cycle code, contract kana name, info display code, invoice issuance flag, and all sender/invoice-recipient address fields (recipient name, kana, address, phone, fax, email).
7. **Additional Metadata** — Maps the sender address check level, request invoice sender change date, reservation application start date, movement classification, and all first-payment remittance fields.
8. **Return** — Wraps the template in a single-element array, stores it under `TEMPLATE_LIST_KEY`, and returns the populated `paramMap`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The inbound request parameter object that carries control data (operator ID, operation date/time, function code), the work area mapping, and where the constructed CBS message will be stored. It acts as the primary carrier of screen request context. |
| 2 | `dataMap` | `Map<String, Object>` | Request data map containing screen-level input values — specifically the detail number output key (`mskm_dtl_no_out`), billing method work fields (`ekk0501d010_seiky_way_no_koza_work`, `ekk0521d010_seiky_way_no_crecard_work`), SYSID, payment method code (`payway_cd`), and function code. These represent the primary business data submitted by the user on the invoice contract registration screen. |
| 3 | `childMap` | `HashMap<String, Object>` | Child/child-entity data map containing sub-record values — particularly the detail number (`kksv040314_mskm_dtl_no`), mansion owner ID, SYSID, and approximately 25+ sender/recipient address fields (name, kana, full address components, phone/fax/email, address manual entry flag, address check level). These fields come from child screen components or sub-forms. |

**Referenced constants (resolved):**

| Constant | Value | Meaning |
|----------|-------|---------|
| `TEMPLATE_ID_EKK0491D010` | `"EKK0491D010"` | Template identifier for the invoice contract registration CBS message schema |
| `JUDGE_MSKM_DTL_ALL9` | `"999999999999"` | Blank-flag sentinel: when the detail number is set to all nines and the function code is "2" (update confirmation), the detail number is cleared (set to null) in the outbound message |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKSeikyKeiBunkatsuCC.editInMsg` | - | - | Calls `editInMsg` to populate common area fields in the request parameter (U = Update the paramMap) |
| R | `SCW00701SFLogic.getName` | - | - | Utility method reference from the pre-computed graph |

### Additional method calls observed in source (direct within `editInMsg_EKK0491D010`):

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `CAANMsg.set` | EKK0491D010CBS | - | Sets individual fields on the CBS message template (MSKM_DTL_NO, SEIKY_WAY_NO_KOZA, SEIKY_WAY_NO_CRECARD, SYSID, MANSION_OWNR_ID, PAYWAY_CD, KEI_CNC_YMD, SEIKY_CYCLE_CD, SEIKY_KEI_KANA, INFO_DSP_CD, SEIKYUS_HAKKO_YH, all sender address fields, etc.) |
| U | `CAANMsg.setNull` | EKK0491D010CBS | - | Clears fields that are null or empty from the source data (MSKM_DTL_NO, SYSID, and all sender address fields when empty) |
| U | `param.setControlMapData` (via editInMsg) | - | - | Sets control map entries (operator ID, operation date/time) |
| U | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` | - | - | Stores the built template array into the paramMap for downstream consumption |

**Note:** This method performs **no database operations or entity-level CRUD**. It is a pure message-construction method. All CRUD (Create/Read/Update/Delete) against database entities occurs in the **calling** method `execEKK0491D010()` which passes the built message to a service component invoker (`scCall.run(paramMap, handle)`) and then processes the result.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
Terminal operations from this method: `setNull` [-], `set` [-], `editInMsg` [-].

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: EKK0491D010 | `JKKSeikyKeiBunkatsuCC.execEKK0491D010` -> `JKKSeikyKeiBunkatsuCC.editInMsg_EKK0491D010` | `editInMsg [U] -`, `CAANMsg.set [U] -`, `CAANMsg.setNull [U] -` |

**Call Chain Details:**
1. `execEKK0491D010(handle, param, scCall, dataMap, childMap)` — This is the entry point called by the CBS invocation framework for screen EKK0491D010. It calls `editInMsg_EKK0491D010()` to build the inbound message, then invokes the service component via `scCall.run(paramMap, handle)`, processes the result through `editOutMsg_EKK0491D010()`, and performs error result determination via `jdgErrRslt()`.

The method itself only calls:
- `editInMsg(param)` — same class, populates common area
- `CAANMsg.set()` / `CAANMsg.setNull()` — local template field operations
- `param.getControlMapData()`, `param.getMappingWorkArea()` — parameter accessor calls
- No external SC/CBS calls originate from this method

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] Common area setup (L3765)

> Calls `editInMsg(param)` to populate common control fields (operator ID, operation date/time, function code) in the paramMap. This is a shared setup step used by all methods in this class.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `paramMap = editInMsg(param)` |

**Block 2** — [EXEC] Template creation and fixed field setup (L3767–L3779)

> Creates the CBS message template and sets fixed metadata: template ID, function code, operator ID, operation date, and operation date/time.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EKK0491D010CBSMsg.class.getName())` |
| 2 | SET | `template.set(TEMPLATEID, TEMPLATE_ID_EKK0491D010)` [-> `"EKK0491D010"`] |
| 3 | SET | `template.set(FUNC_CODE, "1")` |
| 4 | EXEC | `operatorId = param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` |
| 5 | SET | `template.set(OPERATOR_ID_KEY, operatorId)` |
| 6 | EXEC | `operateDate = param.getControlMapData(SCControlMapKeys.OPE_DATE)` |
| 7 | SET | `template.set(OPERATE_DATE_KEY, operateDate)` |
| 8 | EXEC | `operateDateTime = param.getControlMapData(SCControlMapKeys.OPE_TIME)` |
| 9 | SET | `template.set(OPERATE_DATETIME_KEY, operateDateTime)` |
| 10 | SET | `workMap = param.getMappingWorkArea()` |

**Block 3** — [IF/ELSE] Detail number source routing (L3803–L3846)

> Determines the source of the invoice detail number (MSKM_DTL_NO). In v8.00.00, the logic changed from checking service contract status (`svkeiStateCd`) to checking the `mskm_dtl_no_out` field in dataMap. If present in dataMap, uses it directly. Otherwise, falls through to childMap-based logic.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svkeiStateCd` (commented out, v8.00.00 removed) |
| 2 | IF | `dataMap.get("mskm_dtl_no_out") != null && !"".equals(dataMap.get("mskm_dtl_no_out"))` |

**Block 3.1** — [IF body] Use dataMap detail number (L3805)

> When `mskm_dtl_no_out` is populated in `dataMap`, use it as the invoice detail number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(MSKM_DTL_NO, dataMap.get("mskm_dtl_no_out"))` |

**Block 3.2** — [ELSE] ChildMap-based detail number (L3843)

> When `mskm_dtl_no_out` is not present, delegate to childMap. See Block 4.

| # | Type | Code |
|---|------|------|
| 1 | — | (delegate to nested condition) |

**Block 4** — [IF/ELSE/IF-ELSE] Detail number from childMap (L3845–L3848)

> Checks if the detail number field in childMap is empty. If empty, set null. Otherwise, process it with an additional blank-flag check.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_mskm_dtl_no"))` |

**Block 4.1** — [IF body] Empty detail number (L3846)

> When the detail number is an empty string in childMap, set null on the template.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(MSKM_DTL_NO)` |

**Block 4.2** — [ELSE] Non-empty detail number (L3847–L3849)

> When the detail number is not empty, apply an additional blank-flag override for update confirmation mode. See Block 5.

| # | Type | Code |
|---|------|------|
| 1 | — | (delegate to nested condition) |

**Block 5** — [IF/ELSE] Blank-flag override (v14.00.00) (L3851–L3855)

> In update confirmation mode (FUNC_CODE = "2"), if the detail number equals `JUDGE_MSKM_DTL_ALL9` (all nines = `"999999999999"`), it indicates a "blank all" selection and the detail number must be cleared (set to null). Otherwise, pass the detail number through.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_mskm_dtl_no")) == false` AND `FUNC_CODE_KEY == "2"` AND `childMap.get("kksv040314_mskm_dtl_no") == JUDGE_MSKM_DTL_ALL9 ("999999999999")` |

**Block 5.1** — [IF body] Blank flag detected (L3852)

> The user selected "all blank" in update confirmation. Set null to clear the detail number in the CBS message.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(MSKM_DTL_NO)` |

**Block 5.2** — [ELSE] Normal detail number (L3854)

> Standard case — pass the detail number value from childMap through to the template.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(MSKM_DTL_NO, (String) childMap.get("kksv040314_mskm_dtl_no"))` |

**Block 6** — [IF/ELSE] Billing method — Bank account (L3858–L3862)

> Maps the work field for billing method number (bank account) from `dataMap`. If the field is null or empty, sets null; otherwise casts and sets the string value.

| # | Type | Code |
|---|------|------|
| 1 | IF | `dataMap == null OR dataMap.get("ekk0501d010_seiky_way_no_koza_work") == null OR "".equals(dataMap.get("ekk0501d010_seiky_way_no_koza_work"))` |
| 2 | SET | `template.setNull(SEIKY_WAY_NO_KOZA)` |
| 3 | SET | `template.set(SEIKY_WAY_NO_KOZA, (String) dataMap.get("ekk0501d010_seiky_way_no_koza_work"))` |

**Block 7** — [IF/ELSE] Billing method — Credit card (L3863–L3867)

> Maps the work field for billing method number (credit card) from `dataMap`. Same null/empty-check pattern.

| # | Type | Code |
|---|------|------|
| 1 | IF | `dataMap == null OR dataMap.get("ekk0521d010_seiky_way_no_crecard_work") == null OR "".equals(dataMap.get("ekk0521d010_seiky_way_no_crecard_work"))` |
| 2 | SET | `template.setNull(SEIKY_WAY_NO_CRECARD)` |
| 3 | SET | `template.set(SEIKY_WAY_NO_CRECARD, (String) dataMap.get("ekk0521d010_seiky_way_no_crecard_work"))` |

**Block 8** — [EXEC] Set function code from dataMap (L3871)

> Overrides the hardcoded function code `"1"` set earlier with the actual function code from the request.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(FUNC_CODE, dataMap.get(JCMConstants.FUNC_CODE_KEY))` |

**Block 9** — [IF/ELSE] SYSID mapping (v8.00.01, L3877–L3881)

> Maps SYSID from `dataMap` (changed from `childMap` in v8.00.01). If empty, sets null; otherwise sets the value.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(dataMap.get("sysid"))` |
| 2 | SET | `template.setNull(SYSID)` |
| 3 | SET | `template.set(SYSID, (String) dataMap.get("sysid"))` |

**Block 10** — [IF/ELSE] Mansion owner ID (L3885–L3889)

> Maps mansion owner ID from `childMap`. If empty, sets null.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_mansion_ownr_id"))` |
| 2 | SET | `template.setNull(MANSION_OWNR_ID)` |
| 3 | SET | `template.set(MANSION_OWNR_ID, (String) childMap.get("kksv040314_mansion_ownr_id"))` |

**Block 11** — [IF/ELSE] Payment method code (L3893–L3897)

> Maps payment method code from `dataMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(dataMap.get("payway_cd"))` |
| 2 | SET | `template.setNull(SEIKY_WAY_CD)` |
| 3 | SET | `template.set(SEIKY_WAY_CD, (String) dataMap.get("payway_cd"))` |

**Block 12** — [IF/ELSE] Contract effective date (L3901–L3905)

> Maps contract conclusion date (YYYYMMDD format) from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_kei_cnc_ymd"))` |
| 2 | SET | `template.setNull(KEI_CNC_YMD)` |
| 3 | SET | `template.set(KEI_CNC_YMD, (String) childMap.get("kksv040314_kei_cnc_ymd"))` |

**Block 13** — [IF/ELSE] Billing cycle code (L3909–L3913)

> Maps billing cycle code (e.g., monthly, quarterly) from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_seiky_cycle_cd"))` |
| 2 | SET | `template.setNull(SEIKY_CYCLE_CD)` |
| 3 | SET | `template.set(SEIKY_CYCLE_CD, (String) childMap.get("kksv040314_seiky_cycle_cd"))` |

**Block 14** — [IF/ELSE] Contract kana name (L3917–L3921)

> Maps invoice contract kana name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_seiky_kei_kana"))` |
| 2 | SET | `template.setNull(SEIKY_KEI_KANA)` |
| 3 | SET | `template.set(SEIKY_KEI_KANA, (String) childMap.get("kksv040314_seiky_kei_kana"))` |

**Block 15** — [IF/ELSE] Info display code (L3925–L3929)

> Maps information display code from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_info_dsp_cd"))` |
| 2 | SET | `template.setNull(INFO_DSP_CD)` |
| 3 | SET | `template.set(INFO_DSP_CD, (String) childMap.get("kksv040314_info_dsp_cd"))` |

**Block 16** — [IF/ELSE] Invoice issuance flag (L3933–L3937)

> Maps invoice issuance required/flag from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_seikyus_hakko_yh"))` |
| 2 | SET | `template.setNull(SEIKYUS_HAKKO_YH)` |
| 3 | SET | `template.set(SEIKYUS_HAKKO_YH, (String) childMap.get("kksv040314_seikyus_hakko_yh"))` |

**Block 17** — [IF/ELSE] Invoice sender-Contractor address mismatch flag (L3941–L3945)

> Maps flag indicating whether the invoice delivery address differs from the contractor's registered address.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sks_shs_ksh_ad_sai_flg"))` |
| 2 | SET | `template.setNull(SKS_SHS_KSH_AD_SAI_FLG)` |
| 3 | SET | `template.set(SKS_SHS_KSH_AD_SAI_FLG, (String) childMap.get("kksv040314_sks_shs_ksh_ad_sai_flg"))` |

**Block 18** — [IF/ELSE] Invoice sender name-Customer name mismatch flag (L3949–L3953)

> Maps flag indicating whether the invoice delivery name differs from the customer's registered name.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sks_shs_nm_cust_nm_sai_flg"))` |
| 2 | SET | `template.setNull(SKS_SHS_NM_CUST_NM_SAI_FLG)` |
| 3 | SET | `template.set(SKS_SHS_NM_CUST_NM_SAI_FLG, (String) childMap.get("kksv040314_sks_shs_nm_cust_nm_sai_flg"))` |

**Block 19** — [IF/ELSE] Sender organization type code (L3957–L3961)

> Maps sender legal entity type code (individual vs. corporation) from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_shs_hojin_sbt_cd"))` |
| 2 | SET | `template.setNull(SHS_HOJIN_SBT_CD)` |
| 3 | SET | `template.set(SHS_HOJIN_SBT_CD, (String) childMap.get("kksv040314_shs_hojin_sbt_cd"))` |

**Block 20** — [IF/ELSE] Sender organization prefix/suffix designation (L3965–L3969)

> Maps sender legal entity prefix/suffix designation code from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_shs_hojin_zengo_shitei_cd"))` |
| 2 | SET | `template.setNull(SHS_HOJIN_ZENGO_SHITEI_CD)` |
| 3 | SET | `template.set(SHS_HOJIN_ZENGO_SHITEI_CD, (String) childMap.get("kksv040314_shs_hojin_zengo_shitei_cd"))` |

**Block 21** — [IF/ELSE] Sender kana name (L3973–L3977)

> Maps sender kana name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_shs_kana"))` |
| 2 | SET | `template.setNull(SHS_KANA)` |
| 3 | SET | `template.set(SHS_KANA, (String) childMap.get("kksv040314_shs_kana"))` |

**Block 22** — [IF/ELSE] Sender name (L3981–L3985)

> Maps sender name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_nm"))` |
| 2 | SET | `template.setNull(SOHUS_NM)` |
| 3 | SET | `template.set(SOHUS_NM, (String) childMap.get("kksv040314_sohus_nm"))` |

**Block 23** — [IF/ELSE] Sender department name (L3989–L3993)

> Maps sender department name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_bkm"))` |
| 2 | SET | `template.setNull(SOHUS_BKM)` |
| 3 | SET | `template.set(SOHUS_BKM, (String) childMap.get("kksv040314_sohus_bkm"))` |

**Block 24** — [IF/ELSE] Sender responsible person name (L3997–L4001)

> Maps sender responsible person name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_tntsha_nm"))` |
| 2 | SET | `template.setNull(SOHUS_TNTSHA_NM)` |
| 3 | SET | `template.set(SOHUS_TNTSHA_NM, (String) childMap.get("kksv040314_sohus_tntsha_nm"))` |

**Block 25** — [IF/ELSE] Sender address code (L4005–L4009)

> Maps sender address code from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_ad_cd"))` |
| 2 | SET | `template.setNull(SOHUS_AD_CD)` |
| 3 | SET | `template.set(SOHUS_AD_CD, (String) childMap.get("kksv040314_sohus_ad_cd"))` |

**Block 26** — [IF/ELSE] Sender postal code (L4013–L4017)

> Maps sender postal code from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_pcd"))` |
| 2 | SET | `template.setNull(SOHUS_PCD)` |
| 3 | SET | `template.set(SOHUS_PCD, (String) childMap.get("kksv040314_sohus_pcd"))` |

**Block 27** — [IF/ELSE] Sender prefecture name (L4021–L4025)

> Maps sender prefecture name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_state_nm"))` |
| 2 | SET | `template.setNull(SOHUS_STATE_NM)` |
| 3 | SET | `template.set(SOHUS_STATE_NM, (String) childMap.get("kksv040314_sohus_state_nm"))` |

**Block 28** — [IF/ELSE] Sender city/town/village name (L4029–L4033)

> Maps sender city/town/village name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_city_nm"))` |
| 2 | SET | `template.setNull(SOHUS_CITY_NM)` |
| 3 | SET | `template.set(SOHUS_CITY_NM, (String) childMap.get("kksv040314_sohus_city_nm"))` |

**Block 29** — [IF/ELSE] Sender district name (L4037–L4041)

> Maps sender district (oaza/aza) name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_oaztsu_nm"))` |
| 2 | SET | `template.setNull(SOHUS_OAZTSU_NM)` |
| 3 | SET | `template.set(SOHUS_OAZTSU_NM, (String) childMap.get("kksv040314_sohus_oaztsu_nm"))` |

**Block 30** — [IF/ELSE] Sender block/cho name (L4045–L4049)

> Maps sender block/cho (aza-cho-me) name from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_azcho_nm"))` |
| 2 | SET | `template.setNull(SOHUS_AZCHO_NM)` |
| 3 | SET | `template.set(SOHUS_AZCHO_NM, (String) childMap.get("kksv040314_sohus_azcho_nm"))` |

**Block 31** — [IF/ELSE] Sender address supplement — Building name (L4053–L4057)

> Maps sender address supplement (building name) from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_adrttm"))` |
| 2 | SET | `template.setNull(SOHUS_ADRTTM)` |
| 3 | SET | `template.set(SOHUS_ADRTTM, (String) childMap.get("kksv040314_sohus_adrttm"))` |

**Block 32** — [IF/ELSE] Sender address supplement — Room number (L4061–L4065)

> Maps sender address supplement (room number) from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_adrrm"))` |
| 2 | SET | `template.setNull(SOHUS_ADRRM)` |
| 3 | SET | `template.set(SOHUS_ADRRM, (String) childMap.get("kksv040314_sohus_adrrm"))` |

**Block 33** — [IF/ELSE] Sender block/ground number (L4069–L4073)

> Maps sender block/ground reference number from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_bnchigo"))` |
| 2 | SET | `template.setNull(SOHUS_BNCHIGO)` |
| 3 | SET | `template.set(SOHUS_BNCHIGO, (String) childMap.get("kksv040314_sohus_bnchigo"))` |

**Block 34** — [IF/ELSE] Sender telephone number (L4077–L4081)

> Maps sender telephone number from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_telno"))` |
| 2 | SET | `template.setNull(SOHUS_TELNO)` |
| 3 | SET | `template.set(SOHUS_TELNO, (String) childMap.get("kksv040314_sohus_telno"))` |

**Block 35** — [IF/ELSE] Sender FAX number (L4085–L4089)

> Maps sender FAX number from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_fax_no"))` |
| 2 | SET | `template.setNull(SOHUS_FAX_NO)` |
| 3 | SET | `template.set(SOHUS_FAX_NO, (String) childMap.get("kksv040314_sohus_fax_no"))` |

**Block 36** — [IF/ELSE] Sender email address (L4093–L4097)

> Maps sender email address from `childMap`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_mlad"))` |
| 2 | SET | `template.setNull(SOHUS_MLAD)` |
| 3 | SET | `template.set(SOHUS_MLAD, (String) childMap.get("kksv040314_sohus_mlad"))` |

**Block 37** — [IF/ELSE] Sender address manual entry flag (L4101–L4105)

> Maps flag indicating whether the sender address was manually entered (vs. auto-populated from address code).

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_sohus_ad_man_input_flg"))` |
| 2 | SET | `template.setNull(SOHUS_AD_MAN_INPUT_FLG)` |
| 3 | SET | `template.set(SOHUS_AD_MAN_INPUT_FLG, (String) childMap.get("kksv040314_sohus_ad_man_input_flg"))` |

**Block 38** — [IF/ELSE] Sender address check level (v4.00.00/v4.01.00, L4111–L4119)

> Maps the sender address check level from `childMap`. In v4.01.00, the field name was changed from `ad_chk_lv` to `sohus_ad_chk_lv`. If empty, sets null; otherwise sets the value.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("sohus_ad_chk_lv"))` [changed from `"ad_chk_lv"` in v4.01.00] |
| 2 | SET | `template.setNull(SOHUS_AD_CHK_LV)` |
| 3 | SET | `template.set(SOHUS_AD_CHK_LV, (String) childMap.get("sohus_ad_chk_lv"))` [changed from `"ad_chk_lv"` in v4.01.00] |

**Block 39** — [IF/ELSE] Invoice sender change date (L4124–L4128)

> Maps the date when the invoice sender information was last changed.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_seikyus_sohus_chge_ymd"))` |
| 2 | SET | `template.setNull(SEIKYUS_SOHUS_CHGE_YMD)` |
| 3 | SET | `template.set(SEIKYUS_SOHUS_CHGE_YMD, (String) childMap.get("kksv040314_seikyus_sohus_chge_ymd"))` |

**Block 40** — [IF/ELSE] Reservation application start date (L4132–L4136)

> Maps the desired reservation application start date (YYYYMMDD format).

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_rsv_tsta_kibo_ymd"))` |
| 2 | SET | `template.setNull(RSV_TSTA_KIBO_YMD)` |
| 3 | SET | `template.set(RSV_TSTA_KIBO_YMD, (String) childMap.get("kksv040314_rsv_tsta_kibo_ymd"))` |

**Block 41** — [IF/ELSE] Movement classification (L4140–L4144)

> Maps the movement type classification code (e.g., new contract, transfer, renewal).

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_ido_div"))` |
| 2 | SET | `template.setNull(IDO_DIV)` |
| 3 | SET | `template.set(IDO_DIV, (String) childMap.get("kksv040314_ido_div"))` |

**Block 42** — [IF/ELSE] First payment submission required flag (L4148–L4152)

> Maps whether the first-payment remittance instruction must be submitted.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_first_pay_mskmsho_sohu_yh"))` |
| 2 | SET | `template.setNull(FIRST_PAY_MSKMSHO_SOHU_YH)` |
| 3 | SET | `template.set(FIRST_PAY_MSKMSHO_SOHU_YH, (String) childMap.get("kksv040314_first_pay_mskmsho_sohu_yh"))` |

**Block 43** — [IF/ELSE] First payment submission date (L4155–L4159)

> Maps the date of first-payment remittance submission.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_first_pay_mskmsho_sohu_ymd"))` |
| 2 | SET | `template.setNull(FIRST_PAY_MSKMSHO_SOHU_YMD)` |
| 3 | SET | `template.set(FIRST_PAY_MSKMSHO_SOHU_YMD, (String) childMap.get("kksv040314_first_pay_mskmsho_sohu_ymd"))` |

**Block 44** — [IF/ELSE] First payment receipt date (L4162–L4166)

> Maps the date of first-payment remittance receipt.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_first_pay_mskmsho_rcp_ymd"))` |
| 2 | SET | `template.setNull(FIRST_PAY_MSKMSHO_RCP_YMD)` |
| 3 | SET | `template.set(FIRST_PAY_MSKMSHO_RCP_YMD, (String) childMap.get("kksv040314_first_pay_mskmsho_rcp_ymd"))` |

**Block 45** — [IF/ELSE] Billing method application adjustment date (L4170–L4174)

> Maps the billing method application adjustment date.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_seiky_way_aply_adj_ymd"))` |
| 2 | SET | `template.setNull(SEIKY_WAY_APLY_ADJ_YMD)` |
| 3 | SET | `template.set(SEIKY_WAY_APLY_ADJ_YMD, (String) childMap.get("kksv040314_seiky_way_aply_adj_ymd"))` |

**Block 46** — [IF/ELSE] First invoice month (L4178–L4182)

> Maps the first invoice month (YYYYMM format).

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040314_first_seiky_ym"))` |
| 2 | SET | `template.setNull(FIRST_SEIKY_YM)` |
| 3 | SET | `template.set(FIRST_SEIKY_YM, (String) childMap.get("kksv040314_first_seiky_ym"))` |

**Block 47** — [RETURN] Template assembly and return (L4186–L4189)

> Wraps the single template in a `CAANMsg[]` array, stores it under `TEMPLATE_LIST_KEY` in `paramMap`, and returns the complete parameter map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `templates = new CAANMsg[1]` |
| 2 | SET | `templates[0] = template` |
| 3 | SET | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` |
| 4 | RETURN | `return paramMap` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskm_dtl_no` | Field | Invoice detail number — the unique line-item identifier for an invoice contract registration entry. When set to all nines (`999999999999`), it represents a "blank all" selection in update confirmation mode. |
| `mskm_dtl_no_out` | Field | Invoice detail number output — an alternate source for the detail number, used when the screen populates it in a prior processing step. |
| `seiky_way_no_koza_work` | Field | Billing method number (bank account) work field — specifies bank account-based billing method. |
| `seiky_way_no_crecard_work` | Field | Billing method number (credit card) work field — specifies credit card-based billing method. |
| `payway_cd` | Field | Payment method code — classifies the type of payment (bank transfer, credit card, etc.). |
| `kei_cnc_ymd` | Field | Contract conclusion date — the date the service contract was established (YYYYMMDD format). |
| `seiky_cycle_cd` | Field | Billing cycle code — the periodicity of invoice generation (monthly, quarterly, annual, etc.). |
| `seiky_kei_kana` | Field | Invoice contract kana name — the kana phonetic spelling of the invoice contract name. |
| `info_dsp_cd` | Field | Information display code — controls what billing-related information is displayed on screens/reports. |
| `seikyus_hakko_yh` | Field | Invoice issuance required/flag — whether an invoice document should be generated. |
| `sks_shs_ksh_ad_sai_flg` | Field | Invoice sender address-Contractor address mismatch flag — indicates whether the invoice delivery address differs from the contractor's registered address. |
| `sks_shs_nm_cust_nm_sai_flg` | Field | Invoice sender name-Customer name mismatch flag — indicates whether the invoice delivery name differs from the customer's registered name. |
| `shs_hojin_sbt_cd` | Field | Sender organization type code — classifies the sender as an individual (taijin) or corporation (hojin). |
| `shs_hojin_zengo_shitei_cd` | Field | Sender organization prefix/suffix designation code — controls the ordering of honorific suffixes for corporate names. |
| `sohus_nm` | Field | Sender name — the name of the invoice delivery recipient. |
| `sohus_kana` | Field | Sender kana name — the kana phonetic spelling of the sender name. |
| `sohus_bkm` | Field | Sender department name — the department within the sender organization. |
| `sohus_tntsha_nm` | Field | Sender responsible person name — the named contact person at the sender organization. |
| `sohus_ad_cd` | Field | Sender address code — the postal/address code used to auto-populate the sender address. |
| `sohus_pcd` | Field | Sender postal code — the postal code of the sender address. |
| `sohus_state_nm` | Field | Sender prefecture name — the prefecture (province/prefecture) of the sender address. |
| `sohus_city_nm` | Field | Sender city/town/village name — the municipality of the sender address. |
| `sohus_oaztsu_nm` | Field | Sender district name — the oaza/aza (large/small district) of the sender address. |
| `sohus_azcho_nm` | Field | Sender block/cho name — the aza-cho-me (block-level) designation of the sender address. |
| `sohus_adrttm` | Field | Sender address supplement — Building name — the building name component of the sender address. |
| `sohus_adrrm` | Field | Sender address supplement — Room number — the room/suite number component of the sender address. |
| `sohus_bnchigo` | Field | Sender block/ground number — the land parcel/block reference number of the sender address. |
| `sohus_telno` | Field | Sender telephone number — the contact phone number of the sender. |
| `sohus_fax_no` | Field | Sender FAX number — the contact FAX number of the sender. |
| `sohus_mlad` | Field | Sender email address — the contact email address of the sender. |
| `sohus_ad_man_input_flg` | Field | Sender address manual entry flag — indicates whether the sender address was manually typed rather than auto-populated. |
| `sohus_ad_chk_lv` | Field | Sender address check level — the validation level used when verifying the sender address (changed from `ad_chk_lv` in v4.01.00). |
| `seikyus_sohus_chge_ymd` | Field | Invoice sender change date — the date when the invoice sender information was last modified. |
| `rsv_tsta_kibo_ymd` | Field | Reservation application start date — the requested start date for the reservation application. |
| `ido_div` | Field | Movement classification — the type of contract change (new, transfer, renewal, cancellation, etc.). |
| `first_pay_mskmsho_sohu_yh` | Field | First payment remittance submission required flag — whether the initial payment remittance instruction must be submitted. |
| `first_pay_mskmsho_sohu_ymd` | Field | First payment remittance submission date — the date the first payment remittance instruction was submitted. |
| `first_pay_mskmsho_rcp_ymd` | Field | First payment remittance receipt date — the date the first payment remittance was received. |
| `seiky_way_aply_adj_ymd` | Field | Billing method application adjustment date — the date when the billing method application was adjusted. |
| `first_seiky_ym` | Field | First invoice month — the YYYYMM of the first invoice generation. |
| `mskm_dtl_no` (childMap) | Field | Invoice detail number from child screen — the detail number passed from the child form component (`kksv040314_mskm_dtl_no`). |
| `mansion_ownr_id` | Field | Mansion owner ID — the identifier for the building/mansion owner. |
| `sysid` | Field | SYSID — the system identifier for the service. |
| TEMPLATE_ID_EKK0491D010 | Constant | Template identifier string `"EKK0491D010"` for the invoice contract registration CBS message schema. |
| JUDGE_MSKM_DTL_ALL9 | Constant | Sentinel value `"999999999999"` indicating a "blank all" selection in update confirmation mode. |
| EKK0491D010CBSMsg | Class | CBS message schema class defining the field structure for the invoice contract registration service message. |
| CAANMsg | Class | Fujitsu's message abstraction class for constructing CBS service request/response payloads. |
| JKKSeikyKeiBunkatsuCC | Class | Invoice contract division/common component — the EJB component handling invoice contract registration operations. |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service (a service type handled by this customer billing system). |
| CBS | Acronym | Central Billing System — the core billing service backbone. |
| SC | Acronym | Service Component — the service layer component that handles business operations. |
| CAAN | Acronym | Fujitsu's messaging framework (Component Application ANchor) for CBS service communication. |
| FUNC_CODE | Field | Function code — indicates the screen operation type ("1" = add, "2" = update confirmation, etc.). |
| Template List | Data structure | `CAANMsg[]` array containing the built CBS message templates, stored in `paramMap` under `TEMPLATE_LIST_KEY` for downstream service invocation. |
| `kksv040314_` | Prefix | Screen EKK0491D010 child-data field prefix — all fields prefixed with `kksv040314_` originate from the child screen component of the invoice contract registration screen. |
