Overview
Comment:Affichage d'opération
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 878d1fe51d3fbfee921d321b647a3dffe3ffd262
User & Date: bohwaz on 2012-09-09 00:41:13
Other Links: manifest | tags
Context
2012-09-09
00:41
Catégories comptables par défaut check-in: 193cf13f97 user: bohwaz tags: trunk
00:41
Affichage d'opération check-in: 878d1fe51d user: bohwaz tags: trunk
00:12
Diverses corrections et améliorations check-in: 0af2419531 user: bohwaz tags: trunk
Changes

Modified include/class.compta_journal.php from [488a505223] to [8e2454921e].

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

        return true;
    }

    public function get($id)
    {
        $db = Garradin_DB::getInstance();
        return $db->simpleQuerySingle('SELECT * FROM compta_journal WHERE id = ?;', true, $id);
    }

    protected function _checkFields(&$data)
    {
        $db = Garradin_DB::getInstance();

        if (empty($data['libelle']) || !trim($data['libelle']))







|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

        return true;
    }

    public function get($id)
    {
        $db = Garradin_DB::getInstance();
        return $db->simpleQuerySingle('SELECT *, strftime(\'%s\', date) AS date FROM compta_journal WHERE id = ?;', true, $id);
    }

    protected function _checkFields(&$data)
    {
        $db = Garradin_DB::getInstance();

        if (empty($data['libelle']) || !trim($data['libelle']))
201
202
203
204
205
206
207
208
209
210
211
212
213
    }

    public function getJournal()
    {
        $db = Garradin_DB::getInstance();
        $exercice = $this->_getCurrentExercice();
        $exercice = is_null($exercice) ? 'IS NULL' : '= ' . (int)$exercice;
        $query = 'SELECT * FROM compta_journal WHERE id_exercice '.$exercice.' ORDER BY date, id;';
        return $db->simpleStatementFetch($query);
    }
}

?>







|





201
202
203
204
205
206
207
208
209
210
211
212
213
    }

    public function getJournal()
    {
        $db = Garradin_DB::getInstance();
        $exercice = $this->_getCurrentExercice();
        $exercice = is_null($exercice) ? 'IS NULL' : '= ' . (int)$exercice;
        $query = 'SELECT *, strftime(\'%s\', date) AS date FROM compta_journal WHERE id_exercice '.$exercice.' ORDER BY date, id;';
        return $db->simpleStatementFetch($query);
    }
}

?>

Added templates/admin/compta/operation.tpl version [59bef79f48].



































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{include file="admin/_head.tpl" title="Opération n°`$operation.id`" current="compta/gestion"}

<dl class="operation">
    <dt>Date</dt>
    <dd>{$operation.date|date_fr:'l j F Y (d/m/Y)'}</dd>
    <dt>Libellé</dt>
    <dd>{$operation.libelle|escape}</dd>
    <dt>Montant</dt>
    <dd>{$operation.montant|escape}&nbsp;{$config.monnaie|escape}</dd>
    <dt>Numéro pièce comptable</dt>
    <dd>{if trim($operation.numero_piece)}{$operation.numero_piece|escape}{else}Non renseigné{/if}</dd>

    {if $operation.id_categorie}

        <dt>Moyen de paiement</dt>
        <dd>{if trim($operation.moyen_paiement)}{$operation.moyen_paiement|escape}{else}Non renseigné{/if}</dd>

        {if $operation.moyen_paiement == 'CH'}
            <dt>Numéro de chèque</dt>
            <dd>{if trim($operation.numero_cheque)}{$operation.numero_cheque|escape}{else}Non renseigné{/if}</dd>
        {/if}

        {if $operation.moyen_paiement && $operation.moyen_paiement != 'ES'}
            <dt>Compte bancaire</dt>
            <dd>{$compte|escape}</dd>
        {/if}

    {/if}

    <dt>Opération créée par</dt>
    <dd>
        {if $user.droits.membres >= Garradin_Membres::DROIT_ACCES}
            <a href="{$www_url}admin/membres/fiche.php?id={$operation.id_auteur|escape}">{$nom_auteur|escape}</a>
        {else}
            {$nom_auteur|escape}
        {/if}
    </dd>

    <dt>Remarques</dt>
    <dd>{if trim($operation.remarques)}{$operation.remarques|escape}{else}Non renseigné{/if}</dd>
</dl>

<table class="list multi">
    <thead>
        <tr>
            <th>Comptes</th>
            <td>Débit</td>
            <td>Crédit</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>{$operation.compte_debit|escape} - {$nom_compte_debit}</td>
            <td>{$operation.montant|escape}&nbsp;{$config.monnaie|escape}</td>
            <td></td>
        </tr>
        <tr>
            <td>{$operation.compte_credit|escape} - {$nom_compte_credit}</td>
            <td></td>
            <td>{$operation.montant|escape}&nbsp;{$config.monnaie|escape}</td>
        </tr>
    </tbody>
</table>

{include file="admin/_foot.tpl"}

Added www/admin/compta/operation.php version [bc97947a3d].







































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php

require_once __DIR__ . '/_inc.php';

if ($user['droits']['compta'] < Garradin_Membres::DROIT_ECRITURE)
{
    throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
}

require_once GARRADIN_ROOT . '/include/class.compta_journal.php';
$journal = new Garradin_Compta_Journal;

$operation = $journal->get(utils::get('id'));

if (!$operation)
{
    throw new UserException("L'opération demandée n'existe pas.");
}

$tpl->assign('operation', $operation);

$credit = $comptes->get($operation['compte_credit']);
$tpl->assign('nom_compte_credit', $credit['libelle']);

$debit = $comptes->get($operation['compte_debit']);
$tpl->assign('nom_compte_debit', $debit['libelle']);

if ($operation['id_categorie'])
{
    require_once GARRADIN_ROOT . '/include/class.compta_categories.php';
    $cats = new Garradin_Compta_Categories;

    $categorie = $cats->get($operation['id_categorie']);
    $tpl->assign('categorie', $categorie);

    if ($categorie['type'] == Garradin_Compta_Categories::RECETTES)
    {
        $tpl->assign('compte', $debit['libelle']);
    }
    else
    {
        $tpl->assign('compte', $credit['libelle']);
    }
}

$auteur = $membres->get($operation['id_auteur']);
$tpl->assign('nom_auteur', $auteur['nom']);

$tpl->display('admin/compta/operation.tpl');

?>

Modified www/admin/static/admin.css from [8a06d9faf0] to [ae4601342e].

747
748
749
750
751
752
753
















table.accountList .niveau_3 .libelle { padding-left: 1em; }
table.accountList .niveau_4 .libelle { padding-left: 2em; }
table.accountList .niveau_5 .libelle { padding-left: 3em; }
table.accountList .niveau_6 .libelle { padding-left: 4em; }

table.rib { display: inline-table; vertical-align: middle; font-size: .9em; text-align: center; border-collapse: collapse; }
table.rib th, table.rib td { padding: .1em .3em; border: 1px solid #ccc; }























>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
table.accountList .niveau_3 .libelle { padding-left: 1em; }
table.accountList .niveau_4 .libelle { padding-left: 2em; }
table.accountList .niveau_5 .libelle { padding-left: 3em; }
table.accountList .niveau_6 .libelle { padding-left: 4em; }

table.rib { display: inline-table; vertical-align: middle; font-size: .9em; text-align: center; border-collapse: collapse; }
table.rib th, table.rib td { padding: .1em .3em; border: 1px solid #ccc; }

dl.operation {
    margin-bottom: 1em;
}

dl.operation dt {
    font-weight: bold;
    width: 15em;
    float: left;
    clear: left;
    margin-bottom: .5em;
}

dl.operation dd {
    margin-bottom: .5em;
}