Compare commits

...

3 Commits

Author SHA1 Message Date
OpenXE
09aacfbb7b Bugfix file upload dragndrop 2024-06-12 15:14:57 +02:00
OpenXE
2b43efca70 Bugfix add price when address is in several groups 2024-06-11 20:00:16 +02:00
OpenXE
0b5b7cbed1 Bugfixes adressstammdatenblatt 2024-06-11 19:45:39 +02:00
6 changed files with 342 additions and 307 deletions

View File

@ -14135,24 +14135,18 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
$action = $this->app->Secure->GetGET("action");
$id = $this->app->Secure->GetGET("id");
if($id)$this->app->Tpl->Set('ID',$id);
if ($speichern != "") {
$titel = $this->app->Secure->GetPOST("titel");
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
$stichwort = $this->app->Secure->GetPOST("stichwort");
$this->app->Tpl->Set('TITLE', $titel);
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
if ($_FILES['upload']['tmp_name'] == "") {
$this->app->Tpl->Set('ERROR', "<div class=\"info\">Bitte w&auml;hlen Sie eine Datei aus und laden Sie diese herauf!</div>");
$this->app->erp->EnableTab("tabs-2");
} else {
//$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'],$titel,$beschreibung,"",$_FILES['upload']['tmp_name'],$this->app->User->GetName());
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $_FILES['upload']['name'], "Neue Version", $_FILES['upload']['tmp_name']);
header("Location: index.php?module=$module&action=$action&id=$id");
exit;
// Get files here
if ($speichern != "") {
$retval = $this->FilesFromUploadtoDMS(null, null, $datei);
if ($retval !== true) {
$this->app->Tpl->Set('ERROR', implode(', ',$retval));
$this->app->erp->EnableTab("tabs-2");
} else {
header("Location: index.php?module=$module&action=$action&id=$id");
}
}
$this->app->Tpl->Set('STARTDISABLE', "<!--");
$this->app->Tpl->Set('ENDEDISABLE', "-->");
$this->app->Tpl->Parse($parsetarget, "datei_neudirekt.tpl");
@ -14229,61 +14223,18 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
$id = $this->app->Secure->GetGET("id");
$sid = $this->app->Secure->GetGET("sid");
if($id)$this->app->Tpl->Set('ID', $id);
// Get files here
if ($speichern != "") {
if($parameter == '')$parameter = $id;
if(isset($_POST['dateiv']))
{
foreach($_POST['dateiv'] as $k => $v)
{
$name = $this->app->DB->real_escape_string($_POST['dateiname'][$k]);
$titel = $this->app->DB->real_escape_string($_POST['dateititel'][$k]);
$beschreibung = $this->app->DB->real_escape_string($_POST['beschreibung'][$k]);
$stichwort = $this->app->DB->real_escape_string($_POST['dateistichwort'][$k]);
//$getMime = explode('.', $name);
//$mime = end($getMime);
$data = explode(',', $v);
$encodedData = str_replace(' ','+',$data[1]);
$decodedData = base64_decode($encodedData);
$this->app->Tpl->Set('TITLE', $titel);
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
if ($v == "" ) {
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgew&auml;hlt!</div>");
$this->app->erp->EnableTab("tabs-2");
} else {
$fileid = $this->app->erp->CreateDatei($name, $titel, $beschreibung, "", $decodedData, $this->app->User->GetName());
// stichwoerter hinzufuegen
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
}
}
if($_FILES['upload']['tmp_name'] == "")
{
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
}
if($parameter == '') {
$parameter = $id;
}
$titel = $this->app->Secure->GetPOST("titel");
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
$stichwort = $this->app->Secure->GetPOST("stichwort");
$this->app->Tpl->Set('TITLE', $titel);
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
if ($_FILES['upload']['tmp_name'] == "" && empty($_POST['dateiv'])) {
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgew&auml;hlt!</div>");
$this->app->erp->EnableTab("tabs-2");
} elseif($_FILES['upload']['tmp_name'] != '') {
$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'], $titel, $beschreibung, "", $_FILES['upload']['tmp_name'], $this->app->User->GetName());
// stichwoerter hinzufuegen
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
$retval = $this->FilesFromUploadtoDMS($objekt, $parameter);
if ($retval !== true) {
$this->app->Tpl->Set('ERROR', implode(', ',$retval));
$this->app->erp->EnableTab("tabs-2");
} else {
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
}
}
@ -14551,6 +14502,87 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
}
}
/*
* Retrieve uploaded files and put them into DMS
* $datei: given file, just add a new version
* Return array of errors or true
*/
function FilesFromUploadtoDMS($objekt, $parameter, $datei = false) {
$retval = true;
// Files come from drag'n'drop
if(isset($_POST['dateiv']))
{
foreach($_POST['dateiv'] as $k => $v)
{
$name = $this->app->DB->real_escape_string($_POST['dateiname'][$k]);
$titel = $this->app->DB->real_escape_string($_POST['dateititel'][$k]);
$beschreibung = $this->app->DB->real_escape_string($_POST['dateibeschreibung'][$k]);
$stichwort = $this->app->DB->real_escape_string($_POST['dateistichwort'][$k]);
$data = explode(',', $v);
$encodedData = str_replace(' ','+',$data[1]);
$decodedData = base64_decode($encodedData);
$this->app->Tpl->Set('TITLE', $titel);
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
if ($v == "" ) {
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgew&auml;hlt!</div>");
$this->app->erp->EnableTab("tabs-2");
} else {
// Save file to disk first
$tempfilename = rtrim($this->app->erp->GetTMP(), '/') . "/" . $name;
if($handle = fopen($tempfilename, "wb")){
fwrite($handle, $decodedData);
fclose($handle);
// Add file to DMS
if ($datei) {
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $name, "Neue Version", $tempfilename);
} else {
$fileid = $this->app->erp->CreateDatei($name, $titel, $beschreibung, "", $tempfilename, $this->app->User->GetName());
// stichwoerter hinzufuegen
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
}
} else {
if ($retval === true) {
$retval = array();
}
$retval[] = "<div class=\"error\">Datei konnte nicht gespeichert werden: ".$name."</div>";
}
}
}
} // drag'n'drop
// Single file comes from browse button
else {
$titel = $this->app->Secure->GetPOST("titel");
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
$stichwort = $this->app->Secure->GetPOST("stichwort");
$this->app->Tpl->Set('TITLE', $titel);
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
if ($_FILES['upload']['tmp_name'] == "" && empty($_POST['dateiv'])) {
$this->app->erp->EnableTab("tabs-2");
if ($retval === true) {
$retval = array();
}
$retval[] = "<div class=\"error\">Keine Datei ausgew&auml;hlt!</div>";
} elseif ($_FILES['upload']['tmp_name'] != '') {
if ($datei) {
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $_FILES['upload']['name'], "Neue Version", $_FILES['upload']['tmp_name']);
}
else {
$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'], $titel, $beschreibung, "", $_FILES['upload']['tmp_name'], $this->app->User->GetName());
// stichwoerter hinzufuegen
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
}
}
}
return($retval);
}
function SortListAdd($parsetarget, &$ref, $menu, $sql, $sort = true) {
$module = $this->app->Secure->GetGET("module");

View File

@ -38222,7 +38222,7 @@ function Firmendaten($field,$projekt="")
$sql_erweiterung = '';
if(!empty($gruppenarr))
{
$sql_erweiterung .= ' OR v.gruppe IN ('.implode(' ', $gruppenarr).') ';
$sql_erweiterung .= ' OR v.gruppe IN ('.implode(', ', $gruppenarr).') ';
}
if(!$guenstigste_vk) {
$vkarr = $this->app->DB->SelectArr("SELECT * FROM verkaufspreise v WHERE v.ab_menge <= '$menge' AND

View File

@ -1,235 +1,236 @@
<?php
/*
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
*
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
*
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
* to obtain the text of the corresponding license version.
*
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
/*
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
*
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
*
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
* to obtain the text of the corresponding license version.
*
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*/
?>
<?php
class AdressstammblattPDF extends Dokumentenvorlage {
public $doctype;
function __construct($app,$projekt="")
{
$this->app=$app;
//parent::Dokumentenvorlage();
$this->doctype="adresse";
$this->doctypeOrig="Adressstammblatt";
parent::__construct($this->app,$projekt);
}
public function renderDocument() {
// prepare page details
SuperFPDF::__construct('P','mm','A4');
$this->AddPage();
$this->SetDisplayMode("real","single");
$this->SetMargins(15,50);
$this->SetAutoPageBreak(true,40);
$this->AliasNbPages('{nb}');
// Bei Adressstammblatt immer oben beginnen
$this->abstand_betreffzeileoben=0;
$this->logofile = "";//$this->app->erp->GetTMP()."/".$this->app->Conf->WFdbname."_logo.jpg";
$this->briefpapier="";
$schrift = $this->app->erp->Firmendaten('schriftgroesse');
$this->SetFontSize($schrift);
$this->SetFont($this->GetFont(),'','10');
$this->SetX($this->GetX()+160);
$this->Cell(10,0,date("d.m.Y"),"","","L");
$this->renderDoctype();
$adresse = $this->app->DB->SelectArr("SELECT * FROM adresse WHERE id='".$this->id."'");
$adresse = reset($adresse);
if($adresse['typ']=="firma")
{
$infofields[]=array("Firma",$adresse['name']);
if($adresse['ansprechpartner']!="")
$infofields[]=array("Ansprechpartner",$adresse['ansprechpartner']);
} else {
$infofields[]=array("Name",$adresse['name']);
}
$infofields[]=array("Anschrift",$adresse['land']."-".$adresse['plz']." ".$adresse['ort'].", ".$adresse['strasse']);
$felder = array('telefon','telefax','mobil','email','web');
foreach($felder as $feldname)
{
$infofields[]=array(ucfirst($feldname),$adresse[$feldname=='web'?'internetseite':$feldname]);
}
if($this->app->erp->Firmendaten("modul_mlm")==1)
{
$mlmvertragsbeginn = $this->app->DB->Select("SELECT DATE_FORMAT(mlmvertragsbeginn,'%d.%m.%Y') FROM adresse WHERE id='".$adresse['id']."' LIMIT 1");
if($mlmvertragsbeginn=="00.00.0000") $mlmvertragsbeginn = "kein Vertragsbeginn eingestellt";
$sponsorid = $this->app->DB->Select("SELECT sponsor FROM adresse WHERE id='".$adresse['id']."' LIMIT 1");
if($sponsorid> 0)
$sponsor = $this->app->DB->Select("SELECT CONCAT(kundennummer,' ',name) FROM adresse WHERE id='$sponsorid' LIMIT 1");
else
$sponsor = "Kein Sponsor vorhanden";
$erfasstam = $this->app->DB->Select("SELECT DATE_FORMAT(zeitstempel,'%d.%m.%Y') FROM objekt_protokoll WHERE objekt='adresse' AND objektid='".$adresse['id']."' AND action_long='adresse_create' LIMIT 1");
$infofields[]=array("Sponsor",$sponsor);
$infofields[]=array("Erfasst am",$erfasstam);
$infofields[]=array("Vertragsbeginn am",$mlmvertragsbeginn);
}
$infofields[]=array("UST-ID",$adresse['ustid']);
if($adresse['kundennummer']!="")
$numbers[] = array("Kunden Nr.",$adresse['kundennummer']);
if($adresse['lieferantennummer']!="")
$numbers[] = array("Lieferanten Nr.",$adresse['lieferantennummer']);
if($adresse['mitarbeiternummer']!="")
$numbers[] = array("Mitarbeiter Nr.",$adresse['mitarbeiternummer']);
if(count($numbers)>0)
$this->renderInfoBox($numbers);
$this->Ln(5);
$this->renderHeading("Adressstammblatt",8);
$this->renderInfoBox($infofields);
$ansprechpartner_tmp = $this->app->DB->SelectArr("SELECT CONCAT(name,', ',if(bereich='','-',bereich),
', Telefon: ',telefon,
', Mobil: ',mobil,
', E-Mail: ',email
) as 'value' FROM ansprechpartner WHERE adresse='".$adresse['id']."'");
for($i=0;$i<count($ansprechpartner_tmp);$i++) $ansprechpartner[] = $ansprechpartner_tmp[$i]['value'];
if(count($ansprechpartner) > 0)
{
$this->Ln(5);
$this->renderHeading("Ansprechpartner",8);
$this->renderInfoBoxSingle($ansprechpartner);
}
$lieferadressen_tmp = $this->app->DB->SelectArr("SELECT name,abteilung,unterabteilung,adresszusatz,strasse,plz,ort,land,
telefon,email
FROM lieferadressen WHERE adresse='".$adresse['id']."' ORDER by standardlieferadresse DESC");
for($i=0;$i<count($lieferadressen_tmp);$i++) {
$lieferadressen_tmp[$i]['value']="";
foreach($lieferadressen_tmp[$i] as $key=>$value)
{
switch($key)
{
case "email":
$lieferadressen_tmp[$i]['value'] .= "E-Mail: $value, ";
break;
case "telefon":
$lieferadressen_tmp[$i]['value'] .= "Telefon: $value, ";
break;
case "telefax":
$lieferadressen_tmp[$i]['value'] .= "Telefax: $value, ";
break;
default:
if($value!="")
$lieferadressen_tmp[$i]['value'] .= "$value, ";
}
}
$lieferadressen_tmp[$i]['value'] = trim($lieferadressen_tmp[$i]['value'],', ');
if($i==0) $standard = " (Standard)"; else $standard="";
$lieferadressen[] = $lieferadressen_tmp[$i]['value'].$standard;
}
if(count($lieferadressen) > 0)
{
$this->Ln(5);
$this->renderHeading("Lieferadressen",8);
$this->renderInfoBoxSingle($lieferadressen);
}
$this->Ln(5);
if($adresse['sonstiges']!="")
{
$this->renderHeading("Sonstiges",8);
$this->SetFont($this->GetFont(),'',7);
$this->MultiCell(180,4,$this->WriteHTML($adresse['sonstiges']));
}
$this->renderFooter();
}
function GetAdressstammblatt($id,$info="",$extrafreitext="")
{
$this->id = $id;
// das muss vom reisekosten sein!!!!
//$this->setRecipientLieferadresse($id,"reisekosten");
// OfferNo, customerId, OfferDate
/*$auftrag = $this->app->DB->Select("SELECT auftragid FROM reisekosten WHERE id='$id' LIMIT 1");
$auftrag = $this->app->DB->Select("SELECT belegnr FROM auftrag WHERE id='$auftrag' LIMIT 1");
$bearbeiter = $this->app->DB->Select("SELECT bearbeiter FROM reisekosten WHERE id='$id' LIMIT 1");
$prefix = $this->app->DB->Select("SELECT prefix FROM reisekosten WHERE id='$id' LIMIT 1");
$bestellbestaetigung = $this->app->DB->Select("SELECT bestellbestaetigung FROM reisekosten WHERE id='$id' LIMIT 1");
$this->datum = $this->app->DB->Select("SELECT DATE_FORMAT(datum,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
$this->von = $this->app->DB->Select("SELECT DATE_FORMAT(von,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
$this->bis = $this->app->DB->Select("SELECT DATE_FORMAT(bis,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
$this->von_zeit = $this->app->DB->Select("SELECT von_zeit FROM reisekosten WHERE id='$id' LIMIT 1");
$this->bis_zeit = $this->app->DB->Select("SELECT bis_zeit FROM reisekosten WHERE id='$id' LIMIT 1");
$belegnr = $this->app->DB->Select("SELECT belegnr FROM reisekosten WHERE id='$id' LIMIT 1");
$this->anlass = $this->app->DB->Select("SELECT anlass FROM reisekosten WHERE id='$id' LIMIT 1");
$this->freitext = $this->app->DB->Select("SELECT freitext FROM reisekosten WHERE id='$id' LIMIT 1");
$projekt = $this->app->DB->Select("SELECT projekt FROM reisekosten WHERE id='$id' LIMIT 1");
$mitarbeiter = $this->app->DB->Select("SELECT mitarbeiter FROM reisekosten WHERE id='$id' LIMIT 1");*/
$kunde= $this->app->DB->SelectArr("SELECT name,kundennummer,lieferantennummer FROM adresse WHERE id='$id' LIMIT 1");
$kunde = reset($kunde);
$kundennummer = $kunde['kundennummer'];
$this->name = $kunde['name'];
$this->projektabkuerzung = $this->app->DB->Select("SELECT abkuerzung FROM projekt WHERE id='$projekt'");
$this->firmenname = $this->app->erp->Firmendaten('name');
$this->doctypeOrig="Adresse: ".$kunde['name'];
$this->barcode=$belegnr;
//$ohne_briefpapier = $this->app->DB->Select("SELECT ohne_briefpapier FROM reisekosten WHERE id='$id' LIMIT 1");
//$artikel = $this->app->DB->SelectArr("SELECT *,DATE_FORMAT(datum,'%d.%m.%Y') as datum, CONCAT(rk.nummer,'- ',rk.beschreibung) as reisekostenart FROM reisekosten_position rp LEFT JOIN reisekostenart rk ON rk.id=rp.reisekostenart WHERE rp.reisekosten='$id' ORDER By rp.sort");
//$waehrung = $this->app->DB->Select("SELECT waehrung FROM reisekosten_position WHERE reisekosten='$id' LIMIT 1");
/* Dateiname */
$this->filename = date('Ymd')."_STAMMDATEN_ADRESSE_".$this->app->erp->Dateinamen($kunde['name']).".pdf";
$this->setBarcode($id);
}
}
<?php
class AdressstammblattPDF extends Dokumentenvorlage {
public $doctype;
function __construct($app,$projekt="")
{
$this->app=$app;
//parent::Dokumentenvorlage();
$this->doctype="adresse";
$this->table="adresse";
$this->doctypeOrig="Adressstammblatt";
parent::__construct($this->app,$projekt);
}
public function renderDocument() {
// prepare page details
SuperFPDF::__construct('P','mm','A4');
$this->AddPage();
$this->SetDisplayMode("real","single");
$this->SetMargins(15,50);
$this->SetAutoPageBreak(true,40);
$this->AliasNbPages('{nb}');
// Bei Adressstammblatt immer oben beginnen
$this->abstand_betreffzeileoben=0;
$this->logofile = "";//$this->app->erp->GetTMP()."/".$this->app->Conf->WFdbname."_logo.jpg";
$this->briefpapier="";
$schrift = $this->app->erp->Firmendaten('schriftgroesse');
$this->SetFontSize($schrift);
$this->SetFont($this->GetFont(),'','10');
$this->SetX($this->GetX()+160);
$this->Cell(10,0,date("d.m.Y"),"","","L");
$this->renderDoctype();
$adresse = $this->app->DB->SelectArr("SELECT * FROM adresse WHERE id='".$this->id."'");
$adresse = reset($adresse);
if($adresse['typ']=="firma")
{
$infofields[]=array("Firma",$adresse['name']);
if($adresse['ansprechpartner']!="")
$infofields[]=array("Ansprechpartner",$adresse['ansprechpartner']);
} else {
$infofields[]=array("Name",$adresse['name']);
}
$infofields[]=array("Anschrift",$adresse['land']."-".$adresse['plz']." ".$adresse['ort'].", ".$adresse['strasse']);
$felder = array('telefon','telefax','mobil','email','web');
foreach($felder as $feldname)
{
$infofields[]=array(ucfirst($feldname),$adresse[$feldname=='web'?'internetseite':$feldname]);
}
if($this->app->erp->Firmendaten("modul_mlm")==1)
{
$mlmvertragsbeginn = $this->app->DB->Select("SELECT DATE_FORMAT(mlmvertragsbeginn,'%d.%m.%Y') FROM adresse WHERE id='".$adresse['id']."' LIMIT 1");
if($mlmvertragsbeginn=="00.00.0000") $mlmvertragsbeginn = "kein Vertragsbeginn eingestellt";
$sponsorid = $this->app->DB->Select("SELECT sponsor FROM adresse WHERE id='".$adresse['id']."' LIMIT 1");
if($sponsorid> 0)
$sponsor = $this->app->DB->Select("SELECT CONCAT(kundennummer,' ',name) FROM adresse WHERE id='$sponsorid' LIMIT 1");
else
$sponsor = "Kein Sponsor vorhanden";
$erfasstam = $this->app->DB->Select("SELECT DATE_FORMAT(zeitstempel,'%d.%m.%Y') FROM objekt_protokoll WHERE objekt='adresse' AND objektid='".$adresse['id']."' AND action_long='adresse_create' LIMIT 1");
$infofields[]=array("Sponsor",$sponsor);
$infofields[]=array("Erfasst am",$erfasstam);
$infofields[]=array("Vertragsbeginn am",$mlmvertragsbeginn);
}
$infofields[]=array("UST-ID",$adresse['ustid']);
if($adresse['kundennummer']!="")
$numbers[] = array("Kunden Nr.",$adresse['kundennummer']);
if($adresse['lieferantennummer']!="")
$numbers[] = array("Lieferanten Nr.",$adresse['lieferantennummer']);
if($adresse['mitarbeiternummer']!="")
$numbers[] = array("Mitarbeiter Nr.",$adresse['mitarbeiternummer']);
if($numbers?count($numbers):0>0)
$this->renderInfoBox($numbers);
$this->Ln(5);
$this->renderHeading("Adressstammblatt",8);
$this->renderInfoBox($infofields);
$ansprechpartner_tmp = $this->app->DB->SelectArr("SELECT CONCAT(name,', ',if(bereich='','-',bereich),
', Telefon: ',telefon,
', Mobil: ',mobil,
', E-Mail: ',email
) as 'value' FROM ansprechpartner WHERE adresse='".$adresse['id']."'");
for($i=0;$i<($ansprechpartner_tmp?count($ansprechpartner_tmp):0);$i++) $ansprechpartner[] = $ansprechpartner_tmp[$i]['value'];
if($ansprechpartner_tmp?count($ansprechpartner):0 > 0)
{
$this->Ln(5);
$this->renderHeading("Ansprechpartner",8);
$this->renderInfoBoxSingle($ansprechpartner);
}
$lieferadressen_tmp = $this->app->DB->SelectArr("SELECT name,abteilung,unterabteilung,adresszusatz,strasse,plz,ort,land,
telefon,email
FROM lieferadressen WHERE adresse='".$adresse['id']."' ORDER by standardlieferadresse DESC");
for($i=0;$i<($lieferadressen_tmp?count($lieferadressen_tmp):0);$i++) {
$lieferadressen_tmp[$i]['value']="";
foreach($lieferadressen_tmp[$i] as $key=>$value)
{
switch($key)
{
case "email":
$lieferadressen_tmp[$i]['value'] .= "E-Mail: $value, ";
break;
case "telefon":
$lieferadressen_tmp[$i]['value'] .= "Telefon: $value, ";
break;
case "telefax":
$lieferadressen_tmp[$i]['value'] .= "Telefax: $value, ";
break;
default:
if($value!="")
$lieferadressen_tmp[$i]['value'] .= "$value, ";
}
}
$lieferadressen_tmp[$i]['value'] = trim($lieferadressen_tmp[$i]['value'],', ');
if($i==0) $standard = " (Standard)"; else $standard="";
$lieferadressen[] = $lieferadressen_tmp[$i]['value'].$standard;
}
if($lieferadressen?count($lieferadressen):0 > 0)
{
$this->Ln(5);
$this->renderHeading("Lieferadressen",8);
$this->renderInfoBoxSingle($lieferadressen);
}
$this->Ln(5);
if($adresse['sonstiges']!="")
{
$this->renderHeading("Sonstiges",8);
$this->SetFont($this->GetFont(),'',7);
$this->MultiCell(180,4,$this->WriteHTML($adresse['sonstiges']));
}
$this->renderFooter();
}
function GetAdressstammblatt($id,$info="",$extrafreitext="")
{
$this->id = $id;
// das muss vom reisekosten sein!!!!
//$this->setRecipientLieferadresse($id,"reisekosten");
// OfferNo, customerId, OfferDate
/*$auftrag = $this->app->DB->Select("SELECT auftragid FROM reisekosten WHERE id='$id' LIMIT 1");
$auftrag = $this->app->DB->Select("SELECT belegnr FROM auftrag WHERE id='$auftrag' LIMIT 1");
$bearbeiter = $this->app->DB->Select("SELECT bearbeiter FROM reisekosten WHERE id='$id' LIMIT 1");
$prefix = $this->app->DB->Select("SELECT prefix FROM reisekosten WHERE id='$id' LIMIT 1");
$bestellbestaetigung = $this->app->DB->Select("SELECT bestellbestaetigung FROM reisekosten WHERE id='$id' LIMIT 1");
$this->datum = $this->app->DB->Select("SELECT DATE_FORMAT(datum,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
$this->von = $this->app->DB->Select("SELECT DATE_FORMAT(von,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
$this->bis = $this->app->DB->Select("SELECT DATE_FORMAT(bis,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
$this->von_zeit = $this->app->DB->Select("SELECT von_zeit FROM reisekosten WHERE id='$id' LIMIT 1");
$this->bis_zeit = $this->app->DB->Select("SELECT bis_zeit FROM reisekosten WHERE id='$id' LIMIT 1");
$belegnr = $this->app->DB->Select("SELECT belegnr FROM reisekosten WHERE id='$id' LIMIT 1");
$this->anlass = $this->app->DB->Select("SELECT anlass FROM reisekosten WHERE id='$id' LIMIT 1");
$this->freitext = $this->app->DB->Select("SELECT freitext FROM reisekosten WHERE id='$id' LIMIT 1");
$projekt = $this->app->DB->Select("SELECT projekt FROM reisekosten WHERE id='$id' LIMIT 1");
$mitarbeiter = $this->app->DB->Select("SELECT mitarbeiter FROM reisekosten WHERE id='$id' LIMIT 1");*/
$kunde= $this->app->DB->SelectArr("SELECT name,kundennummer,lieferantennummer FROM adresse WHERE id='$id' LIMIT 1");
$kunde = reset($kunde);
$kundennummer = $kunde['kundennummer'];
$this->name = $kunde['name'];
$this->projektabkuerzung = $this->app->DB->Select("SELECT abkuerzung FROM projekt WHERE id='$projekt'");
$this->firmenname = $this->app->erp->Firmendaten('name');
$this->doctypeOrig="Adresse: ".$kunde['name'];
$this->barcode=$belegnr;
//$ohne_briefpapier = $this->app->DB->Select("SELECT ohne_briefpapier FROM reisekosten WHERE id='$id' LIMIT 1");
//$artikel = $this->app->DB->SelectArr("SELECT *,DATE_FORMAT(datum,'%d.%m.%Y') as datum, CONCAT(rk.nummer,'- ',rk.beschreibung) as reisekostenart FROM reisekosten_position rp LEFT JOIN reisekostenart rk ON rk.id=rp.reisekostenart WHERE rp.reisekosten='$id' ORDER By rp.sort");
//$waehrung = $this->app->DB->Select("SELECT waehrung FROM reisekosten_position WHERE reisekosten='$id' LIMIT 1");
/* Dateiname */
$this->filename = date('Ymd')."_STAMMDATEN_ADRESSE_".$this->app->erp->Dateinamen($kunde['name']).".pdf";
$this->setBarcode($id);
}
}

View File

@ -474,9 +474,11 @@ class Dokumentenvorlage extends SuperFPDF {
$this->Output($dir."/".$this->table."/".$this->id."_".$this->filename,'F');
}
public function displayDocument() {
public function displayDocument($archive = true) {
$this->renderDocument();
$this->archiveDocument();
if ($archive) {
$this->archiveDocument();
}
$this->Output($this->filename,'D');
exit;
}

View File

@ -780,7 +780,7 @@ class Adresse extends GenAdresse {
}
$Brief->GetAdressstammblatt($id);
$Brief->displayDocument();
$Brief->displayDocument(archive: false);
$this->app->ExitXentral();
}

View File

@ -11,7 +11,7 @@
<td colspan="4">[ERROR]</td>
</tr>
<tr id="trdropfiles">
<td colspan="4">
<td colspan="6">
<div id="drop-files" ondragover="return false">
{|Dateien hier einf&uuml;gen|}
</div>
@ -333,8 +333,8 @@ $(document).ready(function() {
}
}
$('#trdatei').before('<tr><td>Datei '+vorschau+'</td><td class="tddateiname"><input type="hidden" name="dateiv[]" value="'+image+'" /><input type="hidden" name="dateiname[]" value="'+filenameEncoded+'" />'+filenameEncoded+'</td><td>Titel: <input type="text" name="dateititel[]" /></td><td><select name="dateistichwort[]">'+$('#stichwort').html()+'</select></td></tr>');
};
$('#trdatei').before(' <tr> <td>Datei '+vorschau+'</td> <td class="tddateiname"><input type="hidden" name="dateiv[]" value="'+image+'" /><input type="hidden" name="dateiname[]" value="'+filenameEncoded+'" />'+filenameEncoded+'</td> <td>Titel: <input type="text" name="dateititel[]" /></td> <td>{|Beschreibung|}:</td> <td><textarea name="dateibeschreibung[]" cols="50"></textarea></td> <td><select name="dateistichwort[]">'+$('#stichwort').html()+'</select></td> </tr> ');
};
})(files[index]);
fileReader.readAsDataURL(file);