Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
PROCEDURE P_HAVAS_INSERT_AP_INV_LINES ( p_instance_id VARCHAR2 ) AS BEGIN INSERT INTO silk_tbl_ap_inv_lines_havas_temp ( instance_id, invoice_id, line_number, line_type_lookup_code, amount, invoice_quantity, unit_price, uom, description_, po_number, po_line_number, po_schedule_number, po_distribution_number, item_description, release_number, purchasing_category, receipt_number, receipt_line_number, consumption_advice_number, consumption_advice_line_number, packing_slip, final_match, distribution_combination, distribution_set, accounting_date, overlay_account_segment, overlay_primary_balancing_segment, overlay_cost_center_segment, tax_classification_code, ship_to_location, ship_from_location, location_of_final_discharge, transaction_business_category, product_fiscal_classification, intended_use, user_defined_fiscal_classification, product_type, assessable_value, product_category, tax_control_amount, tax_regime_code, tax, tax_status_code, tax_jurisdiction_code, tax_rate_code, tax_rate, withholding_tax_group, income_tax_type, income_tax_region, prorate_across_all_item_lines, line_group_number, cost_factor_name, statistical_quantity, track_as_asset, asset_book_type_code, asset_category_id, serial_number, manufacturer, model_number, warranty_number, price_correction_line, price_correction_invoice_number, price_correction_invoice_line_num, requester_first_name, requester_last_name, requester_employee_number, attribute_category, attribute1, attribute2, attribute3, attribute4, attribute5, attribute6, attribute7, attribute8, attribute9, attribute10, attribute11, attribute12, attribute13, attribute14, attribute15, attribute_number1, attribute_number2, attribute_number3, attribute_number4, attribute_number5, attribute_date1, attribute_date2, attribute_date3, attribute_date4, attribute_date5, global_attribute_category, global_attribute1, global_attribute2, global_attribute3, global_attribute4, global_attribute5, global_attribute6, global_attribute7, global_attribute8, global_attribute9, global_attribute10, global_attribute11, global_attribute12, global_attribute13, global_attribute14, global_attribute15, global_attribute16, global_attribute17, global_attribute18, global_attribute19, global_attribute20, global_attribute_number1, global_attribute_number2, global_attribute_number3, global_attribute_number4, global_attribute_number5, global_attribute_date1, global_attribute_date2, global_attribute_date3, global_attribute_date4, global_attribute_date5, project_id, task_id, expenditure_type_id, expenditure_item_date, expenditure_organization_id, project_number, task_number, expenditure_type, expenditure_organization, funding_source_id, pjc_reserved_attribute2, pjc_reserved_attribute3, pjc_reserved_attribute4, pjc_reserved_attribute5, pjc_reserved_attribute6, pjc_reserved_attribute7, pjc_reserved_attribute8, pjc_reserved_attribute9, pjc_reserved_attribute10, pjc_user_defined_attribute1, pjc_user_defined_attribute2, pjc_user_defined_attribute3, pjc_user_defined_attribute4, pjc_user_defined_attribute5, pjc_user_defined_attribute6, pjc_user_defined_attribute7, pjc_user_defined_attribute8, pjc_user_defined_attribute9, pjc_user_defined_ttribute_10, fiscal_charge_type, multiperiod_accounting_start_date, multiperiod_accounting_end_date, multiperiod_accounting_accrual_account, project_name, task_name, line_id, EMPLOYEE_ID, TVA_PRECENTAGE, ACT ) SELECT havas.instance_id AS instance_id, ( SELECT invoice_id FROM silk_tbl_ap_inv_header WHERE instance_id = p_instance_id AND invoice_num = no_du_do ) AS invoice_id, NULL AS line_number, 'ITEM' AS line_type_lookup_code, havas.solde AS amount, NULL AS invoice_quantity, NULL AS unit_price, NULL AS uom, RTRIM(havas.ville_origine) || '/' || RTRIM(havas.ville_destination) AS description_, NULL AS po_number, NULL AS po_line_number, NULL AS po_schedule_number, NULL AS po_distribution_number, NULL AS item_description, NULL AS release_number, NULL AS purchasing_category, NULL AS receipt_number, NULL AS receipt_line_number, NULL AS consumption_advice_number, NULL AS consumption_advice_line_number, NULL AS packing_slip, NULL AS final_match, havas.segment_1 || '.' || havas.segment_2 || '.' || havas.segment_3 || '.' || F_SILK_ALD_RESPONSIBILITY_CENTER('HAVAS VOYAGE') || '.' || havas.segment_5 || '.' || havas.segment_6 || '.' || '000000' || '.' || '000000' || '.' || '000000' || '.' || '000000' || '.' || '000000' AS distribution_combination, NULL AS distribution_set, to_char(sysdate, 'YYYY/MM/DD') AS accounting_date, NULL AS overlay_account_segment, NULL AS overlay_primary_balancing_segment, NULL AS overlay_cost_center_segment, havas.TAXCLASSIFICATIONCODE AS tax_classification_code, NULL AS ship_to_location, NULL AS ship_from_location, NULL AS location_of_final_discharge, NULL AS transaction_business_category, NULL AS product_fiscal_classification, NULL AS intended_use, NULL AS user_defined_fiscal_classification, NULL AS product_type, NULL AS assessable_value, NULL AS product_category, NULL AS tax_control_amount, NULL AS tax_regime_code, NULL AS tax, NULL AS tax_status_code, NULL AS tax_jurisdiction_code, NULL AS tax_rate_code, NULL AS tax_rate, NULL AS withholding_tax_group, NULL AS income_tax_type, NULL AS income_tax_region, NULL AS prorate_across_all_item_lines, NULL AS line_group_number, NULL AS cost_factor_name, NULL AS statistical_quantity, NULL AS track_as_asset, NULL AS asset_book_type_code, NULL AS asset_category_id, NULL AS serial_number, NULL AS manufacturer, NULL AS model_number, NULL AS warranty_number, NULL AS price_correction_line, NULL AS price_correction_invoice_number, NULL AS price_correction_invoice_line_num, NULL AS requester_first_name, NULL AS requester_last_name, NULL AS requester_employee_number, NULL AS attribute_category, havas.ORDRE_MISSION AS attribute1, havas.VILLE_ORIGINE AS attribute2, havas.PAYS_ORIGINE AS attribute3, havas.VILLE_DESTINATION AS attribute4, havas.PAYS_DESTINATION AS attribute5, NULL AS attribute6, NULL AS attribute7, NULL AS attribute8, NULL AS attribute9, NULL AS attribute10, NULL AS attribute11, NULL AS attribute12, NULL AS attribute13, NULL AS attribute14, NULL AS attribute15, NULL AS attribute_number1, NULL AS attribute_number2, NULL AS attribute_number3, NULL AS attribute_number4, NULL AS attribute_number5, NULL AS attribute_date1, NULL AS attribute_date2, NULL AS attribute_date3, NULL AS attribute_date4, NULL AS attribute_date5, NULL AS global_attribute_category, NULL AS global_attribute1, NULL AS global_attribute2, NULL AS global_attribute3, NULL AS global_attribute4, NULL AS global_attribute5, NULL AS global_attribute6, NULL AS global_attribute7, NULL AS global_attribute8, NULL AS global_attribute9, NULL AS global_attribute10, NULL AS global_attribute11, NULL AS global_attribute12, NULL AS global_attribute13, NULL AS global_attribute14, NULL AS global_attribute15, NULL AS global_attribute16, NULL AS global_attribute17, NULL AS global_attribute18, NULL AS global_attribute19, NULL AS global_attribute20, NULL AS global_attribute_number1, NULL AS global_attribute_number2, NULL AS global_attribute_number3, NULL AS global_attribute_number4, NULL AS global_attribute_number5, NULL AS global_attribute_date1, NULL AS global_attribute_date2, NULL AS global_attribute_date3, NULL AS global_attribute_date4, NULL AS global_attribute_date5, NULL AS project_id, NULL AS task_id, NULL AS expenditure_type_id, NULL AS expenditure_item_date, NULL AS expenditure_organization_id, NULL AS project_number, NULL AS task_number, NULL AS expenditure_type, NULL AS expenditure_organization, NULL AS funding_source_id, NULL AS pjc_reserved_attribute2, NULL AS pjc_reserved_attribute3, NULL AS pjc_reserved_attribute4, NULL AS pjc_reserved_attribute5, NULL AS pjc_reserved_attribute6, NULL AS pjc_reserved_attribute7, NULL AS pjc_reserved_attribute8, NULL AS pjc_reserved_attribute9, NULL AS pjc_reserved_attribute10, NULL AS pjc_user_defined_attribute1, NULL AS pjc_user_defined_attribute2, NULL AS pjc_user_defined_attribute3, NULL AS pjc_user_defined_attribute4, NULL AS pjc_user_defined_attribute5, NULL AS pjc_user_defined_attribute6, NULL AS pjc_user_defined_attribute7, NULL AS pjc_user_defined_attribute8, NULL AS pjc_user_defined_attribute9, NULL AS pjc_user_defined_ttribute_10, NULL AS fiscal_charge_type, NULL AS multiperiod_accounting_start_date, NULL AS multiperiod_accounting_end_date, NULL AS multiperiod_accounting_accrual_account, NULL AS project_name, NULL AS task_name, '', havas.ORDRE_MISSION AS EMPLOYEE_ID, havas.TVA_PERCENTAGE AS TVA_REC, havas.ACT AS ACT FROM silk_tbl_havas_source havas WHERE havas.instance_id = p_instance_id; COMMIT;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear