PIVP#74972 -- Fase 2 implementatie
svn path=/Customer/trunk/; revision=59229
This commit is contained in:
309
PIVP/PIVP.sql
309
PIVP/PIVP.sql
@@ -39,6 +39,9 @@ AS
|
||||
p_tag IN VARCHAR2,
|
||||
p_value IN VARCHAR2);
|
||||
|
||||
|
||||
PROCEDURE afmelden_reserveringen;
|
||||
|
||||
PROCEDURE inactivate_prs;
|
||||
|
||||
|
||||
@@ -82,6 +85,60 @@ AS
|
||||
|| '</' || p_tag || '>');
|
||||
END;
|
||||
|
||||
PROCEDURE afmelden_reserveringen
|
||||
AS
|
||||
v_errormsg VARCHAR2 (1000);
|
||||
v_errorhint VARCHAR2 (1000);
|
||||
oracle_err_num NUMBER;
|
||||
oracle_err_mes VARCHAR2 (200);
|
||||
|
||||
CURSOR res_ruimte IS
|
||||
SELECT res.res_rsv_ruimte_key res_key
|
||||
FROM res_rsv_ruimte res
|
||||
WHERE res.res_status_bo_key = 2 --- geregistreerd, nog niet verwerkt
|
||||
AND (res.res_status_fo_key = 2
|
||||
OR (res.res_rsv_ruimte_verwijder IS NOT NULL
|
||||
AND res.res_status_fo_key=1) AND TRUNC(res.res_rsv_ruimte_verwijder)-TRUNC(res.res_rsv_ruimte_van)<3)
|
||||
AND res.RES_RSV_RUIMTE_EXTERNSYNCDATE IS NULL
|
||||
AND TRUNC(res.res_rsv_ruimte_van)< TRUNC(SYSDATE);
|
||||
|
||||
|
||||
BEGIN
|
||||
FOR rec IN res_ruimte
|
||||
LOOP
|
||||
v_errormsg := 'Status update reservering niet gelukt';
|
||||
v_errorhint := 'Res_rsv_ruimte_key: ' || TO_CHAR (rec.res_key);
|
||||
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_status_bo_key = 5
|
||||
WHERE res_rsv_ruimte_key = rec.res_key;
|
||||
|
||||
fac.trackaction ('RESAFM',
|
||||
rec.res_key,
|
||||
3,
|
||||
SYSDATE,
|
||||
'Status reservering naar Afgemeld');
|
||||
END LOOP;
|
||||
EXCEPTION
|
||||
WHEN OTHERS
|
||||
THEN
|
||||
oracle_err_num := SQLCODE;
|
||||
oracle_err_mes := SUBSTR (SQLERRM, 1, 100);
|
||||
v_errormsg :=
|
||||
'OTHERS (error '
|
||||
|| oracle_err_num
|
||||
|| '/'
|
||||
|| oracle_err_mes
|
||||
|| ')';
|
||||
|
||||
fac.imp_writelog ('afm_res',
|
||||
'E',
|
||||
v_errormsg,
|
||||
v_errorhint);
|
||||
END;
|
||||
|
||||
|
||||
|
||||
PROCEDURE inactivate_prs
|
||||
AS
|
||||
v_errormsg VARCHAR2 (1000);
|
||||
@@ -298,7 +355,9 @@ AS
|
||||
BEGIN
|
||||
-- inactiveren personen die 12 maanden niet hebben ingelogd
|
||||
pivp.inactivate_prs ();
|
||||
|
||||
|
||||
-- zaalreservereing afmelden ook die verwijderd zijn
|
||||
pivp.afmelden_reserveringen;
|
||||
END;
|
||||
/
|
||||
|
||||
@@ -3041,26 +3100,32 @@ CREATE OR REPLACE VIEW PIVP_V_RESEXPORT
|
||||
reservering_nr,
|
||||
reservering_volgNr,
|
||||
ruimte_nr,
|
||||
res_rsv_ruimte_van,
|
||||
datum,
|
||||
van,
|
||||
tot,
|
||||
bedrag,
|
||||
reserveerder,
|
||||
bedrijf_naam,
|
||||
debiteurnr
|
||||
debiteurnr,
|
||||
verwijderdatum,
|
||||
externsyncdate
|
||||
)
|
||||
AS
|
||||
SELECT rrr.res_rsv_ruimte_key,
|
||||
rrr.res_reservering_key,
|
||||
rrr.RES_RSV_RUIMTE_VOLGNR,
|
||||
rr.res_ruimte_nr,
|
||||
rr.res_ruimte_nr,
|
||||
rrr.res_rsv_ruimte_van,
|
||||
TRUNC(rrr.res_rsv_ruimte_van) datum,
|
||||
TO_CHAR(rrr.res_rsv_ruimte_van,'HH24:MI') van,
|
||||
TO_CHAR(rrr.res_rsv_ruimte_tot,'HH24:MI') tot,
|
||||
res.getdeelresprijs(rrr.res_rsv_ruimte_key) prijs,
|
||||
p.prs_perslid_naam,
|
||||
pa.prs_afdeling_omschrijving,
|
||||
pa.prs_afdeling_naam
|
||||
pa.prs_afdeling_naam,
|
||||
rrr.res_rsv_ruimte_verwijder,
|
||||
rrr.res_rsv_ruimte_externsyncdate
|
||||
FROM res_rsv_ruimte rrr,
|
||||
res_activiteit ra,
|
||||
res_activiteitdiscipline rad,
|
||||
@@ -3082,8 +3147,7 @@ AS
|
||||
AND pa.prs_afdeling_key=p.prs_afdeling_key
|
||||
AND pa.prs_bedrijf_key=pb.prs_bedrijf_key
|
||||
AND pb.prs_bedrijf_naam_upper<>'PIVOTPARK' -- PIVP uitsluiten voor facturatie
|
||||
AND res.getdeelresprijs(rrr.res_rsv_ruimte_key) > 0
|
||||
AND rrr.res_rsv_ruimte_externsyncdate IS NULL;
|
||||
AND res.getdeelresprijs(rrr.res_rsv_ruimte_key) > 0;
|
||||
|
||||
|
||||
|
||||
@@ -3514,7 +3578,10 @@ AS
|
||||
v_dagboek VARCHAR2(10);
|
||||
v_startDate DATE;
|
||||
v_endDate DATE;
|
||||
v_currentmonth NUMBER;
|
||||
v_factuurdatum DATE;
|
||||
v_startmonth VARCHAR2(10);
|
||||
v_currentmonth VARCHAR2(10);
|
||||
v_currentyear VARCHAR2(10);
|
||||
v_currenthuurder VARCHAR2(10);
|
||||
|
||||
BEGIN
|
||||
@@ -3531,11 +3598,18 @@ BEGIN
|
||||
|
||||
-- eerst controlerene of we de eerste van een nieuw kwartaal zijn.
|
||||
|
||||
v_currentmonth := TO_NUMBER(TO_CHAR(SYSDATE,'MM'));
|
||||
v_currentmonth:=10;
|
||||
IF v_currentmonth=1 OR v_currentmonth=4 OR v_currentmonth=7 OR v_currentmonth=10
|
||||
THEN
|
||||
CASE v_currentmonth
|
||||
v_startmonth := TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'MM'))-1);
|
||||
v_currentyear := TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'YYYY')));
|
||||
IF v_startmonth = '0' THEN
|
||||
v_currentyear := TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'YYYY'))-1);
|
||||
v_startmonth:='12';
|
||||
END IF;
|
||||
v_startdate := TO_DATE('01-'||v_startmonth||'-'||v_currentyear,'DD-MM-YYYY');
|
||||
v_enddate := LAST_DAY(v_startdate);
|
||||
v_factuurdatum:=v_enddate;
|
||||
-- IF v_currentmonth=1 OR v_currentmonth=4 OR v_currentmonth=7 OR v_currentmonth=10
|
||||
-- THEN
|
||||
/*CASE v_currentmonth
|
||||
WHEN 1 THEN
|
||||
v_startDate:= TO_DATE('01-10-'||TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'YYYY')-1)),'DD-MM-YYYY');
|
||||
v_endDate:= TO_DATE('31-12-'||TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'YYYY')-1)),'DD-MM-YYYY');
|
||||
@@ -3550,10 +3624,10 @@ BEGIN
|
||||
v_endDate:= TO_DATE('30-09-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MM-YYYY');
|
||||
END CASE;
|
||||
v_bestand:= 'EXM_MLD';
|
||||
|
||||
|
||||
-- PUUR OM EENVOUDIGER TE KUNNEN TESTEN
|
||||
v_startDate:=TO_DATE('01-01-2022','DD-MM-YYYY');
|
||||
v_endDate:=TO_DATE('31-12-2022','DD-MM-YYYY');
|
||||
v_endDate:=TO_DATE('31-12-2022','DD-MM-YYYY'); */
|
||||
|
||||
FOR rec in mld(v_startDate, v_endDate)
|
||||
LOOP
|
||||
@@ -3561,7 +3635,7 @@ BEGIN
|
||||
IF v_count=1 THEN
|
||||
pivp.add_xml_row (v_bestand, '<?xml version="1.0" encoding="windows-1252"?>');
|
||||
pivp.add_xml_row (v_bestand, '<eExact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="eExact-Schema.xsd">');
|
||||
pivp.add_xml_row (v_bestand, '<GLEntries>');
|
||||
pivp.add_xml_row (v_bestand, '<Invoices companycode="003" companyname="Pivot Park">');
|
||||
END IF;
|
||||
|
||||
|
||||
@@ -3569,7 +3643,19 @@ BEGIN
|
||||
LOOP
|
||||
v_sub_count:=v_sub_count+1;
|
||||
IF v_sub_count=1 THEN
|
||||
pivp.add_xml_row (v_bestand, '<GLEntry entry="">');
|
||||
|
||||
pivp.add_xml_row (v_bestand, '<Invoice type="V" code="00">');
|
||||
pivp.add_xml_element (v_bestand, 'Description', 'Geleverde diensten van '||TO_CHAR(v_startDate,'DD-MM-YYYY')||' tot '||TO_CHAR(v_endDate,'DD-MM-YYYY')||'.');
|
||||
pivp.add_xml_element(v_bestand, 'YourRef','Uwe referentie : '||rec_regel.ponummer);
|
||||
pivp.add_xml_row (v_bestand, '<Order type="V"/>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
pivp.add_xml_element (v_bestand, 'CalcIncludeVAT', 'N');
|
||||
pivp.add_xml_row (v_bestand, '<OrderedBy>');
|
||||
pivp.add_xml_row (v_bestand, '<Debtor code="' || xml.char_to_html(rec_regel.debiteurnr) || '"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Date', v_factuurdatum );
|
||||
pivp.add_xml_row (v_bestand, '</OrderedBy>');
|
||||
|
||||
/*
|
||||
pivp.add_xml_element (v_bestand, 'Description', 'Geleverder diensten van '||TO_CHAR(v_startDate,'DD-MM-YYYY')||' tot '||TO_CHAR(v_endDate,'DD-MM-YYYY')||'.');
|
||||
pivp.add_xml_element (v_bestand, 'Date', SYSDATE);
|
||||
pivp.add_xml_element (v_bestand, 'DocumentDate', TO_CHAR(SYSDATE, 'YYYY-MM-DD') );
|
||||
@@ -3582,12 +3668,23 @@ BEGIN
|
||||
pivp.add_xml_row (v_bestand, '<ForeignAmount>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Value', '0');
|
||||
pivp.add_xml_row (v_bestand, '</ForeignAmount>');
|
||||
pivp.add_xml_row (v_bestand, '</ForeignAmount>'); */
|
||||
END IF;
|
||||
pivp.add_xml_row (v_bestand, '<InvoiceLine lineNo="' || v_sub_count || '" type="N" subtype="N">');
|
||||
pivp.add_xml_element (v_bestand, 'Description', rec_regel.melding_key||' - '||rec_regel.onderwerp);
|
||||
pivp.add_xml_row (v_bestand, '<Item code="' || rec_regel.dienstencode || '"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Quantity', '1' );
|
||||
pivp.add_xml_row (v_bestand, '<Price>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
|
||||
pivp.add_xml_element (v_bestand, 'Value', rec_regel.factuurbedrag);
|
||||
|
||||
pivp.add_xml_row (v_bestand, '<FinEntryLine number="' || v_sub_count || '" type="N" subtype="N">');
|
||||
|
||||
pivp.add_xml_row (v_bestand, '</Price>');
|
||||
pivp.add_xml_row (v_bestand, '<Delivery>');
|
||||
pivp.add_xml_element (v_bestand, 'Date', TO_CHAR(rec_regel.afmelddatum, 'YYYY-MM-DD') );
|
||||
pivp.add_xml_row (v_bestand, '</Delivery>');
|
||||
|
||||
/* pivp.add_xml_row (v_bestand, '<FinEntryLine number="' || v_sub_count || '" type="N" subtype="N">');
|
||||
pivp.add_xml_row (v_bestand, '<GLAccount code="' || SUBSTR(rec_regel.dienstencode,3) || '"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Description', rec_regel.melding_key||' - '||rec_regel.onderwerp);
|
||||
pivp.add_xml_row (v_bestand, '<Costcenter code="' || xml.char_to_html('003.OPS') || '"/>');
|
||||
@@ -3603,19 +3700,20 @@ BEGIN
|
||||
pivp.add_xml_row (v_bestand, '<FinReferences>');
|
||||
pivp.add_xml_element (v_bestand, 'YourRef', 'PO Nummer klant');
|
||||
pivp.add_xml_element (v_bestand, 'DocumentDate', TO_CHAR(rec_regel.afmelddatum, 'YYYY-MM-DD') );
|
||||
pivp.add_xml_row (v_bestand, '</FinReferences>');
|
||||
pivp.add_xml_row (v_bestand, '</FinEntryLine>');
|
||||
pivp.add_xml_row (v_bestand, '</FinReferences>'); */
|
||||
pivp.add_xml_row (v_bestand, '</InvoiceLine>');
|
||||
|
||||
END LOOP;
|
||||
IF v_sub_count>0 THEN
|
||||
pivp.add_xml_row (v_bestand, '</GLEntry>');
|
||||
pivp.add_xml_element (v_bestand, 'Resource', v_sub_count);
|
||||
pivp.add_xml_row (v_bestand, '</Invoice>');
|
||||
END IF;
|
||||
|
||||
|
||||
v_sub_count:=0;
|
||||
END LOOP;
|
||||
IF v_count>0 THEN
|
||||
pivp.add_xml_row (v_bestand, '</GLEntries>');
|
||||
pivp.add_xml_row (v_bestand, '</Invoices>');
|
||||
pivp.add_xml_row (v_bestand, '</eExact>');
|
||||
END IF;
|
||||
IF v_count=0 THEN
|
||||
@@ -3623,8 +3721,8 @@ BEGIN
|
||||
DELETE FROM fac_rapport WHERE fac_rapport_node = v_bestand;
|
||||
END IF;
|
||||
|
||||
fac.writelog (p_applname, 'S', 'Exact export uitgevoerd.','Regels: '||v_count||' Periode :('||v_currentmonth||') '||v_startDate||'-'||v_enddate);
|
||||
END IF;
|
||||
fac.writelog (p_applname, 'S', 'Exact export uitgevoerd.','Regels: '||v_count||' Periode : '||v_startDate||'-'||v_enddate);
|
||||
--END IF;
|
||||
|
||||
END;
|
||||
/
|
||||
@@ -3637,7 +3735,7 @@ AS
|
||||
CURSOR res(p_startDate DATE, p_endDate DATE) IS
|
||||
SELECT DISTINCT debiteurnr
|
||||
FROM pivp_v_resexport
|
||||
WHERE datum BETWEEN p_startDate AND p_endDate;
|
||||
WHERE datum BETWEEN p_startDate AND p_endDate AND externsyncdate IS NULL;
|
||||
|
||||
|
||||
|
||||
@@ -3648,6 +3746,7 @@ AS
|
||||
FROM pivp_v_resexport
|
||||
WHERE debiteurnr=c_debiteur_nr
|
||||
AND datum BETWEEN p_startDate AND p_endDate
|
||||
AND externsyncdate IS NULL
|
||||
ORDER by datum;
|
||||
|
||||
v_bestand VARCHAR2(100);
|
||||
@@ -3662,11 +3761,12 @@ AS
|
||||
v_endDate DATE;
|
||||
v_currentmonth NUMBER;
|
||||
v_currenthuurder VARCHAR2(10);
|
||||
v_factuurdatum VARCHAR2(15);
|
||||
|
||||
BEGIN
|
||||
|
||||
v_dagboek:='70';
|
||||
v_dienstencode:='221';
|
||||
v_dienstencode:='FM-221'; -- alle reservering worden op deze dienstencode geboekt
|
||||
v_leverancier:=0;
|
||||
v_sub_count:=0;
|
||||
v_count:=0;
|
||||
@@ -3686,15 +3786,19 @@ BEGIN
|
||||
WHEN 1 THEN
|
||||
v_startDate:= TO_DATE('01-10-'||TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'YYYY')-1)),'DD-MM-YYYY');
|
||||
v_endDate:= TO_DATE('31-12-'||TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'YYYY')-1)),'DD-MM-YYYY');
|
||||
v_factuurdatum:='31-12-'||TO_CHAR(TO_NUMBER(TO_CHAR(SYSDATE,'YYYY')-1));
|
||||
WHEN 4 THEN
|
||||
v_startDate:= TO_DATE('01-01-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MM-YYYY');
|
||||
v_endDate:= TO_DATE('30-03-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MM-YYYY');
|
||||
v_factuurdatum:='30-03-'||TO_CHAR(SYSDATE,'YYYY');
|
||||
WHEN 7 THEN
|
||||
v_startDate:= TO_DATE('01-04-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MM-YYYY');
|
||||
v_endDate:= TO_DATE('30-06-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MM-YYYY');
|
||||
v_factuurdatum:='30-06-'||TO_CHAR(SYSDATE,'YYYY');
|
||||
ELSE
|
||||
v_startDate:= TO_DATE('01-07-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MM-YYYY');
|
||||
v_endDate:= TO_DATE('30-09-'||TO_CHAR(SYSDATE,'YYYY'),'DD-MM-YYYY');
|
||||
v_factuurdatum:='30-09-'||TO_CHAR(SYSDATE,'YYYY');
|
||||
END CASE;
|
||||
|
||||
|
||||
@@ -3706,70 +3810,107 @@ BEGIN
|
||||
v_bestand:= 'EXR_RES';
|
||||
FOR rec in res(v_startDate, v_endDate)
|
||||
LOOP
|
||||
v_count:=v_count+1;
|
||||
IF v_count=1 THEN
|
||||
pivp.add_xml_row (v_bestand, '<?xml version="1.0" encoding="windows-1252"?>');
|
||||
pivp.add_xml_row (v_bestand, '<eExact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="eExact-Schema.xsd">');
|
||||
pivp.add_xml_row (v_bestand, '<GLEntries>');
|
||||
END IF;
|
||||
|
||||
-- AFhandelen van alle reservering voor deze klant
|
||||
FOR rec_regel IN res_regel(rec.debiteurnr,v_startDate, v_endDate)
|
||||
LOOP
|
||||
v_sub_count:=v_sub_count+1;
|
||||
IF v_sub_count=1 THEN
|
||||
pivp.add_xml_row (v_bestand, '<GLEntry>');
|
||||
-- pivp.add_xml_element (v_bestand, 'Description', 'Zaalreserveringen van '||TO_CHAR(v_startDate,'DD-MM-YYYY')||' tot '||TO_CHAR(v_endDate,'DD-MM-YYYY')||'.');
|
||||
pivp.add_xml_element (v_bestand, 'Date', SYSDATE);
|
||||
pivp.add_xml_element (v_bestand, 'DocumentDate', TO_CHAR(SYSDATE, 'YYYY-MM-DD') );
|
||||
pivp.add_xml_row (v_bestand, '<Division code="003"/>');
|
||||
pivp.add_xml_row (v_bestand, '<Journal code="' || v_dagboek || '" type="V"/>');
|
||||
|
||||
v_count:=v_count+1;
|
||||
IF v_count=1 THEN
|
||||
pivp.add_xml_row (v_bestand, '<?xml version="1.0" encoding="windows-1252"?>');
|
||||
pivp.add_xml_row (v_bestand, '<eExact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="eExact-Schema.xsd">');
|
||||
pivp.add_xml_row (v_bestand, '<Invoices companycode="003" companyname="Pivot Park">');
|
||||
END IF;
|
||||
|
||||
-- AFhandelen van alle reservering voor deze klant
|
||||
FOR rec_regel IN res_regel(rec.debiteurnr,v_startDate, v_endDate)
|
||||
LOOP
|
||||
v_sub_count:=v_sub_count+1;
|
||||
IF v_sub_count=1 THEN
|
||||
pivp.add_xml_row (v_bestand, '<Invoice type="V" code="00">');
|
||||
pivp.add_xml_element (v_bestand, 'Description', 'Zaalreserveringen van '||TO_CHAR(v_startDate,'DD-MM-YYYY')||' tot '||TO_CHAR(v_endDate,'DD-MM-YYYY')||'.');
|
||||
pivp.add_xml_element(v_bestand, 'YourRef','Uwe referentie');
|
||||
pivp.add_xml_row (v_bestand, '<Order type="V"/>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
pivp.add_xml_element (v_bestand, 'CalcIncludeVAT', 'N');
|
||||
pivp.add_xml_row (v_bestand, '<OrderedBy>');
|
||||
pivp.add_xml_row (v_bestand, '<Debtor code="' || xml.char_to_html(rec_regel.debiteurnr) || '"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Date', v_factuurdatum );
|
||||
pivp.add_xml_row (v_bestand, '</OrderedBy>');
|
||||
|
||||
/* pivp.add_xml_element (v_bestand, 'Date', 'N');
|
||||
pivp.add_xml_element (v_bestand, 'DocumentDate', v_factuurdatum );
|
||||
pivp.add_xml_row (v_bestand, '<Division code="003"/>');
|
||||
pivp.add_xml_row (v_bestand, '<Journal code="' || v_dagboek || '" type="V"/>');
|
||||
pivp.add_xml_row (v_bestand, '<Amount>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Value', '0');
|
||||
pivp.add_xml_row (v_bestand, '</Amount>');
|
||||
pivp.add_xml_row (v_bestand, '<ForeignAmount>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Value', '0');
|
||||
pivp.add_xml_row (v_bestand, '</ForeignAmount>'); */
|
||||
|
||||
|
||||
|
||||
END IF;
|
||||
pivp.add_xml_row (v_bestand, '<InvoiceLine lineNo="' || v_sub_count || '" type="N" subtype="N">');
|
||||
pivp.add_xml_element (v_bestand, 'Description', 'Reservering '||rec_regel.reservering_nr||' (Zaal '||rec_regel.ruimte_nr||') op '||TO_CHAR(rec_regel.datum,'DD-MM-YYYY')||' van '||rec_regel.van||' tot '||rec_regel.tot);
|
||||
pivp.add_xml_row (v_bestand, '<Item code="' || v_dienstencode || '"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Quantity', '1' );
|
||||
pivp.add_xml_row (v_bestand, '<Price>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
|
||||
IF rec_regel.verwijderdatum IS NOT NULL
|
||||
AND (rec_regel.verwijderdatum - rec_regel.res_rsv_ruimte_van)<3
|
||||
THEN
|
||||
pivp.add_xml_element (v_bestand, 'Value', ROUND(rec_regel.bedrag*0.5,2));
|
||||
ELSE
|
||||
pivp.add_xml_element (v_bestand, 'Value', rec_regel.bedrag);
|
||||
END IF;
|
||||
pivp.add_xml_row (v_bestand, '</Price>');
|
||||
pivp.add_xml_row (v_bestand, '<Delivery>');
|
||||
pivp.add_xml_element (v_bestand, 'Date', TO_CHAR(rec_regel.datum, 'YYYY-MM-DD') );
|
||||
pivp.add_xml_row (v_bestand, '</Delivery>');
|
||||
|
||||
|
||||
/* pivp.add_xml_row (v_bestand, '<GLAccount code="' || v_dienstencode || '"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Description', 'Reservering '||rec_regel.reservering_nr||' (Zaal '||rec_regel.ruimte_nr||') op '||TO_CHAR(rec_regel.datum,'DD-MM-YYYY')||' van '||rec_regel.van||' tot '||rec_regel.tot);
|
||||
pivp.add_xml_row (v_bestand, '<Costcenter code="' || xml.char_to_html('003.OPS') || '"/>');
|
||||
|
||||
pivp.add_xml_row (v_bestand, '<Debtor number="' || xml.char_to_html(rec_regel.debiteurnr) || '"/>');
|
||||
-- pivp.add_xml_row (v_bestand, '<Item code=""/>');
|
||||
pivp.add_xml_row (v_bestand, '<Amount>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Value', '0');
|
||||
pivp.add_xml_row (v_bestand, '</Amount>');
|
||||
pivp.add_xml_row (v_bestand, '<ForeignAmount>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Value', '0');
|
||||
pivp.add_xml_row (v_bestand, '</ForeignAmount>');
|
||||
pivp.add_xml_element (v_bestand, 'Debit', '0');
|
||||
|
||||
IF rec_regel.verwijderdatum IS NOT NULL
|
||||
AND (rec_regel.verwijderdatum - rec_regel.res_rsv_ruimte_van)<3
|
||||
THEN
|
||||
pivp.add_xml_element (v_bestand, 'Credit', ROUND(rec_regel.bedrag*0.5,2));
|
||||
ELSE
|
||||
pivp.add_xml_element (v_bestand, 'Credit', rec_regel.bedrag);
|
||||
END IF;
|
||||
|
||||
-- pivp.add_xml_row (v_bestand, '<VAT code="' || xml.char_to_html('21') || '"/>');
|
||||
pivp.add_xml_row (v_bestand, '</Amount>');
|
||||
pivp.add_xml_row (v_bestand, '<FinReferences>');
|
||||
pivp.add_xml_element (v_bestand, 'YourRef', 'PO NUmmer klant');
|
||||
pivp.add_xml_element (v_bestand, 'DocumentDate', v_factuurdatum );
|
||||
pivp.add_xml_row (v_bestand, '</FinReferences>');
|
||||
*/
|
||||
pivp.add_xml_row (v_bestand, '</InvoiceLine>');
|
||||
|
||||
|
||||
-- UPDATE res_rsv_ruimte set res_rsv_ruimte_externsyncdat=SYSDATE WHERE res_rsv_ruimte_key=rec.res_rsv_ruimte_key;
|
||||
|
||||
END IF;
|
||||
pivp.add_xml_row (v_bestand, '<FinEntryLine number="' || v_sub_count || '" type="N" subtype="N">');
|
||||
pivp.add_xml_element (v_bestand, 'Date', TO_CHAR(SYSDATE, 'YYYY-MM-DD') );
|
||||
|
||||
|
||||
pivp.add_xml_row (v_bestand, '<GLAccount code="' || v_dienstencode || '"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Description', 'Zaal '||rec_regel.ruimte_nr||' op '||TO_CHAR(rec_regel.datum,'DD-MM-YYYY')||' van '||rec_regel.van||' tot '||rec_regel.tot);
|
||||
pivp.add_xml_row (v_bestand, '<Costcenter code="' || xml.char_to_html('003.OPS') || '"/>');
|
||||
|
||||
pivp.add_xml_row (v_bestand, '<Debtor number="' || xml.char_to_html(rec_regel.debiteurnr) || '"/>');
|
||||
-- pivp.add_xml_row (v_bestand, '<Item code=""/>');
|
||||
pivp.add_xml_row (v_bestand, '<Amount>');
|
||||
pivp.add_xml_row (v_bestand, '<Currency code="EUR"/>');
|
||||
pivp.add_xml_element (v_bestand, 'Debit', '0');
|
||||
pivp.add_xml_element (v_bestand, 'Credit', rec_regel.bedrag);
|
||||
-- pivp.add_xml_row (v_bestand, '<VAT code="' || xml.char_to_html('21') || '"/>');
|
||||
pivp.add_xml_row (v_bestand, '</Amount>');
|
||||
pivp.add_xml_row (v_bestand, '<FinReferences>');
|
||||
pivp.add_xml_element (v_bestand, 'YourRef', 'PO NUmmer klant');
|
||||
pivp.add_xml_element (v_bestand, 'DocumentDate', TO_CHAR(rec_regel.datum, 'YYYY-MM-DD') );
|
||||
pivp.add_xml_row (v_bestand, '</FinReferences>');
|
||||
pivp.add_xml_row (v_bestand, '</FinEntryLine>');
|
||||
|
||||
|
||||
-- UPDATE res_rsv_ruimte set res_rsv_ruimte_externsyncdat=SYSDATE WHERE res_rsv_ruimte_key=rec.res_rsv_ruimte_key;
|
||||
|
||||
|
||||
END LOOP;
|
||||
IF v_sub_count>=1 THEN
|
||||
pivp.add_xml_row (v_bestand, '</GLEntry>');
|
||||
END IF;
|
||||
v_sub_count:=0;
|
||||
|
||||
END LOOP;
|
||||
IF v_sub_count>=1 THEN
|
||||
pivp.add_xml_element (v_bestand, 'Resource', v_sub_count);
|
||||
pivp.add_xml_row (v_bestand, '</Invoice>');
|
||||
END IF;
|
||||
v_sub_count:=0;
|
||||
|
||||
END LOOP;
|
||||
IF v_count>0 THEN
|
||||
pivp.add_xml_row (v_bestand, '</GLEntries>');
|
||||
pivp.add_xml_row (v_bestand, '</Invoices>');
|
||||
pivp.add_xml_row (v_bestand, '</eExact>');
|
||||
END IF;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user