From 7acb6c33c5370cf730cff935fff2dc37e8cfeab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 27 Jan 2011 12:44:52 +0000 Subject: [PATCH] =?UTF-8?q?Bestellschein,=20Liefertermin=20und=20Kundennum?= =?UTF-8?q?mer=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/firma.class.php | 39 +++++++++++++++++++++++++++++++- rdf/bestellung.rdf.php | 6 ++++- system/xsl/bestellung_etw_v1.xsl | 14 ++++++------ 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/include/firma.class.php b/include/firma.class.php index 7b09e1f7a..5e24727d7 100644 --- a/include/firma.class.php +++ b/include/firma.class.php @@ -25,6 +25,7 @@ * @create 18-12-2006 */ require_once(dirname(__FILE__).'/basis_db.class.php'); +require_once(dirname(__FILE__).'/organisationseinheit.class.php'); class firma extends basis_db { @@ -560,6 +561,42 @@ class firma extends basis_db } } + /** + * Liefert die Kundennummer einer Firma zu einer Organisationseinheit + * Wenn fuer diese Organisationseinheit kein Eintrag vorhanden ist, wird + * in den uebergeordneten OEs gesucht + * + * @param firma_id + * @param oe_kurzbz + * @return kundennummer oder false wenn nicht vorhanden + */ + public function get_kundennummer($firma_id, $oe_kurzbz) + { + $qry = "SELECT kundennummer FROM public.tbl_firma_organisationseinheit + WHERE firma_id='".addslashes($firma_id)."' AND oe_kurzbz='".addslashes($oe_kurzbz)."';"; + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + return $row->kundennummer; + } + else + { + $oe = new organisationseinheit(); + if($oe->load($oe_kurzbz)) + { + if($oe->oe_parent_kurzbz!='') + return $this->get_kundennummer($firma_id, $oe->oe_parent_kurzbz); + else + return false; + } + else + return false; + } + } + } + /** * Laedt alle Firmen - Organisationseinheiten nach Firmen ID und/oder OE Kurzbz * @param $firma_id ID die gelesen werden soll @@ -777,4 +814,4 @@ class firma extends basis_db } } -?> \ No newline at end of file +?> diff --git a/rdf/bestellung.rdf.php b/rdf/bestellung.rdf.php index b8f0b9ed4..66264afa5 100644 --- a/rdf/bestellung.rdf.php +++ b/rdf/bestellung.rdf.php @@ -66,7 +66,8 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $firma = new firma(); $firma->load($bestellung->firma_id); - + $kundennummer = $firma->get_kundennummer($bestellung->firma_id, $kostenstelle->oe_kurzbz); + $standort = new standort(); $standort->load_firma($firma->firma_id); if(isset($standort->result[0])) @@ -80,12 +81,15 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $kontakt = new kontakt(); $kontakt->loadFirmaKontakttyp($standort->standort_id, 'fax'); $fax = $kontakt->kontakt; + header("Content-type: application/xhtml+xml"); echo ''; echo "\n\n"; echo " bestell_nr]]>\n"; echo " titel]]>\n"; + echo " liefertermin]]>\n"; + echo " \n"; echo " \n"; echo " titelpre]]>\n"; echo " vorname]]>\n"; diff --git a/system/xsl/bestellung_etw_v1.xsl b/system/xsl/bestellung_etw_v1.xsl index 7fcb1c85e..8f3a907fa 100644 --- a/system/xsl/bestellung_etw_v1.xsl +++ b/system/xsl/bestellung_etw_v1.xsl @@ -71,8 +71,8 @@ - - !! fehlt noch in xml !! + + @@ -83,8 +83,8 @@ - - !! gibts nicht mehr? !! + + @@ -96,7 +96,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -559,7 +559,7 @@ - +