fibu_buchungen improved cache refresh

This commit is contained in:
OpenXE 2023-04-03 21:17:59 +02:00
parent ad4599e381
commit 06bc38e66a
4 changed files with 66 additions and 29 deletions

View File

@ -6085,7 +6085,7 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
); );
$width = array('1%', '1%', '10%', '10%', '10%', '25%', '5%', '1%', '1%', '1%', '1%', '1%', '1%','5%', '1%','1%', '1%'); $width = array('1%', '1%', '10%', '10%', '10%', '25%', '5%', '1%', '1%', '1%', '1%', '1%', '1%','5%', '1%','1%', '1%');
$findcols = array('open', 'r.belegnr', 'r.belegnr', 'r.datum', 'adr.kundennummer', 'r.name', 'r.land', 'p.abkuerzung', 'r.zahlungsweise', 'r.soll','re.belegnr', 'r.zahlungsstatus','differenz', 'r.status', 'pt.payement_status' ,'id'); $findcols = array('open', 'r.belegnr', 'r.belegnr', 'r.datum', 'adr.kundennummer', 'r.name', 'r.land', 'p.abkuerzung', 'r.zahlungsweise', 'r.soll', 'r.zahlungsstatus','r.soll-r.ist', 're.belegnr', 'r.status', 'id');
$searchsql = array('DATE_FORMAT(r.datum,\'%d.%m.%Y\')', 'r.belegnr', 'adr.kundennummer', 'r.name', 'r.land', 'p.abkuerzung','re.belegnr', 'r.status', "FORMAT(r.soll,2{$extended_mysql55})", 'adr.freifeld1', 'r.ihrebestellnummer','r.internebezeichnung','au.internet'); $searchsql = array('DATE_FORMAT(r.datum,\'%d.%m.%Y\')', 'r.belegnr', 'adr.kundennummer', 'r.name', 'r.land', 'p.abkuerzung','re.belegnr', 'r.status', "FORMAT(r.soll,2{$extended_mysql55})", 'adr.freifeld1', 'r.ihrebestellnummer','r.internebezeichnung','au.internet');
$defaultorder = 13; //Optional wenn andere Reihenfolge gewuenscht $defaultorder = 13; //Optional wenn andere Reihenfolge gewuenscht
@ -6134,16 +6134,24 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
$parameter = json_decode($parameter, true); $parameter = json_decode($parameter, true);
// SQL statement // SQL statement
$sql = "SELECT SQL_CALC_FOUND_ROWS r.id,'<img src=./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' as open, concat('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',r.id,'\" />')as auswahl, $sql = "SELECT SQL_CALC_FOUND_ROWS
r.belegnr, r.id,
DATE_FORMAT(r.datum,'%d.%m.%Y') as vom, adr.kundennummer as kundennummer, '<img src=./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' as open,
CONCAT(" . $this->app->erp->MarkerUseredit("r.name", "r.useredittimestamp") . ", if(r.internebezeichnung!='',CONCAT('<br><i style=color:#999>',r.internebezeichnung,'</i>'),'')) as kunde, concat('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',r.id,'\" />')as auswahl,
r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise, r.belegnr,
".$this->app->erp->FormatMenge('r.soll',2)." as soll, DATE_FORMAT(r.datum,'%d.%m.%Y') as vom,
r.zahlungsstatus as zahlung, adr.kundennummer as kundennummer,
".$this->app->erp->FormatMenge('r.soll-r.ist',2)." as differenz, CONCAT(" . $this->app->erp->MarkerUseredit("r.name", "r.useredittimestamp") . ", if(r.internebezeichnung!='',CONCAT('<br><i style=color:#999>',r.internebezeichnung,'</i>'),'')) as kunde,
re.belegnr as rechnung, UPPER(r.status) as status, r.land as land,
".$this->IconsSQLReturnOrder()." ,r.id p.abkuerzung as projekt,
r.zahlungsweise as zahlungsweise,
".$this->app->erp->FormatMenge('r.soll',2)." as soll,
r.zahlungsstatus as zahlung,
".$this->app->erp->FormatMenge('r.soll-r.ist',2)." as differenz,
re.belegnr as rechnung,
UPPER(r.status) as status,
".$this->IconsSQLReturnOrder().",
r.id
FROM gutschrift r FROM gutschrift r
LEFT JOIN rechnung re ON re.id=r.rechnungid LEFT JOIN rechnung re ON re.id=r.rechnungid
LEFT JOIN projekt p ON p.id=r.projekt LEFT JOIN projekt p ON p.id=r.projekt

View File

@ -33,8 +33,31 @@
[TAB1NEXT] [TAB1NEXT]
</div> </div>
<div id="tabs-2"> <div id="tabs-2">
[MESSAGE] <form action="" enctype="multipart/form-data" method="POST">
[TAB2] [MESSAGE]
<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>{|Einzelbuchungen|}</legend>
[TAB2]
</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>
</table>
</fieldset>
</div>
</div>
</div>
</div>
</form>
[TAB2NEXT] [TAB2NEXT]
</div> </div>
</div> </div>

View File

@ -21,7 +21,8 @@
<fieldset> <fieldset>
<table width="100%" border="0" class="mkTableFormular"> <table width="100%" border="0" class="mkTableFormular">
<legend>{|Aktionen|}</legend> <legend>{|Aktionen|}</legend>
<tr><td><input type="submit" class="btnBlue" name="ausfuehren" value="{|BUCHEN|}" /></td></tr> <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> </table>
</fieldset> </fieldset>
</div> </div>

View File

@ -190,6 +190,22 @@ class Fibu_buchungen {
} }
return $erg; return $erg;
} }
function fibu_rebuild_tables() {
$sql = "DROP TABLE IF EXISTS `fibu_buchungen_alle`";
$this->app->DB->Update($sql);
$sql = "DROP VIEW IF EXISTS `fibu_buchungen_alle`";
$this->app->DB->Update($sql);
$sql = "CREATE TABLE `fibu_buchungen_alle` AS SELECT * FROM `fibu_buchungen_alle_view`";
$this->app->DB->Update($sql);
$sql = "DROP TABLE IF EXISTS `fibu_objekte`";
$this->app->DB->Update($sql);
$sql = "DROP VIEW IF EXISTS `fibu_objekte`";
$this->app->DB->Update($sql);
$sql = "CREATE TABLE `fibu_objekte` AS SELECT * FROM `fibu_objekte_view`";
$this->app->DB->Update($sql);
}
function fibu_buchungen_list() { function fibu_buchungen_list() {
$this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=list", "&Uuml;bersicht"); $this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=list", "&Uuml;bersicht");
@ -197,19 +213,7 @@ class Fibu_buchungen {
$submit = $this->app->Secure->GetPOST('submit'); $submit = $this->app->Secure->GetPOST('submit');
if ($submit == 'neuberechnen') { if ($submit == 'neuberechnen') {
$sql = "DROP TABLE IF EXISTS `fibu_buchungen_alle`"; $this->fibu_rebuild_tables();
$this->app->DB->Update($sql);
$sql = "DROP VIEW IF EXISTS `fibu_buchungen_alle`";
$this->app->DB->Update($sql);
$sql = "CREATE TABLE `fibu_buchungen_alle` AS SELECT * FROM `fibu_buchungen_alle_view`";
$this->app->DB->Update($sql);
$sql = "DROP TABLE IF EXISTS `fibu_objekte`";
$this->app->DB->Update($sql);
$sql = "DROP VIEW IF EXISTS `fibu_objekte`";
$this->app->DB->Update($sql);
$sql = "CREATE TABLE `fibu_objekte` AS SELECT * FROM `fibu_objekte_view`";
$this->app->DB->Update($sql);
} }
// For transfer to tablesearch // For transfer to tablesearch
@ -429,7 +433,7 @@ class Fibu_buchungen {
$this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=list", "&Uuml;bersicht"); $this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=list", "&Uuml;bersicht");
$submit = $this->app->Secure->GetPOST('ausfuehren'); $submit = $this->app->Secure->GetPOST('submit');
$count_success = 0; $count_success = 0;
if ($submit == 'BUCHEN') { if ($submit == 'BUCHEN') {
@ -462,7 +466,8 @@ class Fibu_buchungen {
$count_success++; $count_success++;
} }
} }
$this->fibu_rebuild_tables();
} }
$msg .= "<div class=\"info\">".$count_success." Buchung".(($count_success===1)?'':'en')." durchgef&uuml;hrt.</div>"; $msg .= "<div class=\"info\">".$count_success." Buchung".(($count_success===1)?'':'en')." durchgef&uuml;hrt.</div>";
} }