phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4891 - in phpcompta/trunk: html html/js include sql


From: phpcompta-dev
Subject: [Phpcompta-dev] r4891 - in phpcompta/trunk: html html/js include sql
Date: Wed, 13 Jun 2012 21:16:44 +0200 (CEST)

Author: danydb
Date: 2012-06-13 21:16:44 +0200 (Wed, 13 Jun 2012)
New Revision: 4891

Added:
   phpcompta/trunk/include/ajax_mod_stock_repo.php
   phpcompta/trunk/include/stock_cfg.inc.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/class_own.php
   phpcompta/trunk/include/company.inc.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000572: Ajout de d?\195?\169p?\195?\180t pour les stocks

Modified: phpcompta/trunk/html/ajax_misc.php
===================================================================
--- phpcompta/trunk/html/ajax_misc.php  2012-06-13 17:22:54 UTC (rev 4890)
+++ phpcompta/trunk/html/ajax_misc.php  2012-06-13 19:16:44 UTC (rev 4891)
@@ -57,7 +57,7 @@
        exit();
 extract($_REQUEST);
 set_language();
-global $g_user;
+global $g_user,$cn;
 $cn = new Database($gDossier);
 $g_user = new User($cn);
 $g_user->check(true);
@@ -547,6 +547,9 @@
         case 'modify_menu';
             require_once 'ajax_mod_menu.php';
             break;
+               case 'mod_stock_repo':
+               require_once 'ajax_mod_stock_repo.php';
+               break;
         default:
             var_dump($_GET);
 }

Modified: phpcompta/trunk/html/js/scripts.js
===================================================================
--- phpcompta/trunk/html/js/scripts.js  2012-06-13 17:22:54 UTC (rev 4890)
+++ phpcompta/trunk/html/js/scripts.js  2012-06-13 19:16:44 UTC (rev 4891)
@@ -418,7 +418,7 @@
     removeDiv('change_doc_div');
     waiting_box();
     var action = new Ajax.Request(
-                                 "ajax_misc.php" , 
+                                 "ajax_misc.php" ,
                                  {
                                      method:'get', parameters:queryString,
                                      onFailure:ajax_misc_failure,
@@ -1512,4 +1512,30 @@
                alert(e.message);
                return false;
        }
- }
\ No newline at end of file
+ }
+ /**
+ address@hidden change a document_modele
+ */
+function stock_repo_change(p_dossier,r_id)
+{
+    var queryString="gDossier="+p_dossier+"&op=mod_stock_repo"+"&r_id="+r_id;
+    var nTop=calcy(posY);
+    var nLeft="200px";
+    var str_style="top:"+nTop+"px;left:"+nLeft+";width:50em;height:auto";
+
+    removeDiv('change_stock_repo_div');
+    waiting_box();
+    var action = new Ajax.Request(
+                                 "ajax_misc.php" ,
+                                 {
+                                     method:'get', parameters:queryString,
+                                     onFailure:ajax_misc_failure,
+                                     onSuccess:function(req){
+                                         remove_waiting_box();
+                                         
add_div({id:'change_stock_repo_div',style:str_style,cssclass:'inner_box',drag:"1"});
+                                         
$('change_stock_repo_div').innerHTML=req.responseText;
+
+                                     }
+                                 }
+                                 );
+}

Added: phpcompta/trunk/include/ajax_mod_stock_repo.php
===================================================================
--- phpcompta/trunk/include/ajax_mod_stock_repo.php                             
(rev 0)
+++ phpcompta/trunk/include/ajax_mod_stock_repo.php     2012-06-13 19:16:44 UTC 
(rev 4891)
@@ -0,0 +1,80 @@
+<?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 a depot
+ *
+ */
+require_once 'class_stock_sql.php';
+$st=new Stock_Sql($_GET['r_id']);
+
+?>
+<?=HtmlInput::title_box("Ajouter un dépôt","change_stock_repo_div","close")?>
+       <form method="post">
+               <?=HtmlInput::hidden("r_id",$_GET['r_id']);?>
+               <table>
+                       <tr>
+                               <td>
+                                       Nom
+                               </td>
+                               <td>
+                                       <? $name=new 
IText("r_name",$st->r_name); echo $name->input();?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       Adresse
+                               </td>
+                               <td>
+                                       <? $name=new 
IText("r_adress",$st->r_adress); echo $name->input();?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       Ville
+                               </td>
+                               <td>
+                                       <? $name=new 
IText("r_city",$st->r_city); echo $name->input();?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       Pays
+                               </td>
+                               <td>
+                                       <? $name=new 
IText("r_country",$st->r_country); echo $name->input();?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       Téléphone
+                               </td>
+                               <td>
+                                       <? $name=new 
IText("r_phone",$st->r_phone); echo $name->input();?>
+                               </td>
+                       </tr>
+
+               </table>
+               <?=HtmlInput::submit("mod_stock","Sauver")?>
+       </form>
\ No newline at end of file

Modified: phpcompta/trunk/include/class_html_input.php
===================================================================
--- phpcompta/trunk/include/class_html_input.php        2012-06-13 17:22:54 UTC 
(rev 4890)
+++ phpcompta/trunk/include/class_html_input.php        2012-06-13 19:16:44 UTC 
(rev 4891)
@@ -588,9 +588,10 @@
        }
       return $array[$ind];
     }
-       static function title_box($name,$div)
+       static function title_box($name,$div,$mod="close")
        {
-               $r=HtmlInput::anchor_close($div);
+               if ($mod=='close')              
$r=HtmlInput::anchor_close($div);
+               if ($mod=='hide')               
$r=HtmlInput::anchor_hide(_('Fermer'),"$('$div').hide()");
                $r.=h2info($name);
                return $r;
        }

Modified: phpcompta/trunk/include/class_own.php
===================================================================
--- phpcompta/trunk/include/class_own.php       2012-06-13 17:22:54 UTC (rev 
4890)
+++ phpcompta/trunk/include/class_own.php       2012-06-13 19:16:44 UTC (rev 
4891)
@@ -105,6 +105,7 @@
         $this->save('MY_DATE_SUGGEST');
         $this->save('MY_ALPHANUM');
         $this->save('MY_UPDLAB');
+        $this->save('MY_STOCK');
 
 
     }

Modified: phpcompta/trunk/include/company.inc.php
===================================================================
--- phpcompta/trunk/include/company.inc.php     2012-06-13 17:22:54 UTC (rev 
4890)
+++ phpcompta/trunk/include/company.inc.php     2012-06-13 19:16:44 UTC (rev 
4891)
@@ -1,120 +1,130 @@
 <?php
+
 global $g_user;
-    echo '<div class="content">';
-    require_once("class_own.php");
-    if ( isset ($_POST['record_company'] ))
-    {
-        $m=new Own($cn);
-        extract($_POST);
-        $m->MY_NAME=$p_name;
-        $m->MY_TVA=$p_tva;
-        $m->MY_STREET=$p_street;
-        $m->MY_NUMBER=$p_no;
-        $m->MY_CP=$p_cp;
-        $m->MY_COMMUNE=$p_Commune;
-        $m->MY_TEL=$p_tel;
-        $m->MY_FAX=$p_fax;
-        $m->MY_PAYS=$p_pays;
-        $m->MY_CHECK_PERIODE=$p_check_periode;
-        $m->MY_DATE_SUGGEST=$p_date_suggest;
-        $m->MY_ANALYTIC=$p_compta;
-        $m->MY_STRICT=$p_strict;
-        $m->MY_TVA_USE=$p_tva_use;
-        $m->MY_PJ_SUGGEST=$p_pj;
-       $m->MY_ALPHANUM=$p_alphanum;
-       $m->MY_UPDLAB=$p_updlab;
+echo '<div class="content">';
+require_once("class_own.php");
+if (isset($_POST['record_company']))
+{
+       $m = new Own($cn);
+       extract($_POST);
+       $m->MY_NAME = $p_name;
+       $m->MY_TVA = $p_tva;
+       $m->MY_STREET = $p_street;
+       $m->MY_NUMBER = $p_no;
+       $m->MY_CP = $p_cp;
+       $m->MY_COMMUNE = $p_Commune;
+       $m->MY_TEL = $p_tel;
+       $m->MY_FAX = $p_fax;
+       $m->MY_PAYS = $p_pays;
+       $m->MY_CHECK_PERIODE = $p_check_periode;
+       $m->MY_DATE_SUGGEST = $p_date_suggest;
+       $m->MY_ANALYTIC = $p_compta;
+       $m->MY_STRICT = $p_strict;
+       $m->MY_TVA_USE = $p_tva_use;
+       $m->MY_PJ_SUGGEST = $p_pj;
+       $m->MY_ALPHANUM = $p_alphanum;
+       $m->MY_UPDLAB = $p_updlab;
+       $m->MY_STOCK = $p_stock;
 
-        $m->Update();
-    }
+       $m->Update();
+}
 
-    $my=new Own($cn);
-    ///// Compta analytic
-    $array=array (
-               array("value"=>"ob",'label'=>_("obligatoire")),
-               array("value"=>"op",'label'=>_("optionnel")),
-               array("value"=>"nu",'label'=>_("non utilisé"))
-           );
-    $strict_array=array(
-                      array('value'=>'N','label'=>_('Non')),
-                      array('value'=>'Y','label'=>_('Oui'))
-                  );
+$my = new Own($cn);
+///// Compta analytic
+$array = array(
+       array("value" => "ob", 'label' => _("obligatoire")),
+       array("value" => "op", 'label' => _("optionnel")),
+       array("value" => "nu", 'label' => _("non utilisé"))
+);
+$strict_array = array(
+       array('value' => 'N', 'label' => _('Non')),
+       array('value' => 'Y', 'label' => _('Oui'))
+);
 
-    $alpha_num_array[0]=array('value'=>'N','label'=>_('Non'));
-    $alpha_num_array[1]=array('value'=>'Y','label'=>_('Oui'));
-    
-    $updlab_array[0]=array('value'=>'N','label'=>_('Non'));
-    $updlab_array[1]=array('value'=>'Y','label'=>_('Oui'));
+$alpha_num_array[0] = array('value' => 'N', 'label' => _('Non'));
+$alpha_num_array[1] = array('value' => 'Y', 'label' => _('Oui'));
 
-    $compta=new ISelect();
-    $compta->table=1;
-    $compta->selected=$my->MY_ANALYTIC;
+$updlab_array[0] = array('value' => 'N', 'label' => _('Non'));
+$updlab_array[1] = array('value' => 'Y', 'label' => _('Oui'));
 
-    $strict=new ISelect();
-    $strict->table=1;
-    $strict->selected=$my->MY_STRICT;
+$compta = new ISelect();
+$compta->table = 1;
+$compta->selected = $my->MY_ANALYTIC;
 
-    $tva_use=new ISelect();
-    $tva_use->table=1;
-    $tva_use->selected=$my->MY_TVA_USE;
+$strict = new ISelect();
+$strict->table = 1;
+$strict->selected = $my->MY_STRICT;
 
-    $pj_suggest=new ISelect();
-    $pj_suggest->table=1;
-    $pj_suggest->selected=$my->MY_PJ_SUGGEST;
+$tva_use = new ISelect();
+$tva_use->table = 1;
+$tva_use->selected = $my->MY_TVA_USE;
 
-    $date_suggest=new ISelect();
-    $date_suggest->table=1;
-    $date_suggest->selected=$my->MY_DATE_SUGGEST;
+$pj_suggest = new ISelect();
+$pj_suggest->table = 1;
+$pj_suggest->selected = $my->MY_PJ_SUGGEST;
 
-    $check_periode=new ISelect();
-    $check_periode->table=1;
-    $check_periode->selected=$my->MY_CHECK_PERIODE;
-    $alpha_num=new ISelect();
-    $alpha_num->table=1;
-    $alpha_num->value=$alpha_num_array;
-    $alpha_num->selected=$my->MY_ALPHANUM;
+$date_suggest = new ISelect();
+$date_suggest->table = 1;
+$date_suggest->selected = $my->MY_DATE_SUGGEST;
 
-    $updlab=new ISelect();
-    $updlab->table=1;
-    $updlab->value=$updlab_array;
-    $updlab->selected=$my->MY_UPDLAB;
+$check_periode = new ISelect();
+$check_periode->table = 1;
+$check_periode->selected = $my->MY_CHECK_PERIODE;
+$alpha_num = new ISelect();
+$alpha_num->table = 1;
+$alpha_num->value = $alpha_num_array;
+$alpha_num->selected = $my->MY_ALPHANUM;
 
-    // other parameters
-    $all=new IText();
-    $all->table=1;
-    echo '<form method="post" >';
-    echo dossier::hidden();
-    echo "<table class=\"result\" style=\"width:auto\">";
-    echo "<tr>".td(_('Nom 
société'),'style="text-align:right"').$all->input("p_name",$my->MY_NAME)."</tr>";
-    $all->value='';
-    echo 
"<tr>".td(_("Téléphone"),'style="text-align:right"').$all->input("p_tel",$my->MY_TEL)."</tr>";
-    $all->value='';
-    echo 
"<tr>".td(_("Fax"),'style="text-align:right"').$all->input("p_fax",$my->MY_FAX)."</tr>";
-    $all->value='';
-    echo "<tr>".td(_("Rue 
"),'style="text-align:right"').$all->input("p_street",$my->MY_STREET)."</tr>";
-    $all->value='';
-    echo 
"<tr>".td(_("Numéro"),'style="text-align:right"').$all->input("p_no",$my->MY_NUMBER)."</tr>";
-    $all->value='';
-    echo "<tr>".td(_("Code 
Postal"),'style="text-align:right"').$all->input("p_cp",$my->MY_CP)."</tr>";
-    $all->value='';
-    echo 
"<tr>".td(_("Commune"),'style="text-align:right"').$all->input("p_Commune",$my->MY_COMMUNE)."</tr>";
-    $all->value='';
-    echo 
"<tr>".td(_("Pays"),'style="text-align:right"').$all->input("p_pays",$my->MY_PAYS)."</tr>";
-    $all->value='';
-    echo "<tr>".td(_("Numéro de 
Tva"),'style="text-align:right"').$all->input("p_tva",$my->MY_TVA)."</tr>";
-    echo "<tr>".td(_("Utilisation de la compta. 
analytique"),'style="text-align:right"').$compta->input("p_compta",$array)."</tr>";
-    
-    echo "<tr>".td(_("Utilisation du mode strict 
"),'style="text-align:right"').$strict->input("p_strict",$strict_array)."</tr>";
-    echo "<tr>".td(_("Assujetti à la 
tva"),'style="text-align:right"').$tva_use->input("p_tva_use",$strict_array)."</tr>";
-    echo "<tr>".td(_("Suggérer le numéro de pièce 
justificative"),'style="text-align:right"').$pj_suggest->input("p_pj",$strict_array)."</tr>";
-    echo "<tr>".td(_("Suggérer la 
date"),'style="text-align:right"').$date_suggest->input("p_date_suggest",$strict_array)."</tr>";
-    echo '<tr>'.td(_('Afficher la période comptable pour éviter les erreurs de 
date'),'style="text-align:right"').$check_periode->input('p_check_periode',$strict_array).'</tr>';
-    echo '<tr>'.td(_('Utilisez des postes comptables 
alphanumérique'),'style="text-align:right"').$alpha_num->input('p_alphanum').'</tr>';
-    echo '<tr>'.td(_('Changer le libellé des détails en VEN ou 
ACH'),'style="text-align:right"').$updlab->input('p_updlab').'</tr>';
+$updlab = new ISelect();
+$updlab->table = 1;
+$updlab->value = $updlab_array;
+$updlab->selected = $my->MY_UPDLAB;
 
-    echo "</table>";
-    echo HtmlInput::submit("record_company",_("Sauve"));
-    echo "</form>";
-    echo '</div>';
-    exit();
+$stock = new ISelect('p_stock');
+$stock->value = array(
+       array('value' => 'N', 'label' => _('Non')),
+       array('value' => 'Y', 'label' => _('Oui'))
+);
+$stock->selected = $my->MY_STOCK;
+$stock->table = 1;
 
+// other parameters
+$all = new IText();
+$all->table = 1;
+echo '<form method="post" >';
+echo dossier::hidden();
+echo "<table class=\"result\" style=\"width:auto\">";
+echo "<tr>" . td(_('Nom société'), 'style="text-align:right"') . 
$all->input("p_name", $my->MY_NAME) . "</tr>";
+$all->value = '';
+echo "<tr>" . td(_("Téléphone"), 'style="text-align:right"') . 
$all->input("p_tel", $my->MY_TEL) . "</tr>";
+$all->value = '';
+echo "<tr>" . td(_("Fax"), 'style="text-align:right"') . $all->input("p_fax", 
$my->MY_FAX) . "</tr>";
+$all->value = '';
+echo "<tr>" . td(_("Rue "), 'style="text-align:right"') . 
$all->input("p_street", $my->MY_STREET) . "</tr>";
+$all->value = '';
+echo "<tr>" . td(_("Numéro"), 'style="text-align:right"') . 
$all->input("p_no", $my->MY_NUMBER) . "</tr>";
+$all->value = '';
+echo "<tr>" . td(_("Code Postal"), 'style="text-align:right"') . 
$all->input("p_cp", $my->MY_CP) . "</tr>";
+$all->value = '';
+echo "<tr>" . td(_("Commune"), 'style="text-align:right"') . 
$all->input("p_Commune", $my->MY_COMMUNE) . "</tr>";
+$all->value = '';
+echo "<tr>" . td(_("Pays"), 'style="text-align:right"') . 
$all->input("p_pays", $my->MY_PAYS) . "</tr>";
+$all->value = '';
+echo "<tr>" . td(_("Numéro de Tva"), 'style="text-align:right"') . 
$all->input("p_tva", $my->MY_TVA) . "</tr>";
+echo "<tr>" . td(_("Utilisation de la compta. analytique"), 
'style="text-align:right"') . $compta->input("p_compta", $array) . "</tr>";
+echo "<tr>" . td(_("Utilisation des stocks"), 'style="text-align:right"') . 
$stock->input() . "</tr>";
+
+echo "<tr>" . td(_("Utilisation du mode strict "), 'style="text-align:right"') 
. $strict->input("p_strict", $strict_array) . "</tr>";
+echo "<tr>" . td(_("Assujetti à la tva"), 'style="text-align:right"') . 
$tva_use->input("p_tva_use", $strict_array) . "</tr>";
+echo "<tr>" . td(_("Suggérer le numéro de pièce justificative"), 
'style="text-align:right"') . $pj_suggest->input("p_pj", $strict_array) . 
"</tr>";
+echo "<tr>" . td(_("Suggérer la date"), 'style="text-align:right"') . 
$date_suggest->input("p_date_suggest", $strict_array) . "</tr>";
+echo '<tr>' . td(_('Afficher la période comptable pour éviter les erreurs de 
date'), 'style="text-align:right"') . $check_periode->input('p_check_periode', 
$strict_array) . '</tr>';
+echo '<tr>' . td(_('Utilisez des postes comptables alphanumérique'), 
'style="text-align:right"') . $alpha_num->input('p_alphanum') . '</tr>';
+echo '<tr>' . td(_('Changer le libellé des détails en VEN ou ACH'), 
'style="text-align:right"') . $updlab->input('p_updlab') . '</tr>';
+
+echo "</table>";
+echo HtmlInput::submit("record_company", _("Sauve"));
+echo "</form>";
+echo '</div>';
+exit();
 ?>

Added: phpcompta/trunk/include/stock_cfg.inc.php
===================================================================
--- phpcompta/trunk/include/stock_cfg.inc.php                           (rev 0)
+++ phpcompta/trunk/include/stock_cfg.inc.php   2012-06-13 19:16:44 UTC (rev 
4891)
@@ -0,0 +1,160 @@
+<?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 Manage the repository
+ *
+ */
+require_once 'class_stock_sql.php';
+require_once 'class_sort_table.php';
+
+global $g_user, $cn,$g_parameter;
+
+if ($g_parameter->MY_STOCK == 'N')
+{
+       echo '<h2 class="notice">';
+       echo _("Vous n'utilisez pas de gestion de stock");
+       echo '</h2>';
+       exit();
+}
+if ( isset ($_POST['add_stock']))
+{
+       $st=new Stock_Sql();
+       $st->from_array($_POST);
+       $st->insert();
+
+}
+if ( isset ($_POST['mod_stock']))
+{
+       $st=new Stock_Sql($_POST['r_id']);
+       $st->from_array($_POST);
+       $st->update();
+
+}
+$tb=new Sort_Table();
+$p_url=HtmlInput::get_to_string(array("ac","gDossier"));
+
+$tb->add(_("Nom"), $p_url, " order by r_name asc", "order by r_name desc", 
"ona", "ond");
+$tb->add(_("Adresse"), $p_url, " order by r_adress asc", "order by r_adress 
desc", "oaa", "oad");
+$tb->add(_("Ville"), $p_url, " order by r_city asc", "order by r_city desc", 
"ova", "ovd");
+$tb->add(_("Pays"), $p_url, " order by r_country asc", "order by r_country 
desc", "opa", "opd");
+$tb->add(_("Téléphone"), $p_url, " order by r_phone asc", "order by r_phone 
desc", "opa", "opd");
+
+$sql="select * from stock_repository ";
+
+$ord=(isset($_GET['ord']))?$_GET['ord']:"ona";
+
+$order=$tb->get_sql_order($ord);
+
+$array=$cn->get_array($sql." ".$order);
+
+?>
+<div class="content">
+
+<table class="result">
+       <tr>
+               <th><?=$tb->get_header(0)?></th>
+               <th><?=$tb->get_header(1)?></th>
+               <th><?=$tb->get_header(2)?></th>
+               <th><?=$tb->get_header(3)?></th>
+               <th><?=$tb->get_header(4)?></th>
+       </tr>
+<? for ($i=0;$i<count($array);$i++): ?>
+       <tr>
+               <td>
+                       <?=h($array[$i]['r_name'])?>
+               </td>
+               <td>
+                       <?=h($array[$i]['r_adress'])?>
+               </td>
+               <td>
+                       <?=h($array[$i]['r_city'])?>
+               </td>
+               <td>
+                       <?=h($array[$i]['r_country'])?>
+               </td>
+               <td>
+                       <?=h($array[$i]['r_phone'])?>
+               </td>
+               <td>
+                       <?
+                               $js=' 
onclick="stock_repo_change(\''.dossier::id().'\',\''.$array[$i]['r_id'].'\')"';
+                               echo HtmlInput::button("mod", _("Modifier"), 
$js);
+                       ?>
+               </td>
+       </tr>
+
+<?endfor;?>
+</table>
+       <?=HtmlInput::button("show_add_depot_d", "Ajout d'un dépot", 
"onclick=\"$('add_depot_d').show();\"");?>
+       <div id="add_depot_d" class="inner_box" style="display:none">
+       <?=HtmlInput::title_box("Ajouter un dépôt","add_depot_d","hide")?>
+       <form method="post">
+               <table>
+                       <tr>
+                               <td>
+                                       Nom
+                               </td>
+                               <td>
+                                       <? $name=new IText("r_name",""); echo 
$name->input();?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       Adresse
+                               </td>
+                               <td>
+                                       <? $name=new IText("r_adress",""); echo 
$name->input();?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       Ville
+                               </td>
+                               <td>
+                                       <? $name=new IText("r_city",""); echo 
$name->input();?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       Pays
+                               </td>
+                               <td>
+                                       <? $name=new IText("r_country",""); 
echo $name->input();?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       Téléphone
+                               </td>
+                               <td>
+                                       <? $name=new IText("r_phone",""); echo 
$name->input();?>
+                               </td>
+                       </tr>
+
+               </table>
+               <?=HtmlInput::submit("add_stock","Sauver")?>
+       </form>
+       </div>
+</div>

Modified: phpcompta/trunk/sql/upgrade.sql
===================================================================
--- phpcompta/trunk/sql/upgrade.sql     2012-06-13 17:22:54 UTC (rev 4890)
+++ phpcompta/trunk/sql/upgrade.sql     2012-06-13 19:16:44 UTC (rev 4891)
@@ -212,3 +212,32 @@
 INSERT INTO profile (p_name, p_id, p_desc, with_calc, with_direct_form) VALUES 
('Public', -1, 'faux groupe', NULL, NULL);
 insert into user_sec_action_profile(p_id,p_granted,ua_right) select 1,p_id,'W' 
from profile;
 insert into user_sec_action_profile(p_id,p_granted ,ua_right) select 
2,p_id,'W' from profile;
+insert into parameter values('MY_STOCK','N');
+
+INSERT INTO menu_ref(me_code, me_menu, me_file, me_url, me_description, 
me_parameter,
+            me_javascript, me_type)
+    VALUES ('CFGSTOCK', 'Configuration des dépôts', 'stock_cfg.inc.php', null, 
'Configuration dépôts', null,null,'ME');
+
+INSERT INTO profile_menu(me_code, me_code_dep, p_id, p_order, p_type_display, 
pm_default)
+    VALUES ('CFGSTOCK', 'PARAM', 1, 40, 'E', 0);
+
+CREATE TABLE stock_repository
+(
+  r_id bigserial NOT NULL, -- pk
+  r_name text, -- name of the stock
+  r_adress text, -- adress of the stock
+  r_country text, -- country of the stock
+  r_city text, -- City of the stock
+  r_phone text, -- City of the stock
+  CONSTRAINT stock_repository_pkey PRIMARY KEY (r_id )
+);
+
+COMMENT ON TABLE stock_repository  IS 'stock repository';
+COMMENT ON COLUMN stock_repository.r_id IS 'pk';
+COMMENT ON COLUMN stock_repository.r_name IS 'name of the stock';
+COMMENT ON COLUMN stock_repository.r_adress IS 'adress of the stock';
+COMMENT ON COLUMN stock_repository.r_country IS 'country of the stock';
+COMMENT ON COLUMN stock_repository.r_city IS 'City of the stock';
+COMMENT ON COLUMN stock_repository.r_phone  IS 'Phone number';
+
+insert into stock_repository(r_name) values ('Dépôt par défaut');
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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