40 parent::__construct($p_anc_acc_list->db);
41 $this->anc_acc_list=$p_anc_acc_list;
43 1=>_(
'Comptabilité Analytique Fiche/Activité'),
44 2=>_(
"Comptabilité Analytique Poste comptable/Activité"),
45 3=>_(
'Comptabilité Analytique Activité/Fiche'),
46 4=>_(
'Comptabilité Analytique Activité/Poste Comptable'));
47 if (!isset($a_title[$p_anc_acc_list->card_poste]))
49 throw new Exception(
"PAAL.46 : invalid object");
51 $this->str_title=$a_title[$p_anc_acc_list->card_poste];
60 $p_pdf->SetFont(
'DejaVu',
'B', 7);
61 $p_pdf->write_cell(
$a_size[
'po_name']+
$a_size[
'po_description'], 5, _(
"Total"));
62 $p_pdf->write_cell(
$a_size[
'po_amount'], 5,
nbm($p_total, 2), 0, 0,
'R');
72 $p_pdf->SetFont(
'DejaVu',
'BU', 10);
73 switch ($this->anc_acc_list->card_poste)
77 $p_pdf->write_cell(190, 12,
78 $this->anc_acc_list->arow[$n_row_idx][
'j_qcode'].
" ".
79 $this->anc_acc_list->arow[$n_row_idx][
'name']);
84 $p_pdf->write_cell(190, 12,
85 $this->anc_acc_list->arow[$n_row_idx][
'j_poste'].
" ".
86 $this->anc_acc_list->arow[$n_row_idx][
'name']);
91 $p_pdf->write_cell(190, 12,
92 $this->anc_acc_list->arow[$n_row_idx][
'po_name'].
" ".
93 $this->anc_acc_list->arow[$n_row_idx][
'po_description']);
98 $p_pdf->write_cell(190, 12,
99 $this->anc_acc_list->arow[$n_row_idx][
'po_name'].
" ".
100 $this->anc_acc_list->arow[$n_row_idx][
'po_description']);
115 switch ($this->anc_acc_list->card_poste)
118 return $this->anc_acc_list->arow[$n_row_idx][
'f_id'];
121 return $this->anc_acc_list->arow[$n_row_idx][
'j_poste'];
124 return $this->anc_acc_list->arow[$n_row_idx][
'po_id'];
127 return $this->anc_acc_list->arow[$n_row_idx][
'po_id'];
137 $pdf=
new PDF($this->anc_acc_list->db);
138 $pdf->setDossierInfo(_(
"Balance croisée A/C"));
139 $pdf->SetTitle($this->str_title);
141 $pdf->SetFont(
'DejaVu',
'B', 12);
142 $pdf->write_cell(190, 12, $this->str_title, 1);
143 $pdf->AliasNbPages();
145 $nb_row=count($this->anc_acc_list->arow);
146 $a_size=array(
"po_name"=>60,
"po_description"=>100,
"po_amount"=>30);
148 $pdf->SetFont(
'DejaVu',
'', 7);
149 $tot_card=0; $tot_glob=0;
152 $fill=
$pdf->is_fill(
$i+1);
157 $pdf->SetFont(
'DejaVu',
'', 7);
165 $pdf->SetFont(
'DejaVu',
'', 7);
168 $this->anc_acc_list->arow[
$i][
'sum_amount']=($this->anc_acc_list->arow[
$i][
'sum_amount']==
"")?0:
169 $this->anc_acc_list->arow[
$i][
'sum_amount'];
171 $tot_card=bcadd($tot_card, $this->anc_acc_list->arow[
$i][
'sum_amount'], 2);
172 $tot_glob=bcadd($tot_glob, $this->anc_acc_list->arow[
$i][
'sum_amount'], 2);
173 if ($this->anc_acc_list->card_poste<3)
175 $pdf->write_cell(
$a_size[
'po_name'], 4, $this->anc_acc_list->arow[
$i][
'po_name'], 0, 0,
'L', $fill);
176 $pdf->write_cell(
$a_size[
'po_description'], 4, $this->anc_acc_list->arow[
$i][
'po_description'], 0, 0,
178 $pdf->write_cell(
$a_size[
'po_amount'], 4,
nbm($this->anc_acc_list->arow[
$i][
'sum_amount'], 2), 0, 0,
181 elseif ($this->anc_acc_list->card_poste==3)
183 $pdf->write_cell(
$a_size[
'po_name'], 4, $this->anc_acc_list->arow[
$i][
'j_qcode'], 0, 0,
'L', $fill);
184 $pdf->write_cell(
$a_size[
'po_description'], 4, $this->anc_acc_list->arow[
$i][
'name'], 0, 0,
'L', $fill);
185 $pdf->write_cell(
$a_size[
'po_amount'], 4,
nbm($this->anc_acc_list->arow[
$i][
'sum_amount'], 2), 0, 0,
188 elseif ($this->anc_acc_list->card_poste==4)
190 $pdf->write_cell(
$a_size[
'po_name'], 4, $this->anc_acc_list->arow[
$i][
'j_poste'], 0, 0,
'L', $fill);
191 $pdf->write_cell(
$a_size[
'po_description'], 4, $this->anc_acc_list->arow[
$i][
'name'], 0, 0,
'L', $fill);
192 $pdf->write_cell(
$a_size[
'po_amount'], 4,
nbm($this->anc_acc_list->arow[
$i][
'sum_amount'], 2), 0, 0,
198 $pdf->SetFont(
'DejaVu',
'', 7);
201 $pdf->write_cell(
$a_size[
'po_name']+
$a_size[
'po_description'], 10, _(
"Total Global"),
'LBT');
202 $pdf->write_cell(
$a_size[
'po_amount'], 10,
nbm($tot_glob, 2),
'RBT', 0,
'R');
247 if ($this->anc_acc_list->check()!=0)
249 throw new Exception(_(
"date invalide"));
251 switch ($this->anc_acc_list->card_poste)
255 $this->anc_acc_list->load_card();
260 $this->anc_acc_list->load_poste();
265 $this->anc_acc_list->load_anc_card();
270 $this->anc_acc_list->load_anc_account();
274 throw new Exception(
'AAL700:unknown export');
nbm($p_number, $p_dec=2)
format the number with a sep.
Manage the class for reporting about Analytic Accountancy and Accountancy : card - analytic account,...
__construct(Anc_Acc_List $p_anc_acc_list)
set_anc_acc_list($anc_acc_list)
put_total($a_size, $p_pdf, $p_total)
Display the total amount.
export_pdf()
Main function , export the ANCBCC list to PDF, crossed by activity , account or card.
get_previous($n_row_idx)
Return the previous item : card or account or activity depending of the crossing method.
put_title($p_pdf, $n_row_idx)
Print the title.
set_str_title($str_title)
API for creating PDF, unicode, based on tfpdf.
if( $delta< 0) elseif( $delta==0)