diff --git a/include/class/acc_ledger_search.class.php b/include/class/acc_ledger_search.class.php index 40cb60886..f2fdb2b8a 100644 --- a/include/class/acc_ledger_search.class.php +++ b/include/class/acc_ledger_search.class.php @@ -660,24 +660,30 @@ class Acc_Ledger_Search $Max=Database::num_row($Res); if ($Max==0) + { return array(0, _("Aucun enregistrement trouvé")); + } $r.='
| "._("n° interne")." | "; - if ($this->type=='ALL') - { - $r.=th('Journal'); - } $r.=''.$table->get_header(0).' | '; if ($p_paid!=0) + { $r.=''.$table->get_header(1).''; + } if ($p_paid!=0) + { $r.=' | '.$table->get_header(2).' | '; + } $r.=''.$table->get_header(3).' | '; - $r.=''.$table->get_header(4).' | '; + $r.=th('Journal'); + if ( $this->type != "ODS") + { + $r.=''.$table->get_header(4).' | '; + } + $r.=""._("n° interne")." | "; $r.=''.$table->get_header(6).' | '; $r.=th('Notes', ' style="width:15%"'); $r.=''.$table->get_header(5).' | '; @@ -699,24 +705,18 @@ class Acc_Ledger_Search $row=Database::fetch_array($Res, $i); if ($i%2==0) + { $tr='
|---|---|---|---|---|---|---|---|---|---|
| "; - // If url contains - // - - $href=basename($_SERVER['PHP_SELF']); - - - $r.=sprintf('%s ', - $row['jr_id'], $gDossier, $row['jr_internal']); - $r.=" | "; - if ($this->type=='ALL') - $r.=td($row['jrn_def_name']); + + // date $r.=""; $r.=$row['str_jr_date']; @@ -736,10 +736,24 @@ class Acc_Ledger_Search $r.=" | "; $r.=$row['jr_pj_number']; $r.=" | "; + + // Ledger + $r.=td($row['jrn_def_name']); - // Tiers - $other=($row['quick_code']!='')?HtmlInput::card_detail($row['quick_code'],h($row['name'].' '.$row['first_name'])):''; - $r.=td($other); + + if ($this->type != 'ODS') + { + // Tiers + $other=($row['quick_code']!='')?HtmlInput::card_detail($row['quick_code'],h($row['name'].' '.$row['first_name'])):''; + $r.=td($other); + } + + // Internal number + $r.=""; + $r.=sprintf('%s ', + $row['jr_id'], $gDossier, $row['jr_internal']); + $r.=" | "; + // comment $r.=""; $tmp_jr_comment=h($row['jr_comment']); @@ -757,7 +771,9 @@ class Acc_Ledger_Search $positive=$this->cn->get_value("select qf_amount from quant_fin where jr_id=$1", array($row['jr_id'])); if ($this->cn->count()!=0) + { $positive=($positive<0)?1:0; + } } $r.=" | "; $t_amount=$row['jr_montant']; @@ -788,9 +804,13 @@ class Acc_Ledger_Search $h->name="set_jr_id".$row['jr_id']; $r.=' | '.$w->input().$h->input().' | '; if ($row['jr_rapt']=='paid') + { $amount_paid=bcadd($amount_paid, $t_amount); + } else + { $amount_unpaid=bcadd($amount_unpaid, $t_amount); + } } // Rapprochement diff --git a/include/history_operation.inc.php b/include/history_operation.inc.php index 2acc4fae5..20113ba9f 100644 --- a/include/history_operation.inc.php +++ b/include/history_operation.inc.php @@ -42,6 +42,7 @@ switch($ledger_type) { case 'ACH': $ask_pay=1; + $p_array['ledger_type']='ACH'; break; case 'ODS': $ask_pay=0; @@ -53,9 +54,11 @@ switch($ledger_type) break; case 'VEN': $ask_pay=1; + $p_array['ledger_type']='VEN'; break; case 'FIN': $ask_pay=0; + $p_array['ledger_type']='FIN'; break; } @@ -95,7 +98,9 @@ if (!isset($p_array['date_start'])) } else { - $msg='