FS#83 : add the printing of the details of operation for the menu :

impression -> poste
This commit is contained in:
Dany De Bontridder 2010-07-09 23:45:08 +00:00
parent 9841fd0b15
commit dd2ea58a27
5 changed files with 76 additions and 24 deletions

View file

@ -101,7 +101,37 @@ foreach ($a_poste as $poste)
$pdf->ln();
$tot_deb+=$row['deb_montant'];
$tot_cred+=$row['cred_montant'];
/* -------------------------------------- */
/* if details are asked we show them here */
/* -------------------------------------- */
if ( isset($_GET['oper_detail'])){
$detail=new Acc_Operation($cn);
$detail->jr_id=$row['jr_id'];
$a_detail=$detail->get_jrnx_detail();
for ($f=0;$f<count($a_detail);$f++) {
$l=0;
$pdf->Cell($size[$l],6,'',0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,$a_detail[$f]['j_qcode'],0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,$a_detail[$f]['j_poste'],0,0,$align[$l]);$l++;
if ( $a_detail[$f]['j_qcode']=='')
$lib=$a_detail[$f]['pcm_lib'];
else
{
$f_id=$cn->get_value('select f_id from vw_poste_qcode where j_qcode=$1',array($a_detail[$f]['j_qcode'])) ;
$lib=$cn->get_value('select av_text from jnt_fic_att_value join attr_value using (jft_id) where ad_id=$1 and f_id=$2',
array(ATTR_DEF_NAME,$f_id));
}
$pdf->Cell($size[$l],6,$lib,0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,(($a_detail[$f]['letter']!=-1)?$a_detail[$f]['letter']:''),0,0,$align[$l]);$l++;
$deb=($a_detail[$f]['debit']=='D')?$a_detail[$f]['j_montant']:'';
$cred=($a_detail[$f]['debit']=='C')?$a_detail[$f]['j_montant']:'';
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',$deb)),0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',$cred)),0,0,$align[$l]);$l++;
$pdf->ln();
}
}
}
$str_debit=sprintf("% 12.2f €",$tot_deb);
$str_credit=sprintf("% 12.2f €",$tot_cred);

View file

@ -86,7 +86,38 @@ $pdf->Ln();
$pdf->ln();
$tot_deb+=$row['deb_montant'];
$tot_cred+=$row['cred_montant'];
/* -------------------------------------- */
/* if details are asked we show them here */
/* -------------------------------------- */
if ( isset($_GET['oper_detail'])){
$detail=new Acc_Operation($cn);
$detail->jr_id=$row['jr_id'];
$a_detail=$detail->get_jrnx_detail();
for ($f=0;$f<count($a_detail);$f++) {
$l=0;
$pdf->Cell($size[$l],6,'',0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,$a_detail[$f]['j_qcode'],0,0,'L');$l++;
$pdf->Cell($size[$l],6,$a_detail[$f]['j_poste'],0,0,'R');$l++;
if ( $a_detail[$f]['j_qcode']=='')
$lib=$a_detail[$f]['pcm_lib'];
else
{
$f_id=$cn->get_value('select f_id from vw_poste_qcode where j_qcode=$1',array($a_detail[$f]['j_qcode'])) ;
$lib=$cn->get_value('select av_text from jnt_fic_att_value join attr_value using (jft_id) where ad_id=$1 and f_id=$2',
array(ATTR_DEF_NAME,$f_id));
}
$pdf->Cell($size[$l],6,$lib,0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,(($a_detail[$f]['letter']!=-1)?$a_detail[$f]['letter']:''),0,0,$align[$l]);$l++;
$deb=($a_detail[$f]['debit']=='D')?$a_detail[$f]['j_montant']:'';
$cred=($a_detail[$f]['debit']=='C')?$a_detail[$f]['j_montant']:'';
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',$deb)),0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',$cred)),0,0,$align[$l]);$l++;
$pdf->ln();
}
}
}
$str_debit=sprintf("% 12.2f €",$tot_deb);
$str_credit=sprintf("% 12.2f €",$tot_cred);

View file

@ -34,7 +34,7 @@ $p_array=array(array ("?p_action=impress&type=jrn&".$str_dossier,_("Journaux")),
array("?p_action=impress&type=poste&".$str_dossier,_("Poste")),
array("?p_action=impress&type=fiche&".$str_dossier,_("Catégorie de fiche")),
array("?p_action=impress&type=rapport&".$str_dossier,_("Rapport")),
array("?p_action=impress&type=rec&".$str_dossier,_("Réconciliation")),
array("?p_action=impress&type=rec&".$str_dossier,_("Rapprochement")),
array('?p_action=impress&type=bal&'.$str_dossier,_('Balance des comptes')),
array("?p_action=impress&type=bilan&".$str_dossier,_("Bilan"))
);

View file

@ -34,18 +34,7 @@ require_once('class_acc_operation.php');
// Show the jrn and date
//-----------------------------------------------------
require_once('class_database.php');
echo JS_LEDGER;
echo JS_PROTOTYPE;
echo JS_INFOBULLE;
require_once('class_ipopup.php');
echo js_include('accounting_item.js');
echo js_include('prototype.js');
echo js_include('scriptaculous.js');
echo js_include('effects.js');
echo js_include('controls.js');
echo js_include('dragdrop.js');
echo js_include('card.js');
echo js_include('acc_ledger.js');
echo IPoste::ipopup('ipop_account');
echo ICard::ipopup('ipopcard');
@ -175,13 +164,13 @@ if ( isset( $_REQUEST['bt_html'] ) ) {
if ( empty($Poste->row)) exit();
$Poste->load();
echo '<table class="result">';
echo '<tr><td class="mtitle" colspan="5"><h2 class="info">'. $_GET['poste_id'].' '.h($Poste->label).'</h2></td></tr>';
echo '<tr><td class="mtitle" style="width:auto" colspan="6"><h2 class="info">'. $_GET['poste_id'].' '.h($Poste->label).'</h2></td></tr>';
/* avoid duplicates */
$old=array();
foreach ($Poste->row as $detail) {
if ( in_array($detail['jr_id'],$old) == TRUE ) continue;
$old[]=$detail['jr_id'];
echo '<tr><td class="mtitle" colspan="5">'.$detail['j_date'].' '.$detail['jr_internal'].h($detail['description']).'</td></tr>';
echo '<tr><td class="mtitle" style="width:auto" colspan="6">'.$detail['j_date'].' '.$detail['jr_internal'].h($detail['description']).'</td></tr>';
$op=new Acc_Operation($cn);
$op->jr_id=$detail['jr_id'];
@ -240,14 +229,14 @@ if ( isset( $_REQUEST['bt_html'] ) ) {
// Detail
//----------------------------------------------------------------------
echo Acc_Account_Ledger::HtmlTableHeader();
echo '<table class="result">';
echo '<table class="result" style="width:80%;margin-left:10%">';
foreach ($a_poste as $poste_id )
{
$Poste=new Acc_Account_Ledger ($cn,$poste_id['pcm_val']);
$Poste->load();
$Poste->get_row_date( $_GET['from_periode'], $_GET['to_periode']);
if ( empty($Poste->row)) continue;
echo '<tr><td class="mtitle" colspan="5"><h2 class="info">'. $poste_id['pcm_val'].' '.h($Poste->label).'</h2></td></tr>';
echo '<tr><td class="mtitle" style="width:auto" colspan="6"><h2 class="info">'. $poste_id['pcm_val'].' '.h($Poste->label).'</h2></td></tr>';
$detail=$Poste->row[0];
@ -257,7 +246,7 @@ if ( isset( $_REQUEST['bt_html'] ) ) {
/* avoid duplicates */
if ( in_array($detail['jr_id'],$old) == TRUE ) continue;
$old[]=$detail['jr_id'];
echo '<tr><td class="mtitle" colspan="5">'. $detail['j_date'].' '.$detail['jr_internal'].' '.hb($detail['description']).' '.hi($detail['jr_pj_number']).'</td></tr>';
echo '<tr><td class="mtitle" style="width:auto" colspan="6">'. $detail['j_date'].' '.$detail['jr_internal'].' '.hb($detail['description']).' '.hi($detail['jr_pj_number']).'</td></tr>';
$op=new Acc_Operation($cn);
$op->poste=$poste_id['pcm_val'];

View file

@ -35,6 +35,7 @@ echo load_all_script();
*@file
*@todo add the export to PDF
*/
echo '<div class="noprint">';
echo '<div class="content">';
$rjrn='';
$radio=new IRadio('choice');
@ -45,22 +46,23 @@ echo dossier::hidden().HtmlInput::hidden('p_action','impress').HtmlInput::hidden
echo '<ol style="list-style-type:none;">';
$radio->selected=($choice==0)?true:false;$radio->value=0;
echo '<li>'.$radio->input().'Opérations réconcilées'.'</li>';
echo '<li>'.$radio->input().'Opérations rapprochées'.'</li>';
$radio->selected=($choice==1)?true:false;$radio->value=1;
echo '<li>'.$radio->input().'Opérations réconcilées avec des montants différents'.'</li>';
echo '<li>'.$radio->input().'Opérations rapprochées avec des montants différents'.'</li>';
$radio->selected=($choice==2)?true:false;$radio->value=2;
echo '<li>'.$radio->input().'Opérations réconcilées avec des montants identiques'.'</li>';
echo '<li>'.$radio->input().'Opérations rapprochées avec des montants identiques'.'</li>';
$radio->selected=($choice==3)?true:false;$radio->value=3;
echo '<li>'.$radio->input().'Opérations non réconcilées'.'</li>';
echo '<li>'.$radio->input().'Opérations non rapprochées'.'</li>';
echo '<li>'.HtmlInput::submit('vis',_('Visualisation')).'</li>';
echo '</lo>';
echo '</ol>';
echo '</form>';
echo '<hr>';
echo '</div>';
echo '</div>';
echo '<div class="content">';
if ( ! isset($_GET['vis'])) exit();
$a=new Acc_Reconciliation($cn);