From aa554b4c33534e3464f83deaaf7f4d7baaf8962c Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sun, 8 Feb 2004 17:43:20 +0000 Subject: [PATCH] trezo --- etat_migration | 11 ++- include/trezo.inc.php | 46 ++++++++++++ templates/trezo/choix_date.tpl | 21 ++++++ templates/trezo/gere_operations.tpl | 136 ++++++++++++++++++++++++++++++++++++ templates/trezo/index.tpl | 54 ++++++++++++++ 5 files changed, 262 insertions(+), 6 deletions(-) create mode 100644 include/trezo.inc.php create mode 100644 templates/trezo/choix_date.tpl create mode 100644 templates/trezo/gere_operations.tpl create mode 100644 templates/trezo/index.tpl diff --git a/etat_migration b/etat_migration index ed8fbbd..186c2d9 100644 --- a/etat_migration +++ b/etat_migration @@ -16,8 +16,8 @@ ------+-------------------------------------------+---------------- Etat | Ancien nom | Nouveau nom ------+-[ admin ]---------------------------------+---------------- - | admin/FormatePrenomNOM.php | - | admin/FormatePrenomNOM2.php | + | admin/FormatePrenomNOM.php | scripts/ + | admin/FormatePrenomNOM2.php | scripts/ | admin/admin_faqs.php | | admin/admin_trombino.php | | admin/comptesPOP.php | @@ -73,10 +73,6 @@ Etat | Ancien nom | Nouveau nom | sondage/resultats.php | | sondage/titre.php | | sondage/validation.php | -------+-[ trezo ]---------------------------------+---------------- - | trezo/gere_operations.php | - | trezo/index.php | - | trezo/trezo.inc.php | ------+-[ emails ... ]----------------------------+---------------- | emails.php | | routage-mail.php | @@ -196,6 +192,9 @@ xx | rss.php | - xx | secu.php | docs/secu.php xx | sendmail.php | - xx | skins.php | - +xx | trezo/gere_operations.php | +xx | trezo/index.php | +xx | trezo/trezo.inc.php | xx | vcard.php | - ------+-------------------------------------------+---------------- --- | trackers/tracker_delete.php | - diff --git a/include/trezo.inc.php b/include/trezo.inc.php new file mode 100644 index 0000000..eace898 --- /dev/null +++ b/include/trezo.inc.php @@ -0,0 +1,46 @@ +'Janvier', + '02'=>'Février', + '03'=>'Mars', + '04'=>'Avril', + '05'=>'Mai', + '06'=>'Juin', + 'O7'=>'Juillet', + '08'=>'Août', + '09'=>'Septembre', + '10'=>'Octobre', + '11'=>'Novembre', + '12'=>'Decembre'); + + +$trim_fr = array('01'=>'Janvier-Mars', + '04'=>'Avril-Juin', + '07'=>'Juillet-Septembre', + '10'=>'Octobre-Decembre'); + + +function isDate($date) +{ + list($d, $m, $y) = split('[/.-]', $date); + $dummy = date("d/m/Y", mktime (0,0,0,$m,$d,$y)); + $date = ereg_replace('-', '/', $date); + if ($dummy != $date) + return false; + else + return true; +} + + +function solde_until($date='') +{ + $sql = "select sum(credit)-sum(debit) from trezo.operations"; + if(!empty($date)) + $sql .= " where date <= '$date'"; + $res = mysql_query($sql); + list($mysolde) = mysql_fetch_row($res); + return $mysolde; +} + +?> + diff --git a/templates/trezo/choix_date.tpl b/templates/trezo/choix_date.tpl new file mode 100644 index 0000000..a0f83bd --- /dev/null +++ b/templates/trezo/choix_date.tpl @@ -0,0 +1,21 @@ +{* $Id: choix_date.tpl,v 1.1 2004-02-08 17:43:20 x2000habouzit Exp $ *} + +{assign var=def_month value=$smarty.now|date_format:"%m"} +{assign var=def_year value=$smarty.now|date_format:"%Y"} +{assign var=month value=$smarty.request.mois|default:$def_month} + +
+
+ + Afficher la période suivante : + + + +
+
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/trezo/gere_operations.tpl b/templates/trezo/gere_operations.tpl new file mode 100644 index 0000000..65e78d5 --- /dev/null +++ b/templates/trezo/gere_operations.tpl @@ -0,0 +1,136 @@ +{* $Id: gere_operations.tpl,v 1.1 2004-02-08 17:43:20 x2000habouzit Exp $ *} + +{dynamic} + +{if $smarty.request.action eq "edit"} +
+ Gestion des opérations de trésorerie +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {if $operation_id} + Modifier une opération + {else} + Ajouter une opération + {/if} +
Date (DD/MM/YYYY)
Description libre
Débit
Crédit
+ +
+
+ +retour +{elseif $smarty.request.action eq "update" && $operation_id} +modification de l'opération +{elseif $smarty.request.action eq "update"} +ajout de l'opération +{elseif $smarty.request.action eq "del"} +suppression de l'opération +{/if} + +{if $smarty.request.action neq "edit"} +
+ Trésorerie pour {$mon_sel} +
+ + + + + + + + +
Solde en début de mois
{$from_solde}
+ +
+ + + + + + + + + + + + + + + + + + +{foreach item=op from=$ops} + + + + + + + + +{/foreach} +
IdDateDescriptionDébitCréditAction
  Nouvelle opération   +
+ + + + + +
+
{$op.id}{$op.date|date_format:"%d/%m/%Y"}{$op.label}{$op.debit}{$op.credit} +
+ + + + + +
+
+ +
+ + + + + + + + +
Solde en fin de mois
{$to_solde}
+ +
+ +{include file=trezo/choix_date.tpl month_arr=$month_arr} +{/if} +{/dynamic} + +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/trezo/index.tpl b/templates/trezo/index.tpl new file mode 100644 index 0000000..6e70047 --- /dev/null +++ b/templates/trezo/index.tpl @@ -0,0 +1,54 @@ +{* $Id: index.tpl,v 1.1 2004-02-08 17:43:20 x2000habouzit Exp $ *} + +{dynamic} + +
+ Trésorerie pour {$mon_sel} +
+ + + + + + + + +
Solde en début de mois
{$from_solde}
+ +
+ + + + + + + + +{foreach item=op from=$ops} + + + + + + +{/foreach} +
DateDescriptionDépensesRecettes
{$op.date|date_format:"%d/%m/%Y"}{$op.label}{$op.debit}{$op.credit}
+ +
+ + + + + + + + +
Solde en fin de mois
{$to_solde}
+ +
+ +{include file=trezo/choix_date.tpl month_arr=$month_arr} + +{/dynamic} + +{* vim:set et sw=2 sts=2 sws=2: *} -- 2.1.4