jrn=null; switch( $_GET['p_filter']) { case 0: $bal->jrn=null; break; case 1: if ( isset($_GET['r_jrn'])) { $selected=$_GET['r_jrn']; $array_ledger=$g_user->get_ledger('ALL',3); $array=get_array_column($array_ledger,'jrn_def_id'); for ($e=0;$ejrn[]=$selected[$e]; } } break; case 2: if ( isset($_GET['r_cat'])) $bal->filter_cat($_GET['r_cat']); break; } $bal->from_poste=$_GET['from_poste']; $bal->to_poste=$_GET['to_poste']; if (isset($_GET['unsold'])) $bal->unsold=true; $prev = (isset($_GET['previous_exc'])) ? 1: 0; $row=$bal->get_row($_GET['from_periode'], $_GET['to_periode'], $prev); $prev = ( isset ($row[0]['sum_cred_previous'])) ?1:0; echo 'poste;libelle;'; if ($prev == 1 ) echo 'deb n-1;cred n-1;solde n-1;d/c;'; echo 'deb;cred;solde;d/c'; printf("\n"); foreach ($row as $r) { echo $r['poste'].';'. $r['label'].';'; if ( $prev == 1 ) { $delta=bcsub($r['solde_deb_previous'],$r['solde_cred_previous']); $sign=($delta<0)?'C':'D'; $sign=($delta == 0)?'=':$sign; echo nb($r['sum_deb_previous']).';'. nb($r['sum_cred_previous']).';'. nb(abs($delta)).';'. "$sign".';'; } $delta=bcsub($r['solde_deb'],$r['solde_cred']); $sign=($delta<0)?'C':'D'; $sign=($delta == 0)?'=':$sign; echo nb($r['sum_deb']).';'. nb($r['sum_cred']).';'. nb(abs($delta)).';'. "$sign"; printf("\n"); } ?>