CREATE OR REPLACE PROCEDURE inv_proc_v
(aSQLcode OUT NUMBER,
aSQLerrm OUT VARCHAR2)
IS
V_BATCH_SOURCE_NAME VARCHAR2(100);
V_CURRENCY_CODE VARCHAR2(10);
V_CUST_TRX_TYPE_ID NUMBER;
V_TERM_ID NUMBER;
BEGIN
SELECT NAME INTO V_BATCH_SOURCE_NAME FROM RA_BATCH_SOURCES_ALL
WHERE BATCH_SOURCE_ID=1228 AND
ORG_ID=204;
END;
BEGIN
SELECT CURRENCY_CODE INTO V_CURRENCY_CODE FROM FND_CURRENCIES WHERE ISSUING_TERRITORY_CODE='US' AND ENABLED_FLAG='Y';
END;
BEGIN
SELECT CUST_TRX_TYPE_ID INTO V_CUST_TRX_TYPE_ID FROM RA_CUST_TRX_TYPES_ALL WHERE NAME='Invoice' AND ORG_ID=204;
END;
BEGIN
SELECT term_id INTO V_TERM_ID FROM RA_TERMS_TL WHERE name = '30 Net';
END;
BEGIN
SELECT set_of_books_id INTO v_sob_id FROM gl.gl_sets_of_books WHERE short_name = 'Vision Operations';
END;
BEGIN INSERT INTO RA_INTERFACE_LINES_ALL ( interface_line_id, interface_line_context, interface_line_attribute1, interface_line_attribute2, batch_source_name, set_of_books_id,line_type, tax_code, description, currency_code, amount, cust_trx_type_id, term_id, conversion_type, conversion_rate, trx_date, gl_date, quantity, quantity_ordered, unit_selling_price, unit_standard_price, inventory_item_id, territory_id, --ra_territories uom_code, created_by, last_update_Date, last_updated_by, org_id, tax_exempt_flag, ORIG_SYSTEM_BILL_CUSTOMER_ID,ORIG_SYSTEM_BILL_ADDRESS_ID,ORIG_SYSTEM_SOLD_CUSTOMER_ID) --hz_customer_accounts
VALUES
(ra_customer_trx_lines_s.nextval, 'LEGACY', '1101233', '11045', 'LEGACY', 1, 'LINE', 'Exempt', 'Paper Carrier', 'USD', '1000.00', 1, 1060, 'User', 1, sysdate, sysdate, 12, 12, 50.00, 50.00, 6074, 1003,'Ea',1318, sysdate, sysdate, 1318, 204, 'S', 5789, 5808, 5789 ;
END;
END inv_proc_v;/
No comments:
Post a Comment