diff --git a/html/admin/sql/patch/upgrade77.sql b/html/admin/sql/patch/upgrade77.sql index ad445ddd2..d85a80b8e 100644 --- a/html/admin/sql/patch/upgrade77.sql +++ b/html/admin/sql/patch/upgrade77.sql @@ -1,4 +1,4 @@ begin; -insert into parameter(pr_id,pr_value) values ('MY_SUGGEST_DATE','N'); +insert into parameter(pr_id,pr_value) values ('MY_DATE_SUGGEST','Y'); update version set val=78; commit; \ No newline at end of file diff --git a/html/parametre.php b/html/parametre.php index f62b58ec4..f1d7e1777 100644 --- a/html/parametre.php +++ b/html/parametre.php @@ -234,6 +234,7 @@ if ( $p_action=='company') { $m->MY_FAX=$p_fax; $m->MY_PAYS=$p_pays; $m->MY_CHECK_PERIODE=$p_check_periode; + $m->MY_DATE_SUGGEST=$p_date_suggest; if ( $User->check_action(PARCA)!=0)$m->MY_ANALYTIC=$p_compta; if ( $User->check_action(PARSTR)!=0) $m->MY_STRICT=$p_strict; if ( $User->check_action(PARTVA)!=0)$m->MY_TVA_USE=$p_tva_use; @@ -268,7 +269,11 @@ if ( $p_action=='company') { $pj_suggest=new ISelect(); $pj_suggest->table=1; $pj_suggest->selected=$my->MY_PJ_SUGGEST; - + + $date_suggest=new ISelect(); + $date_suggest->table=1; + $date_suggest->selected=$my->MY_DATE_SUGGEST; + $check_periode=new ISelect(); $check_periode->table=1; $check_periode->selected=$my->MY_CHECK_PERIODE; @@ -295,6 +300,7 @@ if ( $p_action=='company') { 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 ""; echo HtmlInput::submit("record_company",_("Sauve")); diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index e4daf4510..c13af3624 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -1104,6 +1104,7 @@ jr_comment||' ('||jr_internal||')'||case when jr_pj_number is not null and jr_pj function show_form($p_array=null,$p_readonly=0) { $user = new User($this->db); + $owner=new Own($this->db); if ( $p_readonly == 1 ) return $this->show_summary($p_array); @@ -1134,7 +1135,7 @@ jr_comment||' ('||jr_internal||')'||case when jr_pj_number is not null and jr_pj $wDate=new IDate('date'); $wDate->readonly=$p_readonly; $date=(isset($date)&&trim($date)!='')?$date:''; - if (trim($date)=='') { + if (trim($date)=='' && $owner->MY_DATE_SUGGEST=='Y') { $user=new User($this->db); $periode=new Periode($this->db); list ($l_date_start,$l_date_end)=$periode->get_date_limit($user->get_periode()); diff --git a/include/class_acc_ledger_fin.php b/include/class_acc_ledger_fin.php index 02dec650c..8fc4542bc 100644 --- a/include/class_acc_ledger_fin.php +++ b/include/class_acc_ledger_fin.php @@ -189,6 +189,8 @@ class Acc_Ledger_Fin extends Acc_Ledger { function input($p_array=null) { if ( $p_array != null) extract ($p_array); + $owner=new Own($this->db); + $pview_only=false; $user = new User($this->db); $f_add_button=new IButton('add_card'); @@ -201,8 +203,11 @@ class Acc_Ledger_Fin extends Acc_Ledger { // The first day of the periode $pPeriode=new Periode($this->db); list ($l_date_start,$l_date_end)=$pPeriode->get_date_limit($user->get_periode()); - - $op_date=( ! isset($e_date) ) ?$l_date_start:$e_date; + if ( $owner->MY_DATE_SUGGEST=='Y' ) + $op_date=( ! isset($e_date) ) ?$l_date_start:$e_date; + else + $op_date=( ! isset($e_date) ) ?'':$e_date; + $r=""; $r.=dossier::hidden(); diff --git a/include/class_acc_ledger_purchase.php b/include/class_acc_ledger_purchase.php index c3de49db9..caa9ed53a 100644 --- a/include/class_acc_ledger_purchase.php +++ b/include/class_acc_ledger_purchase.php @@ -740,8 +740,11 @@ array // The first day of the periode $oPeriode=new Periode($this->db); list ($l_date_start,$l_date_end)=$oPeriode->get_date_limit($user->get_periode()); + if ( $owner->MY_DATE_SUGGEST=='Y' ) + $op_date=( ! isset($e_date) ) ?$l_date_start:$e_date; + else + $op_date=( ! isset($e_date) ) ?'':$e_date; - $op_date=( ! isset($e_date) ) ?$l_date_start:$e_date; $e_ech=(isset($e_ech))?$e_ech:""; $e_comm=(isset($e_comm))?$e_comm:""; diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php index d99c9a039..79160feef 100644 --- a/include/class_acc_ledger_sold.php +++ b/include/class_acc_ledger_sold.php @@ -859,8 +859,12 @@ class Acc_Ledger_Sold extends Acc_Ledger { // The first day of the periode $oPeriode=new Periode($this->db); list ($l_date_start,$l_date_end)=$oPeriode->get_date_limit($user->get_periode()); + if ( $owner->MY_DATE_SUGGEST=='Y' ) + $op_date=( ! isset($e_date) ) ?$l_date_start:$e_date; + else + $op_date=( ! isset($e_date) ) ?'':$e_date; + - $op_date=( ! isset($e_date) ) ?$l_date_start:$e_date; $e_ech=(isset($e_ech))?$e_ech:""; $e_comm=(isset($e_comm))?$e_comm:""; diff --git a/include/class_own.php b/include/class_own.php index 4a02a83a1..3f1006cdd 100644 --- a/include/class_own.php +++ b/include/class_own.php @@ -94,6 +94,8 @@ class Own { $this->save('MY_TVA_USE'); $this->save('MY_PJ_SUGGEST'); $this->save('MY_CHECK_PERIODE'); + $this->save('MY_DATE_SUGGEST'); + } diff --git a/include/constant.php b/include/constant.php index f6a9ee59a..1315f4606 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",77); +define ("DBVERSION",78); define ("MAX_COMPTE",4); define ('MAX_ARTICLE',9); diff --git a/release-note b/release-note index 213a8996f..7d2a728cc 100644 --- a/release-note +++ b/release-note @@ -51,4 +51,6 @@ operation 3 = FIN1.3 il est préférable d'avoir un préfixe différent pour chaque banque, il est plus facile d'utiliser un journal par compte en banque 14. Pour le pense bête, changement cosmétique -15. Opérations Diverses fonctionne comme les autres journaux : soit on spécifie la période soit la période est déduite de la date \ No newline at end of file +15. Opérations Diverses fonctionne comme les autres journaux : soit on spécifie la période soit la période est déduite de la date +16. La calculatrice est dans un bouton +17. Possibilité d'avoir la date de la periode ou vide pour les achat, ventes, opérations diverses et banque, à changer dans paramètre->société : suggérer date