mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2025-01-27 13:01:13 +01:00
seriennummern lieferschein enter()
This commit is contained in:
parent
a907a9fa3f
commit
c486b241bd
@ -91424,7 +91424,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Field": "datum",
|
"Field": "datum",
|
||||||
"Type": "date",
|
"Type": "datetime",
|
||||||
"Collation": null,
|
"Collation": null,
|
||||||
"Null": "NO",
|
"Null": "NO",
|
||||||
"Key": "",
|
"Key": "",
|
||||||
|
@ -17,148 +17,148 @@
|
|||||||
<div class="col-xs-14 col-md-6 col-md-height">
|
<div class="col-xs-14 col-md-6 col-md-height">
|
||||||
<div class="inside inside-full-height">
|
<div class="inside inside-full-height">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{|Lieferscheinpositionen|}</legend>
|
<legend [LIEFERSCHEIN_HIDDEN]>{|Lieferscheinpositionen|}</legend>
|
||||||
[LIEFERSCHEINPOSITIONEN]
|
<legend [ARTIKEL_HIDDEN]>{|Seriennummern|}</legend>
|
||||||
|
[POSITIONEN]
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-14 col-md-6 col-md-height">
|
<div class="col-xs-14 col-md-6 col-md-height">
|
||||||
<div class="inside inside-full-height">
|
<div class="inside inside-full-height">
|
||||||
<div class="row">
|
<fieldset>
|
||||||
<div class="row-height">
|
<legend>{|Seriennummern erfassen [LEGEND]|}</legend>
|
||||||
<div class="col-xs-14 col-md-14 col-md-height">
|
<table width="100%" border="0" class="mkTableFormular">
|
||||||
<div class="inside inside-full-height">
|
<tr [ARTIKEL_HIDDEN]>
|
||||||
<fieldset>
|
<td>
|
||||||
<legend>{|Seriennummern erfassen [LEGEND]|}</legend>
|
{|Lagermenge|}:
|
||||||
<table width="100%" border="0" class="mkTableFormular">
|
</td>
|
||||||
<tr [ARTIKEL_HIDDEN]>
|
<td>
|
||||||
<td>
|
<input type="text" value="[ANZLAGER]" size="40" disabled />
|
||||||
{|Lagermenge|}:
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
<td>
|
<tr [ARTIKEL_HIDDEN]>
|
||||||
<input type="text" value="[ANZLAGER]" size="40" disabled />
|
<td>
|
||||||
</td>
|
{|Seriennummern verfügbar|}:
|
||||||
</tr>
|
</td>
|
||||||
<tr [ARTIKEL_HIDDEN]>
|
<td>
|
||||||
<td>
|
<input type="text" value="[ANZVORHANDEN]" size="40" disabled />
|
||||||
{|Seriennummern verfügbar|}:
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
<td>
|
<tr [LIEFERSCHEIN_HIDDEN]>
|
||||||
<input type="text" value="[ANZVORHANDEN]" size="40" disabled />
|
<td>
|
||||||
</td>
|
{|Menge auf Lieferschein|}:
|
||||||
</tr>
|
</td>
|
||||||
<tr [ARTIKEL_HIDDEN]>
|
<td>
|
||||||
<td>
|
<input type="text" value="[ANZLIEFERSCHEIN]" size="40" disabled />
|
||||||
{|Seriennummern fehlen|}:
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
<td>
|
<tr [LIEFERSCHEIN_HIDDEN]>
|
||||||
<input type="text" value="[ANZFEHLT]" size="40" disabled />
|
<td>
|
||||||
</td>
|
{|Seriennummern zugeordnet|}:
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
<td>
|
||||||
<td>
|
<input type="text" value="[ANZVORHANDEN]" size="40" disabled />
|
||||||
{|Seriennummer scannen|}:
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
<td>
|
<tr>
|
||||||
<input type="text" name="eingabescan" id="eingabescan" value="[EINGABESCAN]" size="40" autofocus />
|
<td>
|
||||||
</td>
|
{|Seriennummern fehlen|}:
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
<td>
|
||||||
<td>
|
<input type="text" value="[ANZFEHLT]" size="40" disabled />
|
||||||
{|Seriennummer wählen|}:
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
<td>
|
<tr [ARTIKEL_HIDDEN] [EINGABE_HIDDEN]>
|
||||||
<input type="text" name="eingabe" id="eingabe" value="[EINGABE]" size="40" />
|
<td>
|
||||||
</td>
|
{|Seriennummer scannen|}:
|
||||||
</tr>
|
</td>
|
||||||
</table>
|
<td>
|
||||||
</fieldset>
|
<input type="text" name="eingabescan" id="eingabescan" value="[EINGABESCAN]" size="40" autofocus />
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
<tr [LIEFERSCHEIN_HIDDEN] [EINGABE_HIDDEN]>
|
||||||
</div>
|
<td>
|
||||||
<div class="row">
|
{|Seriennummer wählen|}:
|
||||||
<div class="row-height">
|
</td>
|
||||||
<div class="col-xs-14 col-md-14 col-md-height">
|
<td>
|
||||||
<div class="inside inside-full-height">
|
<input type="text" name="eingabe" id="eingabe" value="[EINGABE]" size="40" autofocus/>
|
||||||
<fieldset>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr [EINGABE_HIDDEN]>
|
||||||
|
<td>
|
||||||
|
<fieldset>
|
||||||
<legend>{|Seriennummernassistent|}</legend>
|
<legend>{|Seriennummernassistent|}</legend>
|
||||||
<table width="100%" border="0" class="mkTableFormular">
|
</fieldset>
|
||||||
<tr>
|
</tr>
|
||||||
<td>
|
</tr>
|
||||||
{|Letzte Seriennummer|}:
|
<tr [EINGABE_HIDDEN]>
|
||||||
</td>
|
<td [ARTIKEL_HIDDEN]>
|
||||||
<td>
|
{|Letzte Seriennummer|}:
|
||||||
<input type="text" name="muster" id="muster" value="[LETZTE]" size="40" disabled />
|
</td>
|
||||||
</td>
|
<td [LIEFERSCHEIN_HIDDEN]>
|
||||||
</tr>
|
{|Nächste Seriennummer|}:
|
||||||
<tr>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{|Präfix|}:
|
<input type="text" name="muster" id="muster" value="[LETZTE]" size="40" disabled />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
</tr>
|
||||||
<input type="text" name="praefix" id="praefix" value="[PRAEFIX]" size="40" />
|
<tr [EINGABE_HIDDEN]>
|
||||||
</td>
|
<td>
|
||||||
</tr>
|
{|Präfix|}:
|
||||||
<tr>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{|Start|}:
|
<input type="text" name="praefix" id="praefix" value="[PRAEFIX]" size="40" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
</tr>
|
||||||
<input type="number" name="start" id="start" value="[START]" size="40" />
|
<tr [EINGABE_HIDDEN]>
|
||||||
</td>
|
<td>
|
||||||
</tr>
|
{|Start|}:
|
||||||
<tr>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{|Postfix|}:
|
<input type="number" name="start" id="start" value="[START]" size="40" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
</tr>
|
||||||
<input type="text" name="postfix" id="postfix" value="[POSTFIX]" size="40" />
|
<tr [EINGABE_HIDDEN]>
|
||||||
</td>
|
<td>
|
||||||
</tr>
|
{|Postfix|}:
|
||||||
<tr>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{|Anzahl|}:
|
<input type="text" name="postfix" id="postfix" value="[POSTFIX]" size="40" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
</tr>
|
||||||
<input type="number" name="anzahl" id="anzahl" value="[ANZAHL]" size="40" />
|
<tr [EINGABE_HIDDEN]>
|
||||||
</td>
|
<td>
|
||||||
</tr>
|
{|Anzahl|}:
|
||||||
</table>
|
</td>
|
||||||
</fieldset>
|
<td>
|
||||||
</div>
|
<input type="number" name="anzahl" id="anzahl" value="[ANZAHL]" size="40" />
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
<tr [EINGABE_HIDDEN]>
|
||||||
<div class="row">
|
<td>
|
||||||
<div class="row-height">
|
<fieldset>
|
||||||
<div class="col-xs-14 col-md-14 col-md-height">
|
|
||||||
<div class="inside inside-full-height">
|
|
||||||
<fieldset>
|
|
||||||
<legend>{|Gewählte Seriennummern|}</legend>
|
<legend>{|Gewählte Seriennummern|}</legend>
|
||||||
<table width="100%" border="0" class="mkTableFormular">
|
</fieldset>
|
||||||
<tr>
|
</tr>
|
||||||
<td>
|
</tr>
|
||||||
{|Seriennummern|}:
|
<tr [EINGABE_HIDDEN]>
|
||||||
</td>
|
<td>
|
||||||
<td>
|
{|Seriennummern|}:
|
||||||
<textarea name="seriennummern" id="seriennummern" rows="20" style="width:100%;">[SERIENNUMMERN]</textarea>
|
</td>
|
||||||
<i>Liste der Seriennummern, 1 pro Zeile</i>
|
<td>
|
||||||
</td>
|
<textarea name="seriennummern" id="seriennummern" rows="20" style="width:100%;">[SERIENNUMMERN]</textarea>
|
||||||
</tr>
|
<i>Liste der Seriennummern, 1 pro Zeile</i>
|
||||||
</table>
|
</td>
|
||||||
</fieldset>
|
</tr>
|
||||||
</div>
|
</table>
|
||||||
</div>
|
<fieldset>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-14 col-md-2 col-md-height">
|
<div class="col-xs-14 col-md-2 col-md-height">
|
||||||
<div class="inside inside-full-height">
|
<div class="inside inside-full-height">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{|<!--Legend for this form area goes here>-->Aktionen|}</legend>
|
<legend>{|<!--Legend for this form area goes here>-->Aktionen|}</legend>
|
||||||
<table width="100%" border="0" class="mkTableFormular">
|
<table width="100%" border="0" class="mkTableFormular" [EINGABE_HIDDEN]>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<button name="submit" value="hinzufuegen" class="ui-button-icon" style="width:100%;">Hinzufügen</button>
|
<button name="submit" value="hinzufuegen" class="ui-button-icon" style="width:100%;">Hinzufügen</button>
|
||||||
@ -179,7 +179,7 @@
|
|||||||
<button name="submit" value="einlagern" class="ui-button-icon" style="width:100%;">Einlagern</button>
|
<button name="submit" value="einlagern" class="ui-button-icon" style="width:100%;">Einlagern</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr [LIEFERSCHEIN_HIDDEN]>
|
||||||
<td>
|
<td>
|
||||||
<button name="submit" value="lieferscheinzuordnen" class="ui-button-icon" style="width:100%;">Zuordnen</button>
|
<button name="submit" value="lieferscheinzuordnen" class="ui-button-icon" style="width:100%;">Zuordnen</button>
|
||||||
</td>
|
</td>
|
||||||
|
28
www/pages/content/seriennummern_lieferscheine_list.tpl
Normal file
28
www/pages/content/seriennummern_lieferscheine_list.tpl
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<div id="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||||
|
</ul>
|
||||||
|
<div class="filter-box filter-usersave">
|
||||||
|
<div class="filter-block filter-inline">
|
||||||
|
<div class="filter-title">{|Filter|}
|
||||||
|
</div>
|
||||||
|
<ul class="filter-list">
|
||||||
|
<li class="filter-item">
|
||||||
|
<label for="altelieferscheine" class="switch">
|
||||||
|
<input type="checkbox" id="altelieferscheine" />
|
||||||
|
<span class="slider round">
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<label for="altelieferscheine">
|
||||||
|
{|Zzgl. alte Lieferscheine|}
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="tabs-1">
|
||||||
|
[MESSAGE]
|
||||||
|
[TAB1]
|
||||||
|
[TAB1NEXT]
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -21,6 +21,7 @@ class Seriennummern {
|
|||||||
$this->app->ActionHandler("lieferscheine_list", "seriennummern_lieferscheine_list");
|
$this->app->ActionHandler("lieferscheine_list", "seriennummern_lieferscheine_list");
|
||||||
$this->app->ActionHandler("enter", "seriennummern_enter");
|
$this->app->ActionHandler("enter", "seriennummern_enter");
|
||||||
$this->app->ActionHandler("delete", "seriennummern_delete");
|
$this->app->ActionHandler("delete", "seriennummern_delete");
|
||||||
|
$this->app->ActionHandler("remove", "seriennummern_remove");
|
||||||
$this->app->ActionHandler("minidetail", "seriennummern_minidetail");
|
$this->app->ActionHandler("minidetail", "seriennummern_minidetail");
|
||||||
$this->app->DefaultActionHandler("list");
|
$this->app->DefaultActionHandler("list");
|
||||||
$this->app->ActionHandlerListen($app);
|
$this->app->ActionHandlerListen($app);
|
||||||
@ -34,13 +35,15 @@ class Seriennummern {
|
|||||||
switch ($name) {
|
switch ($name) {
|
||||||
case "seriennummern_list":
|
case "seriennummern_list":
|
||||||
$allowed['seriennummern_list'] = array('list');
|
$allowed['seriennummern_list'] = array('list');
|
||||||
$heading = array('Artikel-Nr.','Artikel', 'Seriennummer','Erfasst am','Eingelagert','Adresse','Lieferschein','Lieferdatum', 'Menü');
|
// $heading = array('Artikel-Nr.','Artikel', 'Seriennummer','Erfasst am','Eingelagert','Adresse','Lieferschein','Lieferdatum', 'Menü');
|
||||||
$width = array('10%','20%','20%'); // Fill out manually later
|
$heading = array('Artikel-Nr.','Artikel', 'Seriennummer','Erfasst am','Eingelagert', 'Menü');
|
||||||
|
$width = array('10%','20%','20%','10%','1%','1%'); // Fill out manually later
|
||||||
|
|
||||||
// columns that are aligned right (numbers etc)
|
// columns that are aligned right (numbers etc)
|
||||||
// $alignright = array(4,5,6,7,8);
|
// $alignright = array(4,5,6,7,8);
|
||||||
|
|
||||||
$findcols = array('a.nummer', 'a.name_de', 's.seriennummer','s.datum','s.eingelagert','lh.adresse_name','lh.belegnr','lh.datum','s.id');
|
// $findcols = array('a.nummer', 'a.name_de', 's.seriennummer','s.datum','s.eingelagert','lh.adresse_name','lh.belegnr','lh.datum','s.id');
|
||||||
|
$findcols = array('a.nummer', 'a.name_de', 's.seriennummer','s.datum','s.eingelagert','s.id');
|
||||||
$searchsql = array('a.nummer', 'a.name_de', 's.seriennummer');
|
$searchsql = array('a.nummer', 'a.name_de', 's.seriennummer');
|
||||||
|
|
||||||
$defaultorder = 1;
|
$defaultorder = 1;
|
||||||
@ -66,19 +69,30 @@ class Seriennummern {
|
|||||||
'</a>',
|
'</a>',
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql_columns = "
|
/* $sql_columns = "
|
||||||
s.id,
|
s.id,
|
||||||
CONCAT('<a href=\"index.php?module=artikel&action=edit&id=',a.id,'\">',a.nummer,'</a>') as nummer,
|
CONCAT('<a href=\"index.php?module=artikel&action=edit&id=',a.id,'\">',a.nummer,'</a>') as nummer,
|
||||||
a.name_de,
|
a.name_de,
|
||||||
s.seriennummer,
|
s.seriennummer,
|
||||||
".$app->erp->FormatDate("s.datum").",
|
".$app->erp->FormatDateTime("s.datum").",
|
||||||
if(s.eingelagert,'Ja','Nein'),
|
if(s.eingelagert,'Ja','Nein'),
|
||||||
lh.adresse_name,
|
lh.adresse_name,
|
||||||
".$app->erp->ConcatSQL($lieferschein_link).",
|
".$app->erp->ConcatSQL($lieferschein_link).",
|
||||||
".$app->erp->FormatDate("lh.datum").",
|
".$app->erp->FormatDate("lh.datum").",
|
||||||
s.id
|
s.id
|
||||||
|
";*/
|
||||||
|
|
||||||
|
$sql_columns = "
|
||||||
|
s.id,
|
||||||
|
CONCAT('<a href=\"index.php?module=artikel&action=edit&id=',a.id,'\">',a.nummer,'</a>') as nummer,
|
||||||
|
a.name_de,
|
||||||
|
s.seriennummer,
|
||||||
|
".$app->erp->FormatDateTime("s.datum").",
|
||||||
|
if(s.eingelagert,'Ja','Nein'),
|
||||||
|
s.id
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
$sql_tables = "
|
$sql_tables = "
|
||||||
seriennummern s
|
seriennummern s
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
@ -165,7 +179,7 @@ class Seriennummern {
|
|||||||
case "seriennummern_artikel_list":
|
case "seriennummern_artikel_list":
|
||||||
$allowed['seriennummern_artikel_list'] = array('list');
|
$allowed['seriennummern_artikel_list'] = array('list');
|
||||||
$heading = array('Artikel-Nr.', 'Artikel', 'Lagermenge', 'Nummern verfügbar', 'Nummern ausgeliefert', 'Nummern gesamt', 'Menü','');
|
$heading = array('Artikel-Nr.', 'Artikel', 'Lagermenge', 'Nummern verfügbar', 'Nummern ausgeliefert', 'Nummern gesamt', 'Menü','');
|
||||||
$width = array('10%','20%'); // Fill out manually later
|
$width = array('10%','90%','1%','1%','1%','1%','1%'); // Fill out manually later
|
||||||
|
|
||||||
// columns that are aligned right (numbers etc)
|
// columns that are aligned right (numbers etc)
|
||||||
// $alignright = array(4,5,6,7,8);
|
// $alignright = array(4,5,6,7,8);
|
||||||
@ -243,7 +257,7 @@ class Seriennummern {
|
|||||||
case "seriennummern_lieferscheine_list":
|
case "seriennummern_lieferscheine_list":
|
||||||
$allowed['seriennummern_artikel_list'] = array('list');
|
$allowed['seriennummern_artikel_list'] = array('list');
|
||||||
$heading = array('Lieferschein', 'Vom', 'Adresse', 'Menge Artikel', 'Nummern zugeordnet', 'Nummern fehlen', 'Menü','');
|
$heading = array('Lieferschein', 'Vom', 'Adresse', 'Menge Artikel', 'Nummern zugeordnet', 'Nummern fehlen', 'Menü','');
|
||||||
$width = array('10%','10%','20%'); // Fill out manually later
|
$width = array('10%','10%','20%','1%','1%','1%','1%','1%','1%'); // Fill out manually later
|
||||||
|
|
||||||
// columns that are aligned right (numbers etc)
|
// columns that are aligned right (numbers etc)
|
||||||
$alignright = array(4,5,6,7);
|
$alignright = array(4,5,6,7);
|
||||||
@ -262,10 +276,10 @@ class Seriennummern {
|
|||||||
//$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=seriennummern&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=seriennummern&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
//$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=seriennummern&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=seriennummern&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
||||||
|
|
||||||
$menu_link = array(
|
$menu_link = array(
|
||||||
'<a href="index.php?module=seriennummern&action=enter&artikel=',
|
'<a href="index.php?module=seriennummern&action=enter&lieferschein=',
|
||||||
['sql' => 'a.id'],
|
['sql' => 'l.id'],
|
||||||
'">',
|
'">',
|
||||||
'<img src="./themes/'.$app->Conf->WFconf['defaulttheme'].'/images/add.png" title="Seriennummern erfassen" border="0">',
|
'<img src="./themes/'.$app->Conf->WFconf['defaulttheme'].'/images/edit.svg" title="Seriennummern erfassen" border="0">',
|
||||||
'</a>',
|
'</a>',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -284,7 +298,7 @@ class Seriennummern {
|
|||||||
adr.name,
|
adr.name,
|
||||||
".$app->erp->FormatMengeFuerFormular("menge").",
|
".$app->erp->FormatMengeFuerFormular("menge").",
|
||||||
SUM(if(slp.id IS NULL,0,1)),
|
SUM(if(slp.id IS NULL,0,1)),
|
||||||
".$app->erp->FormatMengeFuerFormular("menge-SUM(if(slp.id IS NULL,0,1))").",
|
".$app->erp->FormatMengeFuerFormular("if(menge>SUM(if(slp.id IS NULL,0,1)),menge-SUM(if(slp.id IS NULL,0,1)),0) ").",
|
||||||
".$app->erp->ConcatSQL($menu_link).",
|
".$app->erp->ConcatSQL($menu_link).",
|
||||||
l.id
|
l.id
|
||||||
FROM
|
FROM
|
||||||
@ -299,7 +313,36 @@ class Seriennummern {
|
|||||||
adr.id = l.adresse
|
adr.id = l.adresse
|
||||||
";
|
";
|
||||||
|
|
||||||
$where = "(a.seriennummern <> 'keine') AND (l.datum >= (SELECT MIN(datum) FROM seriennummern WHERE artikel = a.id))";
|
$where = "(a.seriennummern <> 'keine')";
|
||||||
|
|
||||||
|
// Toggle filters
|
||||||
|
$app->Tpl->Add('JQUERYREADY', "$('#altelieferscheine').click( function() { fnFilterColumn1( 0 ); } );");
|
||||||
|
|
||||||
|
for ($r = 1;$r <= 1;$r++) {
|
||||||
|
$app->Tpl->Add('JAVASCRIPT', '
|
||||||
|
function fnFilterColumn' . $r . ' ( i )
|
||||||
|
{
|
||||||
|
if(oMoreData' . $r . $name . '==1)
|
||||||
|
oMoreData' . $r . $name . ' = 0;
|
||||||
|
else
|
||||||
|
oMoreData' . $r . $name . ' = 1;
|
||||||
|
|
||||||
|
$(\'#' . $name . '\').dataTable().fnFilter(
|
||||||
|
\'\',
|
||||||
|
i,
|
||||||
|
0,0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
');
|
||||||
|
}
|
||||||
|
|
||||||
|
$more_data1 = $app->Secure->GetGET("more_data1");
|
||||||
|
if ($more_data1 == 1) {
|
||||||
|
} else {
|
||||||
|
$where .= " AND (l.datum >= (SELECT DATE(MIN(datum)) FROM seriennummern WHERE artikel = a.id))";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$count = "SELECT COUNT(DISTINCT lp.lieferschein) FROM
|
$count = "SELECT COUNT(DISTINCT lp.lieferschein) FROM
|
||||||
lieferschein_position lp
|
lieferschein_position lp
|
||||||
LEFT JOIN seriennummern_lieferschein_position slp
|
LEFT JOIN seriennummern_lieferschein_position slp
|
||||||
@ -314,7 +357,7 @@ class Seriennummern {
|
|||||||
break;
|
break;
|
||||||
case "seriennummern_lieferschein_positionen":
|
case "seriennummern_lieferschein_positionen":
|
||||||
$allowed['seriennummern_artikel_list'] = array('list');
|
$allowed['seriennummern_artikel_list'] = array('list');
|
||||||
$heading = array('','','Position', 'Artikel-Nr.', 'Artikel', 'Menge', 'Nummern zugeordnet', 'Nummern fehlen', 'Menü','');
|
$heading = array('','','Position', 'Artikel-Nr.', 'Artikel', 'Menge', 'Nummern zugeordnet', 'Nummern fehlen', 'Menü');
|
||||||
$width = array('1%','1%','10%','10%','20%'); // Fill out manually later
|
$width = array('1%','1%','10%','10%','20%'); // Fill out manually later
|
||||||
|
|
||||||
$lieferschein_id = $app->User->GetParameter('seriennummern_lieferschein_id');
|
$lieferschein_id = $app->User->GetParameter('seriennummern_lieferschein_id');
|
||||||
@ -337,15 +380,7 @@ class Seriennummern {
|
|||||||
|
|
||||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',lp.id,'\" />') AS `auswahl`";
|
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',lp.id,'\" />') AS `auswahl`";
|
||||||
|
|
||||||
//$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=seriennummern&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=seriennummern&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
$menu = "<a href=\"#\" onclick=DeleteDialog(\"index.php?module=seriennummern&action=remove&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>";
|
||||||
|
|
||||||
$menu_link = array(
|
|
||||||
'<a href="index.php?module=seriennummern&action=enter&artikel=',
|
|
||||||
['sql' => 'a.id'],
|
|
||||||
'">',
|
|
||||||
'<img src="./themes/'.$app->Conf->WFconf['defaulttheme'].'/images/add.png" title="Seriennummern erfassen" border="0">',
|
|
||||||
'</a>',
|
|
||||||
);
|
|
||||||
|
|
||||||
$lieferschein_link = array(
|
$lieferschein_link = array(
|
||||||
'<a href="index.php?module=lieferschein&action=edit&id=',
|
'<a href="index.php?module=lieferschein&action=edit&id=',
|
||||||
@ -364,8 +399,7 @@ class Seriennummern {
|
|||||||
".$app->erp->FormatMengeFuerFormular("menge").",
|
".$app->erp->FormatMengeFuerFormular("menge").",
|
||||||
SUM(if(slp.id IS NULL,0,1)),
|
SUM(if(slp.id IS NULL,0,1)),
|
||||||
".$app->erp->FormatMengeFuerFormular("menge-SUM(if(slp.id IS NULL,0,1))").",
|
".$app->erp->FormatMengeFuerFormular("menge-SUM(if(slp.id IS NULL,0,1))").",
|
||||||
".$app->erp->ConcatSQL($menu_link).",
|
lp.id
|
||||||
l.id
|
|
||||||
FROM
|
FROM
|
||||||
lieferschein_position lp
|
lieferschein_position lp
|
||||||
LEFT JOIN seriennummern_lieferschein_position slp
|
LEFT JOIN seriennummern_lieferschein_position slp
|
||||||
@ -440,21 +474,21 @@ class Seriennummern {
|
|||||||
|
|
||||||
$check_delivery_notes = $this->seriennummern_check_delivery_notes($lieferschein_id);
|
$check_delivery_notes = $this->seriennummern_check_delivery_notes($lieferschein_id);
|
||||||
if (!empty($check_delivery_notes)) {
|
if (!empty($check_delivery_notes)) {
|
||||||
$lieferschein_minus_id_links = array();
|
$lieferschein_minus_links = array();
|
||||||
$lieferschein_plus_id_links = array();
|
$lieferschein_plus_links = array();
|
||||||
foreach ($check_delivery_notes as $lieferschein_id) {
|
foreach ($check_delivery_notes as $check_delivery_note) {
|
||||||
if ($lieferschein_id['anzahl_nummern'] < $lieferschein_id['menge']) {
|
if ($check_delivery_note['anzahl_nummern'] < $check_delivery_note['menge_lieferschein']) {
|
||||||
$lieferschein_minus_id_links[] = '<a href="index.php?module=seriennummern&action=enter&lieferschein='.$lieferschein_id['id'].'">'.$lieferschein_id['nummer'].'</a>';
|
$lieferschein_minus_links[] = '<a href="index.php?module=seriennummern&action=enter&lieferschein='.$check_delivery_note['lieferschein'].'">'.$check_delivery_note['belegnr'].'</a>';
|
||||||
}
|
}
|
||||||
else if ($lieferschein_id['anzahl_nummern'] > $lieferschein_id['menge']) {
|
else if ($check_delivery_note['anzahl_nummern'] > $check_delivery_note['menge']) {
|
||||||
$lieferschein_plus_id_links[] = '<a href="index.php?module=seriennummern&action=nummern_list&lieferschein='.$lieferschein_id['id'].'">'.$lieferschein_id['nummer'].'</a>';
|
$lieferschein_plus_links[] = '<a href="index.php?module=seriennummern&action=nummern_list&lieferschein='.$check_delivery_note['lieferschein'].'">'.$check_delivery_note['belegnr'].'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($lieferschein_minus_id_links)) {
|
if (!empty($lieferschein_minus_links)) {
|
||||||
$this->app->YUI->Message('warning','Seriennummern fehlen für Lieferschein: '.implode(', ',$lieferschein_minus_id_links));
|
$this->app->YUI->Message('warning','Seriennummern fehlen für Lieferschein: '.implode(', ',$lieferschein_minus_links));
|
||||||
}
|
}
|
||||||
if (!empty($lieferschein_plus_id_links)) {
|
if (!empty($lieferschein_plus_links)) {
|
||||||
$this->app->YUI->Message('warning','Seriennummern Überschuss für Lieferschein: '.implode(', ',$lieferschein_plus_id_links));
|
$this->app->YUI->Message('warning','Seriennummern Überschuss für Lieferschein: '.implode(', ',$lieferschein_plus_links));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,20 +560,36 @@ class Seriennummern {
|
|||||||
|
|
||||||
$this->app->YUI->TableSearch('TAB1', 'seriennummern_lieferscheine_list', "show", "", "", basename(__FILE__), __CLASS__);
|
$this->app->YUI->TableSearch('TAB1', 'seriennummern_lieferscheine_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
|
|
||||||
$this->app->Tpl->Parse('PAGE', "seriennummern_list.tpl");
|
$this->app->Tpl->Parse('PAGE', "seriennummern_lieferscheine_list.tpl");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function seriennummern_delete() {
|
public function seriennummern_delete() {
|
||||||
$id = (int) $this->app->Secure->GetGET('id');
|
$id = (int) $this->app->Secure->GetGET('id');
|
||||||
|
|
||||||
if (!$this->app->DB->Select("SELECT id FROM `seriennummern_lieferschein_position` WHERE `seriennummer` = '{$id}'")) {
|
if ($id) {
|
||||||
$this->app->DB->Delete("DELETE FROM `seriennummern` WHERE `id` = '{$id}'");
|
if (!$this->app->DB->Select("SELECT id FROM `seriennummern_lieferschein_position` WHERE `seriennummer` = '{$id}'")) {
|
||||||
$this->app->Tpl->addMessage('error', 'Der Eintrag wurde gelöscht');
|
$this->app->DB->Delete("DELETE FROM `seriennummern` WHERE `id` = '{$id}'");
|
||||||
} else {
|
$this->app->Tpl->addMessage('error', 'Der Eintrag wurde gelöscht');
|
||||||
$this->app->Tpl->addMessage('error', 'Der Eintrag kann nicht gelöscht werden da eine Lieferscheinzuordnung existiert!');
|
} else {
|
||||||
|
$this->app->Tpl->addMessage('error', 'Der Eintrag kann nicht gelöscht werden da eine Lieferscheinzuordnung existiert!');
|
||||||
|
}
|
||||||
|
$this->seriennummern_nummern_list();
|
||||||
}
|
}
|
||||||
$this->seriennummern_nummern_list();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function seriennummern_remove() {
|
||||||
|
$id = (int) $this->app->Secure->GetGET('id');
|
||||||
|
|
||||||
|
if ($id) {
|
||||||
|
if (!$this->app->DB->Delete("DELETE FROM `seriennummern_lieferschein_position` WHERE `lieferschein_position` = '{$id}'")) {
|
||||||
|
$this->app->Tpl->addMessage('error', 'Der Eintrag wurde gelöscht');
|
||||||
|
}
|
||||||
|
$lieferschein = $this->app->DB->Select("SELECT lieferschein FROM lieferschein_position WHERE id = '".$id."'");
|
||||||
|
$this->app->Location->execute("index.php?module=seriennummern&action=enter&lieferschein=$lieferschein&msg=$msg");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function seriennummern_enter() {
|
function seriennummern_enter() {
|
||||||
|
|
||||||
@ -573,6 +623,18 @@ class Seriennummern {
|
|||||||
$seriennummern = explode('\n',str_replace(['\r'],'',$seriennummern_text));
|
$seriennummern = explode('\n',str_replace(['\r'],'',$seriennummern_text));
|
||||||
|
|
||||||
switch ($submit) {
|
switch ($submit) {
|
||||||
|
case 'assistent':
|
||||||
|
$praefix = $this->app->Secure->GetPOST('praefix');
|
||||||
|
$start = $this->app->Secure->GetPOST('start');
|
||||||
|
$postfix = $this->app->Secure->GetPOST('postfix');
|
||||||
|
$anzahl = (int) $this->app->Secure->GetPOST('anzahl');
|
||||||
|
|
||||||
|
while ($anzahl) {
|
||||||
|
$seriennummern[] = $praefix.$start.$postfix;
|
||||||
|
$anzahl--;
|
||||||
|
$start++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'hinzufuegen':
|
case 'hinzufuegen':
|
||||||
$eingabescan = $this->app->Secure->GetPOST('eingabescan');
|
$eingabescan = $this->app->Secure->GetPOST('eingabescan');
|
||||||
$eingabe = $this->app->Secure->GetPOST('eingabe');
|
$eingabe = $this->app->Secure->GetPOST('eingabe');
|
||||||
@ -630,24 +692,87 @@ class Seriennummern {
|
|||||||
}
|
}
|
||||||
$seriennummern = array_merge($seriennummern_not_written, $seriennummern_already_exist, $seriennummern_old_not_allowed);
|
$seriennummern = array_merge($seriennummern_not_written, $seriennummern_already_exist, $seriennummern_old_not_allowed);
|
||||||
break;
|
break;
|
||||||
case 'assistent':
|
case 'lieferscheinzuordnen':
|
||||||
$praefix = $this->app->Secure->GetPOST('praefix');
|
|
||||||
$start = $this->app->Secure->GetPOST('start');
|
|
||||||
$postfix = $this->app->Secure->GetPOST('postfix');
|
|
||||||
$anzahl = (int) $this->app->Secure->GetPOST('anzahl');
|
|
||||||
|
|
||||||
while ($anzahl) {
|
if (empty($lieferschein_id)) {
|
||||||
$seriennummern[] = $praefix.$start.$postfix;
|
break;
|
||||||
$anzahl--;
|
|
||||||
$start++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$auswahl = $this->app->Secure->GetPOST('auswahl');
|
||||||
|
if (!empty($auswahl)) {
|
||||||
|
if (count($auswahl) > 1) {
|
||||||
|
$this->app->Tpl->addMessage('error', 'Bitte eine oder keine Position anklicken');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$lieferschein_position = $auswahl[0];
|
||||||
|
$sql_auswahl = " AND artikel IN (SELECT artikel FROM lieferschein_position WHERE id = '".$lieferschein_position."'";
|
||||||
|
}
|
||||||
|
|
||||||
|
$seriennummern_not_written = array();
|
||||||
|
$seriennummern_dont_exist = array();
|
||||||
|
$seriennummern_ambigious = array();
|
||||||
|
|
||||||
|
foreach ($seriennummern as $seriennummer) {
|
||||||
|
|
||||||
|
$seriennummer = trim($seriennummer);
|
||||||
|
|
||||||
|
if (empty($seriennummer)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT id, artikel FROM seriennummern WHERE eingelagert = 1 AND seriennummer = '".$this->app->DB->real_escape_string($seriennummer)."'".$sql_auswahl;
|
||||||
|
|
||||||
|
$check_existing = $this->app->DB->SelectArr($sql);
|
||||||
|
|
||||||
|
if (empty($check_existing)) {
|
||||||
|
$seriennummern_dont_exist[] = $seriennummer;
|
||||||
|
} else if (count($check_existing) > 1) {
|
||||||
|
$seriennummern_ambigious[] = $seriennummer;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$check_lieferschein = $this->seriennummern_check_delivery_notes($lieferschein_id, ignore_date: true);
|
||||||
|
$written = false;
|
||||||
|
|
||||||
|
foreach ($check_lieferschein as $position) {
|
||||||
|
$menge_offen = $position['menge_lieferschein']-$position['menge_nummern'];
|
||||||
|
|
||||||
|
if ($menge_offen > 0) {
|
||||||
|
if (empty($lieferschein_position)) {
|
||||||
|
$lieferschein_position = $position['lieferschein_position'];
|
||||||
|
}
|
||||||
|
if ($lieferschein_position == $position['lieferschein_position']) {
|
||||||
|
$sql = "INSERT INTO seriennummern_lieferschein_position (lieferschein_position, seriennummer) VALUES ('".$lieferschein_position."','".$check_existing[0]['id']."') ";
|
||||||
|
|
||||||
|
$this->app->DB->Insert($sql);
|
||||||
|
$written = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$written) {
|
||||||
|
$seriennummern_not_written[] = $seriennummer;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!empty($seriennummern_dont_exist)) {
|
||||||
|
$this->app->Tpl->addMessage('error', 'Seriennummern existieren nicht: '.implode(', ',$seriennummern_dont_exist));
|
||||||
|
}
|
||||||
|
if (!empty($seriennummern_ambigious)) {
|
||||||
|
$this->app->Tpl->addMessage('error', 'Seriennummern nicht eindeutig: '.implode(', ',$seriennummern_ambigious));
|
||||||
|
}
|
||||||
|
$seriennummern = array_merge($seriennummern_not_written, $seriennummern_ambigious, $seriennummern_dont_exist);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$seriennummern = array_unique($seriennummern);
|
$seriennummern = array_unique($seriennummern);
|
||||||
|
|
||||||
|
$complete = false;
|
||||||
|
|
||||||
switch ($task) {
|
switch ($task) {
|
||||||
case 'artikel':
|
case 'artikel':
|
||||||
|
$this->app->Tpl->Set('LIEFERSCHEIN_HIDDEN', "hidden=\"true\"");
|
||||||
$check_seriennummern = $this->seriennummern_check_serials($artikel_id);
|
$check_seriennummern = $this->seriennummern_check_serials($artikel_id);
|
||||||
$check_seriennummern = $check_seriennummern[0];
|
$check_seriennummern = $check_seriennummern[0];
|
||||||
|
|
||||||
@ -676,13 +801,38 @@ class Seriennummern {
|
|||||||
$this->app->Tpl->Set('ANZLAGER', $check_seriennummern['menge_auf_lager']);
|
$this->app->Tpl->Set('ANZLAGER', $check_seriennummern['menge_auf_lager']);
|
||||||
$this->app->Tpl->Set('ANZVORHANDEN', $check_seriennummern['menge_nummern']);
|
$this->app->Tpl->Set('ANZVORHANDEN', $check_seriennummern['menge_nummern']);
|
||||||
$this->app->Tpl->Set('ANZFEHLT', $anzahl_fehlt);
|
$this->app->Tpl->Set('ANZFEHLT', $anzahl_fehlt);
|
||||||
$this->app->Tpl->Set('SERIENNUMMERN', implode("\n",$seriennummern));
|
$this->app->Tpl->Set('SERIENNUMMERN', implode("\n",$seriennummern));
|
||||||
|
|
||||||
|
$artikel_id = $this->app->Secure->GetGET('artikel');
|
||||||
|
$this->app->User->SetParameter('seriennummern_artikel_id', $artikel_id);
|
||||||
|
$this->app->YUI->TableSearch('POSITIONEN', 'seriennummern_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'lieferschein':
|
case 'lieferschein':
|
||||||
|
$this->app->erp->MenuEintrag("index.php?module=seriennummern&action=lieferscheine_list", "Zurück");
|
||||||
$this->app->Tpl->Set('ARTIKEL_HIDDEN', "hidden");
|
$this->app->Tpl->Set('ARTIKEL_HIDDEN', "hidden");
|
||||||
$this->app->Tpl->Set('LIEFERSCHEINNUMMER', '<a href="index.php?module=lieferschein&action=edit&id='.$lieferschein_id.'">'.$lieferschein['belegnr'].'</a>');
|
$this->app->Tpl->Set('LIEFERSCHEINNUMMER', '<a href="index.php?module=lieferschein&action=edit&id='.$lieferschein_id.'">'.$lieferschein['belegnr'].'</a>');
|
||||||
|
|
||||||
|
$check_lieferschein = $this->seriennummern_check_delivery_notes($lieferschein_id, ignore_date: true);
|
||||||
|
|
||||||
|
if (empty($check_lieferschein)) {
|
||||||
|
$this->app->Tpl->AddMessage('success', 'Seriennummern vollständig.');
|
||||||
|
$check_lieferschein = $this->seriennummern_check_delivery_notes($lieferschein_id, ignore_date: true, only_missing: false);
|
||||||
|
$this->app->Tpl->Set('EINGABE_HIDDEN', 'hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
$menge_lieferschein = array_sum(array_column($check_lieferschein,'menge_lieferschein'));
|
||||||
|
$menge_nummern = array_sum(array_column($check_lieferschein,'menge_nummern'));
|
||||||
|
$anzahl_fehlt = $menge_lieferschein-$menge_nummern;
|
||||||
|
|
||||||
|
if ($anzahl_fehlt < 0) {
|
||||||
|
$anzahl_fehlt = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->app->Tpl->Set('ANZLIEFERSCHEIN', $menge_lieferschein);
|
||||||
|
$this->app->Tpl->Set('ANZVORHANDEN', $menge_nummern);
|
||||||
|
$this->app->Tpl->Set('ANZFEHLT', $anzahl_fehlt);
|
||||||
|
|
||||||
$artikel_lieferschein = $this->app->DB->SelectArr("SELECT artikel FROM lieferschein_position WHERE lieferschein = '".$lieferschein_id."'");
|
$artikel_lieferschein = $this->app->DB->SelectArr("SELECT artikel FROM lieferschein_position WHERE lieferschein = '".$lieferschein_id."'");
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
@ -693,7 +843,7 @@ class Seriennummern {
|
|||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
seriennummern_lieferschein_position slp ON slp.seriennummer = s.id
|
seriennummern_lieferschein_position slp ON slp.seriennummer = s.id
|
||||||
WHERE
|
WHERE
|
||||||
s.artikel IN ('".implode("','",array_column($artikel_lieferschein,'artikel'))."')
|
s.artikel = '".$check_lieferschein[0]['artikel']."'
|
||||||
AND s.eingelagert = 1
|
AND s.eingelagert = 1
|
||||||
AND slp.id IS NULL
|
AND slp.id IS NULL
|
||||||
ORDER BY s.id ASC
|
ORDER BY s.id ASC
|
||||||
@ -708,7 +858,14 @@ class Seriennummern {
|
|||||||
$this->app->Tpl->Set('START', $matches[2]);
|
$this->app->Tpl->Set('START', $matches[2]);
|
||||||
$this->app->Tpl->Set('POSTFIX', $matches[3]);
|
$this->app->Tpl->Set('POSTFIX', $matches[3]);
|
||||||
|
|
||||||
$this->app->YUI->TableSearch('LIEFERSCHEINPOSITIONEN', 'seriennummern_lieferschein_positionen', "show", "", "", basename(__FILE__), __CLASS__);
|
$fehlt = $check_lieferschein[0]['menge_lieferschein']-$check_lieferschein[0]['menge_nummern'];
|
||||||
|
if ($fehlt < 0) {
|
||||||
|
$fehlt = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->app->Tpl->Set('ANZAHL', $fehlt);
|
||||||
|
|
||||||
|
$this->app->YUI->TableSearch('POSITIONEN', 'seriennummern_lieferschein_positionen', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
$this->app->YUI->AutoComplete("eingabe", "seriennummerverfuegbar",0,"&lieferschein=$lieferschein_id");
|
$this->app->YUI->AutoComplete("eingabe", "seriennummerverfuegbar",0,"&lieferschein=$lieferschein_id");
|
||||||
|
|
||||||
$this->app->Tpl->Set('SERIENNUMMERN', implode("\n",$seriennummern));
|
$this->app->Tpl->Set('SERIENNUMMERN', implode("\n",$seriennummern));
|
||||||
@ -774,37 +931,54 @@ 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) : array {
|
public function seriennummern_check_delivery_notes($lieferschein_id = null, $ignore_date = false, $only_missing = true) : array {
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT SQL_CALC_FOUND_ROWS
|
SELECT SQL_CALC_FOUND_ROWS
|
||||||
l.id,
|
l.id lieferschein,
|
||||||
l.belegnr nummer,
|
l.belegnr belegnr,
|
||||||
menge,
|
lp.id lieferschein_position,
|
||||||
SUM(IF(slp.id IS NULL, 0, 1)) menge_nummern
|
a.id artikel,
|
||||||
|
a.nummer artikel_nummer,
|
||||||
|
a.name_de,
|
||||||
|
".$this->app->erp->FormatMenge('SUM(menge)')." menge_lieferschein,
|
||||||
|
SUM(COALESCE(menge_nummern,0)) menge_nummern
|
||||||
FROM
|
FROM
|
||||||
lieferschein_position lp
|
lieferschein_position lp
|
||||||
LEFT JOIN seriennummern_lieferschein_position slp ON
|
|
||||||
slp.lieferschein_position = lp.id
|
|
||||||
INNER JOIN lieferschein l ON
|
INNER JOIN lieferschein l ON
|
||||||
l.id = lp.lieferschein
|
l.id = lp.lieferschein
|
||||||
INNER JOIN artikel a ON
|
INNER JOIN artikel a ON
|
||||||
a.id = lp.artikel
|
a.id = lp.artikel
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
lieferschein_position,
|
||||||
|
COUNT(*) menge_nummern
|
||||||
|
FROM
|
||||||
|
seriennummern_lieferschein_position slp
|
||||||
|
GROUP BY
|
||||||
|
slp.lieferschein_position
|
||||||
|
) slp ON slp.lieferschein_position = lp.id
|
||||||
WHERE
|
WHERE
|
||||||
(a.seriennummern <> 'keine') AND(
|
(a.seriennummern <> 'keine')
|
||||||
|
AND (
|
||||||
l.datum >=(
|
l.datum >=(
|
||||||
SELECT
|
SELECT
|
||||||
MIN(datum)
|
DATE(MIN(datum))
|
||||||
FROM
|
FROM
|
||||||
seriennummern
|
seriennummern
|
||||||
WHERE
|
WHERE
|
||||||
artikel = a.id
|
artikel = a.id
|
||||||
)
|
) OR ('".$ignore_date."' <> '')
|
||||||
) AND (l.id = '".$lieferschein_id."' OR '".$lieferschein_id."' = '')
|
)
|
||||||
|
AND (l.id = '".$lieferschein_id."' OR '".$lieferschein_id."' = '')
|
||||||
GROUP BY
|
GROUP BY
|
||||||
l.id
|
l.id,
|
||||||
HAVING menge > menge_nummern
|
lp.id
|
||||||
";
|
";
|
||||||
|
|
||||||
|
if ($only_missing) {
|
||||||
|
$sql .= " HAVING menge_lieferschein > menge_nummern";
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->app->DB->SelectArr($sql);
|
$result = $this->app->DB->SelectArr($sql);
|
||||||
return(empty($result)?array():$result);
|
return(empty($result)?array():$result);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user