phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r207 - in trunk: . coprop coprop/include coprop/include/


From: phpcompta-dev
Subject: [Phpcompta-dev] r207 - in trunk: . coprop coprop/include coprop/include/template coprop/sql skel
Date: Sun, 11 Dec 2011 16:46:43 +0100 (CET)

Author: danydb
Date: 2011-12-11 16:46:41 +0100 (Sun, 11 Dec 2011)
New Revision: 207

Added:
   trunk/coprop/
   trunk/coprop/README.txt
   trunk/coprop/ajax.php
   trunk/coprop/coprop-constant.php
   trunk/coprop/coprop-javascript.js
   trunk/coprop/doc/
   trunk/coprop/include/
   trunk/coprop/include/appel_fond.inc.php
   trunk/coprop/include/class_copro_parameter.php
   trunk/coprop/include/class_install_plugin.php
   trunk/coprop/include/copro-parameter.inc.php
   trunk/coprop/include/coprop_parameter.php
   trunk/coprop/include/key.inc.php
   trunk/coprop/include/lot.inc.php
   trunk/coprop/include/template/
   trunk/coprop/include/template/appel_fond.php
   trunk/coprop/include/template/list_copro_lot.php
   trunk/coprop/index.php
   trunk/coprop/raw.php
   trunk/coprop/sql/
   trunk/coprop/sql/trunk_dev.sql
Modified:
   trunk/skel/index.php
   trunk/skel/skel_constant.php
Log:
First step
Add screens + DB schema

Added: trunk/coprop/README.txt
===================================================================
--- trunk/coprop/README.txt                             (rev 0)
+++ trunk/coprop/README.txt     2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1 @@
+Extension pour les copropriétés

Added: trunk/coprop/ajax.php
===================================================================
--- trunk/coprop/ajax.php                               (rev 0)
+++ trunk/coprop/ajax.php       2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1,18 @@
+<?php
+require_once('coprop-constant.php');
+require_once('class_database.php');
+
+extract($_GET);
+global $cn;
+$html='';$extra='';$ctl='';
+ob_start();
+switch($act) {
+case 'dsp_decl':
+  /* the hide button */
+  require_once('include/ajax_dsp.php');
+  break;
+default:
+
+       var_dump($_GET);
+}
+?>

Added: trunk/coprop/coprop-constant.php
===================================================================
--- trunk/coprop/coprop-constant.php                            (rev 0)
+++ trunk/coprop/coprop-constant.php    2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1,17 @@
+<?
+/**
+ address@hidden
+ *Contains all the needed variable for the plugin
+ *is name is plugin_name_constant.php
+ * You can use some globale variable, especially for the database
+ *  connection
+ */
+
+require_once ('class_database.php');
+require_once 'include/class_copro_parameter.php';
+global $cn,$g_copro_parameter,$gDossier;
+
+$gDossier=Dossier::id();
+$g_copro_parameter=new Copro_Parameter();
+
+?>
\ No newline at end of file

Added: trunk/coprop/coprop-javascript.js
===================================================================
--- trunk/coprop/coprop-javascript.js                           (rev 0)
+++ trunk/coprop/coprop-javascript.js   2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1,60 @@
+/**
+ *javascript
+ */
+
+/**
+ * Modifier un copropriétaire et les lots qu'il a
+ */
+function mod_coprop(dossier,copro_qcode,plugin_code)
+{
+       try
+       {
+               alert('Modifier un copropriétaire et ses lots');
+       }
+       catch(e)
+       {
+               alert(e.message);
+       }
+}
+/**
+ * Ajout un lien entre copropriétaire et lot
+ */
+function add_coprop()
+{
+       try
+       {
+               alert('Modifier un copropriétaire et ses lots');
+       }
+       catch(e)
+       {
+               alert(e.message);
+       }
+}
+/**
+ * Ajout clef + tantième lot associés
+ */
+function add_key()
+{
+       try
+       {
+               alert('Ajout clef + tantième lot associés');
+       }
+       catch(e)
+       {
+               alert(e.message);
+       }
+}
+/**
+ * Modifie clef + tantième lot associés
+ */
+function mod_key()
+{
+       try
+       {
+               alert('Modifie clef + tantième lot associés');
+       }
+       catch(e)
+       {
+               alert(e.message);
+       }
+}
\ No newline at end of file

Added: trunk/coprop/include/appel_fond.inc.php
===================================================================
--- trunk/coprop/include/appel_fond.inc.php                             (rev 0)
+++ trunk/coprop/include/appel_fond.inc.php     2011-12-11 15:46:41 UTC (rev 
207)
@@ -0,0 +1,53 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief génére écriture comptable pour appel de fond
+ *
+ */
+global $cn,$g_copro_parameter;
+
+extract($_GET);
+if ( isset($genere ))
+{
+       // Génére écriture comptable dans journal choisi
+} else
+{
+       $date=new IDate('p_date');
+       $amount=new INum('amount');
+
+       $ledger=new Acc_Ledger($cn,0);
+       $led_appel_fond=$ledger->select_ledger('ODS',3);
+       $led_appel_fond->selected=$g_copro_parameter->journal_appel;
+       $poste_appel=new IPoste('poste_appel');
+       $poste_appel->set_attribute('gDossier',Dossier::id());
+       $poste_appel->set_attribute('jrn',$g_copro_parameter->journal_appel);
+       $poste_appel->set_attribute('account','poste_appel');
+       $poste_appel->value=$g_copro_parameter->poste_appel;
+       $key=new ISelect("key");
+       $key->value=$cn->make_array("select cr_id,cr_name from 
coprop.clef_repartition");
+
+       require_once 'template/appel_fond.php';
+}
+?>

Added: trunk/coprop/include/class_copro_parameter.php
===================================================================
--- trunk/coprop/include/class_copro_parameter.php                              
(rev 0)
+++ trunk/coprop/include/class_copro_parameter.php      2011-12-11 15:46:41 UTC 
(rev 207)
@@ -0,0 +1,73 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief class for the table coprop.parameter
+ *
+ */
+class Copro_Parameter
+{
+    // constructor
+    function __construct() {
+               global $cn;
+        $Res=$cn->exec_sql("select * from coprop.parameter ");
+        for ($i = 0;$i < Database::num_row($Res);$i++)
+        {
+            $row=Database::fetch_array($Res,$i);
+            $key=$row['pr_id'];
+            $elt=$row['pr_value'];
+            // store value here
+            $this->{"$key"}=$elt;
+        }
+
+    }
+    /*!
+     **************************************************
+     * \brief  save the parameter into the database by inserting or updating
+     *
+     *
+     * \param $p_attr give the attribut name
+     *
+     */
+    function save($p_option,$p_value)
+    {
+               global $cn;
+        // check if the parameter does exist
+        if ( $cn->get_value('select count(*) from coprop.parameter where 
pr_id=$1',array($p_option)) != 0 )
+        {
+            $Res=$cn->exec_sql("update coprop.parameter set pr_value=$1 where 
pr_id=$2",
+                                     array($p_value,$p_option));
+        }
+        else
+        {
+
+            $Res=$cn->exec_sql("insert into coprop.parameter (pr_id,pr_value) 
values( $1,$2)",
+                                     array($p_option,$p_value));
+
+        }
+
+    }
+
+}
+?>

Added: trunk/coprop/include/class_install_plugin.php
===================================================================
--- trunk/coprop/include/class_install_plugin.php                               
(rev 0)
+++ trunk/coprop/include/class_install_plugin.php       2011-12-11 15:46:41 UTC 
(rev 207)
@@ -0,0 +1,81 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/* !\file
+ * \brief this class manages the installation and the patch of the plugin
+ */
+
+class Install_Plugin
+{
+
+       function __construct($p_cn)
+       {
+               $this->cn = $p_cn;
+       }
+
+       /**
+        * @brief install the plugin, create all the needed schema, tables, proc
+        * in the database
+        * @param $p_dossier is the dossier id
+        */
+       function install()
+       {
+               $this->cn->start();
+               // create the schema
+               $this->create_schema();
+               // create table + put default values
+               $this->create_table_parameter();
+               $this->cn->commit();
+       }
+
+       function create_schema()
+       {
+               $this->cn->exec_sql('create schema coprop');
+       }
+
+       function create_table_parameter()
+       {
+               $sql = <<<EOF
+CREATE TABLE coprop.parameter
+(
+  pr_id text NOT NULL,
+  pr_value text,
+  CONSTRAINT copro_parameter_pkey PRIMARY KEY (pr_id)
+ );
+EOF;
+               $this->cn->exec_sql($sql);
+// load default value
+               $array = array(
+                       'categorie_lot' => array(''),
+                       'categorie_coprop' => array(''),
+                       'poste_appel' => array(''),
+                       'journal_appel' => array('0'),
+               );
+
+               foreach ($array as $code => $value)
+               {
+                       $this->cn->exec_sql('insert into 
coprop.parameter(pr_id,pr_value) values ($1,$2)', array($code, $value[0]));
+               }
+       }
+
+}

Added: trunk/coprop/include/copro-parameter.inc.php
===================================================================
--- trunk/coprop/include/copro-parameter.inc.php                                
(rev 0)
+++ trunk/coprop/include/copro-parameter.inc.php        2011-12-11 15:46:41 UTC 
(rev 207)
@@ -0,0 +1,108 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief table parametre pour les copropriétés
+ *
+ */
+require_once 'class_copro_parameter.php';
+global $cn,$g_copro_parameter;
+
+if ( isset ($_POST['save']))
+{
+       $cn->start();
+       try {
+               
$g_copro_parameter->save('categorie_lot',$_POST['categorie_lot']);
+               
$g_copro_parameter->save('categorie_coprop',$_POST['categorie_coprop']);
+               $g_copro_parameter->save('poste_appel',$_POST['poste_appel']);
+               
$g_copro_parameter->save('journal_appel',$_POST['journal_appel']);
+       }
+       catch(Exception $e)
+       {
+               $cn->rollback();
+               echo $e->getTraceAsString();
+       }
+       $cn->commit();
+}
+$g_copro_parameter=new Copro_Parameter();
+/*
+ * Liste paramètres
+ */
+$cat_lot=new ISelect('categorie_lot');
+$cat_lot->value=$cn->make_array("select fd_id,fd_label from fiche_def order by 
fd_label");
+$cat_lot->selected=$g_copro_parameter->categorie_lot;
+
+$cat_coprop=new ISelect('categorie_coprop');
+$cat_coprop->value=$cn->make_array("select fd_id,fd_label from fiche_def order 
by fd_label");
+$cat_coprop->selected=$g_copro_parameter->categorie_coprop;
+
+$journal_appel=new ISelect('journal_appel');
+$journal_appel->value=$cn->make_array("select jrn_def_id,jrn_def_name from 
jrn_def where jrn_def_type='ODS' order by 2");
+$journal_appel->selected=$g_copro_parameter->journal_appel;
+
+$poste_appel=new IPoste('poste_appel');
+$poste_appel->set_attribute('gDossier',Dossier::id());
+$poste_appel->set_attribute('jrn',0);
+$poste_appel->set_attribute('account','poste_appel');
+
+$poste_appel->value=$g_copro_parameter->poste_appel;
+
+?>
+<form method="POST">
+<table>
+       <tr>
+               <td>
+                       Catégorie de fiches pour les lots
+               </td>
+               <td>
+                       <?=$cat_lot->input()?>
+               </td>
+       </tr>
+               <tr>
+               <td>
+                       Catégorie de fiches pour les copropriétaires
+               </td>
+               <td>
+                       <?=$cat_coprop->input();?>
+               </td>
+       </tr>
+       <tr>
+               <td>
+                       Poste comptable par défaut pour les appels de fond
+               </td>
+               <td>
+                       <?=$poste_appel->input();?>
+               </td>
+       </tr>
+       <tr>
+               <td>
+                       Journal Appel de fond
+               </td>
+               <td>
+                       <?=$journal_appel->input();?>
+               </td>
+       </tr>
+</table>
+       <?=HtmlInput::submit("save","Sauver")?>
+</form>
\ No newline at end of file

Added: trunk/coprop/include/coprop_parameter.php
===================================================================
--- trunk/coprop/include/coprop_parameter.php                           (rev 0)
+++ trunk/coprop/include/coprop_parameter.php   2011-12-11 15:46:41 UTC (rev 
207)
@@ -0,0 +1,29 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief
+ *
+ */
+?>

Added: trunk/coprop/include/key.inc.php
===================================================================
--- trunk/coprop/include/key.inc.php                            (rev 0)
+++ trunk/coprop/include/key.inc.php    2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1,75 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief gestion des clefs de répartitions
+ *
+ */
+global $cn,$gDossier;
+$sql="select cr_id,cr_name,cr_note,cr_start,cr_end from 
coprop.clef_repartition ";
+/**
+ * @todo ajouter tri
+ */
+
+$a_key=$cn->get_array($sql);
+?>
+<table class="result">
+       <tr>
+               <th>
+                       Nom
+               </th>
+               <th>
+                       Note
+               </th>
+               <th>
+                       Date début
+               </th>
+               <th>
+                       Date Fin
+               </th>
+       </tr>
+<?
+for ($i=0;$i < count($a_key);$i++):
+       
$js=sprintf("mod_key(\'%s\',\'%s\',\'%s\')",$gDossier,$a_key[$i]['cr_id'],$_REQUEST['plugin_code']);
+       $mod_key=HtmlInput::anchor($a_key[$i]['cr_name'],"",$js);
+?>
+       <tr>
+               <td>
+                       <?=$mod_key?>
+               </td>
+               <td>
+                       <?=$a_key[$i]['cr_note']?>
+               </td>
+               <td>
+                       <?=format_date($a_key[$i]['cr_date'])?>
+               </td>
+               <td>
+                       <?=format_date($a_key[$i]['cr_end'])?>
+               </td>
+       </tr>
+<?
+endfor;
+?>
+</table>
+<?=HtmlInput::button("add_key","Ajout 
clef","onclick=\"add_key('".$gDossier."')\"")?>
\ No newline at end of file

Added: trunk/coprop/include/lot.inc.php
===================================================================
--- trunk/coprop/include/lot.inc.php                            (rev 0)
+++ trunk/coprop/include/lot.inc.php    2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1,66 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief liaison entre lot et copropriétaires
+ *
+ */
+global $cn,$g_copro_parameter;
+//require_once 'include/class_coprop-lot_coprop.php';
+/* Add button */
+$f_add_button=new IButton('add_card');
+$f_add_button->label=_('Créer une nouvelle fiche');
+$f_add_button->set_attribute('ipopup','ipop_newcard');
+$f_add_button->set_attribute('jrn',-1);
+$filter=$g_copro_parameter->categorie_lot.",".$g_copro_parameter->categorie_coprop;
+$f_add_button->javascript=" 
this.filter='$filter';this.jrn=-1;select_card_type(this);";
+
+
+/*
+ * Liste
+ */
+$sql=" select jcl_id,
+       jcl_copro,
+       (select ad_value from fiche_detail where f_id=jcl_copro and ad_id=1) as 
coprop_name,
+       (select ad_value from fiche_detail where f_id=jcl_copro and ad_id=23) 
as coprop_qcode
+       from
+       coprop.jnt_coprop_lot
+       ";
+/**
+ * @todo ajouter tri
+ */
+$a_copro=$cn->get_array($sql);
+
+$sql_lot=$cn->prepare ("lot","select jcl_lot, (select ad_value from 
fiche_detail where f_id=jcl_lot and ad_id=1) as lot_name,
+       (select ad_value from fiche_detail where f_id=jcl_lot and ad_id=23) as 
lot_qcode from coprop.jnt_coprop_lot where jcl_id=$1");
+
+echo $f_add_button->input();
+require_once 'template/list_copro_lot.php';
+echo $f_add_button->input();
+/**
+ * @todo
+ * Bouton pour ajouter une fiche de lot ou copro (comme dans menu ach/ven...)
+ */
+
+?>

Added: trunk/coprop/include/template/appel_fond.php
===================================================================
--- trunk/coprop/include/template/appel_fond.php                                
(rev 0)
+++ trunk/coprop/include/template/appel_fond.php        2011-12-11 15:46:41 UTC 
(rev 207)
@@ -0,0 +1,74 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief demande info pour générer appel de fond
+ *
+ */
+?>
+<table>
+       <tr>
+
+               <td>Journal pour l'appel de fond</td>
+               <td>
+                       <?=$led_appel_fond->input()?>
+               </td>
+       </tr>
+       <tr>
+               <td>
+                       Date de l'opération
+               </td>
+               <td>
+                       <?=$date->input()?>
+               </td>
+       </tr>
+       <tr>
+
+               <td>
+                       Montant à répartir
+               </td>
+               <td>
+                       <?=$amount->input()?>
+               </td>
+       </tr>
+       <tr>
+
+               <td>
+                       Poste comptable pour l'appel de fond
+               </td>
+               <td>
+                       <?=$poste_appel->input()?>
+               </td>
+       </tr>
+       <tr>
+
+               <td>
+                       Clef de répartiton à utiliser
+               </td>
+               <td>
+                       <?=$key->input()?>
+               </td>
+       </tr>
+
+</table>
\ No newline at end of file

Added: trunk/coprop/include/template/list_copro_lot.php
===================================================================
--- trunk/coprop/include/template/list_copro_lot.php                            
(rev 0)
+++ trunk/coprop/include/template/list_copro_lot.php    2011-12-11 15:46:41 UTC 
(rev 207)
@@ -0,0 +1,67 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief show list between lot et copropriétaire
+ *
+ */
+$gDossier=Dossier::id();
+?>
+<table class="result">
+       <tr>
+               <th> Nom copropriétaire </th>
+               <th>
+                       Lot(s)
+               </th>
+       </tr>
+<?
+for ($i=0;$i<count($a_copro);$i++):
+       
$col_copro=HtmlInput::anchor($a_copro[$i]['copro_name'],"","mod_coprop($gDossier,'".$a_copro[$i]['jcl_copro']."','".$_REQUEST['plugin_code']."'");
+?>
+       <tr>
+               <td><?=col_copro?></td>
+       </tr>
+       <td>
+               <?
+                       $rlot=$cn->execute('lot',$a_copro[$i]['jcl_id']);
+                       $max=Database::num_row($rlot);
+                       $sp="";
+                       for ($e=0;$e<$max;$e++):
+                               $row=Database::fetch_array($rlot,$e);
+                               
$js_lot=HtmlInput::card_detail($row['lot_qcode'],$row['lot_name']);
+                               echo $js_lot.$sp;
+                               $sp=" , ";
+                       endfor;
+               ?>
+
+       </td>
+</tr>
+<?
+endfor;
+?>
+
+</table>
+<?
+echo HtmlInput::button("add_link","Ajout Copropriétaire / lot 
","onclick=\"add_coprop('$gDossier')\"");
+?>
\ No newline at end of file

Added: trunk/coprop/index.php
===================================================================
--- trunk/coprop/index.php                              (rev 0)
+++ trunk/coprop/index.php      2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1,119 @@
+<?php
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/*!\file
+ * \brief main file for tva
+ */
+
+/*
+ * load javascript
+ */
+
+require_once 'class_acc_ledger.php';
+
+ob_start();
+require_once('coprop-javascript.js');
+$j=ob_get_contents();
+ob_clean();
+echo create_script($j);
+
+$url='?'.dossier::get().'&plugin_code='.$_REQUEST['plugin_code'].'&ac='.$_REQUEST['ac'];
+$array=array (
+         array($url.'&sa=lot',_('Lot'),_('Listes des lots et liaison 
copro'),1),
+         array($url.'&sa=cle',_('Clef de répartition'),_('Clef de 
répartition'),2),
+         array($url.'&sa=af',_('Appel de fond'),_('Création décompte pour 
appel de fond'),3),
+         array($url.'&sa=pa',_('Paramètre'),_('Configuration et paramètre'),4)
+       );
+
+$sa=(isset($_REQUEST['sa']))?$_REQUEST['sa']:0;
+$def=0;
+switch($sa)
+  {
+  case 'lot':
+    $def=1;
+    break;
+  case 'cle':
+    $def=2;
+    break;
+  case 'af':
+    $def=3;
+    break;
+  case 'pa':
+    $def=4;
+    break;
+  }
+
+$cn=new Database(dossier::id());
+if ( $cn->exist_schema('coprop') == false)
+  {
+    require_once('include/class_install_plugin.php');
+
+    $iplugn=new Install_Plugin($cn);
+    $iplugn->install();
+    echo_warning(_("L'extension est installée, pourriez-vous en vérifier le 
paramètrage ?"));
+       // Affiche paramètre
+    $def=4;
+  }
+require_once('coprop-constant.php');
+// show menu
+echo '<div style="float:right"><a class="mtitle" style="font-size:140%" 
href="http://wiki.phpcompta.eu/doku.php?id=plugin:copropriété"; 
target="_blank">Aide</a>'.
+'<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>'.
+'</div>';
+
+echo ShowItem($array,'H','mtitle ','mtitle ',$def,' class="topmenu"');
+
+// include the right file
+/*
+ * Lot
+ */
+if ($def==1)
+  {
+    require_once('include/lot.inc.php');
+    exit();
+  }
+
+/*
+ * Paramètre
+ */
+if ($def==4)
+  {
+    require_once('include/copro-parameter.inc.php');
+    exit();
+  }
+/*
+ * Clef
+ */
+if ($def==2)
+  {
+    require_once('include/key.inc.php');
+    exit();
+  }
+/*
+ * Appel de fond
+ */
+if ($def==3)
+  {
+    require_once('include/appel_fond.inc.php');
+    exit();
+  }
+
+?>

Added: trunk/coprop/raw.php
===================================================================
--- trunk/coprop/raw.php                                (rev 0)
+++ trunk/coprop/raw.php        2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1,44 @@
+<?php
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/*!\file
+ * \brief raw file for PDF ewa
+ */
+require_once('amortis_constant.php');
+
+extract ($_REQUEST);
+
+/* export all cards in PDF */
+/* EXAMPLE
+if ( isset($_REQUEST['pdf_all']))
+  {
+    require_once('include/class_pdf_card.php');
+    global $cn;
+    $a=new Pdf_Card($cn);
+    $a->setDossierInfo(dossier::id());
+    $a->AliasNbPages('{nb}');
+    $a->AddPage();
+    $a->export();
+    exit();
+  }
+*/
+?>

Added: trunk/coprop/sql/trunk_dev.sql
===================================================================
--- trunk/coprop/sql/trunk_dev.sql                              (rev 0)
+++ trunk/coprop/sql/trunk_dev.sql      2011-12-11 15:46:41 UTC (rev 207)
@@ -0,0 +1,352 @@
+--
+-- PostgreSQL database dump
+--
+
+-- Dumped from database version 9.0.4
+-- Dumped by pg_dump version 9.0.4
+-- Started on 2011-12-11 16:40:35 CET
+
+SET statement_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = off;
+SET check_function_bodies = false;
+SET client_min_messages = warning;
+SET escape_string_warning = off;
+
+--
+-- TOC entry 8 (class 2615 OID 7283076)
+-- Name: coprop; Type: SCHEMA; Schema: -; Owner: dany
+--
+
+CREATE SCHEMA coprop;
+
+
+ALTER SCHEMA coprop OWNER TO dany;
+
+SET search_path = coprop, pg_catalog;
+
+SET default_tablespace = '';
+
+SET default_with_oids = false;
+
+--
+-- TOC entry 2087 (class 1259 OID 7283087)
+-- Dependencies: 8
+-- Name: clef_repartition; Type: TABLE; Schema: coprop; Owner: dany; 
Tablespace: 
+--
+
+CREATE TABLE clef_repartition (
+    cr_id integer NOT NULL,
+    cr_name text NOT NULL,
+    cr_note text,
+    cr_start date,
+    cr_end date
+);
+
+
+ALTER TABLE coprop.clef_repartition OWNER TO dany;
+
+--
+-- TOC entry 2086 (class 1259 OID 7283085)
+-- Dependencies: 2087 8
+-- Name: clef_repartition_cr_id_seq; Type: SEQUENCE; Schema: coprop; Owner: 
dany
+--
+
+CREATE SEQUENCE clef_repartition_cr_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE coprop.clef_repartition_cr_id_seq OWNER TO dany;
+
+--
+-- TOC entry 2399 (class 0 OID 0)
+-- Dependencies: 2086
+-- Name: clef_repartition_cr_id_seq; Type: SEQUENCE OWNED BY; Schema: coprop; 
Owner: dany
+--
+
+ALTER SEQUENCE clef_repartition_cr_id_seq OWNED BY clef_repartition.cr_id;
+
+
+--
+-- TOC entry 2400 (class 0 OID 0)
+-- Dependencies: 2086
+-- Name: clef_repartition_cr_id_seq; Type: SEQUENCE SET; Schema: coprop; 
Owner: dany
+--
+
+SELECT pg_catalog.setval('clef_repartition_cr_id_seq', 1, false);
+
+
+--
+-- TOC entry 2089 (class 1259 OID 7283136)
+-- Dependencies: 2379 8
+-- Name: clef_repartition_detail; Type: TABLE; Schema: coprop; Owner: dany; 
Tablespace: 
+--
+
+CREATE TABLE clef_repartition_detail (
+    crd_id integer NOT NULL,
+    crd_lot bigint,
+    crd_amount numeric(20,4) DEFAULT 0,
+    cr_id bigint
+);
+
+
+ALTER TABLE coprop.clef_repartition_detail OWNER TO dany;
+
+--
+-- TOC entry 2088 (class 1259 OID 7283134)
+-- Dependencies: 8 2089
+-- Name: clef_repartition_detail_crd_id_seq; Type: SEQUENCE; Schema: coprop; 
Owner: dany
+--
+
+CREATE SEQUENCE clef_repartition_detail_crd_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE coprop.clef_repartition_detail_crd_id_seq OWNER TO dany;
+
+--
+-- TOC entry 2401 (class 0 OID 0)
+-- Dependencies: 2088
+-- Name: clef_repartition_detail_crd_id_seq; Type: SEQUENCE OWNED BY; Schema: 
coprop; Owner: dany
+--
+
+ALTER SEQUENCE clef_repartition_detail_crd_id_seq OWNED BY 
clef_repartition_detail.crd_id;
+
+
+--
+-- TOC entry 2402 (class 0 OID 0)
+-- Dependencies: 2088
+-- Name: clef_repartition_detail_crd_id_seq; Type: SEQUENCE SET; Schema: 
coprop; Owner: dany
+--
+
+SELECT pg_catalog.setval('clef_repartition_detail_crd_id_seq', 1, false);
+
+
+--
+-- TOC entry 2091 (class 1259 OID 7283155)
+-- Dependencies: 8
+-- Name: jnt_coprop_lot; Type: TABLE; Schema: coprop; Owner: dany; Tablespace: 
+--
+
+CREATE TABLE jnt_coprop_lot (
+    jcl_id integer NOT NULL,
+    jcl_copro bigint,
+    jcl_lot bigint
+);
+
+
+ALTER TABLE coprop.jnt_coprop_lot OWNER TO dany;
+
+--
+-- TOC entry 2090 (class 1259 OID 7283153)
+-- Dependencies: 8 2091
+-- Name: jnt_coprop_lot_jlc_id_seq; Type: SEQUENCE; Schema: coprop; Owner: dany
+--
+
+CREATE SEQUENCE jnt_coprop_lot_jlc_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE coprop.jnt_coprop_lot_jlc_id_seq OWNER TO dany;
+
+--
+-- TOC entry 2403 (class 0 OID 0)
+-- Dependencies: 2090
+-- Name: jnt_coprop_lot_jlc_id_seq; Type: SEQUENCE OWNED BY; Schema: coprop; 
Owner: dany
+--
+
+ALTER SEQUENCE jnt_coprop_lot_jlc_id_seq OWNED BY jnt_coprop_lot.jcl_id;
+
+
+--
+-- TOC entry 2404 (class 0 OID 0)
+-- Dependencies: 2090
+-- Name: jnt_coprop_lot_jlc_id_seq; Type: SEQUENCE SET; Schema: coprop; Owner: 
dany
+--
+
+SELECT pg_catalog.setval('jnt_coprop_lot_jlc_id_seq', 1, false);
+
+
+--
+-- TOC entry 2085 (class 1259 OID 7283077)
+-- Dependencies: 8
+-- Name: parameter; Type: TABLE; Schema: coprop; Owner: dany; Tablespace: 
+--
+
+CREATE TABLE parameter (
+    pr_id text NOT NULL,
+    pr_value text
+);
+
+
+ALTER TABLE coprop.parameter OWNER TO dany;
+
+--
+-- TOC entry 2377 (class 2604 OID 7283090)
+-- Dependencies: 2086 2087 2087
+-- Name: cr_id; Type: DEFAULT; Schema: coprop; Owner: dany
+--
+
+ALTER TABLE clef_repartition ALTER COLUMN cr_id SET DEFAULT 
nextval('clef_repartition_cr_id_seq'::regclass);
+
+
+--
+-- TOC entry 2378 (class 2604 OID 7283139)
+-- Dependencies: 2088 2089 2089
+-- Name: crd_id; Type: DEFAULT; Schema: coprop; Owner: dany
+--
+
+ALTER TABLE clef_repartition_detail ALTER COLUMN crd_id SET DEFAULT 
nextval('clef_repartition_detail_crd_id_seq'::regclass);
+
+
+--
+-- TOC entry 2380 (class 2604 OID 7283158)
+-- Dependencies: 2090 2091 2091
+-- Name: jcl_id; Type: DEFAULT; Schema: coprop; Owner: dany
+--
+
+ALTER TABLE jnt_coprop_lot ALTER COLUMN jcl_id SET DEFAULT 
nextval('jnt_coprop_lot_jlc_id_seq'::regclass);
+
+
+--
+-- TOC entry 2394 (class 0 OID 7283087)
+-- Dependencies: 2087
+-- Data for Name: clef_repartition; Type: TABLE DATA; Schema: coprop; Owner: 
dany
+--
+
+COPY clef_repartition (cr_id, cr_name, cr_note, cr_start, cr_end) FROM stdin;
+\.
+
+
+--
+-- TOC entry 2395 (class 0 OID 7283136)
+-- Dependencies: 2089
+-- Data for Name: clef_repartition_detail; Type: TABLE DATA; Schema: coprop; 
Owner: dany
+--
+
+COPY clef_repartition_detail (crd_id, crd_lot, crd_amount, cr_id) FROM stdin;
+\.
+
+
+--
+-- TOC entry 2396 (class 0 OID 7283155)
+-- Dependencies: 2091
+-- Data for Name: jnt_coprop_lot; Type: TABLE DATA; Schema: coprop; Owner: dany
+--
+
+COPY jnt_coprop_lot (jcl_id, jcl_copro, jcl_lot) FROM stdin;
+\.
+
+
+--
+-- TOC entry 2393 (class 0 OID 7283077)
+-- Dependencies: 2085
+-- Data for Name: parameter; Type: TABLE DATA; Schema: coprop; Owner: dany
+--
+
+COPY parameter (pr_id, pr_value) FROM stdin;
+categorie_lot  1
+categorie_coprop       2
+poste_appel    740
+journal_appel  4
+\.
+
+
+--
+-- TOC entry 2386 (class 2606 OID 7283142)
+-- Dependencies: 2089 2089
+-- Name: clef_repartition_detail_pkey; Type: CONSTRAINT; Schema: coprop; 
Owner: dany; Tablespace: 
+--
+
+ALTER TABLE ONLY clef_repartition_detail
+    ADD CONSTRAINT clef_repartition_detail_pkey PRIMARY KEY (crd_id);
+
+
+--
+-- TOC entry 2384 (class 2606 OID 7283095)
+-- Dependencies: 2087 2087
+-- Name: clef_repartition_pkey; Type: CONSTRAINT; Schema: coprop; Owner: dany; 
Tablespace: 
+--
+
+ALTER TABLE ONLY clef_repartition
+    ADD CONSTRAINT clef_repartition_pkey PRIMARY KEY (cr_id);
+
+
+--
+-- TOC entry 2382 (class 2606 OID 7283084)
+-- Dependencies: 2085 2085
+-- Name: copro_parameter_pkey; Type: CONSTRAINT; Schema: coprop; Owner: dany; 
Tablespace: 
+--
+
+ALTER TABLE ONLY parameter
+    ADD CONSTRAINT copro_parameter_pkey PRIMARY KEY (pr_id);
+
+
+--
+-- TOC entry 2388 (class 2606 OID 7283160)
+-- Dependencies: 2091 2091
+-- Name: jnt_coprop_lot_pkey; Type: CONSTRAINT; Schema: coprop; Owner: dany; 
Tablespace: 
+--
+
+ALTER TABLE ONLY jnt_coprop_lot
+    ADD CONSTRAINT jnt_coprop_lot_pkey PRIMARY KEY (jcl_id);
+
+
+--
+-- TOC entry 2390 (class 2606 OID 7283148)
+-- Dependencies: 2089 2087 2383
+-- Name: clef_repartition_detail_cr_id_fkey; Type: FK CONSTRAINT; Schema: 
coprop; Owner: dany
+--
+
+ALTER TABLE ONLY clef_repartition_detail
+    ADD CONSTRAINT clef_repartition_detail_cr_id_fkey FOREIGN KEY (cr_id) 
REFERENCES clef_repartition(cr_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- TOC entry 2389 (class 2606 OID 7283143)
+-- Dependencies: 2089 1947
+-- Name: clef_repartition_detail_crl_lot_fkey; Type: FK CONSTRAINT; Schema: 
coprop; Owner: dany
+--
+
+ALTER TABLE ONLY clef_repartition_detail
+    ADD CONSTRAINT clef_repartition_detail_crl_lot_fkey FOREIGN KEY (crd_lot) 
REFERENCES public.fiche(f_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- TOC entry 2391 (class 2606 OID 7283161)
+-- Dependencies: 1947 2091
+-- Name: jnt_coprop_lot_jcl_copro_fkey; Type: FK CONSTRAINT; Schema: coprop; 
Owner: dany
+--
+
+ALTER TABLE ONLY jnt_coprop_lot
+    ADD CONSTRAINT jnt_coprop_lot_jcl_copro_fkey FOREIGN KEY (jcl_copro) 
REFERENCES public.fiche(f_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- TOC entry 2392 (class 2606 OID 7283166)
+-- Dependencies: 1947 2091
+-- Name: jnt_coprop_lot_jcl_lot_fkey; Type: FK CONSTRAINT; Schema: coprop; 
Owner: dany
+--
+
+ALTER TABLE ONLY jnt_coprop_lot
+    ADD CONSTRAINT jnt_coprop_lot_jcl_lot_fkey FOREIGN KEY (jcl_lot) 
REFERENCES public.fiche(f_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+-- Completed on 2011-12-11 16:40:35 CET
+
+--
+-- PostgreSQL database dump complete
+--
+

Modified: trunk/skel/index.php
===================================================================
--- trunk/skel/index.php        2011-12-04 05:36:15 UTC (rev 206)
+++ trunk/skel/index.php        2011-12-11 15:46:41 UTC (rev 207)
@@ -33,7 +33,8 @@
 ob_clean();
 echo create_script($j);
 
-$url='?'.dossier::get().'&code=tva';
+$url='?'.dossier::get().'&plugin_code='.$_REQUEST['plugin_code'].'&ac='.$_REQUEST['ac'];
+
 $array=array (
          array($url.'&sa=dec',_('Déclaration TVA'),_('Déclaration Trimestriel 
ou annuel de TVA'),1),
          array($url.'&sa=li',_('Listing intracommunautaire'),_('Listing 
intracommunautaire trimestriel'),2),

Modified: trunk/skel/skel_constant.php
===================================================================
--- trunk/skel/skel_constant.php        2011-12-04 05:36:15 UTC (rev 206)
+++ trunk/skel/skel_constant.php        2011-12-11 15:46:41 UTC (rev 207)
@@ -8,7 +8,9 @@
  */
 
 require_once ('class_database.php');
+require_once 'include/class_SKEL_parameter.php');
 
-global $cn;
+global $cn,$g_SKEL_parameter;
 $cn=new Database (dossier::id());
+$g_SKEL_parameter=new SKEL_Parameter();
 ?>
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]