MY_TVA_USE=='Y') { echo ''; $a_Tva=$cn->get_array("select tva_id,tva_label from tva_rate where tva_rate != 0.0000 order by tva_rate"); foreach($a_Tva as $line_tva) { $col_tva.=''; } } echo $col_tva; ?> prepare('reconcile_date','select * from jrn where jr_id in (select jra_concerned from jrn_rapt where jr_id = $1 union all select jr_id from jrn_rapt where jra_concerned=$1)'); $tot['htva']=0; $tot['dep_priv']=0; $tot['dna']=0; $tot['tva_nd']=0; $tot['tvac']=0; $tot['tva']=array(); bcscale(2); foreach ($Row as $line) { $i++; /* * Get date of reconcile operation */ $ret_reconcile=$cn->execute('reconcile_date',array($line['jr_id'])); $class = ($i % 2 == 0) ? ' class="even" ' : ' class="odd" '; echo ""; echo ""; echo ""; echo ""; echo ""; $tiers = $Jrn->get_tiers($line['jrn_def_type'], $line['jr_id']); echo td($tiers); echo ""; $dep_priv=($line['dep_priv']==0)?"":nbm($line['dep_priv']); $tot['dep_priv']=bcadd($tot['dep_priv'], floatval($line['dep_priv'])); $dna=($line['dna']==0)?"":nbm($line['dna']); $tot['dna']=bcadd($tot['dna'],floatval($line['dna'])); echo ""; $tot['htva']=bcadd($tot['htva'], floatval($line['HTVA'])); echo ""; echo ""; if ($own->MY_TVA_USE == 'Y' ) { $tva_dna=($line['tva_dna']==0)?"":nbm($line['tva_dna']); $tot['tva_nd']=bcadd($tot['tva_nd'], floatval($line['tva_dna'])); echo ""; $a_tva_amount=array(); foreach ($line['TVA'] as $lineTVA) { foreach ($a_Tva as $idx=>$line_tva) { if ($line_tva['tva_id'] == $lineTVA[1][0]) { $a=$line_tva['tva_id']; $a_tva_amount[$a]=$lineTVA[1][2]; } } } foreach ($a_Tva as $line_tva) { $a=$line_tva['tva_id']; if ( isset($a_tva_amount[$a])) { echo ''; $tot['tva'][$a]=(isset($tot['tva'][$a]))?bcadd($tot['tva'][$a],floatval($a_tva_amount[$a])):floatval($a_tva_amount[$a]); } else printf(""); } } echo ''; $tot['tvac']=bcadd($tot['tvac'], floatval($line['TVAC'])); /* * If reconcile print them */ echo ''; echo ""; } /** * summary */ ?> MY_TVA_USE == 'Y' ): ?>
HTVA Privé DNA TVA NDTva '.$line_tva['tva_label'].'TVAC
" . h($line['jr_pj_number']) . "" . smaller_date($line['date']) . "" . smaller_date($line['date_paid']) . "" . HtmlInput::detail_op($line['jr_id'], $line['jr_internal']) . "" . h($line['comment']) . "" . nbm($line['HTVA']) . "" .$dep_priv . "" . $dna . "" . $tva_dna. "'.nb($a_tva_amount[$a]).''.$line['TVAC'].''; $max=Database::num_row($ret_reconcile); if ($max > 0) { $sep=""; for ($e=0;$e<$max;$e++) { $row=Database::fetch_array($ret_reconcile, $e); echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $row['jr_internal']); $sep=' ,'; } } echo '