#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

@ -186,7 +186,7 @@ class Anc_Balance_Double extends Anc_Print
$pb=new Anc_Plan($this->db,$this->pa_id2);
$pb->get();
$pdf->SetFont('DejaVu','B',9);
$pdf->Cell(0,7,sprintf("Balance croise plan %s %s ",
$pdf->write_cell(0,7,sprintf("Balance croise plan %s %s ",
$pa->name,
$pb->name),1,0,'C');
$filtre_date="";
@ -208,58 +208,58 @@ class Anc_Balance_Double extends Anc_Print
($this->to_poste2!="")?"jusque ".$this->to_poste2:"");
$pdf->SetFont('DejaVu','',8);
$pdf->Cell(50,7,$filtre_date);
$pdf->Cell(50,7,$filtre_pa);
$pdf->Cell(50,7,$filtre_pb);
$pdf->Ln();
$pdf->write_cell(50,7,$filtre_date);
$pdf->write_cell(50,7,$filtre_pa);
$pdf->write_cell(50,7,$filtre_pb);
$pdf->line_new();
$pdf->SetFont('DejaVu','',6);
$pdf->Cell(20,7,'id','B');
$pdf->Cell(100,7,'Poste Comptable','B');
$pdf->Cell(20,7,'Débit','B',0,'L');
$pdf->Cell(20,7,'Crédit','B',0,'L');
$pdf->Cell(20,7,'Solde','B',0,'L');
$pdf->Cell(20,7,'D/C','B',0,'L');
$pdf->Ln();
$pdf->write_cell(20,7,'id','B');
$pdf->write_cell(100,7,'Poste Comptable','B');
$pdf->write_cell(20,7,'Débit','B',0,'L');
$pdf->write_cell(20,7,'Crédit','B',0,'L');
$pdf->write_cell(20,7,'Solde','B',0,'L');
$pdf->write_cell(20,7,'D/C','B',0,'L');
$pdf->line_new();
for ($i=0;$i<count($array);$i++)
{
$row=$array[$i];
$pdf->Cell(20,6,$row['a_po_name'],0,0,'L');
$pdf->Cell(40,6,mb_substr($row['a_po_description'],0,31),0,0,'L');
$pdf->Cell(20,6,$row['b_po_name'],0,0,'L');
$pdf->Cell(40,6,mb_substr($row['b_po_description'],0,31),0,0,'L');
$pdf->Cell(20,6,$row['a_d'],0,0,'R');
$pdf->Cell(20,6,$row['a_c'],0,0,'R');
$pdf->Cell(20,6,$row['a_solde'],0,0,'R');
$pdf->Cell(20,6,$row['a_debit'],0,0,'C');
$pdf->Ln();
$pdf->write_cell(20,6,$row['a_po_name'],0,0,'L');
$pdf->write_cell(40,6,mb_substr($row['a_po_description'],0,31),0,0,'L');
$pdf->write_cell(20,6,$row['b_po_name'],0,0,'L');
$pdf->write_cell(40,6,mb_substr($row['b_po_description'],0,31),0,0,'L');
$pdf->write_cell(20,6,$row['a_d'],0,0,'R');
$pdf->write_cell(20,6,$row['a_c'],0,0,'R');
$pdf->write_cell(20,6,$row['a_solde'],0,0,'R');
$pdf->write_cell(20,6,$row['a_debit'],0,0,'C');
$pdf->line_new();
}
$sum=$this->show_sum($array);
$pdf->SetFont('DejaVu','B',8);
$pdf->Cell(70,6,'Somme',1,0,'C');
$pdf->Ln(5);
$pdf->write_cell(70,6,'Somme',1,0,'C');
$pdf->line_new(5);
$pdf->SetFont('DejaVu','',6);
$pdf->Cell(20,7,'Poste');
$pdf->Cell(60,7,'Description','B');
$pdf->Cell(20,7,'Débit','B',0,'L');
$pdf->Cell(20,7,'Crédit','B',0,'L');
$pdf->Cell(20,7,'Solde','B',0,'L');
$pdf->Cell(20,7,'D/C','B',0,'L');
$pdf->Ln();
$pdf->write_cell(20,7,'Poste');
$pdf->write_cell(60,7,'Description','B');
$pdf->write_cell(20,7,'Débit','B',0,'L');
$pdf->write_cell(20,7,'Crédit','B',0,'L');
$pdf->write_cell(20,7,'Solde','B',0,'L');
$pdf->write_cell(20,7,'D/C','B',0,'L');
$pdf->line_new();
for ($i=0;$i<count($sum);$i++)
{
$row=$sum[$i];
$pdf->Cell(20,6,$row['poste'],0,0,'L');
$pdf->Cell(60,6,$row['desc'],0,0,'L');
$pdf->Cell(20,6,sprintf('%.2f',$row['debit']),0,0,'R');
$pdf->Cell(20,6,sprintf('%.2f',$row['credit']),0,0,'R');
$pdf->Cell(20,6,sprintf('%.2f',$row['solde']),0,0,'R');
$pdf->Cell(20,6,$row['dc'],0,0,'R');
$pdf->Ln();
$pdf->write_cell(20,6,$row['poste'],0,0,'L');
$pdf->write_cell(60,6,$row['desc'],0,0,'L');
$pdf->write_cell(20,6,sprintf('%.2f',$row['debit']),0,0,'R');
$pdf->write_cell(20,6,sprintf('%.2f',$row['credit']),0,0,'R');
$pdf->write_cell(20,6,sprintf('%.2f',$row['solde']),0,0,'R');
$pdf->write_cell(20,6,$row['dc'],0,0,'R');
$pdf->line_new();
}
$fDate=date('dmy-Hi');
$pdf->output('crossbalance-'.$fDate.'.pdf','D');

View file

@ -206,13 +206,13 @@ class Anc_Balance_Simple extends Anc_Print
for ($i=0;$i<count($array);$i++)
{
$row=$array[$i];
$pdf->Cell(20,6,$row['po_id'],0,0,'L');
$pdf->Cell(90,6,$row['po_name'],0,0,'L');
$pdf->Cell(20,6,sprintf('%s',nbm($row['sum_deb'])),0,0,'R');
$pdf->Cell(20,6,sprintf('%s',nbm($row['sum_cred'])),0,0,'R');
$pdf->Cell(20,6,sprintf('%s',nbm($row['solde'])),0,0,'R');
$pdf->Cell(20,6,$row['debit'],0,0,'R');
$pdf->Ln();
$pdf->write_cell(20,6,$row['po_id'],0,0,'L');
$pdf->write_cell(90,6,$row['po_name'],0,0,'L');
$pdf->write_cell(20,6,sprintf('%s',nbm($row['sum_deb'])),0,0,'R');
$pdf->write_cell(20,6,sprintf('%s',nbm($row['sum_cred'])),0,0,'R');
$pdf->write_cell(20,6,sprintf('%s',nbm($row['solde'])),0,0,'R');
$pdf->write_cell(20,6,$row['debit'],0,0,'R');
$pdf->line_new();
}
$fDate=date('dmy-Hi');
$pdf->output('simple-balance-'.$fDate.'.pdf','D');

View file

@ -64,11 +64,7 @@ class Print_Ledger_Detail extends PDF
$this->Cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'R',false,'http://www.noalyss.eu');
}
function Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
{
$txt = str_replace("\\", "", $txt);
return parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $link);
}
function export()
{
@ -80,12 +76,12 @@ class Print_Ledger_Detail extends PDF
$array=$this->ledger->get_operation($_GET['from_periode'],$_GET['to_periode']);
$this->SetFont('DejaVu','BI',7);
$this->Cell(215,7,'report Débit',0,0,'R');
$this->Cell(30,7,nbm($rap_deb),0,0,'R');
$this->Ln(4);
$this->Cell(215,7,'report Crédit',0,0,'R');
$this->Cell(30,7,nbm($rap_cred),0,0,'R');
$this->Ln(4);
$this->write_cell(215,7,'report Débit',0,0,'R');
$this->write_cell(30,7,nbm($rap_deb),0,0,'R');
$this->line_new(4);
$this->write_cell(215,7,'report Crédit',0,0,'R');
$this->write_cell(30,7,nbm($rap_cred),0,0,'R');
$this->line_new(4);
// print all operation
for ($i=0;$i< count($array);$i++)
@ -94,12 +90,12 @@ class Print_Ledger_Detail extends PDF
$row=$array[$i];
$this->LongLine(20,7,$row['pj']);
$this->Cell(15,7,$row['date_fmt']);
$this->Cell(20,7,$row['internal']);
$this->write_cell(15,7,$row['date_fmt']);
$this->write_cell(20,7,$row['internal']);
$this->LongLine(170,7,$row['comment']);
$this->Cell(20,7,nbm($row['montant']),0,0,'R');
$this->write_cell(20,7,nbm($row['montant']),0,0,'R');
$this->Ln();
$this->line_new();
// get the entries
$aEntry=$this->cn->get_array("select j_id,j_poste,j_qcode,j_montant,j_debit, j_text,".
" case when j_text='' or j_text is null then pcm_lib else j_text end as desc,".
@ -111,9 +107,9 @@ class Print_Ledger_Detail extends PDF
{
$this->SetFont('DejaVuCond','',7);
$entry=$aEntry[$j];
// $this->Cell(15,6,$entry['j_id'],0,0,'R');
$this->Cell(32,6,$entry['j_qcode'],0,0,'R');
$this->Cell(23,6,$entry['j_poste'],0,0,'R');
// $this->write_cell(15,6,$entry['j_id'],0,0,'R');
$this->write_cell(32,6,$entry['j_qcode'],0,0,'R');
$this->write_cell(23,6,$entry['j_poste'],0,0,'R');
// if j_qcode is not empty retrieve name
if ( $entry['j_text'] =='' && $entry['j_qcode'] != '')
@ -127,21 +123,21 @@ class Print_Ledger_Detail extends PDF
}
else
$name=$entry['desc'];
$this->Cell(150,6,$name,0,0,'L');
$this->write_cell(150,6,$name,0,0,'L');
// print amount
$str_amount=nbm($entry['j_montant']);
if ( $entry['j_debit']=='t')
{
$this->Cell(20,6,$str_amount,0,0,'R');
$this->Cell(20,6,'',0,0,'R');
$this->write_cell(20,6,$str_amount,0,0,'R');
$this->write_cell(20,6,'',0,0,'R');
}
else
{
$this->Cell(20,6,'',0,0,'R');
$this->Cell(20,6,$str_amount,0,0,'R');
$this->write_cell(20,6,'',0,0,'R');
$this->write_cell(20,6,$str_amount,0,0,'R');
}
$this->Ln(4);
$this->line_new(4);
}
}
}

View file

@ -49,21 +49,21 @@ class Print_Ledger_Detail_Item extends PDFLand
//Arial bold 12
$this->SetFont('DejaVu', 'B', 12);
//Title
$this->Cell(0,10,$this->dossier, 'B', 0, 'C');
$this->write_cell(0,10,$this->dossier, 'B', 0, 'C');
//Line break
$this->Ln(20);
$this->line_new(20);
$high=6;
$this->SetFont('DejaVu', '', 6);
$this->LongLine(20, $high, _('Date'),0, 'L', false);
$this->Cell(20, $high, _('Numéro interne'), 0, 0, 'L', false);
$this->write_cell(20, $high, _('Numéro interne'), 0, 0, 'L', false);
$this->LongLine(50, $high, _('Code'),0,'L',false);
$this->LongLine(80, $high, _('Libellé'),0,'L',false);
$this->Cell(20, $high, _('Tot HTVA'), 0, 0, 'R', false);
$this->Cell(20, $high, _('Tot TVA NP'), 0, 0, 'R', false);
$this->Cell(20, $high, "", 0, 0, 'R', false);
$this->Cell(20, $high, _('Tot TVA'), 0, 0, 'R', false);
$this->Cell(20, $high, _('TVAC'), 0, 0, 'R', false);
$this->Ln(6);
$this->write_cell(20, $high, _('Tot HTVA'), 0, 0, 'R', false);
$this->write_cell(20, $high, _('Tot TVA NP'), 0, 0, 'R', false);
$this->write_cell(20, $high, "", 0, 0, 'R', false);
$this->write_cell(20, $high, _('Tot TVA'), 0, 0, 'R', false);
$this->write_cell(20, $high, _('TVAC'), 0, 0, 'R', false);
$this->line_new(6);
$this->show_col=true;
}
@ -72,21 +72,17 @@ class Print_Ledger_Detail_Item extends PDFLand
*/
function Footer()
{
$this->Ln(2);
$this->line_new(2);
$this->SetFont('Arial', 'I', 8);
$this->Cell(50,8,' Journal '.$this->ledger->get_name(),0,0,'C');
$this->write_cell(50,8,' Journal '.$this->ledger->get_name(),0,0,'C');
//Arial italic 8
//Page number
$this->Cell(30,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
$this->write_cell(30,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
// Created by NOALYSS
$this->Cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'R',false,'http://www.noalyss.eu');
$this->write_cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'R',false,'http://www.noalyss.eu');
}
function Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
{
$txt = str_replace("\\", "", $txt);
return parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $link);
}
/**
*@brief export the ledger in PDF
*/
@ -122,50 +118,50 @@ class Print_Ledger_Detail_Item extends PDFLand
{
// Print the general info line width=270mm
$this->LongLine(20, $high, $row['jr_date'],1, 'L', true);
$this->Cell(20, $high, $row['jr_internal'], 1, 0, 'L', true);
$this->write_cell(20, $high, $row['jr_internal'], 1, 0, 'L', true);
$this->LongLine(50, $high, $row['quick_code']." ".$row['tiers_name'],1,'L',true);
$this->LongLine(80, $high, $row['jr_comment'],1,'L',true);
$this->Cell(20, $high, nbm($row['htva']), 1, 0, 'R', true);
$this->Cell(20, $high, nbm($row['tot_tva_np']), 1, 0, 'R', true);
$this->Cell(20, $high, "", 1, 0, 'R', true);
$this->Cell(20, $high, nbm($row['tot_vat']), 1, 0, 'R', true);
$this->write_cell(20, $high, nbm($row['htva']), 1, 0, 'R', true);
$this->write_cell(20, $high, nbm($row['tot_tva_np']), 1, 0, 'R', true);
$this->write_cell(20, $high, "", 1, 0, 'R', true);
$this->write_cell(20, $high, nbm($row['tot_vat']), 1, 0, 'R', true);
$sum=bcadd($row['htva'],$row['tot_vat']);
$sum=bcsub($sum,$row['tot_tva_np']);
$this->Cell(20, $high, nbm($sum), 1, 0, 'R', true);
$this->write_cell(20, $high, nbm($sum), 1, 0, 'R', true);
$internal=$row['jr_internal'];
$this->Ln(6);
$this->line_new(6);
// on the first line, the code for each column is displaid
if ( $this->show_col == true ) {
//
// Header detail
$this->LongLine(30,$high,'QuickCode');
$this->Cell(30,$high,'Poste');
$this->write_cell(30,$high,'Poste');
$this->LongLine(70,$high,'Libellé');
$this->Cell(20,$high,'Prix/Unit',0,0,'R');
$this->Cell(20,$high,'Quant.',0,0,'R');
$this->Cell(20,$high,'HTVA',0,0,'R');
$this->Cell(20,$high,'TVA NP',0,0,'R');
$this->Cell(20,$high,'Code TVA');
$this->Cell(20,$high,'TVA',0,0,'R');
$this->Cell(20,$high,'TVAC',0,0,'R');
$this->Ln(6);
$this->write_cell(20,$high,'Prix/Unit',0,0,'R');
$this->write_cell(20,$high,'Quant.',0,0,'R');
$this->write_cell(20,$high,'HTVA',0,0,'R');
$this->write_cell(20,$high,'TVA NP',0,0,'R');
$this->write_cell(20,$high,'Code TVA');
$this->write_cell(20,$high,'TVA',0,0,'R');
$this->write_cell(20,$high,'TVAC',0,0,'R');
$this->line_new(6);
$this->show_col=false;
}
}
// Print detail sale / purchase
$this->LongLine(30,$high,$row['j_qcode']);
$this->Cell(30,$high,$row['j_poste']);
$this->write_cell(30,$high,$row['j_poste']);
$comment=($row['j_text']=="")?$row['item_name']:$row['j_text'];
$this->LongLine(70,$high,$comment);
$this->Cell(20,$high,nbm($row['price_per_unit']),0,0,'R');
$this->Cell(20,$high,nbm($row['quantity']),0,0,'R');
$this->Cell(20,$high,nbm($row['price']),0,0,'R');
$this->Cell(20,$high,nbm($row['vat_sided']),0,0,'R');
$this->Cell(20,$high,$row['vat_code']." ".$row['tva_label']);
$this->Cell(20,$high,nbm($row['vat']),0,0,'R');
$this->write_cell(20,$high,nbm($row['price_per_unit']),0,0,'R');
$this->write_cell(20,$high,nbm($row['quantity']),0,0,'R');
$this->write_cell(20,$high,nbm($row['price']),0,0,'R');
$this->write_cell(20,$high,nbm($row['vat_sided']),0,0,'R');
$this->write_cell(20,$high,$row['vat_code']." ".$row['tva_label']);
$this->write_cell(20,$high,nbm($row['vat']),0,0,'R');
$sum=bcadd($row['price'],$row['vat']);
$this->Cell(20,$high,nbm($sum),0,0,'R');
$this->Ln(6);
$this->write_cell(20,$high,nbm($sum),0,0,'R');
$this->line_new(6);
}
}

View file

@ -48,43 +48,43 @@ class Print_Ledger_Financial extends PDF
//Arial bold 12
$this->SetFont('DejaVu', 'B', 12);
//Title
$this->Cell(0,10,$this->dossier, 'B', 0, 'C');
$this->write_cell(0,10,$this->dossier, 'B', 0, 'C');
//Line break
$this->SetFont('DejaVu', 'B', 7);
$this->Ln(10);
$this->Cell(40,6,_('report'),0,0,'R');
$this->Cell(40,6,nbm($this->rap_amount),0,0,'R');
$this->Ln(6);
$this->line_new(10);
$this->write_cell(40,6,_('report'),0,0,'R');
$this->write_cell(40,6,nbm($this->rap_amount),0,0,'R');
$this->line_new(6);
$this->SetFont('DejaVu', 'B', 7);
$this->Cell(15,6,'Piece');
$this->Cell(10,6,'Date');
$this->Cell(15,6,'Interne');
$this->Cell(40,6,'Dest/Orig');
$this->Cell(80,6,'Commentaire');
$this->Cell(20,6,'Montant');
$this->Ln(6);
$this->write_cell(15,6,'Piece');
$this->write_cell(10,6,'Date');
$this->write_cell(15,6,'Interne');
$this->write_cell(40,6,'Dest/Orig');
$this->write_cell(80,6,'Commentaire');
$this->write_cell(20,6,'Montant');
$this->line_new(6);
}
function Footer()
{
$this->SetFont('DejaVu', 'B', 7);
$this->Cell(40,6,_('Total page'),0,0,'R');
$this->Cell(40,6,nbm($this->tp_amount),0,0,'R');
$this->write_cell(40,6,_('Total page'),0,0,'R');
$this->write_cell(40,6,nbm($this->tp_amount),0,0,'R');
bcscale(2);
$this->rap_amount=bcadd($this->rap_amount,$this->tp_amount);
$this->Cell(40,6,_('Total à reporter'),0,0,'R');
$this->Cell(40,6,nbm($this->rap_amount),0,0,'R');
$this->write_cell(40,6,_('Total à reporter'),0,0,'R');
$this->write_cell(40,6,nbm($this->rap_amount),0,0,'R');
$this->tp_amount=0;
//Position at 2 cm from bottom
$this->SetY(-20);
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->Ln(3);
$this->write_cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->line_new(3);
// Created by NOALYSS
$this->Cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'C',false,'http://www.noalyss.eu');
$this->write_cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'C',false,'http://www.noalyss.eu');
}
/**
@ -100,18 +100,18 @@ class Print_Ledger_Financial extends PDF
for ( $i=0;$i<count($a_jrn);$i++)
{
$row=$a_jrn[$i];
$this->Cell(15,5,$row['pj']);
$this->Cell(10,5,$row['date_fmt']);
$this->Cell(15,5,$row['internal']);
$this->write_cell(15,5,$row['pj']);
$this->write_cell(10,5,$row['date_fmt']);
$this->write_cell(15,5,$row['internal']);
$name=$this->ledger->get_tiers($this->jrn_type,$row['id']);
$this->Cell(40,5,$name,0,'L');
$this->write_cell(40,5,$name,0,'L');
$this->Cell(80,5,$row['comment'],0,'L');
$this->write_cell(80,5,$row['comment'],0,'L');
$amount=$this->cn->get_value('select qf_amount from quant_fin where jr_id=$1',array( $row['id']));
$this->Cell(20,5,sprintf('%s',nbm($amount)),0,0,'R');
$this->Ln(5);
$this->write_cell(20,5,sprintf('%s',nbm($amount)),0,0,'R');
$this->line_new(5);
$this->tp_amount=bcadd($this->tp_amount,$amount);
}

View file

@ -36,17 +36,17 @@ class Print_Ledger_Misc extends PDF
//Arial bold 12
$this->SetFont('DejaVu', 'B', 12);
//Title
$this->Cell(0,10,$this->dossier, 'B', 0, 'C');
$this->write_cell(0,10,$this->dossier, 'B', 0, 'C');
//Line break
$this->Ln(20);
$this->line_new(20);
$this->SetFont('DejaVu', 'B', 7);
$this->Cell(30,6,'Piece');
$this->Cell(10,6,'Date');
$this->Cell(20,6,'Interne');
$this->Cell(25,6,'Tiers');
$this->Cell(80,6,'Commentaire');
$this->Cell(15,6,'Montant');
$this->Ln(6);
$this->write_cell(30,6,'Piece');
$this->write_cell(10,6,'Date');
$this->write_cell(20,6,'Interne');
$this->write_cell(25,6,'Tiers');
$this->write_cell(80,6,'Commentaire');
$this->write_cell(15,6,'Montant');
$this->line_new(6);
}
function Footer()
@ -56,10 +56,10 @@ class Print_Ledger_Misc extends PDF
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->Ln(3);
$this->write_cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->line_new(3);
// Created by NOALYSS
$this->Cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'C',false,'http://www.noalyss.eu');
$this->write_cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'C',false,'http://www.noalyss.eu');
}
/**
*@brief print the pdf
@ -78,8 +78,8 @@ class Print_Ledger_Misc extends PDF
{
$row=$a_jrn[$i];
$this->LongLine(30,5,$row['jr_pj_number']);
$this->Cell(10,5, smaller_date($row['date']));
$this->Cell(20,5,$row['jr_internal']);
$this->write_cell(10,5, smaller_date($row['date']));
$this->write_cell(20,5,$row['jr_internal']);
$type=$this->cn->get_value("select jrn_def_type from jrn_def where jrn_def_id=$1",array($a_jrn[$i]['jr_def_id']));
$other=mb_substr($this->ledger->get_tiers($type,$a_jrn[$i]['jr_id']),0,25);
$this->LongLine(25,5,$other,0,'L');
@ -89,8 +89,8 @@ class Print_Ledger_Misc extends PDF
$positive = $this->cn->get_value("select qf_amount from quant_fin ".
" where jr_id=".$row['jr_id']);
}
$this->Cell(15,5,nbm($positive),0,0,'R');
$this->Ln(5);
$this->write_cell(15,5,nbm($positive),0,0,'R');
$this->line_new(5);
}
}

View file

@ -77,9 +77,9 @@ class Print_Ledger_Simple extends PDF
//Arial bold 12
$this->SetFont('DejaVu', 'B', 12);
//Title
$this->Cell(0,10,$this->dossier, 'B', 0, 'C');
$this->write_cell(0,10,$this->dossier, 'B', 0, 'C');
//Line break
$this->Ln(20);
$this->line_new(20);
$this->SetFont('DejaVu', 'B', 8);
/* column header */
//----------------------------------------------------------------------
@ -90,46 +90,46 @@ class Print_Ledger_Simple extends PDF
$tmp1=$line_tva['tva_id'];
$this->rap_tva[$tmp1]=(isset($this->rap_tva[$tmp1]))?$this->rap_tva[$tmp1]:0;
}
$this->Cell(15,6,'Pièce');
$this->Cell(10,6,'Date');
$this->Cell(13,6,'ref');
$this->write_cell(15,6,'Pièce');
$this->write_cell(10,6,'Date');
$this->write_cell(13,6,'ref');
if ( $this->jrn_type=='ACH')
$this->Cell(40,6,'Client');
$this->write_cell(40,6,'Client');
else
$this->Cell(40,6,'Fournisseur');
$this->write_cell(40,6,'Fournisseur');
$flag_tva=(count($this->a_Tva) > 4)?true:false;
if ( !$flag_tva ) $this->Cell(65,6,'Description');
if ( !$flag_tva ) $this->write_cell(65,6,'Description');
$this->Cell(15,6,'HTVA',0,0,'R');
$this->write_cell(15,6,'HTVA',0,0,'R');
if ( $this->jrn_type=='ACH')
{
$this->Cell(15,6,'Priv/DNA',0,0,'R');
$this->Cell(15,6,'TVA ND',0,0,'R');
$this->write_cell(15,6,'Priv/DNA',0,0,'R');
$this->write_cell(15,6,'TVA ND',0,0,'R');
}
$this->Cell(15,6,'TVA NP',0,0,'R'); // Unpaid TVA --> autoliquidation, NPR
$this->write_cell(15,6,'TVA NP',0,0,'R'); // Unpaid TVA --> autoliquidation, NPR
foreach($this->a_Tva as $line_tva)
{
$this->Cell(15,6,$line_tva['tva_label'],0,0,'R');
$this->write_cell(15,6,$line_tva['tva_label'],0,0,'R');
}
$this->Cell(15,6,'TVAC',0,0,'R');
$this->Ln(5);
$this->write_cell(15,6,'TVAC',0,0,'R');
$this->line_new(5);
$this->SetFont('DejaVu','',6);
// page Header
$this->Cell(143,6,'report',0,0,'R');
$this->Cell(15,6,nbm($this->rap_htva),0,0,'R'); /* HTVA */
$this->write_cell(143,6,'report',0,0,'R');
$this->write_cell(15,6,nbm($this->rap_htva),0,0,'R'); /* HTVA */
if ( $this->jrn_type != 'VEN')
{
$this->Cell(15,6,nbm($this->rap_priv),0,0,'R'); /* prive */
$this->Cell(15,6,nbm($this->rap_nd),0,0,'R'); /* Tva ND */
$this->write_cell(15,6,nbm($this->rap_priv),0,0,'R'); /* prive */
$this->write_cell(15,6,nbm($this->rap_nd),0,0,'R'); /* Tva ND */
}
$this->Cell(15,6,nbm($this->rap_tva_np),0,0,'R'); /* Tva ND */
$this->write_cell(15,6,nbm($this->rap_tva_np),0,0,'R'); /* Tva ND */
foreach($this->rap_tva as $line_tva)
$this->Cell(15,6,nbm($line_tva),0,0,'R');
$this->Cell(15,6,nbm($this->rap_tvac),0,0,'R'); /* Tvac */
$this->write_cell(15,6,nbm($line_tva),0,0,'R');
$this->write_cell(15,6,nbm($this->rap_tvac),0,0,'R'); /* Tvac */
$this->Ln(6);
$this->line_new(6);
//total page
$this->tp_htva=0.0;
$this->tp_tvac=0.0;
@ -151,53 +151,49 @@ class Print_Ledger_Simple extends PDF
//Position at 3 cm from bottom
$this->SetY(-20);
/* write reporting */
$this->Cell(143,6,'Total page ','T',0,'R'); /* HTVA */
$this->Cell(15,6,nbm($this->tp_htva),'T',0,'R'); /* HTVA */
$this->write_cell(143,6,'Total page ','T',0,'R'); /* HTVA */
$this->write_cell(15,6,nbm($this->tp_htva),'T',0,'R'); /* HTVA */
if ( $this->jrn_type !='VEN')
{
$this->Cell(15,6,nbm($this->tp_priv),'T',0,'R'); /* prive */
$this->Cell(15,6,nbm($this->tp_nd),'T',0,'R'); /* Tva ND */
$this->write_cell(15,6,nbm($this->tp_priv),'T',0,'R'); /* prive */
$this->write_cell(15,6,nbm($this->tp_nd),'T',0,'R'); /* Tva ND */
}
$this->Cell(15,6,nbm($this->tp_tva_np),'T',0,'R'); /* Tva Unpaid */
$this->write_cell(15,6,nbm($this->tp_tva_np),'T',0,'R'); /* Tva Unpaid */
foreach($this->a_Tva as $line_tva)
{
$l=$line_tva['tva_id'];
$this->Cell(15,6,nbm($this->tp_tva[$l]),'T',0,'R');
$this->write_cell(15,6,nbm($this->tp_tva[$l]),'T',0,'R');
}
$this->Cell(15,6,nbm($this->tp_tvac),'T',0,'R'); /* Tvac */
$this->Ln(2);
$this->write_cell(15,6,nbm($this->tp_tvac),'T',0,'R'); /* Tvac */
$this->line_new(2);
$this->Cell(143,6,'report',0,0,'R'); /* HTVA */
$this->Cell(15,6,nbm($this->rap_htva),0,0,'R'); /* HTVA */
$this->write_cell(143,6,'report',0,0,'R'); /* HTVA */
$this->write_cell(15,6,nbm($this->rap_htva),0,0,'R'); /* HTVA */
if ( $this->jrn_type !='VEN')
{
$this->Cell(15,6,nbm($this->rap_priv),0,0,'R'); /* prive */
$this->Cell(15,6,nbm($this->rap_nd),0,0,'R'); /* Tva ND */
$this->write_cell(15,6,nbm($this->rap_priv),0,0,'R'); /* prive */
$this->write_cell(15,6,nbm($this->rap_nd),0,0,'R'); /* Tva ND */
}
$this->Cell(15,6,nbm($this->rap_tva_np),0,0,'R'); /* Tva ND */
$this->write_cell(15,6,nbm($this->rap_tva_np),0,0,'R'); /* Tva ND */
foreach($this->a_Tva as $line_tva)
{
$l=$line_tva['tva_id'];
$this->Cell(15,6,nbm($this->rap_tva[$l]),0,0,'R');
$this->write_cell(15,6,nbm($this->rap_tva[$l]),0,0,'R');
}
$this->Cell(15,6,nbm($this->rap_tvac),0,0,'R'); /* Tvac */
$this->Ln(2);
$this->write_cell(15,6,nbm($this->rap_tvac),0,0,'R'); /* Tvac */
$this->line_new(2);
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
$this->write_cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
// Created by NOALYSS
$this->Cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'R',false,'http://www.noalyss.eu');
$this->write_cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'R',false,'http://www.noalyss.eu');
}
function Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
{
$txt = str_replace("\\", "", $txt);
return parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $link);
}
/**
*@brief export the ledger in PDF
*/
@ -232,8 +228,8 @@ class Print_Ledger_Simple extends PDF
$row=$a_jrn[$i];
$this->LongLine(15,5,($row['pj']),0);
$this->Cell(10,5,$row['date_fmt'],0,0);
$this->Cell(13,5,$row['internal'],0,0);
$this->write_cell(10,5,$row['date_fmt'],0,0);
$this->write_cell(13,5,$row['internal'],0,0);
list($qc,$name)=$this->get_tiers($row['id'],$this->jrn_type);
$this->LongLine(40,5,"[".$qc."]".$name,0,'L');
@ -253,24 +249,24 @@ class Print_Ledger_Simple extends PDF
$this->rap_tva_np=bcadd($this->rap_tva_np,$other['tva_np']);
$this->Cell(15,5,nbm($other['price']),0,0,'R');
$this->write_cell(15,5,nbm($other['price']),0,0,'R');
if ( $this->jrn_type !='VEN')
{
$this->Cell(15,5,nbm($other['priv']),0,0,'R');
$this->Cell(15,5,nbm($other['tva_nd']),0,0,'R');
$this->write_cell(15,5,nbm($other['priv']),0,0,'R');
$this->write_cell(15,5,nbm($other['tva_nd']),0,0,'R');
}
$this->Cell(15,5,nbm($other['tva_np']),0,0,'R');
$this->write_cell(15,5,nbm($other['tva_np']),0,0,'R');
foreach ($atva_amount as $row_atva_amount)
{
$this->Cell(15, 5, nbm($row_atva_amount), 0, 0, 'R');
$this->write_cell(15, 5, nbm($row_atva_amount), 0, 0, 'R');
}
$l_tvac=bcadd($other['price'], bcsub($other['vat'],$other['tva_np']));
$l_tvac=bcadd($l_tvac,$other['tva_nd']);
$this->Cell(15,5,nbm($l_tvac),0,0,'R');
$this->Ln(5);
$this->write_cell(15,5,nbm($l_tvac),0,0,'R');
$this->line_new(5);
}
}

View file

@ -63,40 +63,40 @@ class Print_Ledger_Simple_Without_Vat extends PDF
//Arial bold 12
$this->SetFont('DejaVu', 'B', 12);
//Title
$this->Cell(0,10,$this->dossier, 'B', 0, 'C');
$this->write_cell(0,10,$this->dossier, 'B', 0, 'C');
//Line break
$this->Ln(20);
$this->line_new(20);
$this->SetFont('DejaVu', 'B', 8);
/* column header */
$this->Cell(15,6,'Pièce');
$this->Cell(15,6,'Date');
$this->Cell(20,6,'ref');
$this->write_cell(15,6,'Pièce');
$this->write_cell(15,6,'Date');
$this->write_cell(20,6,'ref');
if ( $this->jrn_type=='ACH')
$this->Cell(60,6,'Client');
$this->write_cell(60,6,'Client');
else
$this->Cell(60,6,'Fournisseur');
$this->Cell(105,6,'Commentaire');
$this->write_cell(60,6,'Fournisseur');
$this->write_cell(105,6,'Commentaire');
if ( $this->jrn_type=='ACH')
{
$this->Cell(15,6,'Privé',0,0,'R');
$this->write_cell(15,6,'Privé',0,0,'R');
}
$this->Cell(15,6,'Prix',0,0,'R');
$this->write_cell(15,6,'Prix',0,0,'R');
$this->Ln(5);
$this->line_new(5);
$this->SetFont('DejaVu','',6);
// page Header
$this->Cell(215,6,'report',0,0,'R'); /* HTVA */
$this->write_cell(215,6,'report',0,0,'R'); /* HTVA */
if ( $this->jrn_type != 'VEN')
{
$this->Cell(15,6,sprintf('%.2f',$this->rap_priv),0,0,'R'); /* prive */
$this->write_cell(15,6,sprintf('%.2f',$this->rap_priv),0,0,'R'); /* prive */
}
$this->Cell(15,6,sprintf('%.2f',$this->rap_htva),0,0,'R'); /* HTVA */
$this->write_cell(15,6,sprintf('%.2f',$this->rap_htva),0,0,'R'); /* HTVA */
$this->Ln(6);
$this->line_new(6);
//total page
$this->tp_htva=0.0;
$this->tp_tvac=0.0;
@ -111,36 +111,31 @@ class Print_Ledger_Simple_Without_Vat extends PDF
//Position at 3 cm from bottom
$this->SetY(-20);
/* write reporting */
$this->Cell(215,6,'Total page ','T',0,'R'); /* HTVA */
$this->write_cell(215,6,'Total page ','T',0,'R'); /* HTVA */
if ( $this->jrn_type !='VEN')
{
$this->Cell(15,6,sprintf('%.2f',$this->tp_priv),'T',0,'R'); /* prive */
$this->write_cell(15,6,sprintf('%.2f',$this->tp_priv),'T',0,'R'); /* prive */
}
$this->Cell(15,6,sprintf('%.2f',$this->tp_htva),'T',0,'R'); /* HTVA */
$this->Cell(0,6,'','T',0,'R'); /* line */
$this->Ln(2);
$this->write_cell(15,6,sprintf('%.2f',$this->tp_htva),'T',0,'R'); /* HTVA */
$this->write_cell(0,6,'','T',0,'R'); /* line */
$this->line_new(2);
$this->Cell(215,6,'report',0,0,'R'); /* HTVA */
$this->write_cell(215,6,'report',0,0,'R'); /* HTVA */
if ( $this->jrn_type !='VEN')
{
$this->Cell(15,6,sprintf('%.2f',$this->rap_priv),0,0,'R'); /* prive */
$this->write_cell(15,6,sprintf('%.2f',$this->rap_priv),0,0,'R'); /* prive */
}
$this->Cell(15,6,sprintf('%.2f',$this->rap_htva),0,0,'R'); /* HTVA */
$this->Ln(2);
$this->write_cell(15,6,sprintf('%.2f',$this->rap_htva),0,0,'R'); /* HTVA */
$this->line_new(2);
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
$this->write_cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
// Created by NOALYSS
$this->Cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'R',false,'http://www.noalyss.eu');
$this->write_cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'R',false,'http://www.noalyss.eu');
}
function Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
{
$txt = str_replace("\\", "", $txt);
return parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $link);
}
/**
*@brief export the ledger in PDF
*/
@ -156,10 +151,10 @@ class Print_Ledger_Simple_Without_Vat extends PDF
$row=$a_jrn[$i];
$this->LongLine(15,5,($row['pj']),0);
$this->Cell(15,5,$row['date_fmt'],0,0);
$this->Cell(20,5,$row['internal'],0,0);
$this->write_cell(15,5,$row['date_fmt'],0,0);
$this->write_cell(20,5,$row['internal'],0,0);
list($qc,$name)=$this->get_tiers($row['id'],$this->jrn_type);
$this->Cell(20,5,$qc,0,0);
$this->write_cell(20,5,$qc,0,0);
$this->LongLine(40,5,$name,0,'L');
$this->LongLine(105,5,$row['comment'],0,'L');
@ -174,11 +169,11 @@ class Print_Ledger_Simple_Without_Vat extends PDF
if ( $this->jrn_type !='VEN')
{
$this->Cell(15,6,sprintf("%.2f",$other['priv']),0,0,'R');
$this->write_cell(15,6,sprintf("%.2f",$other['priv']),0,0,'R');
}
$this->Cell(15,6,sprintf("%.2f",$other['price']),0,0,'R');
$this->Ln(5);
$this->write_cell(15,6,sprintf("%.2f",$other['price']),0,0,'R');
$this->line_new(5);
}
}

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');

View file

@ -113,6 +113,11 @@ class PDF extends TFPDF
{
if ($this->cells[$i]->type == 'M' )
{
/**
* On doit calculer si le texte dépasse la texte et compter le
* nombre de lignes que le texte prendrait. Ensuite il faut
* faire un saut de page (renvoit true) si dépasse
*/
$y=$this->GetY();
if ( $y > ($this->h - $this->bMargin-20))
return true;
@ -124,27 +129,28 @@ class PDF extends TFPDF
{
static $e=0;
$e++;
if ( $e == 73 ) xdebug_break ();
//if ( $this->check_page_add() == true ) $this->AddPage ();
if ( $e == 40 ) xdebug_break ();
if ( $this->check_page_add() == true ) $this->AddPage ();
$this->bigger=0;
$size=count($this->cells);
$cell=$this->cells;
if ($size == 0 )return;
for ($i=0;$i < $size ; $i++)
{
$this->cells[$i]->text= str_replace("\\", "", $this->cells[$i]->text);
switch ($this->cells[$i]->type)
$a=$cell[$i];
$a->text= str_replace("\\", "", $a->text);
switch ($a->type)
{
case "M":
$x_m=$this->GetX();
$y_m=$this->GetY();
parent::MultiCell(
$this->cells[$i]->width,
$this->cells[$i]->height,
$this->cells[$i]->text,
$this->cells[$i]->border,
$this->cells[$i]->align,
$this->cells[$i]->fill
$a->width,
$a->height,
$a->text,
$a->border,
$a->align,
$a->fill
);
$x_m=$x_m+$this->cells[$i]->width;
$tmp=$this->GetY()-$y_m;
@ -154,14 +160,14 @@ class PDF extends TFPDF
case "C":
$this->Cell( $this->cells[$i]->width,
$this->cells[$i]->height,
$this->cells[$i]->text,
$this->cells[$i]->border,
$this->cells[$i]->new_line,
$this->cells[$i]->align,
$this->cells[$i]->fill,
$this->cells[$i]->link);
parent::Cell( $a->width,
$a->height,
$a->text,
$a->border,
$a->new_line,
$a->align,
$a->fill,
$a->link);
break;
default:
@ -170,7 +176,7 @@ class PDF extends TFPDF
}
$this->cells=array();
}
function add_cell(Cellule $Ce)
private function add_cell(Cellule $Ce)
{
$size=count($this->cells);
$this->cells[$size]=$Ce;
@ -186,7 +192,7 @@ class PDF extends TFPDF
$this->add_cell(new Cellule($w,$h,$txt,$border,0,$align,$fill,'','M'));
}
function Ln($p_step=null){
function line_new($p_step=null){
$this->print_row();
if ( $this->bigger==0)
parent::Ln($p_step);
@ -298,7 +304,7 @@ class PDFLand extends PDF
//Title
$this->Cell(0,10,$this->dossier, 'B', 0, 'C');
//Line break
$this->Ln(20);
$this->line_new(20);
}
function Footer()
{
@ -308,7 +314,7 @@ class PDFLand extends PDF
$this->SetFont('DejaVuCond', 'I', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->Ln(3);
$this->line_new(3);
// Created by NOALYSS
$this->Cell(0,8,'Created by NOALYSS, online on http://www.noalyss.eu',0,0,'C',false,'http://www.noalyss.eu');
@ -343,7 +349,7 @@ class PDFBalance_simple extends PDF
$this->to);
$this->Cell(0,7,$titre,1,0,'C');
$this->Ln();
$this->line_new();
$this->SetFont('DejaVu','',6);
$this->Cell(20,7,'id','B');
$this->Cell(90,7,'Poste Comptable','B');
@ -351,7 +357,7 @@ class PDFBalance_simple extends PDF
$this->Cell(20,7,'Crédit','B',0,'L');
$this->Cell(20,7,'Solde','B',0,'L');
$this->Cell(20,7,'D/C','B',0,'L');
$this->Ln();
$this->line_new();
}
}