seriennummern bugfix lieferschein check message

This commit is contained in:
OpenXE 2024-08-07 12:11:32 +02:00
parent 8f3d2a6ade
commit 934bd151ea
2 changed files with 42 additions and 26 deletions

View File

@ -2,6 +2,10 @@
<ul> <ul>
<li><a href="#tabs-1">[TABTEXT1]</a></li> <li><a href="#tabs-1">[TABTEXT1]</a></li>
</ul> </ul>
<div id="tabs-1">
[MESSAGE]
<form action="" method="post">
[FORMHANDLEREVENT]
<div class="filter-box filter-usersave"> <div class="filter-box filter-usersave">
<div class="filter-block filter-inline"> <div class="filter-block filter-inline">
<div class="filter-title">{|Filter|} <div class="filter-title">{|Filter|}
@ -20,9 +24,10 @@
</ul> </ul>
</div> </div>
</div> </div>
<div id="tabs-1"> </form>
[MESSAGE] <div class="row" [ARTIKEL_HIDDEN]>
[TAB1] [TAB1]
[TAB1NEXT] [TAB1NEXT]
</div> </div>
</div> </div>
</div>

View File

@ -425,6 +425,8 @@ class Seriennummern {
$groupby = "GROUP BY lp.id"; $groupby = "GROUP BY lp.id";
$orderby = "ORDER BY lp.sort ASC";
// echo($sql." WHERE ".$where." ".$groupby); // echo($sql." WHERE ".$where." ".$groupby);
break; break;
@ -472,7 +474,7 @@ class Seriennummern {
function seriennummern_delivery_note_check_and_message($lieferschein_id) { function seriennummern_delivery_note_check_and_message($lieferschein_id) {
$check_delivery_notes = $this->seriennummern_check_delivery_notes($lieferschein_id); $check_delivery_notes = $this->seriennummern_check_delivery_notes($lieferschein_id, group_lieferschein: true);
if (!empty($check_delivery_notes)) { if (!empty($check_delivery_notes)) {
$lieferschein_minus_links = array(); $lieferschein_minus_links = array();
$lieferschein_plus_links = array(); $lieferschein_plus_links = array();
@ -931,12 +933,21 @@ class Seriennummern {
* Check if all delivery notes have serials * Check if all delivery notes have serials
* Return array of delivery note positions and head information * Return array of delivery note positions and head information
*/ */
public function seriennummern_check_delivery_notes($lieferschein_id = null, $ignore_date = false, $only_missing = true) : array { public function seriennummern_check_delivery_notes($lieferschein_id = null, $ignore_date = false, $only_missing = true, $group_lieferschein = false) : array {
if ($group_lieferschein) {
$sql_lp = "''";
$sql_lp_group = "";
} else {
$sql_lp = "lp.id";
$sql_lp_group = ", lp.id";
}
$sql = " $sql = "
SELECT SQL_CALC_FOUND_ROWS SELECT SQL_CALC_FOUND_ROWS
l.id lieferschein, l.id lieferschein,
l.belegnr belegnr, l.belegnr belegnr,
lp.id lieferschein_position, $sql_lp lieferschein_position,
a.id artikel, a.id artikel,
a.nummer artikel_nummer, a.nummer artikel_nummer,
a.name_de, a.name_de,
@ -971,12 +982,12 @@ class Seriennummern {
) )
AND (l.id = '".$lieferschein_id."' OR '".$lieferschein_id."' = '') AND (l.id = '".$lieferschein_id."' OR '".$lieferschein_id."' = '')
GROUP BY GROUP BY
l.id, l.id
lp.id $sql_lp_group
"; ";
if ($only_missing) { if ($only_missing) {
$sql .= " HAVING menge_lieferschein > menge_nummern"; $sql .= " HAVING menge_lieferschein <> menge_nummern";
} }
$result = $this->app->DB->SelectArr($sql); $result = $this->app->DB->SelectArr($sql);