2: /* $Header: xtrimnib.pls 120.1 2005/06/29 10:06:24 csutaria noship $*/
3:
4: /* Stub for consistency sake */
5: /*-------------------------------------------------------------------------------------*/
6: PROCEDURE TRANSFER_NI_DEALS(ARec_Interface IN XTR_DEALS_INTERFACE%ROWTYPE,
7: user_error OUT NOCOPY BOOLEAN,
8: mandatory_error OUT NOCOPY BOOLEAN,
9: validation_error OUT NOCOPY BOOLEAN,
10: limit_error OUT NOCOPY BOOLEAN) is
14: TRANSFER_NI_DEALS(ARec_Interface,user_error,mandatory_error,validation_error,limit_error,v_dummy);
15: END;
16:
17: /*-------------------------------------------------------------------------------------*/
18: PROCEDURE TRANSFER_NI_DEALS(ARec_Interface IN XTR_DEALS_INTERFACE%ROWTYPE,
19: user_error OUT NOCOPY BOOLEAN,
20: mandatory_error OUT NOCOPY BOOLEAN,
21: validation_error OUT NOCOPY BOOLEAN,
22: limit_error OUT NOCOPY BOOLEAN,
23: deal_num OUT NOCOPY NUMBER) is
24: /*-------------------------------------------------------------------------------------*/
25:
26: v_limit_log_return NUMBER;
27: l_risk_code_holder XTR_DEALS_INTERFACE.cparty_code%TYPE;
28:
29: BEGIN
30:
31: -------------------------
124:
125: CHECK_ACCRUAL_REVAL(ARec_Interface);
126:
127: /*----------------------------------------------------*/
128: /* Call the insert procedure to insert into xtr_deals */
129: /*----------------------------------------------------*/
130: CREATE_NI_DEAL;
131:
132: XTR_LIMITS_P.UPDATE_LIMIT_EXCESS_LOG(G_Ni_Main_Rec.DEAL_NO,
138:
139: /*----------------------------------------------------------------------------------*/
140: /* Since the insert is done, we can now delete the rows from the interface tables. */
141: /*----------------------------------------------------------------------------------*/
142: delete from xtr_deals_interface
143: where external_deal_id = ARec_Interface.external_deal_id
144: and deal_type = ARec_Interface.deal_type;
145:
146: delete from xtr_transactions_interface
148: and deal_type = ARec_Interface.deal_type;
149:
150: else
151:
152: update xtr_deals_interface
153: set load_status_code = 'ERROR',
154: last_update_date = G_Curr_Date,
155: Last_Updated_by = g_user_id
156: where external_deal_id = ARec_Interface.external_deal_id
163:
164: /*------------------------------------------------------------------------------*/
165: /* The following code implements the CHECK_MANDATORY_FIELDS process */
166: /*------------------------------------------------------------------------------*/
167: PROCEDURE CHECK_MANDATORY_FIELDS(ARec_Interface IN XTR_DEALS_INTERFACE%ROWTYPE,
168: error OUT NOCOPY BOOLEAN) is
169: /*------------------------------------------------------------------------------*/
170: PROCEDURE CHECK_MANDATORY_TR_FIELDS IS
171:
338:
339: /*------------------------------------------------------------------------*/
340: /* The following code implements the VALIDATE_DEALS process */
341: /*------------------------------------------------------------------------*/
342: PROCEDURE VALIDATE_DEALS(ARec_Interface IN XTR_DEALS_INTERFACE%ROWTYPE,
343: error OUT NOCOPY BOOLEAN) is
344: /*------------------------------------------------------------------------*/
345: rate_error boolean := FALSE;
346: validity_error boolean := FALSE;
367:
368:
369:
370: /*-------------------------------------------------------------------------*/
371: PROCEDURE CHECK_VALIDITY(ARec_Interface IN XTR_DEALS_INTERFACE%ROWTYPE,
372: error OUT NOCOPY BOOLEAN) is
373: /*-------------------------------------------------------------------------*/
374:
375:
803: /*-------------------------------------------------------------------------------*/
804: /* Flexfields Validation */
805: /*-------------------------------------------------------------------------------*/
806:
807: if not ( xtr_import_deal_data.val_desc_flex(ARec_Interface,'XTR_DEALS_DESC_FLEX',l_err_segment)) then
808: l_error := l_error +1;
809: if l_err_segment is not null and l_err_segment = 'Attribute16' then
810: xtr_import_deal_data.log_interface_errors( ARec_Interface.External_Deal_Id,
811: ARec_Interface.Deal_Type,
1495:
1496:
1497: /* ------------- END FIELD VALIDATION SECTION ------------------------------------*/
1498:
1499: PROCEDURE CHECK_ACCRUAL_REVAL(ARec_interface IN xtr_deals_interface%ROWTYPE) IS
1500:
1501: /*--------------------------------------------------------------------------------*/
1502: PROCEDURE CHK_TRANS_RATE(p_trans_rate IN VARCHAR2,
1503: p_currency IN VARCHAR2) is
1636:
1637: /* ------------- BEGIN DATA POPULATION SECTION -----------------------------------*/
1638:
1639: /*------------------------------------------------------------------------------------------*/
1640: PROCEDURE copy_from_interface_to_ni(ARec_Interface IN xtr_deals_interface%rowtype ) is
1641: /*------------------------------------------------------------------------------------------*/
1642:
1643: CURSOR GET_RISKPARTY_CODE IS
1644: select a.cparty_code
1804:
1805: /*--------------------------------------------*/
1806: /* Copying values into the Global Record Type */
1807: /*--------------------------------------------*/
1808: select xtr_deals_s.nextval
1809: into G_Ni_Main_Rec.DEAL_NO
1810: from dual;
1811:
1812: G_Ni_Main_Rec.EXTERNAL_DEAL_ID := ARec_Interface.EXTERNAL_DEAL_ID;
1911:
1912: /*------------------------------------------------------------*/
1913: /* The following code implements the calc_rates process */
1914: /*------------------------------------------------------------*/
1915: PROCEDURE CALC_RATES(ARec_Interface IN XTR_DEALS_INTERFACE%ROWTYPE,
1916: error OUT NOCOPY boolean) is
1917:
1918: l_bkr_amt_type varchar2(30);
1919: l_dummy_char varchar2(30);
2288: from xtr_tax_brokerage_setup_v
2289: where reference_code = p_tax_code;
2290: --
2291: cursor get_tax_codes(p_deal_no NUMBER) is
2292: select tax_code,income_tax_code from xtr_deals
2293: where deal_no=p_deal_no;
2294: --
2295: BEGIN
2296: g_prn_tax_settle_method:=null;
2886: v_error := v_rec.p_error;
2887: v_settle_method := v_rec.p_settle_method;
2888: p_prn_exp_number := v_rec.p_exp_number;
2889:
2890: update xtr_deals
2891: set tax_settled_reference=p_prn_exp_number
2892: where deal_no=G_Ni_Main_Rec.deal_no;
2893: end if;
2894:
2909: v_error := v_rec.p_error;
2910: v_settle_method := v_rec.p_settle_method;
2911: p_int_exp_number := v_rec.p_exp_number;
2912:
2913: update xtr_deals
2914: set income_tax_settled_ref=p_int_exp_number
2915: where deal_no=G_Ni_Main_Rec.deal_no;
2916: end if;
2917: END CALL_ONE_STEP_SETTLEMENT;
2971:
2972: GET_RISK_PARTY_NAMES;
2973:
2974:
2975: INSERT INTO XTR_DEALS
2976: (
2977: EXTERNAL_DEAL_ID,
2978: FREQUENCY,
2979: DEAL_TYPE,
3270: SET confirmation_validated_by = l_dual_user,
3271: confirmation_validated_on = l_dual_date
3272: WHERE deal_no = G_Ni_Main_Rec.DEAL_NO;
3273:
3274: UPDATE xtr_deals
3275: SET dual_authorisation_on = l_dual_date
3276: WHERE deal_no = G_Ni_Main_Rec.DEAL_NO;
3277: end if;
3278: