fibu_buchungen einzelzuordnen multifilter

This commit is contained in:
OpenXE 2023-04-15 18:45:09 +02:00
parent 64d6b90312
commit 4720cc8e94
2 changed files with 79 additions and 33 deletions

View File

@ -1,3 +1,4 @@
<form action="" method="post" id="buchungenform">
<div id="tabs">
<ul>
<li><a href="#tabs-1"><!--[TABTEXT]--></a></li>
@ -5,13 +6,12 @@
<div id="tabs-1">
[MESSAGE]
[FORMHANDLEREVENT]
<legend>{|Einzelsaldo zuordnen und auf mehrere Gegenbelege oder Sachkonto verbuchen.|}</legend>
<div class="row">
<div class="row-height">
<div class="col-xs-12 col-md-12 col-md-height">
<div class="col-xs-12 col-md-6 col-md-height">
<div class="inside inside-full-height">
<form action="" method="post" id="buchungenform">
<fieldset>
<legend>{|Einzelsaldo zuordnen und auf mehrere Gegenbelege oder Sachkonto verbuchen.|}</legend>
<table>
<tr>
<td>
@ -25,8 +25,36 @@
</tr>
</table>
</fieldset>
</div>
</div>
<div class="col-xs-12 col-md-6 col-md-height">
<div class="inside inside-full-height">
<fieldset>
<table>
<tr>
<td>
Multifilter f&uuml;r "Info" (Trennzeichen ',; ')
</td>
</tr>
<tr>
<td>
<textarea type="text" name="multifilter" id="multifilter" style="width:100%;">[MULTIFILTER]</textarea>
</td>
<td>
<button name="submit" value="multifilter" class="ui-button-icon">{|Filtern|}</button>
</td>
</tr>
</table>
</fieldset>
</div>
</div>
</div>
</div>
<div class="row">
<div class="row-height">
<div class="col-xs-12 col-md-12 col-md-height">
<div class="inside inside-full-height">
[TAB1]
</form>
<fieldset>
<table>
<legend>Stapelverarbeitung</legend>
@ -35,27 +63,25 @@
</tr>
<tr>
<td><input type="checkbox" value="1" id="autoalle" />&nbsp;alle markieren&nbsp;
<select form="buchungenform" id="sel_aktion" name="sel_aktion">
<select id="sel_aktion" name="sel_aktion">
<option value="buchen">{|auf Ausgew&auml;hlte buchen|}</option>
<option value="buchen_diff_sachkonto">{|auf Ausgew&auml;hlte buchen, Gegenbeleg auf Sachkonto ausgleichen|}</option>
</select>&nbsp;Sachkonto:
<input type="text" form="buchungenform" id="sachkonto" name="sachkonto" value="">
<button name="submit" form="buchungenform" value="BUCHEN" class="ui-button-icon">{|BUCHEN|}</button>
<input type="text" id="sachkonto" name="sachkonto" value="">
<button name="submit" value="BUCHEN" class="ui-button-icon">{|BUCHEN|}</button>
</td>
</tr>
<tr>
<td>
<input type="number" name="abschlag" id="abschlag" form="neuberechnen" value=[ABSCHLAG] />% Abschlag auf Buchungsbetrag</td>
<input type="number" name="abschlag" id="abschlag" value=[ABSCHLAG] />% Abschlag auf Buchungsbetrag</td>
</td>
</tr>
<tr>
<form action="" method="post" id="neuberechnen">
<td>
<button name="submit" value="neuberechnen" class="ui-button-icon" style="width:100%;">
{|Buchungen neu berechnen|}
</button>
</td>
</form>
</tr>
</table>
</fieldset>
@ -66,6 +92,8 @@
</div>
</div>
</form>
<script>
$('#autoalle').on('change',function(){

View File

@ -430,11 +430,21 @@ class Fibu_buchungen {
$doc_typ = $this->app->User->GetParameter('fibu_buchungen_doc_typ');
$doc_id = $this->app->User->GetParameter('fibu_buchungen_doc_id');
$abschlag = $this->app->User->GetParameter('fibu_buchungen_abschlag');
if (!is_numeric($abschlag)) {
$abschlag = 0;
}
$multifilter = $this->app->User->GetParameter('fibu_buchungen_multifilter');
if (!empty($multifilter)) {
$multifilter = $this->app->DB->real_escape_string($multifilter);
$multifilter = str_replace(',',' ',$multifilter);
$multifilter = str_replace(';',' ',$multifilter);
$multifilter = str_replace('\r',' ',$multifilter);
$multifilter = str_replace('\n',' ',$multifilter);
$multifilter_array = explode(' ',$multifilter." ");
}
$auswahl = array (
'<input type=\"text\" name=\"ids[]\" value=\"',
['sql' => 'fo.typ'],
@ -502,6 +512,10 @@ class Fibu_buchungen {
$where = "fo.typ <> '".$doc_typ."'";
if (!empty($multifilter_array)) {
$where .= " AND fo.info IN ('".implode("','",$multifilter_array)."')";
}
// $count = "SELECT count(DISTINCT id) FROM fibu_buchungen_alle WHERE $where";
$groupby = "GROUP BY fo.id, fo.typ";
@ -918,6 +932,8 @@ class Fibu_buchungen {
$sachkonto = $this->app->Secure->GetPOST('sachkonto');
$abschlag = $this->app->Secure->GetPOST('abschlag');
$this->app->User->SetParameter('fibu_buchungen_abschlag', $abschlag);
$multifilter = $this->app->Secure->GetPOST('multifilter');
$this->app->User->SetParameter('fibu_buchungen_multifilter', $multifilter);
$account_id = null;
if (!empty($sachkonto)) {
@ -1031,6 +1047,8 @@ class Fibu_buchungen {
$this->app->Tpl->Set('DOC_SALDO',$saldo." ".$waehrung);
$this->app->Tpl->Set('ABSCHLAG',$abschlag);
$this->app->Tpl->Set('MULTIFILTER',str_replace(array('\r\n', '\r', '\n'), ", ", $multifilter));
$this->app->erp->Headlines('Buchhaltung','Einzelzuordnung '.strtoupper($von_typ));
$this->app->YUI->TableSearch('TAB1', 'fibu_buchungen_einzelzuordnen', "show", "", "", basename(__FILE__), __CLASS__);