diff --git a/doc/manuel-fr.odt b/doc/manuel-fr.odt index 1bdc711a3..bcbcf7b05 100644 Binary files a/doc/manuel-fr.odt and b/doc/manuel-fr.odt differ diff --git a/html/admin/sql/patch/upgrade97.sql b/html/admin/sql/patch/upgrade97.sql index 6b5dc5ac5..5816c42ce 100644 --- a/html/admin/sql/patch/upgrade97.sql +++ b/html/admin/sql/patch/upgrade97.sql @@ -218,12 +218,8 @@ sResult account_type; begin sResult := lower(p_account); -sResult := translate(sResult,'éèêëàâäïîüûùöô','eeeeaaaiiuuuoo'); -sResult := translate(sResult,' $€µ£%.+-/\!(){}(),;_&|"#''^',''); - -if not sResult similar to '^[[:alnum:]_]+$' then - raise exception 'Invalid character in %',p_account; -end if; +sResult := translate(sResult,'éèêëàâäïîüûùöôç','eeeeaaaiiuuuooc'); +sResult := translate(sResult,' $€µ£%.+-/\!(){}(),;_&|"#''^<>*',''); return upper(sResult); @@ -960,7 +956,7 @@ end; insert into menu_ref(me_code,me_menu,me_file,me_description,me_type,me_parameter) select ex_code,ex_name,ex_file,ex_desC,'PL','plugin_code='||ex_code from extension; insert into profile_menu (me_code,me_code_dep,p_id,p_type_display) select me_code,'EXT',1,'S' from menu_ref where me_type='PL'; -update jrn set jr_internal=substring(jr_internal,1,1)||lpad(upper(to_hex(jr_id+1)),6,'0'); +update jrn set jr_internal=substr(jrn_def_type,1,1)||lpad(upper(to_hex(jr_id+1)),6,'0') from jrn_def where jrn_def_id=jr_def_id; update version set val=98; diff --git a/html/export.php b/html/export.php index 320ec4d88..ac56c6de1 100644 --- a/html/export.php +++ b/html/export.php @@ -34,9 +34,9 @@ $cn=new Database($gDossier); $user=new User($cn); $user->Check(); -$act=$user->check_dossier($gDossier); +$action=$user->check_dossier($gDossier); -if ( $act=='X' || ! isset($_GET['act']) || $user->check_print($_GET['act'])==0 ) +if ( $action=='X' || ! isset($_GET['act']) || $user->check_print($_GET['act'])==0 ) { echo alert('Accès interdit'); redirect("do.php?".dossier::get()); diff --git a/include/ac_common.php b/include/ac_common.php index db99d8a42..b6dba7311 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -774,10 +774,14 @@ function show_module($selected) // if file is not a plugin, include the file, otherwise // include the plugin launcher - if ( $file[0]['me_type'] != 'PL') - require_once $file[0]['me_file']; - else - require 'extension_get.inc.php'; + if ($file[0]['me_type'] != 'PL') + { + require_once $file[0]['me_file']; + } + else + { + var_dump($file); + } } if ( $file[0]['me_javascript'] != '') { diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index c5ff1da0b..5c4d7e6fa 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -2456,10 +2456,12 @@ class Acc_Ledger extends jrn_def_sql if ( ! isset ($date_start)) { $user=new User($this->db); - $period=$user->get_periode(); + $exercice=$user->get_exercice(); - $per=new Periode($this->db,$period); - list($date_start,$date_end)=$per->get_date_limit(); + $per=new Periode($this->db); + list($per_start,$per_end)=$per->limit_year($exercice); + list($date_start,$none)=$per_start->get_date_limit(); + list($none,$date_end)=$per_end->get_date_limit(); } $desc=''; @@ -2697,8 +2699,10 @@ class Acc_Ledger extends jrn_def_sql " to_char(jr_date,'DDMMYY') as date_fmt, ". " jr_comment as comment, jr_montant as montant ,". " jr_grpt_id,jr_def_id". - " from jrn where jr_tech_per >= $1 ". - ' and jr_tech_per <=$2 '.$jrn.' order by jr_date,substring(jr_pj_number,\'\\\d+$\')::numeric asc'; + " from jrn where ". + " jr_date >= (select p_start from parm_periode where p_id = $1) + and jr_date <= (select p_end from parm_periode where p_id = $2)" . + ' '.$jrn.' order by jr_date,substring(jr_pj_number,\'\\\d+$\')::numeric asc'; $ret=$this->db->get_array($sql,array($p_from,$p_to)); return $ret; } diff --git a/include/class_print_ledger_simple.php b/include/class_print_ledger_simple.php index e1885342d..1489cd562 100644 --- a/include/class_print_ledger_simple.php +++ b/include/class_print_ledger_simple.php @@ -93,11 +93,11 @@ class Print_Ledger_Simple extends PDF } $this->Cell(15,6,'Pièce'); $this->Cell(10,6,'Date'); - $this->Cell(20,6,'ref'); + $this->Cell(13,6,'ref'); if ( $this->jrn_type=='ACH') - $this->Cell(60,6,'Client'); + $this->Cell(40,6,'Client'); else - $this->Cell(60,6,'Fournisseur'); + $this->Cell(40,6,'Fournisseur'); $flag_tva=(count($this->a_Tva) > 4)?true:false; if ( !$flag_tva ) $this->Cell(65,6,'Description'); @@ -117,7 +117,7 @@ class Print_Ledger_Simple extends PDF $this->SetFont('DejaVu','',6); // page Header - $this->Cell(170,6,'report',0,0,'R'); + $this->Cell(143,6,'report',0,0,'R'); $this->Cell(15,6,nbm($this->rap_htva),0,0,'R'); /* HTVA */ if ( $this->jrn_type != 'VEN') { @@ -149,7 +149,7 @@ class Print_Ledger_Simple extends PDF //Position at 3 cm from bottom $this->SetY(-20); /* write reporting */ - $this->Cell(170,6,'Total page ','T',0,'R'); /* HTVA */ + $this->Cell(143,6,'Total page ','T',0,'R'); /* HTVA */ $this->Cell(15,6,nbm($this->tp_htva),'T',0,'R'); /* HTVA */ if ( $this->jrn_type !='VEN') { @@ -164,7 +164,7 @@ class Print_Ledger_Simple extends PDF $this->Cell(15,6,nbm($this->tp_tvac),'T',0,'R'); /* Tvac */ $this->Ln(2); - $this->Cell(170,6,'report',0,0,'R'); /* HTVA */ + $this->Cell(143,6,'report',0,0,'R'); /* HTVA */ $this->Cell(15,6,nbm($this->rap_htva),0,0,'R'); /* HTVA */ if ( $this->jrn_type !='VEN') { @@ -219,31 +219,30 @@ class Print_Ledger_Simple extends PDF for ($f=0;$ftp_tva[$l]+=$aAmountVat[$f]['sum_vat']; - $this->rap_tva[$l]+=$aAmountVat[$f]['sum_vat']; + $atva_amount[$l]=bcadd($atva_amount[$l],$aAmountVat[$f]['sum_vat']); + $this->tp_tva[$l]=bcadd($this->tp_tva[$l],$aAmountVat[$f]['sum_vat']); + $this->rap_tva[$l]=bcadd($this->rap_tva[$l],$aAmountVat[$f]['sum_vat']); } $row=$a_jrn[$i]; $this->Cell(15,5,($row['pj']),0,0); $this->Cell(10,5,$row['date_fmt'],0,0); - $this->Cell(20,5,$row['internal'],0,0); + $this->Cell(13,5,$row['internal'],0,0); list($qc,$name)=$this->get_tiers($row['id'],$this->jrn_type); - $this->Cell(20,5,$qc,0,0); - $this->Cell(40,5,$name,0,0); + $this->Cell(40,5,"[".$qc."]".$name,0,0); $this->Cell(65,5,substr($row['comment'],0,47),0,0); /* get other amount (without vat, total vat included, private, ND */ $other=$this->ledger->get_other_amount($a_jrn[$i]['jr_grpt_id']); - $this->tp_htva+=$other['price']; - $this->tp_tvac+=$other['price']+$other['vat']; - $this->tp_priv+=$other['priv']; - $this->tp_nd+=$other['tva_nd']; - $this->rap_htva+=$other['price']; - $this->rap_tvac+=$other['price']+$other['vat']; - $this->rap_priv+=$other['priv']; - $this->rap_nd+=$other['tva_nd']; + $this->tp_htva=bcadd($this->tp_htva,$other['price']); + $this->tp_tvac=bcadd($this->tp_tvac,$other['price']+$other['vat']); + $this->tp_priv=bcadd($this->tp_priv,$other['priv']); + $this->tp_nd=bcadd($this->tp_nd,$other['tva_nd']); + $this->rap_htva=bcadd($this->rap_htva,$other['price']); + $this->rap_tvac=bcadd($this->rap_tvac,$other['price']+$other['vat']); + $this->rap_priv=bcadd($this->rap_priv,$other['priv']); + $this->rap_nd=bcadd($this->rap_nd,$other['tva_nd']); $this->Cell(15,5,nbm($other['price']),0,0,'R'); @@ -252,10 +251,10 @@ class Print_Ledger_Simple extends PDF $this->Cell(15,5,nbm($other['priv']),0,0,'R'); $this->Cell(15,5,nbm($other['tva_nd']),0,0,'R'); } - foreach ($atva_amount as $row_atva_amount) - { - $this->Cell(15,5,nbm($row_atva_amount),0,0,'R'); - } + foreach ($atva_amount as $row_atva_amount) + { + $this->Cell(15, 5, nbm($row_atva_amount), 0, 0, 'R'); + } $l_tvac=bcadd($other['price'],$other['vat']); $this->Cell(15,5,nbm($l_tvac),0,0,'R'); diff --git a/include/extension_choice.inc.php b/include/extension_choice.inc.php index 29ee97fd2..4810215f1 100644 --- a/include/extension_choice.inc.php +++ b/include/extension_choice.inc.php @@ -38,7 +38,7 @@ if ( count($a->value)==1 ) { $_REQUEST['plugin_code']=$a->value[0]['value']; } -else +/*else { if (!isset($_REQUEST['ac'])) echo_warning ("ac non positionné"); echo '
'; @@ -47,9 +47,8 @@ else echo _('Extension').$a->input().HtmlInput::submit('go',_("Choix de l'extension")); echo '
'; echo '
'; -} - -if ( isset($_REQUEST['plugin_code'])) - require_once 'extension_get.inc.php'; +}*/ +//if ( isset($_REQUEST['plugin_code'])) +// require_once 'extension_get.inc.php'; ?> diff --git a/include/extension_get.inc.php b/include/extension_get.inc.php index 84d1e06b4..74217ad35 100644 --- a/include/extension_get.inc.php +++ b/include/extension_get.inc.php @@ -18,7 +18,7 @@ require_once ('class_user.php'); global $cn,$g_user; $ext=new Extension($cn); -; + if ($ext->search($_REQUEST['plugin_code']) == -1) { echo_warning("plugin non trouvé"); diff --git a/include/history_operation.inc.php b/include/history_operation.inc.php index ce6018477..cb293e4f5 100644 --- a/include/history_operation.inc.php +++ b/include/history_operation.inc.php @@ -85,6 +85,7 @@ if (isset($_GET ['paid'])) } $p_array = $_GET; +$msg=""; /* by default we should the default period */ if (!isset($p_array['date_start'])) { @@ -93,6 +94,12 @@ if (!isset($p_array['date_start'])) list($date_start, $date_end) = $per->get_date_limit(); $p_array['date_start'] = $date_start; $p_array['date_end'] = $date_end; + $msg='

'."Periode ".$date_start." au ".$date_end.'

'; +} +else +{ + $msg='

'."Periode ".$_GET['date_start']." au ".$_GET['date_end'].'

'; + } /* compute the sql stmt */ list($sql, $where) = $Ledger->build_search_sql($p_array); @@ -104,7 +111,7 @@ $page = (isset($_GET['offset'])) ? $_GET['page'] : 1; $offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0; $bar = jrn_navigation_bar($offset, $max_line, $step, $page); - +echo $msg; echo '
'; echo HtmlInput::hidden("ac", $_REQUEST['ac']); echo HtmlInput::hidden('ledger_type',$_REQUEST['ledger_type']);