mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 06:00:28 +01:00
lieferantengutschrift artikell manuell
This commit is contained in:
parent
c3cbf0d214
commit
e348560cf7
52
www/pages/content/lieferantengutschrift_artikel_manuell.tpl
Normal file
52
www/pages/content/lieferantengutschrift_artikel_manuell.tpl
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
[POSITIONENMESSAGE]
|
||||||
|
<form method="post" action="#tabs-2">
|
||||||
|
<div class="row" [POSITIONHINZUFUEGENHIDDEN]>
|
||||||
|
<div class="row-height">
|
||||||
|
<div class="col-xs-14 col-md-12 col-md-height">
|
||||||
|
<div class="inside inside-full-height">
|
||||||
|
<fieldset>
|
||||||
|
<legend style="float:left">Artikel hinzufügen:</legend>
|
||||||
|
<div class="filter-box filter-usersave" style="float:right;">
|
||||||
|
<div class="filter-block filter-inline">
|
||||||
|
<div class="filter-title">{|Filter|}</div>
|
||||||
|
<ul class="filter-list">
|
||||||
|
<li class="filter-item">
|
||||||
|
<label for="passende" class="switch">
|
||||||
|
<input type="checkbox" id="passende">
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
<label for="passende">{|Nur passende (Bestellung/Rechnungsnummer)|}</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
[ARTIKELMANUELL]
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-14 col-md-2 col-md-height">
|
||||||
|
<div class="inside inside-full-height">
|
||||||
|
<fieldset>
|
||||||
|
<table width="100%" border="0" class="mkTableFormular">
|
||||||
|
<legend>{|Aktionen|}</legend>
|
||||||
|
<tr [HINZUFUEGENHIDDEN]>
|
||||||
|
<td>
|
||||||
|
{|Multifilter|}: <img src="./themes/new/images/tooltip_grau.png" border="0" style="position: relative; left: 1px; top: 3px; z-index: 8;" class="wawitooltipicon" title="Auswahl mehrerer Artikel über Name oder Nummer">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr [HINZUFUEGENHIDDEN]>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="multifilter" id="multifilter" value="[MULTIFILTER]" size="20" style="width:98%;" form="">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><button [SAVEDISABLED] name="submit" value="artikel_manuell_hinzufuegen" class="ui-button-icon" style="width:100%;">Hinzufügen</button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
@ -2,6 +2,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="#tabs-1">Lieferantengutschrift</a></li>
|
<li><a href="#tabs-1">Lieferantengutschrift</a></li>
|
||||||
<li [POSITIONENHIDDEN]><a href="#tabs-2">Positionen</a></li>
|
<li [POSITIONENHIDDEN]><a href="#tabs-2">Positionen</a></li>
|
||||||
|
<li [POSITIONENHIDDEN]><a href="#tabs-4">Artikel manuell</a></li>
|
||||||
<li><a href="#tabs-3">Protokoll</a></li>
|
<li><a href="#tabs-3">Protokoll</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="tabs-1">
|
<div id="tabs-1">
|
||||||
@ -208,6 +209,9 @@
|
|||||||
<div id="tabs-2">
|
<div id="tabs-2">
|
||||||
[POSITIONENTAB]
|
[POSITIONENTAB]
|
||||||
</div>
|
</div>
|
||||||
|
<div id="tabs-4">
|
||||||
|
[POSITIONENMANUELLTAB]
|
||||||
|
</div>
|
||||||
<div id="tabs-3">
|
<div id="tabs-3">
|
||||||
[MINIDETAIL]
|
[MINIDETAIL]
|
||||||
</div>
|
</div>
|
||||||
|
@ -281,7 +281,7 @@ class lieferantengutschrift {
|
|||||||
|
|
||||||
$count = "";
|
$count = "";
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'verbindlichkeit_positionen':
|
case 'verbindlichkeit_positionen':
|
||||||
|
|
||||||
$allowed['verbindlichkeit_positionen'] = array('list');
|
$allowed['verbindlichkeit_positionen'] = array('list');
|
||||||
@ -317,7 +317,7 @@ class lieferantengutschrift {
|
|||||||
'<input type="number" name="werte[]" value="',
|
'<input type="number" name="werte[]" value="',
|
||||||
['sql' => $offen_menge],
|
['sql' => $offen_menge],
|
||||||
'" min="0"',
|
'" min="0"',
|
||||||
'" max="',
|
' max="',
|
||||||
['sql' => $offen_menge],
|
['sql' => $offen_menge],
|
||||||
'"/>'
|
'"/>'
|
||||||
);
|
);
|
||||||
@ -326,7 +326,7 @@ class lieferantengutschrift {
|
|||||||
'<input type="number" name="preise[]" step="0.00001" value="',
|
'<input type="number" name="preise[]" step="0.00001" value="',
|
||||||
['sql' => $this->app->erp->FormatMenge("COALESCE(bp.preis,0)",5)],
|
['sql' => $this->app->erp->FormatMenge("COALESCE(bp.preis,0)",5)],
|
||||||
'" min="0"',
|
'" min="0"',
|
||||||
'"/>'
|
'/>'
|
||||||
);
|
);
|
||||||
|
|
||||||
$artikellink = array (
|
$artikellink = array (
|
||||||
@ -372,8 +372,8 @@ class lieferantengutschrift {
|
|||||||
case 'artikel_manuell':
|
case 'artikel_manuell':
|
||||||
$allowed['paketdistribution_list'] = array('list');
|
$allowed['paketdistribution_list'] = array('list');
|
||||||
|
|
||||||
$heading = array('Art.-Nummer', 'Beschreibung', 'Menge', 'Bemerkung','');
|
$heading = array('Art.-Nummer', 'Beschreibung', 'Menge', 'Preis','Steuer','Sachkonto','');
|
||||||
$width = array( '5%', '30%', '5%', '15%', '1%');
|
$width = array( '5%', '30%', '5%', '5%', '1%', '1%', '1%');
|
||||||
|
|
||||||
$findcols = array('nummer','name_de','id','id');
|
$findcols = array('nummer','name_de','id','id');
|
||||||
$searchsql = array('');
|
$searchsql = array('');
|
||||||
@ -405,19 +405,29 @@ class lieferantengutschrift {
|
|||||||
'</input>'
|
'</input>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$preise = array (
|
||||||
|
'<input type="number" name="preise[]" step="0.00001" value="',
|
||||||
|
'" min="0"',
|
||||||
|
' style=\"text-align:right; width:100%\">'
|
||||||
|
);
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT SQL_CALC_FOUND_ROWS
|
SELECT SQL_CALC_FOUND_ROWS
|
||||||
id,
|
a.id,
|
||||||
".$this->app->erp->ConcatSQL($auswahl).",
|
".$this->app->erp->ConcatSQL($auswahl).",
|
||||||
name_de,
|
name_de,
|
||||||
".$this->app->erp->ConcatSQL($input_for_menge).",
|
".$this->app->erp->ConcatSQL($input_for_menge).",
|
||||||
".$this->app->erp->ConcatSQL($input_for_bemerkung)."
|
".$this->app->erp->ConcatSQL($preise)."
|
||||||
''
|
'',
|
||||||
|
a.umsatzsteuer,
|
||||||
|
CONCAT(skart.sachkonto,' ',skart.beschriftung)
|
||||||
FROM
|
FROM
|
||||||
artikel a
|
artikel a
|
||||||
";
|
LEFT JOIN
|
||||||
|
kontorahmen skart ON skart.id = a.kontorahmen";
|
||||||
|
|
||||||
|
|
||||||
$where = "geloescht <> 1";
|
$where = " (geloescht <> 1)";
|
||||||
|
|
||||||
$multifilter = $this->app->YUI->TableSearchFilter($name, 8,'multifilter');
|
$multifilter = $this->app->YUI->TableSearchFilter($name, 8,'multifilter');
|
||||||
if (!empty($multifilter)) {
|
if (!empty($multifilter)) {
|
||||||
@ -756,7 +766,67 @@ class lieferantengutschrift {
|
|||||||
$sql = "INSERT INTO lieferantengutschrift_position (lieferantengutschrift,verbindlichkeit_position, menge, preis, steuersatz, artikel, kontorahmen) VALUES ($id, $verbindlichkeit_position, $menge, $preis, $steuersatz, $einartikel, $kontorahmen)";
|
$sql = "INSERT INTO lieferantengutschrift_position (lieferantengutschrift,verbindlichkeit_position, menge, preis, steuersatz, artikel, kontorahmen) VALUES ($id, $verbindlichkeit_position, $menge, $preis, $steuersatz, $einartikel, $kontorahmen)";
|
||||||
$this->app->DB->Insert($sql);
|
$this->app->DB->Insert($sql);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'artikel_manuell_hinzufuegen':
|
||||||
|
|
||||||
|
$freigabe = $this->app->DB->SelectArr("SELECT rechnungsfreigabe, freigabe FROM lieferantengutschrift WHERE id =".$id)[0];
|
||||||
|
if ($freigabe['rechnungsfreigabe'] || $freigabe['freigabe']) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process multi action
|
||||||
|
$ids = $this->app->Secure->GetPOST('manuell_artikel_ids');
|
||||||
|
$werte = $this->app->Secure->GetPOST('manuell_mengen');
|
||||||
|
$preise = $this->app->Secure->GetPOST('preise');
|
||||||
|
|
||||||
|
$bruttoeingabe = $this->app->Secure->GetPOST('bruttoeingabe');
|
||||||
|
|
||||||
|
foreach ($ids as $key => $artikelid) {
|
||||||
|
$menge = $werte[$key];
|
||||||
|
|
||||||
|
if ($menge <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$preis = $preise[$key];
|
||||||
|
if ($preis <= 0) {
|
||||||
|
$preis = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
a.id,
|
||||||
|
a.umsatzsteuer,
|
||||||
|
a.steuersatz,
|
||||||
|
COALESCE(skart.id,0) AS kontorahmen
|
||||||
|
FROM
|
||||||
|
artikel a
|
||||||
|
LEFT JOIN
|
||||||
|
kontorahmen skart ON skart.id = a.kontorahmen
|
||||||
|
WHERE a.id =".$artikelid;
|
||||||
|
|
||||||
|
$artikel = $this->app->DB->SelectRow($sql);
|
||||||
|
$einartikel = $artikel['id'];
|
||||||
|
$umsatzsteuer = $artikel['umsatzsteuer'];
|
||||||
|
if (empty($artikel['kontorahmen'])) {
|
||||||
|
$kontorahmen = $this->app->DB->Select("SELECT a.kontorahmen FROM adresse a INNER JOIN lieferantengutschrift lg ON lg.adresse = a.id WHERE lg.id = ".$id);
|
||||||
|
} else {
|
||||||
|
$kontorahmen = $artikel['kontorahmen'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($umsatzsteuer) && is_numeric($artikel['steuersatz'])) {
|
||||||
|
$steuersatz = $artikel['steuersatz'];
|
||||||
|
} else {
|
||||||
|
$steuersatz = $this->get_steuersatz($umsatzsteuer,$id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($bruttoeingabe) {
|
||||||
|
$preis = $preis / (1+($steuersatz/100));
|
||||||
|
}
|
||||||
|
$sql = "INSERT INTO lieferantengutschrift_position (lieferantengutschrift,verbindlichkeit_position, menge, preis, steuersatz, artikel, kontorahmen) VALUES ($id, 0, $menge, $preis, $steuersatz, $einartikel, $kontorahmen)";
|
||||||
|
|
||||||
|
$this->app->DB->Insert($sql);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'positionen_entfernen':
|
case 'positionen_entfernen':
|
||||||
|
|
||||||
$freigabe = $this->app->DB->SelectArr("SELECT rechnungsfreigabe, freigabe FROM lieferantengutschrift WHERE id =".$id)[0];
|
$freigabe = $this->app->DB->SelectArr("SELECT rechnungsfreigabe, freigabe FROM lieferantengutschrift WHERE id =".$id)[0];
|
||||||
@ -847,7 +917,6 @@ class lieferantengutschrift {
|
|||||||
v.beschreibung,
|
v.beschreibung,
|
||||||
v.sachkonto,
|
v.sachkonto,
|
||||||
v.internebemerkung,
|
v.internebemerkung,
|
||||||
v.verbindlichkeit,
|
|
||||||
a.lieferantennummer,
|
a.lieferantennummer,
|
||||||
a.name AS adresse_name FROM lieferantengutschrift v LEFT JOIN adresse a ON a.id = v.adresse"." WHERE v.id=$id");
|
a.name AS adresse_name FROM lieferantengutschrift v LEFT JOIN adresse a ON a.id = v.adresse"." WHERE v.id=$id");
|
||||||
|
|
||||||
@ -1007,23 +1076,23 @@ class lieferantengutschrift {
|
|||||||
} else {
|
} else {
|
||||||
$this->app->Tpl->Set('INLINEPDF', 'Keine Dateien vorhanden.');
|
$this->app->Tpl->Set('INLINEPDF', 'Keine Dateien vorhanden.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($lieferantengutschrift_from_db['freigabe'])) {
|
|
||||||
|
|
||||||
if (empty($lieferantengutschrift_from_db['verbindlichkeit'])) {
|
|
||||||
$this->app->YUI->TableSearch('PAKETDISTRIBUTION', 'artikel_manuell', "show", "", "", basename(__FILE__), __CLASS__);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->app->YUI->TableSearch('PAKETDISTRIBUTION', 'verbindlichkeit_positionen', "show", "", "", basename(__FILE__), __CLASS__);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- POSITIONEN
|
// -- POSITIONEN
|
||||||
|
if (empty($lieferantengutschrift_from_db['freigabe'])) {
|
||||||
|
$this->app->YUI->TableSearch('PAKETDISTRIBUTION', 'verbindlichkeit_positionen', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
|
}
|
||||||
$this->app->YUI->AutoComplete("positionen_sachkonto", "sachkonto", 1);
|
$this->app->YUI->AutoComplete("positionen_sachkonto", "sachkonto", 1);
|
||||||
$this->app->YUI->TableSearch('POSITIONEN', 'lieferantengutschrift_positionen', "show", "", "", basename(__FILE__), __CLASS__);
|
$this->app->YUI->TableSearch('POSITIONEN', 'lieferantengutschrift_positionen', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
$this->app->Tpl->Parse('POSITIONENTAB', "lieferantengutschrift_positionen.tpl");
|
$this->app->Tpl->Parse('POSITIONENTAB', "lieferantengutschrift_positionen.tpl");
|
||||||
// -- POSITIONEN
|
// -- POSITIONEN
|
||||||
|
|
||||||
|
// -- POSITIONEN manuell
|
||||||
|
if (empty($lieferantengutschrift_from_db['freigabe'])) {
|
||||||
|
$this->app->YUI->TableSearch('ARTIKELMANUELL', 'artikel_manuell', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
|
}
|
||||||
|
$this->app->Tpl->Parse('POSITIONENMANUELLTAB', "lieferantengutschrift_artikel_manuell.tpl");
|
||||||
|
// -- POSITIONEN manuell
|
||||||
|
|
||||||
$this->lieferantengutschrift_minidetail('MINIDETAIL',false);
|
$this->lieferantengutschrift_minidetail('MINIDETAIL',false);
|
||||||
$this->app->Tpl->Parse('PAGE', "lieferantengutschrift_edit.tpl");
|
$this->app->Tpl->Parse('PAGE', "lieferantengutschrift_edit.tpl");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user