From 06bc38e66a91db7b72e2e0c237a6db06c4749128 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Mon, 3 Apr 2023 21:17:59 +0200 Subject: [PATCH] fibu_buchungen improved cache refresh --- phpwf/plugins/class.yui.php | 30 ++++++++++------ www/pages/content/fibu_buchungen_list.tpl | 27 ++++++++++++-- www/pages/content/fibu_buchungen_zuordnen.tpl | 3 +- www/pages/fibu_buchungen.php | 35 +++++++++++-------- 4 files changed, 66 insertions(+), 29 deletions(-) diff --git a/phpwf/plugins/class.yui.php b/phpwf/plugins/class.yui.php index 41ba736e..3cff0535 100644 --- a/phpwf/plugins/class.yui.php +++ b/phpwf/plugins/class.yui.php @@ -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%'); - $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'); $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); // SQL statement - $sql = "SELECT SQL_CALC_FOUND_ROWS r.id,'app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' as open, concat('')as auswahl, - r.belegnr, - DATE_FORMAT(r.datum,'%d.%m.%Y') as vom, adr.kundennummer as kundennummer, - CONCAT(" . $this->app->erp->MarkerUseredit("r.name", "r.useredittimestamp") . ", if(r.internebezeichnung!='',CONCAT('
',r.internebezeichnung,''),'')) as kunde, - r.land as land, 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 + $sql = "SELECT SQL_CALC_FOUND_ROWS + r.id, + 'app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' as open, + concat('')as auswahl, + r.belegnr, + DATE_FORMAT(r.datum,'%d.%m.%Y') as vom, + adr.kundennummer as kundennummer, + CONCAT(" . $this->app->erp->MarkerUseredit("r.name", "r.useredittimestamp") . ", if(r.internebezeichnung!='',CONCAT('
',r.internebezeichnung,''),'')) as kunde, + r.land as land, + 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 LEFT JOIN rechnung re ON re.id=r.rechnungid LEFT JOIN projekt p ON p.id=r.projekt diff --git a/www/pages/content/fibu_buchungen_list.tpl b/www/pages/content/fibu_buchungen_list.tpl index 00ddbd0d..33610955 100644 --- a/www/pages/content/fibu_buchungen_list.tpl +++ b/www/pages/content/fibu_buchungen_list.tpl @@ -33,8 +33,31 @@ [TAB1NEXT]
- [MESSAGE] - [TAB2] +
+ [MESSAGE] +
+
+
+
+
+ {|Einzelbuchungen|} + [TAB2] +
+
+
+
+
+
+ + {|Aktionen|} + +
+
+
+
+
+
+
[TAB2NEXT]
diff --git a/www/pages/content/fibu_buchungen_zuordnen.tpl b/www/pages/content/fibu_buchungen_zuordnen.tpl index 0d3a577f..0090e5c7 100644 --- a/www/pages/content/fibu_buchungen_zuordnen.tpl +++ b/www/pages/content/fibu_buchungen_zuordnen.tpl @@ -21,7 +21,8 @@
{|Aktionen|} - + +
diff --git a/www/pages/fibu_buchungen.php b/www/pages/fibu_buchungen.php index f398b2f7..2b7affbd 100644 --- a/www/pages/fibu_buchungen.php +++ b/www/pages/fibu_buchungen.php @@ -190,6 +190,22 @@ class Fibu_buchungen { } 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() { $this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=list", "Übersicht"); @@ -197,19 +213,7 @@ class Fibu_buchungen { $submit = $this->app->Secure->GetPOST('submit'); if ($submit == 'neuberechnen') { - $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); + $this->fibu_rebuild_tables(); } // For transfer to tablesearch @@ -429,7 +433,7 @@ class Fibu_buchungen { $this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=list", "Übersicht"); - $submit = $this->app->Secure->GetPOST('ausfuehren'); + $submit = $this->app->Secure->GetPOST('submit'); $count_success = 0; if ($submit == 'BUCHEN') { @@ -462,7 +466,8 @@ class Fibu_buchungen { $count_success++; } - } + } + $this->fibu_rebuild_tables(); } $msg .= "
".$count_success." Buchung".(($count_success===1)?'':'en')." durchgeführt.
"; }