26if ( ! defined (
'ALLOWED') ) die(
'Appel direct ne sont pas permis');
28require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
32$cn=Dossier::connect();
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'a pas de poste comptable"));
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->write_multi(30,3,
'Quick Code',0,
'L',0);
92 $pdf->write_multi(80,3,
'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);
129 $pdf->write_cell(20,7,
nbm(abs(
$solde[
'solde'])),0,0,
'R',$fill);
130 $pdf->write_cell(20,7,
$side,0,0,
'C',$fill);
137 $pdf->write_cell(30,7,
"",0,0,
'L',$fill);
138 $pdf->write_cell(80,7,
_(
"Totaux"),0,0,
'L',$fill);
139 $pdf->write_cell(20,7,
nbm($sum_deb),0,0,
'R',$fill);
140 $pdf->write_cell(20,7,
nbm($sum_cred),0,0,
'R',$fill);
141 $pdf->write_cell(20,7,
nbm(abs($sum_solde)),0,0,
'R',$fill);
143 if ( $sum_solde > 0 )
147 else if ( $sum_solde < 0)
152 $pdf->write_cell(20,7,
$side,0,0,
'C',$fill);
179 $tab = array(12, 20, 20,68, 20, 20, 10, 20);
180 $align = array(
'L',
'C',
'L',
'L',
'R',
'R',
'R',
'R');
182 foreach (
$array as $row_fiche)
187 $letter->set_parameter(
'start',
$http->request(
'start'));
210 if (count(
$letter->content) == 0)
212 $pdf->SetFont(
'DejaVuCond',
'', 10);
216 $pdf->SetFont(
'DejaVuCond',
'', 7);
218 $pdf->write_cell(
$tab[0], 7,
'Date');
219 $pdf->write_cell(
$tab[1], 7,
'ref');
220 $pdf->write_cell(
$tab[2], 7,
'Internal');
221 $pdf->write_cell(
$tab[3], 7,
'Comm');
222 $pdf->write_cell(
$tab[4], 7,
'Montant', 0, 0,
'C');
223 $pdf->write_cell(
$tab[5], 7,
'Prog.', 0, 0,
'R');
224 $pdf->write_cell(
$tab[6], 7,
'Let.', 0, 0,
'R');
225 $pdf->write_cell(
$tab[7], 7,
'Diff. Let.', 0, 0,
'R');
234 $pdf->SetFont(
'DejaVuCond',
'', 7);
242 if (
$row[
'j_debit'] ==
't')
244 $prog=bcadd($prog,
$row[
'j_montant']);
247 $str_prog=sprintf(
"%s %s",
nbm(abs($prog)),
$fic->get_amount_side($prog));
252 $prog=bcsub($prog,
$row[
'j_montant']);
255 $str_prog=sprintf(
"%s %s",
nbm(abs($prog)),
$fic->get_amount_side($prog));
258 if (
$row[
'letter'] != -1)
260 $pdf->write_cell(
$tab[6], 4, strtoupper(base_convert(
$row[
'letter'],10,36)), 0, 0,
$align[6], $fill);
266 $pdf->write_cell(
$tab[6], 4,
"", 0, 0,
'R', $fill);
270 $pdf->SetFont(
'DejaVuCond',
'B', 8);
274 $s =
'solde débiteur';
276 $s =
'solde crediteur';
279 $pdf->write_cell(0, 6, $debit, 0, 0,
'R');
281 $pdf->write_cell(0, 6, $credit, 0, 0,
'R');
292$pdf->Output(
"category-$fDate.pdf",
'D');
isDate($p_date)
Verifie qu'une date est bien formaté en d.m.y et est valable.
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
_("actif, passif,charge,...")
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, $card_category_id, $p_order='', $inactive=1)
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++) exit