26if ( ! defined (
'ALLOWED') ) die(
'Appel direct ne sont pas permis');
28require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
41$name=
$cn->get_value(
'select fd_label from fiche_def where fd_id=$1',array(
$cat));
44$pdf->setDossierInfo(
" Periode : ".
$http->get(
'start').
" - ".
$http->get(
'end'));
49$pdf->SetAuthor(
'NOALYSS');
60 $pdf->write_cell(0,10,
"Cette catégorie n'ayant pas de poste comptable n'a pas de balance");
63 $pdf->Output(
"category-$fDate.pdf",
'D');
78 $pdf->write_cell(0,10,
"Aucune fiche trouvée");
80 $pdf->Output(
"category-$fDate.pdf",
'D');
85 $aCard=
$cn->get_array(
"select f_id,ad_value from fiche join fiche_Detail using (f_id) where ad_id=1 and fd_id=$1 order by 2 ",array(
$afiche[
$e][
'fd_id']));
86 $name=
$cn->get_value(
'select fd_label from fiche_def where fd_id=$1',array(
$afiche[
$e][
'fd_id']));
87 $pdf->SetFont(
'DejaVu',
'BI',14);
90 $pdf->SetFont(
'DejaVuCond',
'',7);
91 $pdf->LongLine(30,7,
'Quick Code',0,
'L',0);
92 $pdf->LongLine(80,7,
'Libellé',0,
'L',0);
93 $pdf->write_cell(20,7,
'Débit',0,0,
'R',0);
94 $pdf->write_cell(20,7,
'Crédit',0,0,
'R',0);
95 $pdf->write_cell(20,7,
'Solde',0,0,
'R',0);
96 $pdf->write_cell(20,7,
'D/C',0,0,
'C',0);
99 if (empty(
$aCard))
continue;
102 $idx=0;$sum_deb=0;$sum_cred=0;bcscale(4);
106 $filter=
" (j_date >= to_date('".$http->request(
'start').
"','DD.MM.YYYY') ".
107 " and j_date <= to_date('".$http->request(
'end').
"','DD.MM.YYYY')) ";
110 if (
$solde[
'debit'] == 0 &&
$solde[
'credit']==0)
continue;
119 $sum_cred=bcadd($sum_cred,
$solde[
'credit']);
120 $sum_deb=bcadd($sum_deb,
$solde[
'debit']);
121 $sum_solde=bcsub($sum_deb,$sum_cred);
127 $pdf->write_cell(20,7,
nbm(abs(
$solde[
'solde'])),0,0,
'R',$fill);
128 $pdf->write_cell(20,7,
$side,0,0,
'C',$fill);
135 $pdf->write_cell(30,7,
"",0,0,
'L',$fill);
136 $pdf->write_cell(80,7,_(
"Totaux"),0,0,
'L',$fill);
137 $pdf->write_cell(20,7,
nbm($sum_deb),0,0,
'R',$fill);
138 $pdf->write_cell(20,7,
nbm($sum_cred),0,0,
'R',$fill);
139 $pdf->write_cell(20,7,
nbm(abs($sum_solde)),0,0,
'R',$fill);
141 if ( $sum_solde > 0 )
145 else if ( $sum_solde < 0)
150 $pdf->write_cell(20,7,
$side,0,0,
'C',$fill);
177 $tab = array(12, 20, 20,68, 20, 20, 10, 20);
178 $align = array(
'L',
'C',
'L',
'L',
'R',
'R',
'R',
'R');
180 foreach (
$array as $row_fiche)
185 $letter->set_parameter(
'start',
$http->request(
'start'));
208 if (count(
$letter->content) == 0)
210 $pdf->SetFont(
'DejaVuCond',
'', 10);
214 $pdf->SetFont(
'DejaVuCond',
'', 7);
216 $pdf->write_cell(
$tab[0], 7,
'Date');
217 $pdf->write_cell(
$tab[1], 7,
'ref');
218 $pdf->write_cell(
$tab[2], 7,
'Internal');
219 $pdf->write_cell(
$tab[3], 7,
'Comm');
220 $pdf->write_cell(
$tab[4], 7,
'Montant', 0, 0,
'C');
221 $pdf->write_cell(
$tab[5], 7,
'Prog.', 0, 0,
'R');
222 $pdf->write_cell(
$tab[6], 7,
'Let.', 0, 0,
'R');
223 $pdf->write_cell(
$tab[7], 7,
'Diff. Let.', 0, 0,
'R');
232 $pdf->SetFont(
'DejaVuCond',
'', 7);
240 if (
$row[
'j_debit'] ==
't')
242 $prog=bcadd($prog,
$row[
'j_montant']);
245 $str_prog=sprintf(
"%s %s",
nbm(abs($prog)),
$fic->get_amount_side($prog));
250 $prog=bcsub($prog,
$row[
'j_montant']);
253 $str_prog=sprintf(
"%s %s",
nbm(abs($prog)),
$fic->get_amount_side($prog));
256 if (
$row[
'letter'] != -1)
258 $pdf->write_cell(
$tab[6], 4, strtoupper(base_convert(
$row[
'letter'],10,36)), 0, 0,
$align[6], $fill);
264 $pdf->write_cell(
$tab[6], 4,
"", 0, 0,
'R', $fill);
267 $pdf->SetFillColor(0, 0, 0);
268 $pdf->SetFont(
'DejaVuCond',
'B', 8);
272 $s =
'solde débiteur';
274 $s =
'solde crediteur';
277 $pdf->write_cell(0, 6, $debit, 0, 0,
'R');
279 $pdf->write_cell(0, 6, $credit, 0, 0,
'R');
290$pdf->Output(
"category-$fDate.pdf",
'D');
shrink_date($p_date)
shrink the date, make a date shorter for the printing
nbm($p_number, $p_dec=2)
format the number with a sep.
global $g_user
if no group available , then stop
define Class fiche and fiche def, those class are using class attribut
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
static get_fiche_def($p_cn, $pFd_id, $p_order='')
get all the card from a categorie
only for operation retrieved thanks a quick_code manage the accounting entries for a given card
API for creating PDF, unicode, based on tfpdf.
for($e=0; $e< count($afiche); $e++) $fDate