diff --git a/FAC/FAC_PACF.SRC b/FAC/FAC_PACF.SRC index ac95aab7..276f56b6 100644 --- a/FAC/FAC_PACF.SRC +++ b/FAC/FAC_PACF.SRC @@ -19393,12 +19393,9 @@ BEGIN LOOP BEGIN v_count_tot := v_count_tot + 1; - v_aanduiding := - rec_ins.ins_discipline_omschrijving - || ' - ' - || rec_ins.ins_srtgroep_omschrijving - || '-' - || rec_ins.ins_srtdeel_code + v_aanduiding := rec_ins.ins_discipline_omschrijving + || ' - ' || rec_ins.ins_srtgroep_omschrijving + || '-' || rec_ins.ins_srtdeel_code || ' - ' || rec_ins.ctr_discipline_omschrijving; v_errorhint := 'Fout bij bepalen discipline'; data_is_valid := 1; @@ -19406,43 +19403,42 @@ BEGIN IF rec_ins.ins_discipline_omschrijving IS NULL THEN data_is_valid := 0; - fac.imp_writelog ( - p_import_key, - 'E', - v_aanduiding, - 'Discipline mag niet leeg zijn: inspectie wordt niet toegevoegd.'); + fac.imp_writelog ( p_import_key, 'E' + , v_aanduiding + , 'Discipline mag niet leeg zijn: inspectie wordt niet toegevoegd.'); ELSE SELECT ins_discipline_key, 'D' INTO v_ins_srtinstallatie_key, v_ins_srtcontrole_niveau FROM ins_tab_discipline - WHERE UPPER (ins_discipline_omschrijving) = - UPPER (rec_ins.ins_discipline_omschrijving) - AND ins_discipline_module = 'INS' - AND ins_discipline_verwijder IS NULL; + WHERE UPPER (ins_discipline_omschrijving) = UPPER (rec_ins.ins_discipline_omschrijving) + AND ins_discipline_module = 'INS' + AND ins_discipline_verwijder IS NULL; IF rec_ins.ins_srtgroep_omschrijving IS NOT NULL THEN + v_errorhint := 'Fout bij bepalen groepsoort'; SELECT ins_srtgroep_key, 'G' INTO v_ins_srtinstallatie_key, v_ins_srtcontrole_niveau FROM ins_srtgroep - WHERE UPPER (ins_srtgroep_omschrijving) = - UPPER (rec_ins.ins_srtgroep_omschrijving) - AND ins_srtgroep_module = 'INS' - AND ins_srtgroep_verwijder IS NULL - AND ins_discipline_key = v_ins_srtinstallatie_key; + WHERE UPPER (ins_srtgroep_omschrijving) = UPPER (rec_ins.ins_srtgroep_omschrijving) + AND ins_srtgroep_module = 'INS' + AND ins_srtgroep_verwijder IS NULL + AND ins_discipline_key = v_ins_srtinstallatie_key; + v_errorhint := 'Fout bij bepalen deelsoort'; IF rec_ins.ins_srtdeel_code IS NOT NULL THEN SELECT ins_srtdeel_key, 'S' INTO v_ins_srtinstallatie_key, v_ins_srtcontrole_niveau FROM ins_srtdeel - WHERE UPPER (ins_srtdeel_code) = UPPER (rec_ins.ins_srtdeel_code) - AND ins_srtdeel_module = 'INS' - AND ins_srtdeel_verwijder IS NULL - AND ins_srtgroep_key = v_ins_srtinstallatie_key; + WHERE UPPER (ins_srtdeel_code) = UPPER (rec_ins.ins_srtdeel_code) + AND ins_srtdeel_module = 'INS' + AND ins_srtdeel_verwijder IS NULL + AND ins_srtgroep_key = v_ins_srtinstallatie_key; END IF; END IF; + v_errorhint := 'Fout bij bepalen bits'; -- Alleen de gezette bits van de dagen van de week. SELECT COALESCE(BITAND(rec_ins.ins_srtcontrole_bits, 127), 0) INTO v_week_bits @@ -19452,6 +19448,7 @@ BEGIN INTO v_maand_bits FROM DUAL; + v_errorhint := 'Fout bij bepalen takcategorie'; BEGIN SELECT ins_discipline_key INTO v_ctr_discipline_key @@ -19465,13 +19462,17 @@ BEGIN END; - IF rec_ins.ins_srtcontrole_omschrijving IS NOT NULL AND - rec_ins.ins_srtcontrole_periode IS NOT NULL AND - ((rec_ins.ins_srtcontrole_eenheid = 0) - OR (rec_ins.ins_srtcontrole_eenheid > 0 AND MOD(rec_ins.ins_srtcontrole_periode, 1) = 0)) AND - rec_ins.ins_srtcontrole_eenheid IS NOT NULL AND - rec_ins.ins_srtcontrole_mode IS NOT NULL AND - (rec_ins.ins_srtcontrole_mode = 1 OR (rec_ins.ins_srtcontrole_mode = 0 AND v_week_bits > 0 AND v_maand_bits > 0)) + IF ( rec_ins.ins_srtcontrole_omschrijving IS NOT NULL + AND rec_ins.ins_srtcontrole_periode IS NOT NULL + AND ( (rec_ins.ins_srtcontrole_eenheid = 0) + OR (rec_ins.ins_srtcontrole_eenheid > 0 AND MOD(rec_ins.ins_srtcontrole_periode, 1) = 0) + ) + AND rec_ins.ins_srtcontrole_eenheid IS NOT NULL + AND rec_ins.ins_srtcontrole_mode IS NOT NULL + AND ( (rec_ins.ins_srtcontrole_mode = 1) + OR (rec_ins.ins_srtcontrole_mode = 0 AND v_week_bits > 0 AND v_maand_bits > 0) + ) + ) THEN INSERT INTO ins_srtcontrole (ins_srtinstallatie_key, ins_srtcontrole_niveau, @@ -19499,11 +19500,9 @@ BEGIN THEN v_errorhint := 'Periode moet een geheel getal zijn voor dagelijkse, wekelijkse, maandelijkse en jaarlijkse taken: inspectie wordt niet toegevoegd.'; ELSE v_errorhint := 'Één of meerdere van de verplichte velden "Omschrijving", "Period", "Eenheid" of "Mode" zijn niet ingevuld: inspectie wordt niet toegevoegd.'; END IF; - fac.imp_writelog ( - p_import_key, - 'E', - v_aanduiding, - v_errorhint); + fac.imp_writelog ( p_import_key, 'E' + , v_aanduiding + , v_errorhint); END IF; END IF; EXCEPTION @@ -19513,10 +19512,9 @@ BEGIN oracle_err_num := SQLCODE; oracle_err_mes := SUBSTR (SQLERRM, 1, 200); v_errormsg := 'OTHERS (error ' || oracle_err_num || '/' || oracle_err_mes || ')'; - fac.imp_writelog (p_import_key, - 'E', - v_aanduiding || v_errormsg, - v_errorhint); + fac.imp_writelog ( p_import_key, 'E' + , v_aanduiding || v_errormsg + , v_errorhint); COMMIT; END; END LOOP; @@ -19525,12 +19523,10 @@ EXCEPTION THEN oracle_err_num := SQLCODE; oracle_err_mes := SUBSTR (SQLERRM, 1, 150); - v_errormsg := - v_errormsg || 'ORACLE (error ' || oracle_err_num || '/' || oracle_err_mes || ')'; - fac.imp_writelog (p_import_key, - 'E', - 'Importproces inspecties afgebroken!', - v_errormsg); + v_errormsg := v_errormsg || 'ORACLE (error ' || oracle_err_num || '/' || oracle_err_mes || ')'; + fac.imp_writelog ( p_import_key, 'E' + , 'Importproces inspecties afgebroken!' + , v_errormsg); END fac_update_inspectie; /