#1251 impression PDF

Remove function Cell that fct cannot be overloaded
Change Cell by write_cell
change ln by print_row

All cells of a row are kept into an array and print at once when we
are sure it is not going to be splitted onto 2 pages
This commit is contained in:
Dany De Bontridder 2016-01-24 14:22:03 +01:00
parent 69efdd1cb3
commit 6a142ad73e
17 changed files with 546 additions and 557 deletions

View file

@ -101,19 +101,19 @@ $pdf->AddPage();
$pdf->SetAuthor('NOALYSS');
$pdf->SetFont('DejaVuCond','',7);
$pdf->setTitle("Balance comptable",true);
$pdf->Cell(30,6,'poste');
$pdf->write_cell(30,6,'poste');
$pdf->LongLine(60,6,'Libellé');
if ($previous == 1 ){
$pdf->Cell(20,6,'Débit N-1',0,0,'R');
$pdf->Cell(20,6,'Crédit N-1',0,0,'R');
$pdf->Cell(20,6,'Débiteur N-1',0,0,'R');
$pdf->Cell(20,6,'Créditeur N-1',0,0,'R');
$pdf->write_cell(20,6,'Débit N-1',0,0,'R');
$pdf->write_cell(20,6,'Crédit N-1',0,0,'R');
$pdf->write_cell(20,6,'Débiteur N-1',0,0,'R');
$pdf->write_cell(20,6,'Créditeur N-1',0,0,'R');
}
$pdf->Cell(25,6,'Total Débit',0,0,'R');
$pdf->Cell(25,6,'Total Crédit',0,0,'R');
$pdf->Cell(25,6,'Solde Débiteur',0,0,'R');
$pdf->Cell(25,6,'Solde Créditeur',0,0,'R');
$pdf->Ln();
$pdf->write_cell(25,6,'Total Débit',0,0,'R');
$pdf->write_cell(25,6,'Total Crédit',0,0,'R');
$pdf->write_cell(25,6,'Solde Débiteur',0,0,'R');
$pdf->write_cell(25,6,'Solde Créditeur',0,0,'R');
$pdf->line_new();
$pdf->SetFont('DejaVuCond','',8);
$tp_deb=0;
@ -166,20 +166,20 @@ if (! empty($array))
if ($previous == 1 ) {
$delta_previous=bcsub(${'nlvl'.$ind}['solde_cred_previous'],${'nlvl'.$ind}['solde_deb_previous']);
$side_previous=($delta_previous < 0) ? "D":"C";
$pdf->Cell(30,6,"n-1 : " .nbm($delta_previous)." $side_previous",0,0,'R');
$pdf->Cell(30,6," n : ".nbm($delta)." $side",0,0,'R');
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['sum_deb_previous']),0,0,'R');
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['sum_cred_previous']),0,0,'R');
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['solde_deb_previous']),0,0,'R');
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['solde_cred_previous']),0,0,'R');
$pdf->write_cell(30,6,"n-1 : " .nbm($delta_previous)." $side_previous",0,0,'R');
$pdf->write_cell(30,6," n : ".nbm($delta)." $side",0,0,'R');
$pdf->write_cell(22,6,nbm(${'nlvl'.$ind}['sum_deb_previous']),0,0,'R');
$pdf->write_cell(22,6,nbm(${'nlvl'.$ind}['sum_cred_previous']),0,0,'R');
$pdf->write_cell(22,6,nbm(${'nlvl'.$ind}['solde_deb_previous']),0,0,'R');
$pdf->write_cell(22,6,nbm(${'nlvl'.$ind}['solde_cred_previous']),0,0,'R');
} else {
$pdf->Cell(60,6,nbm($delta)." $side",0,0,'R');
$pdf->write_cell(60,6,nbm($delta)." $side",0,0,'R');
}
$pdf->Cell(25,6,nbm(${'nlvl'.$ind}['sum_deb']),0,0,'R');
$pdf->Cell(25,6,nbm(${'nlvl'.$ind}['sum_cred']),0,0,'R');
$pdf->Cell(25,6,nbm(${'nlvl'.$ind}['solde_deb']),0,0,'R');
$pdf->Cell(25,6,nbm(${'nlvl'.$ind}['solde_cred']),0,0,'R');
$pdf->Ln();
$pdf->write_cell(25,6,nbm(${'nlvl'.$ind}['sum_deb']),0,0,'R');
$pdf->write_cell(25,6,nbm(${'nlvl'.$ind}['sum_cred']),0,0,'R');
$pdf->write_cell(25,6,nbm(${'nlvl'.$ind}['solde_deb']),0,0,'R');
$pdf->write_cell(25,6,nbm(${'nlvl'.$ind}['solde_cred']),0,0,'R');
$pdf->line_new();
$pdf->SetFont('DejaVuCond','',7);
${'lvl'.$ind.'_old'}=substr($r['poste'],0,$ind);
foreach($a_sum as $a)
@ -209,20 +209,20 @@ if (! empty($array))
$pdf->LongLine(30,6,$value['poste'],0,'L',$fill);
$pdf->LongLine(60,6,$value['label'],0,'L',$fill);
if ($previous == 1 ) {
$pdf->Cell(22,6,nbm($value['sum_deb_previous']),0,0,'R',$fill);
$pdf->Cell(22,6,nbm($value['sum_cred_previous']),0,0,'R',$fill);
$pdf->Cell(22,6,nbm($value['solde_deb_previous']),0,0,'R',$fill);
$pdf->Cell(22,6,nbm($value['solde_cred_previous']),0,0,'R',$fill);
$pdf->write_cell(22,6,nbm($value['sum_deb_previous']),0,0,'R',$fill);
$pdf->write_cell(22,6,nbm($value['sum_cred_previous']),0,0,'R',$fill);
$pdf->write_cell(22,6,nbm($value['solde_deb_previous']),0,0,'R',$fill);
$pdf->write_cell(22,6,nbm($value['solde_cred_previous']),0,0,'R',$fill);
$tp_deb_previous=bcadd($tp_deb_previous,$value['sum_deb_previous']);
$tp_cred_previous=bcadd($tp_cred_previous,$value['sum_cred_previous']);
$tp_sold_previous=bcadd($tp_sold_previous,$value['solde_deb_previous']);
$tp_solc_previous=bcadd($tp_solc_previous,$value['solde_cred_previous']);
}
$pdf->Cell(25,6,nbm($value['sum_deb']),0,0,'R',$fill);
$pdf->Cell(25,6,nbm($value['sum_cred']),0,0,'R',$fill);
$pdf->Cell(25,6,nbm($value['solde_deb']),0,0,'R',$fill);
$pdf->Cell(25,6,nbm($value['solde_cred']),0,0,'R',$fill);
$pdf->Ln();
$pdf->write_cell(25,6,nbm($value['sum_deb']),0,0,'R',$fill);
$pdf->write_cell(25,6,nbm($value['sum_cred']),0,0,'R',$fill);
$pdf->write_cell(25,6,nbm($value['solde_deb']),0,0,'R',$fill);
$pdf->write_cell(25,6,nbm($value['solde_cred']),0,0,'R',$fill);
$pdf->line_new();
$tp_deb=bcadd($tp_deb,$value['sum_deb']);
$tp_cred=bcadd($tp_cred,$value['sum_cred']);
$tp_sold=bcadd($tp_sold,$value['solde_deb']);
@ -238,19 +238,19 @@ if (! empty($array))
if ( ${'lvl'.$ind.'_old'} != substr($r['poste'],0,$ind))
{
$pdf->SetFont('DejaVu','B',7);
$pdf->Cell(30,6,"Totaux ".$ind);
$pdf->Cell(60,6,${'lvl'.$ind.'_old'});
$pdf->write_cell(30,6,"Totaux ".$ind);
$pdf->write_cell(60,6,${'lvl'.$ind.'_old'});
if ($previous == 1 ) {
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['sum_deb_previous']),0,0,'R');
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['sum_cred_previous']),0,0,'R');
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['solde_deb_previous']),0,0,'R');
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['solde_cred_previous']),0,0,'R');
$pdf->write_cell(22,6,nbm(${'nlvl'.$ind}['sum_deb_previous']),0,0,'R');
$pdf->write_cell(22,6,nbm(${'nlvl'.$ind}['sum_cred_previous']),0,0,'R');
$pdf->write_cell(22,6,nbm(${'nlvl'.$ind}['solde_deb_previous']),0,0,'R');
$pdf->write_cell(22,6,nbm(${'nlvl'.$ind}['solde_cred_previous']),0,0,'R');
}
$pdf->Cell(25,6,nbm(${'nlvl'.$ind}['sum_deb']),0,0,'R');
$pdf->Cell(25,6,nbm(${'nlvl'.$ind}['sum_cred']),0,0,'R');
$pdf->Cell(25,6,nbm(${'nlvl'.$ind}['solde_deb']),0,0,'R');
$pdf->Cell(25,6,nbm(${'nlvl'.$ind}['solde_cred']),0,0,'R');
$pdf->Ln();
$pdf->write_cell(25,6,nbm(${'nlvl'.$ind}['sum_deb']),0,0,'R');
$pdf->write_cell(25,6,nbm(${'nlvl'.$ind}['sum_cred']),0,0,'R');
$pdf->write_cell(25,6,nbm(${'nlvl'.$ind}['solde_deb']),0,0,'R');
$pdf->write_cell(25,6,nbm(${'nlvl'.$ind}['solde_cred']),0,0,'R');
$pdf->line_new();
$pdf->SetFont('DejaVuCond','',7);
${'lvl'.$ind.'_old'}=substr($r['poste'],0,$ind);
foreach($a_sum as $a)
@ -262,18 +262,18 @@ if (! empty($array))
// Totaux
$pdf->SetFont('DejaVuCond','B',8);
$pdf->Cell(90,6,$r['label']);
$pdf->write_cell(90,6,$r['label']);
if ($previous == 1 ) {
$pdf->Cell(22,6,nbm($tp_deb_previous),'T',0,'R',0);
$pdf->Cell(22,6,nbm($tp_cred_previous),'T',0,'R',0);
$pdf->Cell(22,6,nbm($tp_sold_previous),'T',0,'R',0);
$pdf->Cell(22,6,nbm($tp_solc_previous),'T',0,'R',0);
$pdf->write_cell(22,6,nbm($tp_deb_previous),'T',0,'R',0);
$pdf->write_cell(22,6,nbm($tp_cred_previous),'T',0,'R',0);
$pdf->write_cell(22,6,nbm($tp_sold_previous),'T',0,'R',0);
$pdf->write_cell(22,6,nbm($tp_solc_previous),'T',0,'R',0);
}
$pdf->Cell(25,6,nbm($tp_deb),'T',0,'R',0);
$pdf->Cell(25,6,nbm($tp_cred),'T',0,'R',0);
$pdf->Cell(25,6,nbm($tp_sold),'T',0,'R',0);
$pdf->Cell(25,6,nbm($tp_solc),'T',0,'R',0);
$pdf->Ln();
$pdf->write_cell(25,6,nbm($tp_deb),'T',0,'R',0);
$pdf->write_cell(25,6,nbm($tp_cred),'T',0,'R',0);
$pdf->write_cell(25,6,nbm($tp_sold),'T',0,'R',0);
$pdf->write_cell(25,6,nbm($tp_solc),'T',0,'R',0);
$pdf->line_new();
} /** empty */
$fDate=date('dmy-Hi');

View file

@ -56,7 +56,7 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5)
$fd=new Fiche_Def($cn,$_REQUEST['cat']);
if ($allcard==1 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) == false )
{
$pdf->Cell(0,10, "Cette catégorie n'ayant pas de poste comptable n'a pas de balance");
$pdf->write_cell(0,10, "Cette catégorie n'ayant pas de poste comptable n'a pas de balance");
//Save PDF to file
$fDate=date('dmy-Hi');
$pdf->Output("category-$fDate.pdf", 'D');
@ -74,7 +74,7 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5)
if ( $allcard==0 && empty($afiche))
{
$pdf->Cell(0,10, "Aucune fiche trouvée");//Save PDF to file
$pdf->write_cell(0,10, "Aucune fiche trouvée");//Save PDF to file
$fDate=date('dmy-Hi');
$pdf->Output("category-$fDate.pdf", 'D');
exit;
@ -84,16 +84,16 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5)
$aCard=$cn->get_array("select f_id,ad_value from fiche join fiche_Detail using (f_id) where ad_id=1 and fd_id=$1 order by 2 ",array($afiche[$e]['fd_id']));
$name=$cn->get_value('select fd_label from fiche_def where fd_id=$1',array($afiche[$e]['fd_id']));
$pdf->SetFont('DejaVu','BI',14);
$pdf->Cell(0,8,$name,0,1,'C');
$pdf->write_cell(0,8,$name,0,1,'C');
$pdf->SetFont('DejaVuCond','',7);
$pdf->LongLine(30,7,'Quick Code',0,'L',0);
$pdf->LongLine(80,7,'Libellé',0,'L',0);
$pdf->Cell(20,7,'Débit',0,0,'R',0);
$pdf->Cell(20,7,'Crédit',0,0,'R',0);
$pdf->Cell(20,7,'Solde',0,0,'R',0);
$pdf->Cell(20,7,'D/C',0,0,'C',0);
$pdf->Ln();
$pdf->write_cell(20,7,'Débit',0,0,'R',0);
$pdf->write_cell(20,7,'Crédit',0,0,'R',0);
$pdf->write_cell(20,7,'Solde',0,0,'R',0);
$pdf->write_cell(20,7,'D/C',0,0,'C',0);
$pdf->line_new();
if (empty($aCard)) continue;
@ -129,13 +129,13 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5)
$sum_deb=bcadd($sum_deb,$solde['debit']);
$sum_solde=bcsub($sum_deb,$sum_cred);
$pdf->Cell(30,7,$oCard->strAttribut(ATTR_DEF_QUICKCODE),0,0,'L',$fill);
$pdf->write_cell(30,7,$oCard->strAttribut(ATTR_DEF_QUICKCODE),0,0,'L',$fill);
$pdf->LongLine(80,7,$oCard->strAttribut(ATTR_DEF_NAME)." (".$oCard->strAttribut(ATTR_DEF_ACCOUNT).")",0,'L',$fill);
$pdf->Cell(20,7,nbm($solde['debit']),0,0,'R',$fill);
$pdf->Cell(20,7,nbm($solde['credit']),0,0,'R',$fill);
$pdf->Cell(20,7,nbm(abs($solde['solde'])),0,0,'R',$fill);
$pdf->Cell(20,7,$side,0,0,'C',$fill);
$pdf->Ln();
$pdf->write_cell(20,7,nbm($solde['debit']),0,0,'R',$fill);
$pdf->write_cell(20,7,nbm($solde['credit']),0,0,'R',$fill);
$pdf->write_cell(20,7,nbm(abs($solde['solde'])),0,0,'R',$fill);
$pdf->write_cell(20,7,$side,0,0,'C',$fill);
$pdf->line_new();
}
if ( $idx % 2 == 0 )
{
@ -149,11 +149,11 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5)
}
$idx++;
// Sum by category
$pdf->Cell(30,7,"",0,0,'L',$fill);
$pdf->Cell(80,7,_("Totaux"),0,0,'L',$fill);
$pdf->Cell(20,7,nbm($sum_deb),0,0,'R',$fill);
$pdf->Cell(20,7,nbm($sum_cred),0,0,'R',$fill);
$pdf->Cell(20,7,nbm(abs($sum_solde)),0,0,'R',$fill);
$pdf->write_cell(30,7,"",0,0,'L',$fill);
$pdf->write_cell(80,7,_("Totaux"),0,0,'L',$fill);
$pdf->write_cell(20,7,nbm($sum_deb),0,0,'R',$fill);
$pdf->write_cell(20,7,nbm($sum_cred),0,0,'R',$fill);
$pdf->write_cell(20,7,nbm(abs($sum_solde)),0,0,'R',$fill);
$side=" = ";
if ( $sum_solde > 0 )
{
@ -164,8 +164,8 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5)
$side='Cred.';
}
$pdf->Cell(20,7,$side,0,0,'C',$fill);
$pdf->Ln();
$pdf->write_cell(20,7,$side,0,0,'C',$fill);
$pdf->line_new();
}
}
else
@ -226,19 +226,19 @@ else
continue;
$pdf->SetFont('DejaVuCond', '', 10);
$fiche = new Fiche($cn, $row_fiche['f_id']);
$pdf->Cell(0, 7, $fiche->strAttribut(ATTR_DEF_NAME)." [".$fiche->strAttribut(ATTR_DEF_QUICKCODE).":".$fiche->strAttribut(ATTR_DEF_ACCOUNT)."]", 1, 'C');
$pdf->write_cell(0, 7, $fiche->strAttribut(ATTR_DEF_NAME)." [".$fiche->strAttribut(ATTR_DEF_QUICKCODE).":".$fiche->strAttribut(ATTR_DEF_ACCOUNT)."]", 1, 'C');
$pdf->SetFont('DejaVuCond', '', 7);
$pdf->Ln();
$pdf->Cell($tab[0], 7, 'Date');
$pdf->Cell($tab[1], 7, 'ref');
$pdf->Cell($tab[2], 7, 'Internal');
$pdf->Cell($tab[3], 7, 'Comm');
$pdf->Cell($tab[4], 7, 'Montant', 0, 0, 'C');
$pdf->Cell($tab[5], 7, 'Prog.', 0, 0, 'R');
$pdf->Cell($tab[6], 7, 'Let.', 0, 0, 'R');
$pdf->Cell($tab[7], 7, 'Diff. Let.', 0, 0, 'R');
$pdf->ln();
$pdf->line_new();
$pdf->write_cell($tab[0], 7, 'Date');
$pdf->write_cell($tab[1], 7, 'ref');
$pdf->write_cell($tab[2], 7, 'Internal');
$pdf->write_cell($tab[3], 7, 'Comm');
$pdf->write_cell($tab[4], 7, 'Montant', 0, 0, 'C');
$pdf->write_cell($tab[5], 7, 'Prog.', 0, 0, 'R');
$pdf->write_cell($tab[6], 7, 'Let.', 0, 0, 'R');
$pdf->write_cell($tab[7], 7, 'Diff. Let.', 0, 0, 'R');
$pdf->line_new();
$amount_deb = 0;
$amount_cred = 0;
@ -260,35 +260,35 @@ else
$str_date = shrink_date($row['j_date_fmt']);
$pdf->LongLine($tab[0], 4, $str_date, 0, $align[0], $fill);
$pdf->Cell($tab[1], 4, $row['jr_pj_number'], 0, 0, $align[1], $fill);
$pdf->write_cell($tab[1], 4, $row['jr_pj_number'], 0, 0, $align[1], $fill);
$pdf->LongLine($tab[2], 4, $row['jr_internal'], 0, $align[1], $fill);
$pdf->LongLine($tab[3], 4, $row['jr_comment'], 0, $align[2], $fill);
if ($row['j_debit'] == 't')
{
$prog=bcadd($prog,$row['j_montant']);
$pdf->Cell($tab[4], 4, sprintf('%s D', nbm($row['j_montant'])), 0, 0, $align[4], $fill);
$pdf->write_cell($tab[4], 4, sprintf('%s D', nbm($row['j_montant'])), 0, 0, $align[4], $fill);
$amount_deb+=$row['j_montant'];
$str_prog=sprintf("%s %s",nbm(abs($prog)),$fic->get_amount_side($prog));
$pdf->Cell($tab[5], 4, $str_prog, 0, 0, $align[5], $fill);
$pdf->write_cell($tab[5], 4, $str_prog, 0, 0, $align[5], $fill);
}
else
{
$prog=bcsub($prog,$row['j_montant']);
$pdf->Cell($tab[4], 4, sprintf('%s C', nbm($row['j_montant'])), 0, 0, $align[4], $fill);
$pdf->write_cell($tab[4], 4, sprintf('%s C', nbm($row['j_montant'])), 0, 0, $align[4], $fill);
$amount_cred+=$row['j_montant'];
$str_prog=sprintf("%s %s",nbm(abs($prog)),$fic->get_amount_side($prog));
$pdf->Cell($tab[5], 4, $str_prog, 0, 0, $align[5], $fill);
$pdf->write_cell($tab[5], 4, $str_prog, 0, 0, $align[5], $fill);
}
if ($row['letter'] != -1)
{
$pdf->Cell($tab[6], 4, strtoupper(base_convert($row['letter'],10,36)), 0, 0, $align[6], $fill);
$pdf->write_cell($tab[6], 4, strtoupper(base_convert($row['letter'],10,36)), 0, 0, $align[6], $fill);
// get sum for this lettering
$pdf->Cell($tab[7], 4, sprintf('%s', nbm($row['letter_diff'])), '0', '0', $align[7], $fill);
$pdf->write_cell($tab[7], 4, sprintf('%s', nbm($row['letter_diff'])), '0', '0', $align[7], $fill);
}
else
$pdf->Cell($tab[6], 4, "", 0, 0, 'R', $fill);
$pdf->Ln();
$pdf->write_cell($tab[6], 4, "", 0, 0, 'R', $fill);
$pdf->line_new();
}
$pdf->SetFillColor(0, 0, 0);
$pdf->SetFont('DejaVuCond', 'B', 8);
@ -300,14 +300,14 @@ else
$s = 'solde crediteur';
$solde = sprintf('%s : %s', $s, nbm(abs(round($amount_cred - $amount_deb, 2))));
$pdf->Cell(0, 6, $debit, 0, 0, 'R');
$pdf->ln(4);
$pdf->Cell(0, 6, $credit, 0, 0, 'R');
$pdf->ln(4);
$pdf->Cell(0, 6, $solde, 0, 0, 'R');
$pdf->ln(4);
$pdf->write_cell(0, 6, $debit, 0, 0, 'R');
$pdf->line_new(4);
$pdf->write_cell(0, 6, $credit, 0, 0, 'R');
$pdf->line_new(4);
$pdf->write_cell(0, 6, $solde, 0, 0, 'R');
$pdf->line_new(4);
$pdf->Ln();
$pdf->line_new();
}
}
}

View file

@ -60,29 +60,29 @@ $align=array('L','C','C','L','R','R','R','R');
$Libelle=sprintf("(%s) %s [ %s ]",$Fiche->id,$Fiche->getName(),$Fiche->get_quick_code());
$pdf->SetFont('DejaVu','',10);
$pdf->Cell(0,8,$Libelle,1,0,'C');
$pdf->Ln();
$pdf->write_cell(0,8,$Libelle,1,0,'C');
$pdf->line_new();
$pdf->SetFont('DejaVuCond','',8);
$l=0;
$pdf->Cell($size[$l],6,'Date',0,0,'L');
$pdf->write_cell($size[$l],6,'Date',0,0,'L');
$l++;
$pdf->Cell($size[$l],6,'Ref',0,0,'C');
$pdf->write_cell($size[$l],6,'Ref',0,0,'C');
$l++;
$pdf->Cell($size[$l],6,'Journal',0,0,'C');
$pdf->write_cell($size[$l],6,'Journal',0,0,'C');
$l++;
$pdf->Cell($size[$l],6,'Libellé',0,0,'L');
$pdf->write_cell($size[$l],6,'Libellé',0,0,'L');
$l++;
$pdf->Cell($size[$l],6,'Let',0,0,'R');
$pdf->write_cell($size[$l],6,'Let',0,0,'R');
$l++;
$pdf->Cell($size[$l],6,'Debit',0,0,'R');
$pdf->write_cell($size[$l],6,'Debit',0,0,'R');
$l++;
$pdf->Cell($size[$l],6,'Credit',0,0,'R');
$pdf->write_cell($size[$l],6,'Credit',0,0,'R');
$l++;
$pdf->Cell($size[$l],6,'Prog',0,0,'R');
$pdf->write_cell($size[$l],6,'Prog',0,0,'R');
$l++;
$pdf->ln();
$pdf->line_new();
$tot_deb=0;
$tot_cred=0;
$progress=0;
@ -113,12 +113,12 @@ for ($e=0;$e<count($array);$e++)
$pdf->SetFont('DejaVu','B',8);
$pdf->LongLine(15,6,_('totaux'),0,'L');
$pdf->Cell(15,6,$current_exercice,0,0,'L');
$pdf->write_cell(15,6,$current_exercice,0,0,'L');
$pdf->LongLine(40,6,$solde,0,'L');
$pdf->Cell(40,6,$str_debit,0,0,'R');
$pdf->Cell(40,6,$str_credit,0,0,'R');
$pdf->Cell(40,6,$str_diff_solde,0,0,'R');
$pdf->Ln();
$pdf->write_cell(40,6,$str_debit,0,0,'R');
$pdf->write_cell(40,6,$str_credit,0,0,'R');
$pdf->write_cell(40,6,$str_diff_solde,0,0,'R');
$pdf->line_new();
/*
* reset total and current_exercice
*/
@ -132,15 +132,15 @@ for ($e=0;$e<count($array);$e++)
$progress=bcadd($progress,$delta);
$date=shrink_date($row['j_date_fmt']);
$pdf->Cell($size[$l],6,$date,0,0,$align[$l]);
$pdf->write_cell($size[$l],6,$date,0,0,$align[$l]);
$l++;
if ( $row['jr_pj_number'] == '')
$pdf->Cell($size[$l],6,"",0,0,$align[$l]);
$pdf->write_cell($size[$l],6,"",0,0,$align[$l]);
else
$pdf->Cell($size[$l],6,$row['jr_pj_number'],0,0,$align[$l]);
$pdf->write_cell($size[$l],6,$row['jr_pj_number'],0,0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,mb_substr($row['jrn_def_code'],0,14),0,0,$align[$l]);
$pdf->write_cell($size[$l],6,mb_substr($row['jrn_def_code'],0,14),0,0,$align[$l]);
$l++;
$pdf->LongLine($size[$l],6,($row['description'].'('.$row['jr_internal'].")"),0,$align[$l]);
@ -153,7 +153,7 @@ for ($e=0;$e<count($array);$e++)
$l++;
$pdf->LongLine($size[$l],6,(sprintf('% 12.2f',abs($progress))),0,$align[$l]);
$l++;
$pdf->ln();
$pdf->line_new();
$tot_deb=bcadd($tot_deb,$row['deb_montant']);
$tot_cred=bcadd($tot_cred,$row['cred_montant']);
/* -------------------------------------- */
@ -167,11 +167,11 @@ for ($e=0;$e<count($array);$e++)
for ($f=0;$f<count($a_detail);$f++)
{
$l=0;
$pdf->Cell($size[$l],6,'',0,0,$align[$l]);
$pdf->write_cell($size[$l],6,'',0,0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,$a_detail[$f]['j_qcode'],0,0,'L');
$pdf->write_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');
$pdf->write_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'];
@ -181,19 +181,19 @@ for ($e=0;$e<count($array);$e++)
$lib=$cn->get_value('select ad_value from fiche_detail where ad_id=$1 and f_id=$2',
array(ATTR_DEF_NAME,$f_id));
}
$pdf->Cell($size[$l],6,$lib,0,0,$align[$l]);
$pdf->write_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]);
$pdf->write_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]);
$pdf->write_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]);
$pdf->write_cell($size[$l],6,(sprintf('% 12.2f',$cred)),0,0,$align[$l]);
$l++;
$pdf->ln();
$pdf->line_new();
}
}
@ -214,15 +214,15 @@ $str_diff_solde=sprintf("%12.2f €",$diff_solde);
$pdf->SetFont('DejaVu','B',8);
$pdf->Cell(160,5,'Débit',0,0,'R');
$pdf->Cell(30,5,$str_debit,0,0,'R');
$pdf->Ln();
$pdf->Cell(160,5,'Crédit',0,0,'R');
$pdf->Cell(30,5,$str_credit,0,0,'R');
$pdf->Ln();
$pdf->Cell(160,5,'Solde '.$solde,0,0,'R');
$pdf->Cell(30,5,$str_diff_solde,0,0,'R');
$pdf->Ln();
$pdf->write_cell(160,5,'Débit',0,0,'R');
$pdf->write_cell(30,5,$str_debit,0,0,'R');
$pdf->line_new();
$pdf->write_cell(160,5,'Crédit',0,0,'R');
$pdf->write_cell(30,5,$str_credit,0,0,'R');
$pdf->line_new();
$pdf->write_cell(160,5,'Solde '.$solde,0,0,'R');
$pdf->write_cell(30,5,$str_diff_solde,0,0,'R');
$pdf->line_new();
$fDate=date('dmy-Hi');
$pdf->Output('fiche-'.$fDate.'.pdf','D');

View file

@ -44,7 +44,7 @@ $pdf->AliasNbPages();
$pdf->AddPage();
$name=$cn->get_value('select fd_label from fiche_def where fd_id=$1',array($_GET['cat']));
$pdf->SetFont('DejaVu','BI',14);
$pdf->Cell(0,8,$name,0,1,'C');
$pdf->write_cell(0,8,$name,0,1,'C');
$pdf->SetTitle($name,1);
$pdf->SetAuthor('NOALYSS');
/* balance */
@ -53,7 +53,7 @@ if ( $_GET['histo'] == 4 )
$fd=new Fiche_Def($cn,$_REQUEST['cat']);
if ( $fd->hasAttribute(ATTR_DEF_ACCOUNT) == false )
{
$pdf->Cell(0,10, "Cette catégorie n'ayant pas de poste comptable n'a pas de balance");
$pdf->write_cell(0,10, "Cette catégorie n'ayant pas de poste comptable n'a pas de balance");
//Save PDF to file
$fDate=date('dmy-Hi');
$pdf->Output("category-$fDate.pdf", 'D');
@ -63,19 +63,19 @@ if ( $_GET['histo'] == 4 )
if ( empty($aCard))
{
$pdf->Cell(0,10, "Aucune fiche trouvée");//Save PDF to file
$pdf->write_cell(0,10, "Aucune fiche trouvée");//Save PDF to file
$fDate=date('dmy-Hi');
$pdf->Output("category-$fDate.pdf", 'D');
exit;
}
$pdf->SetFont('DejaVuCond','',7);
$pdf->Cell(30,7,'Quick Code',0,0,'L',0);
$pdf->Cell(80,7,'Libellé',0,0,'L',0);
$pdf->Cell(20,7,'Débit',0,0,'R',0);
$pdf->Cell(20,7,'Crédit',0,0,'R',0);
$pdf->Cell(20,7,'Solde',0,0,'R',0);
$pdf->Cell(20,7,'D/C',0,0,'C',0);
$pdf->Ln();
$pdf->write_cell(30,7,'Quick Code',0,0,'L',0);
$pdf->write_cell(80,7,'Libellé',0,0,'L',0);
$pdf->write_cell(20,7,'Débit',0,0,'R',0);
$pdf->write_cell(20,7,'Crédit',0,0,'R',0);
$pdf->write_cell(20,7,'Solde',0,0,'R',0);
$pdf->write_cell(20,7,'D/C',0,0,'C',0);
$pdf->line_new();
$idx=0;
for ($i=0;$i < count($aCard);$i++)
{
@ -98,13 +98,13 @@ if ( $_GET['histo'] == 4 )
}
$idx++;
$pdf->Cell(30,7,$oCard->strAttribut(ATTR_DEF_QUICKCODE),0,0,'L',$fill);
$pdf->Cell(80,7,$oCard->strAttribut(ATTR_DEF_NAME),0,0,'L',$fill);
$pdf->Cell(20,7,sprintf('%.02f',$solde['debit']),0,0,'R',$fill);
$pdf->Cell(20,7,sprintf('%.02f',$solde['credit']),0,0,'R',$fill);
$pdf->Cell(20,7,sprintf('%.02f',abs($solde['solde'])),0,0,'R',$fill);
$pdf->Cell(20,7,(($solde['solde']<0)?'CRED':'DEB'),0,0,'C',$fill);
$pdf->Ln();
$pdf->write_cell(30,7,$oCard->strAttribut(ATTR_DEF_QUICKCODE),0,0,'L',$fill);
$pdf->write_cell(80,7,$oCard->strAttribut(ATTR_DEF_NAME),0,0,'L',$fill);
$pdf->write_cell(20,7,sprintf('%.02f',$solde['debit']),0,0,'R',$fill);
$pdf->write_cell(20,7,sprintf('%.02f',$solde['credit']),0,0,'R',$fill);
$pdf->write_cell(20,7,sprintf('%.02f',abs($solde['solde'])),0,0,'R',$fill);
$pdf->write_cell(20,7,(($solde['solde']<0)?'CRED':'DEB'),0,0,'C',$fill);
$pdf->line_new();
}
}
else
@ -147,18 +147,18 @@ else
if (count($letter->content) == 0 ) continue;
$pdf->SetFont('DejaVuCond','',10);
$fiche=new Fiche($cn,$row_fiche['f_id']);
$pdf->Cell(0,7,$fiche->strAttribut(ATTR_DEF_NAME),1,1,'C');
$pdf->write_cell(0,7,$fiche->strAttribut(ATTR_DEF_NAME),1,1,'C');
$pdf->SetFont('DejaVuCond','',7);
$pdf->Cell($tab[0],7,'Date');
$pdf->Cell($tab[1],7,'ref');
$pdf->Cell($tab[1],7,'Int.');
$pdf->Cell($tab[2],7,'Comm');
$pdf->Cell(40,7,'Montant',0,0,'C');
$pdf->Cell($tab[5],7,'Let.',0,0,'R');
$pdf->Cell($tab[6],7,'Som. Let.',0,0,'R');
$pdf->ln();
$pdf->write_cell($tab[0],7,'Date');
$pdf->write_cell($tab[1],7,'ref');
$pdf->write_cell($tab[1],7,'Int.');
$pdf->write_cell($tab[2],7,'Comm');
$pdf->write_cell(40,7,'Montant',0,0,'C');
$pdf->write_cell($tab[5],7,'Let.',0,0,'R');
$pdf->write_cell($tab[6],7,'Som. Let.',0,0,'R');
$pdf->line_new();
$amount_deb=0;
$amount_cred=0;
@ -178,35 +178,35 @@ else
$row=$letter->content[$i];
$str_date=shrink_date($row['j_date_fmt']);
$pdf->Cell($tab[0],4,$str_date,0,0,$align[0],$fill);
$pdf->Cell($tab[1],4,$row['jr_pj_number'],0,0,$align[1],$fill);
$pdf->Cell($tab[1],4,$row['jr_internal'],0,0,$align[1],$fill);
$pdf->Cell($tab[2],4,$row['jr_comment'],0,0,$align[2],$fill);
$pdf->write_cell($tab[0],4,$str_date,0,0,$align[0],$fill);
$pdf->write_cell($tab[1],4,$row['jr_pj_number'],0,0,$align[1],$fill);
$pdf->write_cell($tab[1],4,$row['jr_internal'],0,0,$align[1],$fill);
$pdf->write_cell($tab[2],4,$row['jr_comment'],0,0,$align[2],$fill);
if ( $row['j_debit'] == 't')
{
$pdf->Cell($tab[3],4,sprintf('%10.2f',$row['j_montant']),0,0,$align[4],$fill);
$pdf->write_cell($tab[3],4,sprintf('%10.2f',$row['j_montant']),0,0,$align[4],$fill);
$amount_deb+=$row['j_montant'];
$pdf->Cell($tab[4],4,"",0,0,'C',$fill);
$pdf->write_cell($tab[4],4,"",0,0,'C',$fill);
}
else
{
$pdf->Cell($tab[3],4,"",0,0,'C',$fill);
$pdf->Cell($tab[4],4,sprintf('%10.2f',$row['j_montant']),0,0,$align[4],$fill);
$pdf->write_cell($tab[3],4,"",0,0,'C',$fill);
$pdf->write_cell($tab[4],4,sprintf('%10.2f',$row['j_montant']),0,0,$align[4],$fill);
$amount_cred+=$row['j_montant'];
}
if ($row['letter'] != -1 )
{
$pdf->Cell($tab[5],4,strtoupper(base_convert($row['letter'],10,36)),0,0,$align[5],$fill);
$pdf->write_cell($tab[5],4,strtoupper(base_convert($row['letter'],10,36)),0,0,$align[5],$fill);
// get sum for this lettering
$sql="select sum(j_montant) from jrnx where j_debit=$1 and j_id in ".
" (select j_id from jnt_letter join letter_deb using (jl_id) where jl_id=$2 union ".
" select j_id from jnt_letter join letter_cred using (jl_id) where jl_id=$3)";
$sum=$cn->get_value($sql,array($row['j_debit'],$row['letter'],$row['letter']));
$pdf->Cell($tab[6],4,sprintf('%.2f',$sum),'0','0','R',$fill);
$pdf->write_cell($tab[6],4,sprintf('%.2f',$sum),'0','0','R',$fill);
}
else
$pdf->Cell($tab[5],4,"",0,0,'R',$fill);
$pdf->Ln();
$pdf->write_cell($tab[5],4,"",0,0,'R',$fill);
$pdf->line_new();
}
$pdf->SetFillColor(0,0,0);
$pdf->SetFont('DejaVuCond','B',8);
@ -216,14 +216,14 @@ else
else $s='solde crediteur';
$solde =sprintf('%s : % 12.2f',$s,(abs(round($amount_cred-$amount_deb,2))));
$pdf->Cell(0,6,$debit,0,0,'R');
$pdf->ln(4);
$pdf->Cell(0,6,$credit,0,0,'R');
$pdf->ln(4);
$pdf->Cell(0,6,$solde,0,0,'R');
$pdf->ln(4);
$pdf->write_cell(0,6,$debit,0,0,'R');
$pdf->line_new(4);
$pdf->write_cell(0,6,$credit,0,0,'R');
$pdf->line_new(4);
$pdf->write_cell(0,6,$solde,0,0,'R');
$pdf->line_new(4);
$pdf->Ln();
$pdf->line_new();
}
}
//Save PDF to file

View file

@ -98,13 +98,13 @@ if ( $step == 0 )
{
$periode=sprintf("Date %s jusque %s",$_GET['from_date'],$_GET['to_date']);
}
$pdf->Cell(0,7,$periode,'B');
$pdf->Ln();
$pdf->write_cell(0,7,$periode,'B');
$pdf->line_new();
for ($i=0;$i<count($array);$i++)
{
$pdf->Cell(160,6,$array[$i]['desc']);
$pdf->Cell(30,6,sprintf('% 12.2f',$array[$i]['montant']),0,0,'R');
$pdf->Ln();
$pdf->write_cell(160,6,$array[$i]['desc']);
$pdf->write_cell(30,6,sprintf('% 12.2f',$array[$i]['montant']),0,0,'R');
$pdf->line_new();
}
}
else
@ -112,14 +112,14 @@ else
$a=0;
foreach ($array as $e)
{
$pdf->Cell(0,7,$periode_name[$a],'B');
$pdf->Ln();
$pdf->write_cell(0,7,$periode_name[$a],'B');
$pdf->line_new();
$a++;
for ($i=0;$i<count($e);$i++)
{
$pdf->Cell(160,6,$e[$i]['desc']);
$pdf->Cell(30,6,sprintf('% 12.2f',$e[$i]['montant']),0,0,'R');
$pdf->Ln();
$pdf->write_cell(160,6,$e[$i]['desc']);
$pdf->write_cell(30,6,sprintf('% 12.2f',$e[$i]['montant']),0,0,'R');
$pdf->line_new();
}
}
}

View file

@ -105,12 +105,12 @@ foreach ($a_poste as $poste)
$pdf->SetFont('DejaVuCond','',10);
$Libelle=sprintf("%s - %s ",$Poste->id,$Poste->get_name());
$pdf->Cell(0, 7, $Libelle, 1, 1, 'C');
$pdf->write_cell(0, 7, $Libelle, 1, 1, 'C');
$pdf->SetFont('DejaVuCond','',6);
for($i=0;$i<count($header);$i++)
$pdf->Cell($width[$i], 4, $header[$i], 0, 0, $lor[$i]);
$pdf->Ln();
$pdf->write_cell($width[$i], 4, $header[$i], 0, 0, $lor[$i]);
$pdf->line_new();
$pdf->SetFont('DejaVuCond','',7);
@ -143,23 +143,23 @@ foreach ($a_poste as $poste)
$pdf->SetFont('DejaVuCond','B',8);
$i=0;
$pdf->Cell($width[$i], 6, $current_exercice, 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, $current_exercice, 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, '', 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, '', 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, '', 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, 'Total du compte '.$Poste->id, 0, 0, 'R');
$pdf->write_cell($width[$i], 6, 'Total du compte '.$Poste->id, 0, 0, 'R');
$i++;
$pdf->Cell($width[$i], 6, ($solde_d > 0 ? nbm($solde_d) : ''), 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, ($solde_d > 0 ? nbm($solde_d) : ''), 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, ($solde_c > 0 ? nbm( $solde_c) : ''), 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, ($solde_c > 0 ? nbm( $solde_c) : ''), 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, nbm(abs($solde_c-$solde_d)), 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, nbm(abs($solde_c-$solde_d)), 0, 0, $lor[$i]);
$i++;
$pdf->Cell(5, 6, ($solde_c > $solde_d ? 'C' : 'D'), 0, 0, 'L');
$pdf->write_cell(5, 6, ($solde_c > $solde_d ? 'C' : 'D'), 0, 0, 'L');
/*
* reset total and current_exercice
*/
@ -167,7 +167,7 @@ foreach ($a_poste as $poste)
$solde = 0.0;
$solde_d = 0.0;
$solde_c = 0.0;
$pdf->Ln();
$pdf->line_new();
$pdf->SetFont('DejaVuCond','',7);
}
@ -191,19 +191,20 @@ foreach ($a_poste as $poste)
$i++;
/* limit set to 40 for the substring */
$triple_point = (mb_strlen($detail['description']) > 40 ) ? '...':'';
$pdf->LongLine($width[$i], 6, mb_substr($detail['description'],0,40).$triple_point, 0,$lor[$i]);
// $pdf->LongLine($width[$i], 6, mb_substr($detail['description'],0,40).$triple_point, 0,$lor[$i]);
$pdf->LongLine($width[$i], 6,$detail['description'], 0,$lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, $detail['jr_pj_number'], 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, $detail['jr_pj_number'], 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, ($detail['letter']!=-1)?$detail['letter']:'', 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, ($detail['letter']!=-1)?$detail['letter']:'', 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, ($detail['deb_montant'] > 0 ? nbm( $detail['deb_montant']) : ''), 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, ($detail['deb_montant'] > 0 ? nbm( $detail['deb_montant']) : ''), 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, ($detail['cred_montant'] > 0 ? nbm( $detail['cred_montant']) : ''), 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, ($detail['cred_montant'] > 0 ? nbm( $detail['cred_montant']) : ''), 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, nbm(abs( $solde)).$side, 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, nbm(abs( $solde)).$side, 0, 0, $lor[$i]);
$i++;
$pdf->Ln();
$pdf->line_new();
}
@ -211,26 +212,25 @@ foreach ($a_poste as $poste)
$pdf->SetFont('DejaVuCond','B',8);
$i = 0;
$pdf->Cell($width[$i], 6, $current_exercice, 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, $current_exercice, 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, '', 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, '', 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, '', 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, 'Total du compte '.$Poste->id, 0, 0, 'R');
$pdf->write_cell($width[$i], 6, 'Total du compte '.$Poste->id, 0, 0, 'R');
$i++;
$pdf->Cell($width[$i], 6, ($solde_d > 0 ? nbm($solde_d) : ''), 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, ($solde_d > 0 ? nbm($solde_d) : ''), 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, ($solde_c > 0 ? nbm( $solde_c) : ''), 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, ($solde_c > 0 ? nbm( $solde_c) : ''), 0, 0, $lor[$i]);
$i++;
$pdf->Cell($width[$i], 6, nbm(abs($solde_c-$solde_d)), 0, 0, $lor[$i]);
$pdf->write_cell($width[$i], 6, nbm(abs($solde_c-$solde_d)), 0, 0, $lor[$i]);
$i++;
$pdf->Cell(5, 6, ($solde_c > $solde_d ? 'C' : 'D'), 0, 0, 'L');
$pdf->write_cell(5, 6, ($solde_c > $solde_d ? 'C' : 'D'), 0, 0, 'L');
$pdf->Ln();
$pdf->Ln();
$pdf->line_new();
}
//Save PDF to file

View file

@ -75,28 +75,28 @@ foreach ($a_poste as $poste)
}
$Libelle=sprintf("(%s) %s ",$Poste->id,$Poste->get_name());
$pdf->SetFont('DejaVuCond','',10);
$pdf->Cell(0,8,$Libelle,1,0,'C');
$pdf->Ln();
$pdf->write_cell(0,8,$Libelle,1,0,'C');
$pdf->line_new();
$pdf->SetFont('DejaVuCond','',8);
$l=0;
$pdf->Cell($size[$l],6,'Date',0,0,'L');
$pdf->write_cell($size[$l],6,'Date',0,0,'L');
$l++;
$pdf->Cell($size[$l],6,'Ref',0,0,'C');
$pdf->write_cell($size[$l],6,'Ref',0,0,'C');
$l++;
$pdf->Cell($size[$l],6,'Journal',0,0,'C');
$pdf->write_cell($size[$l],6,'Journal',0,0,'C');
$l++;
$pdf->LongLine($size[$l],6,'Libellé',0,'L');
$l++;
$pdf->Cell($size[$l],6,'Let',0,0,'R');
$pdf->write_cell($size[$l],6,'Let',0,0,'R');
$l++;
$pdf->Cell($size[$l],6,'Debit',0,0,'R');
$pdf->write_cell($size[$l],6,'Debit',0,0,'R');
$l++;
$pdf->Cell($size[$l],6,'Credit',0,0,'R');
$pdf->write_cell($size[$l],6,'Credit',0,0,'R');
$l++;
$pdf->Cell($size[$l],6,'Prog',0,0,'R');
$pdf->write_cell($size[$l],6,'Prog',0,0,'R');
$l++;
$pdf->ln();
$pdf->line_new();
$tot_deb=0;
$tot_cred=0;
$prog=0;
@ -126,13 +126,13 @@ foreach ($a_poste as $poste)
$str_diff_solde=sprintf("%12.2f €",$diff_solde);
$pdf->SetFont('DejaVu','B',8);
$pdf->Cell(15,6,_('totaux'),0,0,'L');
$pdf->Cell(15,6,$current_exercice,0,0,'L');
$pdf->Cell(40,6,$solde,0,'L');
$pdf->Cell(40,6,$str_debit,0,0,'R');
$pdf->Cell(40,6,$str_credit,0,0,'R');
$pdf->Cell(40,6,$str_diff_solde,0,0,'R');
$pdf->Ln();
$pdf->write_cell(15,6,_('totaux'),0,0,'L');
$pdf->write_cell(15,6,$current_exercice,0,0,'L');
$pdf->write_cell(40,6,$solde,0,'L');
$pdf->write_cell(40,6,$str_debit,0,0,'R');
$pdf->write_cell(40,6,$str_credit,0,0,'R');
$pdf->write_cell(40,6,$str_diff_solde,0,0,'R');
$pdf->line_new();
/*
* reset total and current_exercice
*/
@ -146,26 +146,26 @@ foreach ($a_poste as $poste)
$prog=bcadd($row['deb_montant'],$row['cred_montant']);
$date=shrink_date($row['j_date_fmt']);
$pdf->Cell($size[$l],6,$date,0,0,$align[$l]);
$pdf->write_cell($size[$l],6,$date,0,0,$align[$l]);
$l++;
if ( $row['jr_pj_number'] == '')
$pdf->Cell($size[$l],6,$row['jr_internal'],0,0,$align[$l]);
$pdf->write_cell($size[$l],6,$row['jr_internal'],0,0,$align[$l]);
else
$pdf->Cell($size[$l],6,$row['jr_pj_number'],0,0,$align[$l]);
$pdf->write_cell($size[$l],6,$row['jr_pj_number'],0,0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,mb_substr($row['jrn_def_code'],0,14),0,0,$align[$l]);
$pdf->write_cell($size[$l],6,mb_substr($row['jrn_def_code'],0,14),0,0,$align[$l]);
$l++;
$pdf->LongLine($size[$l],6, $row['description'],0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,(($row['letter']!=-1)?$row['letter']:''),0,0,$align[$l]);
$pdf->write_cell($size[$l],6,(($row['letter']!=-1)?$row['letter']:''),0,0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',$row['deb_montant'])),0,0,$align[$l]);
$pdf->write_cell($size[$l],6,(sprintf('% 12.2f',$row['deb_montant'])),0,0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',$row['cred_montant'])),0,0,$align[$l]);
$pdf->write_cell($size[$l],6,(sprintf('% 12.2f',$row['cred_montant'])),0,0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',abs($prog))),0,0,$align[$l]);
$pdf->write_cell($size[$l],6,(sprintf('% 12.2f',abs($prog))),0,0,$align[$l]);
$l++;
$pdf->ln();
$pdf->line_new();
$tot_deb=bcadd($tot_deb,$row['deb_montant']);
$tot_cred=bcadd($tot_deb,$row['cred_montant']);
/* -------------------------------------- */
@ -179,11 +179,11 @@ foreach ($a_poste as $poste)
for ($f=0;$f<count($a_detail);$f++)
{
$l=0;
$pdf->Cell($size[$l],6,'',0,0,$align[$l]);
$pdf->write_cell($size[$l],6,'',0,0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,$a_detail[$f]['j_qcode'],0,0,$align[$l]);
$pdf->write_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]);
$pdf->write_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'];
@ -193,19 +193,19 @@ foreach ($a_poste as $poste)
$lib=$cn->get_value('select ad_value from fiche_detail where ad_id=$1 and f_id=$2',
array(ATTR_DEF_NAME,$f_id));
}
$pdf->Cell($size[$l],6,$lib,0,0,$align[$l]);
$pdf->write_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]);
$pdf->write_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]);
$pdf->write_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]);
$pdf->write_cell($size[$l],6,(sprintf('% 12.2f',$cred)),0,0,$align[$l]);
$l++;
$pdf->ln();
$pdf->line_new();
}
}
}
@ -225,15 +225,15 @@ foreach ($a_poste as $poste)
$pdf->SetFont('DejaVu','B',8);
$pdf->Cell(160,5,'Débit',0,0,'R');
$pdf->Cell(30,5,$str_debit,0,0,'R');
$pdf->Ln();
$pdf->Cell(160,5,'Crédit',0,0,'R');
$pdf->Cell(30,5,$str_credit,0,0,'R');
$pdf->Ln();
$pdf->Cell(160,5,'Solde '.$solde,0,0,'R');
$pdf->Cell(30,5,$str_diff_solde,0,0,'R');
$pdf->Ln();
$pdf->write_cell(160,5,'Débit',0,0,'R');
$pdf->write_cell(30,5,$str_debit,0,0,'R');
$pdf->line_new();
$pdf->write_cell(160,5,'Crédit',0,0,'R');
$pdf->write_cell(30,5,$str_credit,0,0,'R');
$pdf->line_new();
$pdf->write_cell(160,5,'Solde '.$solde,0,0,'R');
$pdf->write_cell(30,5,$str_diff_solde,0,0,'R');
$pdf->line_new();
}
$fDate=date('dmy-Hi');

View file

@ -85,66 +85,66 @@ $str_user=sprintf("( %d ) %s %s [ %s ] - %s",
$str);
$pdf->SetFont('DejaVu','B',9);
$pdf->Cell(0,7,$str_user,'B',0,'C');
$pdf->Ln();
$pdf->write_cell(0,7,$str_user,'B',0,'C');
$pdf->line_new();
if ( $SecUser->active==0)
{
$pdf->SetTextColor(255,0,34);
$pdf->Cell(0,7,'Bloqué',0,0,'R');
$pdf->Ln();
$pdf->write_cell(0,7,'Bloqué',0,0,'R');
$pdf->line_new();
}
if ( $SecUser->admin==1)
{
$pdf->SetTextColor(0,0,0);
$pdf->setFillColor(239,251,255);
$pdf->Cell(40,7,'Administrateur',1,1,'R');
$pdf->Ln();
$pdf->write_cell(40,7,'Administrateur',1,1,'R');
$pdf->line_new();
}
$pdf->SetTextColor(0,0,0);
//-----------------------------------------------------
// Journal
$pdf->Cell(0,7,'Accès journaux',1,0,'C');
$pdf->Ln();
$pdf->write_cell(0,7,'Accès journaux',1,0,'C');
$pdf->line_new();
$pdf->SetFont('DejaVu','',6);
$Res=$cn->exec_sql("select jrn_def_id,jrn_def_name from jrn_def ");
$SecUser->db=$cn;
for ($e=0;$e < Database::num_row($Res);$e++)
{
$row=Database::fetch_array($Res,$e);
$pdf->Cell(40,6,$row['jrn_def_name']);
$pdf->write_cell(40,6,$row['jrn_def_name']);
$priv=$SecUser->check_jrn($row['jrn_def_id']);
switch($priv)
{
case 'X':
$pdf->SetTextColor(255,0,34);
$pdf->Cell(30,6,"Pas d'accès");
$pdf->write_cell(30,6,"Pas d'accès");
break;
case 'R':
$pdf->SetTextColor(54,233,0);
$pdf->Cell(30,6,"Lecture");
$pdf->write_cell(30,6,"Lecture");
break;
case 'O':
/**
*non implemente
*/
$pdf->Cell(30,6,"Opérations prédéfinies uniquement");
$pdf->write_cell(30,6,"Opérations prédéfinies uniquement");
break;
case 'W':
$pdf->SetTextColor(54,233,0);
$pdf->Cell(30,6,'Ecriture');
$pdf->write_cell(30,6,'Ecriture');
break;
}
$pdf->SetTextColor(0);
$pdf->Ln();
$pdf->line_new();
}
//-----------------------------------------------------
// Follow_Up
$pdf->SetFont('DejaVu','B',9);
$pdf->Cell(0,7,'Accès action',1,0,'C');
$pdf->Ln();
$pdf->write_cell(0,7,'Accès action',1,0,'C');
$pdf->line_new();
$pdf->SetFont('DejaVu','',6);
$Res=$cn->exec_sql(
"select ac_id, ac_description from action order by ac_description ");
@ -154,24 +154,24 @@ $Max=Database::num_row($Res);
for ( $i =0 ; $i < $Max; $i++ )
{
$l_line=Database::fetch_array($Res,$i);
$pdf->Cell(90,6,$l_line['ac_description']);
$pdf->write_cell(90,6,$l_line['ac_description']);
$right=$SecUser->check_action($l_line['ac_id']);
switch ($right)
{
case 0:
$pdf->SetTextColor(255,0,34);
$pdf->Cell(30,6,"Pas d'accès");
$pdf->write_cell(30,6,"Pas d'accès");
break;
case 1:
case 2:
$pdf->SetTextColor(54,233,0);
$pdf->Cell(30,6,"Accès");
$pdf->write_cell(30,6,"Accès");
break;
}
$pdf->SetTextColor(0);
$pdf->Ln();
$pdf->line_new();
}
$fDate=date('dmy-HI');
$pdf->Output('security-'.$fDate.'pdf','D');