noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 24/73: Bug Select_Box = problem with DIV id


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 24/73: Bug Select_Box = problem with DIV id
Date: Fri, 28 May 2021 05:26:26 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 39b6ec4f865877d10819abb56b40d950443e44d8
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Apr 18 09:22:30 2021 +0200

    Bug Select_Box = problem with DIV id
---
 html/js/infobulle.js                             |  13 ++-
 include/class/print_operation_currency.class.php | 143 +++++++++++++++++++++++
 include/export/export_pcur01_csv.php             |  30 +++++
 include/export/export_pcur01_pdf.php             |  30 +++++
 include/print_currency01.inc.php                 |  61 ++++++++++
 include/sql/patch/upgrade156.sql                 |  27 +++++
 6 files changed, 298 insertions(+), 6 deletions(-)

diff --git a/html/js/infobulle.js b/html/js/infobulle.js
index 81942ad..94e160e 100644
--- a/html/js/infobulle.js
+++ b/html/js/infobulle.js
@@ -73,22 +73,23 @@ function displayBulle(p_comment)  {
  */
 function displaySelectBox(p_name) {
     try {
-        if (! document.getElementById("select_box_content") ) {
+        var newDiv=null;
+        if (! document.getElementById("select_box_content"+p_name) ) {
 
-            var newDiv=new Element("div");
-            newDiv.id="select_box_content";
+            newDiv=new Element("div");
+            newDiv.id="select_box_content"+p_name;
             document.body.appendChild(newDiv);
             newDiv.addClassName("select_box");
-            $("select_box_content").onmouseleave=function() {
+            $("select_box_content"+p_name).onmouseleave=function() {
                 try {
-                    var newDiv=$("select_box_content");
+                    var newDiv=$("select_box_content"+p_name);
                     newDiv.setStyle({display:"none"});
                 } catch(e) {
                     alert(e.message);
                 }
             }
         } else {
-            var newDiv=document.getElementById("select_box_content");
+            newDiv=document.getElementById("select_box_content"+p_name);
         }
         newDiv.innerHTML=$("select_box"+p_name).innerHTML;
         var viewport = document.viewport.getDimensions();
diff --git a/include/class/print_operation_currency.class.php 
b/include/class/print_operation_currency.class.php
new file mode 100644
index 0000000..58b07a9
--- /dev/null
+++ b/include/class/print_operation_currency.class.php
@@ -0,0 +1,143 @@
+<?php
+
+/*
+ *   This file is part of NOALYSS.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+// Copyright (2002-2021) Author Dany De Bontridder <danydb@noalyss.eu>
+
+/**
+ * @file
+ * @brief manage the operation in currency : export CSV, export PDF , output 
in HTML
+ */
+require_once NOALYSS_INCLUDE."/class/acc_currency.class.php";
+
+class Print_Operation_Currency
+{
+    
+    private $from_date;
+    private $to_date;
+    private $currency_id;
+    private $from_account;
+    private $to_account;
+
+    function __construct($cn)
+    {
+        
+    }
+
+    public function getFrom_date()
+    {
+        return $this->from_date;
+    }
+
+    public function getTo_date()
+    {
+        return $this->to_date;
+    }
+
+    public function getCurrency()
+    {
+        return $this->currency;
+    }
+
+    public function getFrom_account()
+    {
+        return $this->from_account;
+    }
+
+    public function getTo_account()
+    {
+        return $this->to_account;
+    }
+
+    public function setFrom_date($from_date)
+    {
+        $this->from_date=$from_date;
+    }
+
+    public function setTo_date($to_date)
+    {
+        $this->to_date=$to_date;
+    }
+
+    public function setCurrency($currency)
+    {
+        $this->currency=$currency;
+    }
+
+    public function setFrom_account($from_account)
+    {
+        $this->from_account=$from_account;
+    }
+    public function from_get()
+    {   
+        $http=new HttpInput();
+        $this->from_date=$http->get("from_date","date");
+        $this->to_date=$http->get("to_date","date");
+        $this->from_account=$http->get("from_account");
+        $this->to_account=$http->get("to_account");
+        $this->currency_id=$http->get("currency_id","numeric");
+        
+    }
+    public function setTo_account($to_account)
+    {
+        $this->to_account=$to_account;
+    }
+    /**
+     * @brief Return array of data
+     */
+    function get_date()
+    {
+        $aArray=$this->cn->get_array("select jr_id,
+            j_date,
+            j_montant,
+            oc_amount,
+            j_poste,
+            jr_comment,
+            jr_internal,
+            jr_pj_number,
+            currency_id,
+            currency_rate,
+            currency_rate_ref,
+            f_id
+        from jrnx
+            join jrn on (jr_grpt_id=jrnx.j_grpt)
+            join operation_currency oc using (j_id)
+        where 
+            j_poste >= $1 
+            and j_poste <= $2 
+            and j_date >= to_date($3 ,'DD.MM.YYYY')
+            and j_date <=to_date($4 ,'DD.MM.YYYY')
+            and currency_id = $5 
+            order by j_poste,j_date  
+        
",[$this->from_account,$this->to_account,$this->from_date,$this->to_date,$this->currency_id]);
+        return $aArray;
+    }
+    function export_html()
+    {
+        
+    }
+    function export_csv()
+    {
+        
+    }
+    function export_pdf()
+    {
+        
+    }
+}
+?>
diff --git a/include/export/export_pcur01_csv.php 
b/include/export/export_pcur01_csv.php
new file mode 100644
index 0000000..2e911f1
--- /dev/null
+++ b/include/export/export_pcur01_csv.php
@@ -0,0 +1,30 @@
+<?php
+
+/*
+ *   This file is part of NOALYSS.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
+
+if (!defined('ALLOWED'))
+    die('Appel direct ne sont pas permis');
+
+/**
+ * @file
+ * @brief  export currency in CSV
+ */
+require_once NOALYSS_INCLUDE.'/class/print_operation_currency.class.php';
+?>
diff --git a/include/export/export_pcur01_pdf.php 
b/include/export/export_pcur01_pdf.php
new file mode 100644
index 0000000..973464e
--- /dev/null
+++ b/include/export/export_pcur01_pdf.php
@@ -0,0 +1,30 @@
+<?php
+
+/*
+ *   This file is part of NOALYSS.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
+
+if (!defined('ALLOWED'))
+    die('Appel direct ne sont pas permis');
+
+/**
+ * @file
+ * @brief export currency in PDF
+ */
+require_once NOALYSS_INCLUDE.'/class/print_operation_currency.class.php';
+?>
diff --git a/include/print_currency01.inc.php b/include/print_currency01.inc.php
new file mode 100644
index 0000000..62db6a8
--- /dev/null
+++ b/include/print_currency01.inc.php
@@ -0,0 +1,61 @@
+<?php
+
+/*
+ *   This file is part of NOALYSS.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
+
+if (!defined('ALLOWED'))
+    die('Appel direct ne sont pas permis');
+require_once NOALYSS_INCLUDE.'/class/print_operation_currency.class.php';
+
+/**
+ * @file
+ * @brief show all the operation in currency by accounting
+ */
+$action=$http->get("action","string","no");
+$print_operation_currency=new Print_Operation_Currency($cn);
+if ( $action == "print")
+{
+    $print_operation_currency->from_request();
+}
+$from_date=new IDate("from_date",$print_operation_currency->getFrom_date());
+$to_date=new IDate("to_date",$print_operation_currency->getTo_date());
+
+$from_account=new 
IPoste("from_account",$print_operation_currency->getFrom_account());
+
+$to_account=new 
IPoste("to_account",$print_operation_currency->getTo_account());
+
+$from_account->name('from_account');
+$from_account->set_attribute('gDossier',Dossier::id());
+$from_account->set_attribute('jrn',0);
+$from_account->set_attribute('account','from_account');
+
+$to_account->name('to_account');
+$to_account->set_attribute('gDossier',Dossier::id());
+$to_account->set_attribute('jrn',0);
+$to_account->set_attribute('account','to_account');
+
+$acc_currency=new Acc_Currency($cn);
+$selCurrency=$acc_currency->select_currency();
+$selCurrency->selected=$print_operation_currency->getCurrency();
+
+?>
+<form method="get">
+    
+    
+</form>
\ No newline at end of file
diff --git a/include/sql/patch/upgrade156.sql b/include/sql/patch/upgrade156.sql
new file mode 100644
index 0000000..02a3f1e
--- /dev/null
+++ b/include/sql/patch/upgrade156.sql
@@ -0,0 +1,27 @@
+begin;
+
+
+insert into menu_ref 
(me_code,me_menu,me_file,me_description,me_type,me_description_etendue)
+values('PCUR01','Devise','print_currency01.inc.php','Résumé par 
devise','ME','Résumé par devise afin de 
+faire de calculer les écarts de conversion (différence de change) pour les 
actifs et passifs');
+
+insert into profile_menu 
(me_code,me_code_dep,p_id,p_order,p_type_display,pm_default,pm_id_dep)
+select me_code,'PRINT',1,260,'E',0,6 from menu_ref where me_code='PCUR01'
+union
+select me_code,'PRINT',1,260,'E',0,35 from menu_ref where me_code='PCUR01'
+union
+select me_code,'PRINT',2,260,'E',0,719 from menu_ref where me_code='PCUR01' 
and exists (select 1 from profile where p_id=2)
+union
+select me_code,'PRINT',2,260,'E',0,716 from menu_ref where me_code='PCUR01' 
and exists (select 1 from profile where p_id=2)
+;
+
+insert into menu_ref (me_code,me_menu,me_file,me_type)
+values ('CSV:pcur01','Export Devise CSV','export_pcur01_csv.php','PR'),
+       ('PDF:pcur01','Export Devise PDF','export_pcur01_pdf.php','PR')
+;
+
+
+insert into version (val,v_description) values (157,'new feature Currency 
search');
+commit ;
+
+commit;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]