836: g_main_rec.DEAL_LINK_CODE := ARec_Interface.deal_linking_code;
837:
838: --Bug 2254853
839: if nvl(g_main_rec.SETTLE_ACTION_REQD, 'N') = 'Y' then
840: g_main_rec.DUAL_AUTHORISATION_BY := ARec_Interface.dual_authorization_by;
841: g_main_rec.DUAL_AUTHORISATION_ON := ARec_Interface.dual_authorization_on;
842: else
843: g_main_rec.DUAL_AUTHORISATION_BY := NULL;
844: g_main_rec.DUAL_AUTHORISATION_ON := NULL;
837:
838: --Bug 2254853
839: if nvl(g_main_rec.SETTLE_ACTION_REQD, 'N') = 'Y' then
840: g_main_rec.DUAL_AUTHORISATION_BY := ARec_Interface.dual_authorization_by;
841: g_main_rec.DUAL_AUTHORISATION_ON := ARec_Interface.dual_authorization_on;
842: else
843: g_main_rec.DUAL_AUTHORISATION_BY := NULL;
844: g_main_rec.DUAL_AUTHORISATION_ON := NULL;
845: end if;
839: if nvl(g_main_rec.SETTLE_ACTION_REQD, 'N') = 'Y' then
840: g_main_rec.DUAL_AUTHORISATION_BY := ARec_Interface.dual_authorization_by;
841: g_main_rec.DUAL_AUTHORISATION_ON := ARec_Interface.dual_authorization_on;
842: else
843: g_main_rec.DUAL_AUTHORISATION_BY := NULL;
844: g_main_rec.DUAL_AUTHORISATION_ON := NULL;
845: end if;
846: --Bug 2254853
847:
840: g_main_rec.DUAL_AUTHORISATION_BY := ARec_Interface.dual_authorization_by;
841: g_main_rec.DUAL_AUTHORISATION_ON := ARec_Interface.dual_authorization_on;
842: else
843: g_main_rec.DUAL_AUTHORISATION_BY := NULL;
844: g_main_rec.DUAL_AUTHORISATION_ON := NULL;
845: end if;
846: --Bug 2254853
847:
848: end if;
946: g_main_rec.PROGRAM_UPDATE_DATE := g_curr_date;
947: g_main_rec.INTERNAL_COMMENTS := ARec.internal_comments;
948: g_main_rec.EXTERNAL_COMMENTS := ARec.external_comments;
949: g_main_rec.DEAL_LINK_CODE := ARec.deal_link_code;
950: g_main_rec.DUAL_AUTHORISATION_BY := g_user;
951: g_main_rec.DUAL_AUTHORISATION_ON := trunc(g_curr_date);
952: g_main_rec.CASH_POSITION_EXPOSURE := ARec.cash_position_exposure;
953:
954: IF xtr_risk_debug_pkg.g_Debug THEN
947: g_main_rec.INTERNAL_COMMENTS := ARec.internal_comments;
948: g_main_rec.EXTERNAL_COMMENTS := ARec.external_comments;
949: g_main_rec.DEAL_LINK_CODE := ARec.deal_link_code;
950: g_main_rec.DUAL_AUTHORISATION_BY := g_user;
951: g_main_rec.DUAL_AUTHORISATION_ON := trunc(g_curr_date);
952: g_main_rec.CASH_POSITION_EXPOSURE := ARec.cash_position_exposure;
953:
954: IF xtr_risk_debug_pkg.g_Debug THEN
955: xtr_risk_debug_pkg.dpop('XTR_EXP_TRANSFERS.COPY_TO_EXP');
1207: p_error := TRUE;
1208: p_cparty_error := TRUE;
1209: end if;
1210:
1211: if (ARec_Interface.dual_authorization_by is not null and
1212: not valid_dealer_code(ARec_Interface.dual_authorization_by)) then
1213: Log_Errors(ARec_Interface.external_deal_id,
1214: ARec_Interface.deal_type,
1215: 'DualAuthorizationBy','XTR_INV_DUAL_AUTH_BY'); -- Bug 2254853
1208: p_cparty_error := TRUE;
1209: end if;
1210:
1211: if (ARec_Interface.dual_authorization_by is not null and
1212: not valid_dealer_code(ARec_Interface.dual_authorization_by)) then
1213: Log_Errors(ARec_Interface.external_deal_id,
1214: ARec_Interface.deal_type,
1215: 'DualAuthorizationBy','XTR_INV_DUAL_AUTH_BY'); -- Bug 2254853
1216: p_error := TRUE;
1211: if (ARec_Interface.dual_authorization_by is not null and
1212: not valid_dealer_code(ARec_Interface.dual_authorization_by)) then
1213: Log_Errors(ARec_Interface.external_deal_id,
1214: ARec_Interface.deal_type,
1215: 'DualAuthorizationBy','XTR_INV_DUAL_AUTH_BY'); -- Bug 2254853
1216: p_error := TRUE;
1217: end if;
1218:
1219: if p_cparty_error <> TRUE and ARec_Interface.cparty_code is NOT NULL AND
1273: ------------------------------------------------------------------------*/
1274: function GET_TRANSACTION_NUMBER return number IS
1275: cursor trans_no is
1276: select XTR_EXPOSURE_TRANS_S.NEXTVAL
1277: from DUAL;
1278:
1279: v_trans_no NUMBER;
1280:
1281: BEGIN
1334: from xtr_dealer_codes_v
1335: where user_id = p_fnd_user;
1336:
1337: l_user xtr_dealer_codes.dealer_code%TYPE;
1338: l_dual_user xtr_dealer_codes.dealer_code%TYPE;
1339: l_dual_date DATE;
1340:
1341: BEGIN
1342:
1335: where user_id = p_fnd_user;
1336:
1337: l_user xtr_dealer_codes.dealer_code%TYPE;
1338: l_dual_user xtr_dealer_codes.dealer_code%TYPE;
1339: l_dual_date DATE;
1340:
1341: BEGIN
1342:
1343: IF xtr_risk_debug_pkg.g_Debug THEN
1347: open FIND_USER(G_User_Id);
1348: fetch FIND_USER into l_user;
1349: close FIND_USER;
1350:
1351: l_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1352: l_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1353: if ((l_dual_user is not null and l_dual_date is null) or
1354: (l_dual_user is null and l_dual_date is not null)) then
1355: if l_dual_date is null then
1348: fetch FIND_USER into l_user;
1349: close FIND_USER;
1350:
1351: l_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1352: l_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1353: if ((l_dual_user is not null and l_dual_date is null) or
1354: (l_dual_user is null and l_dual_date is not null)) then
1355: if l_dual_date is null then
1356: l_dual_date := trunc(sysdate);
1349: close FIND_USER;
1350:
1351: l_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1352: l_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1353: if ((l_dual_user is not null and l_dual_date is null) or
1354: (l_dual_user is null and l_dual_date is not null)) then
1355: if l_dual_date is null then
1356: l_dual_date := trunc(sysdate);
1357: elsif l_dual_user is null then
1350:
1351: l_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1352: l_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1353: if ((l_dual_user is not null and l_dual_date is null) or
1354: (l_dual_user is null and l_dual_date is not null)) then
1355: if l_dual_date is null then
1356: l_dual_date := trunc(sysdate);
1357: elsif l_dual_user is null then
1358: l_dual_user := l_user;
1351: l_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1352: l_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1353: if ((l_dual_user is not null and l_dual_date is null) or
1354: (l_dual_user is null and l_dual_date is not null)) then
1355: if l_dual_date is null then
1356: l_dual_date := trunc(sysdate);
1357: elsif l_dual_user is null then
1358: l_dual_user := l_user;
1359: end if;
1352: l_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1353: if ((l_dual_user is not null and l_dual_date is null) or
1354: (l_dual_user is null and l_dual_date is not null)) then
1355: if l_dual_date is null then
1356: l_dual_date := trunc(sysdate);
1357: elsif l_dual_user is null then
1358: l_dual_user := l_user;
1359: end if;
1360: end if;
1353: if ((l_dual_user is not null and l_dual_date is null) or
1354: (l_dual_user is null and l_dual_date is not null)) then
1355: if l_dual_date is null then
1356: l_dual_date := trunc(sysdate);
1357: elsif l_dual_user is null then
1358: l_dual_user := l_user;
1359: end if;
1360: end if;
1361:
1354: (l_dual_user is null and l_dual_date is not null)) then
1355: if l_dual_date is null then
1356: l_dual_date := trunc(sysdate);
1357: elsif l_dual_user is null then
1358: l_dual_user := l_user;
1359: end if;
1360: end if;
1361:
1362: INSERT INTO xtr_exposure_transactions (
1430: PROGRAM_UPDATE_DATE,
1431: INTERNAL_COMMENTS,
1432: EXTERNAL_COMMENTS,
1433: DEAL_LINK_CODE,
1434: DUAL_AUTHORISATION_BY,
1435: DUAL_AUTHORISATION_ON,
1436: CASH_POSITION_EXPOSURE
1437: )
1438: VALUES (
1431: INTERNAL_COMMENTS,
1432: EXTERNAL_COMMENTS,
1433: DEAL_LINK_CODE,
1434: DUAL_AUTHORISATION_BY,
1435: DUAL_AUTHORISATION_ON,
1436: CASH_POSITION_EXPOSURE
1437: )
1438: VALUES (
1439: Arec_Exp.ACCOUNT_NO,
1506: Arec_Exp.PROGRAM_UPDATE_DATE,
1507: Arec_Exp.INTERNAL_COMMENTS,
1508: Arec_Exp.EXTERNAL_COMMENTS,
1509: Arec_Exp.DEAL_LINK_CODE,
1510: l_dual_user, --Bug 2254853
1511: l_dual_date, --Bug 2254853
1512: Arec_Exp.CASH_POSITION_EXPOSURE
1513: );
1514:
1507: Arec_Exp.INTERNAL_COMMENTS,
1508: Arec_Exp.EXTERNAL_COMMENTS,
1509: Arec_Exp.DEAL_LINK_CODE,
1510: l_dual_user, --Bug 2254853
1511: l_dual_date, --Bug 2254853
1512: Arec_Exp.CASH_POSITION_EXPOSURE
1513: );
1514:
1515: if l_dual_user is not null then
1511: l_dual_date, --Bug 2254853
1512: Arec_Exp.CASH_POSITION_EXPOSURE
1513: );
1514:
1515: if l_dual_user is not null then
1516: UPDATE xtr_confirmation_details
1517: SET confirmation_validated_by = l_dual_user,
1518: confirmation_validated_on = l_dual_date
1519: WHERE deal_type = 'EXP'
1513: );
1514:
1515: if l_dual_user is not null then
1516: UPDATE xtr_confirmation_details
1517: SET confirmation_validated_by = l_dual_user,
1518: confirmation_validated_on = l_dual_date
1519: WHERE deal_type = 'EXP'
1520: AND transaction_no = Arec_Exp.TRANSACTION_NUMBER;
1521: end if;
1514:
1515: if l_dual_user is not null then
1516: UPDATE xtr_confirmation_details
1517: SET confirmation_validated_by = l_dual_user,
1518: confirmation_validated_on = l_dual_date
1519: WHERE deal_type = 'EXP'
1520: AND transaction_no = Arec_Exp.TRANSACTION_NUMBER;
1521: end if;
1522:
1552: --
1553: v_dealer xtr_dealer_codes.dealer_code%TYPE;
1554: -- end bug 1849281
1555:
1556: v_dual_user xtr_dealer_codes.dealer_code%TYPE;
1557: v_dual_date DATE;
1558:
1559: v_comments VARCHAR2(255);
1560: v_portfolio_code VARCHAR2(7);
1553: v_dealer xtr_dealer_codes.dealer_code%TYPE;
1554: -- end bug 1849281
1555:
1556: v_dual_user xtr_dealer_codes.dealer_code%TYPE;
1557: v_dual_date DATE;
1558:
1559: v_comments VARCHAR2(255);
1560: v_portfolio_code VARCHAR2(7);
1561: v_balance_sheet_exposure VARCHAR2(1);
1601: END IF;
1602: END IF;
1603:
1604: --Bug 2254853
1605: v_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1606: v_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1607: if ((v_dual_user is not null and v_dual_date is null) or
1608: (v_dual_user is null and v_dual_date is not null)) then
1609: if v_dual_date is null then
1602: END IF;
1603:
1604: --Bug 2254853
1605: v_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1606: v_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1607: if ((v_dual_user is not null and v_dual_date is null) or
1608: (v_dual_user is null and v_dual_date is not null)) then
1609: if v_dual_date is null then
1610: v_dual_date := trunc(sysdate);
1603:
1604: --Bug 2254853
1605: v_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1606: v_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1607: if ((v_dual_user is not null and v_dual_date is null) or
1608: (v_dual_user is null and v_dual_date is not null)) then
1609: if v_dual_date is null then
1610: v_dual_date := trunc(sysdate);
1611: elsif v_dual_user is null then
1604: --Bug 2254853
1605: v_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1606: v_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1607: if ((v_dual_user is not null and v_dual_date is null) or
1608: (v_dual_user is null and v_dual_date is not null)) then
1609: if v_dual_date is null then
1610: v_dual_date := trunc(sysdate);
1611: elsif v_dual_user is null then
1612: v_dual_user := v_dealer;
1605: v_dual_user := ARec_Exp.DUAL_AUTHORISATION_BY;
1606: v_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1607: if ((v_dual_user is not null and v_dual_date is null) or
1608: (v_dual_user is null and v_dual_date is not null)) then
1609: if v_dual_date is null then
1610: v_dual_date := trunc(sysdate);
1611: elsif v_dual_user is null then
1612: v_dual_user := v_dealer;
1613: end if;
1606: v_dual_date := ARec_Exp.DUAL_AUTHORISATION_ON;
1607: if ((v_dual_user is not null and v_dual_date is null) or
1608: (v_dual_user is null and v_dual_date is not null)) then
1609: if v_dual_date is null then
1610: v_dual_date := trunc(sysdate);
1611: elsif v_dual_user is null then
1612: v_dual_user := v_dealer;
1613: end if;
1614: end if;
1607: if ((v_dual_user is not null and v_dual_date is null) or
1608: (v_dual_user is null and v_dual_date is not null)) then
1609: if v_dual_date is null then
1610: v_dual_date := trunc(sysdate);
1611: elsif v_dual_user is null then
1612: v_dual_user := v_dealer;
1613: end if;
1614: end if;
1615: --Bug 2254853
1608: (v_dual_user is null and v_dual_date is not null)) then
1609: if v_dual_date is null then
1610: v_dual_date := trunc(sysdate);
1611: elsif v_dual_user is null then
1612: v_dual_user := v_dealer;
1613: end if;
1614: end if;
1615: --Bug 2254853
1616:
1622: currency,amount,hce_amount,amount_date,
1623: cashflow_amount,company_code,account_no,action_code,
1624: cparty_account_no,cparty_code,status_code,settle,
1625: exp_settle_reqd,deal_subtype,portfolio_code,balance_sheet_exposure,
1626: dual_authorisation_by, dual_authorisation_on,
1627: dealer_code, comments)
1628: -- bug 1849281
1629: values ('EXP','AMOUNT','VALUE',ARec_Exp.EXPOSURE_TYPE,
1630: 0,ARec_Exp.TRANSACTION_NUMBER,
1638: v_cparty_account_no,
1639: AREC_EXP.THIRDPARTY_CODE,AREC_EXP.STATUS_CODE,'N',
1640: nvl(AREC_EXP.SETTLE_ACTION_REQD,'N'),AREC_EXP.DEAL_SUBTYPE,
1641: v_portfolio_code,v_balance_sheet_exposure,
1642: v_dual_user, v_dual_date, --Bug 2254853
1643: v_dealer, v_comments);
1644: -- bug 1849281
1645: --
1646: --No need for 2nd row insertion for TAX.
1654: currency,amount,hce_amount,amount_date,
1655: cashflow_amount,company_code,account_no,action_code,
1656: cparty_account_no,cparty_code,status_code,settle,
1657: exp_settle_reqd,deal_subtype,portfolio_code,balance_sheet_exposure,
1658: dual_authorisation_by, dual_authorisation_on, dealer_code, comments)
1659: -- bug 1849281
1660: values ('EXP','N/A','DEALT',ARec_Exp.EXPOSURE_TYPE,
1661: 0,AREC_EXP.TRANSACTION_NUMBER,
1662: trunc(SYSDATE),AREC_EXP.CURRENCY,0,
1664: 0,AREC_EXP.COMPANY_CODE,NULL,NULL,NULL,
1665: AREC_EXP.THIRDPARTY_CODE,AREC_EXP.STATUS_CODE,'N',
1666: nvl(AREC_EXP.SETTLE_ACTION_REQD,'N'),AREC_EXP.DEAL_SUBTYPE,
1667: v_portfolio_code,v_balance_sheet_exposure,
1668: v_dual_user, v_dual_date, --Bug 2254853
1669: v_dealer, v_comments);
1670: -- bug 1849281
1671: END IF;
1672: