Bug Select_Box = problem with DIV id

This commit is contained in:
sparkyx 2021-04-18 09:22:30 +02:00
parent ef1a5e414c
commit 39b6ec4f86
6 changed files with 298 additions and 6 deletions

View file

@ -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();

View file

@ -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()
{
}
}
?>

View file

@ -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';
?>

View file

@ -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';
?>

View file

@ -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>

View file

@ -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;