noalyss Version-9
Public Member Functions | Private Attributes
Print_Ledger_Financial Class Reference

print a listing of financial More...

+ Inheritance diagram for Print_Ledger_Financial:
+ Collaboration diagram for Print_Ledger_Financial:

Public Member Functions

 __construct (Database $p_cn, Acc_Ledger $p_jrn, $p_from, $p_to)
 
 export ()
 print the pdf for a financial ledger More...
 
 Footer ()
 
 Header ()
 
- Public Member Functions inherited from Print_Ledger
 __construct (\Database $p_cn, $orientation, $unit, $format, Acc_Ledger $p_ledger, $p_from, $p_to, $p_filter_operation)
 integer parm_periode.p_id , end periode; More...
 
 get_filter_operation ()
 
 get_from ()
 
 get_ledger ()
 
 get_to ()
 
 set_filter_operation ($filter_operation)
 Filter the operations ,. More...
 
 set_from ($from)
 
 set_ledger ($ledger)
 
 set_to ($to)
 
- Public Member Functions inherited from PDF
 __construct (Database $p_cn, $orientation='P', $unit='mm', $format='A4')
 
 Footer ()
 
 get_tiers ($p_jr_id, $p_jrn_type)
 retrieve the client name and quick_code More...
 
 Header ()
 
 set_filter_operation ($filter_operation)
 
 setDossierInfo ($dossier="n/a")
 
- Public Member Functions inherited from PDF_Core
 __construct ( $orientation='P', $unit='mm', $format='A4')
 
 get_margin_bottom ()
 
 get_margin_left ()
 
 get_margin_right ()
 
 get_margin_top ()
 
 get_orientation ()
 
 get_page_size ()
 
 get_unit ()
 
 is_fill ($p_step)
 If the step is even then return 1 and set the backgroup color to blue , otherwise returns 0, and set the background color to white It is use to compute alternated colored row , it the parameter fill in write_cell and cell. More...
 
 line_new ($p_step=null)
 Print all the cell stored and call Ln (new line) More...
 
 LongLine ($w, $h, $txt, $border=0, $align='', $fill=false)
 
 write_cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
 

Private Attributes

 $rap_amount
 
 $tp_amount
 

Additional Inherited Members

- Static Public Member Functions inherited from Print_Ledger
static available_ledger ($get_from_periode)
 find all the active ledger for the exerice of the periode and readable by the current user @global type $g_user More...
 
static factory (Database $cn, $p_type_export, Acc_Ledger $p_ledger, $p_from, $p_to, $p_filter_operation)
 Create an object Print_Ledger* depending on $p_type_export ( 0 => accounting 1-> one row per operation 2-> detail of item) More...
 
- Data Fields inherited from PDF
 $cn = null
 
 $date = ""
 
 $dossier = "n/a"
 
 $own = null
 
 $soc = ""
 
- Protected Member Functions inherited from Print_Ledger
 build_filter_operation ()
 Build a SQL clause to filter operation depending if they are paid, unpaid or no filter. More...
 
- Protected Member Functions inherited from PDF_Core
 print_row ()
 print the current array of cell and reset it , if different colors are set on the same row you have to print it before changing More...
 
- Protected Attributes inherited from Print_Ledger
 $filter_operation
 

Detailed Description

print a listing of financial

Definition at line 31 of file print_ledger_fin.class.php.

Constructor & Destructor Documentation

◆ __construct()

Print_Ledger_Financial::__construct ( Database  $p_cn,
Acc_Ledger  $p_jrn,
  $p_from,
  $p_to 
)

Definition at line 36 of file print_ledger_fin.class.php.

37 {
38 parent::__construct($p_cn,'P','mm','A4',$p_jrn,$p_from,$p_to,'all');
39 $this->jrn_type=$p_jrn->get_type();
40
41 // report from begin exercice
42 $this->rap_amount=0;
43
44 // total page
45 $this->tp_amount=0;
46
47 $amount=$this->get_ledger()->previous_amount($this->get_from());
48 $this->rap_amount=$amount['amount'];
49 }

References $amount, $p_jrn, Print_Ledger\get_from(), and Print_Ledger\get_ledger().

+ Here is the call graph for this function:

Member Function Documentation

◆ export()

Print_Ledger_Financial::export ( )

print the pdf for a financial ledger

Definition at line 98 of file print_ledger_fin.class.php.

99 {
100 $ledger=$this->get_ledger();
101 $a_jrn=$ledger->get_operation($this->get_from(),$this->get_to());
102
103 $this->SetFont('DejaVu', '', 6);
104 if ( $a_jrn == null ) return;
105 bcscale(2);
106
107 $prepare=new Prepared_Query($this->cn);
108 $prepare->prepare_currency();
109
110 for ( $i=0;$i<count($a_jrn);$i++)
111 {
112 $row=$a_jrn[$i];
113 $this->write_cell(15,5,$row['pj']);
114 $this->write_cell(10,5,$row['date_fmt']);
115 $this->write_cell(10,5,$row['internal']);
116
117 $name=$ledger->get_tiers($this->jrn_type,$row['id']);
118 $this->write_cell(40,5,$name,0,0,'L');
119
120 $this->LongLine(60,5,$row['comment'],0,'L');
121 $amount=$this->cn->get_value('select qf_amount from quant_fin where jr_id=$1',array( $row['id']));
122 $ret_amount_cur=$this->cn->execute("amount_cur",array($row['id']));
123
124 if ( $this->cn->count($ret_amount_cur) == 1) {
125
126 $amount_cur=Database::fetch_result($ret_amount_cur, 0,1);
127 $this->write_cell(20,5,sprintf('%s %s',nbm($amount_cur),$row['cr_code_iso']),0,0,'R');
128 } else {
129
130 $this->write_cell(20,5,"",0,0,'R');
131 }
132 $this->write_cell(20,5,sprintf('%s',nbm($amount)),0,0,'R');
133 $this->line_new(5);
134 $this->tp_amount=bcadd($this->tp_amount,$amount);
135
136 }
137 }
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition: ac_common.php:137
$input_from cn
Definition: balance.inc.php:66
static fetch_result($ret, $p_row=0, $p_col=0)
wrapper for the function pg_fetch_all
line_new($p_step=null)
Print all the cell stored and call Ln (new line)
LongLine($w, $h, $txt, $border=0, $align='', $fill=false)
write_cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
contains prepared query used in different classes of the application
$ledger
concerned Ledger

References $amount, $i, Print_Ledger\$ledger, $name, $row, cn, DatabaseCore\fetch_result(), Print_Ledger\get_from(), Print_Ledger\get_ledger(), Print_Ledger\get_to(), PDF_Core\line_new(), PDF_Core\LongLine(), nbm(), and PDF_Core\write_cell().

+ Here is the call graph for this function:

◆ Footer()

Print_Ledger_Financial::Footer ( )

Reimplemented from PDF.

Definition at line 73 of file print_ledger_fin.class.php.

74 {
75 $this->SetFont('DejaVu', 'B', 7);
76
77 $this->Cell(40,6,_('Total page'),0,0,'R');
78 $this->Cell(40,6,nbm($this->tp_amount),0,0,'R');
79 bcscale(2);
80 $this->rap_amount=bcadd($this->rap_amount,$this->tp_amount);
81 $this->Cell(40,6,_('Total à reporter'),0,0,'R');
82 $this->Cell(40,6,nbm($this->rap_amount),0,0,'R');
83 $this->tp_amount=0;
84 //Position at 2 cm from bottom
85 $this->SetY(-20);
86 //Arial italic 8
87 $this->SetFont('Arial', 'I', 8);
88 //Page number
89 $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
90 $this->Ln(3);
91 // Created by NOALYSS
92 $this->Cell(0,8,'Created by NOALYSS, online on https://www.noalyss.eu',0,0,'C',false,'https://www.noalyss.eu');
93
94 }

References nbm().

+ Here is the call graph for this function:

◆ Header()

Print_Ledger_Financial::Header ( )

Reimplemented from PDF.

Definition at line 50 of file print_ledger_fin.class.php.

51 {
52 //Arial bold 12
53 $this->SetFont('DejaVu', 'B', 12);
54 //Title
55 $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
56 //Line break
57 $this->SetFont('DejaVu', 'B', 7);
58 $this->Ln(10);
59 $this->Cell(40,6,_('report'),0,0,'R');
60 $this->Cell(40,6,nbm($this->rap_amount),0,0,'R');
61 $this->Ln(6);
62 $this->SetFont('DejaVu', 'B', 7);
63 $this->Cell(15,6,_('Piece'));
64 $this->Cell(10,6,_('Date'));
65 $this->Cell(10,6,_('Interne'));
66 $this->Cell(40,6,_('Dest/Orig'));
67 $this->Cell(60,6,_('Commentaire'));
68 $this->Cell(20,6,_('Devise'),0,0,'R');
69 $this->Cell(20,6,_('Montant'),0,0,'R');
70 $this->Ln(6);
71
72 }

References nbm().

+ Here is the call graph for this function:

Field Documentation

◆ $rap_amount

Print_Ledger_Financial::$rap_amount
private

Definition at line 33 of file print_ledger_fin.class.php.

◆ $tp_amount

Print_Ledger_Financial::$tp_amount
private

Definition at line 34 of file print_ledger_fin.class.php.


The documentation for this class was generated from the following file: