From 608c564fbe9714f79ef768084adfed48cf434fcc Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 15 Oct 2018 21:49:54 +0200 Subject: [PATCH 01/49] Improve debug info --- html/do.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/html/do.php b/html/do.php index 73669e6db..0278416f6 100644 --- a/html/do.php +++ b/html/do.php @@ -1,5 +1,4 @@ \ No newline at end of file + + From 14ea453731c65f90cffdd7ba429217bd3374c7c0 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 23 Nov 2018 23:10:50 +0100 Subject: [PATCH 21/49] http_input : fix bug with array --- include/lib/http_input.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/lib/http_input.class.php b/include/lib/http_input.class.php index 35922702a..5a5be5f6e 100644 --- a/include/lib/http_input.class.php +++ b/include/lib/http_input.class.php @@ -80,7 +80,9 @@ class HttpInput throw new Exception(_("Type invalide")."[ $p_name ] = {$this->array[$p_name]}" , EXC_PARAM_TYPE); } - $this->array[$p_name]=h($this->array[$p_name]); + if (is_string($this->array )) { + $this->array[$p_name]=h($this->array[$p_name]); + } }else { throw new Exception(_("Unknown type")); } From 3a534aa1cb69d1242f89aa58e215b821a4059ae4 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 23 Nov 2018 23:11:04 +0100 Subject: [PATCH 22/49] Document : replace properly value in the OOo file --- include/class/document.class.php | 87 +++++++++++++++++++------------- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/include/class/document.class.php b/include/class/document.class.php index 03258cf34..3f0327fa3 100644 --- a/include/class/document.class.php +++ b/include/class/document.class.php @@ -237,7 +237,6 @@ class Document $lt="<"; $gt=">"; } - //read the file while(! feof($h)) { @@ -270,33 +269,8 @@ class Document * Change type of cell to numeric * allow numeric cel in ODT for the formatting and formula */ - if ( is_numeric($value) && $p_type=='OOo') - { - // For libreOffice <=4 - $searched='/office:value-type="string">'.$pattern.'/i'; - $replaced='office:value-type="float" office:value="'.$value.'">'.$pattern; - $buffer=preg_replace($searched, $replaced, $buffer,1); - // For libreOffice >=4 - $searched='/office:value-type="string" calcext:value-type="string">'.$pattern.'/i'; - $replaced='office:value-type="float" office:value="'.$value.'" calcext:value-type="float">'.$pattern; - $buffer=preg_replace($searched, $replaced, $buffer,1); - } - // replace into the $buffer - // take the position in the buffer - $pos=strpos($buffer,$to_remove); - // get the length of the string to remove - $len=strlen($to_remove); - if ( $p_type=='OOo' ) - { - $value=str_replace('&','&',$value); - $value=str_replace('<','<',$value); - $value=str_replace('>','>',$value); - $value=str_replace('"','"',$value); - $value=str_replace("'",''',$value); - } - $buffer=substr_replace($buffer,$value,$pos,$len); - - // if the pattern if found we replace it + + $buffer=\Document::replace_value($buffer,$pattern, $value, 1,$p_type); } } } @@ -1111,9 +1085,9 @@ class Document } $sell=${'e_march'.$i.'_price'}; $qt=${'e_quant'.$i}; - $tot=bcmul($sell,$qt); - $tot=bcadd($tot,$tva_amount); - $sum=bcadd($sum,$tot); + $tot=bcmul($sell,$qt); + $tot=bcadd($tot,$tva_amount); + $sum=bcadd($sum,$tot); } $r=round($sum,2); @@ -1125,10 +1099,10 @@ class Document { $tva='e_march'.$i.'_tva_amount'; if (! isset(${$tva})) $tva_amount=0.0; - else $tva_amount=$ - { - $tva - }; + else { + $tva_amount=${$tva}; + $tva_amount=($tva_amount=="")?0:$tva_amount; + } $sum+=$tva_amount; $sum=round($sum,2); } @@ -1303,5 +1277,48 @@ class Document $this->db->exec_sql('update document set d_description = $1 where d_id=$2', array($p_desc,$this->d_id)); } + /** + * Replace a pattern with a value in the buffer , handle the change for OOo type file and amount + * + * @param string $p_buffer + * @param string $_pattern + * @param mixed $p_value + */ + static function replace_value($p_buffer, $p_pattern, $p_value,$p_limit=-1,$p_type='OOo') + { + $check=$p_pattern; + $check=str_replace(['<','>','<','>','='], "", $check); + if ( preg_replace('/[^[:alnum:]^_]/', '', $check) != $check) + { + throw new Exception(sprintf(_("chaine à remplacer [%s] contient un caractère interdit"), $p_pattern)); + } + $count=0; + if (is_numeric($p_value) && $p_type == 'OOo') + { + /* -- works only with OOo Calc -- */ + $searched='/office:value-type="string">'.$p_pattern.'/i'; + $replaced='office:value-type="float" office:value="'.$p_value.'">'.$p_value; + $p_buffer=preg_replace($searched, $replaced, $p_buffer,$p_limit,$count); + if ( $count == 0) { + /* -- work with libreOffice > 5 -- */ + $searched='/office:value-type="string" calcext:value-type="string">'.$p_pattern.'/i'; + $replaced='office:value-type="float" office:value="'.$p_value.'" calcext:value-type="float">'.$p_value; + $p_buffer=preg_replace($searched, $replaced, $p_buffer,$p_limit,$count); + } + } + if ($count == 0) + { + if ( $p_type=='OOo' ) + { + $p_value=str_replace('&','&',$p_value); + $p_value=str_replace('<','<',$p_value); + $p_value=str_replace('>','>',$p_value); + $p_value=str_replace('"','"',$p_value); + $p_value=str_replace("'",''',$p_value); + } + $p_buffer=preg_replace('/'.$p_pattern.'/i', $p_value, $p_buffer,$p_limit); + } + return $p_buffer; + } } From a1789c6b74213b49029e516c23f4c78f8950c098 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 24 Nov 2018 09:49:32 +0100 Subject: [PATCH 23/49] css : force a.inline to be inline ! --- html/style-classic7.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/style-classic7.css b/html/style-classic7.css index 60c7e2aed..718a7dd59 100644 --- a/html/style-classic7.css +++ b/html/style-classic7.css @@ -1072,16 +1072,16 @@ ul { a.line,div.content a.line { text-decoration:underline; - display:inline; + display:inline !important; /* color: #0000FF; */ cursor:pointer; } a.line:hover,div_content a.line { text-decoration:underline; - display:inline; - color: #FFFFFF; - background-color:#336699; + display:inline !important; + color: #FFFFFF !important; + background-color:#336699 !important; cursor:pointer; } From 085a67098c98148007f8e5e05d0a2273a963da3a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 24 Nov 2018 12:28:08 +0100 Subject: [PATCH 24/49] CSS : print number align to right --- html/style-print.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html/style-print.css b/html/style-print.css index baca9b6e5..7cc014c31 100644 --- a/html/style-print.css +++ b/html/style-print.css @@ -319,4 +319,7 @@ span.inplace_edit span.inplace_edit_input { text-decoration: none; +} +.inum { + text-align: right; } \ No newline at end of file From e335451028fd0b3c69a9bb6eac8874080ac464c6 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 24 Nov 2018 13:32:17 +0100 Subject: [PATCH 25/49] Document::replace_value handle space before numeric --- include/class/document.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/document.class.php b/include/class/document.class.php index 3f0327fa3..a703f7b7e 100644 --- a/include/class/document.class.php +++ b/include/class/document.class.php @@ -1301,7 +1301,7 @@ class Document $p_buffer=preg_replace($searched, $replaced, $p_buffer,$p_limit,$count); if ( $count == 0) { /* -- work with libreOffice > 5 -- */ - $searched='/office:value-type="string" calcext:value-type="string">'.$p_pattern.'/i'; + $searched='/office:value-type="string" calcext:value-type="string">()*'.$p_pattern.'/i'; $replaced='office:value-type="float" office:value="'.$p_value.'" calcext:value-type="float">'.$p_value; $p_buffer=preg_replace($searched, $replaced, $p_buffer,$p_limit,$count); } From 59eb0ce03a0474c81e2e18852c969f12f5c06318 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 25 Nov 2018 01:43:37 +0100 Subject: [PATCH 26/49] cosmetic --- html/style-classic7.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/style-classic7.css b/html/style-classic7.css index 718a7dd59..e8a3bb7ed 100644 --- a/html/style-classic7.css +++ b/html/style-classic7.css @@ -315,7 +315,7 @@ td.selectedcell{ /*color:#FFFFFF;*/ width:250px; text-align:center; - background-color: lightskyblue; + background-color: #002ba3; border-style: solid; border-width: 1px; border-color:white; From 2d0da8b05b1a98823eab06ddc6fd23ca74d3d5ac Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 26 Nov 2018 15:18:15 +0100 Subject: [PATCH 27/49] Exception rethrow --- html/do.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html/do.php b/html/do.php index 0278416f6..71f687dca 100644 --- a/html/do.php +++ b/html/do.php @@ -311,10 +311,12 @@ if (isset($_REQUEST['ac'])) echo ''; echo _('Retour'); echo ''; + return; } else { alert($e->getMessage()); record_log($e->getTraceAsString()); + throw $e; } } } @@ -345,6 +347,7 @@ else { echo $exc->getMessage(); record_log($exc->getTraceAsString()); + throw $e; } } From 48cad5f8854533c6044230238161d8a34b48b30c Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 27 Nov 2018 07:46:34 +0100 Subject: [PATCH 28/49] translate --- include/class/acc_ledger_fin.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php index c9ef7d967..0a2364bca 100644 --- a/include/class/acc_ledger_fin.class.php +++ b/include/class/acc_ledger_fin.class.php @@ -524,7 +524,7 @@ class Acc_Ledger_Fin extends Acc_Ledger $r.=''; - $r.='

Extrait de compte

'; + $r.='

'._("Extrait de compte").'

'; //-------------------------------------------------- // Saldo begin end //------------------------------------------------- @@ -532,10 +532,10 @@ class Acc_Ledger_Fin extends Acc_Ledger $r.=''; // Extrait //-- - $r.=tr(' Numéro d\'extrait' . td(h($e_pj))); - $r.='Solde début extrait '; + $r.=tr(''._("Numéro d'extrait").' ' . td(h($e_pj))); + $r.=''._("Solde début extrait").' '; $r.='' . nbm($first_sold) . ''; - $r.='Solde fin extrait '; + $r.=''._("Solde fin extrait").' '; $r.='' . nbm($last_sold) . ''; $r.=''; @@ -545,11 +545,11 @@ class Acc_Ledger_Fin extends Acc_Ledger //------------------------------------------------- $r.=''; $r.=""; - if ($chdate==2) $r.=''; - $r.=""; - $r.=""; - $r.=""; - $r.=''; + if ($chdate==2) $r.=''; + $r.=""; + $r.=""; + $r.=""; + $r.=''; /* if we use the AC */ if ($g_parameter->MY_ANALYTIC != 'nu') @@ -631,14 +631,14 @@ class Acc_Ledger_Fin extends Acc_Ledger $r.="
DateNomCommentaireMontant Op. Concernée(s)'._("Date").'"._("Nom").""._("Commentaire").""._("Montant")."'._("Op. Concernée(s)").'
"; // saldo - $r.='
Ancien solde = ' . $solde; + $r.='
'.sprintf(_("Ancien solde = %d"), $solde); $new_solde+=$tot_amount; - $r.='
Nouveau solde = ' . $new_solde; - $r.='
Difference =' . $tot_amount; + $r.='
'.sprintf(_("Nouveau solde = %d"),$new_solde); + $r.='
'.sprintf(_("Difference = %d"), $tot_amount); // check for upload piece $file = new IFile(); - $r.="
Ajoutez une pièce justificative "; + $r.="
"._("Ajoutez une pièce justificative")." "; $r.=$file->input("pj", ""); $r.='
'; From d166d35e85e3b50620966c4b711895ae4045da4d Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 27 Nov 2018 17:38:58 +0100 Subject: [PATCH 29/49] Analytic accountancy : fix bug --- include/lib/iselect.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/lib/iselect.class.php b/include/lib/iselect.class.php index 72996cc0b..1d4837b2d 100644 --- a/include/lib/iselect.class.php +++ b/include/lib/iselect.class.php @@ -29,10 +29,21 @@ require_once NOALYSS_INCLUDE.'/lib/html_input.class.php'; class ISelect extends HtmlInput { + /** + * Constructor , $p_value is supposed to be an array + * @param string $p_name name of the element + * @param array $p_value + * @param DOMID $p_id + */ function __construct($p_name="", $p_value="", $p_id="") { parent::__construct($p_name, $p_value, $p_id); - $this->value=[]; + if ( $p_value =="" ) + { + $this->value=[]; + } else { + $this->value=$p_value; + } } /*!\brief show the html input of the widget*/ public function input($p_name=null,$p_value=null) From f0220f58163f5fdb9eebaca7e245dcc38ac6d359 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 28 Nov 2018 12:27:16 +0100 Subject: [PATCH 30/49] Currency : SQL quant_fin is adapted --- include/sql/patch/upgrade130.sql | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 include/sql/patch/upgrade130.sql diff --git a/include/sql/patch/upgrade130.sql b/include/sql/patch/upgrade130.sql new file mode 100644 index 000000000..cfecdda82 --- /dev/null +++ b/include/sql/patch/upgrade130.sql @@ -0,0 +1,46 @@ +begin; + +CREATE OR REPLACE FUNCTION isnumeric(text) RETURNS BOOLEAN AS $$ +DECLARE x NUMERIC; +BEGIN + x = $1::NUMERIC; + RETURN TRUE; +EXCEPTION WHEN others THEN + RETURN FALSE; +END; +$$ +STRICT +LANGUAGE plpgsql IMMUTABLE; + +CREATE OR REPLACE FUNCTION isdate(text,text) RETURNS BOOLEAN AS $$ +DECLARE x timestamp; +BEGIN + x := to_date($1,$2); + RETURN TRUE; +EXCEPTION WHEN others THEN + RETURN FALSE; +END; +$$ +LANGUAGE plpgsql; + +ALTER TABLE public.jrn_def ADD currency_id int NULL; +ALTER TABLE public.jrn_def ALTER COLUMN currency_id SET DEFAULT 0; +update public.jrn_def set currency_id = 0 ; +ALTER TABLE public.jrn_def ALTER COLUMN currency_id SET NOT NULL; +ALTER TABLE public.jrn_def ADD CONSTRAINT jrn_def_currency_fk FOREIGN KEY (currency_id) REFERENCES public.currency(id); + +COMMENT ON COLUMN public.jrn_def.currency_id IS 'Default currency for financial ledger'; + + +alter table quant_fin add j_id bigint; + +with j_fin as ( +select jrnx.j_id,quant_fin.qf_id from quant_fin join jrn using (jr_id) join jrnx on (j_grpt=jr_grpt_id and f_id=qf_other) +) +update quant_fin set j_id =j_fin.j_id from j_fin where j_fin.qf_id=quant_fin.qf_id; + +alter table quant_fin add constraint jrnx_j_id_fk foreign key (j_id ) references jrnx(j_id) on delete cascade on update cascade; + + +insert into version (val,v_description) values (131,'Currency : adapt quant_fin'); +commit; From 58d6b510812cf7a8f7bb7ff028ddc2f0145c120d Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 28 Nov 2018 12:40:34 +0100 Subject: [PATCH 31/49] Version DB 131 --- include/constant.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constant.php b/include/constant.php index d2657a22f..34489ca5d 100644 --- a/include/constant.php +++ b/include/constant.php @@ -108,7 +108,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) { if ( ! defined ("SYSINFO_DISPLAY")) { define ("SYSINFO_DISPLAY",TRUE); } -define ("DBVERSION",130); +define ("DBVERSION",131); define ("MONO_DATABASE",25); define ("DBVERSIONREPO",18); define ('NOTFOUND','--not found--'); From 4848d75130e714fe4c46e6826d980c4fee0c5679 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 28 Nov 2018 21:18:39 +0100 Subject: [PATCH 32/49] Quant_Fin : set the j_id when an operation is recorded --- include/class/acc_ledger_fin.class.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php index 0a2364bca..86f84e389 100644 --- a/include/class/acc_ledger_fin.class.php +++ b/include/class/acc_ledger_fin.class.php @@ -814,7 +814,7 @@ class Acc_Ledger_Fin extends Acc_Ledger } $acc_operation->periode = $tperiode; $acc_operation->qcode = ${"e_other" . $i}; - $j_id = $acc_operation->insert_jrnx(); + $j_id_other = $acc_operation->insert_jrnx(); $acc_operation = new Acc_Operation($this->db); $acc_operation->date = $e_date; @@ -931,7 +931,7 @@ class Acc_Ledger_Fin extends Acc_Ledger /** * save also into quant_fin */ - $this->insert_quant_fin($fBank->id, $jr_id, $fPoste->id, ${"e_other$i" . "_amount"}); + $this->insert_quant_fin($fBank->id, $jr_id, $fPoste->id, ${"e_other$i" . "_amount"},$j_id_other); if ($g_parameter->MY_ANALYTIC != "nu") { @@ -1147,17 +1147,18 @@ class Acc_Ledger_Fin extends Acc_Ledger /** * insert into the quant_fin table - * @param $bank_id is the f_id of the bank - * @param $jr_id is the jrn.jr_id of the operation - * @param $other is the f_id of the benefit - * @param $amount is the amount + * @param integer $bank_id is the f_id of the bank + * @param integer $jr_id is the jrn.jr_id of the operation + * @param integer $other is the f_id of the benefit + * @param integer $amount is the amount + * @param integer $p_j_id is the j_id of the operation */ - function insert_quant_fin($p_bankid, $p_jrid, $p_otherid, $p_amount) + function insert_quant_fin($p_bankid, $p_jrid, $p_otherid, $p_amount,$p_j_id) { - $sql = "INSERT INTO quant_fin(qf_bank, jr_id, qf_other, qf_amount) - VALUES ($1, $2, $3, $4);"; + $sql = "INSERT INTO quant_fin(qf_bank, jr_id, qf_other, qf_amount,j_id) + VALUES ($1, $2, $3, $4,$5);"; - $this->db->exec_sql($sql, array($p_bankid, $p_jrid, $p_otherid, round($p_amount, 2))); + $this->db->exec_sql($sql, array($p_bankid, $p_jrid, $p_otherid, round($p_amount, 2),$p_j_id)); } } From 2d23ca4a9bb998a10c9cd8659294e8fe1826ace8 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 28 Nov 2018 21:28:25 +0100 Subject: [PATCH 33/49] reverse for quant_fin --- include/class/acc_ledger.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 91dc186fb..faf46e419 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -324,10 +324,10 @@ class Acc_Ledger extends jrn_def_sql throw (new Exception(__FILE__.__LINE__."SQL ERROR [ $sql ]")); // reverse in QUANT_FIN table $Res=$this->db->exec_sql(" INSERT INTO quant_fin( - qf_bank, qf_other, qf_amount,jr_id) - SELECT qf_bank, qf_other, qf_amount*(-1),$1 + qf_bank, qf_other, qf_amount,jr_id,j_id) + SELECT qf_bank, qf_other, qf_amount*(-1),$1,$3 FROM quant_fin where jr_id=$2", - array($seq, $this->jr_id)); + array($seq, $this->jr_id,$j_id)); if ($Res==false) throw (new Exception(__FILE__.__LINE__."SQL ERROR[ $sql ]")); From 2334329097a0766efe708613508c14a2d2efc4e4 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 29 Nov 2018 09:32:21 +0100 Subject: [PATCH 34/49] Background color --- html/style-classic7.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/style-classic7.css b/html/style-classic7.css index e8a3bb7ed..9c0f93ae6 100644 --- a/html/style-classic7.css +++ b/html/style-classic7.css @@ -34,7 +34,7 @@ BODY { color:darkblue; /*font-size:0.9em; font-size:0.95rem;*/ - /*! background-color: #FBF9F4; */ + background-color:#F2F2F2; } input{ font-family: 'OpenSansRegular'; From 47cab2980d9af34f6c9ef08eeb3091112f0b310f Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 3 Dec 2018 21:46:01 +0100 Subject: [PATCH 35/49] acc_ledger_fin . translation --- include/class/acc_ledger_fin.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php index 86f84e389..dda87941d 100644 --- a/include/class/acc_ledger_fin.class.php +++ b/include/class/acc_ledger_fin.class.php @@ -739,7 +739,8 @@ class Acc_Ledger_Fin extends Acc_Ledger $amount = 0.0; $idx_operation = 0; $ret = ''; - $ret.=tr(th('Date').th('n° interne') . th('Quick Code') . th('Nom') . th('Libellé') . th('Montant', ' style="text-align:right"')); + $ret.=tr(th(_('Date')).th(_('n° interne')) . th(_('Quick Code')) + . th(_('Nom')) . th(_('Libellé')) . th(_('Montant'), ' style="text-align:right"')); // Credit = goods $get_solde=true; for ($i = 0; $i < $nb_item; $i++) From bd7ba3d10c369fd2dbaba44d1d2b9ce009714117 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 5 Dec 2018 08:50:07 +0100 Subject: [PATCH 36/49] Indentation --- include/class/acc_ledger_fin.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php index dda87941d..4c2ab45c8 100644 --- a/include/class/acc_ledger_fin.class.php +++ b/include/class/acc_ledger_fin.class.php @@ -951,7 +951,12 @@ class Acc_Ledger_Fin extends Acc_Ledger $js_detail = HtmlInput::detail_op($jr_id, $internal); // Compute display - $row = td($e_date).td($js_detail) . td(${"e_other$i"}) . td($fPoste->strAttribut(ATTR_DEF_NAME)) . td(${"e_other" . $i . "_comment"}) . td(nbm(${"e_other$i" . "_amount"}), 'class="num"'); + $row = td($e_date) + . td($js_detail) + . td(${"e_other$i"}) + . td($fPoste->strAttribut(ATTR_DEF_NAME)) + . td(${"e_other" . $i . "_comment"}) + . td(nbm(${"e_other$i" . "_amount"}), 'class="num"'); $class=($i%2==0)?' class="even" ':' class="odd" '; $ret.=tr($row,$class); From c61b6e9e452a2f615c9c16a6b0093018b765fa44 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 5 Dec 2018 17:45:11 +0100 Subject: [PATCH 37/49] change background --- html/style-classic7.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/style-classic7.css b/html/style-classic7.css index 9c0f93ae6..8279f0682 100644 --- a/html/style-classic7.css +++ b/html/style-classic7.css @@ -34,7 +34,7 @@ BODY { color:darkblue; /*font-size:0.9em; font-size:0.95rem;*/ - background-color:#F2F2F2; + background-color:#FCFDFD; } input{ font-family: 'OpenSansRegular'; From 8e7dc4f38a723a211de2b3a881a60a8c9e920554 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 6 Dec 2018 11:50:15 +0100 Subject: [PATCH 38/49] Database upgrade 131 --- include/constant.php | 2 +- include/sql/patch/upgrade131.sql | 180 +++++++++++++++++++++++++++++++ sql/upgrade.sql | 55 ---------- 3 files changed, 181 insertions(+), 56 deletions(-) create mode 100644 include/sql/patch/upgrade131.sql diff --git a/include/constant.php b/include/constant.php index 34489ca5d..2eb6dafff 100644 --- a/include/constant.php +++ b/include/constant.php @@ -108,7 +108,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) { if ( ! defined ("SYSINFO_DISPLAY")) { define ("SYSINFO_DISPLAY",TRUE); } -define ("DBVERSION",131); +define ("DBVERSION",132); define ("MONO_DATABASE",25); define ("DBVERSIONREPO",18); define ('NOTFOUND','--not found--'); diff --git a/include/sql/patch/upgrade131.sql b/include/sql/patch/upgrade131.sql new file mode 100644 index 000000000..17dd1c86f --- /dev/null +++ b/include/sql/patch/upgrade131.sql @@ -0,0 +1,180 @@ +begin; + +drop VIEW public.v_detail_sale; + +CREATE OR REPLACE VIEW public.v_detail_sale as +WITH m AS ( + SELECT sum(quant_sold_1.qs_price) AS htva, + sum(quant_sold_1.qs_vat) AS tot_vat, + sum(quant_sold_1.qs_vat_sided) AS tot_tva_np, + jrn_1.jr_id + FROM quant_sold quant_sold_1 + JOIN jrnx jrnx_1 USING (j_id) + JOIN jrn jrn_1 ON jrnx_1.j_grpt = jrn_1.jr_grpt_id + GROUP BY jrn_1.jr_id + ) + SELECT jrn.jr_id, + jrn.jr_date, + jrn.jr_date_paid, + jrn.jr_ech, + jrn.jr_tech_per, + jrn.jr_comment, + jrn.jr_pj_number, + jrn.jr_internal, + jrn.jr_def_id, + jrnx.j_poste, + jrnx.j_text, + jrnx.j_qcode, + quant_sold.qs_fiche AS item_card, + a.name AS item_name, + quant_sold.qs_client, + b.vw_name AS tiers_name, + b.quick_code, + tva_rate.tva_label, + tva_rate.tva_comment, + tva_rate.tva_both_side, + quant_sold.qs_vat_sided AS vat_sided, + quant_sold.qs_vat_code AS vat_code, + quant_sold.qs_vat AS vat, + quant_sold.qs_price AS price, + quant_sold.qs_quantite AS quantity, + quant_sold.qs_price / quant_sold.qs_quantite AS price_per_unit, + m.htva, + m.tot_vat, + m.tot_tva_np, + oc.oc_amount, + oc.oc_vat_amount, + (select cr_code_iso from currency where jrn.currency_id=currency.id) as cr_code_iso + FROM jrn + JOIN jrnx ON jrn.jr_grpt_id = jrnx.j_grpt + JOIN quant_sold USING (j_id) + JOIN vw_fiche_name a ON quant_sold.qs_fiche = a.f_id + JOIN vw_fiche_attr b ON quant_sold.qs_client = b.f_id + JOIN tva_rate ON quant_sold.qs_vat_code = tva_rate.tva_id + JOIN m ON m.jr_id = jrn.jr_id + left join operation_currency as oc on (oc.j_id=jrnx.j_id) +; + +drop VIEW public.v_detail_purchase; + +CREATE OR REPLACE VIEW public.v_detail_purchase +AS WITH m AS ( + SELECT sum(quant_purchase_1.qp_price) AS htva, + sum(quant_purchase_1.qp_vat) AS tot_vat, + sum(quant_purchase_1.qp_vat_sided) AS tot_tva_np, + jrn_1.jr_id + FROM quant_purchase quant_purchase_1 + JOIN jrnx jrnx_1 USING (j_id) + JOIN jrn jrn_1 ON jrnx_1.j_grpt = jrn_1.jr_grpt_id + GROUP BY jrn_1.jr_id + ) + SELECT jrn.jr_id, + jrn.jr_date, + jrn.jr_date_paid, + jrn.jr_ech, + jrn.jr_tech_per, + jrn.jr_comment, + jrn.jr_pj_number, + jrn.jr_internal, + jrn.jr_def_id, + jrnx.j_poste, + jrnx.j_text, + jrnx.j_qcode, + quant_purchase.qp_fiche AS item_card, + a.name AS item_name, + quant_purchase.qp_supplier, + b.vw_name AS tiers_name, + b.quick_code, + tva_rate.tva_label, + tva_rate.tva_comment, + tva_rate.tva_both_side, + quant_purchase.qp_vat_sided AS vat_sided, + quant_purchase.qp_vat_code AS vat_code, + quant_purchase.qp_vat AS vat, + quant_purchase.qp_price AS price, + quant_purchase.qp_quantite AS quantity, + quant_purchase.qp_price / quant_purchase.qp_quantite AS price_per_unit, + quant_purchase.qp_nd_amount AS non_ded_amount, + quant_purchase.qp_nd_tva AS non_ded_tva, + quant_purchase.qp_nd_tva_recup AS non_ded_tva_recup, + m.htva, + m.tot_vat, + m.tot_tva_np, + oc.oc_amount, + oc.oc_vat_amount, + (select cr_code_iso from currency where jrn.currency_id=currency.id) as cr_code_iso + FROM jrn + JOIN jrnx ON jrn.jr_grpt_id = jrnx.j_grpt + JOIN quant_purchase USING (j_id) + JOIN vw_fiche_name a ON quant_purchase.qp_fiche = a.f_id + JOIN vw_fiche_attr b ON quant_purchase.qp_supplier = b.f_id + JOIN tva_rate ON quant_purchase.qp_vat_code = tva_rate.tva_id + JOIN m ON m.jr_id = jrn.jr_id + left join operation_currency as oc on (oc.j_id=jrnx.j_id) +; + + create or replace view v_all_account_currency as +select sum(oc_amount) as sum_oc_amount,sum(oc_vat_amount) as sum_oc_vat_amount,x.j_poste,x.j_id +from +quant_fin as q1 +join (select j_id ,jr_id,f_id,j_poste + from jrnx as j1 join + jrn as j on (j1.j_grpt=jr_grpt_id) +) as x on (q1.jr_id=x.jr_id) +join operation_currency as oc on (oc.j_id=q1.j_id) +group by x.j_poste,x.j_id +union all +select sum(oc_amount),sum(oc_vat_amount),x.j_poste,x.j_id +from +quant_purchase as q1 +join (select j_id ,jr_id,f_id,j_poste,jr_internal + from jrnx as j1 join + jrn as j on (j1.j_grpt=jr_grpt_id) +) as x on (q1.qp_internal=x.jr_internal and (x.f_id=q1.qp_fiche or x.f_id=qp_supplier) ) +join operation_currency as oc on (oc.j_id=q1.j_id) +group by x.j_poste,x.j_id +union all +select sum(oc_amount),sum(oc_vat_amount),x.j_poste,x.j_id +from +quant_sold as q1 +join (select j_id ,jr_id,f_id,j_poste,jr_internal + from jrnx as j1 join + jrn as j on (j1.j_grpt=jr_grpt_id) +) as x on (q1.qs_internal=x.jr_internal and (x.f_id=q1.qs_fiche or x.f_id=q1.qs_client) ) +join operation_currency as oc on (oc.j_id=q1.j_id) +group by x.j_poste,x.j_id +; + +create or replace view v_all_card_currency as +select sum(oc_amount) as sum_oc_amount,sum(oc_vat_amount) as sum_oc_vat_amount,x.f_id,x.j_id +from +quant_fin as q1 +join (select j_id ,jr_id,f_id,j_poste + from jrnx as j1 join + jrn as j on (j1.j_grpt=jr_grpt_id) +) as x on (q1.jr_id=x.jr_id) +join operation_currency as oc on (oc.j_id=q1.j_id) +group by x.f_id,x.j_id +union all +select sum(oc_amount),sum(oc_vat_amount),x.f_id,x.j_id +from +quant_purchase as q1 +join (select j_id ,jr_id,f_id,j_poste,jr_internal + from jrnx as j1 join + jrn as j on (j1.j_grpt=jr_grpt_id) +) as x on (q1.qp_internal=x.jr_internal and (x.f_id=q1.qp_fiche or x.f_id=qp_supplier) ) +join operation_currency as oc on (oc.j_id=q1.j_id) +group by x.f_id,x.j_id +union all +select sum(oc_amount),sum(oc_vat_amount),x.f_id,x.j_id +from +quant_sold as q1 +join (select j_id ,jr_id,f_id,j_poste,jr_internal + from jrnx as j1 join + jrn as j on (j1.j_grpt=jr_grpt_id) +) as x on (q1.qs_internal=x.jr_internal and (x.f_id=q1.qs_fiche or x.f_id=q1.qs_client) ) +join operation_currency as oc on (oc.j_id=q1.j_id) +group by x.f_id,x.j_id +; +insert into version (val,v_description) values (132,'Currency : Create view for managing currency '); +commit; diff --git a/sql/upgrade.sql b/sql/upgrade.sql index f3340f58e..e69de29bb 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -1,55 +0,0 @@ -CREATE OR REPLACE FUNCTION comptaproc.insert_quant_purchase(p_internal text, p_j_id numeric, p_fiche character varying, p_quant numeric, p_price numeric, p_vat numeric, p_vat_code integer, p_nd_amount numeric, p_nd_tva numeric, p_nd_tva_recup numeric, p_dep_priv numeric, p_client character varying, p_tva_sided numeric, p_price_unit numeric) - RETURNS void - LANGUAGE plpgsql -AS $function$ -declare - fid_client integer; - fid_good integer; - account_priv account_type; - fid_good_account account_type; - n_dep_priv numeric; -begin - n_dep_priv := p_dep_priv; - select p_value into account_priv from parm_code where p_code='DEP_PRIV'; - select f_id into fid_client from - fiche_detail where ad_id=23 and ad_value=upper(trim(p_client)); - select f_id into fid_good from - fiche_detail where ad_id=23 and ad_value=upper(trim(p_fiche)); - select ad_value into fid_good_account from fiche_detail where ad_id=5 and f_id=fid_good; - if strpos( fid_good_account , account_priv ) = 1 then - n_dep_priv=p_price; - end if; - - insert into quant_purchase - (qp_internal, - j_id, - qp_fiche, - qp_quantite, - qp_price, - qp_vat, - qp_vat_code, - qp_nd_amount, - qp_nd_tva, - qp_nd_tva_recup, - qp_supplier, - qp_dep_priv, - qp_vat_sided, - qp_unit) - values - (p_internal, - p_j_id, - fid_good, - p_quant, - p_price, - p_vat, - p_vat_code, - p_nd_amount, - p_nd_tva, - p_nd_tva_recup, - fid_client, - n_dep_priv, - p_tva_sided, - p_price_unit); - return; -end; - $function$ \ No newline at end of file From 7faeb862c1b3a1639672dde835769775105d0252 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 17 Dec 2018 18:04:44 +0100 Subject: [PATCH 39/49] predefined operation , invalid value for database::setp --- include/class/pre_op_advanced.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/pre_op_advanced.class.php b/include/class/pre_op_advanced.class.php index e743e0dad..d3690861f 100644 --- a/include/class/pre_op_advanced.class.php +++ b/include/class/pre_op_advanced.class.php @@ -248,7 +248,7 @@ class Pre_Op_Advanced extends Pre_operation_detail if ($poste->value != '') { $Poste = new Acc_Account($legder->db); - $Poste->set_parameter('value', $poste->value); + $Poste->set_parameter('pcm_val', $poste->value); $label = $Poste->get_lib(); } From 5e46bc36c8ccb24470136ce6104a00161c1fa1b9 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 17 Dec 2018 18:08:15 +0100 Subject: [PATCH 40/49] predefined operation , find a label for an accounting thx its value, the pk is now an numeric id --- include/class/pre_op_advanced.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/pre_op_advanced.class.php b/include/class/pre_op_advanced.class.php index d3690861f..ec78536a7 100644 --- a/include/class/pre_op_advanced.class.php +++ b/include/class/pre_op_advanced.class.php @@ -248,7 +248,7 @@ class Pre_Op_Advanced extends Pre_operation_detail if ($poste->value != '') { $Poste = new Acc_Account($legder->db); - $Poste->set_parameter('pcm_val', $poste->value); + $Poste->find_by_value($poste->value); $label = $Poste->get_lib(); } From 81df6ed4a8c1a7bfef4e9fd399f806eba0b93edc Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 17 Dec 2018 23:26:03 +0100 Subject: [PATCH 41/49] Pre_Operation : add attribut --- include/class/pre_operation.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/class/pre_operation.class.php b/include/class/pre_operation.class.php index dbf87302e..bd6c5afba 100644 --- a/include/class/pre_operation.class.php +++ b/include/class/pre_operation.class.php @@ -39,6 +39,7 @@ class Pre_operation var $p_jrn; /*!< $p_jrn jrn_def_id */ var $jrn_type; /*!< $jrn_type */ var $name; /*!< $name name of the predef. operation */ + var $detail; /*!< Pre_operation_detail */ function __construct($cn,$p_id=0) { From 3efb8904feb19c3345610af4c1d0299d792cb188 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 17 Dec 2018 23:30:55 +0100 Subject: [PATCH 42/49] cfgcurrency : file for the new version : if the file to include does not exist then display a warning and exit --- include/lib/ac_common.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php index 9ace668a1..40cb46b39 100644 --- a/include/lib/ac_common.php +++ b/include/lib/ac_common.php @@ -1103,10 +1103,16 @@ function show_menu($module) } // if file is not a plugin, include the file, otherwise // include the plugin launcher - if ( $file[0]['me_type'] != 'PL') + if ( $file[0]['me_type'] != 'PL') { + if (file_exists($file[0]['me_file'])) + { require_once $file[0]['me_file']; - else + } else { + echo echo_warning(_("Fichier non trouvé")); + } + } else { require 'extension_get.inc.php'; + } exit(); } From 112f648c2fff049b51c57545a9a0e3160cb9e224 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 17 Dec 2018 23:53:31 +0100 Subject: [PATCH 43/49] cfgcurrency : file for the new version : if the file to include does not exist then display a warning and exit look also into NOALYSS_INCLUDE --- include/lib/ac_common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php index 40cb46b39..4a320191a 100644 --- a/include/lib/ac_common.php +++ b/include/lib/ac_common.php @@ -1104,7 +1104,7 @@ function show_menu($module) // if file is not a plugin, include the file, otherwise // include the plugin launcher if ( $file[0]['me_type'] != 'PL') { - if (file_exists($file[0]['me_file'])) + if (file_exists ($file[0]['me_file']) || file_exists(NOALYSS_INCLUDE.'/'.$file[0]['me_file'])) { require_once $file[0]['me_file']; } else { From 836ac70d0cc99503c55e4eff3f1b93ede86ffd14 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 17 Dec 2018 23:54:32 +0100 Subject: [PATCH 44/49] cfgcurrency : file for the new version : if the file to include does not exist then display a warning and exit look also into NOALYSS_INCLUDE --- include/lib/ac_common.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php index 4a320191a..c57d20a8d 100644 --- a/include/lib/ac_common.php +++ b/include/lib/ac_common.php @@ -1104,10 +1104,12 @@ function show_menu($module) // if file is not a plugin, include the file, otherwise // include the plugin launcher if ( $file[0]['me_type'] != 'PL') { - if (file_exists ($file[0]['me_file']) || file_exists(NOALYSS_INCLUDE.'/'.$file[0]['me_file'])) + if (file_exists ($file[0]['me_file']) ) { require_once $file[0]['me_file']; - } else { + } elseif ( file_exists(NOALYSS_INCLUDE.'/'.$file[0]['me_file'])) { + require_once NOALYSS_INCLUDE.'/'.$file[0]['me_file']; + }else { echo echo_warning(_("Fichier non trouvé")); } } else { From c373d5d576cdd332526c74c07e0528e99909a60a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 23 Dec 2018 21:04:54 +0100 Subject: [PATCH 45/49] PHP 7.2 : sizeof attribut --- include/class/fiche.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php index a69db88b2..3f44dc7bc 100644 --- a/include/class/fiche.class.php +++ b/include/class/fiche.class.php @@ -345,7 +345,7 @@ class Fiche function strAttribut($p_ad_id,$p_return=1) { $return=($p_return==1)?NOTFOUND:""; - if ( sizeof ($this->attribut) == 0 ) + if ( $this->attribut == NULL ) { if ($this->id==0) { From a4fc7968413ba9297207a0cf3527fa20c67f0331 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 25 Dec 2018 11:45:36 +0100 Subject: [PATCH 46/49] Doc + typo --- html/js/scripts.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/html/js/scripts.js b/html/js/scripts.js index 98964f9ce..d01ae04c4 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -1271,15 +1271,14 @@ function save_predf_op(obj) *amount_id is either a html obj. or an amount and the field tiers if given * @param {type} dossier * @param {type} ctl_concern - * @param {type} amount_id - * @param {type} ledger + * @param {float or string} amount_id Amount or DOM Id of the element containing the amount + * @param {float} ledger * @param {type} p_id_targetDom Element (div) where to display the search result * @param p_tiers id of the Tiers * @returns {undefined} */ function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target,p_tiers) { - var dossier = g('gDossier').value; if (amount_id === undefined) { amount_id = 0; @@ -1295,7 +1294,7 @@ function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target,p amount_id = $(amount_id).innerHTML; } } - var tiers="" + var tiers=""; if ( p_tiers ) tiers=p_tiers; var target = ""; if ( p_id_target !="") { From 3f53de417dd89e9a90a386404f93f8648155e046 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 25 Dec 2018 23:19:36 +0100 Subject: [PATCH 47/49] gitlab #3 Manage Table issue with the type SELECT, cannot reproduce bug Back to old version to fix issue with the type "SELECT" from the menu Syndicat.tools->section --- include/lib/manage_table_sql.class.php | 33 ++++++++++++-------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/include/lib/manage_table_sql.class.php b/include/lib/manage_table_sql.class.php index 87427d300..51aef220c 100644 --- a/include/lib/manage_table_sql.class.php +++ b/include/lib/manage_table_sql.class.php @@ -810,27 +810,24 @@ function check() * we translate the code from the database into a hardcoded label */ $idx=$p_row[$v]; - if ( ! isset($this->a_select[$v][$idx])) { - /* - * Check if index exists - */ - $array_to_search=$this->a_select[$v]; - $value=$p_row[$v]; - $nb_search=count($array_to_search); - $found=FALSE; - for ( $e=0;$e< $nb_search;$e++) { - if (isset ($array_to_search[$e]['value']) && $array_to_search[$e]['value']==$value ) { - $found=TRUE; - echo td($array_to_search[$e]['label']); - } + /* + * Check if index exists + */ + $array_to_search=$this->a_select[$v]; + $value=$p_row[$v]; + + $nb_search=(is_array($array_to_search))?count($array_to_search):0; + $found=FALSE; + for ( $e=0;$e< $nb_search;$e++) { + if (isset ($array_to_search[$e]['value']) && $array_to_search[$e]['value']==$value ) { + $found=TRUE; + echo td($array_to_search[$e]['label']); } + } - if ( ! $found) { - echo td("--"); + if ( ! $found) { + echo td("--"); - } - } else { - echo td($this->a_select[$v][$idx]["label"]); } }else { From b57ab4348bdeeeb68fdd021401592b220083013c Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 26 Dec 2018 13:35:04 +0100 Subject: [PATCH 48/49] Esthetic with button "Add accounting" --- include/param_pcmn.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/param_pcmn.inc.php b/include/param_pcmn.inc.php index 8da1c483f..fdb03237c 100644 --- a/include/param_pcmn.inc.php +++ b/include/param_pcmn.inc.php @@ -79,7 +79,7 @@ echo $mtable->display_table(" where pcm_val::text like '{$g_start}%' order by pc From 0de24ee08ff340bf3db8e36aa5e4355c5701a4ff Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 26 Dec 2018 13:50:20 +0100 Subject: [PATCH 49/49] typo doc --- html/js/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/js/scripts.js b/html/js/scripts.js index d01ae04c4..59d78ad31 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -3411,7 +3411,7 @@ var progressIdx = 0; /** * Start the progress bar * @param {string} p_taskid id to monitor - * @param {int} p_dossier + * @param {int} p_message */ function progress_bar_start(p_taskid,p_message) {