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 @@ - +