|
noalyss
Version-6.7.2
|
Print detail of operation PURCHASE or SOLD plus the items There is no report of the different amounts. More...
Public Member Functions | |
| __construct (Database $p_cn, Acc_Ledger $p_jrn) | |
| Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') | |
| export () | |
| export the ledger in PDF | |
| Footer () | |
| write the Footer | |
| Header () | |
| write the header of each page | |
| setDossierInfo ($dossier="n/a") | |
Print detail of operation PURCHASE or SOLD plus the items There is no report of the different amounts.
Definition at line 28 of file class_print_ledger_detail_item.php.
| Print_Ledger_Detail_Item::__construct | ( | Database $ | p_cn, |
| Acc_Ledger $ | p_jrn | ||
| ) |
Definition at line 30 of file class_print_ledger_detail_item.php.
References $p_jrn.
{
if($p_cn == null) die("No database connection. Abort.");
parent::__construct($p_cn,'L', 'mm', 'A4');
$this->ledger=$p_jrn;
}
| Print_Ledger_Detail_Item::Cell | ( | $ | w, |
| $ | h = 0, |
||
| $ | txt = '', |
||
| $ | border = 0, |
||
| $ | ln = 0, |
||
| $ | align = '', |
||
| $ | fill = false, |
||
| $ | link = '' |
||
| ) |
export the ledger in PDF
Definition at line 92 of file class_print_ledger_detail_item.php.
References $_GET, $comment, $jrn_type, $ledger, $nb, $row, Cell(), cn, Database\fetch_array(), PDF\Ln(), PDF\LongLine(), nbm(), and Database\num_row().
{
bcscale(2);
$jrn_type=$this->ledger->get_type();
switch ($jrn_type)
{
case 'VEN':
$ledger=new Acc_Ledger_Sold($this->cn, $this->ledger->jrn_def_id);
$ret_detail=$ledger->get_detail_sale($_GET['from_periode'],$_GET['to_periode']);
break;
case 'ACH':
$ledger=new Acc_Ledger_Purchase($this->cn, $this->ledger->jrn_def_id);
$ret_detail=$ledger->get_detail_purchase($_GET['from_periode'],$_GET['to_periode']);
break;
default:
die (__FILE__.":".__LINE__.'Journal invalide');
break;
}
if ( $ret_detail == null ) return;
$nb=Database::num_row($ret_detail);
$this->SetFont('DejaVu', '', 6);
$internal="";
$this->SetFillColor(220,221,255);
$high=4;
for ( $i=0;$i< $nb ;$i++)
{
$row=Database::fetch_array($ret_detail, $i);
if ($internal != $row['jr_internal'])
{
// 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->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);
$sum=bcadd($row['htva'],$row['tot_vat']);
$sum=bcsub($sum,$row['tot_tva_np']);
$this->Cell(20, $high, nbm($sum), 1, 0, 'R', true);
$internal=$row['jr_internal'];
$this->Ln(6);
//
// Header detail
$this->LongLine(30,$high,'QuickCode');
$this->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);
}
// Print detail sale / purchase
$this->LongLine(30,$high,$row['j_qcode']);
$this->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');
$sum=bcadd($row['price'],$row['vat']);
$this->Cell(20,$high,nbm($sum),0,0,'R');
$this->Ln(6);
}
}
write the Footer
Reimplemented from PDFLand.
Definition at line 72 of file class_print_ledger_detail_item.php.
References Cell(), and PDF\Ln().
{
$this->Ln(2);
$this->SetFont('Arial', 'I', 8);
$this->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');
// Created by NOALYSS
$this->Cell(0,8,'Created by NOALYSS, online on http://www.aevalys.eu',0,0,'R',false,'http://www.aevalys.eu');
}
write the header of each page
Reimplemented from PDFLand.
Definition at line 47 of file class_print_ledger_detail_item.php.
References Cell(), PDF\Ln(), and PDF\LongLine().
{
//Arial bold 12
$this->SetFont('DejaVu', 'B', 12);
//Title
$this->Cell(0,10,$this->dossier, 'B', 0, 'C');
//Line break
$this->Ln(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->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);
}
| Print_Ledger_Detail_Item::setDossierInfo | ( | $ | dossier = "n/a" | ) |
Reimplemented from PDF.
Definition at line 40 of file class_print_ledger_detail_item.php.
References PDF\$dossier, and name.
{
$this->dossier = dossier::name()." ".$dossier;
}