diff --git a/doc/manuel-fr.odt b/doc/manuel-fr.odt index 919d6901e..8b1a53243 100644 Binary files a/doc/manuel-fr.odt and b/doc/manuel-fr.odt differ diff --git a/doc/manuel-fr.pdf b/doc/manuel-fr.pdf index 33053baaa..1fc340b70 100644 Binary files a/doc/manuel-fr.pdf and b/doc/manuel-fr.pdf differ diff --git a/html/access.php b/html/access.php index 0d23c8d80..e72966d71 100644 --- a/html/access.php +++ b/html/access.php @@ -42,6 +42,7 @@ $user=new User($cn); $user->Check(); if ( $user->check_dossier(dossier::id()) == 'P') { redirect("extension.php?".dossier::get(),0); + exit(); } html_page_start($_SESSION['g_theme']); @@ -70,6 +71,12 @@ echo <<exist_table('version') == false ) { + echo '

'._("Base de donnée invalide").'

'; + $base=dirname($_SERVER['REQUEST_URI']); + echo HtmlInput::button_anchor('Retour',$base.'/user_login.php'); + exit(); +} if ( DBVERSION < dossier::get_version($cn)) { echo '

'._("Attention: la version de base de donnée est supérieure à la version du programme, vous devriez mettre à jour").'

'; } diff --git a/html/admin/sql/patch/upgrade79.sql b/html/admin/sql/patch/upgrade79.sql new file mode 100644 index 000000000..825ec7434 --- /dev/null +++ b/html/admin/sql/patch/upgrade79.sql @@ -0,0 +1,32 @@ +begin; + +CREATE OR REPLACE FUNCTION comptaproc.jrnx_letter_del() + RETURNS trigger AS +$BODY$ +declare +row jrnx%ROWTYPE; +begin +row:=OLD; +-- remove orphan +delete from jnt_letter + where (jl_id in (select jl_id from letter_deb) and jl_id not in(select jl_id from letter_cred )) + or (jl_id not in (select jl_id from letter_deb ) and jl_id in(select jl_id from letter_cred )); +return row; +end; +$BODY$ + LANGUAGE 'plpgsql'; + +delete from jnt_letter where (jl_id in (select jl_id from letter_deb ) and jl_id not in(select jl_id from letter_cred )) or (jl_id not in (select jl_id from letter_deb ) and jl_id in(select jl_id from letter_cred )); + +-- Function: comptaproc.jrnx_del() + +CREATE TRIGGER t_letter_del + AFTER DELETE + ON jrnx + FOR EACH ROW + EXECUTE PROCEDURE comptaproc.jrnx_letter_del(); +COMMENT ON TRIGGER t_letter_del ON jrnx IS 'Delete the lettering for this row'; + +update version set val=80; + +commit; \ No newline at end of file diff --git a/html/admin/sql/patch/upgrade80.sql b/html/admin/sql/patch/upgrade80.sql new file mode 100644 index 000000000..ea56356e5 --- /dev/null +++ b/html/admin/sql/patch/upgrade80.sql @@ -0,0 +1,4 @@ +begin; +INSERT INTO format_csv_banque (name, include_file) VALUES ('CBC Online', 'cbc_be_ol.inc.php'); +update version set val=81; +commit; \ No newline at end of file diff --git a/html/commercial.php b/html/commercial.php index e21364db8..16233ad45 100644 --- a/html/commercial.php +++ b/html/commercial.php @@ -41,7 +41,10 @@ $rep=new Database($gDossier); require_once ("class_user.php"); $User=new User($rep); $User->Check(); -if ($User->check_dossier($gDossier)=='P')exit(); +if ($User->check_dossier($gDossier)=='P') { + redirect("extension.php?".dossier::get(),0); + exit(); +} //----------------------------------------------------- // update preference @@ -72,7 +75,7 @@ $p_action=(isset ($_REQUEST['p_action']))?$_REQUEST['p_action']:""; echo '
'; echo menu_tool('commercial.php'); -echo '
'; +echo '
'; $def=0; if ( isset($_REQUEST['p_action'])) { switch($_REQUEST['p_action']) { diff --git a/html/compta.php b/html/compta.php index 3daac5daa..b8159cb68 100644 --- a/html/compta.php +++ b/html/compta.php @@ -45,7 +45,10 @@ $cn=new Database($gDossier); require_once ('class_user.php'); $User=new User($cn); $User->Check(); -if ($User->check_dossier($gDossier)=='P') exit(); +if ($User->check_dossier($gDossier)=='P') { + redirect("extension.php?".dossier::get(),0); + exit(); +} html_page_start($_SESSION['g_theme']); diff --git a/html/comptanalytic.php b/html/comptanalytic.php index 74054e63a..5a55558ac 100644 --- a/html/comptanalytic.php +++ b/html/comptanalytic.php @@ -68,7 +68,7 @@ if ( isset ($_REQUEST['p_action'])) break; } } -echo '
'; +echo '
'; echo ShowItem(array( array('?p_action=ca_pa&'.$str_dossier,'Plan Analytique',"Plan Analytique",0), array('?p_action=ca_od&'.$str_dossier,'Opérations Diverses',"Permet d'enregistrer des operations sur la compta analytique",1), diff --git a/html/index.php b/html/index.php index 9ea0f2ca9..50ff065cb 100644 --- a/html/index.php +++ b/html/index.php @@ -139,14 +139,24 @@ BODY { color:red; } - +.input_text { + border:groove 1px blue; + margin:1px; +} .button { font-size:10; - color:black; + color:white; + font-weight: bold; + text-decoration:none; font-family: helvetica,arial,sans-serif; - background-color:#DFDFDF; -/* border-style: outset ;*/ + background-image: url("image/bg-submit2.gif"); + background-repeat: repeat-x; + background-position: left; + text-decoration:none; + font-family: helvetica,arial,sans-serif; + + border-style: outset ; border-color: blue ; border-width:1; padding:2 4 2 4; @@ -158,11 +168,10 @@ BODY { .button:hover { cursor:pointer; background-color:white; -/* border-style: inset ;*/ + border-style: inset ; font-color:blue; margin:1 2 1 2; } - @@ -192,11 +201,11 @@ version 5.1.build SVNINFO - '.$my_domain.' - + - +',$UserChange->login); ?> prénom
utilisateur
mot de passe
diff --git a/html/parametre.php b/html/parametre.php index c6bbb377c..ab09f7712 100644 --- a/html/parametre.php +++ b/html/parametre.php @@ -57,7 +57,7 @@ echo '
'; echo menu_tool('parametre.php'); -echo '
'; +echo '
'; $authorized =0; @@ -283,33 +283,33 @@ if ( $p_action=='company') { $all->table=1; echo '
'; echo dossier::hidden(); - echo ""; - echo "".td(_('Nom société')).$all->input("p_name",$my->MY_NAME).""; + echo "
"; + echo "".td(_('Nom société'),'style="text-align:right"').$all->input("p_name",$my->MY_NAME).""; $all->value=''; - echo "".td(_("Téléphone")).$all->input("p_tel",$my->MY_TEL).""; + echo "".td(_("Téléphone"),'style="text-align:right"').$all->input("p_tel",$my->MY_TEL).""; $all->value=''; - echo "".td(_("Fax")).$all->input("p_fax",$my->MY_FAX).""; + echo "".td(_("Fax"),'style="text-align:right"').$all->input("p_fax",$my->MY_FAX).""; $all->value=''; - echo "".td(_("Rue ")).$all->input("p_street",$my->MY_STREET).""; + echo "".td(_("Rue "),'style="text-align:right"').$all->input("p_street",$my->MY_STREET).""; $all->value=''; - echo "".td(_("Numéro")).$all->input("p_no",$my->MY_NUMBER).""; + echo "".td(_("Numéro"),'style="text-align:right"').$all->input("p_no",$my->MY_NUMBER).""; $all->value=''; - echo "".td(_("Code Postal")).$all->input("p_cp",$my->MY_CP).""; + echo "".td(_("Code Postal"),'style="text-align:right"').$all->input("p_cp",$my->MY_CP).""; $all->value=''; - echo "".td(_("Commune")).$all->input("p_Commune",$my->MY_COMMUNE).""; + echo "".td(_("Commune"),'style="text-align:right"').$all->input("p_Commune",$my->MY_COMMUNE).""; $all->value=''; - echo "".td(_("Pays")).$all->input("p_pays",$my->MY_PAYS).""; + echo "".td(_("Pays"),'style="text-align:right"').$all->input("p_pays",$my->MY_PAYS).""; $all->value=''; - echo "".td(_("Numéro de Tva")).$all->input("p_tva",$my->MY_TVA).""; + echo "".td(_("Numéro de Tva"),'style="text-align:right"').$all->input("p_tva",$my->MY_TVA).""; if ( $User->check_action(PARCA)==0) $compta->setReadonly(true); - echo "".td(_("Utilisation de la compta. analytique")).$compta->input("p_compta",$array).""; + echo "".td(_("Utilisation de la compta. analytique"),'style="text-align:right"').$compta->input("p_compta",$array).""; if ( $User->check_action(PARSTR)==0) $strict->setReadonly(true); - echo "".td(_("Utilisation du mode strict ")).$strict->input("p_strict",$strict_array).""; + echo "".td(_("Utilisation du mode strict "),'style="text-align:right"').$strict->input("p_strict",$strict_array).""; if ( $User->check_action(PARTVA)==0) $tva_use->setReadonly(true); - echo "".td(_("Assujetti à la tva")).$tva_use->input("p_tva_use",$strict_array).""; - echo "".td(_("Suggérer le numéro de pièce justificative")).$pj_suggest->input("p_pj",$strict_array).""; - echo "".td(_("Suggérer la date")).$date_suggest->input("p_date_suggest",$strict_array).""; - echo ''.td(_('Afficher la période comptable pour éviter les erreurs de date')).$check_periode->input('p_check_periode',$strict_array).''; + echo "".td(_("Assujetti à la tva"),'style="text-align:right"').$tva_use->input("p_tva_use",$strict_array).""; + echo "".td(_("Suggérer le numéro de pièce justificative"),'style="text-align:right"').$pj_suggest->input("p_pj",$strict_array).""; + echo "".td(_("Suggérer la date"),'style="text-align:right"').$date_suggest->input("p_date_suggest",$strict_array).""; + echo ''.td(_('Afficher la période comptable pour éviter les erreurs de date'),'style="text-align:right"').$check_periode->input('p_check_periode',$strict_array).''; echo "
"; echo HtmlInput::submit("record_company",_("Sauve")); echo "
"; diff --git a/html/priv_user.php b/html/priv_user.php index 0b2e92a75..b74c4facf 100644 --- a/html/priv_user.php +++ b/html/priv_user.php @@ -127,10 +127,10 @@ $UserChange->load(); login
%s
- ',$UserChange->name); ?> + ',$UserChange->name); ?>
- ',$UserChange->first_name); ?> + ',$UserChange->first_name); ?>
@@ -215,12 +215,12 @@ foreach ( $Dossier as $rDossier) { - + -Retour +
diff --git a/html/user_login.php b/html/user_login.php index 3e1a061d7..29f246896 100644 --- a/html/user_login.php +++ b/html/user_login.php @@ -62,7 +62,23 @@ include_once("user_menu.php"); $priv=($User->admin==1)?"Administrateur":"Utilisateur"; echo '
'; +/** + * + * If the user is NOT admin and can access only ONE folder, + * so it will be directly redirected to this folder or to the plugins of this + * folder if he's an "plugin user" + */ +if ( $User->admin == 0 ) { + // how many folder ? + $folder=GetAvailableFolder($_SESSION['g_user'],0); + if ( count($folder) == 1 ) { + if ( $User->check_dossier($folder[0]['dos_id']) == 'P') + redirect('extension.php?gDossier='.$folder[0]['dos_id']); + else + redirect('access.php?gDossier='.$folder[0]['dos_id']); + } +} $result=""; $result.=''; if ( $User->Admin() == 1 ) { diff --git a/include/action.common.inc.php b/include/action.common.inc.php index 2a85cbdd4..e57e4c1ca 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -265,7 +265,7 @@ function ShowActionList($cn,$p_base) $list=$cn->make_list("select fd_id from fiche_def where frd_id in (4,8,9,14,15,16,25)"); $w->extra=$list; echo _('Fiche').' :'.$w->search().$w->input().'
'; - printf (_('Titre ou référence').': ', + printf (_('Titre ou référence').': ', $a); echo '
'; diff --git a/include/adm.inc.php b/include/adm.inc.php index 6cddd299e..5c4689ddb 100644 --- a/include/adm.inc.php +++ b/include/adm.inc.php @@ -94,7 +94,7 @@ if ( $low_action == "list" ) ', + printf (_('Recherche').' ', $a); $sel_card=new ISelect('cat'); $sel_card->value=$cn->make_array('select fd_id, fd_label from fiche_def '. diff --git a/include/cbc_be_ol.inc.php b/include/cbc_be_ol.inc.php new file mode 100644 index 000000000..8359486ba --- /dev/null +++ b/include/cbc_be_ol.inc.php @@ -0,0 +1,90 @@ +start(); +$p_cn->set_encoding('latin1'); +while (($row = fgetcsv($handle, 2000,';')) !== FALSE) { + + $num = count($row); + if ( $num != 10 ) continue; + if ( $row[2] != 'MC' || $row[3] != 'EUR') continue; + $line++; + //----------------------------------------------------- + // Parsing CSV comes here + //----------------------------------------------------- + $num_compte=$row[0]; + $date_exec=$row[5]; + $date_val=$row[7]; + // remove first the thousand sep. + $montant=str_replace(' ','',$row[8]); + // replace the coma by a period + $montant=str_replace(',','.',$montant); + // remove the sign + $montant=str_replace('-','',$montant); + $devise=$row[3]; + $ref_extrait=$row[4].'-'.$line; + $detail=$line.'/'.$row[4].' '.$row[6]; + // + //----------------------------------------------------- + // insert into import_tmp + //----------------------------------------------------- + $Sql="insert into import_tmp (code, + date_exec , + date_valeur, + montant, + devise, + detail, + bq_account , + jrn, + status) + values ('$ref_extrait', + to_date('$date_exec','DD/MM/YYYY'), + to_date('$date_exec','DD/MM/YYYY'), + $montant, + '$devise', + '$detail', + '$p_bq_account', + $p_jrn, + 'n')"; + try + { + $p_cn->exec_sql($Sql) ; + } + catch(Exception $e) + { + $p_cn->rollback(); + break; + } +} // file is read +fclose($handle); +if ($line ==0 ) + echo "Encore rien désolé"; +else + echo "$line lignes sont importées"; +echo '
'; +?> diff --git a/include/class_acc_account_ledger.php b/include/class_acc_account_ledger.php index f170b7ef5..26ad39b36 100644 --- a/include/class_acc_account_ledger.php +++ b/include/class_acc_account_ledger.php @@ -100,7 +100,8 @@ class Acc_Account_Ledger { */ function get_row_date($p_from,$p_to) { - $Res=$this->db->exec_sql("select distinct jr_id,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,j_date,". + + $Res=$this->db->exec_sql("select jr_id,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,j_date,". "case when j_debit='t' then j_montant else 0 end as deb_montant,". "case when j_debit='f' then j_montant else 0 end as cred_montant,". " jr_comment as description,jrn_def_name as jrn_name,". diff --git a/include/class_acc_operation.php b/include/class_acc_operation.php index fd36c343a..40631adf7 100644 --- a/include/class_acc_operation.php +++ b/include/class_acc_operation.php @@ -210,7 +210,7 @@ function get_internal() { */ function get_jrnx_detail() { if ( $this->jr_id==0 ) return; - $sql=" select distinct jr_date,j_qcode,j_poste,j_montant,jr_internal,case when j_debit = 'f' then 'C' else 'D' end as debit,jr_comment as description, + $sql=" select jr_date,j_qcode,j_poste,j_montant,jr_internal,case when j_debit = 'f' then 'C' else 'D' end as debit,jr_comment as description, vw_name,pcm_lib,j_debit,coalesce(comptaproc.get_letter_jnt(j_id),-1) as letter ". " from jrnx join jrn on (jr_grpt_id=j_grpt) join tmp_pcmn on (j_poste=pcm_val) diff --git a/include/class_anc_operation.php b/include/class_anc_operation.php index a0a42350e..30ddf91d3 100644 --- a/include/class_anc_operation.php +++ b/include/class_anc_operation.php @@ -173,7 +173,11 @@ class Anc_Operation $offset=(isset($_GET['offset']))?$_GET['offset']:0; $bar=jrn_navigation_bar($offset+1,count($array),$step,$page); - $view=array_splice($array,$offset,$step); + if ( $step !=-1) + $view=array_splice($array,$offset,$step); + else + $view=$array; + $gDossier=dossier::id(); $ret=""; $ret.=$bar; @@ -182,6 +186,7 @@ class Anc_Operation $group=0; $oldgroup=0; $oldjrid=0; + foreach ($view as $row) { $group=$row['oa_group']; if ( $group !=$oldgroup ) { @@ -189,7 +194,7 @@ class Anc_Operation { $efface=new IButton(); - $efface->javascript="op_remove('".$gDossier.",".$oldgroup.")"; + $efface->javascript="op_remove(".$gDossier.",".$oldgroup.")"; $efface->name="Efface"; $efface->label="Efface"; $ret.=""; diff --git a/include/class_pre_operation.php b/include/class_pre_operation.php index 41559f31c..f9209a6ef 100644 --- a/include/class_pre_operation.php +++ b/include/class_pre_operation.php @@ -104,7 +104,7 @@ class Pre_operation $p_array=$this->load(); $array=array( "e_comm"=>$p_array[0]["od_name"], - "nb_item"=>$p_array[0]["od_item"], + "nb_item"=>(($p_array[0]["od_item"]<10?10:$p_array[0]["od_item"])) , "p_jrn"=>$p_array[0]["jrn_def_id"], "jrn_type"=>$p_array[0]["od_jrn_type"] ); diff --git a/include/client.inc.php b/include/client.inc.php index bd7334868..0b0dc3f7b 100644 --- a/include/client.inc.php +++ b/include/client.inc.php @@ -93,7 +93,7 @@ if ( $low_action == "list" ) ', + printf (_('Recherche').' ', $a); $sel_card=new ISelect('cat'); $sel_card->value=$cn->make_array('select fd_id, fd_label from fiche_def '. diff --git a/include/constant.php b/include/constant.php index 580d7b5dd..7d019d305 100644 --- a/include/constant.php +++ b/include/constant.php @@ -26,7 +26,7 @@ require_once ('config.inc.php'); require_once('constant.security.php'); -define ("DBVERSION",79); +define ("DBVERSION",81); define ("MAX_COMPTE",4); define ('MAX_ARTICLE',9); diff --git a/include/impress_poste.inc.php b/include/impress_poste.inc.php index d47c197be..e37bba1b0 100644 --- a/include/impress_poste.inc.php +++ b/include/impress_poste.inc.php @@ -174,14 +174,15 @@ if ( isset( $_REQUEST['bt_html'] ) ) { $Poste->load(); echo '
".$efface->input()."
'; echo ''; - - foreach ($Poste->row as $a) { - $detail=$a; - + /* avoid duplicates */ + $old=array(); + foreach ($Poste->row as $detail) { + if ( in_array($detail['jr_id'],$old) == TRUE ) continue; + $old[]=$detail['jr_id']; echo ''; $op=new Acc_Operation($cn); - $op->jr_id=$a['jr_id']; + $op->jr_id=$detail['jr_id']; $op->poste=$_GET['poste_id']; echo $op->display_jrnx_detail(1); } @@ -248,15 +249,18 @@ if ( isset( $_REQUEST['bt_html'] ) ) { $detail=$Poste->row[0]; + $old=array(); - foreach ($Poste->row as $a) { - $detail=$a; - echo ''; + foreach ($Poste->row as $detail) { + /* avoid duplicates */ + if ( in_array($detail['jr_id'],$old) == TRUE ) continue; + $old[]=$detail['jr_id']; + echo ''; $op=new Acc_Operation($cn); $op->poste=$poste_id['pcm_val']; - $op->jr_id=$a['jr_id']; + $op->jr_id=$detail['jr_id']; echo $op->display_jrnx_detail(1); } } diff --git a/include/pref.inc.php b/include/pref.inc.php index 66127a54d..867502dbc 100644 --- a/include/pref.inc.php +++ b/include/pref.inc.php @@ -54,7 +54,7 @@ if ( ! isset ($_REQUEST['gDossier']) ) { echo HtmlInput::button_anchor(_('Retour'),'user_login.php?'); } else { - echo '

'._('Changez vos préférences').'

'; + echo '

'._('Changez vos préférences').'

'; } ?> diff --git a/include/supplier.inc.php b/include/supplier.inc.php index 9a7dec059..11669657b 100644 --- a/include/supplier.inc.php +++ b/include/supplier.inc.php @@ -93,7 +93,7 @@ if ( $low_action == "list" ) ', + printf (_('Recherche').' ', $a); $sel_card=new ISelect('cat'); $sel_card->value=$cn->make_array('select fd_id, fd_label from fiche_def '. diff --git a/include/template/letter_all.php b/include/template/letter_all.php index b9573b654..fc63beffe 100644 --- a/include/template/letter_all.php +++ b/include/template/letter_all.php @@ -41,8 +41,10 @@ endif;?> content);$i++): + $class=""; +if ( ($i % 2) == 0 ) $class="odd"; ?> - + > + > '; -echo ''; -echo ''; -echo ''; -echo ''; +echo ''; +echo ''; +echo ''; +echo ''; echo ''; echo '

'. $_GET['poste_id'].' '.h($Poste->label).'

'.$detail['j_date'].' '.$detail['jr_internal'].h($detail['description']).'
'. $detail['j_date'].' '.$detail['jr_internal'].' '.hb($detail['description']).' '.hi($detail['jr_pj_number']).'
'. $detail['j_date'].' '.$detail['jr_internal'].' '.hb($detail['description']).' '.hi($detail['jr_pj_number']).'
content[$i]['letter']==-1)?"x":$this->content[$i]['letter']; diff --git a/include/template/letter_prop.php b/include/template/letter_prop.php index 00b330709..8b4693c44 100644 --- a/include/template/letter_prop.php +++ b/include/template/letter_prop.php @@ -42,8 +42,10 @@ if ( count($this->content) == 0 ) : $amount_deb=($j_debit=='t')?$amount_init:0; $amount_cred=($j_debit=='f')?$amount_init:0; for ($i=0;$icontent);$i++): + $class=""; +if ( ($i % 2) == 0 ) $class="odd"; ?> -
content[$i]['j_id']); diff --git a/include/user.inc.php b/include/user.inc.php index 5958f7596..33d48db8e 100644 --- a/include/user.inc.php +++ b/include/user.inc.php @@ -79,10 +79,10 @@ $compteur=0;
First Name Last Name
login password
First Name Last Name
login password
';