mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
WaWi:
- Nummern-Format bei Rechnungen korrigiert - Check für nicht gelieferte Bestellungen
This commit is contained in:
@@ -943,6 +943,54 @@ class wawi_bestellung extends basis_db
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Gibt alle Bestellungen die Bestellt aber nicht geliefert wurden
|
||||||
|
*/
|
||||||
|
public function loadBestellungNichtGeliefert()
|
||||||
|
{
|
||||||
|
$qry ="SELECT * FROM wawi.tbl_bestellung b WHERE
|
||||||
|
EXISTS (SELECT bestellung_id FROM wawi.tbl_bestellung_bestellstatus where bestellung_id=b.bestellung_id AND bestellstatus_kurzbz ='Bestellung')
|
||||||
|
AND NOT EXISTS (SELECT bestellung_id FROM wawi.tbl_bestellung_bestellstatus where bestellung_id=b.bestellung_id AND bestellstatus_kurzbz ='Lieferung')
|
||||||
|
AND b.insertamum>CURRENT_DATE - '1 year'::interval
|
||||||
|
order by bestellung_id";
|
||||||
|
|
||||||
|
if($result = $this->db_query($qry))
|
||||||
|
{
|
||||||
|
while($row = $this->db_fetch_object($result))
|
||||||
|
{
|
||||||
|
$bestellung = new wawi_bestellung();
|
||||||
|
|
||||||
|
$bestellung->bestellung_id = $row->bestellung_id;
|
||||||
|
$bestellung->bestell_nr = $row->bestell_nr;
|
||||||
|
$bestellung->titel = $row->titel;
|
||||||
|
$bestellung->bemerkung = $row->bemerkung;
|
||||||
|
$bestellung->liefertermin = $row->liefertermin;
|
||||||
|
$bestellung->besteller_uid = $row->besteller_uid;
|
||||||
|
$bestellung->lieferadresse = $row->lieferadresse;
|
||||||
|
$bestellung->kostenstelle_id = $row->kostenstelle_id;
|
||||||
|
$bestellung->konto_id = $row->konto_id;
|
||||||
|
$bestellung->rechnungsadresse = $row->rechnungsadresse;
|
||||||
|
$bestellung->firma_id = $row->firma_id;
|
||||||
|
$bestellung->freigegeben = ($row->freigegeben=='t'?true:false);
|
||||||
|
$bestellung->updateamum = $row->updateamum;
|
||||||
|
$bestellung->updatevon = $row->updatevon;
|
||||||
|
$bestellung->insertamum = $row->insertamum;
|
||||||
|
$bestellung->insertvon = $row->insertvon;
|
||||||
|
$bestellung->ext_id = $row->ext_id;
|
||||||
|
$bestellung->zahlungstyp_kurzbz = $row->zahlungstyp_kurzbz;
|
||||||
|
|
||||||
|
$this->result[] = $bestellung;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->errormsg ="Fehler bei der Abfrage aufgetreten.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* true wenn die Bestellung schon freigegeben wurde
|
* true wenn die Bestellung schon freigegeben wurde
|
||||||
|
|||||||
+83
-62
@@ -57,17 +57,32 @@ require_once '../include/firma.class.php';
|
|||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<h1>Check Bestellungen</h1>
|
||||||
<?php
|
<?php
|
||||||
$min = (isset($_POST['min'])?$_REQUEST['min']:'1');
|
$min = (isset($_POST['min'])?$_REQUEST['min']:'1');
|
||||||
$max = (isset($_POST['max'])?$_REQUEST['max']:'42');
|
$max = (isset($_POST['max'])?$_REQUEST['max']:'42');
|
||||||
|
$type = (isset($_GET['type'])?$_GET['type']:'');
|
||||||
|
|
||||||
echo ' <form action ="check_bestellung.php" method="post" name="checkForm">
|
echo '
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<form action ="check_bestellung.php" method="post" name="checkForm">
|
||||||
<table>
|
<table>
|
||||||
<tr><td>min (Wochen): </td><td><input type="text" name="min" id="min" value="'.$min.'"></td></tr>
|
<tr><td>min (Wochen): </td><td><input type="text" name="min" id="min" value="'.$min.'"></td></tr>
|
||||||
<tr><td>max (Wochen): </td><td><input type="text" name="max" id="max" value="'.$max.'"></td></tr>
|
<tr><td>max (Wochen): </td><td><input type="text" name="max" id="max" value="'.$max.'"></td></tr>
|
||||||
<tr><td> </td><td><input type="submit" name="submit" value="anzeigen" onclick="return checkKst();"></td></tr>
|
<tr><td> </td><td><input type="submit" name="submit" value="anzeigen" onclick="return checkKst();"></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</form>';
|
</form>
|
||||||
|
</td>
|
||||||
|
<td width="100px"> </td>
|
||||||
|
<td valign="top">
|
||||||
|
<form action ="check_bestellung.php?type=nichtgeliefert" method="post" name="checkForm">
|
||||||
|
<input type="submit" name="submit" value="Nicht gelieferte Bestellungen anzeigen"></td></tr>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>';
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -82,67 +97,73 @@ echo '
|
|||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
$date = new datum();
|
$date = new datum();
|
||||||
$firma = new firma();
|
$firma = new firma();
|
||||||
if(is_numeric($min) && is_numeric($max))
|
|
||||||
|
$bestellung = new wawi_bestellung();
|
||||||
|
if($type=='nichtgeliefert')
|
||||||
|
$bestellung->loadBestellungNichtGeliefert();
|
||||||
|
else if(is_numeric($min) && is_numeric($max))
|
||||||
{
|
{
|
||||||
$bestellung = new wawi_bestellung();
|
|
||||||
$bestellung->loadBestellungForCheck($min, $max);
|
$bestellung->loadBestellungForCheck($min, $max);
|
||||||
|
|
||||||
echo ' <table id="checkTable" class="tablesorter" width ="100%">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th></th>
|
|
||||||
<th>Bestellnr.</th>
|
|
||||||
<th>Bestell_ID</th>
|
|
||||||
<th>Firma</th>
|
|
||||||
<th>Erstellung</th>
|
|
||||||
<th>Freigegeben</th>
|
|
||||||
<th>Geliefert</th>
|
|
||||||
<th>Bestellt</th>
|
|
||||||
<th>Brutto</th>
|
|
||||||
<th>Titel</th>
|
|
||||||
<th>Letze Änderung</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>';
|
|
||||||
foreach($bestellung->result as $row)
|
|
||||||
{
|
|
||||||
$firmenname = '';
|
|
||||||
$geliefert ='nein';
|
|
||||||
$bestellt ='nein';
|
|
||||||
$status = new wawi_bestellstatus();
|
|
||||||
if(is_numeric($row->firma_id))
|
|
||||||
{
|
|
||||||
$firma->load($row->firma_id);
|
|
||||||
$firmenname = $firma->name;
|
|
||||||
}
|
|
||||||
if($row->freigegeben == '1')
|
|
||||||
$freigegeben = 'ja';
|
|
||||||
else
|
|
||||||
$freigegeben = 'nein';
|
|
||||||
|
|
||||||
if($status->isStatiVorhanden($row->bestellung_id, 'Lieferung'))
|
|
||||||
$geliefert = 'ja';
|
|
||||||
|
|
||||||
if($status->isStatiVorhanden($row->bestellung_id, 'Bestellung'))
|
|
||||||
$bestellt = 'ja';
|
|
||||||
|
|
||||||
$brutto = $bestellung->getBrutto($row->bestellung_id);
|
|
||||||
echo ' <tr>
|
|
||||||
<td nowrap><a href="bestellung.php?method=update&id='.$row->bestellung_id.'" title="Bestellung bearbeiten"> <img src="../skin/images/edit_wawi.gif"></a><a href="bestellung.php?method=delete&id='.$row->bestellung_id.'" onclick="return conf_del()" title="Bestellung löschen"> <img src="../skin/images/delete_x.png"></a></td>
|
|
||||||
<td>'.$row->bestell_nr.'</td>
|
|
||||||
<td>'.$row->bestellung_id.'</td>
|
|
||||||
<td>'.$firmenname.'</td>
|
|
||||||
<td>'.$date->formatDatum($row->insertamum, "d.m.Y").'</td>
|
|
||||||
<td>'.$freigegeben.'</td>
|
|
||||||
<td>'.$geliefert.'</td>
|
|
||||||
<td>'.$bestellt.'</td>
|
|
||||||
<td>'.number_format($brutto, 2, ",",".").'</td>
|
|
||||||
<td>'.$row->titel.'</td>
|
|
||||||
<td nowrap>'.$date->formatDatum($row->updateamum, "d.m.Y").' '.$row->updatevon.'</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
echo ' </tbody>
|
|
||||||
</table>';
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
die('Fehlerhafte Parameter');
|
||||||
|
|
||||||
|
echo ' <table id="checkTable" class="tablesorter" width ="100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>Bestellnr.</th>
|
||||||
|
<th>Bestell_ID</th>
|
||||||
|
<th>Firma</th>
|
||||||
|
<th>Erstellung</th>
|
||||||
|
<th>Freigegeben</th>
|
||||||
|
<th>Geliefert</th>
|
||||||
|
<th>Bestellt</th>
|
||||||
|
<th>Brutto</th>
|
||||||
|
<th>Titel</th>
|
||||||
|
<th>Letze Änderung</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>';
|
||||||
|
foreach($bestellung->result as $row)
|
||||||
|
{
|
||||||
|
$firmenname = '';
|
||||||
|
$geliefert ='nein';
|
||||||
|
$bestellt ='nein';
|
||||||
|
$status = new wawi_bestellstatus();
|
||||||
|
if(is_numeric($row->firma_id))
|
||||||
|
{
|
||||||
|
$firma->load($row->firma_id);
|
||||||
|
$firmenname = $firma->name;
|
||||||
|
}
|
||||||
|
if($row->freigegeben == '1')
|
||||||
|
$freigegeben = 'ja';
|
||||||
|
else
|
||||||
|
$freigegeben = 'nein';
|
||||||
|
|
||||||
|
if($status->isStatiVorhanden($row->bestellung_id, 'Lieferung'))
|
||||||
|
$geliefert = 'ja';
|
||||||
|
|
||||||
|
if($status->isStatiVorhanden($row->bestellung_id, 'Bestellung'))
|
||||||
|
$bestellt = 'ja';
|
||||||
|
|
||||||
|
$brutto = $bestellung->getBrutto($row->bestellung_id);
|
||||||
|
echo ' <tr>
|
||||||
|
<td nowrap><a href="bestellung.php?method=update&id='.$row->bestellung_id.'" title="Bestellung bearbeiten"> <img src="../skin/images/edit_wawi.gif"></a><a href="bestellung.php?method=delete&id='.$row->bestellung_id.'" onclick="return conf_del()" title="Bestellung löschen"> <img src="../skin/images/delete_x.png"></a></td>
|
||||||
|
<td>'.$row->bestell_nr.'</td>
|
||||||
|
<td>'.$row->bestellung_id.'</td>
|
||||||
|
<td>'.$firmenname.'</td>
|
||||||
|
<td>'.$date->formatDatum($row->insertamum, "d.m.Y").'</td>
|
||||||
|
<td>'.$freigegeben.'</td>
|
||||||
|
<td>'.$geliefert.'</td>
|
||||||
|
<td>'.$bestellt.'</td>
|
||||||
|
<td align="right">'.number_format($brutto, 2, ",",".").'</td>
|
||||||
|
<td>'.$row->titel.'</td>
|
||||||
|
<td nowrap>'.$date->formatDatum($row->updateamum, "d.m.Y").' '.$row->updatevon.'</td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
echo ' </tbody>
|
||||||
|
</table>';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
+2
-2
@@ -334,7 +334,7 @@ if($aktion == 'suche')
|
|||||||
echo '<td>'.$row->bestell_nr."</td>\n";
|
echo '<td>'.$row->bestell_nr."</td>\n";
|
||||||
echo '<td>'.$date->formatDatum($row->rechnungsdatum, 'd.m.Y')."</td>\n";
|
echo '<td>'.$date->formatDatum($row->rechnungsdatum, 'd.m.Y')."</td>\n";
|
||||||
echo '<td>'.$row->buchungstext."</td>\n";
|
echo '<td>'.$row->buchungstext."</td>\n";
|
||||||
echo '<td class="number">'.number_format($brutto,2,".","")."</td>\n";
|
echo '<td class="number">'.number_format($brutto,2,",",".")."</td>\n";
|
||||||
echo '<td>'.$freigegeben=($row->freigegeben=='t')?'ja':'nein'."</td>\n";
|
echo '<td>'.$freigegeben=($row->freigegeben=='t')?'ja':'nein'."</td>\n";
|
||||||
echo '<td>'.$date->formatDatum($row->updateamum,'d.m.Y H:i:s').' '.$row->updatevon ."</td>\n";
|
echo '<td>'.$date->formatDatum($row->updateamum,'d.m.Y H:i:s').' '.$row->updatevon ."</td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
@@ -346,7 +346,7 @@ if($aktion == 'suche')
|
|||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>Summe</th>
|
<th>Summe</th>
|
||||||
<th class="number">'.number_format($brutto_gesamt,2).'</th>
|
<th class="number">'.number_format($brutto_gesamt,2,",",".").'</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</table>';
|
</table>';
|
||||||
|
|||||||
Reference in New Issue
Block a user