fix small cosmetic bugs

This commit is contained in:
Dany De Bontridder 2011-11-27 02:20:11 +00:00
parent c298acc947
commit 24fd4a551f
15 changed files with 69 additions and 66 deletions

View file

@ -69,7 +69,7 @@ begin
end;
$BODY$
LANGUAGE plpgsql;
DROP FUNCTION comptaproc.account_insert(integer, text);
CREATE OR REPLACE FUNCTION comptaproc.account_insert(p_f_id integer, p_account text)
@ -170,7 +170,7 @@ declare
begin
if length(trim(p_account)) != 0 then
-- 2 accounts in card separated by comma
-- 2 accounts in card separated by comma
if position (',' in p_account) = 0 then
select count(*) into nCount from tmp_pcmn where pcm_val=p_account;
if nCount = 0 then
@ -193,13 +193,13 @@ begin
raise exception 'Too many comas, invalid account';
end if;
-- check that both account are in PCMN
end if;
else
-- account is null
update fiche_detail set ad_value=null where f_id=p_f_id and ad_id=5 ;
end if;
update fiche_detail set ad_value=p_account where f_id=p_f_id and ad_id=5 ;
return 0;
@ -230,7 +230,7 @@ return upper(sResult);
end;
$BODY$
LANGUAGE plpgsql;
COMMENT ON FUNCTION comptaproc.format_account(account_type) IS 'format the accounting :
- upper case
- remove space and special char.
@ -256,7 +256,7 @@ declare
r_record tmp_pcmn%ROWTYPE;
begin
r_record := NEW;
if length(trim(r_record.pcm_type))=0 or r_record.pcm_type is NULL then
if length(trim(r_record.pcm_type))=0 or r_record.pcm_type is NULL then
r_record.pcm_type:=find_pcm_type(NEW.pcm_val);
return r_record;
end if;
@ -729,8 +729,6 @@ ALTER TABLE ONLY profile_menu ADD CONSTRAINT profile_menu_me_code_fkey FOREIG
ALTER TABLE ONLY profile_menu ADD CONSTRAINT profile_menu_p_id_fkey FOREIGN KEY (p_id) REFERENCES profile(p_id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY profile_menu ADD CONSTRAINT profile_menu_type_fkey FOREIGN KEY (p_type_display) REFERENCES profile_menu_type(pm_type);
ALTER TABLE ONLY profile_user ADD CONSTRAINT profile_user_p_id_fkey FOREIGN KEY (p_id) REFERENCES profile(p_id) ON UPDATE CASCADE ON DELETE CASCADE;
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,'EXTENSION',1,'S' from menu_ref where me_type='PL';
create type menu_tree as (code text,description text);
create or replace function comptaproc.get_profile_menu(login text)
@ -741,16 +739,16 @@ declare
a menu_tree;
e menu_tree;
begin
for a in select me_code,me_description from v_all_menu where user_name=login
for a in select me_code,me_description from v_all_menu where user_name=login
and me_code_dep is null and me_type <> 'PR' and me_type <>'SP'
loop
return next a;
for e in select * from get_menu_tree(a.code,login)
loop
loop
return next e;
end loop;
end loop;
return;
end;
@ -769,7 +767,7 @@ declare
x v_all_menu%ROWTYPE;
begin
for x in select * from v_all_menu where me_code_dep=p_code::text and user_name=login::text
loop
loop
if x.me_code_dep is not null then
i.code := x.me_code_dep||'/'||x.me_code;
else
@ -777,9 +775,9 @@ begin
end if;
i.description := x.me_description;
return next i;
for e in select * from get_menu_tree(x.me_code,login)
loop
e.code:=x.me_code_dep||'/'||e.code;
@ -791,7 +789,7 @@ begin
end;
$BODY$
LANGUAGE plpgsql;
alter table mod_payment add jrn_def_id bigint;
update mod_payment set jrn_def_id=2 where mp_type='VEN';
update mod_payment set jrn_def_id=3 where mp_type='ACH';
@ -934,7 +932,7 @@ begin
p_tva_sided);
return;
end;
$function$
$function$
LANGUAGE plpgsql;
DROP FUNCTION comptaproc.insert_quant_sold(text, numeric, character varying, numeric, numeric, numeric, integer, character varying);
@ -956,8 +954,14 @@ begin
(p_internal,p_jid,fid_good,p_quant,p_price,p_vat,p_vat_code,fid_client,'Y',p_tva_sided);
return;
end;
$function$
$function$
LANGUAGE plpgsql;
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 version set val=98;
commit;

View file

@ -526,13 +526,12 @@ EOF;
break;
case 'up_pay_method':
require_once 'ajax_update_payment.php';
break;
case 'openancsearch':
case 'resultancsearch':
require_once('ajax_anc_search.php');
break;
case 'autoanc':
require_once('ajax_auto_anc_card.php');
break;
break;
case 'openancsearch':
case 'resultancsearch':
require_once('ajax_anc_search.php');
break;
case 'autoanc':
require_once('ajax_auto_anc_card.php');
break;
}

View file

@ -137,17 +137,6 @@ if (isset($_REQUEST['ac']))
show_menu($all, $i);
}
}
/*elseif (isset($_REQUEST['plugin_code']))
{
$default = find_default_module();
$_GET['ac']=$default;
$_POST['ac']=$default;
$_REQUEST['ac']=$default;
show_module('EXTENSION');
$all[0] = $default;
show_menu($all, 0);
require_once 'extension_choice.inc.php';
}*/
else
{
$default = find_default_module();

View file

@ -125,6 +125,7 @@ div.u_tmenu div.u_tool {
div.u_tool {
float:left;
width: 100%;
padding-bottom: 25px;
}
div.u_tool div.name {
float:left;
@ -838,7 +839,7 @@ a#anchorbutton:hover, .button:hover,a.button:hover,div.content a.button:hover {
div.topmenu {
float:left;
width:100%;
margin-top:2px;
}
h2.dossier {

View file

@ -65,7 +65,10 @@ function h2($p_string, $p_class)
{
return '<h2 ' . $p_class . '>' . htmlspecialchars($p_string) . '</h2>';
}
function h1($p_string, $p_class)
{
return '<h1 ' . $p_class . '>' . htmlspecialchars($p_string) . '</h1>';
}
/* !\brief surround the string with td
* \param $p_string string to surround by TD
* \param $p_extra extra info (class, style, javascript...)
@ -762,7 +765,7 @@ function show_module($selected)
}
if ($file[0]['me_file'] != '')
{
if ($file[0]['me_parameter'] !== "")
if ($file[0]['me_parameter'] != "")
{
// if there are paramter put them in superglobal
$array=compute_variable($file[0]['me_parameter']);
@ -775,17 +778,12 @@ function show_module($selected)
require_once $file[0]['me_file'];
else
require 'extension_get.inc.php';
exit();
}
if ( $file[0]['me_javascript'] != '')
{
create_script($file[0]['me_javascript']);
}
}
else
{
}
}
/**
* Find the default module or the first one

View file

@ -2912,7 +2912,7 @@ class Acc_Ledger extends jrn_def_sql
$op->od_direct='t';
if ($op->count() != 0 )
{
echo HtmlInput::submit('use_opd','Utilisez une op.pr&eacute;d&eacute;finie');
echo HtmlInput::submit('use_opd','Utilisez une opération pr&eacute;d&eacute;finie');
echo $op->show_button();
}
echo '</form>';

View file

@ -364,9 +364,19 @@ class Database
$add=($from_setup==0)?'admin/':'';
for ( $i = 4;$i <= $MaxVersion;$i++)
{
$to=$i+1;
if ( $this->get_version() <= $i )
{
$to = $i + 1;
if ($this->get_version() <= $i)
{
if ($this->get_version() == 97)
{
if ($this->exist_schema("amortissement"))
{
$this->exec_sql('ALTER TABLE amortissement.amortissement_histo
ADD CONSTRAINT internal_fk FOREIGN KEY (jr_internal) REFERENCES jrn (jr_internal)
ON UPDATE CASCADE ON DELETE SET NULL');
}
}
echo "<li>Patching ".$p_name.
" from the version ".$this->get_version()." to $to ";
@ -452,7 +462,7 @@ class Database
$country=$this->get_value ("select pr_value from parameter where pr_id='MY_COUNTRY'");
$this->execute_script($add."sql/patch/upgrade61.".$country.".sql");
}
if ( ! DEBUG ) ob_end_clean();
}
}

View file

@ -113,7 +113,7 @@ class Extension extends Menu_Ref_sql
* insert into default profile
*/
$this->cn->exec_sql("insert into profile_menu(me_code,me_code_dep,p_type_display,p_id)
values ($1,$2,$3,$4)",array($this->me_code,'EXTENSION','S',1));
values ($1,$2,$3,$4)",array($this->me_code,'EXT','S',1));
$this->cn->commit();
}
catch (Exception $exc)

View file

@ -99,6 +99,7 @@ class Pre_op_ach extends Pre_operation_detail
$this->db->commit();
}
/*!\brief compute an array accordingly with the FormVenView function
* @return an array for filling the form
*/
function compute_array()
{
@ -106,6 +107,7 @@ class Pre_op_ach extends Pre_operation_detail
$a_op=$this->operation->load();
$array=$this->operation->compute_array($a_op);
$p_array=$this->load();
if ( empty ($p_array)) return array();
foreach ($p_array as $row)
{
if ( $row['opd_debit']=='f')
@ -126,7 +128,7 @@ class Pre_op_ach extends Pre_operation_detail
return $array;
}
/*!\brief load the data from the database and return an array
* \return an array
* \return an array
*/
function load()
{

View file

@ -101,6 +101,7 @@ class Pre_Op_Advanced extends Pre_operation_detail
$array=$this->operation->compute_array($a_op);
$array['desc']=$array['e_comm'];
$p_array=$this->load();
if (empty($p_array)) return array();
foreach ($p_array as $row)
{
$tmp_array=array("qc_".$count=>'',
@ -126,7 +127,7 @@ class Pre_Op_Advanced extends Pre_operation_detail
return $array;
}
/*!\brief load the data from the database and return an array
* \return an array
* \return an array
*/
function load()
{

View file

@ -105,6 +105,7 @@ class Pre_op_ven extends Pre_operation_detail
$a_op=$this->operation->load();
$array=$this->operation->compute_array($a_op);
$p_array=$this->load();
if (empty($p_array)) return array();
foreach ($p_array as $row)
{
if ( $row['opd_debit']=='t')
@ -124,7 +125,7 @@ class Pre_op_ven extends Pre_operation_detail
return $array;
}
/*!\brief load the data from the database and return an array
* \return an array
* \return an array
*/
function load()
{

View file

@ -196,11 +196,8 @@ class Pre_operation_detail
$hid=new IHidden();
$r=$hid->input("action","use_opd");
$r.=$hid->input("jrn_type",$this->get("ledger_type"));
if ($this->count() != 0 )
{
$r.= HtmlInput::submit('use_opd','Utilisez une op.pr&eacute;d&eacute;finie');
$r.= $this->show_button();
}
$r.= HtmlInput::submit('use_opd','Utilisez une op&eacute;ration pr&eacute;d&eacute;finie');
$r.= $this->show_button();
return $r;
}
@ -230,7 +227,7 @@ class Pre_operation_detail
$value=$this->db->make_array("select od_id,od_name from op_predef ".
" where jrn_def_id=".sql_string($this->jrn_def_id).
" and od_direct ='".sql_string($this->od_direct)."'".
" order by od_name");
" order by od_name",1);
return $value;
}
function set($p_param,$value)

View file

@ -155,7 +155,8 @@ for ($i=0;$i<Database::num_row($ret);$i++)
break;
}
echo '<tr>';
$class= ( $i%2 == 0)?$class=' class="odd"':$class=' class="even"';
echo "<tr $class>";
echo td($js);
echo td($row->me_menu);
echo td($row->me_description);

View file

@ -117,7 +117,7 @@ if ( isset ($_GET['viewsearch']) )
} else
{
if ($step<$max_line ) echo '<span class="notice">Nombre d\'enregistrements trouvés =' .$max_line.' limite = '.$step.'</span>';
if ($step<$max_line ) echo '<h2 class="notice">Liste limitée à '.$step.' enregistrements. Le nombre d\'enregistrements trouvés est de ' .$max_line.'</h2>';
}
echo '<form method="get" onsubmit="set_reconcile(this);return false">';
echo HtmlInput::submit("upd_rec","Mettre à jour");

View file

@ -119,8 +119,8 @@ echo $card->input();
<?
if ( $new || ($type != 'ODS' && $type != 'FIN')) {
?>
<th><?=_('Fiches Débit')?></TH>
<th><?=_('Fiches Crédit')?></TH>
<th style="text-align:left"><?=_('Fiches Débit')?></TH>
<th style="text-align:left"><?=_('Fiches Crédit')?></TH>
<?
}
?>
@ -139,7 +139,7 @@ for ($i=0;$i<$num;$i++) {
break;
}
}
echo '<TR>';
echo '<tr>';
printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]" %s>%s</TD>',
$res['fd_id'],$CHECKED,$res['fd_label']);
$CHECKED=" unchecked";