mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
Usability improvement kontoauszuege and buchungen
This commit is contained in:
parent
92f016d06b
commit
c6a4cf0d23
@ -33,7 +33,7 @@
|
||||
[TAB1NEXT]
|
||||
</div>
|
||||
<div id="tabs-2">
|
||||
<form action="" enctype="multipart/form-data" method="POST">
|
||||
<form action="#tabs-2" enctype="multipart/form-data" method="POST">
|
||||
[MESSAGE]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
|
@ -4,32 +4,34 @@
|
||||
</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-10 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Offene Einzelsalden|}</legend>
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-10 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Offene Einzelsalden|}</legend>
|
||||
<form action="" method="post" id="buchungenform">
|
||||
[TAB1]
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-2 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<legend>{|Aktionen|}</legend>
|
||||
<td><button name="submit" value="neuberechnen" class="ui-button-icon" style="width:100%;">{|Buchungen neu berechnen|}</button></td></tr>
|
||||
<td><button name="submit" value="BUCHEN" class="ui-button-icon" style="width:100%;">{|BUCHEN|}</button></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-2 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<legend>{|Aktionen|}</legend>
|
||||
<form action="index.php?module=fibu_buchungen&action=list" method="post">
|
||||
<td><button name="submit" value="neuberechnen" class="ui-button-icon" style="width:100%;">{|Buchungen neu berechnen|}</button></td></tr>
|
||||
</form>
|
||||
<td><button name="submit" form = "buchungenform" value="BUCHEN" class="ui-button-icon" style="width:100%;">{|BUCHEN|}</button></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -214,6 +214,9 @@ class Fibu_buchungen {
|
||||
$submit = $this->app->Secure->GetPOST('submit');
|
||||
if ($submit == 'neuberechnen') {
|
||||
$this->fibu_rebuild_tables();
|
||||
|
||||
$msg = "<div class=\"info\">Buchungen wurden neu berechnet.</div>";
|
||||
|
||||
}
|
||||
|
||||
// For transfer to tablesearch
|
||||
@ -226,6 +229,10 @@ class Fibu_buchungen {
|
||||
$this->app->YUI->TableSearch('TAB1', 'fibu_buchungen_salden', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
$this->app->YUI->TableSearch('TAB2', 'fibu_buchungen_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
|
||||
if (!empty($msg)) {
|
||||
$this->app->Tpl->Set('MESSAGE', $msg);
|
||||
}
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "fibu_buchungen_list.tpl");
|
||||
}
|
||||
|
||||
@ -233,7 +240,7 @@ class Fibu_buchungen {
|
||||
$id = (int) $this->app->Secure->GetGET('id');
|
||||
|
||||
// $this->app->DB->Delete("DELETE FROM `fibu_buchungen` WHERE `id` = '{$id}'");
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">Der Eintrag wurde gelöscht.</div>");
|
||||
// $this->app->Tpl->Set('MESSAGE', "<div class=\"error\">Der Eintrag wurde gelöscht.</div>");
|
||||
|
||||
$this->fibu_buchungen_list();
|
||||
}
|
||||
|
@ -265,6 +265,20 @@ class Kontoauszuege {
|
||||
$this->app->Tpl->Parse('PAGE', "kontoauszuege_konto_list.tpl");
|
||||
}
|
||||
|
||||
function kontoauszuege_mark_as_error(int $id) : ?string {
|
||||
$sql = "SELECT id FROM fibu_buchungen_alle WHERE CONCAT(doc_typ,doc_id) <> CONCAT('kontoauszuege','".$id."') AND typ = 'kontoauszuege' AND id = ".$id;
|
||||
$result = $this->app->DB->SelectArr($sql);
|
||||
|
||||
if (!empty($result)) {
|
||||
return("Es existieren Buchungen, Eintrag wurde nicht als Importfehler markiert!");
|
||||
} else {
|
||||
$this->app->DB->Delete("UPDATE `kontoauszuege` SET importfehler = 1 WHERE `id` = '{$id}'");
|
||||
return("Der Eintrag wurde als Importfehler markiert.");
|
||||
}
|
||||
|
||||
return(null);
|
||||
|
||||
}
|
||||
|
||||
function kontoauszuege_list() {
|
||||
|
||||
@ -275,15 +289,28 @@ class Kontoauszuege {
|
||||
foreach($auswahl as $selectedId) {
|
||||
$selectedId = (int)$selectedId;
|
||||
if($selectedId > 0) {
|
||||
$selectedIds[] = $selectedId;
|
||||
$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);
|
||||
|
||||
$message = "";
|
||||
|
||||
foreach ($selectedIds as $selectedId) {
|
||||
$result = $this->kontoauszuege_mark_as_error($selectedId);
|
||||
if ($result) {
|
||||
$message = $result;
|
||||
}
|
||||
}
|
||||
|
||||
if ($message) {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">".$message."</div>");
|
||||
} else {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"warning\">Einträge wurden als Importfehler markiert.</div>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -309,15 +336,14 @@ class Kontoauszuege {
|
||||
public function kontoauszuege_delete() {
|
||||
$id = (int) $this->app->Secure->GetGET('id');
|
||||
|
||||
$sql = "SELECT id FROM fibu_buchungen_alle WHERE CONCAT(doc_typ,doc_id) <> CONCAT('kontoauszuege','".$id."') AND typ = 'kontoauszuege' AND id = ".$id;
|
||||
$result = $this->app->DB->SelectArr($sql);
|
||||
|
||||
if (!empty($result)) {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">Es existieren Buchungen, Eintrag wurde nicht als Importfehler markiert!</div>");
|
||||
$result = $this->kontoauszuege_mark_as_error($id);
|
||||
|
||||
if ($result) {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">".$result."</div>");
|
||||
} else {
|
||||
$this->app->DB->Delete("UPDATE `kontoauszuege` SET importfehler = 1 WHERE `id` = '{$id}'");
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"warning\">Der Eintrag wurde als Importfehler markiert.</div>");
|
||||
}
|
||||
|
||||
$this->kontoauszuege_list();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user