27 if ( ! defined (
'ALLOWED') ) die(
'Appel direct ne sont pas permis');
29 require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
38 $pdf->setDossierInfo(
" Periode : ".
$_GET[
'start'].
" - ".
$_GET[
'end']);
41 $name=
$cn->get_value(
'select fd_label from fiche_def where fd_id=$1',array(
$_GET[
'cat']));
42 $pdf->SetFont(
'DejaVu',
'BI',14);
45 $pdf->SetAuthor(
'NOALYSS');
52 if (
$_GET[
'histo'] == 4 )
58 $pdf->write_cell(0,10, _(
"Cette catégorie n'ayant pas de poste comptable n'a pas de balance"));
61 $pdf->Output(
"category-$fDate.pdf",
'D');
64 $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(
$cat));
68 $pdf->write_cell(0,10, _(
"Aucune fiche trouvée"));
70 $pdf->Output(
"category-$fDate.pdf",
'D');
73 $pdf->SetFont(
'DejaVuCond',
'',7);
74 $pdf->write_cell(30,7,
'Quick Code',0,0,
'L',0);
75 $pdf->write_cell(80,7,
'Libellé',0,0,
'L',0);
76 $pdf->write_cell(20,7,
'Débit',0,0,
'R',0);
77 $pdf->write_cell(20,7,
'Crédit',0,0,
'R',0);
78 $pdf->write_cell(20,7,
'Solde',0,0,
'R',0);
79 $pdf->write_cell(20,7,
'D/C',0,0,
'C',0);
82 $filter=
" (j_date >= to_date('".$start.
"','DD.MM.YYYY') ".
83 " and j_date <= to_date('".$end.
"','DD.MM.YYYY')) ";
88 if (
$solde[
'debit'] == 0 &&
$solde[
'credit']==0)
continue;
92 $pdf->SetFillColor(220,221,255);
97 $pdf->SetFillColor(0,0,0);
104 $pdf->write_cell(20,7,sprintf(
'%.02f',
$solde[
'debit']),0,0,
'R',$fill);
105 $pdf->write_cell(20,7,sprintf(
'%.02f',
$solde[
'credit']),0,0,
'R',$fill);
106 $pdf->write_cell(20,7,sprintf(
'%.02f',abs(
$solde[
'solde'])),0,0,
'R',$fill);
107 $pdf->write_cell(20,7,((
$solde[
'solde']<0)?
'CRED':
'DEB'),0,0,
'C',$fill);
121 $tab=array(13,25,55,20,20,12,20);
122 $align=array(
'L',
'L',
'L',
'R',
'R',
'R',
'R');
124 foreach(
$array as $row_fiche)
132 if (
$_GET[
'histo'] == 0 )
138 if (
$_GET[
'histo'] == 1 )
143 if (
$_GET[
'histo'] == 2 )
148 if (count(
$letter->content) == 0 )
continue;
149 $pdf->SetFont(
'DejaVuCond',
'',10);
153 $pdf->SetFont(
'DejaVuCond',
'',7);
159 $pdf->write_cell(40,7,
'Montant',0,0,
'C');
160 $pdf->write_cell(
$tab[5],7,
'Let.',0,0,
'R');
161 $pdf->write_cell(
$tab[6],7,
'Som. Let.',0,0,
'R');
170 $pdf->SetFillColor(220,221,255);
175 $pdf->SetFillColor(0,0,0);
178 $pdf->SetFont(
'DejaVuCond',
'',7);
186 if (
$row[
'j_debit'] ==
't')
190 $pdf->write_cell(
$tab[4],4,
"",0,0,
'C',$fill);
194 $pdf->write_cell(
$tab[3],4,
"",0,0,
'C',$fill);
198 if (
$row[
'letter'] != -1 )
200 $pdf->write_cell(
$tab[5],4,strtoupper(base_convert(
$row[
'letter'],10,36)),0,0,
$align[5],$fill);
202 $sql=
"select sum(j_montant) from jrnx where j_debit=$1 and j_id in ".
203 " (select j_id from jnt_letter join letter_deb using (jl_id) where jl_id=$2 union ".
204 " select j_id from jnt_letter join letter_cred using (jl_id) where jl_id=$3)";
206 $pdf->write_cell(
$tab[6],4,sprintf(
'%.2f',$sum),
'0',
'0',
'R',$fill);
209 $pdf->write_cell(
$tab[5],4,
"",0,0,
'R',$fill);
212 $pdf->SetFillColor(0,0,0);
213 $pdf->SetFont(
'DejaVuCond',
'B',8);
217 else $s=
'solde crediteur';
220 $pdf->write_cell(0,6,$debit,0,0,
'R');
222 $pdf->write_cell(0,6,$credit,0,0,
'R');
232 $pdf->Output(
"category-$fDate.pdf",
'D');
shrink_date($p_date)
shrink the date, make a date shorter for the printing
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.
foreach($array as $row_fiche) $fDate