Update manuel

Extension are now shown as menu 
Fix bug with Acc_Ledger::get_operation for the periode
Historic of operation show the requested periode
Bug in patch : version 9.0 the "similar to" clause failed in trigger on pcmn
Bug in patch : renumbering of operation doesn't work with data before 1/1/2010
This commit is contained in:
Dany De Bontridder 2011-11-27 20:38:23 +00:00
parent 8f6a9ba082
commit b43f91a6fc
9 changed files with 58 additions and 49 deletions

Binary file not shown.

View file

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

View file

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

View file

@ -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'] != '')
{

View file

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

View file

@ -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;$f<count($aAmountVat);$f++)
{
$l=$aAmountVat[$f]['tva_id'];
$atva_amount[$l]=$aAmountVat[$f]['sum_vat'];
$this->tp_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');

View file

@ -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 '<form method="get" action="do.php">';
@ -47,9 +47,8 @@ else
echo _('Extension').$a->input().HtmlInput::submit('go',_("Choix de l'extension"));
echo '</form>';
echo '<hr>';
}
if ( isset($_REQUEST['plugin_code']))
require_once 'extension_get.inc.php';
}*/
//if ( isset($_REQUEST['plugin_code']))
// require_once 'extension_get.inc.php';
?>

View file

@ -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é");

View file

@ -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='<h2 class="info2">'."Periode ".$date_start." au ".$date_end.'</h2>';
}
else
{
$msg='<h2 class="info2">'."Periode ".$_GET['date_start']." au ".$_GET['date_end'].'</h2>';
}
/* 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 '<form method="GET" id="fpaida" class="print">';
echo HtmlInput::hidden("ac", $_REQUEST['ac']);
echo HtmlInput::hidden('ledger_type',$_REQUEST['ledger_type']);