DIAN#51429 EXACT-import/Artikellijsten gesorteerd op artikelnummer
svn path=/Customer/trunk/; revision=43843
This commit is contained in:
@@ -719,14 +719,12 @@ BEGIN
|
||||
RETURN;
|
||||
END IF;
|
||||
|
||||
v_errormsg := 'Fout toevoegen cli<6C>nten';
|
||||
|
||||
-- Generieke update (op loginnaam).
|
||||
v_errormsg := 'Fout toevoegen cli<6C>nten';
|
||||
prs.update_perslid (p_import_key, 'LOGIN', NULL);
|
||||
|
||||
v_errormsg := 'Fout afnemen _Default-groepen';
|
||||
|
||||
-- Nieuwe/bestaande cli<6C>nten de '_Default'-groep afnemen!
|
||||
v_errormsg := 'Fout afnemen _Default-groepen';
|
||||
DELETE FROM fac_gebruikersgroep gg
|
||||
WHERE gg.fac_groep_key = c_default_gkey -- _Default
|
||||
AND EXISTS
|
||||
@@ -738,27 +736,25 @@ BEGIN
|
||||
AND p.prs_perslid_key = gg.prs_perslid_key);
|
||||
COMMIT;
|
||||
|
||||
v_errormsg := 'Fout verwijderen cli<6C>nten';
|
||||
|
||||
-- Verwijderen cli<6C>nten niet in import!
|
||||
v_errormsg := 'Fout verwijderen cli<6C>nten';
|
||||
FOR rec IN c_prsdel
|
||||
LOOP
|
||||
prs.delete_perslid (p_import_key, rec.prs_perslid_key);
|
||||
END LOOP;
|
||||
|
||||
v_errormsg := 'Fout toevoegen catalogi';
|
||||
|
||||
-- Aanmaken BES-catalogi en fac_imp_catalogus-tabel verrijken/aanvullen met
|
||||
-- ins_discipline_key (per cli<6C>nt) en prs_bedrijf_key (Exact).
|
||||
-- LET OP-Catalogus-naamconventie: <perslid_naam>/<perslid_oslogin>
|
||||
v_errormsg := 'Fout toevoegen catalogi';
|
||||
FOR rec IN c_besins
|
||||
LOOP
|
||||
SELECT COUNT ( * )
|
||||
INTO v_count
|
||||
FROM ins_tab_discipline td
|
||||
WHERE td.ins_discipline_verwijder IS NULL
|
||||
AND td.ins_discipline_module = 'BES'
|
||||
AND INSTR (UPPER (td.ins_discipline_omschrijving), '/' || rec.prs_perslid_oslogin) > 0;
|
||||
FROM ins_tab_discipline
|
||||
WHERE ins_discipline_verwijder IS NULL
|
||||
AND ins_discipline_module = 'BES'
|
||||
AND INSTR (UPPER (ins_discipline_omschrijving), '/' || rec.prs_perslid_oslogin) > 0;
|
||||
|
||||
IF v_count = 0
|
||||
THEN
|
||||
@@ -783,12 +779,12 @@ BEGIN
|
||||
bes_disc_params_hide_cost_fe)
|
||||
VALUES (v_discipline_key, 1, 1, 0, 'BES', 0, 2, 1);
|
||||
ELSE -- Exception als v_count > 1!
|
||||
SELECT td.ins_discipline_key
|
||||
SELECT ins_discipline_key
|
||||
INTO v_discipline_key
|
||||
FROM ins_tab_discipline td
|
||||
WHERE td.ins_discipline_verwijder IS NULL
|
||||
AND td.ins_discipline_module = 'BES'
|
||||
AND INSTR (UPPER (td.ins_discipline_omschrijving), '/' || rec.prs_perslid_oslogin) > 0;
|
||||
FROM ins_tab_discipline
|
||||
WHERE ins_discipline_verwijder IS NULL
|
||||
AND ins_discipline_module = 'BES'
|
||||
AND INSTR (UPPER (ins_discipline_omschrijving), '/' || rec.prs_perslid_oslogin) > 0;
|
||||
END IF;
|
||||
|
||||
UPDATE fac_imp_catalogus
|
||||
@@ -798,15 +794,39 @@ BEGIN
|
||||
COMMIT;
|
||||
END LOOP;
|
||||
|
||||
v_errormsg := 'Fout bijwerken catalogi';
|
||||
|
||||
-- Generieke update
|
||||
v_errormsg := 'Fout bijwerken catalogi';
|
||||
fac_update_catalogus (p_import_key);
|
||||
|
||||
v_errormsg := 'Fout toevoegen Cli<6C>nt-groepen';
|
||||
v_errormsg := 'Fout sorteren catalogi';
|
||||
FOR cat
|
||||
IN ( SELECT DISTINCT ins_discipline_key
|
||||
FROM fac_imp_catalogus -- Incl. ins_discipline_key (per cli<6C>nt)!
|
||||
ORDER BY ins_discipline_key)
|
||||
LOOP
|
||||
v_count := 1;
|
||||
FOR art
|
||||
IN ( SELECT sd.bes_srtdeel_key
|
||||
FROM bes_srtdeel sd
|
||||
WHERE EXISTS -- We weten dat er een groep is per discipline!
|
||||
(SELECT 1
|
||||
FROM bes_srtgroep
|
||||
WHERE ins_discipline_key = cat.ins_discipline_key
|
||||
AND bes_srtgroep_key = sd.bes_srtgroep_key)
|
||||
ORDER BY bes_srtgroep_key, bes_srtdeel_nr)
|
||||
LOOP
|
||||
UPDATE bes_srtdeel
|
||||
SET bes_srtdeel_volgnr = MOD (v_count, 999)
|
||||
WHERE bes_srtdeel_key = art.bes_srtdeel_key;
|
||||
|
||||
v_count := v_count + 1;
|
||||
END LOOP;
|
||||
COMMIT;
|
||||
END LOOP;
|
||||
|
||||
-- Per cli<6C>nt een 'Cli<6C>nt'-groep toevoegen (zover nog niet toegevoegd)!
|
||||
-- LET OP-Autorisatiegroep-naamconventie: <perslid_oslogin>/<perslid_naam>
|
||||
v_errormsg := 'Fout toevoegen Cli<6C>nt-groepen';
|
||||
INSERT INTO fac_groep (fac_groep_omschrijving)
|
||||
SELECT SUBSTR (p.prs_perslid_oslogin || '/' || p.prs_perslid_naam, 1, 30)
|
||||
FROM prs_v_aanwezigperslid p, prs_afdeling a
|
||||
@@ -820,10 +840,9 @@ BEGIN
|
||||
WHERE INSTR (fac_groep_upper, p.prs_perslid_oslogin || '/') > 0);
|
||||
COMMIT;
|
||||
|
||||
v_errormsg := 'Fout inkleuren Cli<6C>nt-groepen';
|
||||
|
||||
-- Elke 'Cli<6C>nt'-groep inkleuren met BESUSE-rechten op "eigen" catalogus en
|
||||
-- de 'Cli<6C>ntBeheer'-groep BESFOF/BESBOF/BESBOR-rechten op alle catalogi!
|
||||
v_errormsg := 'Fout inkleuren Cli<6C>nt-groepen';
|
||||
INSERT INTO fac_groeprechten (fac_groep_key,
|
||||
fac_functie_key,
|
||||
ins_discipline_key,
|
||||
@@ -840,9 +859,9 @@ BEGIN
|
||||
-1
|
||||
FROM prs_v_aanwezigperslid p, prs_afdeling a, fac_groep g, fac_functie f, ins_tab_discipline td
|
||||
WHERE p.prs_srtperslid_key = c_client_fkey -- Cli<6C>nt
|
||||
AND p.prs_perslid_oslogin IS NOT NULL
|
||||
AND p.prs_afdeling_key = a.prs_afdeling_key
|
||||
AND a.prs_afdeling_naam = c_client_anaam
|
||||
AND p.prs_perslid_oslogin IS NOT NULL
|
||||
AND INSTR (g.fac_groep_upper, p.prs_perslid_oslogin || '/') > 0
|
||||
AND f.fac_functie_code = 'WEB_BESUSE'
|
||||
AND INSTR (UPPER (td.ins_discipline_omschrijving), '/' || p.prs_perslid_oslogin) > 0
|
||||
@@ -863,8 +882,8 @@ BEGIN
|
||||
9
|
||||
FROM prs_v_aanwezigperslid p, prs_afdeling a, fac_functie f, ins_tab_discipline td
|
||||
WHERE p.prs_srtperslid_key = c_client_fkey -- Cli<6C>nt
|
||||
AND p.prs_afdeling_key = a.prs_afdeling_key
|
||||
AND p.prs_perslid_oslogin IS NOT NULL
|
||||
AND p.prs_afdeling_key = a.prs_afdeling_key
|
||||
AND a.prs_afdeling_naam = c_client_anaam
|
||||
AND f.fac_functie_code IN ('WEB_BESFOF', 'WEB_BESBOF', 'WEB_BESBOR')
|
||||
AND INSTR (UPPER (td.ins_discipline_omschrijving), '/' || p.prs_perslid_oslogin) > 0
|
||||
@@ -877,17 +896,16 @@ BEGIN
|
||||
AND ins_discipline_key = td.ins_discipline_key);
|
||||
COMMIT;
|
||||
|
||||
v_errormsg := 'Fout toekennen Cli<6C>nt-groepen';
|
||||
|
||||
-- Nieuwe/bestaande cli<6C>nten de *eigen* 'Cli<6C>nt'-groep toekennen (zover nog
|
||||
-- niet toegekend)!
|
||||
v_errormsg := 'Fout toekennen Cli<6C>nt-groepen';
|
||||
INSERT INTO fac_gebruikersgroep (fac_groep_key, prs_perslid_key)
|
||||
SELECT g.fac_groep_key, p.prs_perslid_key
|
||||
FROM prs_v_aanwezigperslid p, prs_afdeling a, fac_groep g
|
||||
WHERE p.prs_srtperslid_key = c_client_fkey -- Cli<6C>nt
|
||||
AND p.prs_perslid_oslogin IS NOT NULL
|
||||
AND p.prs_afdeling_key = a.prs_afdeling_key
|
||||
AND a.prs_afdeling_naam = c_client_anaam
|
||||
AND p.prs_perslid_oslogin IS NOT NULL
|
||||
AND INSTR (fac_groep_upper, p.prs_perslid_oslogin || '/') > 0
|
||||
AND NOT EXISTS
|
||||
(SELECT 1
|
||||
|
||||
Reference in New Issue
Block a user