19 require_once NOALYSS_INCLUDE.
'/lib/class_pdf.php';
27 $this->setFont(
'DejaVu',
'B', 14);
28 $this->Cell(190, 10, _(
'Amortissement : Liste de biens'), 1, 2,
'C');
30 $this->col_size=array(
'qcode'=>40,
'name'=>85,
'desc'=>120,
'date.purch'=>20,
'year.purch'=>20,
'#amort'=>10,
'amount.purch'=>30,
'amount.amort'=>30,
'%'=>20,
'amount.remain'=>30,
'amount.delta'=>30);
32 $this->setFont(
'DejaVu',
'B', 7);
33 $this->Cell($this->col_size[
'qcode'], 8, _(
'QCode'));
34 $this->Cell($this->col_size[
'name'], 8, _(
'Nom'));
35 $this->Cell($this->col_size[
'date.purch'], 8, _(
'Date achat'));
36 $this->Cell($this->col_size[
'year.purch'], 8, _(
'Année achat'));
37 $this->Cell($this->col_size[
'#amort'], 8, _(
'Nbre'), 0, 0,
'R');
38 $this->Cell($this->col_size[
'amount.purch'], 8, _(
'Montant'), 0, 0,
'R');
39 $this->Cell($this->col_size[
'amount.amort'], 8, _(
'A amortir'), 0, 0,
'R');
40 $this->Cell($this->col_size[
'amount.delta'], 8, _(
'Val. Comptable Net'), 0, 0,
'R');
47 $this->SetFont(
'DejaVu',
'', 7);
48 $ret=$cn->get_array(
"select * from amortissement.v_amortissement_summary where a_visible='Y' order by a_start,a_date");
52 for ($i=0;$i<count(
$ret);$i++)
56 $this->SetFillColor(220, 221, 255);
61 $this->SetFillColor(0, 0, 0);
65 $this->write_cell($this->col_size[
'qcode'], 8,
$ret[$i][
'quick_code'], 0, 0,
'L', $fill);
66 $this->write_cell($this->col_size[
'name'], 8,
$ret[$i][
'vw_name'], 0, 0,
'L', $fill);
67 $this->write_cell($this->col_size[
'date.purch'], 8, format_date(
$ret[$i][
'a_date']), 0, 0,
'L', $fill);
68 $this->write_cell($this->col_size[
'year.purch'], 8,
$ret[$i][
'a_start'], 0, 0,
'C', $fill);
69 $this->write_cell($this->col_size[
'#amort'], 8, round(
$ret[$i][
'a_nb_year']), 0, 0,
'R', $fill);
70 $this->write_cell($this->col_size[
'amount.purch'], 8, nb(
$ret[$i][
'a_amount']), 0, 0,
'R', $fill);
71 $this->write_cell($this->col_size[
'amount.amort'], 8, nb(
$ret[$i][
'amort_done']), 0, 0,
'R', $fill);
72 $delta=bcsub(
$ret[$i][
'a_amount'],
$ret[$i][
'amort_done']);
73 $this->write_cell($this->col_size[
'amount.delta'], 8, nb($delta), 0, 0,
'R', $fill);
81 $deca=$this->col_size[
'qcode']+$this->col_size[
'name']+$this->col_size[
'date.purch']+$this->col_size[
'year.purch']+$this->col_size[
'#amort'];
82 $this->write_cell($deca+$this->col_size[
'amount.purch'],8,nb(
$tot_purchase) ,0,0,
'R',0);
83 $this->write_cell($this->col_size[
'amount.amort'],8,nb(
$tot_amorti) ,0,0,
'R',0);
84 $this->write_cell($this->col_size[
'amount.delta'],8,nb(
$tot_remain) ,0,0,
'R',0);
86 $this->Output(
'listing-amort.pdf',
'I');