Overview
Comment: | Les RIB ne servent plus de nos jours + simplification page des comptes bancaires |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
ac27edf028ad804829caba73c5563407 |
User & Date: | bohwaz on 2015-02-18 17:58:37 |
Other Links: | manifest | tags |
Context
2015-02-18
| ||
17:59 | Légende plus visible check-in: 2dbae2bec0 user: bohwaz tags: trunk | |
17:58 | Les RIB ne servent plus de nos jours + simplification page des comptes bancaires check-in: ac27edf028 user: bohwaz tags: trunk | |
16:53 | Fix vérification check-in: 48c4153254 user: bohwaz tags: trunk | |
Changes
Modified src/include/lib/Garradin/Utils.php from [bf051c0ec8] to [9eefb1f3b8].
︙ | ︙ | |||
503 504 505 506 507 508 509 | static public function checkIBAN($iban) { $iban = substr($iban, 4) . substr($iban, 0, 4); $iban = str_replace(range('A', 'Z'), range(10, 35), $iban); return (bcmod($iban, 97) == 1); } | | < < < < < < < < < < < < < | 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | static public function checkIBAN($iban) { $iban = substr($iban, 4) . substr($iban, 0, 4); $iban = str_replace(range('A', 'Z'), range(10, 35), $iban); return (bcmod($iban, 97) == 1); } static public function checkBIC($bic) { return preg_match('!^[A-Z]{4}[A-Z]{2}[1-9A-Z]{2}(?:[A-Z\d]{3})?$!', $bic); } static public function normalizePhoneNumber($n) { |
︙ | ︙ |
Deleted src/templates/admin/compta/banques/ajouter.tpl version [3c2df56f9d].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified src/templates/admin/compta/banques/index.tpl from [20cc85f3ce] to [f4e86ef9da].
1 2 3 4 5 | {include file="admin/_head.tpl" title="Comptes bancaires" current="compta/banques"} <ul class="actions"> <li class="current"><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li> <li><a href="{$www_url}admin/compta/comptes/journal.php?id={Garradin\Compta\Comptes::CAISSE}&suivi">Journal de caisse</a></li> | < | | > > > > > > > > > > > > | | > | | < < < | | | > | | | | > > > | > | > > | < > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 66 67 68 69 70 71 72 73 74 75 | {include file="admin/_head.tpl" title="Comptes bancaires" current="compta/banques"} <ul class="actions"> <li class="current"><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li> <li><a href="{$www_url}admin/compta/comptes/journal.php?id={Garradin\Compta\Comptes::CAISSE}&suivi">Journal de caisse</a></li> </ul> {if !empty($liste)} <table class="list"> <thead> <tr> <td>Banque</td> <th>Libellé</th> <td>Solde</td> <td>IBAN</td> <td>BIC</td> <td></td> </tr> </thead> <tbody> {foreach from=$liste item="compte"} <tr> <td>{$compte.banque|escape}</td> <th>{$compte.libelle|escape}</th> <td><strong>{$compte.solde|html_money} {$config.monnaie|escape}</strong></td> <td>{$compte.iban|escape|format_iban}</td> <td>{$compte.bic|escape}</td> <td class="actions"> <a class="icn" href="{$www_url}admin/compta/comptes/journal.php?id={$compte.id|escape}&suivi" title="Journal">𝍢</a> {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <a class="icn" href="{$www_url}admin/compta/banques/rapprocher.php?id={$compte.id|escape}" title="Rapprocher">☑</a> <a class="icn" href="{$www_url}admin/compta/banques/modifier.php?id={$compte.id|escape}" title="Modifier">✎</a> <a class="icn" href="{$www_url}admin/compta/banques/supprimer.php?id={$compte.id|escape}" title="Supprimer">✘</a> {/if} </td> </tr> {/foreach} </tbody> </table> </dl> {/if} {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} {if $error} <p class="error"> {$error|escape} </p> {/if} <form method="post" action="{$self_url|escape}"> <fieldset> <legend>Ajouter un compte bancaire</legend> <dl> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle}" required="required" /></dd> <dt><label for="f_banque">Nom de la banque</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="banque" id="f_banque" value="{form_field name=banque}" required="required" /></dd> <dt><label for="f_solde">Solde initial</label></dt> <dd><input type="number" size="5" name="solde" id="f_solde" value="{form_field name=solde default=0.00}" step="0.01" /> {$config.monnaie|escape}</dd> <dt><label for="f_iban">Numéro IBAN</label></dt> <dd><input type="text" size="30" name="iban" id="f_iban" value="{form_field name=iban}" /></dd> <dt><label for="f_bic">Code BIC/SWIFT de la banque</label></dt> <dd><input type="text" size="10" name="bic" id="f_bic" value="{form_field name=bic}" /></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="compta_ajout_banque"} <input type="submit" name="add" value="Enregistrer →" /> </p> </form> {/if} {include file="admin/_foot.tpl"} |
Added src/templates/admin/compta/banques/rapprocher.tpl version [c2cc21d617].
> > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 | {include file="admin/_head.tpl" title="Rapprochement — `$compte.id`" current="compta/banques" js=1} <ul class="actions"> <li><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li> <li><a href="{$www_url}admin/compta/comptes/journal.php?id={Garradin\Compta\Comptes::CAISSE}&suivi">Journal de caisse</a></li> <li class="current"><a href="{$admin_url}compta/banques/rapprochement.php?id={$compte.id|escape}">Rapprochement</a></li> </ul> {include file="admin/_foot.tpl"} |
Deleted src/www/admin/compta/banques/ajouter.php version [5795e36182].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified src/www/admin/compta/banques/index.php from [135ab2cb49] to [14fbe20721].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $banques = new Compta\Comptes_Bancaires; $journal = new Compta\Journal; $liste = $banques->getList(); foreach ($liste as &$banque) { $banque['solde'] = $journal->getSolde($banque['id']); } $tpl->assign('liste', $liste); function tpl_format_iban($iban) { return implode(' ', str_split($iban, 4)); } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < < < < < < < < < < < < < | | 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 66 67 68 69 70 71 72 73 74 75 76 77 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $banques = new Compta\Comptes_Bancaires; $journal = new Compta\Journal; $error = false; if (Utils::post('add')) { if ($user['droits']['compta'] < Membres::DROIT_ADMIN) { throw new UserException("Vous n'avez pas le droit d'accéder à cette page."); } if (!Utils::CSRF_check('compta_ajout_banque')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $id = $banques->add([ 'libelle' => Utils::post('libelle'), 'banque' => Utils::post('banque'), 'iban' => Utils::post('iban'), 'bic' => Utils::post('bic'), ]); if (Utils::post('solde')) { $exercices = new Compta\Exercices; $exercice = $exercices->getCurrent(); $solde = Utils::post('solde'); $journal->add([ 'libelle' => 'Solde initial', 'montant' => abs($solde), 'date' => gmdate('Y-m-d', $exercice['debut']), 'compte_credit' => $solde > 0 ? null : $id, 'compte_debit' => $solde < 0 ? null : $id, 'numero_piece' => null, 'remarques' => 'Opération automatique à l\'ajout du compte dans la liste des comptes bancaires', 'id_auteur' => $user['id'], ]); } Utils::redirect('/admin/compta/banques/'); } catch (UserException $e) { $error = $e->getMessage(); } } } $liste = $banques->getList(); foreach ($liste as &$banque) { $banque['solde'] = $journal->getSolde($banque['id']); } $tpl->assign('liste', $liste); function tpl_format_iban($iban) { return implode(' ', str_split($iban, 4)); } $tpl->register_modifier('format_iban', 'Garradin\tpl_format_iban'); $tpl->assign('error', $error); $tpl->display('admin/compta/banques/index.tpl'); |