NYBU#36994 import crm students aanpassen obv nieuwe CRM export.
svn path=/Customer/trunk/; revision=29928
This commit is contained in:
@@ -1489,7 +1489,8 @@ AS
|
||||
CREATE OR REPLACE PROCEDURE nybu_import_crm (p_import_key IN NUMBER)
|
||||
IS
|
||||
c_fielddelimitor VARCHAR2 (1) := ';';
|
||||
c_headerline VARCHAR (1000) := 'Enrollment;Contact Number (Participant);Last Name (Participant);First Name Used (Participant);Initials (Participant);Infix (Participant);Gender (Participant);Private Address: Street 1 (Participant);Private Address: Street 2 (Participant);Private Address: ZIP/Postal Code (Participant);Private Address: City (Participant);Private Address: Country (Participant);Private E-mail (Participant);Mobile Phone (Participant);Private Phone (Participant);Participant Number (Participant);SAN Number (Participant);Birthday (Participant);Applicant For (Program);Applicant For (Group)';
|
||||
c_headerline VARCHAR (1000) := '(Do Not Modify) Enrollment Id;(Do Not Modify) Row Checksum;(Do Not Modify) Modified On;Contact Number (Contact) (Contact);Last Name (Contact) (Contact);First Name (Contact) (Contact);Initials (Contact) (Contact);Infix (Contact) (Contact);Gender (Contact) (Contact);Line 1 (private) (Contact) (Contact);Housenumber (private) (Contact) (Contact);Line 2 (private) (Contact) (Contact);Postal Code (private) (Contact) (Contact);City (private) (Contact) (Contact);Country (private) (Contact) (Contact);Email Private (Contact) (Contact);Private Mobile Phone (Contact) (Contact);Private Phone (Contact) (Contact);Participant Number (Contact) (Contact);SAN Number (Contact) (Contact);Birthday (Contact) (Contact);Applicant For (Program);Applicant For (Group)';
|
||||
-- c_headerline VARCHAR (1000) := 'Enrollment;Contact Number (Participant);Last Name (Participant);First Name Used (Participant);Initials (Participant);Infix (Participant);Gender (Participant);Private Address: Street 1 (Participant);Private Address: Street 2 (Participant);Private Address: ZIP/Postal Code (Participant);Private Address: City (Participant);Private Address: Country (Participant);Private E-mail (Participant);Mobile Phone (Participant);Private Phone (Participant);Participant Number (Participant);SAN Number (Participant);Birthday (Participant);Applicant For (Program);Applicant For (Group)';
|
||||
v_newline VARCHAR2 (1000); -- Input line
|
||||
v_header VARCHAR2 (1000);
|
||||
v_aanduiding VARCHAR2 (200);
|
||||
@@ -1510,6 +1511,7 @@ IS
|
||||
v_prs_perslid_initialen VARCHAR2(256);
|
||||
v_prs_perslid_geslacht VARCHAR2(256);
|
||||
v_adres_prive_straat1 VARCHAR2(256);
|
||||
v_housenumber VARCHAR2(256);
|
||||
v_adres_prive_straat2 VARCHAR2(256);
|
||||
v_adres_prive_postcode VARCHAR2(256);
|
||||
v_adres_prive_plaats VARCHAR2(256);
|
||||
@@ -1521,7 +1523,7 @@ IS
|
||||
v_san_nr VARCHAR2(256);
|
||||
v_geboortedatum VARCHAR2(256);
|
||||
v_prs_afdeling_omschrijving VARCHAR2(256);
|
||||
-- Dummy
|
||||
-- Dummy
|
||||
v_dummy VARCHAR2 (256);
|
||||
|
||||
CURSOR c1
|
||||
@@ -1549,24 +1551,27 @@ BEGIN
|
||||
v_prs_perslid_tussenvoegsel := NULL;
|
||||
|
||||
-- Lees alle veldwaarden
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_dummy); -- Enrollment
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_dummy); -- Enrollment ID
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_dummy); -- Row Checksum
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_dummy); -- Modified on
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_contact_nr); -- Contact number
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_naam); -- Last Name (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_voornaam); -- First Name Used (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_initialen); -- Initials (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_tussenvoegsel); -- Infix (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_geslacht); -- Gender (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_straat1); -- Private Address: Street 1 (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_straat2); -- Private Address: Street 2 (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_postcode); -- Private Address: ZIP/Postal Code (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_plaats); -- Private Address: City (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_land); -- Private Address: Country (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_email); -- Private E-mail (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_mobiel); -- Mobile Phone (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_telnr); -- Private Phone (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_nr); -- Participant Number (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_san_nr); -- SAN Number (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_geboortedatum); -- Birthday (Participant)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_naam); -- Last Name
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_voornaam); -- First Name
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_initialen); -- Initials
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_tussenvoegsel); -- Infix
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_geslacht); -- Gender
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_straat1); -- Private Address: Line 1
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_housenumber); -- Housenumber
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_straat2); -- Private Address: Line 2
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_postcode); -- Private Address: Postal Code
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_plaats); -- Private Address: City
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_adres_prive_land); -- Private Address: Country
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_email); -- E-mail Private
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_mobiel); -- Private Mobile Phone
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_telnr); -- Private Phone
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_perslid_nr); -- Participant Number
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_san_nr); -- SAN Number
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_geboortedatum); -- Birthday
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_dummy); -- Applicant For (Program)
|
||||
fac.imp_getfield (v_newline, c_fielddelimitor, v_prs_afdeling_omschrijving); -- Applicant For (Group)
|
||||
|
||||
@@ -1773,7 +1778,8 @@ BEGIN
|
||||
prs_perslid_nr,
|
||||
san_nr,
|
||||
geboortedatum,
|
||||
prs_afdeling_omschrijving
|
||||
prs_afdeling_omschrijving,
|
||||
housenumber
|
||||
)
|
||||
VALUES (SYSDATE,
|
||||
v_contact_nr,
|
||||
@@ -1793,7 +1799,8 @@ BEGIN
|
||||
v_prs_perslid_nr,
|
||||
v_san_nr,
|
||||
v_geboortedatum,
|
||||
v_prs_afdeling_omschrijving
|
||||
v_prs_afdeling_omschrijving,
|
||||
v_housenumber
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
@@ -1923,7 +1930,7 @@ IS
|
||||
'FEMALE', 0,
|
||||
NULL)
|
||||
prs_perslid_geslacht,
|
||||
adres_prive_straat1,
|
||||
adres_prive_straat1||' '||housenumber as adres_prive_straat1,
|
||||
adres_prive_straat2,
|
||||
adres_prive_postcode,
|
||||
adres_prive_plaats,
|
||||
@@ -1934,7 +1941,7 @@ IS
|
||||
prs_perslid_nr,
|
||||
san_nr,
|
||||
TO_DATE(geboortedatum, 'DD-MM-YYYY') geboortedatum,
|
||||
prs_afdeling_omschrijving
|
||||
prs_afdeling_omschrijving
|
||||
FROM nybu_imp_crm
|
||||
WHERE contact_nr IS NOT NULL;
|
||||
|
||||
@@ -2219,7 +2226,6 @@ END nybu_update_crm;
|
||||
/
|
||||
|
||||
|
||||
|
||||
------- OVERIG ------------------------------------------------------------------
|
||||
|
||||
-- Ruimtes waar mensen vandaan/naartoe kunnen verhuizen
|
||||
@@ -7208,7 +7214,8 @@ AS
|
||||
2) credit
|
||||
FROM fin_verkoopfactuur
|
||||
WHERE fin_verkoopfactuur_n1 = 1 -- extern
|
||||
AND fin_verkoopfactuur_datum IS NULL)
|
||||
AND fin_verkoopfactuur_datum IS NULL
|
||||
AND COALESCE(fin_verkoopfactuur_c4, 'NOP') = 'ruimte/voorz' )
|
||||
WHERE bedrag != 0 OR credit != 0
|
||||
GROUP BY deb_nr, periode, kostenplaats, proj
|
||||
ORDER BY deb_nr, periode, kostenplaats, proj;
|
||||
@@ -7226,7 +7233,8 @@ AS
|
||||
AND fin_verkoopfactuur_maand = in_periode
|
||||
AND prs_kostenplaats_nr = in_proj
|
||||
AND fin_verkoopfactuur_datum IS NULL
|
||||
AND fin_verkoopfactuur_bedrag + fin_verkoopfactuur_btw != 0;
|
||||
AND fin_verkoopfactuur_bedrag + fin_verkoopfactuur_btw != 0
|
||||
AND COALESCE(fin_verkoopfactuur_c4, 'NOP') = 'ruimte/voorz';
|
||||
|
||||
-- Individuele facturen voor interne kostenplaatsen, gesommeerd per P-nummer (project)
|
||||
-- (Crediteringen gaan apart)
|
||||
@@ -7251,6 +7259,7 @@ AS
|
||||
AND fin_verkoopfactuur_n2 = 0 -- geen creditering
|
||||
AND fin_verkoopfactuur_datum IS NULL
|
||||
AND fin_verkoopfactuur_bedrag != 0
|
||||
AND COALESCE(fin_verkoopfactuur_c4, 'NOP') = 'ruimte/voorz'
|
||||
GROUP BY prs_kostenplaatsgrp_oms, prs_kostenplaats_nr, fin_verkoopfactuur_maand;
|
||||
|
||||
-- Creditboekingen, per deelreservering
|
||||
@@ -7269,6 +7278,7 @@ AS
|
||||
WHERE fin_verkoopfactuur_n1 = 0 -- intern
|
||||
AND fin_verkoopfactuur_n2 = 1 -- creditering
|
||||
AND fin_verkoopfactuur_datum IS NULL
|
||||
AND COALESCE(fin_verkoopfactuur_c4, 'NOP') = 'ruimte/voorz'
|
||||
ORDER BY grootboek DESC, kostenplaats, project;
|
||||
|
||||
-- Voor markeren van de externe + interne reserveringen die we net gefactureerd/doorbelast/gecrediteerd
|
||||
@@ -7470,8 +7480,9 @@ BEGIN
|
||||
MAX(fin_verkoopfactuur_maand) periode
|
||||
FROM fin_verkoopfactuur
|
||||
WHERE fin_verkoopfactuur_datum IS NULL
|
||||
AND fin_verkoopfactuur_n1 = 0) vf -- intern
|
||||
WHERE ks.prs_kostensoort_oms = '76015'
|
||||
AND fin_verkoopfactuur_n1 = 0 -- intern
|
||||
AND COALESCE(fin_verkoopfactuur_c4, 'NOP') = 'ruimte/voorz') vf
|
||||
WHERE ks.prs_kostensoort_oms = '76015'
|
||||
AND k.prs_kostenplaats_key = ks.prs_kostenplaats_key
|
||||
AND kg.prs_kostenplaatsgrp_key = k.prs_kostenplaatsgrp_key;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user