76 $this->pdf->SetFont(
'DejaVu',
'', 6);
77 $this->pdf->write_cell(50, 6,
_(
'Journal'));
79 $this->pdf->line_new(4);
82 $this->pdf->write_cell(50, 6,
_(
"Date"));
83 $this->pdf->write_cell(100, 6, $this->acc_detail->det->jr_date);
84 $this->pdf->line_new(4);
85 $this->pdf->write_cell(50, 6,
_(
"Echéance"));
86 $this->pdf->write_cell(100, 6, $this->acc_detail->det->jr_ech);
87 $this->pdf->line_new(4);
88 $this->pdf->write_cell(50, 6,
_(
"Paiement"));
89 $this->pdf->write_cell(100, 6, $this->acc_detail->det->jr_date_paid);
90 $this->pdf->line_new(4);
91 $this->pdf->write_cell(50, 6,
_(
"Numéro interne"));
92 $this->pdf->write_cell(100, 6, $this->acc_detail->det->jr_internal);
93 $this->pdf->line_new(4);
94 $this->pdf->write_cell(50, 6,
_(
"Pièce"));
95 $this->pdf->write_cell(100, 6, $this->acc_detail->det->jr_pj_number);
96 $this->pdf->line_new(4);
97 $this->pdf->write_cell(50, 6,
_(
"Commentaire"));
98 $this->pdf->LongLine(130, 3 , $this->acc_detail->det->jr_comment);
99 $this->pdf->line_new(4);
100 $this->pdf->write_cell(50, 6,
_(
"Nom document"));
101 $this->pdf->write_cell(100, 6, $this->acc_detail->det->jr_pj_name);
102 if ($this->acc_detail->det->currency_id != 0)
105 $this->pdf->line_new(4);
106 $this->pdf->write_cell(50, 6,
_(
"Devise"));
107 $this->pdf->write_cell(50, 6,
$currency->get_code());
108 $this->pdf->write_cell(25, 6,
_(
"Taux utilisé"));
109 $this->pdf->write_cell(30, 6,
nb($this->acc_detail->det->currency_rate,4));
110 $this->pdf->write_cell(25, 6,
_(
"Taux référence"));
111 $this->pdf->write_cell(30, 6,
nbm($this->acc_detail->det->currency_rate_ref,4));
112 $this->pdf->line_new(4);
113 $this->pdf->write_cell(50, 6,
_(
"Montant Devise"));
114 $this->pdf->write_cell(50, 6,
nb($this->acc_detail->get_currency_amount(),4));
117 $this->pdf->line_new(4);
119 $this->pdf->line_new(8);
127 if ( $this->acc_detail->signature==
'FIN' ||
128 $this->acc_detail->signature==
"ODS") {
131 if ($this->acc_detail->signature==
"ACH") {
133 $tiers_id=$this->acc_detail->det->array[0][
'qp_supplier'];
136 $tiers_id=$this->acc_detail->det->array[0][
'qs_client'];
138 $this->pdf->SetFont(
'DejaVu',
'B', 10);
142 $this->pdf->SetFont(
'DejaVu',
'B', 6);
143 $this->pdf->write_cell(50, 6,
$tiers);
144 $this->pdf->write_cell(140, 6,
$fiche->getName().
145 " ".$fiche->get_quick_code());
146 $this->pdf->line_new(4);
147 if ($this->acc_detail->signature==
"ACH") {
174 $nb=count($this->acc_detail->det->array);
175 $width=array(10,30,50,25,25,25,25);
179 $this->pdf->SetFont(
'DejaVu',
'B', 6);
180 $this->pdf->write_cell(
$width[0],6,
_(
"n°"),
"B");
181 $this->pdf->write_cell(
$width[1],6,
_(
"code"),
"B");
182 $this->pdf->write_cell(
$width[2],6,
_(
"Libellé"),
"B");
183 $this->pdf->write_cell(
$width[3],6,
_(
"Montant HTVA"),
"B",0,
"R");
184 $this->pdf->write_cell(
$width[4],6,
_(
"TVA"),
"B");
185 $this->pdf->write_cell(
$width[5],6,
_(
"Montant TVA"),
"B",0,
"R");
186 $this->pdf->write_cell(
$width[6],6,
_(
"Total"),
"B",0,
"R");
187 $this->pdf->line_new(6);
188 $this->pdf->SetFont(
'DejaVu',
'', 6);
190 $row=$this->acc_detail->det->array[
$i];
193 $this->pdf->write_cell(
$width[0],6,
$i+1);
194 $this->pdf->write_cell(
$width[1],6,
$fiche->get_quick_code());
195 $this->pdf->LongLine(
$width[2],6,
$row[
'j_text']);
196 $this->pdf->write_cell(
$width[3],6,
nbm(
$row[
"qs_price"],2),
"",0,
"R");
199 $this->pdf->write_cell(
$width[5],6,
nbm(
$row[
"qs_vat"],2),
"",0,
"R");
200 $this->pdf->write_cell(
$width[6],6,
nbm(bcadd(
$row[
"qs_price"],
$row[
"qs_vat"]),2),
"",0,
"R");
201 $this->pdf->line_new(6);
203 $sum_amount=bcadd($sum_amount,
$row[
"qs_price"]);
204 $sum_vat=bcadd($sum_vat,
$row[
"qs_vat"]);
210 $this->pdf->SetFont(
'DejaVu',
'B', 6);
211 $this->pdf->write_cell(
$width[0],6,
"");
212 $this->pdf->write_cell(
$width[1],6,
"");
213 $this->pdf->write_cell(
$width[2],6,
"");
214 $this->pdf->write_cell(
$width[3],6,
nbm($sum_amount,2),
"",0,
"R");
215 $this->pdf->write_cell(
$width[4],6,
nbm($sum_other_tax,2),
"",0,
"R");
216 $this->pdf->write_cell(
$width[5],6,
nbm($sum_vat,2),
"",0,
"R");
218 $sum_amount=bcadd($sum_other_tax,$sum_amount);
219 $this->pdf->write_cell(
$width[6],6,
nbm(bcadd($sum_amount,$sum_vat),2),
"",0,
"R");
220 $this->pdf->line_new(4);
225 $nb=count($this->acc_detail->det->array);
226 $width=array(10,30,50,25,25,25,25);
230 $this->pdf->SetFont(
'DejaVu',
'B', 6);
231 $this->pdf->write_cell(
$width[0],6,
_(
"n°"),
"B");
232 $this->pdf->write_cell(
$width[1],6,
_(
"code"),
"B");
233 $this->pdf->write_cell(
$width[2],6,
_(
"Libellé"),
"B");
234 $this->pdf->write_cell(
$width[3],6,
_(
"Montant HTVA"),
"B",0,
"R");
235 $this->pdf->write_cell(
$width[4],6,
_(
"TVA"),
"B");
236 $this->pdf->write_cell(
$width[5],6,
_(
"Montant TVA"),
"B",0,
"R");
237 $this->pdf->write_cell(
$width[6],6,
_(
"Total"),
"B",0,
"R");
238 $this->pdf->line_new(6);
239 $this->pdf->SetFont(
'DejaVu',
'', 6);
241 $row=$this->acc_detail->det->array[
$i];
244 $this->pdf->write_cell(
$width[0],6,
$i+1);
245 $this->pdf->write_cell(
$width[1],6,
$fiche->get_quick_code());
246 $this->pdf->LongLine(
$width[2],6,
$row[
'j_text']);
247 $this->pdf->write_cell(
$width[3],6,
nbm(
$row[
"qp_price"],2),
"",0,
"R");
250 $this->pdf->write_cell(
$width[5],6,
nbm(
$row[
"qp_vat"],2),
"",0,
"R");
251 $this->pdf->write_cell(
$width[6],6,
nbm(bcadd(
$row[
"qp_price"],
$row[
"qp_vat"]),2),
"",0,
"R");
252 $this->pdf->line_new(6);
254 $sum_amount=bcadd($sum_amount,
$row[
"qp_price"]);
255 $sum_vat=bcadd($sum_vat,
$row[
"qp_vat"]);
261 $this->pdf->SetFont(
'DejaVu',
'B', 6);
262 $this->pdf->write_cell(
$width[0],6,
"");
263 $this->pdf->write_cell(
$width[1],6,
"");
264 $this->pdf->write_cell(
$width[2],6,
"");
265 $this->pdf->write_cell(
$width[3],6,
nbm($sum_amount,2),
"",0,
"R");
266 $this->pdf->write_cell(
$width[4],6,
"");
267 $this->pdf->write_cell(
$width[5],6,
nbm($sum_vat,2),
"",0,
"R");
268 $this->pdf->write_cell(
$width[4],6,
nbm($sum_other_tax,2),
"",0,
"R");
269 $sum_amount=bcadd($sum_other_tax,$sum_amount);
270 $this->pdf->write_cell(
$width[6],6,
nbm(bcadd($sum_amount,$sum_vat),2),
"",0,
"R");
271 $this->pdf->line_new(10);
374 $row_jrnx = $this->
cn->get_row(
"select j_text , j_montant,j_qcode,j_poste from public.jrnx where j_id=$1", array($p_j_id));
377 $this->pdf->SetFont(
'DejaVu',
'B', 7);
378 $this->pdf->write_cell(25, 8,$p_j_id);
379 $this->pdf->write_cell(40, 8,$row_jrnx[
"j_poste"]);
380 $this->pdf->write_cell(40, 8,$row_jrnx[
"j_qcode"]);
381 $this->pdf->write_cell(40, 8,
nbm($row_jrnx[
"j_montant"],2));
382 $this->pdf->line_new(8);
387 $a_operation_analytique = $this->
cn->get_array(
388 "select oa_row,oa_positive,po_name,pa_id,po_id,oa_debit,
389 case when oa_positive='N' then oa_amount*(-1)
390 else oa_amount end as signed_amount
391 from OPeration_analytique
392 left join public.poste_analytique using(po_id)
393 left join public.plan_analytique using (pa_id)
396 order by oa_row,pa_id
398 $this->pdf->SetFont(
'DejaVu',
'', 6);
404 $cnt_plan = count($pa_plan);
408 $current_row = $a_operation_analytique[
$i];
410 $old_row = $current_row;
411 if ($old_row[
'oa_row']!=$current_row[
'oa_row']) {
413 for (
$e = $idx_plan;
$e<$cnt_plan;
$e++)
414 $this->pdf->write_cell(
$width, 8,
"", 1,0,
"c", 0);
417 $this->pdf->write_cell(
$width, 8,
nbm($old_row[
"signed_amount"],2), 1,0,
"R", 0);
419 $tot_anc= bcadd($tot_anc, $old_row[
"signed_amount"]);
421 $this->pdf->line_new(8);
425 if ($current_row[
'pa_id']==$pa_plan[$idx_plan][
'pa_id']) {
426 $this->pdf->write_cell(
$width, 8, $current_row[
'po_name'], 1,0,
"L", 0);
429 for (
$e = $idx_plan;
$e<$cnt_plan;
$e++) {
430 if ($current_row[
'pa_id']==$pa_plan[
$e][
'pa_id']) {
431 $this->pdf->write_cell(
$width, 8, $current_row[
'po_name'], 1, 0,
"L", 0);
436 $this->pdf->write_cell(
$width, 8,
"", 1,0,
"c", 0);
441 if ($idx_plan == $cnt_plan ) $idx_plan=0;
442 $old_row = $current_row;
447 $this->pdf->write_cell(
$width, 8,
"", 1,0,
"C", 0);
449 $this->pdf->write_cell(
$width, 8,
nbm($old_row[
"signed_amount"],2), 1, 0,
"R", 0);
450 $this->pdf->line_new(8);
453 $tot_anc= bcadd($tot_anc, $old_row[
"signed_amount"]);
456 $this->pdf->write_cell(40, 6,
_(
"Comptabilité"));
457 $this->pdf->write_cell(40, 6,
nbm($row_jrnx[
"j_montant"],2),0,0,
"r",0);
458 $this->pdf->line_new();
459 $this->pdf->write_cell(40, 6,
_(
"Analytique"));
460 $this->pdf->write_cell(40, 6,
nbm($tot_anc,2),0,0,
"r",0);
461 $this->pdf->line_new();
463 $this->pdf->write_cell(40, 6,
_(
"Diff"));
464 $this->pdf->write_cell(40, 6,
nbm( bcsub($row_jrnx[
'j_montant'], $tot_anc),2),0,0,
"R",0);
465 $this->pdf->line_new();