phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r4933 - in phpcompta/trunk: html html/js include include/template sql
Date: Mon, 18 Jun 2012 18:09:02 +0200 (CEST)

Author: danydb
Date: 2012-06-18 18:09:01 +0200 (Mon, 18 Jun 2012)
New Revision: 4933

Added:
   phpcompta/trunk/include/ajax_view_mod_stock.php
   phpcompta/trunk/include/class_stock_goods.php
   phpcompta/trunk/include/class_stock_goods_sql.php
   phpcompta/trunk/include/stock_inv.inc.php
   phpcompta/trunk/include/stock_inv_histo.inc.php
   phpcompta/trunk/include/template/stock_inv.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/class_stock.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000635: Historique des changements manuels de stock

Modified: phpcompta/trunk/html/ajax_misc.php
===================================================================
--- phpcompta/trunk/html/ajax_misc.php  2012-06-18 16:06:00 UTC (rev 4932)
+++ phpcompta/trunk/html/ajax_misc.php  2012-06-18 16:09:01 UTC (rev 4933)
@@ -554,6 +554,9 @@
        case 'mod_stock_repo':
                require_once 'ajax_mod_stock_repo.php';
                break;
+       case 'view_mod_stock':
+               require_once 'ajax_view_mod_stock.php';
+               break;
        default:
                var_dump($_GET);
 }

Modified: phpcompta/trunk/html/js/scripts.js
===================================================================
--- phpcompta/trunk/html/js/scripts.js  2012-06-18 16:06:00 UTC (rev 4932)
+++ phpcompta/trunk/html/js/scripts.js  2012-06-18 16:09:01 UTC (rev 4933)
@@ -1539,3 +1539,26 @@
                                  }
                                  );
 }
+function stock_inv_detail(p_dossier,p_id)
+{
+       var 
queryString="gDossier="+p_dossier+"&op=view_mod_stock"+"&c_id="+p_id+"&ctl=view_mod_stock_div";
+    var nTop=calcy(posY);
+    var nLeft="200px";
+    var str_style="top:"+nTop+"px;left:"+nLeft+";width:75%;";
+
+    removeDiv('view_mod_stock_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:'view_mod_stock_div',style:str_style,cssclass:'inner_box',drag:"1"});
+                                         
$('view_mod_stock_div').innerHTML=req.responseText;
+                                         req.responseText.evalScripts();
+                                     }
+                                 }
+                                 );
+}
\ No newline at end of file

Added: phpcompta/trunk/include/ajax_view_mod_stock.php
===================================================================
--- phpcompta/trunk/include/ajax_view_mod_stock.php                             
(rev 0)
+++ phpcompta/trunk/include/ajax_view_mod_stock.php     2012-06-18 16:09:01 UTC 
(rev 4933)
@@ -0,0 +1,45 @@
+<?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 detail of inv.
+ *
+ */
+require_once 'class_stock_goods.php';
+
+$st=new Stock_Goods();
+$array=$cn->get_array("select * from stock_goods where 
c_id=$1",array($_GET['c_id']));
+echo HtmlInput::title_box("Détail changement",$_GET['ctl']);
+$p_array=array();
+$p_array['p_date']=$cn->get_value("select to_char(c_date,'DD.MM.YYYY') from 
stock_change where c_id=$1",array($_GET['c_id']));
+$p_array['p_motif']=$cn->get_value("select c_comment from stock_change where 
c_id=$1",array($_GET['c_id']));
+$p_array['p_depot']=$cn->get_value("select r_id from stock_change where 
c_id=$1",array($_GET['c_id']));
+for ($i=0;$i<count($array);$i++)
+{
+       $p_array['sg_code'.$i]=$array[$i]['sg_code'];
+       $p_array['sg_quantity'.$i]=$array[$i]['sg_quantity'];
+
+}
+echo $st->input($p_array,true);
+?>

Modified: phpcompta/trunk/include/class_stock.php
===================================================================
--- phpcompta/trunk/include/class_stock.php     2012-06-18 16:06:00 UTC (rev 
4932)
+++ phpcompta/trunk/include/class_stock.php     2012-06-18 16:09:01 UTC (rev 
4933)
@@ -31,41 +31,7 @@
 
 class Stock extends Stock_Sql
 {
-       /*       * *
-        * @brief  return an array of f_id and f_name
-        *
-        *
-        * @param _sg_code stock_goods.sg_code
-        * @return - array (f_id, f_label) or null if nothing is found
-        */
 
-       function getCardNameCode($p_sg_code)
-       {
-               // Sql stmt
-               $sql = "select distinct f_id,ad_value
-         from stock_goods
-         join fiche_detail using(f_id)
-         where
-         ad_id=$1
-         and sg_code=upper($2)
-         ";
-// Execute
-               $Res = $this->cn->exec_sql($sql, array(ATTR_DEF_STOCK, 
$p_sg_code));
-               if (( $M = Database::num_row($Res)) == 0)
-                       return null;
-
-// Store in an array
-               for ($i = 0; $i < $M; $i++)
-               {
-                       $r = Database::fetch_array($Res, $i);
-                       $a['f_id'] = $r['f_id'];
-                       $a['av_text'] = $this->cn->get_value("select ad_value 
from fiche_detail where ad_id=1 and f_id=$2", array($r['f_id']));
-                       $result[$i] = $a;
-               }
-
-               return $result;
-       }
-
        function view_detail_stock($p_sg_code, $p_year)
        {
                $sql = "select sg_id,
@@ -343,6 +309,8 @@
 
        function create_query_histo($p_array)
        {
+               global $cn,$g_user;
+               $profile=$g_user->get_profile();
                $sql = "
                        select sg_id,
                                sg.f_id,
@@ -364,36 +332,29 @@
                        from stock_goods as sg
                        join stock_repository as sr on (sg.r_id=sr.r_id)
                        left join jrnx as jx on (sg.j_id=jx.j_id)
-                       left join jrn as j on (j.jr_grpt_id=jx.j_grpt)";
-               $where = "";
-               $and = "";
+                       left join jrn as j on (j.jr_grpt_id=jx.j_grpt)
+                       where
+                       sg.r_id in (select r_id from user_sec_repository where 
p_id = $profile)";
+               $and = " and ";
                $clause = "";
                if (isset($p_array['wdate_start']) && $p_array['wdate_start'] 
!= '')
                {
-                       $where = "where ";
-                       $clause = " to_date('" . 
sql_string($p_array['wdate_start']) . 
"','DD.MM.YYYY')<=coalesce(sg_date,jr_date) ";
-                       $and = " and ";
+                       $clause = $and." to_date('" . 
sql_string($p_array['wdate_start']) . 
"','DD.MM.YYYY')<=coalesce(sg_date,jr_date) ";
                }
                if (isset($p_array['wdate_end']) && $p_array['wdate_end'] != '')
                {
-                       $where = "where ";
                        $clause.=$and . " to_date('" . 
sql_string($p_array['wdate_end']) . "','DD.MM.YYYY')>=coalesce(sg_date,jr_date) 
";
-                       $and = " and ";
                }
                if (isset($p_array['wamount_start']) && 
$p_array['wamount_start'] != '' && isNumber($p_array['wamount_start']) == 1)
                {
-                       $where = "where ";
                        $clause.=$and . " j_montant >= " . 
sql_string($p_array['wamount_start']);
-                       $and = " and ";
                }
                if (isset($p_array['wamount_end'])
                                && $p_array['wamount_end'] != ''
                                && $p_array['wamount_end'] != 0
                                && isNumber($p_array['wamount_end']) == 1)
                {
-                       $where = "where ";
                        $clause.=$and . " j_montant <= " . 
sql_string($p_array['wamount_end']);
-                       $and = " and ";
                }
                if (isset($p_array['wcard']) && $p_array['wcard'] != '')
                {
@@ -401,30 +362,22 @@
                        $f->get_by_qcode($p_array['wcard'], false);
                        if ($f->id != 0)
                        {
-                               $where = "where ";
                                $clause.=$and . " sg.f_id =  " . 
sql_string($f->id);
-                               $and = " and ";
                        }
                }
                if (isset($p_array['wcode_stock']) && $p_array['wcode_stock'] 
!= "")
                {
-                       $where = "where ";
                        $clause.=$and . " upper(sg_code) =  upper('" . 
sql_string($p_array['wcode_stock']) . "')";
-                       $and = " and ";
                }
                if (isset($p_array['wrepo']) && $p_array['wrepo'] != -1)
                {
-                       $where = "where ";
                        $clause.=$and . " sg.r_id = " . 
sql_string($p_array['wrepo']);
-                       $and = " and ";
                }
                if (isset($p_array['wdirection']) && $p_array['wdirection'] != 
-1)
                {
-                       $where = "where ";
                        $clause.=$and . " sg.sg_type = '" . 
sql_string($p_array['wdirection']) . "'";
-                       $and = " and ";
                }
-               return $sql . $where . $clause;
+               return $sql . $clause;
        }
 
        function summary($p_array)
@@ -493,7 +446,7 @@
                                        left join stock_in as si on ( 
sg.r_id=si.r_id)
                                        full join stock_out as so on 
(si.sg_code=so.sg_code and sg.r_id=so.r_id)
                                where
-                               si.sg_code is not null or so.sg_code is not null
+                               (si.sg_code is not null or so.sg_code is not 
null)
                                 and sg.r_id  in (select r_id from 
user_sec_repository where p_id=$1)
 
                        ";

Added: phpcompta/trunk/include/class_stock_goods.php
===================================================================
--- phpcompta/trunk/include/class_stock_goods.php                               
(rev 0)
+++ phpcompta/trunk/include/class_stock_goods.php       2012-06-18 16:09:01 UTC 
(rev 4933)
@@ -0,0 +1,127 @@
+<?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 goods
+ *
+ */
+require_once 'class_stock_goods_sql.php';
+
+class Stock_Goods extends Stock_Goods_Sql
+{
+
+       function input($p_array = null, $p_readonly = false)
+       {
+               global $cn;
+
+               if ($p_array != null)
+               {
+                       extract($p_array);
+               }
+               else
+               {
+                       $p_date = '';
+                       $p_motif = '';
+                       $p_depot = 0;
+               }
+               $date = new IDate('p_date', $p_date);
+               $date->setReadOnly($p_readonly);
+               $motif = new IText('p_motif', $p_motif);
+               $motif->setReadOnly($p_readonly);
+               $motif->size = 80;
+               $idepo = HtmlInput::select_stock($cn, "p_depot", "W");
+               $idepo->setReadOnly($p_readonly);
+               if (count($idepo->value) == 0)
+               {
+                       NoAccess();
+                       exit();
+               }
+               $idepo->selected = $p_depot;
+               for ($e = 0; $e < MAX_ARTICLE; $e++)
+               {
+                       $sg_code[$e] = new ICard('sg_code' . $e);
+                       $sg_code[$e]->extra = '[sql] fd_id = 500000';
+                       $sg_code[$e]->set_attribute("typecard", 
$sg_code[$e]->extra);
+                       $sg_code[$e]->set_attribute("label", "label" . $e);
+                       $sg_code[$e]->value = (isset(${'sg_code' . $e})) ? 
${'sg_code' . $e} : '';
+                       $sg_quantity[$e] = new INum('sg_quantity' . $e);
+                       $sg_quantity[$e]->value = (isset(${'sg_quantity' . 
$e})) ? ${'sg_quantity' . $e} : '';
+                       $label[$e] = new ISpan("label$e");
+                       if (trim($sg_code[$e]->value) != '')
+                       {
+                               $label[$e]->value = $cn->get_value("select 
vw_name from vw_fiche_attr where quick_code=$1", array($sg_code[$e]->value));
+                       }
+                       $sg_code[$e]->setReadOnly($p_readonly);
+                       $sg_quantity[$e]->setReadOnly($p_readonly);
+               }
+               require_once 'template/stock_inv.php';
+       }
+
+       function save($p_array)
+       {
+               global $cn;
+               try
+               {
+                       if (isDate($p_array['p_date']) == null)
+                               throw new Exception('Date invalide');
+                       $cn->start();
+                       $ch = new Stock_Change_Sql();
+                       $ch->setp("c_comment", $p_array['p_motif']);
+                       $ch->setp("r_id", $p_array['p_depot']);
+                       $ch->setp("c_date", $p_array['p_date']);
+                       $ch->setp('tech_user', $_SESSION['g_user']);
+                       $ch->insert();
+                       $per = new Periode($cn);
+                       $periode = $per->find_periode($p_array['p_date']);
+                       $exercice = $per->get_exercice($periode);
+
+                       for ($i = 0; $i < MAX_ARTICLE; $i++)
+                       {
+                               $a = new Stock_Goods_Sql();
+                               if ($p_array['sg_quantity' . $i] != 0 &&
+                                               trim($p_array['sg_code' . $i]) 
!= '')
+                               {
+                                       $a->sg_code = $p_array['sg_code' . $i];
+                                       $a->sg_quantity = 
$p_array['sg_quantity' . $i];
+                                       $a->sg_type = ($p_array['sg_quantity' . 
$i] > 0) ? 'd' : 'c';
+                                       $a->sg_comment = $p_array['p_motif'];
+                                       $a->tech_user = $_SESSION['g_user'];
+                                       $a->r_id = $p_array['p_depot'];
+                                       $a->sg_exercice = $exercice;
+                                       $a->c_id = $ch->c_id;
+                                       $a->insert();
+                               }
+                       }
+                       $cn->commit();
+               }
+               catch (Exception $exc)
+               {
+                       echo $exc->getTraceAsString();
+                       throw $exc;
+               }
+       }
+
+}
+
+?>

Added: phpcompta/trunk/include/class_stock_goods_sql.php
===================================================================
--- phpcompta/trunk/include/class_stock_goods_sql.php                           
(rev 0)
+++ phpcompta/trunk/include/class_stock_goods_sql.php   2012-06-18 16:09:01 UTC 
(rev 4933)
@@ -0,0 +1,121 @@
+<?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
+ *
+ */
+require_once 'class_phpcompta_sql.php';
+
+class Stock_Goods_Sql extends PhpCompta_Sql
+{
+
+       function __construct($p_id = -1)
+       {
+               $this->table = "public.stock_goods";
+               $this->primary_key = "sg_id";
+               $this->date_format="DD.MM.YYYY";
+
+               $this->name = array(
+                       "sg_id" => "sg_id",
+                       "j_id" => "j_id",
+                       "f_id" => "f_id",
+                       "sg_code" => "sg_code",
+                       "sg_quantity" => "sg_quantity",
+                       "sg_type" => "sg_type",
+                       "sg_date" => "sg_date",
+                       "sg_tech_date" => "sg_tech_date",
+                       "sg_tech_user" => "sg_tech_user",
+                       "sg_comment" => "sg_comment",
+                       "sg_exercice" => "sg_exercice",
+                       "r_id" => "r_id",
+                       "c_id"=>"c_id"
+               );
+
+               $this->type = array(
+                       "sg_id" => "numeric",
+                       "j_id" => "numeric",
+                       "f_id" => "numeric",
+                       "sg_code" => "text",
+                       "sg_quantity" => "text",
+                       "sg_type" => "text",
+                       "sg_date" => "date",
+                       "sg_tech_date" => "date",
+                       "sg_tech_user" => "text",
+                       "sg_comment" => "text",
+                       "sg_exercice" => "sg_exercice",
+                       "r_id" => "numeric",
+                       "c_id" => "numeric"
+
+               );
+
+               $this->default = array(
+                       "sg_id" => "auto",
+                       "sg_tech_date" => "auto",
+                       "sg_user" => "auto"
+               );
+               global $cn;
+
+               parent::__construct($cn, $p_id);
+       }
+
+}
+
+class Stock_Change_Sql extends PhpCompta_Sql
+{
+
+       function __construct($p_id = -1)
+       {
+               $this->date_format="DD.MM.YYYY";
+               $this->table = "public.stock_change";
+               $this->primary_key = "c_id";
+
+               $this->name = array(
+                       "id" => "c_id",
+                       "c_comment" => "c_comment",
+                       "c_date" => "c_date",
+                       "tech_date"=>"tech_date",
+                       "tech_user"=>"tech_user",
+                       "r_id"=>"r_id"
+               );
+
+               $this->type = array(
+                       "c_id" => "numeric",
+                       "c_comment" => "text",
+                       "c_date" => "date",
+                       "tech_date"=>"date",
+                       "tech_user"=>"text",
+                       "r_id"=>"numeric"
+               );
+
+               $this->default = array(
+                       "c_id" => "auto",
+                       "tech_date" => "auto"
+               );
+               global $cn;
+
+               parent::__construct($cn, $p_id);
+       }
+}
+?>

Added: phpcompta/trunk/include/stock_inv.inc.php
===================================================================
--- phpcompta/trunk/include/stock_inv.inc.php                           (rev 0)
+++ phpcompta/trunk/include/stock_inv.inc.php   2012-06-18 16:09:01 UTC (rev 
4933)
@@ -0,0 +1,49 @@
+<?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 Inventory : add manuel change
+ *
+ */
+require_once 'class_stock_goods.php';
+global $cn;
+
+$inv=new Stock_Goods();
+if ( isset ($_POST['save']))
+{
+       try
+       {
+               $inv->save($_POST);
+               echo h2info("Opération sauvée");
+               $inv->input($_POST,true);
+
+       }catch(Exception $e)
+       {
+                alert($e->getMessage());
+                $inv->input($_POST);
+       }
+}
+echo $inv->input();
+
+?>

Added: phpcompta/trunk/include/stock_inv_histo.inc.php
===================================================================
--- phpcompta/trunk/include/stock_inv_histo.inc.php                             
(rev 0)
+++ phpcompta/trunk/include/stock_inv_histo.inc.php     2012-06-18 16:09:01 UTC 
(rev 4933)
@@ -0,0 +1,78 @@
+<?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 history of manuel change
+ *
+ */
+$profile=$g_user->get_profile();
+$a_change=$cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_date from 
stock_change as sc
+                       join stock_repository as sr on (sc.r_id=sr.r_id)
+                       where sc.r_id in (select r_id from user_sec_repository 
where p_id=$profile)
+               order by c_date");
+$gDossier=dossier::id();
+?>
+<div class="content">
+<table class="result">
+       <tr>
+
+               <th>
+                       Date
+               </th>
+               <th>
+                       Commentaire
+               </th>
+               <th>
+                       Dépot
+               </th>
+               <th>
+                       Utilisateur
+               </th>
+                       <th>
+
+               </th>
+       </tr>
+       <? for ($e=0;$e<count($a_change);$e++): ?>
+       <? $class=($e%2==0)?' class="even" ':' class="odd" '; ?>
+       <tr <?=$class?>>
+
+               <td>
+                       <?=  $a_change[$e]['str_date']?>
+               </td>
+               <td>
+                       <?=h($a_change[$e]['c_comment'])?>
+               </td>
+               <td>
+                       <?=h($a_change[$e]['r_name'])?>
+               </td>
+               <td>
+                       <?=$a_change[$e]['tech_user']?>
+               </td>
+               <td>
+                       
<?=HtmlInput::button_action("Détail",sprintf("stock_inv_detail('%s','%s')",$gDossier,$a_change[$e]['c_id']));?>
+               </td>
+
+       </tr>
+       <? endfor; ?>
+</table>
+</div>

Added: phpcompta/trunk/include/template/stock_inv.php
===================================================================
--- phpcompta/trunk/include/template/stock_inv.php                              
(rev 0)
+++ phpcompta/trunk/include/template/stock_inv.php      2012-06-18 16:09:01 UTC 
(rev 4933)
@@ -0,0 +1,85 @@
+<?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 the input
+ *
+ */
+?>
+<div class="content">
+       <form method="POST" onsubmit="return confirm('Vous confirmez ?')">
+<table>
+       <tr><td>
+                       Date
+               </td>
+               <td>
+                       <?=$date->input()?>
+               </td>
+       </tr>
+       <tr>
+               <td>
+                       Dépot
+               </td>
+               <td>
+                       <?=$idepo->input()?>
+               </td>
+       </tr>
+       <tr>
+               <td>
+                       Motif de changement
+               </td>
+               <td>
+                       <?=$motif->input()?>
+               </td>
+       </tr>
+</table>
+<table style="width: 80%">
+       <tr>
+               <th >
+                       Code Stock
+               </th>
+               <th style="text-align:right">
+                       Quantité
+               </th>
+       </tr>
+<? for($i=0;$i<MAX_ARTICLE;$i++): ?>
+       <tr>
+               <td>
+                       <?=$sg_code[$i]->input()?>
+                       <?=$sg_code[$i]->search()?>
+                       <?=$label[$i]->input()?>
+               </td>
+               <TD class="num"">
+                       <? if ($sg_quantity[$i]->value==0 && 
$p_readonly==true):?>
+
+                       <? else : ?>
+                       <?=$sg_quantity[$i]->input()?>
+                       <? endif;?>
+               </td>
+       </tr>
+<? endfor; ?>
+</table>
+<? if ($p_readonly == false) echo HtmlInput::submit('save','Sauver')?>
+       </form>
+</div>
\ No newline at end of file

Modified: phpcompta/trunk/sql/upgrade.sql
===================================================================
--- phpcompta/trunk/sql/upgrade.sql     2012-06-18 16:06:00 UTC (rev 4932)
+++ phpcompta/trunk/sql/upgrade.sql     2012-06-18 16:09:01 UTC (rev 4933)
@@ -278,6 +278,7 @@
 
 insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) values 
('STOCK_HISTO','stock_histo.inc.php','Historique stock','Historique des 
mouvement de stock','ME');
 insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) values 
('STOCK_STATE','stock_state.inc.php','Etat des stock','Etat des stock','ME');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) values 
('STOCK_INVHISTO','stock_inv_histo.inc.php','Histo. Changement','Liste des 
changements manuels des stocks','ME');
 insert into menu_ref (me_code,me_menu,me_type) values 
('CSV:StockHisto','Export Historique mouvement stock','PR');
 insert into menu_ref (me_code,me_menu,me_type) values 
('CSV:StockResmList','Export Résumé list stock','PR');
 
@@ -285,11 +286,17 @@
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) 
values ('STOCK_STATE','STOCK',1,20,'E');
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) 
values ('STOCK_HISTO','STOCK',2,10,'E');
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) 
values ('STOCK_STATE','STOCK',2,20,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) 
values ('STOCK_INVHISTO','STOCK',1,30,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) 
values ('STOCK_INVHISTO','STOCK',2,30,'E');
 insert into profile_menu(me_code,p_id,p_type_display) values 
('CSV:StockHisto',1,'P');
 insert into profile_menu(me_code,p_id,p_type_display) values 
('CSV:StockResmList',1,'P');
 insert into profile_menu(me_code,p_id,p_type_display) values 
('CSV:StockHisto',2,'P');
 insert into profile_menu(me_code,p_id,p_type_display) values 
('CSV:StockResmList',2,'P');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) values 
('STOCK_INV','stock_inv.inc.php','Modification Stocks','Modification des stocks 
(inventaire)','ME');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) 
values ('STOCK_INV','STOCK',1,30,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) 
values ('STOCK_INV','STOCK',2,30,'E');
 
+
 -- clean stock_goods
 delete from stock_goods where  sg_code is null or sg_code='' or sg_code not in 
(select ad_value from fiche_detail as fd where ad_id=19 and ad_value is not 
null);
 
@@ -361,4 +368,17 @@
   LANGUAGE plpgsql VOLATILE;
 
 
-CREATE TRIGGER fiche_detail_upd_trg   BEFORE UPDATE   ON fiche_detail   FOR 
EACH ROW   EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
\ No newline at end of file
+CREATE TRIGGER fiche_detail_upd_trg   BEFORE UPDATE   ON fiche_detail   FOR 
EACH ROW   EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
+
+update menu_ref set me_description='Gestion des attributs de fiches ' where 
me_code='CFGATCARD';
+
+ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY 
(c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE;
+
+CREATE TABLE stock_change
+(
+  c_id bigserial NOT NULL,
+  c_comment text,
+  c_date date,
+  CONSTRAINT stock_change_pkey PRIMARY KEY (c_id )
+);
\ 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]