REMARK
\
*****************************************************************************
                                                      
 Bezeichnung:  Datenbank TEAMBAU
 Dateiname:    teamup.wts
 Sprache:      Gupta-Datenbankscript zum Update auf die Datenbank
 Ersteller:    U. Prose
 Erstellt am:  09.10.2013
 Version:      20.13.01

 Aenderungen:
    wann    | wer | was
------------+-----+------------------------------------------------------------
                                teamBAU 8.0.01
------------+-----+------------------------------------------------------------
 28.10.2008 | ag  | Views neu aufbereitet
 17.12.2008 | ag  | Version 8.0.01 gesetzt
------------+-----+------------------------------------------------------------
                                teamBAU 8.0.02
------------+-----+------------------------------------------------------------
 09.01.2009 | ew  | Berechnungsfeld in pe_lpo ist jetzt LONG
------------+-----+------------------------------------------------------------
                                teamBAU 8.0.03
------------+-----+------------------------------------------------------------
 12.01.2009 | ag  | tb_user ist nun ein Querdruck
------------+-----+------------------------------------------------------------
                                teamBAU 8.1.01
------------+-----+------------------------------------------------------------
 15.04.2009 | up  | Tabellen und Änderungen für die mobile Mitschreibung
 28.04.2009 | ag  | SMS-Tabellen mit hinzu
 14.05.2009 | ew  | TE_DRUCK erweitert
 15.05.2009 | ag  | Adress-Eportdruck entfernt
 20.05.2009 | up  | ie_trigger erweitert
 02.06.2009 | ag  | Reportnamen in Grossbuchstaben
------------+-----+------------------------------------------------------------
                                 teamBAU 8.1.02 (Version 8.1)
------------+-----+------------------------------------------------------------
 18.06.2009 | up  | AE_PALM c_palm_mobilversion hinzu
 03.12.2009 | up  | PE_AUFT i_auft_import hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.2.01 (Version 8.2)
------------+-----+------------------------------------------------------------
 09.12.2009 | ew  | ie_ral diverse Spalten für Gutschrift-Assistent hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.2.02 
------------+-----+------------------------------------------------------------
 21.12.2009 | ew  | pe_app erweitert, Mengen-Lock-Mechanismus
 09.03.2010 | up  | ae_korb und ab_korb_art hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.2.03 
------------+-----+------------------------------------------------------------
 09.03.2010 | ew  | Drucke 295,296 hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.2.04 
------------+-----+------------------------------------------------------------
 09.03.2010 | ew  | Mita-View verändert, Index auf pb_lpo_auft
 09.03.2010 | up  | ae_korb und ab_korb_art hinzu
 20.04.2010 | ag  | Indizes für ie_sms und ib_user_sms hinzu  
------------+-----+------------------------------------------------------------
                                 teamBAU 8.2.05
------------+-----+------------------------------------------------------------
 27.04.2010 | ew  | Fibu-Key in ae_korb
------------+-----+------------------------------------------------------------
                                 teamBAU 8.3.01 (Version 8.3)
------------+-----+------------------------------------------------------------
 28.04.2010 | ew  | pe_ger ergänzt mit i_ger_status
 21.05.2010 | up  | pe_apk mit c_app_gruppe ergänzt
 27.05.2010 | up  | Druck TB_UMS.RPT hinzu
 07.06.2010 | ag  | se_adr: Felder für Koordinaten hinzu
 09.06.2010 | up  | Druck TB_PARA.RPT hinzu
 17.06.2010 | up  | Druck PC_MIST1.RPT, PC_FIST1.RPT hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.3.02
------------+-----+------------------------------------------------------------
 17.08.2010 | up  | Spalte ie_msollnp.i_msollnp-kaldaten hinzu
 19.08.2010 | up  | Spalte ie_proj.r_proj_mlohn hinzu
 16.09.2010 | ag  | EFB 221-Formular hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.3.04
------------+-----+------------------------------------------------------------
 15.10.2010 | up  | Tabelle ae_tbb neu hinzu
 13.11.2010 | ag  | Indizes für ae_ -Tabellen hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.4.01 (teamBAU Version 8.4)
------------+-----+------------------------------------------------------------
 22.11.2010 | ew  | Tabelle pe_var neu hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.4.02
------------+-----+------------------------------------------------------------
 12.01.2011 | up  | Tabelle te_druck neu hinzu
 20.01.2011 | up  | Druck PA_PS1A3.RPT, PA_PS3A3.RPT hinzu
------------+-----+------------------------------------------------------------
                                 teamBAU 8.4.03
------------+-----+------------------------------------------------------------
 18.03.2011 | ew  | Druck PA_0305.RPT hinzu, 501-3 auf 306-8 umgemufft
------------+-----+------------------------------------------------------------
                                 teamBAU 8.5.01 (teamBAU Version 8.5)
------------+-----+------------------------------------------------------------
 18.04.2011 | ew  | Tabelle ib_proj_adr hinzu, Drucke
------------+-----+------------------------------------------------------------
                                 teamBAU 8.5.02
------------+-----+------------------------------------------------------------
 06.07.2011 | ew  | Tabelle pe_lvn mit Werktage versehen
------------+-----+------------------------------------------------------------
                                 teamBAU 8.5.03
------------+-----+------------------------------------------------------------
 06.07.2011 | ew  | Tabelle ie_svk mit Spalte CODE versehen
------------+-----+------------------------------------------------------------
                                 teamBAU 8.5.04
------------+-----+------------------------------------------------------------
 04.11.2011 | up  | Druck PA_PRS7.RPT neu hinzu
------------+-----+------------------------------------------------------------
                                teamBAU 8.5.05
------------+-----+------------------------------------------------------------
 23.11.2011 | up  | Druck PZ_ALEIN.RPT neu hinzu
------------+-----+------------------------------------------------------------
                                teamBAU 8.6.01 (teamBAU Version 8.6)
------------+-----+------------------------------------------------------------
 29.11.2011 | ew  | Freistelldatum in se_adr und pe_lvs
 07.12.2011 | ew  | i_lpo_nummer in Tabelle pe_auft hinzu
------------+-----+------------------------------------------------------------
                                teamBAU 8.6.02
------------+-----+------------------------------------------------------------
 10.02.2012 | ew  | Dialog für VGL-Stammdatendrucke (Nr. 19)
 -----------+-----+------------------------------------------------------------
                                teamBAU 8.6.03
------------+-----+------------------------------------------------------------
 27.02.2012 | ew  | Tabelle te_lpos hinzu
 29.03.2012 | ew  | FIBU-Spalte in pe_kst hinzu
 -----------+-----+------------------------------------------------------------
                                teamBAU 8.7.01 (teamBAU Version 8.7)
------------+-----+------------------------------------------------------------
 06.06.2012 | ew  | aenddat in ie_msollp-Tabellen, Erweiterungen ie_term
------------+-----+------------------------------------------------------------
                                teamBAU 8.8.01 (teamBAU Version 8.8)
------------+-----+------------------------------------------------------------
 27.09.2012 | ew  | ie_proj,se_vgl wegen Kostenstruktur erweitert
 17.12.2012 | ew  | Drucke, Auslieferungsversion
------------+-----+------------------------------------------------------------
                                teamBAU 8.8.05 
------------+-----+------------------------------------------------------------
 25.04.2013 | ew  | Erweiterung se_mita, abteilung char(50)
------------+-----+------------------------------------------------------------
                    teamBAU 20.13.01 (teamBAU Version 20.13 TD 6.2)
------------+-----+------------------------------------------------------------
 09.10.2013 | ew  | ProPlan Leistungsbilder in PParam
 09.10.2013 | ew  | c_proj_leibild in ie_proj
------------+-----+------------------------------------------------------------
                    teamBAU 20.14.01 (teamBAU Version 20.14 TD 6.2)
------------+-----+------------------------------------------------------------
 27.06.2014 | ew  | Druckzuordnung für Blankettverteilung FrmBlankVerteil
------------+-----+------------------------------------------------------------
                    teamBAU 20.14.02/03 (teamBAU Version 20.14.2 TD 6.2)
------------+-----+------------------------------------------------------------
 26.09.2014 | up  | GroupId in ae_mits hinzu
 28.11.2014 | ew  | diverse ae-Spalten, Beginn, Ende in pe_apk
 04.02.2015 | ew  | neuer Druck ProWoche (pw_monli.rpt), Version 20.14.04
 11.02.2015 | ew  | c_tbb_notiz hinzu, Druck pc_mvob.rpt Version 20.14.05
 13.04.2015 | ew  | pe_prjan für Bedarfspos. erweitert Version 20.14.07
 08.05.2015 | ew  | ATS-Funktion und Drucker erweitert Version 20.14.08/09
 03.07.2015 | ew  | Funktion zum Umschaufeln der VGL Merkmale
------------+-----+------------------------------------------------------------
                    teamBAU 20.15.01 (teamBAU Version 20.15 TD 6.2)
------------+-----+------------------------------------------------------------
 27.07.2015 | ew  | Index auf LPO-Beziehungstabellen mit PROJ-Nummer vorne
------------+-----+------------------------------------------------------------
                    teamBAU 20.15.02
------------+-----+------------------------------------------------------------
 01.09.2015 | ew  | pe_auva, Spalte i_auva_inaktiv hinzu
------------+-----+------------------------------------------------------------
                    teamBAU 20.15.03
------------+-----+------------------------------------------------------------
 08.10.2015 | up  | ie_man, Spalte c_man_db, c_man_kundennr hinzu
------------+-----+------------------------------------------------------------
                    teamBAU 20.15.04
------------+-----+------------------------------------------------------------
 27.11.2015 | ew  | ie_proj, Spalte i_proj_reb91 hinzu, pe_pap -> i_pap_inaktiv
 01.03.2016 | ew  | neue Drucke Preis-Index-Grafik pr_krv,1,2
------------+-----+------------------------------------------------------------
                    teamBAU 20.16.01 (teamBAU Version 20.16.1)
------------+-----+------------------------------------------------------------
 27.04.2016 | ew  | pe_raum
 24.08.2016 | ew  | Funktion INS_RECHNZA
 29.08.2016 | ew  | Drucke Programm-Parameter und Locks
 07.09.2016 | ew  | pb_mang_pic, c_mpic_tbdatei
 04.10.2016 | ew  | Reziprok für Fremdleistungsbeziehungen hinzu
------------+-----+------------------------------------------------------------
                    teamBAU 20.16.08 (teamBAU Version 20.16.2)
------------+-----+------------------------------------------------------------
 08.12.2016 | ew  | diverse für reziproke Fremdleistung
 08.12.2016 | ew  | Nachweisprojekte in ProPlan
------------+-----+------------------------------------------------------------
                    teamBAU 20.16.10
------------+-----+------------------------------------------------------------
 13.02.2017 | ew  | ErgebnisN-Spalte in pe_kst
 20.03.2017 | ew  | Unterschriften-Pfad-Spalte in ie_user
------------+-----+------------------------------------------------------------
                    teamBAU 20.16.11
------------+-----+------------------------------------------------------------
 09.05.2017 | up  | sv_mitaadr Abteilung hinzu
------------+-----+------------------------------------------------------------
                    teamBAU 20.17.01 (teamBAU Version 20.17.1)
------------+-----+------------------------------------------------------------
 01.06.2017 | ew  | Druck Projektliste tb_proja hinzu
------------+-----+------------------------------------------------------------
                    teamBAU 20.17.02
------------+-----+------------------------------------------------------------
 27.07.2017 | ew  | neue Spalten für Summen in pe_prjan
------------+-----+------------------------------------------------------------
                    teamBAU 20.17.04
------------+-----+------------------------------------------------------------
 18.10.2017 | ew  | neue REB Drucke A4 hoch
------------+-----+------------------------------------------------------------
                    teamBAU 20.17.05
------------+-----+------------------------------------------------------------
 24.10.2017 | ew  | Funktion zur Anpassung der pe_fkst und pe_gkst
------------+-----+------------------------------------------------------------
                    teamBAU 20.17.06
------------+-----+------------------------------------------------------------
 21.11.2017 | ew  | neuer Druck 360, pa_posri.rpt hinzu
------------+-----+------------------------------------------------------------
                    teamBAU 20.17.07 (teamBAU Version 20.17.2)
------------+-----+------------------------------------------------------------
 05.12.2017 | ew  | neuer Druck 361, pz_ezstd.rpt hinzu
 05.12.2017 | ew  | Steuerfeld in pe_pap, index auf ae_tkm
 12.12.2017 | ew  | neue Drucke ZANN*, Nachlass-Feld in pe_kst
------------+-----+------------------------------------------------------------
                    teamBAU 20.17.08
------------+-----+------------------------------------------------------------
 01.02.2018 | ew  | i_notiz_jahr in ie_notiz und Index darauf
------------+-----+------------------------------------------------------------
                    teamBAU 20.17.09
------------+-----+------------------------------------------------------------
 28.02.2018 | ew  | i_zeit_groupid in ie_zeit
------------+-----+------------------------------------------------------------
                    teamBAU 20.18.02 (teamBAU Version 20.18.1)
------------+-----+------------------------------------------------------------
 31.08.2018 | ew  | i_kst_skontom in pe_kst,  i_kstn_skontom in pe_kstn
------------+-----+------------------------------------------------------------
                    teamBAU 20.18.03 (teamBAU Version 20.18.2)
------------+-----+------------------------------------------------------------
 08.11.2018 | ew  | neuer Korr-Druck ADRINDI
------------+-----+------------------------------------------------------------
                    teamBAU 20.18.04
------------+-----+------------------------------------------------------------
 18.01.2019 | ew  | neuer Druck ps_mrapi
------------+-----+------------------------------------------------------------
                    teamBAU 20.18.05
------------+-----+------------------------------------------------------------
 26.02.2019 | ew  | Updates auf ie_ral, c_ral_kenn und c_ral_eingang
------------+-----+------------------------------------------------------------
                    teamBAU 20.18.06
------------+-----+------------------------------------------------------------
 02.04.2019 | ew  | importkey Col in pe_ikst
------------+-----+------------------------------------------------------------
                    teamBAU 20.19.01
------------+-----+------------------------------------------------------------
 19.06.2019 | ew  | Tabellen für Textergänzungen (teamBAU Version 20.19.1)
------------+-----+------------------------------------------------------------
                    teamBAU 20.19.02
------------+-----+------------------------------------------------------------
 09.09.2019 | ew  | Kennung für Nichtberücksichtigung i_biet_ignore in pe_biet
 01.10.2019 | ew  | c_ikst_gobdkey in pe_ikst für PDF-Speicherung GOBD
------------+-----+------------------------------------------------------------
                    teamBAU 20.19.05
------------+-----+------------------------------------------------------------
 09.09.2019 | ew  | Neuer Druck Textergänzungen PA_BTERG.RPT
 01.10.2019 | ew  | Hasenbein Key in pe_apk
------------+-----+------------------------------------------------------------
                    teamBAU 20.19.06
------------+-----+------------------------------------------------------------
 25.11.2019 | ew  | Funktion UP_PE_TERG, Texterg. auf LONG (teamBAU Version 20.19.2)
------------+-----+------------------------------------------------------------
                    teamBAU 20.19.07 und 08
------------+-----+------------------------------------------------------------
 28.02.2020 | ew  | MITA-Views aktualis. und neu
------------+-----+------------------------------------------------------------
                    teamBAU 20.19.09
------------+-----+------------------------------------------------------------
 23.03.2020 | ew  | pe_hase und Index
------------+-----+------------------------------------------------------------
                    teamBAU 20.20.01
------------+-----+------------------------------------------------------------
 11.08.2020 | ew  | KALL-Tools in Programm-Parameter (teamBAU Version 20.20.1)
------------+-----+------------------------------------------------------------
 16.12.2020 | ew  | RPT-Dialoge, div. (teamBAU Version 20.20.2)
------------+-----+------------------------------------------------------------
 25.05.2021 | ew  | KALL-Tools in Programm-Parameter erweitert
------------+-----+------------------------------------------------------------
                    teamBAU 20.21.01
------------+-----+------------------------------------------------------------
 11.08.2020 | ew  | se_art, dn_alt_nr auf 30 Zeichen (teamBAU Version 20.21.1)
------------+-----+------------------------------------------------------------
                    teamBAU 20.21.01
------------+-----+------------------------------------------------------------
 10.09.2020 | ew  | se_art, Zuschlag Beschaffung und Verkauf hinzu
------------+-----+------------------------------------------------------------
 19.10.2021 | ew  | pe_apk, i_apk_mobil für team2Go
------------+-----+------------------------------------------------------------
 26.01.2022 | ew  | pe_apk, i_apk_mobil für team2Go nochmals wegen Trigger
------------+-----+------------------------------------------------------------
                    teamBAU 20.21.2
------------+-----+------------------------------------------------------------
 11.03.2022 | ew  | pe_baut, pb_bbau hinzu plus Druck
------------+-----+------------------------------------------------------------
 13.05.2022 | ew  | pe_lpo erweitern mit sync c_lpo_code, Funktion UP_HASECODE
------------+-----+------------------------------------------------------------
                    teamBAU 20.22.1
------------+-----+------------------------------------------------------------
 22.06.2022 | ew  | i_baut_hinweis zum Bautagebuch (teamBAU Version 20.22.1)
------------+-----+------------------------------------------------------------
                    teamBAU 20.22.2
------------+-----+------------------------------------------------------------
 23.11.2022 | ew  | i_lpo_umlagetit zur LPO (teamBAU Version 20.22.2)
------------+-----+------------------------------------------------------------
 03.02.2023 | ew  | neuer Druck PS_RAUFG eingebunden
------------+-----+------------------------------------------------------------
 15.03.2023 | ew  | Column l_stlb_gaebxml in pe_stlb
------------+-----+------------------------------------------------------------
                    teamBAU 20.23.01
------------+-----+------------------------------------------------------------
 21.04.2023 | ew  | te_druck, String-Felder alle auf 254 (teamBAU Version 20.23.1)
------------+-----+------------------------------------------------------------
                    teamBAU 20.23.02
------------+-----+------------------------------------------------------------
 11.08.2023 | ew  | 2 neue Drucke 386,387
------------+-----+------------------------------------------------------------
                    teamBAU 20.23.02
------------+-----+------------------------------------------------------------
 28.09.2023 | ew  | c_pparam_modul, c_pparam_var auf char(50)
------------+-----+------------------------------------------------------------
                    teamBAU 20.23.03
------------+-----+------------------------------------------------------------
 15.12.2023 | ew  | (teamBAU Version 20.23.2)
------------+-----+------------------------------------------------------------
                    teamBAU 20.23.04
------------+-----+------------------------------------------------------------
 12.01.2024 | ew  | reine Kundendrucke kennzeichnen
------------+-----+------------------------------------------------------------
                    teamBAU 20.23.05
------------+-----+------------------------------------------------------------
 16.02.2024 | ew  | weitere Zusatzspalte in pe_apk, Teamviewer-Eintrag aktual.
------------+-----+------------------------------------------------------------
 26.03.2024 | ew  | (teamBAU Version 20.24.1)
------------+-----+------------------------------------------------------------
                    teamBAU 20.24.01
------------+-----+------------------------------------------------------------
 26.03.2024 | ew  | Funktion UP_SUPERUSER
------------+-----+------------------------------------------------------------
 10.12.2024 | ew  | (teamBAU Version 20.24.2) 20.24.05
------------+-----+------------------------------------------------------------
                    teamBAU 20.24.06
------------+-----+------------------------------------------------------------
 05.02.2025 | ew  | Neuer W-Druck pa_prpos
------------+-----+------------------------------------------------------------
 04.07.2025 | ew  | (teamBAU Version 20.25.1)
------------+-----+------------------------------------------------------------
                    teamBAU 20.25.01
------------+-----+------------------------------------------------------------
 30.07.2025 | ew  | neue Column r_projpp_rmgespreis
------------+-----+------------------------------------------------------------
                    teamBAU 20.25.03-04
------------+-----+------------------------------------------------------------
 30.07.2025 | ew  | neuer Druck 395
 30.09.2025 | ew  | c_lvs_bestellnr vergrößert auf 100 Zeichen
 28.10.2025 | ew  | d_vers_uphin zu Tabelle version hinzu
 05.12.2025 | ew  | (teamBAU Version 20.25.2)
------------+-----+------------------------------------------------------------
                    teamBAU 20.25.05
------------+-----+------------------------------------------------------------
 05.12.2025 | ew  | einige NULL-Column auf 0 setzen (se_art, ie_proj)
------------+-----+------------------------------------------------------------
                    teamBAU 20.25.06
------------+-----+------------------------------------------------------------
 18.02.2026 | ew  | LONG l_ral_qr für QR-Code in ie_ral
------------+-----+------------------------------------------------------------
 26.05.2026 | ew  | (teamBAU Version 20.26.1)
------------+-----+------------------------------------------------------------
                    teamBAU 20.26.01
------------+-----+------------------------------------------------------------
 26.05.2026 | ew  | Felderweiterung ie_proj und se_adr u.a.
 25.06.2026 | ag  | Für alle Fälle wird PV_RAL noch einmal angelegt
------------+-----+------------------------------------------------------------
teamBAU 20.26.02
------------+-----+------------------------------------------------------------
 06.07.2026 | ag  | Neuanlage sv_mitaadr hinzu (Sektion 20.26.02)
------------+-----+------------------------------------------------------------
teamBAU 20.26.03
------------+-----+------------------------------------------------------------
 07.07.2026 | ag  | korrekte view sv_mitaadr verwendet 
------------+-----+------------------------------------------------------------
****************************************************************************

[VERSION]
LetzteVersionsNummer=20.26.03

*****************************************************************************
/


REMARK
\
*****************************************************************************
DB-VERSION: 20.13.01
*****************************************************************************
/

DELETE FROM ie_pparam WHERE (@EXACT(c_pparam_modul, 'ProPlan') = 1) AND (c_pparam_var LIKE 'LB-%');
INSERT INTO ie_pparam (c_pparam_modul, c_pparam_var, c_pparam_value, c_pparam_bem)
VALUES(:1,:2,:3,:4)
\
"ProPlan","LB-Versionen","Gebäude;Innenräume;Freianlagen;Ingenieurbauwerke;Verkehrsanlagen;Tragwerksplanung;Technische Ausrüstung","Leistungsbilder zur Auswahl in ProPlan"
"ProPlan","LB-Phase-1","Grundlagenermittlung","Bezeichnung Leistungsphase 1"
"ProPlan","LB-Phase-2","Vorplanung","Bezeichnung Leistungsphase 2"
"ProPlan","LB-Phase-3","Entwurfsplanung","Bezeichnung Leistungsphase 3"
"ProPlan","LB-Phase-4","Genehmigungsplanung","Bezeichnung Leistungsphase 4"
"ProPlan","LB-Phase-5","Ausführungsplanung","Bezeichnung Leistungsphase 5"
"ProPlan","LB-Phase-6","Vorbereitung der Vergabe","Bezeichnung Leistungsphase 6"
"ProPlan","LB-Phase-7","Mitwirkung bei der Vergabe","Bezeichnung Leistungsphase 7"
"ProPlan","LB-Phase-8","Objektüberwachung","Bezeichnung Leistungsphase 8"
"ProPlan","LB-Phase-9","Objektbetreuung","Bezeichnung Leistungsphase 9"
"ProPlan","LB-Gebäude-1","2","Prozentwert Gebäude Leistungsphase 1"
"ProPlan","LB-Gebäude-2","7","Prozentwert Gebäude Leistungsphase 2"
"ProPlan","LB-Gebäude-3","15","Prozentwert Gebäude Leistungsphase 3"
"ProPlan","LB-Gebäude-4","3","Prozentwert Gebäude Leistungsphase 4"
"ProPlan","LB-Gebäude-5","25","Prozentwert Gebäude Leistungsphase 5"
"ProPlan","LB-Gebäude-6","10","Prozentwert Gebäude Leistungsphase 6"
"ProPlan","LB-Gebäude-7","4","Prozentwert Gebäude Leistungsphase 7"
"ProPlan","LB-Gebäude-8","32","Prozentwert Gebäude Leistungsphase 8"
"ProPlan","LB-Gebäude-9","2","Prozentwert Gebäude Leistungsphase 9"
"ProPlan","LB-Innenräume-1","2","Prozentwert Innenräume Leistungsphase 1"
"ProPlan","LB-Innenräume-2","7","Prozentwert Innenräume Leistungsphase 2"
"ProPlan","LB-Innenräume-3","15","Prozentwert Innenräume Leistungsphase 3"
"ProPlan","LB-Innenräume-4","2","Prozentwert Innenräume Leistungsphase 4"
"ProPlan","LB-Innenräume-5","30","Prozentwert Innenräume Leistungsphase 5"
"ProPlan","LB-Innenräume-6","7","Prozentwert Innenräume Leistungsphase 6"
"ProPlan","LB-Innenräume-7","3","Prozentwert Innenräume Leistungsphase 7"
"ProPlan","LB-Innenräume-8","32","Prozentwert Innenräume Leistungsphase 8"
"ProPlan","LB-Innenräume-9","2","Prozentwert Innenräume Leistungsphase 9"
"ProPlan","LB-Freianlagen-1","3","Prozentwert Freianlagen Leistungsphase 1"
"ProPlan","LB-Freianlagen-2","10","Prozentwert Freianlagen Leistungsphase 2"
"ProPlan","LB-Freianlagen-3","16","Prozentwert Freianlagen Leistungsphase 3"
"ProPlan","LB-Freianlagen-4","4","Prozentwert Freianlagen Leistungsphase 4"
"ProPlan","LB-Freianlagen-5","25","Prozentwert Freianlagen Leistungsphase 5"
"ProPlan","LB-Freianlagen-6","7","Prozentwert Freianlagen Leistungsphase 6"
"ProPlan","LB-Freianlagen-7","3","Prozentwert Freianlagen Leistungsphase 7"
"ProPlan","LB-Freianlagen-8","30","Prozentwert Freianlagen Leistungsphase 8"
"ProPlan","LB-Freianlagen-9","2","Prozentwert Freianlagen Leistungsphase 9"
"ProPlan","LB-Ingenieurbauwerke-1","2","Prozentwert Ingenieurbauwerke Leistungsphase 1"
"ProPlan","LB-Ingenieurbauwerke-2","20","Prozentwert Ingenieurbauwerke Leistungsphase 2"
"ProPlan","LB-Ingenieurbauwerke-3","25","Prozentwert Ingenieurbauwerke Leistungsphase 3"
"ProPlan","LB-Ingenieurbauwerke-4","5","Prozentwert Ingenieurbauwerke Leistungsphase 4"
"ProPlan","LB-Ingenieurbauwerke-5","15","Prozentwert Ingenieurbauwerke Leistungsphase 5"
"ProPlan","LB-Ingenieurbauwerke-6","13","Prozentwert Ingenieurbauwerke Leistungsphase 6"
"ProPlan","LB-Ingenieurbauwerke-7","4","Prozentwert Ingenieurbauwerke Leistungsphase 7"
"ProPlan","LB-Ingenieurbauwerke-8","15","Prozentwert Ingenieurbauwerke Leistungsphase 8"
"ProPlan","LB-Ingenieurbauwerke-9","1","Prozentwert Ingenieurbauwerke Leistungsphase 9"
"ProPlan","LB-Verkehrsanlagen-1","2","Prozentwert Verkehrsanlagen Leistungsphase 1"
"ProPlan","LB-Verkehrsanlagen-2","20","Prozentwert Verkehrsanlagen Leistungsphase 2"
"ProPlan","LB-Verkehrsanlagen-3","25","Prozentwert Verkehrsanlagen Leistungsphase 3"
"ProPlan","LB-Verkehrsanlagen-4","8","Prozentwert Verkehrsanlagen Leistungsphase 4"
"ProPlan","LB-Verkehrsanlagen-5","15","Prozentwert Verkehrsanlagen Leistungsphase 5"
"ProPlan","LB-Verkehrsanlagen-6","10","Prozentwert Verkehrsanlagen Leistungsphase 6"
"ProPlan","LB-Verkehrsanlagen-7","4","Prozentwert Verkehrsanlagen Leistungsphase 7"
"ProPlan","LB-Verkehrsanlagen-8","15","Prozentwert Verkehrsanlagen Leistungsphase 8"
"ProPlan","LB-Verkehrsanlagen-9","1","Prozentwert Verkehrsanlagen Leistungsphase 9"
"ProPlan","LB-Tragwerksplanung-1","3","Prozentwert Tragwerksplanung Leistungsphase 1"
"ProPlan","LB-Tragwerksplanung-2","10","Prozentwert Tragwerksplanung Leistungsphase 2"
"ProPlan","LB-Tragwerksplanung-3","15","Prozentwert Tragwerksplanung Leistungsphase 3"
"ProPlan","LB-Tragwerksplanung-4","30","Prozentwert Tragwerksplanung Leistungsphase 4"
"ProPlan","LB-Tragwerksplanung-5","40","Prozentwert Tragwerksplanung Leistungsphase 5"
"ProPlan","LB-Tragwerksplanung-6","2","Prozentwert Tragwerksplanung Leistungsphase 6"
"ProPlan","LB-Tragwerksplanung-7","0","Prozentwert Tragwerksplanung Leistungsphase 7"
"ProPlan","LB-Tragwerksplanung-8","0","Prozentwert Tragwerksplanung Leistungsphase 8"
"ProPlan","LB-Tragwerksplanung-9","0","Prozentwert Tragwerksplanung Leistungsphase 9"
"ProPlan","LB-Technische Ausrüstung-1","2","Prozentwert Technische Ausrüstung Leistungsphase 1"
"ProPlan","LB-Technische Ausrüstung-2","9","Prozentwert Technische Ausrüstung Leistungsphase 2"
"ProPlan","LB-Technische Ausrüstung-3","17","Prozentwert Technische Ausrüstung Leistungsphase 3"
"ProPlan","LB-Technische Ausrüstung-4","2","Prozentwert Technische Ausrüstung Leistungsphase 4"
"ProPlan","LB-Technische Ausrüstung-5","22","Prozentwert Technische Ausrüstung Leistungsphase 5"
"ProPlan","LB-Technische Ausrüstung-6","7","Prozentwert Technische Ausrüstung Leistungsphase 6"
"ProPlan","LB-Technische Ausrüstung-7","5","Prozentwert Technische Ausrüstung Leistungsphase 7"
"ProPlan","LB-Technische Ausrüstung-8","35","Prozentwert Technische Ausrüstung Leistungsphase 8"
"ProPlan","LB-Technische Ausrüstung-9","1","Prozentwert Technische Ausrüstung Leistungsphase 9"
/;

DELETE FROM ie_pparam WHERE (@EXACT(c_pparam_modul, 'Options') = 1) AND (@EXACT(c_pparam_var, 'ComboMitaSave') = 1);
DELETE FROM ie_pparam WHERE (@EXACT(c_pparam_modul, 'Options') = 1) AND (@EXACT(c_pparam_var, 'ComboProjSave') = 1);
INSERT INTO ie_pparam (c_pparam_modul, c_pparam_var, c_pparam_value, c_pparam_bem)
VALUES(:1,:2,:3,:4)
\
"Options","ComboMitaSave","1","1=Sichern und Wiederherstellen des Mitarbeiternamens in einer Mitarbeitercombobox"
"Options","ComboProjSave","1","1=Sichern und Wiederherstellen des Projektes in einer Projektcombobox"
/;

ALTER TABLE ie_proj ADD c_proj_leibild CHAR(40);

UPDATE version SET c_vers_version = '20.13.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.13.02
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (337);
INSERT INTO ie_rpt (k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename, i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark, d_rpt_aenddat)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
337,"W",1,"Adress-Etiketten, Zweckform-Nr. 3424","A4hoch",1,"TblAdressAL","tb_3424.rpt",0,0,0,0,"","2013-12-19-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.13.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.01
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (1063, 338);
INSERT INTO ie_rpt (k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename, i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark, d_rpt_aenddat)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
1063,"W",1,"Mengenübersicht Arbeitspakete","A4hoch",1,"FrmBlankVerteil","PC_MEAP.RPT",0,0,256,0,"",2014-06-27-00.00.00.000000
338,"W",1,"Mangel mit Bildern","A4hoch",1,"TblMangel","PA_MANGX.rpt",0,0,0,0,"","2014-07-15-00.00.00.000000"
/;

CREATE TABLE pb_mang_pic (
  k_i_mpic_nummer      INTEGER           NOT NULL,
  k_i_proj_nummer      INTEGER           NOT NULL,
  k_i_mang_nummer      INTEGER           NOT NULL,
    i_mpic_fit         INTEGER           NOT NULL WITH DEFAULT,
    c_mpic_datei       CHAR(250),
    c_mpic_bemerk      CHAR(250),
    l_mpic_bild        LONG              NOT NULL WITH DEFAULT,
    d_mpic_aenddat     DATETIME          NOT NULL WITH DEFAULT
) PCTFREE 10;

CREATE UNIQUE INDEX ui_mpic1 ON pb_mang_pic ( k_i_proj_nummer, k_i_mpic_nummer) PCTFREE 10;

UPDATE version SET c_vers_version = '20.14.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.02
*****************************************************************************
/
ALTER TABLE ae_mits ADD i_mits_groupid INTEGER NOT NULL WITH DEFAULT;

DROP INDEX ui_aemits;
CREATE UNIQUE INDEX ui_aemits ON ae_mits (k_i_proj_nummer,k_i_apk_nummer,k_i_mita_nummer,k_i_palm_nummer,d_mits_datum, c_mits_zeitvon, c_mits_zeitbis) PCTFREE 10;

DROP INDEX ui_tbg;
CREATE UNIQUE INDEX ui_tbg ON ae_tbg (k_i_tbp_nummer, k_i_ger_nummer, d_ger_von, d_ger_bis) PCTFREE 10;

UPDATE version SET c_vers_version = '20.14.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.03
*****************************************************************************
/
	   
ALTER TABLE ae_tbl ADD k_i_apk_nummer INTEGER NOT NULL;
ALTER TABLE ae_tbl ADD r_apk_fertig DOUBLE PRECISION NOT NULL WITH DEFAULT;
ALTER TABLE ae_tbl ADD i_tbl_dirty INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_tbl ADD d_tbl_aenddat DATETIME;
ALTER TABLE ae_tbl ADD c_tbl_bemerk CHAR (254);
ALTER TABLE ae_zeit ADD k_i_apk_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_zeit ADD i_zeit_mobil INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ie_zeit ADD i_apk_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_zeit ADD i_zeit_groupid INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_zeit ADD k_i_tbp_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_zeit ADD k_i_apk_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_zeit ADD k_i_zu_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_zeit ADD i_modul_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_zeit ADD i_zeit_dirty INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_tbp ADD i_tbp_dirty INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_tbg ADD i_tbg_dirty INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_palm ADD i_palm_dirty INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_tbb ADD i_tbb_dirty INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_tbb ADD d_tbb_aenddat DATETIME;
ALTER TABLE ae_tbm ADD c_mita_bemerk CHAR (254);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (339, 340, 341);
INSERT INTO ie_rpt (k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename, i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark, d_rpt_aenddat)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
339,"L",11,"Rücksendung Bürgschaft","A4hoch",1,"FrmLVAL","RUECKB.RLV",0,0,0,0,"","2014-09-30-00.00.00.000000"
340,"L",12,"Enthaftungserklärung","A4hoch",1,"FrmLVAL","ENTHAFT.RLV",0,0,0,0,"","2014-09-30-00.00.00.000000"
341,"W",1,"Arbeitspaket-Statistik","A4hoch",1,"TblAPKStatistik","TB_APKST.rpt",0,0,0,0,"","2014-11-24-00.00.00.000000"
/;

ALTER TABLE ie_term MODIFY c_term_user CHAR(250);
UPDATE ie_term SET c_term_user = '[' || c_term_user || ']' where @length(c_term_user ) > 0 And @scan(c_term_user,'[') = -1;

ALTER TABLE pe_apk ADD d_apk_beginn DATETIME;
ALTER TABLE pe_apk ADD d_apk_ende DATETIME;
ALTER TABLE pe_apk ADD r_apk_zusatz DOUBLE PRECISION NOT NULL WITH DEFAULT;
ALTER TABLE version ADD c_vers_kundennr CHAR(50);
DROP INDEX in_apkdate;
CREATE INDEX in_apkdate ON pe_apk (k_i_proj_nummer, d_apk_beginn, d_apk_ende) PCTFREE 10;
DELETE FROM ie_dru;
DELETE FROM ie_ldru;

UPDATE version SET c_vers_version = '20.14.03', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.04
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (342);
INSERT INTO ie_rpt (k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename, i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark, d_rpt_aenddat)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
342,"W",1,"Monatsstunden Mitarbeiter","A4hoch",1,"TblPruefMonatMA","PW_MONLI.rpt",0,0,0,0,"","2015-02-04-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.14.04', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.05
*****************************************************************************
/
ALTER TABLE ae_tbb ADD c_tbb_notiz CHAR(254);
DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (343);
INSERT INTO ie_rpt (k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename, i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark, d_rpt_aenddat)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
343,"W",1,"Mehr-Mindermengen mit Geschäftskostenkorrektur","A4quer",1,"FrmAngebot","PC_MVOB.RPT",0,0,0,0,"","2015-03-10-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.14.05', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.06
*****************************************************************************
/
ALTER TABLE pe_biet ADD i_biet_kst INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_zuab ADD i_zuab_ats INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.14.06', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.07
*****************************************************************************
/
ALTER TABLE pe_prjan ADD r_prjan_bgeslohn   DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bgesschal  DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bgesstoff  DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bgesmasch  DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bgesfremd1 DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bgesfremd2 DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bgesfremd3 DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bgesprod   DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bgespreis  DOUBLE PRECISION  NOT NULL WITH DEFAULT;

ALTER TABLE pe_lvs ADD c_lvs_bedarftext CHAR(40);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (344);
INSERT INTO ie_rpt (k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename, i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark, d_rpt_aenddat)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
344,"W",1,"Arbeitspaket-Statistik m. Auftragnehmer","A4hoch",1,"TblAPKStatistik","TB_APKS1.rpt",0,0,0,0,"","2015-04-15-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.14.07', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.08
*****************************************************************************
/

REMARK
\
*****************************************************************************
Funktionsaufruf zur Vorbelegung der ATS-Kennzeichen in Zulagen/Abzügen
FUNCTION#UPDATE_ZUAB_ATS
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.14.08', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.09
*****************************************************************************
/
ALTER TABLE se_din ADD i_din_nurindex INTEGER  NOT NULL WITH DEFAULT;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (160,345,346,347,1045);
INSERT INTO ie_rpt (k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename, i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark, d_rpt_aenddat)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
160,"W",1,"Positionsstatistik","A4hoch",1,"FrmPosStatistik","PC_PSTAT.RPT",0,0,256,0,"",2001-12-20-14.39.10.364000
1045,"W",2,"Projektberechnungsarten","A4hoch",1,"FrmVglKstUeb","PR_PBART.RPT",0,0,275,0,"",2015-05-08-00.00.00.000000
345,"W",3,"Bietervorschlagsliste","A4quer",1,"TblAdressAL","TB_ADRBI.RPT",0,0,276,0,"","2015-06-03-00.00.00.000000"
346,"W",1,"Kostenarten-Summen Positionsliste","A4quer",2,"FrmAngebot","PM_AUFK.RPT",0,0,256,0,"","2015-06-24-00.00.00.000000"
347,"W",4,"Mitarbeiter-Stundennachweis (MiLoG)","A4hoch",2,"TblPWMitaProjUebersicht","PW_MILO.RPT",0,0,10,0,"","2015-07-01-00.00.00.000000"
/;

DROP VIEW sv_adr_fkz;
CREATE VIEW sv_adr_fkz (
  c_fkz_kennz, 
  c_fkz_system_m, 
  k_i_adr_nummer, 
  k_i_fkz_nummer) AS 
SELECT g.c_fkz_kennz, g.c_fkz_system_m, b.k_i_adr_nummer, b.k_i_fkz_nummer
  FROM sb_adr_fkz b,se_fkz g
 WHERE b.k_i_fkz_nummer=g.k_i_fkz_nummer;
 
UPDATE version SET c_vers_version = '20.14.09', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.14.10
*****************************************************************************
/

REMARK
\
*****************************************************************************
Funktionsaufruf zum Umschaufeln der Merkmale in se_vgl
FUNCTION#ALTER_SEVGL
*****************************************************************************
/
UPDATE version SET c_vers_version = '20.14.10', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.15.01
*****************************************************************************
/

DROP INDEX fi_lpo_fre1;
CREATE       INDEX fi_lpo_fre1 ON pb_lpo_fre (
  k_i_proj_nummer, k_i_lpo_nummer, k_i_fre_nummer
) PCTFREE 10;

DROP INDEX fi_lpo_ger;
CREATE INDEX fi_lpo_ger ON pb_lpo_ger (
    k_i_proj_nummer, k_i_lpo_nummer, k_i_ger_nummer
) PCTFREE 10;

DROP INDEX fi_lpo_art;
CREATE INDEX fi_lpo_art ON pb_lpo_art (
    k_i_proj_nummer, k_i_lpo_nummer, k_i_art_nummer
) PCTFREE 10;

DROP INDEX in_tlpoart;
CREATE INDEX in_tlpoart ON te_lpoart(k_i_pid,k_i_proj_nummer) PCTFREE 10;
DROP INDEX in_tlpoger;
CREATE INDEX in_tlpoger ON te_lpoger(k_i_pid,k_i_proj_nummer) PCTFREE 10;
DROP INDEX in_tlpofre;
CREATE INDEX in_tlpofre ON te_lpofre(k_i_pid,k_i_proj_nummer) PCTFREE 10;

UPDATE version SET c_vers_version = '20.15.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.15.02
*****************************************************************************
/
ALTER TABLE pe_auva ADD i_auva_inaktiv INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.15.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.15.03
*****************************************************************************
/
ALTER TABLE ae_korb ADD c_korb_bemerk CHAR(100);

UPDATE version SET c_vers_version = '20.15.03', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.15.04
*****************************************************************************
/
ALTER TABLE ie_proj ADD i_proj_reb91 INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_pap ADD i_pap_inaktiv INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.15.04', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.15.05
*****************************************************************************
/

UPDATE pe_lvs SET i_lvs_textlen = @LENGTH(l_lvs_vorwort);
ALTER TABLE ie_zeit ADD i_zeit_pause2 INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ie_zeit ADD i_modul_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ie_zeit ADD k_i_zeit_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ie_zeit ADD k_i_tbp_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_zeit ADD k_i_zeit_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_tbl ADD k_i_tbl_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ae_tbg ADD k_i_tbg_nummer INTEGER NOT NULL WITH DEFAULT;

DROP INDEX ui_tbl1;
CREATE UNIQUE INDEX ui_tbl1 ON ae_tbl (k_i_tbl_nummer) PCTFREE 10;
DROP INDEX ui_tbg1;
CREATE UNIQUE INDEX ui_tbg1 ON ae_tbg (k_i_tbg_nummer) PCTFREE 10;
DROP INDEX ui_tbb1;
CREATE UNIQUE INDEX ui_tbb1 ON ae_tbb (k_i_tbb_nummer) PCTFREE 10;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (1117);
INSERT INTO ie_rpt (k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename, i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark, d_rpt_aenddat)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
1117,"W",14,"Mengenermittlung - REB","A4quer",2,"TblMengeREB91AL","PS_MEREB.RPT",0,0,4,0,"",2016-02-15-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.15.05', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.15.06
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (183,328,348,349);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
183,"W",2,"Preis-Statistik Amt/Überregional - Grafik","A4quer",1,"FrmPreisIndex","PR_KRV.RPT",0,0,0,0,"","2002-12-16-14.27.05.200000"
348,"W",3,"Preis-Statistik Amt/Regional - Grafik","A4quer",1,"FrmPreisIndex","PR_KRV1.RPT",0,0,0,0,"","2002-12-16-14.27.05.200000"
349,"W",4,"Preis-Statistik Amt/Regional/Überregional - Grafik","A4quer",1,"FrmPreisIndex","PR_KRV2.RPT",0,0,0,0,"","2002-12-16-14.27.05.200000"
/;

UPDATE version SET c_vers_version = '20.15.06', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.01
*****************************************************************************
/

CREATE TABLE pe_raum (
  k_i_raum_nummer         INTEGER           NOT NULL,
  k_i_proj_nummer         INTEGER           NOT NULL,
    i_apk_nummer          INTEGER           NOT NULL WITH DEFAULT,
    i_raum_ebene          INTEGER           NOT NULL WITH DEFAULT,
    i_raum_parent         INTEGER           NOT NULL WITH DEFAULT,
    i_raum_childs         INTEGER           NOT NULL WITH DEFAULT,
    i_raum_vor            INTEGER           NOT NULL WITH DEFAULT,
    i_raum_nach           INTEGER           NOT NULL WITH DEFAULT,
    c_raum_text           CHAR(100),
    c_raum_code           CHAR(100),
    d_raum_aenddat        DATETIME          NOT NULL WITH DEFAULT
);

DROP INDEX ui_raum1;
CREATE UNIQUE INDEX ui_raum1 ON pe_raum (k_i_proj_nummer, k_i_raum_nummer) PCTFREE 10;
DROP INDEX ie_raum1;
CREATE INDEX ie_raum1 ON pe_raum (k_i_proj_nummer, i_apk_nummer) PCTFREE 10;

CREATE TABLE pe_dinh (
  k_i_dinh_nummer      INTEGER           NOT NULL,
  k_i_proj_nummer      INTEGER           NOT NULL,
    i_din_nummer       INTEGER           NOT NULL WITH DEFAULT,
    i_dinh_lfd         INTEGER           NOT NULL WITH DEFAULT,
    i_dinh_kw          INTEGER           NOT NULL WITH DEFAULT,
    i_dinh_jahr        INTEGER           NOT NULL WITH DEFAULT,
    d_dinh_datum       DATE,
	c_dinh_text        char(100),
    r_dinh_vertrag     DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_nachtrag    DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_prognose    DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_zahlung     DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_user        DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_n_vertrag   DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_n_nachtrag  DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_n_prognose  DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_n_zahlung   DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_dinh_n_user      DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    d_dinh_aenddat     DATETIME          NOT NULL WITH DEFAULT
) PCTFREE 10;

DROP INDEX ui_dinh1;
CREATE UNIQUE INDEX ui_dinh1 ON pe_dinh (k_i_proj_nummer, k_i_dinh_nummer) PCTFREE 10;
DROP INDEX ie_dinh1;
CREATE INDEX ie_dinh1 ON pe_dinh (k_i_proj_nummer, i_din_nummer, i_dinh_lfd, i_dinh_kw, i_dinh_jahr) PCTFREE 10;

ALTER TABLE pe_mer ADD i_raum_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_ikst ADD d_ikst_redatum DATETIME;
ALTER TABLE pe_ikst ADD c_ikst_renr CHAR(50);
ALTER TABLE pe_ikst ADD c_ikst_lieferant CHAR(100);
ALTER TABLE pe_ikst ADD c_ikst_konto CHAR(50);
ALTER TABLE pe_ikst MODIFY c_ikst_bemerk CHAR(100);
ALTER TABLE pe_lvs ADD r_lvs_rueck DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_lvn ADD r_lvn_rueck DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_auft ADD i_auft_man_nummer INTEGER    NOT NULL WITH DEFAULT;
ALTER TABLE ie_ral ADD l_ral_protokoll LONG;
ALTER TABLE pe_raum ADD i_apk_nummer INTEGER NOT NULL WITH DEFAULT;
UPDATE ie_urpt SET c_urpt_filename = @UPPER(c_urpt_filename);
UPDATE ie_rpt SET c_rpt_filename = @UPPER(c_rpt_filename);
UPDATE ie_urpt SET c_urpt_filename = 'RECH_NZA.RLV' WHERE i_rpt_nummer=204 AND c_urpt_filename = 'RECH_NZ.RLV';

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (204,350,351,352,1118);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
204,"L",11,"Rechnung auf AP-Basis","A4hoch",1,"FrmRechnungBF","RECH_NZA.RLV",0,0,771,0,"",2016-07-14-00.00.00.000000
350,"W",1,"Aufmaß A-E","A4hoch",1,"TblRaumMengenEL","PC_SHK1.RPT",0,0,21,0,"",2016-06-27-00.00.00.000000
351,"W",2,"Mengenverteilung Position / Raum","A4hoch",1,"TblRaumMengenEL","PC_SHK2.RPT",0,0,21,0,"",2016-06-27-00.00.00.000000
352,"W",3,"Mengenermittlung SHK komprimiert","A4hoch",1,"TblRaumMengenEL","PC_SHK3.RPT",0,0,21,0,"",2016-06-27-00.00.00.000000
1118,"W",2,"Projekt-IST-Kosten ausführlich","A4quer",1,"TblIstKostenAL","PC_IKSTQ.RPT",0,0,256,0,"",2016-05-04-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.16.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.02
*****************************************************************************
/

REMARK
\
*****************************************************************************
Funktionsaufruf zum Kopieren des Druckes RECH_NZA
FUNCTION#INS_RECHNZA
*****************************************************************************
/
UPDATE version SET c_vers_version = '20.16.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.03
*****************************************************************************
/
DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (18,298);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
18,"W",2,"Datenbank-Zugriffe","A4quer",2,"FrmStatus","LOCK.RPT",0,0,0,0,"","1997-04-18-11.01.05.050000"
298,"W",1,"Programmparameter","A4hoch",1,"FrmStatus","TB_PPAR.RPT",0,0,0,0,"",2010-03-23-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.16.03', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.04
*****************************************************************************
/
ALTER TABLE pb_mang_pic ADD c_mpic_tbdatei CHAR(250);
ALTER TABLE pb_mang_pic ADD i_mpic_lfd INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.16.04', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.05
*****************************************************************************
/
DROP INDEX ie_raum1;
DROP INDEX ui_raum2;
CREATE UNIQUE INDEX ui_raum2 ON pe_raum (k_i_proj_nummer, i_apk_nummer, c_raum_code) PCTFREE 10;

UPDATE version SET c_vers_version = '20.16.05', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.07
*****************************************************************************
/

UPDATE ie_rpt SET C_RPT_ITEMNAME = 'TblStundenMitschreibungAuftrag' WHERE C_RPT_ITEMNAME = 'TblStundenMitschreibung_Auftrag';
UPDATE ie_rpt SET C_RPT_ITEMNAME = 'TblMitaProjUebersichtAuftrag' WHERE C_RPT_ITEMNAME = 'TblMitaProjUebersicht_Auftrag';

UPDATE version SET c_vers_version = '20.16.07', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.08
*****************************************************************************
/
ALTER TABLE pb_lpo_fre ADD r_lpo_fre_faktor DOUBLE PRECISION ;
UPDATE pb_lpo_fre SET r_lpo_fre_faktor = 1 WHERE r_lpo_fre_faktor IS NULL;
ALTER TABLE pb_lpo_fre MODIFY r_lpo_fre_faktor NOT NULL WITH DEFAULT;
ALTER TABLE pb_lpo_fre ADD c_lpo_fre_rezi CHAR(1);
ALTER TABLE te_lpofre ADD r_lpo_fre_faktor DOUBLE PRECISION NOT NULL WITH DEFAULT;
ALTER TABLE te_lpofre ADD c_lpo_fre_rezi CHAR(1);


ALTER TABLE sb_pos_fre ADD r_pos_fre_faktor DOUBLE PRECISION ;
UPDATE sb_pos_fre SET r_pos_fre_faktor = 1 where r_pos_fre_faktor IS NULL;
ALTER TABLE sb_pos_fre MODIFY r_pos_fre_faktor NOT NULL WITH DEFAULT;
ALTER TABLE sb_pos_fre ADD c_pos_fre_rezi CHAR(1);

ALTER TABLE ie_ral ADD r_ral_nsicher DOUBLE PRECISION NOT NULL WITH DEFAULT;
ALTER TABLE ie_proj ADD i_proj_pp_nachweis INTEGER NOT NULL WITH DEFAULT;

ALTER TABLE pe_kst ADD i_kst_sperr INTEGER NOT NULL WITH DEFAULT;

ALTER TABLE version ADD c_vers_teamviewer CHAR(250);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (353,354,355);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
353,"W",12,"Mitarbeiter Monatssummen Kalenderjahr","A4quer",0,"TblMitaProjUebersicht","PZ_AAPS.RPT",0,0,10,0,"",2016-11-09-00.00.00.000000
354,"W",1,"Leistungsnachweis nicht abgerechnete Mitschreibungen","A4hoch",0,"FrmNachweisProj","PZ_NACH1.RPT",0,0,0,0,"",2016-11-09-00.00.00.000000
355,"L",2,"Honorar-Rechnung aus Nachweis-Erfassung oder frei","A4hoch",0,"FrmHonRechnungBF","HONRNACH.RTX",0,0,0,0,"",2016-11-23-00.00.00.000000
/;

UPDATE ie_rpt SET C_RPT_ITEMNAME = 'TblStundenMitschreibungAuftrag' WHERE C_RPT_ITEMNAME = 'TblStundenMitschreibung_Auftrag';
UPDATE ie_rpt SET C_RPT_ITEMNAME = 'TblMitaProjUebersichtAuftrag' WHERE C_RPT_ITEMNAME = 'TblMitaProjUebersicht_Auftrag';

UPDATE version SET c_vers_version = '20.16.08', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS_de-idczzxsn3c.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.09
*****************************************************************************
/

ALTER TABLE pe_kst ADD r_kst_ergebnisn DOUBLE PRECISION NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.16.09', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.10
*****************************************************************************
/

ALTER TABLE ie_user ADD c_user_sign CHAR(250);

UPDATE version SET c_vers_version = '20.16.10', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.16.11
*****************************************************************************
/

ALTER TABLE ie_aktivproto ADD c_akt_bemerk CHAR(250);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (356);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
356,"W",2,"Protokoll der Aktivitäten inkl. Bemerkung","A4quer",1,"TblAktivitaeten","SV_AKTIQ.RPT",0,0,0,0,"",2017-04-11-00.00.00.000000
/;

DROP VIEW sv_mitaadr;
CREATE VIEW sv_mitaadr (k_i_adr_nummer, k_i_mita_nummer, c_adr_vorname, c_mita_name, c_mita_persnr, i_mita_status, i_mita_mobil, i_mita_pwdreset, i_phase_nummer,
       i_mita_usermits, r_mita_prodkst, i_mita_lohnart, c_adr_tel1, c_adr_btx, c_mita_qualif, c_mita_notiz1, c_mita_notiz2, c_mita_notiz3,
       c_adr_strasse, c_adr_plz, c_adr_ort, c_mita_komplett, c_mita_abteilung) AS
SELECT k_i_adr_nummer, k_i_mita_nummer, c_adr_vorname, c_mita_name, c_mita_persnr, i_mita_status, i_mita_mobil, i_mita_pwdreset, i_phase_nummer,
       i_mita_usermits, r_mita_prodkst, i_mita_lohnart, c_adr_tel1, c_adr_btx, c_mita_qualif, c_mita_notiz1, c_mita_notiz2, c_mita_notiz3,
       c_adr_strasse, c_adr_plz, c_adr_ort, c_mita_name || ', ' || c_adr_vorname || ' [' || c_mita_persnr || ']', c_mita_abteilung
FROM se_mita, se_adr
WHERE i_adr_nummer = k_i_adr_nummer(+);

UPDATE version SET c_vers_version = '20.16.11', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.17.01
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (357,358);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
357,"W",1,"Projektliste mit Adressliste","A4quer",1,"TblProjektAL","TB_PROJA.RPT",0,0,0,0,"",2017-06-01-00.00.00.000000
358,"W",1,"Projektergebnisse (ProCash) Überblick","A4quer",1,"TblProjektAL","TB_PROJU.RPT",0,0,0,0,"",2017-06-01-00.00.00.000000
/;

ALTER TABLE pe_kstn ADD r_kstn_korr DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_kstn ADD r_kstn_ergebnisn DOUBLE PRECISION NOT NULL WITH DEFAULT;
ALTER TABLE pe_kstn ADD r_kstn_fibu DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_kstn ADD i_kstn_skonto INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_kstn ADD i_kstn_sicher INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_kstn ADD i_kstn_sperr INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.17.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.17.02
*****************************************************************************
/

ALTER TABLE pe_prjan ADD r_prjan_umpossum DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD r_prjan_bewpossum DOUBLE PRECISION  NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.17.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.17.03
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (359);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
359,"L",10,"Zahlungsanweisung, Abschlag einfach","A4hoch",1,"TblNUKonto","ZANWTNEI.RTX",0,0,768,0,"","2017-08-03-00.00.00.000000"
/;

ALTER TABLE pe_kstn ADD d_kstn_kompldatum DATETIME;
ALTER TABLE pe_kst ADD d_kst_kompldatum DATETIME;
ALTER TABLE ie_user ADD i_user_mailmsg INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.17.03', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.17.04
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (1119);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
1119,"W",10,"REB-Mengen Leistungspositionen Kurzform","A4hoch",2,"FrmPosAL","PS_MRPOH.RPT",0,0,4,0,"",2017-10-18-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.17.04', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.17.05
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zur Anpassung der pe_fkst und pe_gkst mit Preisfeld
FUNCTION#UP_FG_KST
*****************************************************************************
/
UPDATE version SET c_vers_version = '20.17.05', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.17.06
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (360);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
360,"W",6,"Soll/Abrechnungs-Vergleich mit Titelsummen","A4quer",1,"FrmPosAL","PA_POSRI.RPT",0,0,0,0,"","2017-11-21-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.17.06', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.17.07
*****************************************************************************
/

DROP INDEX in_aetk2;
CREATE INDEX in_aetk2 ON ae_tkm(i_tkm_lfd);

ALTER TABLE pe_pap ADD i_pap_steuer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_kst ADD r_kst_nachlass DOUBLE PRECISION  NOT NULL WITH DEFAULT;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (361,362,363,364,365,366);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
361,"W",15,"geleistete Stunden pro Tag (Mitarbeiter)","A4hoch",1,"TblMitaProjUebersicht","PZ_EZSTD.RPT",0,0,0,0,"","2017-12-05-00.00.00.000000"
362,"L",20,"(2017) Zahlungsanw. Zusatzleistungen","A4hoch",1,"TblUKonto","ZANNZ.RTX",0,0,768,0,"","2017-12-11-00.00.00.000000"
363,"L",21,"(2017) Zahlungsanw. Schlussrechnung","A4hoch",1,"TblUKonto","ZANNS.RTX",0,0,768,0,"","2017-12-11-00.00.00.000000"
364,"L",22,"(2017) Zahlungsanw. Teilrechnung (Abschlag)","A4hoch",1,"TblUKonto","ZANNT.RTX",0,0,768,0,"","2017-12-11-00.00.00.000000"
365,"L",23,"(2017) Auszahlung Sicherheitseinbehalt","A4hoch",1,"TblUKonto","ZANNSI.RTX",0,0,768,0,"","2017-12-11-00.00.00.000000"
366,"L",27,"(2017) Bürgschaftserklärung","A4hoch",1,"TblUKonto","ZANNB.RTX",0,0,768,0,"","2017-12-11-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.17.07', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.17.08
*****************************************************************************
/

DELETE FROM ie_notiz WHERE d_notiz_datum IS NULL;
ALTER TABLE ie_notiz ADD i_notiz_jahr INTEGER NOT NULL WITH DEFAULT;

DROP INDEX in_notiz1;
CREATE INDEX in_notiz1 ON ie_notiz (
  i_notiz_jahr, @YEARNO(d_notiz_datum)
 ) PCTFREE 10;

UPDATE ie_notiz SET i_notiz_jahr = @YEARNO(d_notiz_datum);
UPDATE version SET c_vers_version = '20.17.08', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.17.09
*****************************************************************************
/

ALTER TABLE ie_zeit ADD i_zeit_groupid INTEGER NOT NULL WITH DEFAULT;
UPDATE version SET c_vers_version = '20.17.09', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.18.01
*****************************************************************************
/

CREATE TABLE ie_gobd  (
  k_i_gobd_nummer      INTEGER NOT NULL,
  k_i_nummer           INTEGER NOT NULL,
    i_proj_nummer      INTEGER NOT NULL WITH DEFAULT,
    i_lvs_nummer       INTEGER NOT NULL WITH DEFAULT,
    d_gobd_datum       DATETIME,
    c_gobd_art         CHAR(40),
	c_gobd_datei       CHAR(250),
	c_gobd_key         CHAR(200),
	c_gobd_bemerk      CHAR(250),
    i_user_nummer      INTEGER NOT NULL WITH DEFAULT,
    l_gobd_dokument    LONG
) PCTFREE 10;

DROP INDEX ui_gobd;
CREATE UNIQUE INDEX ui_gobd ON ie_gobd (
  k_i_gobd_nummer
 ) PCTFREE 10;
 
DROP INDEX ui_gobd1;
CREATE UNIQUE INDEX ui_gobd1 ON ie_gobd (
  c_gobd_key
 ) PCTFREE 10;

DROP INDEX in_gobd1;
CREATE INDEX in_gobd1 ON ie_gobd (
  k_i_nummer, i_proj_nummer, i_lvs_nummer, c_gobd_art
 ) PCTFREE 10;

ALTER TABLE pe_prjan ADD r_prjan_wagnisb DOUBLE PRECISION  NOT NULL WITH DEFAULT; 
ALTER TABLE pe_prjan ADD r_prjan_wagnisl DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD i_prjan_status INTEGER  NOT NULL WITH DEFAULT;
ALTER TABLE pe_prjan ADD l_prjan_protokoll LONG; 

CREATE TABLE se_ads (
  k_i_adr_nummer       INTEGER           NOT NULL, 
    c_adr_kurz         CHAR(20),
    c_adr_titel        CHAR(20),
    c_adr_anrede1      CHAR(40),
    c_adr_anrede2      CHAR(40),
    c_adr_vorname      CHAR(40),
    c_adr_name1        CHAR(40),
    c_adr_name2        CHAR(40),
    i_adr_post         INTEGER           NOT NULL WITH DEFAULT,
    i_adr_status       INTEGER           NOT NULL WITH DEFAULT,
    i_adr_import       INTEGER           NOT NULL WITH DEFAULT,
    i_adr_sepa         INTEGER           NOT NULL WITH DEFAULT,
    c_adr_strasse      CHAR(40),
    c_adr_plz          CHAR(20), 
    c_adr_ort          CHAR(40),
    c_adr_plzpostfach  CHAR(20), 
    c_adr_postfach     CHAR(20),
    c_adr_land         CHAR(40),   
    r_adr_lat          DOUBLE PRECISION,
    r_adr_lon          DOUBLE PRECISION,
    c_adr_tel1         CHAR(20),
    c_adr_tel2         CHAR(20),
    c_adr_fax          CHAR(20),
    c_adr_btx          CHAR(40),
    c_adr_iban         CHAR(50),
    c_adr_bic          CHAR(50),
    c_adr_homepage     CHAR(250),
    c_adr_staat        CHAR(2),
    l_adr_bemerk       LONG,
    c_adr_fkz          CHAR(1),
    c_adr_bank         CHAR(40),
    c_adr_blz          CHAR(20),
    c_adr_kontonr      CHAR(20),
    c_adr_kundnr       CHAR(10),
    c_adr_notiz1       CHAR(40),
    c_adr_notiz2       CHAR(40),
    c_adr_notiz3       CHAR(40),
    d_adr_wvdatum      DATETIME,
    d_adr_wverstkon    DATETIME,
    c_adr_wvbearb      CHAR(16),
    c_adr_wverstkon    CHAR(160),
    c_adr_wvgrund      CHAR(160),
    c_adr_steuerid     CHAR(40),
    c_adr_finanzamt    CHAR(40),
    c_adr_eibenr       CHAR(40),
    c_adr_ustidnr      CHAR(40),
    i_adr_freistell    INTEGER           NOT NULL WITH DEFAULT,
    d_adr_freistell    DATE,
    d_adr_impneu       DATETIME,
    d_adr_aenddat      DATETIME          NOT NULL WITH DEFAULT
) PCTFREE 10;

DELETE FROM ie_adra WHERE k_i_adr_nummer = 0;

UPDATE version SET c_vers_version = '20.18.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.18.02
*****************************************************************************
/

ALTER TABLE pe_kst ADD i_kst_skontom INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_kstn ADD i_kstn_skontom INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.18.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.18.03
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (367,386,1120);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
367,"L",4,"Adressliste individuell (Basis)","A4quer",1,"TblAdressAL","ADRINDI.RTX",0,0,0,0,"",2018-11-08-00.00.00.000000
368,"L",4,"Adressliste individuell (Basis Projekt)","A4quer",1,"FrmProjektBF","ADRINDIP.RTX",0,0,0,0,"",2018-11-08-00.00.00.000000
1120,"W",20,"REB-Mengen Arbeitspaket Kurzform","A4hoch",2,"TblAPPosAL","PS_MRAPH.RPT",0,0,4,0,"",2018-11-30-00.00.00.000000
/;

DROP INDEX ui_mer1;
DROP INDEX in_mer4;
CREATE INDEX in_mer4     ON pe_mer (
  c_mer_blatt_nr, k_i_proj_nummer
) PCTFREE 10;

UPDATE version SET c_vers_version = '20.18.03', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.18.04
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (1121);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
1121,"W",21,"integrierte REB-Blätter Arbeitspaket Kurzform","A4hoch",2,"TblAPPosAL","PS_MRAPI.RPT",0,0,4,0,"",2019-01-11-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.18.04', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.18.05
*****************************************************************************
/

UPDATE ie_ral SET c_ral_eingang = 'A' WHERE c_ral_eingang IS NULL;
UPDATE ie_ral SET c_ral_kenn = 'X' WHERE c_ral_eingang = 'E';
UPDATE ie_ral SET i_proj_nummer=0 WHERE c_ral_eingang = 'A' AND c_ral_kenn = 'D';

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (1122);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
1122,"W",1,"Rechnungseingangsliste","A4quer",2,"TblRechEinEL","PC_REINL.RPT",0,0,256,0,"",2019-03-05-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.18.05', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.18.06
*****************************************************************************
/

ALTER TABLE pe_ikst ADD c_ikst_importkey CHAR(100);
UPDATE version SET c_vers_version = '20.18.06', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.18.07
*****************************************************************************
/

CREATE TABLE pe_terg (
  k_i_terg_nummer      INTEGER           NOT NULL,
  k_i_proj_nummer      INTEGER           NOT NULL,
  k_i_lvs_nummer       INTEGER           NOT NULL,
  k_i_tit_nummer       INTEGER           NOT NULL,
  k_i_lpo_nummer       INTEGER           NOT NULL,
    i_terg_lfd         INTEGER           NOT NULL,
    c_terg_kenn        CHAR(20),
    c_terg_vor         CHAR(250),
	c_terg_haupt       CHAR(250),
	c_terg_org         CHAR(250),
    c_terg_nach        CHAR(250),
    i_terg_lock        INTEGER           NOT NULL WITH DEFAULT,
    d_terg_aenddat     DATETIME          NOT NULL WITH DEFAULT
) PCTFREE 10;

DROP INDEX ui_terg;
DROP INDEX in_terg;
CREATE UNIQUE INDEX ui_terg ON pe_terg ( k_i_terg_nummer, k_i_proj_nummer) PCTFREE 10;
CREATE INDEX in_terg ON pe_terg ( k_i_terg_nummer, k_i_proj_nummer, k_i_lvs_nummer, k_i_tit_nummer, k_i_lpo_nummer) PCTFREE 10;
ALTER TABLE pe_terg ADD c_terg_org CHAR(250);

UPDATE version SET c_vers_version = '20.18.07', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.19.01
*****************************************************************************
/

ALTER TABLE pe_terg ADD c_terg_org CHAR(250);
DROP INDEX ui_terg;
DROP INDEX in_terg;
CREATE UNIQUE INDEX ui_terg ON pe_terg ( k_i_terg_nummer, k_i_proj_nummer) PCTFREE 10;
CREATE INDEX in_terg ON pe_terg ( k_i_terg_nummer, k_i_proj_nummer, k_i_lvs_nummer, k_i_tit_nummer, k_i_lpo_nummer) PCTFREE 10;

CREATE TABLE pb_biet_terg (
  k_i_terg_nummer      INTEGER           NOT NULL,
  k_i_proj_nummer      INTEGER           NOT NULL,
  k_i_biet_nummer      INTEGER           NOT NULL,
  k_i_lvs_nummer       INTEGER           NOT NULL,
    c_terg_bieter      CHAR(250)
) PCTFREE 10;

DROP INDEX in_tergb;
CREATE INDEX in_tergb ON pb_biet_terg ( k_i_proj_nummer, k_i_terg_nummer, k_i_biet_nummer) PCTFREE 10;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (369);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
369,"W",7,"Positionen-Vergl. mit Textergänzungen","A4hoch",1,"TblPrsBieter","PA_PRS21.RPT",0,0,256,0,"","2019-07-04-00.00.00.000000"
/;

DROP INDEX in_proj2;
CREATE INDEX in_proj2 ON ie_proj (
  i_man_nummer, k_i_proj_nummer, c_proj_projdb
 ) PCTFREE 10;


UPDATE version SET c_vers_version = '20.19.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.19.02
*****************************************************************************
/

ALTER TABLE pe_biet ADD i_biet_ignore INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_biet ADD i_biet_epersatz INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_apk ADD i_apk_fertig INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_apk ADD i_apk_farbe INTEGER NOT NULL WITH DEFAULT;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (128);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
128,"W",8,"Leistungsstand Rechnung - aktuell","A4hoch",1,"FrmPosAL","pc_leiak.rpt",0,0,261,0,"","2019-09-09-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.19.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.19.03
*****************************************************************************
/
ALTER TABLE pe_ikst ADD c_ikst_gobdkey CHAR(200);

UPDATE version SET c_vers_version = '20.19.03', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.19.04
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (268);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
268,"W",13,"Differenzliste für die Stempelzeitverteilung","A4hoch",1,"TblMitaProjUebersichtAuftrag","PZ_DZEIT.RPT",0,0,10,0,"","2019-10-28-00.00.00.000000"
/;
UPDATE ie_urpt SET i_urpt_dialog=10 WHERE i_rpt_nummer=268;
UPDATE ie_urpt SET i_urpt_dialog=261 WHERE i_rpt_nummer=128;

UPDATE version SET c_vers_version = '20.19.04', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.19.05
*****************************************************************************
/
DROP INDEX in_mir1;
CREATE        INDEX in_mir1   ON pe_mir (
  k_i_proj_nummer, i_grp_nummer, i_idx_nummer
) PCTFREE 10;

DROP INDEX in_appauft1;
CREATE INDEX in_appauft1 ON pb_app_auft ( 
   k_i_proj_nummer, k_i_auft_nummer, k_i_app_nummer
) PCTFREE 10;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (370);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
370,"W",1,"Bieter-Textergänzungen","A4hoch",1,"TblPrsBieter","PA_BTERG.RPT",0,0,256,0,"","2019-11-13-00.00.00.000000"
/;

ALTER TABLE pe_apk ADD c_apk_hasenbein CHAR(100);

UPDATE version SET c_vers_version = '20.19.05', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.19.06
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zum Anpassen der Textergänzungen in pe_terg, pb_biet_terg
FUNCTION#UP_PE_TERG
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.19.06', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.19.07
*****************************************************************************
/
DROP VIEW sv_mitaadr;
CREATE VIEW sv_mitaadr (k_i_adr_nummer, k_i_mita_nummer, c_adr_vorname, c_mita_name, c_mita_persnr, i_mita_status, i_mita_mobil, i_mita_pwdreset, i_phase_nummer,
       i_mita_usermits, r_mita_prodkst, i_mita_lohnart, c_adr_tel1, c_adr_btx, c_mita_qualif, c_mita_notiz1, c_mita_notiz2, c_mita_notiz3,
       c_adr_strasse, c_adr_plz, c_adr_ort, c_mita_komplett, c_mita_abteilung, d_mita_aenddat) AS
SELECT k_i_adr_nummer, k_i_mita_nummer, c_adr_vorname, c_mita_name, c_mita_persnr, i_mita_status, i_mita_mobil, i_mita_pwdreset, i_phase_nummer,
       i_mita_usermits, r_mita_prodkst, i_mita_lohnart, c_adr_tel1, c_adr_btx, c_mita_qualif, c_mita_notiz1, c_mita_notiz2, c_mita_notiz3,
       c_adr_strasse, c_adr_plz, c_adr_ort, c_mita_name || ', ' || c_adr_vorname || ' [' || c_mita_persnr || ']', c_mita_abteilung, d_mita_aenddat
FROM se_mita, se_adr
WHERE i_adr_nummer = k_i_adr_nummer(+);

UPDATE version SET c_vers_version = '20.19.07', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.19.08
*****************************************************************************
/
DROP VIEW sv_mita_std;
CREATE VIEW sv_mita_std (k_i_proj_nummer, i_lvs_nummer, i_mita_nummer, i_mist_jahr, i_mist_kw, leiharbeiter, summe) AS
SELECT ie_mist.k_i_proj_nummer, i_lvs_nummer, i_mita_nummer, i_mist_jahr, i_mist_kw, @IF(i_mita_lohnart+1,0,1), SUM(r_mist_mo+r_mist_di+r_mist_mi+r_mist_do+r_mist_fr+r_mist_sa+r_mist_so) 
  FROM ie_mist, pe_apk, se_mita
 WHERE ie_mist.k_i_proj_nummer=pe_apk.k_i_proj_nummer
   AND ie_mist.i_apk_nummer = pe_apk.k_i_apk_nummer
   AND se_mita.k_i_mita_nummer = ie_mist.i_mita_nummer
   AND ie_mist.k_i_proj_nummer != 0
   AND ie_mist.i_apk_nummer != 0
   AND pe_apk.i_lvs_nummer >= 0
 GROUP BY ie_mist.k_i_proj_nummer,pe_apk.i_lvs_nummer, ie_mist.i_mita_nummer, i_mist_jahr, i_mist_kw, i_mita_lohnart;

UPDATE version SET c_vers_version = '20.19.08', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.19.09
*****************************************************************************
/
CREATE TABLE pe_hase (
    k_i_hase_nummer   INTEGER NOT NULL,
    k_i_proj_nummer   INTEGER NOT NULL,
	i_lvs_nummer      INTEGER NOT NULL WITH DEFAULT,
	i_lpo_nummer      INTEGER NOT NULL WITH DEFAULT,
    i_app_nummer      INTEGER NOT NULL WITH DEFAULT,
    i_apk_nummer      INTEGER NOT NULL WITH DEFAULT,
    i_hase_delete     INTEGER,
	c_hase_haus       CHAR(100),
	c_hase_hausid     CHAR(20),
    c_hase_geschoss   CHAR(100),
	c_hase_geschossid CHAR(20),
	c_hase_gewerknr   CHAR(20), 
	c_hase_gewerkbez  CHAR(100),
	c_hase_titelnr    CHAR(20), 
	c_hase_titelbez   CHAR(100),
	c_hase_posnr      CHAR(20), 
	c_hase_postext    CHAR(250),
	r_hase_menge      DOUBLE PRECISION NOT NULL WITH DEFAULT,
	c_hase_einh       CHAR(4), 
	r_hase_preis      DOUBLE PRECISION NOT NULL WITH DEFAULT,
    d_hase_import     DATETIME NOT NULL WITH DEFAULT
 ) PCTFREE 10; 
 
DROP INDEX ui_hase;
CREATE UNIQUE INDEX ui_hase ON pe_hase ( k_i_proj_nummer, k_i_hase_nummer, c_hase_hausid, c_hase_geschossid, c_hase_posnr) PCTFREE 10;

DROP INDEX in_apkhas;
CREATE INDEX in_apkhas ON pe_apk ( k_i_proj_nummer, c_apk_hasenbein) PCTFREE 10;

UPDATE version SET c_vers_version = '20.19.09', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.19.10
*****************************************************************************
/

ALTER TABLE PE_HASE ADD i_hase_delete INTEGER;
ALTER TABLE se_ein ADD c_ein_code CHAR(3);
ALTER TABLE ie_kund ADD c_kund_leitweg_id CHAR(40); 
ALTER TABLE sb_artl_labe ADD c_artl_labe_bem CHAR(250);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (62,371,372,373,374,375,376);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
62,"L",10,"Zahlungsanweisung Zusatzleistungen","A4hoch",1,"TblUKonto","ZANWTEIL.RTX",0,0,768,0,"","2020-04-09-00.00.00.000000"
371,"W",1,"Stundenübersicht Mitarbeiter / Monat","A4quer",1,"FrmPruefListe","PW_MOMA.RPT",0,0,256,0,"","2020-03-27-00.00.00.000000"
372,"W",13,"Monatskontrollsummen","A4hoch",1,"TblPWMitaProjUebersicht","PW_KONT.RPT",0,0,256,0,"","2020-03-27-00.00.00.000000"
373,"W",1,"Bürgschaftsdaten ausführlich","A4quer",1,"TblPCBuergAL","PC_BUERG.RPT",0,0,0,0,"","2020-04-09-00.00.00.000000"
374,"L",2,"Bürgschafts-Anschreiben","A4hoch",1,"FrmPCBuergBF","BUERG1PC.RTX",0,0,768,0,"","2020-04-17-00.00.00.000000"
375,"W",2,"Bürgschaftsdaten Übersicht","A4quer",1,"TblPCBuergAL","PC_BUER1.RPT",0,0,0,0,"","2020-04-09-00.00.00.000000"
376,"W",1,"Protokoll Mengenübernahme Hasenbein PLUS","A4quer",1,"TblAPKHasenbein","PC_HASE1.RPT",0,0,0,0,"","2020-06-18-00.00.00.000000"
/;

DROP VIEW sv_artl_labe;
CREATE VIEW sv_artl_labe (
  k_i_labe_nummer,
  k_i_man_nummer,
    i_artl_labe_lfd,
    r_artl_labe_menge,
	c_artl_labe_bem,
    c_lagart_ort,
    c_lagart_zeile,
    c_lagart_zone,
    c_lagart_fach,
    c_artl_kurztext,
    c_artl_dn_bez1,
    c_artl_dn_bez2,
    c_artl_einheit,
    r_artl_lpreis)
AS SELECT 
    sb_artl_labe.k_i_labe_nummer, sb_artl_labe.k_i_man_nummer,
    sb_artl_labe.i_artl_labe_lfd, sb_artl_labe.r_artl_labe_menge, sb_artl_labe.c_artl_labe_bem,
    se_lagart.c_lagart_ort,
    se_lagart.c_lagart_zeile, se_lagart.c_lagart_zone, se_lagart.c_lagart_fach,
    se_artl.c_artl_kurztext, se_artl.c_artl_dn_bez1, se_artl.c_artl_dn_bez2,
    se_artl.c_artl_einheit, se_artl.r_artl_lpreis
FROM sb_artl_labe, se_lagart, se_artl
WHERE sb_artl_labe.k_i_man_nummer  = se_lagart.k_i_man_nummer(+)
  AND sb_artl_labe.k_i_man_nummer  = se_artl.k_i_man_nummer
  AND sb_artl_labe.i_lagart_nummer = se_lagart.k_i_lagart_nummer(+)
  AND sb_artl_labe.k_i_artl_nummer  = se_artl.k_i_artl_nummer;
  
UPDATE version SET c_vers_version = '20.19.10', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.01
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zum Eintragen des KALL-Tools Servers in der Parametertabelle
FUNCTION#UP_KALLTOOLS
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.20.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.02
*****************************************************************************
/

ALTER TABLE PE_HASE ADD i_hase_delete INTEGER;
ALTER TABLE se_ein ADD c_ein_code CHAR(3);
ALTER TABLE ie_kund ADD c_kund_leitweg_id CHAR(40); 
ALTER TABLE sb_artl_labe ADD c_artl_labe_bem CHAR(250);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (62,371,372,373,374,375,376);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
62,"L",10,"Zahlungsanweisung Zusatzleistungen","A4hoch",1,"TblUKonto","ZANWTEIL.RTX",0,0,768,0,"","2020-04-09-00.00.00.000000"
371,"W",1,"Stundenübersicht Mitarbeiter / Monat","A4quer",1,"FrmPruefListe","PW_MOMA.RPT",0,0,256,0,"","2020-03-27-00.00.00.000000"
372,"W",13,"Monatskontrollsummen","A4hoch",1,"TblPWMitaProjUebersicht","PW_KONT.RPT",0,0,256,0,"","2020-03-27-00.00.00.000000"
373,"W",1,"Bürgschaftsdaten ausführlich","A4quer",1,"TblPCBuergAL","PC_BUERG.RPT",0,0,0,0,"","2020-04-09-00.00.00.000000"
374,"L",2,"Bürgschafts-Anschreiben","A4hoch",1,"FrmPCBuergBF","BUERG1PC.RTX",0,0,768,0,"","2020-04-17-00.00.00.000000"
375,"W",2,"Bürgschaftsdaten Übersicht","A4quer",1,"TblPCBuergAL","PC_BUER1.RPT",0,0,0,0,"","2020-04-09-00.00.00.000000"
376,"W",1,"Protokoll Mengenübernahme Hasenbein PLUS","A4quer",1,"TblAPKHasenbein","PC_HASE1.RPT",0,0,0,0,"","2020-06-18-00.00.00.000000"
/;

DROP VIEW sv_artl_labe;
CREATE VIEW sv_artl_labe (
  k_i_labe_nummer,
  k_i_man_nummer,
    i_artl_labe_lfd,
    r_artl_labe_menge,
	c_artl_labe_bem,
    c_lagart_ort,
    c_lagart_zeile,
    c_lagart_zone,
    c_lagart_fach,
    c_artl_kurztext,
    c_artl_dn_bez1,
    c_artl_dn_bez2,
    c_artl_einheit,
    r_artl_lpreis)
AS SELECT 
    sb_artl_labe.k_i_labe_nummer, sb_artl_labe.k_i_man_nummer,
    sb_artl_labe.i_artl_labe_lfd, sb_artl_labe.r_artl_labe_menge, sb_artl_labe.c_artl_labe_bem,
    se_lagart.c_lagart_ort,
    se_lagart.c_lagart_zeile, se_lagart.c_lagart_zone, se_lagart.c_lagart_fach,
    se_artl.c_artl_kurztext, se_artl.c_artl_dn_bez1, se_artl.c_artl_dn_bez2,
    se_artl.c_artl_einheit, se_artl.r_artl_lpreis
FROM sb_artl_labe, se_lagart, se_artl
WHERE sb_artl_labe.k_i_man_nummer  = se_lagart.k_i_man_nummer(+)
  AND sb_artl_labe.k_i_man_nummer  = se_artl.k_i_man_nummer
  AND sb_artl_labe.i_lagart_nummer = se_lagart.k_i_lagart_nummer(+)
  AND sb_artl_labe.k_i_artl_nummer  = se_artl.k_i_artl_nummer;
  
UPDATE version SET c_vers_version = '20.20.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.03
*****************************************************************************
/
DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (377,378);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
377,"L",28,"(NEU) Zahlungsanw. Teilrechnung (Abschlag einzel MwSt)","A4hoch",1,"TblUKonto","ZANNTE.RTX",0,0,768,0,"","2020-09-07-00.00.00.000000"
378,"L",18,"Zahlungsanw. Teilrechnung (Abschlag einzel MwSt)","A4hoch",1,"TblNUKonto","ZANWNE.RTX",0,0,768,0,"","2020-09-07-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.20.03', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.04
*****************************************************************************
/
ALTER TABLE ie_man ADD c_man_adressfeld CHAR(250);

UPDATE version SET c_vers_version = '20.20.04', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.05
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zum Aktualisieren der Dialog-Nummern in ie_rpt und ie_urpt
FUNCTION#UP_RPTDLG
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.20.05', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.06
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zum Aktualisieren der WebService Einträge
FUNCTION#UP_KALLTOOLS
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.20.06', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.07
*****************************************************************************
/

ALTER TABLE ie_proj ADD i_proj_rahmen INTEGER NOT NULL WITH DEFAULT;
UPDATE ie_proj SET i_proj_rahmen = 1, c_proj_kstelle = '' WHERE c_proj_kstelle = 'TB_RAHMEN';

UPDATE version SET c_vers_version = '20.20.07', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.08
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (379, 1123);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
379,"W",10,"Auswertung mit Summen - Soll/Ist","A4quer",2,"TblMitaUebersicht","PZ_AMP2.RPT",0,0,0,0,"","2021-01-27-00.00.00.000000"
1123,"W",1,"Lagerartikel Inventurliste","A4hoch",1,"TblLagArtAL","PL_LAINV.RPT",0,0,0,0,"",2021-02-02-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.20.08', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.09
*****************************************************************************
/

ALTER TABLE ie_para ADD i_proj_nummer INTEGER NOT NULL WITH DEFAULT;
UPDATE version SET c_vers_version = '20.20.09', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.10
*****************************************************************************
/

ALTER TABLE pe_lvs ADD d_lvs_vbuerg DATE;
ALTER TABLE pe_lvs ADD r_lvs_vbuerg DOUBLE PRECISION NOT NULL WITH DEFAULT;
DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (380);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
380,"L",30,"Positionen Soll/Ist-Vergleich mit Titelstruktur","A4hoch",1,"FrmPosAL","POSKSI.RTX",0,0,0,0,"","2021-02-17-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.20.10', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.20.11
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zum Aktualisieren der WebService Einträge
FUNCTION#UP_KALLTOOLS
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.20.11', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.21.01
*****************************************************************************
/

ALTER TABLE se_art MODIFY c_art_dn_alt_nr CHAR(30);
ALTER TABLE pe_art MODIFY c_art_dn_alt_nr CHAR(30);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (381);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
381,"W",1,"Schluss-Rechnungs-Aufstellung Projekte","A4quer",1,"TblProjektAL","TB_PROSR.RPT",0,0,0,0,"","2021-06-16-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.21.01', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.21.02
*****************************************************************************
/

ALTER TABLE se_art ADD r_art_zb DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE se_art ADD r_art_zv DOUBLE PRECISION  NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.21.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.21.03
*****************************************************************************
/

ALTER TABLE pe_apk ADD i_apk_mobil INTEGER NOT NULL WITH DEFAULT;

CREATE TABLE tt_alter (
  k_i_proj_nummer      INTEGER           NOT NULL,
  k_i_lvs_nummer       INTEGER           NOT NULL,
    i_biet_nummer      INTEGER           NOT NULL,
    r_biet_grundp      DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    r_biet_alterp      DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    c_biet_alter       LONG VARCHAR
) PCTFREE 10;
INSERT INTO tt_alter SELECT * FROM te_alter;
DROP TABLE te_alter;
ALTER TABLE tt_alter RENAME TABLE te_alter;

DROP TABLE te_altu;

UPDATE version SET c_vers_version = '20.21.03', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.21.04
*****************************************************************************
/

ALTER TABLE pe_apk ADD i_apk_mobil INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.21.04', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.21.05
*****************************************************************************
/

ALTER TABLE pe_prjpp ADD r_prjpp_nettoang DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE ie_proj ADD r_proj_rgesstd DOUBLE PRECISION NOT NULL WITH DEFAULT;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (382);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
382,"W",2,"Kostenstellenauswertung Summen und Stand der Baustellen","A4quer",1,"TblProjektAL","PC_PUEB1.RPT",0,0,0,0,"",2022-02-04-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.21.05', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.21.06
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (383);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
383,"W",1,"Bautagebücher","A4hoch",1,"TblBauTagebuch","PA_BAUT.RPT",0,0,0,0,"",2022-03-11-00.00.00.000000
/;

CREATE TABLE pe_baut (
  k_i_baut_nummer      INTEGER           NOT NULL,
  k_i_proj_nummer      INTEGER           NOT NULL,
  k_i_lvs_nummer       INTEGER           NOT NULL,
    i_adr_nummer       INTEGER           NOT NULL,
    d_baut_tag         DATE,
    c_baut_wetter      CHAR(50),
    r_baut_temp        DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    c_baut_aufsteller  CHAR(250),
    i_user_nummer      INTEGER           NOT NULL WITH DEFAULT,
    i_user_aufstell    INTEGER           NOT NULL WITH DEFAULT,
    i_baut_status      INTEGER           NOT NULL WITH DEFAULT,
    d_baut_erstellt    DATE,
    d_baut_pruef       DATE,
    d_baut_aenddat     DATETIME
) PCTFREE 10;

CREATE TABLE pb_bbau (
  k_i_bbau_nummer      INTEGER           NOT NULL,
  k_i_baut_nummer      INTEGER           NOT NULL,
  k_i_proj_nummer      INTEGER           NOT NULL,
    c_bbau_kat         CHAR(50),
    c_bbau_einh        CHAR(4),
	c_bbau_ktext       CHAR(50),
    c_bbau_text        CHAR(250),
	c_bbau_von         CHAR(5),
	c_bbau_bis         CHAR(5),
    r_bbau_menge       DOUBLE PRECISION  NOT NULL WITH DEFAULT,
    i_bbau_aufsicht    INTEGER           NOT NULL WITH DEFAULT,
    i_bbau_vorarb      INTEGER           NOT NULL WITH DEFAULT,
    i_bbau_facharb     INTEGER           NOT NULL WITH DEFAULT,
    i_bbau_maschin     INTEGER           NOT NULL WITH DEFAULT,
    i_bbau_sonst       INTEGER           NOT NULL WITH DEFAULT,
	l_bbau_dok         LONG,
    d_bbau_aenddat     DATETIME
) PCTFREE 10;

DROP INDEX ui_baut;
CREATE UNIQUE INDEX ui_baut ON pe_baut ( k_i_proj_nummer, k_i_baut_nummer ) PCTFREE 10;

DROP INDEX in_bbau;
CREATE INDEX in_bbau ON pb_bbau ( k_i_proj_nummer, k_i_baut_nummer, c_bbau_kat ) PCTFREE 10;

DROP INDEX ui_bbau;
CREATE UNIQUE INDEX ui_bbau ON pb_bbau ( k_i_bbau_nummer ) PCTFREE 10;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (1124);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
1124,"W",1,"Korrekturblatt Mengenänderung","A4hoch",2,"TblAuswertungAL","PC_KBLA1.RPT",0,0,5,0,"",2022-04-12-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.21.06', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.21.07
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zum Aktualisieren der WebService Einträge
FUNCTION#UP_HASECODE
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.21.07', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.22.01
*****************************************************************************
/
ALTER TABLE pe_baut ADD i_baut_hinweis INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE pe_baut ADD i_baut_doks INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE se_ger ADD d_ger_anschaff DATE;
ALTER TABLE pe_tit ADD c_tit_bemerk CHAR(250);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (360,384);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
360,"W",6,"Soll/Abrechnungs-Vergleich mit Titelsummen","A4quer",1,"FrmPosAL","PA_POSRI.RPT",0,0,278,0,"","2017-11-21-00.00.00.000000"
384,"L",29,"(NEU) Auszahlung Teilsicherheitseinbehalt","A4hoch",1,"TblUKonto","ZANATS.RTX",0,0,768,0,"","2022-08-09-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.22.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.22.02
*****************************************************************************
/
ALTER TABLE pe_lpo ADD i_lpo_umlagetit INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.22.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.22.03
*****************************************************************************
/
ALTER TABLE ab_korb_art ADD c_art_schleupennr CHAR(40);

UPDATE version SET c_vers_version = '20.22.03', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.22.04
*****************************************************************************
/
DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (385);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
385,"W",11,"Rechnungsaufmaß mit Verteilung","A4hoch",1,"TblAPPosAL","PS_RAUFG.RPT",0,0,14,0,"","2023-02-03-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.22.04', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.22.05
*****************************************************************************
/
ALTER TABLE pe_stlb ADD l_stlb_gaebxml LONG;

UPDATE version SET c_vers_version = '20.22.05', d_vers_aenddat = SYSDATETIME;


REMARK
\
*****************************************************************************
DB-VERSION: 20.23.01
*****************************************************************************
/
DROP TABLE te_druck;
CREATE TABLE te_druck (
     i_druck_pid        INTEGER NOT NULL,
     i_druck_datenart   INTEGER NOT NULL,
     i_druck_lfd        INTEGER NOT NULL,
     i_tit_nummer       INTEGER NOT NULL WITH DEFAULT,
     i_lpo_nummer       INTEGER NOT NULL WITH DEFAULT,
     d_druck_datum      DATE,
     c_druck_lpoart     CHAR(8),
     c_druck_10_1       CHAR(254),
     c_druck_20_1       CHAR(254),
     c_druck_40_1       CHAR(254),
     c_druck_40_2       CHAR(254),
     c_druck_40_3       CHAR(254),
     c_druck_40_4       CHAR(254),
     c_druck_40_5       CHAR(254),
     c_druck_40_6       CHAR(254),
     c_druck_40_7       CHAR(254),
     c_druck_40_8       CHAR(254),
     c_druck_40_9       CHAR(254),
     c_druck_40_10      CHAR(254),
     c_druck_40_11      CHAR(254),
     c_druck_40_12      CHAR(254),
     c_druck_40_13      CHAR(254),
     c_druck_40_14      CHAR(254),
     c_druck_40_15      CHAR(254),
     c_druck_40_16      CHAR(254),
     c_druck_40_17      CHAR(254),
     c_druck_40_18      CHAR(254),
     c_druck_40_19      CHAR(254),
     c_druck_40_20      CHAR(254),
     c_druck_50_1       CHAR(254),
     c_druck_50_2       CHAR(254),
     c_druck_50_3       CHAR(254),
     c_druck_50_4       CHAR(254),
     c_druck_50_5       CHAR(254),
     c_druck_50_6       CHAR(254),
     c_druck_50_7       CHAR(254),
     c_druck_50_8       CHAR(254),
     c_druck_50_9       CHAR(254),
     c_druck_50_10      CHAR(254),
     c_druck_50_11      CHAR(254),
     c_druck_50_12      CHAR(254),
     c_druck_50_13      CHAR(254),
     c_druck_50_14      CHAR(254),
     c_druck_50_15      CHAR(254),
     c_druck_50_16      CHAR(254),
     c_druck_50_17      CHAR(254),
     c_druck_50_18      CHAR(254),
     c_druck_50_19      CHAR(254),
     c_druck_50_20      CHAR(254),
     c_druck_254_1      CHAR(254),
     c_druck_254_2      CHAR(254),
     l_druck_1          LONG,
     i_druck_1          INTEGER NOT NULL WITH DEFAULT,
     i_druck_2          INTEGER NOT NULL WITH DEFAULT,
     i_druck_3          INTEGER NOT NULL WITH DEFAULT,
     i_druck_4          INTEGER NOT NULL WITH DEFAULT,
     i_druck_5          INTEGER NOT NULL WITH DEFAULT,
     i_druck_6          INTEGER NOT NULL WITH DEFAULT,
     i_druck_7          INTEGER NOT NULL WITH DEFAULT,
     i_druck_8          INTEGER NOT NULL WITH DEFAULT,
     i_druck_9          INTEGER NOT NULL WITH DEFAULT,
     r_druck_1          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_2          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_3          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_4          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_5          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_6          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_7          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_8          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_9          DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_10         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_11         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_12         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_13         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_14         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_15         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_16         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_17         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_18         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_19         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_20         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_21         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_22         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_23         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_24         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_25         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_26         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_27         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_28         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_29         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_30         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_31         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_32         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_33         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_34         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_35         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_36         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     r_druck_37         DOUBLE PRECISION  NOT NULL WITH DEFAULT,
     d_druck_aenddat    DATETIME  NOT NULL WITH DEFAULT
) PCTFREE 10;

ALTER TABLE se_adr ADD i_adr_bauleist INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE se_adr ADD d_adr_bauleist DATE;
ALTER TABLE se_adr ADD c_adr_bauleist CHAR(40);

UPDATE version SET c_vers_version = '20.23.01', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.23.02
*****************************************************************************
/
DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (386,387);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
386,"W",1,"EFB 222 Kalk. ü. Endsumme (Bewertung auf Stunden)","A4hoch",1,"FrmAngebot","PC_EF22a.RPT",0,0,256,0,"",2023-08-11-00.00.00.000000
387,"W",1,"EFB 221 Kalk. ü. Zuschlag (Bewertung auf Stunden)","A4hoch",1,"FrmAngebot","PC_EF21a.RPT",0,0,256,0,"",2023-08-11-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.23.02', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.23.03
*****************************************************************************
/
ALTER TABLE ie_pparam MODIFY c_pparam_modul CHAR(50), c_pparam_var CHAR(50);
DROP INDEX in_ppar;
CREATE INDEX in_ppar ON ie_pparam (@UPPER(c_pparam_modul), @UPPER(c_pparam_var)) PCTFREE 10;

ALTER TABLE pe_tit ADD r_tit_sgesstd    DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_tit ADD r_tit_sgeslohn   DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_tit ADD r_tit_sgesschal  DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_tit ADD r_tit_sgesstoff  DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_tit ADD r_tit_sgesmasch  DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_tit ADD r_tit_sgesfremd1 DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_tit ADD r_tit_sgesfremd2 DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_tit ADD r_tit_sgesfremd3 DOUBLE PRECISION  NOT NULL WITH DEFAULT;
ALTER TABLE pe_tit ADD r_tit_sgesprod   DOUBLE PRECISION  NOT NULL WITH DEFAULT;

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (325,388,389);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
325,"W",1,"Schriftverkehr mit WV und Adresse","A4hoch",1,"TblSchriftverkehrAL","TB_SVAJ.RPT",0,0,0,0,"",2012-03-19-00.00.00.000000
388,"W",10,"Angebotsblatt Titel","A4hoch",1,"FrmAngebot","PM_ANGTB.RPT",0,0,256,0,"","2023-10-31-00.00.00.000000"
389,"W",1,"Einzelaufstellung Rechnung","A4hoch",1,"TblArbeitspaketeAL","PC_0308.RPT",0,0,0,0,"","2023-12-08-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.23.03', d_vers_aenddat = SYSDATETIME;

REMARK
\
*****************************************************************************
DB-VERSION: 20.23.04
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (309,389);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
389,"W",11,"Einzelaufstellung Rechnung","A4hoch",1,"TblArbeitspaketeAL","PC_0308.RPT",0,308,0,0,"",2023-12-08-00.00.00.000000
309,"W",2,"Änderungsanzeigen u. Entscheidungsvorlagen","A4quer",1,"FrmLVAL","PA_0305.RPT",0,305,273,0,"",2011-03-18-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.23.04', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.23.05
*****************************************************************************
/

ALTER TABLE pe_apk ADD c_apk_zusatz2 CHAR(100);
UPDATE version SET c_vers_version = '20.23.05', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.23.06
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (390);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
390,"W",2,"Detaillierte Stundenmitschreibung, Von-Bis-Zeiten","A4hoch",1,"FrmPruefListe","PZ_VOBI.RPT",0,0,10,0,"","2024-04-09-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.23.06', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.23.07
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zum Aktualisieren des Superuser PWD
FUNCTION#UP_SUPERUSER
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.23.07', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.24.01
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (391);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
391,"L",1,"Visualisierung X-Rechnung","A4hoch",1,"DLgXR","VISXR.RTX",0,0,0,0,"","2024-04-09-00.00.00.000000"
/;

ALTER TABLE pe_lpo ADD r_lpo_rmengeAN DOUBLE PRECISION NOT NULL WITH DEFAULT;
ALTER TABLE ie_lkst ADD i_lkst_kennung INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ie_lkst ADD c_lkst_key CHAR(20);
ALTER TABLE ie_zeit ADD i_lkst_nummer INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE ie_lmist ADD i_lmist_merker INTEGER NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.24.01', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.24.02
*****************************************************************************
/

DROP INDEX in_zeit2;
CREATE INDEX in_zeit2 ON ie_zeit ( i_proj_nummer, i_auft_nummer, i_zeit_lfd) PCTFREE 10;
UPDATE ie_rpt SET c_rpt_format = 'A4quer' WHERE c_rpt_filename = 'TB_SVAJ.RPT';

UPDATE version SET c_vers_version = '20.24.02', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.24.03
*****************************************************************************
/

DROP INDEX ui_ral1;
CREATE UNIQUE INDEX ui_ral1 ON ie_ral (k_i_man_nummer, i_man_nummer, c_ral_nr, c_ral_eingang) PCTFREE 10;
ALTER TABLE ie_kund ADD c_kund_fibukonto CHAR(40);
ALTER TABLE pe_stlb ADD i_stlb_vers INTEGER NOT NULL WITH DEFAULT;
ALTER TABLE version ADD d_vers_stati DATETIME;
ALTER TABLE se_adr ADD c_adr_register CHAR(40);
ALTER TABLE se_adr ADD c_adr_info CHAR(100);
ALTER TABLE pe_apk ADD c_apk_kriterium1 CHAR(50);

UPDATE version SET c_vers_version = '20.24.03', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.24.04
*****************************************************************************
/
REMARK
\
*****************************************************************************
Funktionsaufruf zum Abgleichen der STLB-Tabelle für STLB online und GAEB
FUNCTION#UP_STLB
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.24.04', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.24.05
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (392);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
392,"W",8,"Arbeitspaketliste mit mehr Zusatz-Info","A4quer",1,"TblArbeitspaketeAL","PC_ARBZQ.RPT",0,0,0,0,"","2024-12-10-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.24.05', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.24.06
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (393);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich, c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
393,"W",40,"Einheitspreise alle Bieter für markierte Positionen","A4hoch",1,"FrmPosAL","PA_PRPOS.RPT",0,0,0,0,"","2025-02-05-00.00.00.000000"
/;

UPDATE version SET c_vers_version = '20.24.06', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.24.07
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (359);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
359,"L",10,"Zahlungsanweisung, Abschlag einfach","A4hoch",1,"TblNUKonto","ZANWTNEI.RTX",0,0,768,0,"","2017-08-03-00.00.00.000000"
/;

REMARK
\
*****************************************************************************
DB-VERSION: 20.25.01
*****************************************************************************
/
ALTER TABLE pe_psp ADD c_psp_mmm CHAR(3);
ALTER TABLE pe_psp ADD r_psp_mmmep DOUBLE PRECISION NOT NULL WITH DEFAULT;
ALTER TABLE ie_kund ADD c_kund_ekreditor CHAR(40);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (389,394);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
389,"W",11,"Einzelaufstellung Rechnung PPF","A4hoch",1,"TblArbeitspaketeAL","PC_0308.RPT",0,308,0,0,"",2023-12-08-00.00.00.000000
394,"W",11,"Einzelaufstellung Rechnung PPK","A4hoch",1,"TblArbeitspaketeAL","PK_0308.RPT",0,308,0,0,"",2025-07-04-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.25.01', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';


REMARK
\
*****************************************************************************
DB-VERSION: 20.25.02
*****************************************************************************
/

ALTER TABLE pe_prjpp ADD r_prjpp_rmgespreis DOUBLE PRECISION NOT NULL WITH DEFAULT;

UPDATE version SET c_vers_version = '20.25.02', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.25.03
*****************************************************************************
/

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (395);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
395,"W",13,"Kalender-Jahresauswertung IST-Kosten-Erlöse (ProCash)","A4quer",1,"TblProjektAL","PC_PUEB2.RPT",0,0,279,0,"",2025-10-06-00.00.00.000000
/;

UPDATE version SET c_vers_version = '20.25.03', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe';

REMARK
\
*****************************************************************************
DB-VERSION: 20.25.04
*****************************************************************************
/

ALTER TABLE pe_lvs MODIFY c_lvs_bestellnr CHAR(100);
ALTER TABLE version ADD d_vers_uphin DATE;

UPDATE version SET c_vers_version = '20.25.04', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe', d_vers_uphin = SYSDATE;

REMARK
\
*****************************************************************************
DB-VERSION: 20.25.05
*****************************************************************************
/

UPDATE se_art SET r_art_zv = 0 WHERE r_art_zv = NULL;
UPDATE se_art SET r_art_zb = 0 WHERE r_art_zb = NULL;
UPDATE ie_proj SET i_proj_pp_nachweis = 0 WHERE i_proj_pp_nachweis = NULL;
UPDATE ie_proj SET i_proj_rahmen = 0 WHERE i_proj_rahmen = NULL;
UPDATE ie_proj SET r_proj_rgesstd = 0 WHERE r_proj_rgesstd = NULL;

UPDATE version SET c_vers_version = '20.25.05', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe', d_vers_uphin = SYSDATE;

REMARK
\
*****************************************************************************
DB-VERSION: 20.25.06
*****************************************************************************
/

REMARK
\
*****************************************************************************
Funktionsaufruf zur Korrektur von ie_gobd-Eintragungen
FUNCTION#UP_KORRGOBD
*****************************************************************************
/

UPDATE version SET c_vers_version = '20.25.06', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe', d_vers_uphin = SYSDATE;

REMARK
\
*****************************************************************************
DB-VERSION: 20.25.07
*****************************************************************************
/

ALTER TABLE ie_ral ADD L_RAL_QR LONG;
DROP INDEX in_ral3;
CREATE INDEX in_ral3 ON ie_ral ( i_proj_nummer, c_ral_kenn, c_ral_eingang, i_ral_assistat) PCTFREE 10;

UPDATE version SET c_vers_version = '20.25.07', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe', d_vers_uphin = SYSDATE;

REMARK
\
*****************************************************************************
DB-VERSION: 20.26.01
*****************************************************************************
/

ALTER TABLE se_adr MODIFY c_adr_name1 CHAR(100);
ALTER TABLE se_adr MODIFY c_adr_name2 CHAR(100);
ALTER TABLE se_adr MODIFY c_adr_vorname CHAR(100);
ALTER TABLE se_adr MODIFY c_adr_strasse CHAR(100);
ALTER TABLE se_adr MODIFY c_adr_ort CHAR(100);

ALTER TABLE se_ads MODIFY c_adr_name1 CHAR(100);
ALTER TABLE se_ads MODIFY c_adr_name2 CHAR(100);
ALTER TABLE se_ads MODIFY c_adr_vorname CHAR(100);
ALTER TABLE se_ads MODIFY c_adr_strasse CHAR(100);
ALTER TABLE se_ads MODIFY c_adr_ort CHAR(100);

ALTER TABLE ie_proj MODIFY c_proj_name CHAR(100);
ALTER TABLE ie_proj MODIFY c_adr_aufname1 CHAR(100);
ALTER TABLE se_sub MODIFY c_sub_bauvorh CHAR(100);
ALTER TABLE te_mib MODIFY c_mib_bauvorh CHAR(100);
ALTER TABLE te_sub MODIFY c_sub_bauvorh CHAR(100);

ALTER TABLE pe_biet MODIFY c_biet_name1 CHAR(100);
ALTER TABLE ie_bpp MODIFY c_bpp_projlang char(100);

DELETE FROM ie_rpt WHERE k_i_rpt_nummer in (37,117);
INSERT INTO ie_rpt ( k_i_rpt_nummer, c_rpt_kz, i_rpt_variante, c_rpt_bezeich,  c_rpt_format, i_ldru_nummer, c_rpt_itemname, c_rpt_filename,  i_rpt_status, i_rpt_user, i_rpt_dialog, i_rpt_module, c_rpt_remark ,D_RPT_AENDDAT)
VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)
\
37,"W",1,"Betriebsproduktionsplan Soll-Ist-Leistung","A4quer",2,"TblBppAL","PF_BPP.RPT",0,0,256,0,"","2026-11-05-00.00.00.000000"
117,"W",1,"Geräte-IST-Kosten","A4quer",2,"TblGIstKostenAL","PC_GIST.RPT",0,0,256,0,"","2026-11-05-00.00.00.000000"
/;

DROP VIEW pv_ral;
CREATE VIEW pv_ral as
SELECT K_I_KUND_NUMMER, k_i_ral_nummer,c_kund_name,c_kund_nummer,i_man_nummer,ie_kund.i_adr_nummer
  FROM ie_ral, ie_kund
 WHERE ie_kund.k_i_kund_nummer(+) = ie_ral.i_kund_nummer;

UPDATE version SET c_vers_version = '20.26.01', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe', d_vers_uphin = SYSDATE;

REMARK
\
*****************************************************************************
DB-VERSION: 20.26.02
*****************************************************************************
/

DROP VIEW sv_mitaadr;
CREATE VIEW sv_mitaadr (k_i_adr_nummer, k_i_mita_nummer, c_adr_vorname, c_mita_name, c_mita_persnr, i_mita_status, i_mita_mobil, i_mita_pwdreset, i_phase_nummer,
       i_mita_usermits, r_mita_prodkst, i_mita_lohnart, c_adr_tel1, c_adr_btx, c_mita_qualif, c_mita_notiz1, c_mita_notiz2, c_mita_notiz3,
       c_adr_strasse, c_adr_plz, c_adr_ort, c_mita_komplett, c_mita_abteilung) AS
SELECT k_i_adr_nummer, k_i_mita_nummer, c_adr_vorname, c_mita_name, c_mita_persnr, i_mita_status, i_mita_mobil, i_mita_pwdreset, i_phase_nummer,
       i_mita_usermits, r_mita_prodkst, i_mita_lohnart, c_adr_tel1, c_adr_btx, c_mita_qualif, c_mita_notiz1, c_mita_notiz2, c_mita_notiz3,
       c_adr_strasse, c_adr_plz, c_adr_ort, c_mita_name || ', ' || c_adr_vorname || ' [' || c_mita_persnr || ']', c_mita_abteilung
FROM se_mita, se_adr
WHERE i_adr_nummer = k_i_adr_nummer(+);

UPDATE version SET c_vers_version = '20.26.02', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe', d_vers_uphin = SYSDATE;

REMARK
\
*****************************************************************************
DB-VERSION: 20.26.03
*****************************************************************************
/

DROP VIEW sv_adrb;
CREATE VIEW sv_adrb AS 
   SELECT k_i_adr_nummer, k_i_biet_nummer, c_adr_name1, c_adr_name2, c_adr_strasse, 
          c_adr_plz, c_adr_ort, c_adr_tel1, c_adr_fax, c_biet_name1, k_i_proj_nummer
FROM se_adr, pe_biet 
WHERE k_i_adr_nummer (+) = i_adr_nummer;

DROP VIEW sv_kundadr;
CREATE VIEW sv_kundadr AS 
   SELECT k_i_adr_nummer, k_i_kund_nummer, c_adr_vorname, c_kund_name, c_kund_nummer, i_kund_status,
          c_adr_name1, c_adr_name2, c_adr_strasse, c_adr_plz, c_adr_ort, c_adr_tel1
     FROM se_adr, ie_kund WHERE i_adr_nummer = k_i_adr_nummer(+);

DROP VIEW sv_mitaadr;
CREATE VIEW sv_mitaadr (k_i_adr_nummer, k_i_mita_nummer, c_adr_vorname, c_mita_name, c_mita_persnr, i_mita_status, i_mita_mobil, i_mita_pwdreset, i_phase_nummer,
       i_mita_usermits, r_mita_prodkst, i_mita_lohnart, c_adr_tel1, c_adr_btx, c_mita_qualif, c_mita_notiz1, c_mita_notiz2, c_mita_notiz3,
       c_adr_strasse, c_adr_plz, c_adr_ort, c_mita_komplett, c_mita_abteilung, d_mita_aenddat) AS
SELECT k_i_adr_nummer, k_i_mita_nummer, c_adr_vorname, c_mita_name, c_mita_persnr, i_mita_status, i_mita_mobil, i_mita_pwdreset, i_phase_nummer,
       i_mita_usermits, r_mita_prodkst, i_mita_lohnart, c_adr_tel1, c_adr_btx, c_mita_qualif, c_mita_notiz1, c_mita_notiz2, c_mita_notiz3,
       c_adr_strasse, c_adr_plz, c_adr_ort, c_mita_name || ', ' || c_adr_vorname || ' [' || c_mita_persnr || ']', c_mita_abteilung, d_mita_aenddat
FROM se_mita, se_adr
WHERE i_adr_nummer = k_i_adr_nummer(+);

DROP VIEW sv_lag;
CREATE VIEW sv_lag (
  k_i_lag_nummer,
  k_i_man_nummer,
    c_lag_bezeich,
    c_adr_name1,
    c_adr_name2,
    c_adr_strasse,
    c_adr_plz,
    c_adr_ort,
    c_adr_tel1)
AS SELECT 
    se_lag.k_i_lag_nummer, se_lag.k_i_man_nummer, se_lag.c_lag_bezeich,
    se_adr.c_adr_name1, se_adr.c_adr_name2, se_adr.c_adr_strasse,
    se_adr.c_adr_plz, se_adr.c_adr_ort, se_adr.c_adr_tel1
FROM se_lag, se_adr
WHERE se_lag.i_adr_nummer = se_adr.k_i_adr_nummer(+);

DROP VIEW sv_lagp;
CREATE VIEW sv_lagp (
  k_i_lag_nummer,
  k_i_man_nummer,
    c_proj_name,
    c_proj_projdb)
AS SELECT
  se_lag.k_i_lag_nummer, se_lag.k_i_man_nummer,
  ie_proj.c_proj_name, ie_proj.c_proj_projdb
FROM se_lag, ie_proj
WHERE se_lag.i_proj_nummer = ie_proj.k_i_proj_nummer(+);

DROP VIEW sv_projauft;
CREATE VIEW sv_projauft AS 
   SELECT ie_proj.k_i_proj_nummer, pe_auft.k_i_auft_nummer, c_proj_projdb, c_proj_name, c_auft_kuerzel, c_auft_bezeich 
   FROM ie_proj, pe_auft WHERE ie_proj.k_i_proj_nummer = pe_auft.k_i_proj_nummer(+);

UPDATE version SET c_vers_version = '20.26.03', d_vers_aenddat = SYSDATETIME, c_vers_teamviewer = 'TeamViewerQS.exe', d_vers_uphin = SYSDATE;



