mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 14:10:28 +01:00
Bugfixes supportapp
This commit is contained in:
parent
419537d1fd
commit
8fe43e827a
@ -6758,7 +6758,9 @@ title: 'Abschicken',
|
||||
|
||||
|
||||
reset($ISO10646XHTMLTrans);
|
||||
while(list($UnicodeChar, $XHTMLEquiv) = each($ISO10646XHTMLTrans)) {
|
||||
// while(list($UnicodeChar, $XHTMLEquiv) = each($ISO10646XHTMLTrans)) {
|
||||
foreach($ISO10646XHTMLTrans as $UniccideChar => $XHTMLEquiv)
|
||||
{
|
||||
$content = str_replace($UnicodeChar, $XHTMLEquiv, $content);
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ class Supportapp Extends GenSupportapp {
|
||||
$tmp = explode(' ', $tmp);
|
||||
$tmp = reset($tmp);
|
||||
$tmp = $app->DB->Select("SELECT id FROM artikel WHERE nummer <> '' AND ifnull(geloescht,0) = 0 AND nummer = '".$app->DB->real_escape_string($tmp)."' LIMIT 1");
|
||||
if($tmp)$enterprisearr[] = $tmp;
|
||||
if($tmp)$enterprisearr = $tmp;
|
||||
}
|
||||
|
||||
$abgelaufene = $app->YUI->TableSearchFilter($name, 1, 'abgelaufene',0,0,'checkbox');
|
||||
@ -92,7 +92,7 @@ class Supportapp Extends GenSupportapp {
|
||||
LEFT JOIN (
|
||||
SELECT r.adresse
|
||||
FROM rechnung r
|
||||
INNER JOIN rechnung_position rp ON r.status <> 'storniert' AND r.belegnr <> '' AND r.id = rp.rechnung AND rp.artikel in (".implode(',', $enterprisearr).") AND rp.artikel <> 0
|
||||
INNER JOIN rechnung_position rp ON r.status <> 'storniert' AND r.belegnr <> '' AND r.id = rp.rechnung AND rp.artikel in (".$enterprisearr.") AND rp.artikel <> 0
|
||||
LEFT JOIN abrechnungsartikel abo ON r.adresse = abo.adresse AND abo.artikel = rp.artikel
|
||||
AND abo.artikel <> 0
|
||||
WHERE isnull(abo.adresse) OR
|
||||
@ -114,7 +114,7 @@ class Supportapp Extends GenSupportapp {
|
||||
LEFT JOIN (
|
||||
SELECT r.adresse
|
||||
FROM rechnung r
|
||||
INNER JOIN rechnung_position rp ON r.status <> 'storniert' AND r.belegnr <> '' AND r.id = rp.rechnung AND rp.artikel in (".implode(',', $enterprisearr).") AND rp.artikel <> 0
|
||||
INNER JOIN rechnung_position rp ON r.status <> 'storniert' AND r.belegnr <> '' AND r.id = rp.rechnung AND rp.artikel in (".$enterprisearr.") AND rp.artikel <> 0
|
||||
LEFT JOIN abrechnungsartikel abo ON r.adresse = abo.adresse AND abo.artikel = rp.artikel
|
||||
AND abo.artikel <> 0
|
||||
WHERE
|
||||
@ -239,6 +239,8 @@ class Supportapp Extends GenSupportapp {
|
||||
$artikektechnikerarr = array(0);
|
||||
$artikekenterprisearr = array(0);
|
||||
$artikeltmp = $app->DB->SelectArr("SELECT * FROM supportapp_artikel");
|
||||
|
||||
if (!is_null($artikeltmp)) {
|
||||
for ($i=0; $i < count($artikeltmp); $i++) {
|
||||
switch ($artikeltmp[$i]['typ']) {
|
||||
case '1':
|
||||
@ -252,6 +254,7 @@ class Supportapp Extends GenSupportapp {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//$supportvertrag2 = $->app->DB->Select("SELECT rp.id, r.datum FROM rechnung_position rp LEFT JOIN rechnung r ON rp.rechnung = r.id WHERE artikel in (".implode(', ', $artikekenterprisearr).") AND artikel <> 0 AND adresse = '$kundenid' AND r.datum >= (now() - INTERVAL 1 YEAR)");
|
||||
|
||||
@ -339,12 +342,16 @@ class Supportapp Extends GenSupportapp {
|
||||
$moredataarray = array();
|
||||
$schrittearray = array();
|
||||
$filterschritte = $app->DB->SelectArr("SELECT ws.id AS id, wg.bezeichnung AS wgb, ws.bezeichnung AS wsb FROM supportapp_schritte ws LEFT JOIN supportapp_gruppen wg ON ws.gruppe = wg.id WHERE ws.aktiv = '1' and filter = '1' ORDER BY wg.id, ws.sort");
|
||||
|
||||
if (!is_null($filterschritte)) {
|
||||
|
||||
if(count($filterschritte) > 0){
|
||||
for ($i=4; $i < count($filterschritte)+4; $i++) {
|
||||
$moredataarray[$i] = $app->Secure->GetGET("more_data".$i);
|
||||
$schrittearray[$i] = $filterschritte[$i-4]['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($more_data2 == 1)
|
||||
$where = " w.status='geplant' ";
|
||||
@ -678,6 +685,10 @@ class Supportapp Extends GenSupportapp {
|
||||
$kundenid = $this->app->DB->Select("SELECT id FROM adresse WHERE kundennummer ='$kundennummer' LIMIT 1");
|
||||
$mitarbeiterid = $this->app->DB->Select("SELECT id FROM adresse WHERE mitarbeiternummer = '$mitarbeiternummer' LIMIT 1");
|
||||
|
||||
if (gettype($startdatum) !== 'DateTimeInterface') {
|
||||
$startdatum = new DateTime('now');
|
||||
}
|
||||
|
||||
if($einrichtungid > 0){
|
||||
$this->app->DB->Update("UPDATE supportapp SET adresse='$kundenid',mitarbeiter='$mitarbeiterid',startdatum='".date_format($startdatum, 'Y-m-d')."',zeitgeplant='$zeitgeplant', intervall='$intervall', version='$version',bemerkung='$bemerkung',status='$status',phase='$phase' WHERE id='$einrichtungid'");
|
||||
}else{
|
||||
@ -703,6 +714,8 @@ class Supportapp Extends GenSupportapp {
|
||||
$this->app->erp->Headlines('','Einrichtung');
|
||||
$filterschritte = $this->app->DB->SelectArr("SELECT ws.id AS id, wg.bezeichnung AS wgb, ws.bezeichnung AS wsb FROM supportapp_schritte ws LEFT JOIN supportapp_gruppen wg ON ws.gruppe = wg.id WHERE ws.aktiv = '1' and filter = '1' ORDER BY wg.id, ws.sort");
|
||||
|
||||
if (!is_null($filterschritte)) {
|
||||
|
||||
if(count($filterschritte) > 0){
|
||||
$filterinhalt = "<fieldset style=\"width:33em;\"><legend>Einzelfilter</legend><table>";
|
||||
$filtergruppe_tmp = "";
|
||||
@ -725,6 +738,7 @@ class Supportapp Extends GenSupportapp {
|
||||
}
|
||||
$filterinhalt .= "</table></fieldset>";
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->YUI->DatePicker("startdatum");
|
||||
$this->app->YUI->CkEditor("bemerkung","basic",array('height'=>'200px', 'width'=>'500px'));
|
||||
@ -923,6 +937,9 @@ class Supportapp Extends GenSupportapp {
|
||||
$artikekenterprisearr = array(0);
|
||||
|
||||
$artikeltmp = $this->app->DB->SelectArr("SELECT wa.* FROM supportapp_artikel wa JOIN artikel a ON wa.artikel = a.id WHERE a.geloescht = 0");
|
||||
|
||||
if (!is_null($artikeltmp)) {
|
||||
|
||||
for ($i=0; $i < count($artikeltmp); $i++) {
|
||||
switch ($artikeltmp[$i]['typ']) {
|
||||
case '1':
|
||||
@ -936,6 +953,8 @@ class Supportapp Extends GenSupportapp {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$telefonsupport = $this->app->DB->Select("SELECT id FROM abrechnungsartikel WHERE artikel in (".implode(', ', $artikektelefonarr).") AND artikel <> 0 AND (enddatum IS NULL OR enddatum >= CURDATE()) AND adresse = '$kundenid' LIMIT 1");
|
||||
|
||||
$techniksupport = $this->app->DB->Select("SELECT id FROM abrechnungsartikel WHERE artikel in (".implode(', ', $artikektechnikerarr).") AND artikel <> 0 AND (enddatum IS NULL OR enddatum >= CURDATE()) AND adresse = '$kundenid' LIMIT 1");
|
||||
@ -955,6 +974,9 @@ class Supportapp Extends GenSupportapp {
|
||||
|
||||
if($kundenid != ''){
|
||||
$gruppenzumhinzufuegen= $this->app->DB->SelectArr("SELECT ap.id, was.gruppe FROM auftrag_position ap JOIN auftrag a ON ap.auftrag = a.id LEFT JOIN supportapp_gruppen wag ON ap.artikel = wag.artikel LEFT JOIN supportapp_schritte was ON wag.id = was.gruppe LEFT JOIN supportapp_auftrag_check wac ON wac.auftragposition = ap.id WHERE a.adresse = '$kundenid' AND a.status <> 'storniert' AND a.belegnr <> '' AND wag.aktiv = 1 AND was.aktiv = 1 AND ISNULL(wac.id) GROUP BY ap.id");
|
||||
|
||||
if (!is_null($gruppezumhinzufuegen)) {
|
||||
|
||||
for ($i=0; $i < count($gruppenzumhinzufuegen); $i++) {
|
||||
$einzelschritte = $this->app->DB->Select("SELECT * FROM supportapp_schritte WHERE aktiv = 1 AND gruppe = ".$gruppenzumhinzufuegen[$i]['gruppe']);
|
||||
for ($j=0; $j < count($einzelschritte); $j++) {
|
||||
@ -965,6 +987,7 @@ class Supportapp Extends GenSupportapp {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$updatedaten = $this->app->DB->SelectArr("SELECT w.*,
|
||||
@ -1045,6 +1068,9 @@ class Supportapp Extends GenSupportapp {
|
||||
<td>Rabatt</td>
|
||||
</tr>';
|
||||
$modules = $this->app->DB->SelectArr("SELECT DATE_FORMAT(a.datum,'%d.%m.%Y') AS datum, ar.nummer, ap.bezeichnung, ".$this->app->erp->FormatMenge("ap.menge")." AS menge, ".$this->app->erp->FormatPreis("ap.preis",2)." AS preis, ".$this->app->erp->FormatPreis("ap.rabatt",2)." AS rabatt FROM auftrag a LEFT JOIN auftrag_position ap ON a.id = ap.auftrag LEFT JOIN artikel ar ON ar.id = ap.artikel WHERE a.status <> 'angelegt' AND a.status <> 'storniert' AND a.adresse = '$kundenid'");
|
||||
|
||||
if (!is_null($modules)) {
|
||||
|
||||
for ($i=0; $i < count($modules); $i++) {
|
||||
$module .= '
|
||||
<tr>
|
||||
@ -1056,6 +1082,8 @@ class Supportapp Extends GenSupportapp {
|
||||
<td align="right">'.$modules[$i]['rabatt'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
$module .= '</table>';
|
||||
|
||||
$belege ='<table class="mkTable" cellpadding="0" cellspacing="0">
|
||||
@ -1070,6 +1098,9 @@ class Supportapp Extends GenSupportapp {
|
||||
$steuersatznormal = 1+$this->app->erp->GetStandardSteuersatzNormal()/100;
|
||||
$steuersatzermaessigt = 1+$this->app->erp->GetStandardSteuersatzErmaessigt()/100;
|
||||
$beleges = $this->app->DB->SelectArr("SELECT 'Angebot' AS art,a.belegnr, DATE_FORMAT(a.datum,'%d.%m.%Y') AS datum, ".$this->app->erp->FormatPreis("IF(ISNULL(SUM(ap.preis)),0,SUM(ap.preis*ap.menge*IF(ap.umsatzsteuer = 'normal',$steuersatznormal,$steuersatzermaessigt)))",2)." AS summe, a.status, CONCAT('<a href=\"index.php?module=angebot&action=pdf&id=',a.id,'\"><img src=\"themes/new/images/pdf.svg\" border=\"0\"></a>') AS pdf FROM angebot a LEFT JOIN angebot_position ap ON a.id = ap.angebot WHERE adresse = '$kundenid' GROUP BY a.id UNION SELECT 'Auftrag' AS art,a.belegnr, DATE_FORMAT(a.datum,'%d.%m.%Y') AS datum, ".$this->app->erp->FormatPreis("IF(ISNULL(SUM(ap.preis)),0,SUM(ap.preis*ap.menge*IF(ap.umsatzsteuer = 'normal',$steuersatznormal,$steuersatzermaessigt)))",2)." AS summe, a.status, CONCAT('<a href=\"index.php?module=auftrag&action=pdf&id=',a.id,'\"><img src=\"themes/new/images/pdf.svg\" border=\"0\"></a>') AS pdf FROM auftrag a LEFT JOIN auftrag_position ap ON a.id = ap.auftrag WHERE adresse = '$kundenid' GROUP BY a.id");
|
||||
|
||||
if (!is_null($beleges)) {
|
||||
|
||||
for ($i=0; $i < count($beleges); $i++) {
|
||||
$belege .= '
|
||||
<tr>
|
||||
@ -1081,6 +1112,8 @@ class Supportapp Extends GenSupportapp {
|
||||
<td><center>'.$beleges[$i]['pdf'].'</center></td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
$belege .= '</table>';
|
||||
|
||||
$logbuch ='<table class="mkTable" cellpadding="0" cellspacing="0">
|
||||
@ -1091,6 +1124,8 @@ class Supportapp Extends GenSupportapp {
|
||||
</tr>';
|
||||
$logbuchs = $this->app->DB->SelectArr("SELECT wl.logdatei, a.name, wl.details FROM supportapp_log wl LEFT JOIN adresse a ON wl.bearbeiter = a.id WHERE adresse = '$kundenid' ORDER BY wl.logdatei DESC");
|
||||
|
||||
if (!is_null($logbuchs)) {
|
||||
|
||||
for ($i=0; $i < count($logbuchs); $i++) {
|
||||
$logbuch .= '
|
||||
<tr>
|
||||
@ -1099,6 +1134,8 @@ class Supportapp Extends GenSupportapp {
|
||||
<td>'.$logbuchs[$i]['details'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
$logbuch .= '</table>';
|
||||
|
||||
$einrichtung ='<table class="mkTable" cellpadding="0" cellspacing="0">
|
||||
@ -1108,6 +1145,9 @@ class Supportapp Extends GenSupportapp {
|
||||
<td>Bemerkung</td>
|
||||
</tr>';
|
||||
$einrichtungs = $this->app->DB->SelectArr("SELECT status, DATE_FORMAT(startdatum,'%d.%m.%Y') AS startdatum ,bemerkung FROM supportapp WHERE adresse='$kundenid' ORDER BY startdatum");
|
||||
|
||||
if (!is_null($einrichtungs)) {
|
||||
|
||||
for ($i=0; $i < count($einrichtungs); $i++) {
|
||||
$einrichtung .= '
|
||||
<tr>
|
||||
@ -1116,13 +1156,17 @@ class Supportapp Extends GenSupportapp {
|
||||
<td>'.$einrichtungs[$i]['bemerkung'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
$einrichtung .= '</table>';
|
||||
}
|
||||
|
||||
$einrichtung .= '</table>';
|
||||
|
||||
$gruppen = $this->app->DB->SelectArr("SELECT wag.id AS id, ap.id AS auftragsposition, a.belegnr AS auftrag, ap.bezeichnung AS bezeichnung, COUNT(was.id) AS gesamt, x.erledigt FROM auftrag_position ap JOIN auftrag a ON ap.auftrag = a.id LEFT JOIN supportapp_gruppen wag ON ap.artikel = wag.artikel LEFT JOIN supportapp_schritte was ON wag.id = was.gruppe LEFT JOIN (SELECT auftragposition, SUM(status) AS erledigt FROM supportapp_auftrag_check WHERE adresse = '$kundenid' GROUP BY auftragposition) x ON x.auftragposition = ap.id WHERE a.adresse = '$kundenid' AND a.status <> 'storniert' AND a.belegnr <> '' AND wag.aktiv = 1 AND was.aktiv = 1 GROUP BY ap.id");
|
||||
$checkboxen = "<table>";
|
||||
$zeilen = 0;
|
||||
$kopfzeilen = 0;
|
||||
|
||||
if (!is_null($gruppen)) {
|
||||
|
||||
for ($i=0; $i < count($gruppen); $i++) {
|
||||
if($gruppen[$i]['gesamt'] > $gruppen[$i]['erledigt']){
|
||||
$schritte = $this->app->DB->SelectArr("SELECT ws.*, IF(wac.status=1,1,0) AS status FROM supportapp_schritte ws LEFT JOIN (SELECT * FROM supportapp_auftrag_check WHERE adresse = '".$kundenid."' AND auftragposition = '".$gruppen[$i]['auftragsposition']."') wac ON ws.id = wac.schritt WHERE ws.gruppe = '".$gruppen[$i]['id']."' AND ws.aktiv = '1' ORDER BY sort ASC");
|
||||
@ -1143,6 +1187,9 @@ class Supportapp Extends GenSupportapp {
|
||||
$checkboxen .= '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$checkboxen .= "</table>";
|
||||
|
||||
$stundensumme = $this->app->DB->Select("SELECT IFNULL(SUM(TIME_TO_SEC(TIMEDIFF(bis, von)))/3600,0) AS Dauer FROM zeiterfassung WHERE adresse_abrechnung = '$kundenid' AND MONTH(von) = MONTH(CURRENT_DATE) AND YEAR(von) = YEAR(CURRENT_DATE)");
|
||||
@ -1159,10 +1206,13 @@ class Supportapp Extends GenSupportapp {
|
||||
$this->supportappMenuNormal($kundenid);
|
||||
$vorlagenarray = $this->app->DB->SelectArr("SELECT * FROM supportapp_vorlagen");
|
||||
$vorlagen = "";
|
||||
|
||||
if (!is_null($vorlagenarray)) {
|
||||
|
||||
for ($i=0; $i < count($vorlagenarray); $i++) {
|
||||
$vorlagen .= '<option value="'.$vorlagenarray[$i]['id'].'">'.$vorlagenarray[$i]['bezeichnung'].'</option>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($telefonsupport == ''){
|
||||
$this->app->Tpl->Set("TELEFON", "telefonsupport_grey.png");
|
||||
@ -1406,7 +1456,7 @@ class Supportapp Extends GenSupportapp {
|
||||
FROM zeiterfassung z LEFT JOIN projekt p ON p.id=z.projekt LEFT JOIN arbeitspaket ap ON z.arbeitspaket=ap.id LEFT JOIN adresse a ON z.adresse=a.id
|
||||
WHERE z.adresse_abrechnung=".$adresse."
|
||||
ORDER BY z.id DESC LIMIT 100
|
||||
");
|
||||
",0,"");
|
||||
$table->DisplayNew('LETZTEBUCHUNGEN',"Mitarbeiter","noAction");
|
||||
|
||||
$adr = $this->app->DB->SelectArr("select *, DATE_FORMAT(mandatsreferenzdatum, '%e.%m.%Y') AS mandatsreferenzdatumd from adresse where id = ".$adresse." limit 1");
|
||||
@ -1428,15 +1478,13 @@ class Supportapp Extends GenSupportapp {
|
||||
}
|
||||
|
||||
$table = new EasyTable($this->app);
|
||||
$table->Query("SELECT a.name, a.bereich, a.email, a.telefon, a.mobil FROM ansprechpartner a WHERE adresse='$adresse' AND a.name!='Neuer Datensatz' ORDER by id DESC");
|
||||
$table->Query("SELECT a.name, a.bereich, a.email, a.telefon, a.mobil FROM ansprechpartner a WHERE adresse='$adresse' AND a.name!='Neuer Datensatz' ORDER by id DESC",0,"");
|
||||
$table->DisplayNew('ANSPRECHPARTNER',"Mobil","noAction");
|
||||
|
||||
$table = new EasyTable($this->app);
|
||||
$table->Query("SELECT DATE_FORMAT(a.datum,'%d.%m.%Y') as datum,a.belegnr as auftrag, ap.nummer as 'Artikel-Nr.',CONCAT('<b>',ap.bezeichnung,'</b><br>',REPLACE(ap.beschreibung,'\r\n','<br>')) as bezeichnung, ap.menge FROM auftrag a LEFT JOIN auftrag_position ap ON ap.auftrag=a.id WHERE a.adresse='$adresse' ORDER by ap.id DESC");
|
||||
$table->Query("SELECT DATE_FORMAT(a.datum,'%d.%m.%Y') as datum,a.belegnr as auftrag, ap.nummer as 'Artikel-Nr.',CONCAT('<b>',ap.bezeichnung,'</b><br>',REPLACE(ap.beschreibung,'\r\n','<br>')) as bezeichnung, ap.menge FROM auftrag a LEFT JOIN auftrag_position ap ON ap.auftrag=a.id WHERE a.adresse='$adresse' ORDER by ap.id DESC",0,"");
|
||||
$table->DisplayNew('ARTIKEL',"Menge","noAction",false,0,0,false);
|
||||
|
||||
|
||||
|
||||
$this->app->Tpl->Output("supportapp_minidetail.tpl");
|
||||
exit;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user