mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 04:27:14 +01:00
Kontoauszuege module & importer
This commit is contained in:
parent
e356051f5a
commit
6a566a99af
@ -50206,12 +50206,12 @@
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "vorauswahlvorschlag",
|
||||
"Type": "int(11)",
|
||||
"Field": "importdatum",
|
||||
"Type": "datetime",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Default": "",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
|
@ -6,7 +6,8 @@
|
||||
<li><a href="#tabs-3">{|Zeiterfassung|}</a></li>
|
||||
<li><a href="#tabs-4">{|Wiedervorlagen|}</a></li>
|
||||
<li><a href="#tabs-5">{|Notizen|}</a></li>
|
||||
<li><a href="#tabs-6">{|Kontorahmen|}</a></li>
|
||||
<li><a href="#tabs-6">{|Kontenrahmen|}</a></li>
|
||||
<li><a href="#tabs-7">{|Kontoauszug|}</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="tabs-1">
|
||||
@ -508,7 +509,7 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-1 col-sm-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset><legend>{|Kontorahmen|}</legend>
|
||||
<fieldset><legend>{|Kontenrahmen|}</legend>
|
||||
<table class="mkTable">
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
@ -551,4 +552,61 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-7">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-1 col-sm-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset><legend>{|Kontoauszug|}</legend>
|
||||
<table class="mkTable">
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
<th>Beschreibung</th>
|
||||
<th>Kommentar</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>konto</td>
|
||||
<td>Konto-ID</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>buchung</td>
|
||||
<td>Buchungsdatum</td>
|
||||
<td>Im Format DD.MM.YYYY</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>betrag</td>
|
||||
<td>Betrag</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waehrung</td>
|
||||
<td>Währung</td>
|
||||
<td>Muss in den Währungen vorhanden sein</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>buchungstext</td>
|
||||
<td>Buchungstext</td>
|
||||
<td>Wird für die Zuordnung verwendet</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>buchungstext2</td>
|
||||
<td>Buchungstext</td>
|
||||
<td>Wird für die Zuordnung verwendet</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>buchungstext3</td>
|
||||
<td>Buchungstext</td>
|
||||
<td>Wird für die Zuordnung verwendet</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>buchungstext4</td>
|
||||
<td>Buchungstext</td>
|
||||
<td>Wird für die Zuordnung verwendet</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<!--<td width="25%"><a href="index.php?module=shopexport&action=list"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_20.gif" border="0" width="30%"></a></td>-->
|
||||
</tr>
|
||||
<tr align="center">
|
||||
<td><a href="index.php?module=importvorlage&action=list">{|Stammdaten|} <br>{|Import|}</a></td>
|
||||
<td><a href="index.php?module=importvorlage&action=list">{|Daten|} <br>{|Import|}</a></td>
|
||||
<td><a href="index.php?module=exportvorlage&action=list">{|Stammdaten|} <br>{|Export|}</a></td>
|
||||
<!--<td><a href="index.php?module=adresse_import&action=list">{|Intranet|}</a></td>-->
|
||||
<td><a href="index.php?module=shopimport&action=list">{|Import|}<br>({|Online-Shop|})</a></td>
|
||||
@ -17,7 +17,7 @@
|
||||
<tr><td colspan="99"> </td></tr>
|
||||
<tr align="center">
|
||||
<td width="25%"><a href="index.php?module=exportbelegepositionen&action=export"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_1.gif" border="0" width="30%"></a></td>
|
||||
<td width="25%"><a href="index.php?module=exportbuchhaltung&action=export"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_1.gif" border="0" width="30%"></a></td>
|
||||
<td width="25%"><a href="index.php?module=exportbuchhaltung&action=export"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_19.gif" border="0" width="30%"></a></td>
|
||||
<td width="25%">[BELEGEIMPORTSTART]<a href="index.php?module=belegeimport&action=list"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_1.gif" border="0" width="30%"></a>[BELEGEIMPORTEND]</td>
|
||||
<!--<td width="25%"><a href="index.php?module=shopexport&action=list"><img src="./themes/[THEME]/images/einstellungen/Icons_dunkel_20.gif" border="0" width="30%"></a></td>-->
|
||||
</tr>
|
||||
|
@ -19,6 +19,14 @@
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="150">
|
||||
{|Kurzbezeichnung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="kurzbezeichnung" id="kurzbezeichnung" size="40" rule="notempty" msg="Pflichfeld!" tabindex="2" value="[KURZBEZEICHNUNG]" required><i>{|Muss eindeutig sein.|}</i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150">
|
||||
{|Bezeichnung|}:
|
||||
</td>
|
||||
<td>
|
||||
|
151
www/pages/content/kontoauszuege_edit.tpl
Normal file
151
www/pages/content/kontoauszuege_edit.tpl
Normal file
@ -0,0 +1,151 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1"></a></li>
|
||||
</ul>
|
||||
<!-- Example for multiple tabs
|
||||
<ul hidden">
|
||||
<li><a href="#tabs-1">First Tab</a></li>
|
||||
<li><a href="#tabs-2">Second Tab</a></li>
|
||||
</ul>
|
||||
-->
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
<form action="" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Kontoauszüg Eintrag|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Konto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="konto" id="konto" value="[KONTO]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Datum|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="buchung" id="buchung" value="[BUCHUNG]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Betrag|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="soll" id="soll" value="[SOLL]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Währung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="waehrung" id="waehrung" value="[WAEHRUNG]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Fertig|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="fertig" id="fertig" value="[FERTIG]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Datev_abgeschlossen|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="datev_abgeschlossen" id="datev_abgeschlossen" value="[DATEV_ABGESCHLOSSEN]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Buchungstext|}:
|
||||
</td>
|
||||
<td>
|
||||
<Textarea type="text" name="buchungstext" id="buchungstext" size="20" disabled>[BUCHUNGSTEXT]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bearbeiter|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bearbeiter" id="bearbeiter" value="[BEARBEITER]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Internebemerkung|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea type="text" name="internebemerkung" id="internebemerkung" size="20">[INTERNEBEMERKUNG]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Importfehler|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="importfehler" id="importfehler" value="[IMPORTFEHLER]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Klaerfall|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="klaerfall" id="klaerfall" value="[KLAERFALL]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Klaergrund|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="klaergrund" id="klaergrund" value="[KLAERGRUND]" size="20" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right"/>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Example for 2nd tab
|
||||
<div id="tabs-2">
|
||||
[MESSAGE]
|
||||
<form action="" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|...|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
...
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right"/>
|
||||
</form>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
|
44
www/pages/content/kontoauszuege_list.tpl
Normal file
44
www/pages/content/kontoauszuege_list.tpl
Normal file
@ -0,0 +1,44 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<form action="#tabs-1" id="frmauto" name="frmauto" method="post">
|
||||
[MESSAGE]
|
||||
<div class="filter-box filter-usersave">
|
||||
<div class="filter-block filter-inline">
|
||||
<div class="filter-title">{|Filter|}</div>
|
||||
<ul class="filter-list">
|
||||
[STATUSFILTER]
|
||||
<li class="filter-item">
|
||||
<label for="importfehler" class="switch">
|
||||
<input type="checkbox" id="importfehler" />
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="meinetickets">{|Inkl. Importfehler|}</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
[TAB1]
|
||||
<fieldset>
|
||||
<table>
|
||||
<legend>Stapelverarbeitung</legend>
|
||||
<tr>
|
||||
<td><input type="checkbox" value="1" id="autoalle" /> alle markieren </td><td><input type="submit" class="btnBlue" name="ausfuehren" value="{|Importfehler|}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$('#autoalle').on('change',function(){
|
||||
var wert = $(this).prop('checked');
|
||||
$('#kontoauszuege_list').find('input[type="checkbox"]').prop('checked',wert);
|
||||
$('#kontoauszuege_list').find('input[type="checkbox"]').first().trigger('change');
|
||||
});
|
||||
|
||||
</script>
|
@ -1419,7 +1419,7 @@ class Importvorlage extends GenImportvorlage {
|
||||
$zeitstempel = time();
|
||||
|
||||
$number_of_rows = empty($tmp['cmd'])?0:count($tmp['cmd']);
|
||||
$number_of_rows = $number_of_rows + 2;
|
||||
// $number_of_rows = $number_of_rows + 2; // ?!?!
|
||||
|
||||
if($isCronjob) {
|
||||
$this->app->DB->Update(
|
||||
@ -5079,6 +5079,85 @@ class Importvorlage extends GenImportvorlage {
|
||||
}
|
||||
|
||||
break;
|
||||
case 'kontoauszug':
|
||||
|
||||
$allowed_fields = array('konto','buchung','betrag','waehrung','buchungstext','buchungstext2','buchungstext3','buchungstext4');
|
||||
|
||||
$error = false;
|
||||
|
||||
// Create a row dataset (without checked and cmd)
|
||||
$update_sql = "";
|
||||
$row = array();
|
||||
$comma = "";
|
||||
foreach ($tmp as $key => $value) {
|
||||
if ($key != 'cmd' && $key != 'checked') {
|
||||
if (in_array($key,$allowed_fields)) {
|
||||
$row[$key] = $value[$i];
|
||||
$comma = ", ";
|
||||
} else {
|
||||
$msg .= "Feld nicht korrekt: ".$key.".<br>";
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Collect texts
|
||||
$buchungstext = "";
|
||||
$comma = "";
|
||||
foreach ($row as $key => $value) {
|
||||
if (str_starts_with($key,'buchungstext')) {
|
||||
if (!empty($value)) {
|
||||
$buchungstext .= $comma.$value;
|
||||
$comma = ", ";
|
||||
}
|
||||
unset($row[$key]);
|
||||
}
|
||||
}
|
||||
$row['buchungstext'] = $buchungstext;
|
||||
|
||||
$row['soll'] = $row['betrag'];
|
||||
unset($row['betrag']);
|
||||
|
||||
// Calculate hash
|
||||
$hash_fields = array('buchung','soll','waehrung','buchungstext');
|
||||
$hash_text = "";
|
||||
|
||||
foreach($hash_fields as $hash_field) {
|
||||
$hash_text .= $row[$hash_field];
|
||||
}
|
||||
$row['pruefsumme'] = md5($hash_text);
|
||||
|
||||
$sql = "SELECT id FROM konten WHERE kurzbezeichnung ='".$row['konto']."' LIMIT 1";
|
||||
$kontoid = $this->app->DB->SelectArr($sql);
|
||||
|
||||
if (!empty($kontoid)) {
|
||||
|
||||
$row['konto'] = $kontoid[0]['id'];
|
||||
$row['importdatum'] = date("Y-m-d H:i:s");
|
||||
|
||||
$sql = "SELECT pruefsumme FROM kontoauszuege WHERE pruefsumme='".$row['pruefsumme']."' AND konto ='".$row['konto']."'";
|
||||
$result = $this->app->DB->SelectArr($sql);
|
||||
|
||||
if (!empty($result)) {
|
||||
$msg .= "Doppelter Eintrag (nicht importiert): ".$row['buchungstext']."<br>";
|
||||
} else {
|
||||
$sql = "INSERT INTO kontoauszuege (".
|
||||
implode(", ",array_keys($row)).
|
||||
") VALUES ('".
|
||||
implode("', '",array_values($row)).
|
||||
"')";
|
||||
|
||||
$msg .= $sql;
|
||||
|
||||
$result = $this->app->DB->Update($sql);
|
||||
}
|
||||
} else {
|
||||
$msg .= "Konto nicht gefunden: ".$row['konto'].".<br>";
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// HERE END OF PROCESSING THE ROWS switch($ziel);
|
||||
@ -5107,19 +5186,21 @@ class Importvorlage extends GenImportvorlage {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Loop
|
||||
if($return) {
|
||||
if($returnids) {
|
||||
return $ids;
|
||||
}
|
||||
return $number_of_rows;
|
||||
}
|
||||
if($ziel==='zeiterfassung' || $ziel==='wiedervorlage' || $ziel==='notizen') {
|
||||
|
||||
if (empty($msg)) {
|
||||
$msg=$this->app->erp->base64_url_encode("<div class=\"info\">Import durchgeführt.</div>");
|
||||
$this->app->Location->execute("index.php?module=importvorlage&action=import&id=$id&msg=$msg");
|
||||
} else {
|
||||
$msg=$this->app->erp->base64_url_encode("<div class=\"error\">".$msg."</div>");
|
||||
$this->app->Location->execute("index.php?module=importvorlage&action=import&id=$id&msg=$msg");
|
||||
}
|
||||
$msg=$this->app->erp->base64_url_encode("<div class=\"info\">Import durchgeführt.</div>");
|
||||
$this->app->Location->execute("index.php?module=importvorlage&action=import&id=$id&msg=$msg");
|
||||
}
|
||||
|
||||
/**
|
||||
|
346
www/pages/kontoauszuege.php
Normal file
346
www/pages/kontoauszuege.php
Normal file
@ -0,0 +1,346 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022 OpenXE project
|
||||
*/
|
||||
|
||||
use Xentral\Components\Database\Exception\QueryFailureException;
|
||||
|
||||
class Kontoauszuege {
|
||||
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app = $app;
|
||||
if ($intern)
|
||||
return;
|
||||
|
||||
$this->app->ActionHandlerInit($this);
|
||||
$this->app->ActionHandler("list", "kontoauszuege_list");
|
||||
$this->app->ActionHandler("create", "kontoauszuege_edit"); // This automatically adds a "New" button
|
||||
$this->app->ActionHandler("edit", "kontoauszuege_edit");
|
||||
$this->app->ActionHandler("delete", "kontoauszuege_delete");
|
||||
$this->app->DefaultActionHandler("list");
|
||||
$this->app->ActionHandlerListen($app);
|
||||
}
|
||||
|
||||
public function Install() {
|
||||
/* Fill out manually later */
|
||||
}
|
||||
|
||||
static function TableSearch(&$app, $name, $erlaubtevars) {
|
||||
switch ($name) {
|
||||
case "kontoauszuege_list":
|
||||
$allowed['kontoauszuege_list'] = array('list');
|
||||
$heading = array('','', 'Importdatum', 'Konto', 'Datum', 'Betrag', 'Waehrung', 'Buchungstext','Interne Bemerkung', 'Menü');
|
||||
$width = array('1%','1%', '1%', '10%', '1%', '1%', '1%', '20%', '20%', '1%'); // Fill out manually later
|
||||
|
||||
// columns that are aligned right (numbers etc)
|
||||
$alignright = array(6);
|
||||
|
||||
$findcols = array('k.id','k.id','k.konto', 'k.importdatum', 'k.buchung', 'k.soll', 'k.waehrung', 'k.buchungstext','k.internebemerkung');
|
||||
$searchsql = array('k.konto', 'k.buchung', 'k.soll', 'k.buchungstext','k.internebemerkung');
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',k.id,'\" />') AS `auswahl`";
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=kontoauszuege&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=kontoauszuege&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
||||
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS k.id,
|
||||
$dropnbox,
|
||||
".$app->erp->FormatDateTimeShort('k.importdatum').",
|
||||
(SELECT kurzbezeichnung FROM konten WHERE konten.id = k.konto),
|
||||
".$app->erp->FormatDate('k.buchung').",
|
||||
IF(
|
||||
k.importfehler,
|
||||
CONCAT(
|
||||
'<del>',
|
||||
".$app->erp->FormatMenge('k.soll',2).",
|
||||
'</del>'
|
||||
),
|
||||
".$app->erp->FormatMenge('k.soll',2)."),
|
||||
k.waehrung,
|
||||
k.buchungstext,
|
||||
k.internebemerkung,
|
||||
k.id
|
||||
FROM kontoauszuege k";
|
||||
|
||||
$where = "1";
|
||||
|
||||
// Toggle filters
|
||||
$app->Tpl->Add('JQUERYREADY', "$('#importfehler').click( function() { fnFilterColumn1( 0 ); } );");
|
||||
|
||||
for ($r = 1;$r <= 4;$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) {
|
||||
$where .= "";
|
||||
} else {
|
||||
$where .= " AND k.importfehler IS NULL ";
|
||||
}
|
||||
// END Toggle filters
|
||||
|
||||
$count = "SELECT count(DISTINCT id) FROM kontoauszuege k WHERE $where";
|
||||
// $groupby = "";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$erg = false;
|
||||
|
||||
foreach ($erlaubtevars as $k => $v) {
|
||||
if (isset($$v)) {
|
||||
$erg[$v] = $$v;
|
||||
}
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
function kontoauszuege_list() {
|
||||
|
||||
// Process multi action
|
||||
$auswahl = $this->app->Secure->GetPOST('auswahl');
|
||||
$selectedIds = [];
|
||||
if(!empty($auswahl)) {
|
||||
foreach($auswahl as $selectedId) {
|
||||
$selectedId = (int)$selectedId;
|
||||
if($selectedId > 0) {
|
||||
$selectedIds[] = $selectedId;
|
||||
}
|
||||
}
|
||||
|
||||
$submit = $this->app->Secure->GetPOST('ausfuehren');
|
||||
|
||||
if ($submit == 'Importfehler') {
|
||||
$sql = "UPDATE kontoauszuege SET importfehler = 1 WHERE id IN (".implode(",",$selectedIds).")";
|
||||
$this->app->DB->Update($sql);
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=kontoauszuege&action=list", "Übersicht");
|
||||
$this->app->erp->MenuEintrag("index.php?module=kontoauszuege&action=create", "Neu anlegen");
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php", "Zurück");
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1', 'kontoauszuege_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
$this->app->Tpl->Parse('PAGE', "kontoauszuege_list.tpl");
|
||||
}
|
||||
|
||||
public function kontoauszuege_delete() {
|
||||
$id = (int) $this->app->Secure->GetGET('id');
|
||||
|
||||
$this->app->DB->Delete("UPDATE `kontoauszuege` SET importfehler = 1 WHERE `id` = '{$id}'");
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">Der Eintrag wurde als Importfehler markiert.</div>");
|
||||
|
||||
$this->kontoauszuege_list();
|
||||
}
|
||||
|
||||
/*
|
||||
* Edit kontoauszuege item
|
||||
* If id is empty, create a new one
|
||||
*/
|
||||
|
||||
function kontoauszuege_edit() {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
|
||||
// Check if other users are editing this id
|
||||
if($this->app->erp->DisableModul('artikel',$id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('ID', $id);
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=kontoauszuege&action=edit&id=$id", "Details");
|
||||
$this->app->erp->MenuEintrag("index.php?module=kontoauszuege&action=list", "Zurück zur Übersicht");
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$input = $this->GetInput();
|
||||
$submit = $this->app->Secure->GetPOST('submit');
|
||||
|
||||
if (empty($id)) {
|
||||
// New item
|
||||
$id = 'NULL';
|
||||
}
|
||||
|
||||
if ($submit != '')
|
||||
{
|
||||
|
||||
// Write to database
|
||||
|
||||
// Add checks here
|
||||
|
||||
$columns = "id, ";
|
||||
$values = "$id, ";
|
||||
$update = "";
|
||||
|
||||
$fix = "";
|
||||
|
||||
foreach ($input as $key => $value) {
|
||||
$columns = $columns.$fix.$key;
|
||||
$values = $values.$fix."'".$value."'";
|
||||
$update = $update.$fix.$key." = '$value'";
|
||||
|
||||
$fix = ", ";
|
||||
}
|
||||
|
||||
// echo($columns."<br>");
|
||||
// echo($values."<br>");
|
||||
// echo($update."<br>");
|
||||
|
||||
$sql = "INSERT INTO kontoauszuege (".$columns.") VALUES (".$values.") ON DUPLICATE KEY UPDATE ".$update;
|
||||
|
||||
// echo($sql);
|
||||
|
||||
$this->app->DB->Update($sql);
|
||||
|
||||
if ($id == 'NULL') {
|
||||
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
||||
header("Location: index.php?module=kontoauszuege&action=list&msg=$msg");
|
||||
} else {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load values again from database
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',k.id,'\" />') AS `auswahl`";
|
||||
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS k.id, $dropnbox, k.konto, k.buchung, k.originalbuchung, k.vorgang, k.originalvorgang, k.soll, k.originalsoll, k.haben, k.originalhaben, k.gebuehr, k.originalgebuehr, k.waehrung, k.originalwaehrung, k.fertig, k.datev_abgeschlossen, k.buchungstext, k.gegenkonto, k.belegfeld1, k.bearbeiter, k.mailbenachrichtigung, k.pruefsumme, k.kostenstelle, k.importgroup, k.diff, k.diffangelegt, k.internebemerkung, k.importfehler, k.parent, k.sort, k.doctype, k.doctypeid, k.vorauswahltyp, k.vorauswahlparameter, k.klaerfall, k.klaergrund, k.bezugtyp, k.bezugparameter, k.vorauswahlvorschlag, k.id FROM kontoauszuege k"." WHERE id=$id");
|
||||
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add displayed items later
|
||||
*
|
||||
|
||||
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $email);
|
||||
$this->app->Tpl->Add('EMAIL', $email);
|
||||
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
|
||||
*/
|
||||
|
||||
$sql = "SELECT kurzbezeichnung FROM konten WHERE id=".$result[0]['konto'];
|
||||
$konto = $this->app->DB->Select($sql);
|
||||
$this->app->Tpl->Set('KONTO', $konto);
|
||||
|
||||
$this->app->Tpl->Set('BUCHUNG', $this->app->erp->ReplaceDatum(false,$result[0]['buchung'],false));
|
||||
$this->app->Tpl->Set('SOLL', $this->app->erp->ReplaceBetrag(false,$result[0]['soll'],false));
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "kontoauszuege_edit.tpl");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all paramters from html form and save into $input
|
||||
*/
|
||||
public function GetInput(): array {
|
||||
$input = array();
|
||||
//$input['EMAIL'] = $this->app->Secure->GetPOST('email');
|
||||
|
||||
/* $input['konto'] = $this->app->Secure->GetPOST('konto');
|
||||
$input['buchung'] = $this->app->Secure->GetPOST('buchung');
|
||||
$input['originalbuchung'] = $this->app->Secure->GetPOST('originalbuchung');
|
||||
$input['vorgang'] = $this->app->Secure->GetPOST('vorgang');
|
||||
$input['originalvorgang'] = $this->app->Secure->GetPOST('originalvorgang');
|
||||
$input['soll'] = $this->app->Secure->GetPOST('soll');
|
||||
$input['originalsoll'] = $this->app->Secure->GetPOST('originalsoll');
|
||||
$input['haben'] = $this->app->Secure->GetPOST('haben');
|
||||
$input['originalhaben'] = $this->app->Secure->GetPOST('originalhaben');
|
||||
$input['gebuehr'] = $this->app->Secure->GetPOST('gebuehr');
|
||||
$input['originalgebuehr'] = $this->app->Secure->GetPOST('originalgebuehr');
|
||||
$input['waehrung'] = $this->app->Secure->GetPOST('waehrung');
|
||||
$input['originalwaehrung'] = $this->app->Secure->GetPOST('originalwaehrung');
|
||||
$input['fertig'] = $this->app->Secure->GetPOST('fertig');
|
||||
$input['datev_abgeschlossen'] = $this->app->Secure->GetPOST('datev_abgeschlossen');
|
||||
$input['buchungstext'] = $this->app->Secure->GetPOST('buchungstext');
|
||||
$input['gegenkonto'] = $this->app->Secure->GetPOST('gegenkonto');
|
||||
$input['belegfeld1'] = $this->app->Secure->GetPOST('belegfeld1');
|
||||
$input['bearbeiter'] = $this->app->Secure->GetPOST('bearbeiter');
|
||||
$input['mailbenachrichtigung'] = $this->app->Secure->GetPOST('mailbenachrichtigung');
|
||||
$input['pruefsumme'] = $this->app->Secure->GetPOST('pruefsumme');
|
||||
$input['kostenstelle'] = $this->app->Secure->GetPOST('kostenstelle');
|
||||
$input['importgroup'] = $this->app->Secure->GetPOST('importgroup');
|
||||
$input['diff'] = $this->app->Secure->GetPOST('diff');
|
||||
$input['diffangelegt'] = $this->app->Secure->GetPOST('diffangelegt');
|
||||
*/ $input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
|
||||
/* $input['importfehler'] = $this->app->Secure->GetPOST('importfehler');
|
||||
$input['parent'] = $this->app->Secure->GetPOST('parent');
|
||||
$input['sort'] = $this->app->Secure->GetPOST('sort');
|
||||
$input['doctype'] = $this->app->Secure->GetPOST('doctype');
|
||||
$input['doctypeid'] = $this->app->Secure->GetPOST('doctypeid');
|
||||
$input['vorauswahltyp'] = $this->app->Secure->GetPOST('vorauswahltyp');
|
||||
$input['vorauswahlparameter'] = $this->app->Secure->GetPOST('vorauswahlparameter');
|
||||
$input['klaerfall'] = $this->app->Secure->GetPOST('klaerfall');
|
||||
$input['klaergrund'] = $this->app->Secure->GetPOST('klaergrund');
|
||||
$input['bezugtyp'] = $this->app->Secure->GetPOST('bezugtyp');
|
||||
$input['bezugparameter'] = $this->app->Secure->GetPOST('bezugparameter');
|
||||
$input['vorauswahlvorschlag'] = $this->app->Secure->GetPOST('vorauswahlvorschlag');*/
|
||||
|
||||
|
||||
return $input;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set all fields in the page corresponding to $input
|
||||
*/
|
||||
function SetInput($input) {
|
||||
// $this->app->Tpl->Set('EMAIL', $input['email']);
|
||||
|
||||
$this->app->Tpl->Set('KONTO', $input['konto']);
|
||||
$this->app->Tpl->Set('BUCHUNG', $input['buchung']);
|
||||
$this->app->Tpl->Set('ORIGINALBUCHUNG', $input['originalbuchung']);
|
||||
$this->app->Tpl->Set('VORGANG', $input['vorgang']);
|
||||
$this->app->Tpl->Set('ORIGINALVORGANG', $input['originalvorgang']);
|
||||
$this->app->Tpl->Set('SOLL', $input['soll']);
|
||||
$this->app->Tpl->Set('ORIGINALSOLL', $input['originalsoll']);
|
||||
$this->app->Tpl->Set('HABEN', $input['haben']);
|
||||
$this->app->Tpl->Set('ORIGINALHABEN', $input['originalhaben']);
|
||||
$this->app->Tpl->Set('GEBUEHR', $input['gebuehr']);
|
||||
$this->app->Tpl->Set('ORIGINALGEBUEHR', $input['originalgebuehr']);
|
||||
$this->app->Tpl->Set('WAEHRUNG', $input['waehrung']);
|
||||
$this->app->Tpl->Set('ORIGINALWAEHRUNG', $input['originalwaehrung']);
|
||||
$this->app->Tpl->Set('FERTIG', $input['fertig']);
|
||||
$this->app->Tpl->Set('DATEV_ABGESCHLOSSEN', $input['datev_abgeschlossen']);
|
||||
$this->app->Tpl->Set('BUCHUNGSTEXT', $input['buchungstext']);
|
||||
$this->app->Tpl->Set('GEGENKONTO', $input['gegenkonto']);
|
||||
$this->app->Tpl->Set('BELEGFELD1', $input['belegfeld1']);
|
||||
$this->app->Tpl->Set('BEARBEITER', $input['bearbeiter']);
|
||||
$this->app->Tpl->Set('MAILBENACHRICHTIGUNG', $input['mailbenachrichtigung']);
|
||||
$this->app->Tpl->Set('PRUEFSUMME', $input['pruefsumme']);
|
||||
$this->app->Tpl->Set('KOSTENSTELLE', $input['kostenstelle']);
|
||||
$this->app->Tpl->Set('IMPORTGROUP', $input['importgroup']);
|
||||
$this->app->Tpl->Set('DIFF', $input['diff']);
|
||||
$this->app->Tpl->Set('DIFFANGELEGT', $input['diffangelegt']);
|
||||
$this->app->Tpl->Set('INTERNEBEMERKUNG', $input['internebemerkung']);
|
||||
$this->app->Tpl->Set('IMPORTFEHLER', $input['importfehler']);
|
||||
$this->app->Tpl->Set('PARENT', $input['parent']);
|
||||
$this->app->Tpl->Set('SORT', $input['sort']);
|
||||
$this->app->Tpl->Set('DOCTYPE', $input['doctype']);
|
||||
$this->app->Tpl->Set('DOCTYPEID', $input['doctypeid']);
|
||||
$this->app->Tpl->Set('VORAUSWAHLTYP', $input['vorauswahltyp']);
|
||||
$this->app->Tpl->Set('VORAUSWAHLPARAMETER', $input['vorauswahlparameter']);
|
||||
$this->app->Tpl->Set('KLAERFALL', $input['klaerfall']);
|
||||
$this->app->Tpl->Set('KLAERGRUND', $input['klaergrund']);
|
||||
$this->app->Tpl->Set('BEZUGTYP', $input['bezugtyp']);
|
||||
$this->app->Tpl->Set('BEZUGPARAMETER', $input['bezugparameter']);
|
||||
$this->app->Tpl->Set('VORAUSWAHLVORSCHLAG', $input['vorauswahlvorschlag']);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -79,6 +79,7 @@ class WidgetGenimportvorlage
|
||||
$field->AddOption('Wiedervorlagen (min. Angabe: datum_faellig, kundennummer,mitarbeiternummer,betreff)','wiedervorlagen');
|
||||
$field->AddOption('Notizen (min. Angabe: datum,kundennummer,mitarbeiternummer,betreff)','notizen');
|
||||
$field->AddOption('Kontenrahmen (min. Angabe: sachkonto,beschriftung,art)','kontorahmen');
|
||||
$field->AddOption('Kontoauszug','kontoauszug');
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("importerstezeilenummer","text","","15","","","","","","","","0","","");
|
||||
|
Loading…
Reference in New Issue
Block a user