noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
Print_Ledger_Detail_Item Class Reference

Print detail of operation PURCHASE or SOLD plus the items There is no report of the different amounts. More...

+ Inheritance diagram for Print_Ledger_Detail_Item:
+ Collaboration diagram for Print_Ledger_Detail_Item:

Public Member Functions

 __construct (Database $p_cn, Acc_Ledger $p_jrn, $p_from, $p_to, $p_filter_operation)
 
 export ()
 export the ledger in PDF
 
 Footer ()
 write the Footer
 
 Header ()
 write the header of each page
 
 setDossierInfo ($dossier="n/a")
 
- 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)
 
 get_filter_operation ()
 
 get_from ()
 
 get_ledger ()
 
 get_to ()
 
 set_filter_operation ($filter_operation)
 Filter the operations ,.
 
 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')
 
 get_tiers ($p_jr_id, $p_jrn_type)
 retrieve the client name and quick_code
 
- Public Member Functions inherited from PDF_Core
 __construct ( $orientation='P', $unit='mm', $format='A4')
 
 fill_row ($enable)
 set color for row ,
 
 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.
 
 line_new ($p_step=null)
 Print all the cell stored and call Ln (new line)
 
 LongLine ($w, $h, $txt, $border=0, $align='', $fill=false)
 add a cell with automatic return to the line if the text is too long, deprecated , it calls only PDFCore::write_cell_
 
 write_cell ($width, $height=0, $txt='', $border=0, $interline=0, $align='', $fill=false, $link='')
 add a cell the text is not cut and don't return to this line if too large
 
 write_multi ($width, $interline, $txt, $border=0, $align='', $fill=false)
 add a cell with automatic return to the line if the text is too long
 

Protected Attributes

 $show_col
 $show_col (bool) show columns
 
- Protected Attributes inherited from Print_Ledger
 $a_Tva
 $other_tax_previous (array)
 
 $filter_operation
 See Acc_Ledger_History::filter_operation.
 
 $flag_other_tax
 $flag_other_tax(bool) true if other tax exists
 
 $from
 
 $jrn_type
 
 $ledger
 concerned Ledger
 
 $other_tax_previous
 
 $previous
 internal variables for computing sum on PDF Listing
 
 $rap_htva
 $previous (array) see Acc_Ledger->previous_amount
 
 $rap_nd
 $rap_nd (float) $no-deductible tax
 
 $rap_other
 VAT when page starts.
 
 $rap_other_tax
 $rap_other_tav, amount to report for other tax than VAT
 
 $rap_priv
 $rap_priv (float) personal expense
 
 $rap_tva
 $rap_tva array(tva_id,amount)
 
 $rap_tva_np
 $rap_tva_np VAT not deductible
 
 $rap_tvac
 $rap_tvac (float) previous amount
 
 $show_col
 
 $to
 
 $tp_htva
 $tp_htva (float) total page price w/o VAT
 
 $tp_nd
 $tp_nd (float) total page price w/o VAT
 
 $tp_priv
 $tp_priv (float) total page personal expense
 
 $tp_tva
 $tp_tva (float) total page VAT
 
 $tp_tva_np
 $tp_tva_np (float) total page not deductible
 
 $tp_tvac
 $tp_tvac (float) total page full price All Tax Incl.
 
- Protected Attributes inherited from PDF_Core
 $bigger
 
 $cells =array()
 

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
 
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)
 
- Static Public Member Functions inherited from PDF
static test_me ()
 test the class
 
- 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.
 
- Protected Member Functions inherited from PDF_Core
 add_cell (Cellule $Ce)
 
 check_page_add ()
 Check if a page must be added due a MultiCell.
 
 count_nb_row ($p_text, $p_colSize)
 Count the number of rows a p_text will take for a multicell.
 
 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
 

Detailed Description

Print detail of operation PURCHASE or SOLD plus the items There is no report of the different amounts.

Author
danydb

Definition at line 27 of file print_ledger_detail_item.class.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 32 of file print_ledger_detail_item.class.php.

33 {
34
35 parent::__construct($p_cn,'L', 'mm', 'A4',$p_jrn,$p_from,$p_to,$p_filter_operation);
36 $this->show_col=true;
37 }

References $p_jrn.

Member Function Documentation

◆ export()

Print_Ledger_Detail_Item::export ( )

export the ledger in PDF

Definition at line 88 of file print_ledger_detail_item.class.php.

89 {
90 bcscale(2);
91 $jrn_type=$this->get_ledger()->get_type();
92
93 switch ($jrn_type)
94 {
95 case 'VEN':
96 $ledger=new Acc_Ledger_Sale($this->cn, $this->get_ledger()->jrn_def_id);
97 $ret_detail=$ledger->get_detail_sale($this->get_from(),$this->get_to(), $this->filter_operation);
98 break;
99 case 'ACH':
100 $ledger=new Acc_Ledger_Purchase($this->cn, $this->get_ledger()->jrn_def_id);
101 $ret_detail=$ledger->get_detail_purchase($this->get_from(),$this->get_to(),$this->filter_operation);
102 break;
103 default:
104 die (__FILE__.":".__LINE__.'Journal invalide');
105 break;
106 }
107 if ( $ret_detail == null ) return;
108
109 $prepared_query=new Prepared_Query($this->cn);
110 $prepared_query->prepare_reconcile_date();
111
112 $nb=Database::num_row($ret_detail);
113 $this->SetFont('DejaVu', '', 6);
114 $internal="";
115 $this->fill_row(0);
116 $high=8;
117 $high_lg=8;
118 for ( $i=0;$i< $nb ;$i++)
119 {
120
121 $row=Database::fetch_array($ret_detail, $i);
122 if ($internal != $row['jr_internal'])
123 {
124
125 // Print the general info line width=270mm
126 $this->write_multi(20, $high_lg, $row['jr_date'],1, 'L', true);
127 $this->write_cell(20, $high,$row['jr_pj_number'].".". $row['jr_internal'], 1, 0, 'L', true);
128 $this->write_multi(50, $high_lg, $row['quick_code']." ".$row['tiers_name'],1,'L',true);
129 $this->write_multi(80, $high_lg, $row['jr_comment'],1,'L',true);
130 $this->write_cell(20, $high, nbm($row['htva']), 1, 0, 'R', true);
131 $this->write_cell(20, $high, nbm($row['tot_tva_np']), 1, 0, 'R', true);
132 $this->write_cell(20, $high, nbm($row['other_tax_amount']), 1, 0, 'R', true);
133 $this->write_cell(20, $high, nbm($row['tot_vat']), 1, 0, 'R', true);
134 $sum=noalyss_bcadd($row['htva'],$row['tot_vat']);
135 $sum=noalyss_bcadd($row['other_tax_amount'],$sum);
136 $sum=noalyss_bcsub($sum,$row['tot_tva_np']);
137 $this->write_cell(20, $high, nbm($sum), 1, 0, 'R', true);
138 $internal=$row['jr_internal'];
139 $this->line_new(6);
140 // Payment info
141 // Prepare the query for reconcile date
142 $ret_reconcile=$this->cn->execute('reconcile_date', array($row['jr_id']));
144 for ($e=0; $e<$max; $e++)
145 {
147 $msg=( $ret_row['qcode_bank']!="")?"[".$ret_row['qcode_bank']."]":$ret_row['jr_internal'];
148 $this->write_cell(200, $high,
149 sprintf(_("Paiement montant %s date %s methoded %s "), $ret_row['jr_montant'],
150 $ret_row['jr_date'], $msg
151 ));
152 $this->line_new(6);
153 }
154 // on the first line, the code for each column is displaid
155 if ( $this->show_col == true ) {
156
157
158 // Header detail
159 $this->write_multi(30,$high_lg,_('QuickCode'));
160 $this->write_cell(30,$high,_('Poste'));
161 $this->write_multi(70,$high_lg,_('Libellé'));
162 $this->write_cell(20,$high,_('Prix/Unit'),0,0,'R');
163 $this->write_cell(20,$high,_('Quant.'),0,0,'R');
164 $this->write_cell(20,$high,_('HTVA'),0,0,'R');
165 $this->write_cell(20,$high,_('TVA NP'),0,0,'R');
166 $this->write_cell(20,$high,_('Code TVA'));
167 $this->write_cell(20,$high,_('TVA'),0,0,'R');
168 $this->write_cell(20,$high,_('TVAC'),0,0,'R');
169 $this->line_new(6);
170 $this->show_col=false;
171 }
172 }
173 // Print detail sale / purchase
174 $this->write_multi(30,$high_lg,$row['j_qcode']);
175 $this->write_cell(30,$high,$row['j_poste']);
176 $comment=($row['j_text']=="")?$row['item_name']:$row['j_text'];
177 $this->write_multi(70,$high_lg,$comment);
178 $this->write_cell(20,$high,nbm($row['price_per_unit']),0,0,'R');
179 $this->write_cell(20,$high,nbm($row['quantity']),0,0,'R');
180 $this->write_cell(20,$high,nbm($row['price']),0,0,'R');
181 $this->write_cell(20,$high,nbm($row['vat_sided']),0,0,'R');
182 $this->write_cell(20,$high,$row['tva_label']);
183 $this->write_cell(20,$high,nbm($row['vat']),0,0,'R');
184 $sum=bcadd($row['price'],$row['vat']);
185 $this->write_cell(20,$high,nbm($sum),0,0,'R');
186 $this->line_new(6);
187
188 }
189 }
noalyss_bcsub($p_first, $p_second, $p_decimal=4)
noalyss_bcadd($p_first, $p_second, $p_decimal=4)
nbm($p_number, $p_dec=2)
format the number with a sep.
margin jrn_def_id
$input_from cn
_("actif, passif,charge,...")
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
line_new($p_step=null)
Print all the cell stored and call Ln (new line)
write_cell($width, $height=0, $txt='', $border=0, $interline=0, $align='', $fill=false, $link='')
add a cell the text is not cut and don't return to this line if too large
write_multi($width, $interline, $txt, $border=0, $align='', $fill=false)
add a cell with automatic return to the line if the text is too long
fill_row($enable)
set color for row ,
$ledger
concerned Ledger

References $e, $i, Print_Ledger\$jrn_type, Print_Ledger\$ledger, $max, $msg, $nb, $ret_reconcile, $row, _, cn, DatabaseCore\fetch_array(), PDF_Core\fill_row(), Print_Ledger\get_from(), Print_Ledger\get_ledger(), Print_Ledger\get_to(), jrn_def_id, PDF_Core\line_new(), nbm(), noalyss_bcadd(), noalyss_bcsub(), DatabaseCore\num_row(), PDF_Core\write_cell(), and PDF_Core\write_multi().

+ Here is the call graph for this function:

◆ Footer()

Print_Ledger_Detail_Item::Footer ( )

write the Footer

Reimplemented from PDF.

Definition at line 72 of file print_ledger_detail_item.class.php.

73 {
74 $this->Ln(2);
75 $this->SetFont('Arial', 'I', 8);
76 $this->Cell(50,8,' Journal '.$this->get_ledger()->get_name(),0,0,'C');
77 //Arial italic 8
78 //Page number
79 $this->Cell(30,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
80 // Created by NOALYSS
81 $this->Cell(0,8,'Created by NOALYSS, online on https://www.noalyss.eu',0,0,'R',false,'https://www.noalyss.eu');
82 }

References Print_Ledger\get_ledger().

+ Here is the call graph for this function:

◆ Header()

Print_Ledger_Detail_Item::Header ( )

write the header of each page

Reimplemented from PDF.

Definition at line 46 of file print_ledger_detail_item.class.php.

47 {
48 //Arial bold 12
49 $this->SetFont('DejaVu', 'B', 12);
50 //Title
51 $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
52 //Line break
53 $this->Ln(20);
54 $high=6;
55 $this->SetFont('DejaVu', '', 6);
56 $this->write_cell(20, $high, _('Date'),0,0, 'L', false);
57 $this->write_cell(20, $high, _('Numéro interne'), 0,0, 'L', false);
58 $this->write_cell(50, $high, _('Code'),0,0,'L',false);
59 $this->write_cell(80, $high, _('Libellé'),0,0,'L',false);
60 $this->write_cell(20, $high, _('Tot HTVA'), 0, 0,'R', false,'R', false);
61 $this->write_cell(20, $high, _('Tot TVA NP'), 0, 0,'R', false, false);
62 $this->write_cell(20, $high, _("Autre Tx"), 0, 0, 'R', false);
63 $this->write_cell(20, $high, _('Tot TVA'), 0, 0, 'R', false);
64 $this->write_cell(20, $high, _('TVAC'), 0, 0, 'R', false);
65 $this->line_new(6);
66 $this->show_col=true;
67
68 }

References _, PDF_Core\line_new(), and PDF_Core\write_cell().

+ Here is the call graph for this function:

◆ setDossierInfo()

Print_Ledger_Detail_Item::setDossierInfo ( $dossier = "n/a")

Reimplemented from PDF.

Definition at line 39 of file print_ledger_detail_item.class.php.

40 {
41 $this->dossier = dossier::name()." ".$dossier;
42 }
$dossier
Definition pdf.class.php:38

References PDF\$dossier.

Field Documentation

◆ $show_col

Print_Ledger_Detail_Item::$show_col
protected

$show_col (bool) show columns

Definition at line 30 of file print_ledger_detail_item.class.php.


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