diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index 728ee22a3..c06ff887e 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -3500,6 +3500,9 @@ class Acc_Ledger extends jrn_def_sql if ($result == 1) throw new Exception(_("Aucun compte en banque n'est donné")); } + if ($p_jrn_type == "-1") { + throw new Exception(_('Choix du type de journal est obligatoire')); + } } catch (Exception $e) { @@ -3573,6 +3576,14 @@ class Acc_Ledger extends jrn_def_sql */ function input_new() { + $retry=HtmlInput::default_value_post("sa", ""); +// if ( $retry == "add") { + $default_type=HtmlInput::default_value_post("p_jrn_type", -1); + $previous_jrn_def_pj_pref=HtmlInput::default_value_post("jrn_def_pj_pref",""); + $previous_p_description=HtmlInput::default_value_post("p_description",""); + $previous_p_jrn_name=HtmlInput::default_value_post('p_jrn_name',''); + $previous_p_jrn_type = HtmlInput::default_value_post("p_jrn_type",""); +// } global $g_user; $f_add_button=new ISmallButton('add_card'); $f_add_button->label=_('Créer une nouvelle fiche'); @@ -3619,7 +3630,7 @@ class Acc_Ledger extends jrn_def_sql $hidden.=HtmlInput::hidden('p_ech_lib', 'echeance'); /* properties of the ledger */ - $name = ""; + $name = $previous_p_jrn_name; $code = ""; $wType = new ISelect(); $a_jrn= $this->db->make_array("select '-1',' -- "._("choix du type de journal")." -- ' union select jrn_type_id,jrn_desc from jrn_type"); @@ -3628,17 +3639,19 @@ class Acc_Ledger extends jrn_def_sql $wType->name = "p_jrn_type"; $wType->id= "p_jrn_type_select_id"; $wType->javascript=' onchange="show_ledger_div()"'; + $wType->selected=$default_type; $type = $wType->input(); $rcred = $rdeb = array(); $wPjPref = new IText(); $wPjPref->name = 'jrn_def_pj_pref'; + $wPjPref->value=$previous_jrn_def_pj_pref; $pj_pref = $wPjPref->input(); $pj_seq = ''; $last_seq = 0; $new = 1; $description=new ITextarea('p_description'); $description->style='class="itextarea" style="margin:0px;"'; - $description->value=""; + $description->value=$previous_p_description; $str_description=$description->input(); /* bank card */ $qcode_bank = ''; diff --git a/include/class_anc_operation.php b/include/class_anc_operation.php index cd5632430..6fa9278a4 100644 --- a/include/class_anc_operation.php +++ b/include/class_anc_operation.php @@ -147,9 +147,9 @@ class Anc_Operation $cond_poste=""; if ($p_from!="") - $cond="and jr_date >= to_date('$p_from','DD.MM.YYYY') "; + $cond="and (jr_date >= to_date('$p_from','DD.MM.YYYY') or oa_date >= to_date('$p_from','DD.MM.YYYY') )"; if ( $p_to!="" ) - $cond.="and jr_date <=to_date('$p_to','DD.MM.YYYY')"; + $cond.="and (jr_date <=to_date('$p_to','DD.MM.YYYY') or oa_date <=to_date('$p_to','DD.MM.YYYY')) "; if ($p_from_poste != "" ) $cond_poste=" and upper(po_name) >= upper('".$p_from_poste."')"; @@ -159,12 +159,13 @@ class Anc_Operation if ( isset ( $this->pa_id) && $this->pa_id !='') $pa_id_cond= "pa_id=".$this->pa_id." and"; $sql=" + select oa_id, po_name, oa_description, po_description, oa_debit, - to_char(jr_date,'DD.MM.YYYY') as oa_date, + (case when jr_date is not null then to_char(jr_date,'DD.MM.YYYY') else to_char(oa_date,'DD.MM.YYYY') end ) as oa_date, oa_amount, oa_group, j_id , @@ -173,7 +174,8 @@ class Anc_Operation jr_comment, j_poste, jrnx.f_id, - ( select ad_value from fiche_Detail where f_id=jrnx.f_id and ad_id=23) as qcode + ( select ad_value from fiche_Detail where f_id=jrnx.f_id and ad_id=23) as qcode, + jr_pj_number from operation_analytique as B join poste_analytique using(po_id) left join jrnx using (j_id) left join jrn on (j_grpt=jr_grpt_id) @@ -253,18 +255,18 @@ class Anc_Operation $ret.=''; } - $ret.=''; + $ret.='
'; - $ret.="". - ""; + $ret.="". + td($row['oa_date']). + "". + td(); - $ret.="". $oldgroup=$group; diff --git a/include/class_html_input.php b/include/class_html_input.php index 202846b21..ee40566cc 100755 --- a/include/class_html_input.php +++ b/include/class_html_input.php @@ -352,6 +352,7 @@ class HtmlInput echo ''; echo ''; echo ''; + $ret=ob_get_contents(); ob_end_clean(); return $ret; @@ -427,7 +428,7 @@ class HtmlInput { $r=''; $r.='
'; - $r.= ''._('Fermer').''; + $r.= ''._('Fermer').''; $r.='
'; return $r; } diff --git a/include/template/form_ledger_detail.php b/include/template/form_ledger_detail.php index cc2e6ceec..3ce1032c9 100644 --- a/include/template/form_ledger_detail.php +++ b/include/template/form_ledger_detail.php @@ -103,21 +103,21 @@ echo ''; ?>
". - $row['oa_date']. - "". - h($row['oa_description']). - "
". + HtmlInput::detail_op($row['jr_id'], h($row['oa_description']." ".$row['jr_pj_number'])). + "". + $ret.="". "Groupe id : ".$row['oa_group']. - ""; + "
-
+
-
+

0.0
0.0 -
0.0 +
0.0
-
+
diff --git a/include/template/ledger_detail_top.php b/include/template/ledger_detail_top.php index 66e56b0e9..f56974653 100644 --- a/include/template/ledger_detail_top.php +++ b/include/template/ledger_detail_top.php @@ -6,9 +6,12 @@ if ($div != "popup") { $callback=$_SERVER['PHP_SELF']; $str=$_SERVER['QUERY_STRING']."&act=$action&ajax=$callback"; - echo ' + $msg_close=_('Fermer'); + $msg_pop=_('Ouvrir dans une fenêtre séparée'); + + echo ' !pop me out ! '; - echo ''._("Fermer").''; + echo ''._("Fermer").''; } ?>
diff --git a/include/template/param_jrn.php b/include/template/param_jrn.php index fcd464ef2..d07c7ed1d 100644 --- a/include/template/param_jrn.php +++ b/include/template/param_jrn.php @@ -379,5 +379,12 @@ echo $str_add_button; } hide_ledger(); hide_row(); + + show_ledger_div(); +