[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4907 - in phpcompta/trunk: html include include/templat
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4907 - in phpcompta/trunk: html include include/template sql |
Date: |
Sat, 16 Jun 2012 02:00:03 +0200 (CEST) |
Author: danydb
Date: 2012-06-16 02:00:01 +0200 (Sat, 16 Jun 2012)
New Revision: 4907
Added:
phpcompta/trunk/include/stock_histo.inc.php
phpcompta/trunk/include/template/stock_histo.php
phpcompta/trunk/include/template/stock_histo_search.php
Modified:
phpcompta/trunk/html/user_login.php
phpcompta/trunk/include/class_html_input.php
phpcompta/trunk/include/class_periode.php
phpcompta/trunk/sql/upgrade.sql
Log:
0000618: Affichage des stocks
Modified: phpcompta/trunk/html/user_login.php
===================================================================
--- phpcompta/trunk/html/user_login.php 2012-06-15 18:37:18 UTC (rev 4906)
+++ phpcompta/trunk/html/user_login.php 2012-06-16 00:00:01 UTC (rev 4907)
@@ -25,7 +25,7 @@
include_once ("ac_common.php");
require_once('class_database.php');
require_once('class_itext.php');
-html_page_start($_SESSION['g_theme']);
address@hidden($_SESSION['g_theme']);
$rep=new Database();
include_once ("class_user.php");
$User=new User($rep);
Modified: phpcompta/trunk/include/class_html_input.php
===================================================================
--- phpcompta/trunk/include/class_html_input.php 2012-06-15 18:37:18 UTC
(rev 4906)
+++ phpcompta/trunk/include/class_html_input.php 2012-06-16 00:00:01 UTC
(rev 4907)
@@ -646,5 +646,15 @@
" order by 2" );
return $sel;
}
+ if ($p_mode == 'R')
+ {
+ $sel->value=$p_cn->make_array("
+ select r_id,r_name
+ from stock_repository join
user_sec_repository using (r_id)
+ where
+ p_id=".sql_string($profile).
+ " order by 2" );
+ return $sel;
+ }
}
}
\ No newline at end of file
Modified: phpcompta/trunk/include/class_periode.php
===================================================================
--- phpcompta/trunk/include/class_periode.php 2012-06-15 18:37:18 UTC (rev
4906)
+++ phpcompta/trunk/include/class_periode.php 2012-06-16 00:00:01 UTC (rev
4907)
@@ -440,18 +440,20 @@
*the this->p_id must be set
*\return a string with the date (DD.MM.YYYY)
*/
- public function first_day()
+ public function first_day($p=0)
{
- list($p_start,$p_end)=$this->get_date_limit($this->p_id);
+ if ($p==0) $p=$this->p_id;
+ list($p_start,$p_end)=$this->get_date_limit($p);
return $p_start;
}
/*!\brief return the last day of periode
*the this->p_id must be set
*\return a string with the date (DD.MM.YYYY)
*/
- public function last_day()
+ public function last_day($p=0)
{
- list($p_start,$p_end)=$this->get_date_limit($this->p_id);
+ if ($p==0) $p=$this->p_id;
+ list($p_start,$p_end)=$this->get_date_limit($p);
return $p_end;
}
@@ -500,12 +502,12 @@
throw new Exception('Erreur insertion période');
}
}
- if ( $nb_periode==12 &&
$this->insert('01.12.'.$p_exercice,'31.12.'.$p_exercice,$p_exercice) != 0 )
- {
+ if ( $nb_periode==12 &&
$this->insert('01.12.'.$p_exercice,'31.12.'.$p_exercice,$p_exercice) != 0 )
+ {
throw new Exception('Erreur insertion période');
}
- if ( $nb_periode==13)
- {
+ if ( $nb_periode==13)
+ {
if
($this->insert('01.12.'.$p_exercice,'30.12.'.$p_exercice,$p_exercice) != 0 )
throw new Exception('Erreur insertion période');
if
($this->insert('31.12.'.$p_exercice,'31.12.'.$p_exercice,$p_exercice) != 0 )
throw new Exception('Erreur insertion période');
}
Added: phpcompta/trunk/include/stock_histo.inc.php
===================================================================
--- phpcompta/trunk/include/stock_histo.inc.php (rev 0)
+++ phpcompta/trunk/include/stock_histo.inc.php 2012-06-16 00:00:01 UTC (rev
4907)
@@ -0,0 +1,48 @@
+<?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
+ *
+ */
+global $g_user,$cn,$g_parameter;
+require_once 'class_stock.php';
+require_once 'class_periode.php';
+
+$stock=new Stock();
+$array=$_GET;
+if ( ! isset ($array['wdate_start']) || ! isset ($array['wdate_end']))
+{
+ // Date start / end
+ $exercice = $g_user->get_exercice();
+ $periode = new Periode($cn);
+ list($periode_start, $periode_end) =
$periode->get_limit($exercice);
+
+ $array['wdate_start'] = $periode_start->first_day();
+ $array['wdate_end'] =$periode_end->last_day();
+}
+
+$stock->history($array);
+
+?>
Added: phpcompta/trunk/include/template/stock_histo.php
===================================================================
--- phpcompta/trunk/include/template/stock_histo.php
(rev 0)
+++ phpcompta/trunk/include/template/stock_histo.php 2012-06-16 00:00:01 UTC
(rev 4907)
@@ -0,0 +1,83 @@
+<?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 result of stock history
+ *
+ */
+
+?>
+<div class="content">
+ <?=$nav_bar?>
+<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>Opération</th>
+ <th><?=$tb->get_header(4);?></th>
+ <th><?=$tb->get_header(5);?></th>
+ <th><?=$tb->get_header(6);?></th>
+ <th><?=$tb->get_header(7);?></th>
+ </tr>
+ <?
+
+ for ($i=0;$i<$max_row;$i++):
+ $row=Database::fetch_array($res, $i);
+ $class=($i%2==0)?' class="even" ':' class="odd" ';
+ ?>
+ <tr <?=$class?>>
+ <td>
+ <?=$row['cdate']?>
+ </td>
+ <td>
+ <?=$row['sg_code']?>
+ </td>
+ <td>
+ <?=$row['r_name']?>
+ </td>
+ <td>
+ <?=HtmlInput::card_detail($row['qcode'],$row['fname'])?>
+ </td>
+ <td>
+
<?=HtmlInput::detail_op($row['jr_id'],$row['jr_internal'])?>
+ </td>
+ <td>
+ <?=$row['ccomment']?>
+ </td>
+ <td class="num">
+ <?=nbm($row['j_montant'])?>
+ </td>
+ <td class="num">
+ <?=nbm($row['sg_quantity'])?>
+ </td>
+ <td>
+ <?=$row['direction']?>
+ </td>
+ </tr>
+ <? endfor;?>
+</table>
+ <?=$nav_bar?>
+</div>
\ No newline at end of file
Added: phpcompta/trunk/include/template/stock_histo_search.php
===================================================================
--- phpcompta/trunk/include/template/stock_histo_search.php
(rev 0)
+++ phpcompta/trunk/include/template/stock_histo_search.php 2012-06-16
00:00:01 UTC (rev 4907)
@@ -0,0 +1,70 @@
+<?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 box for search
+ *
+ */
+?>
+<div id="histo_search_d" class="inner_box"
style="width:60%;height:280px;display:none">
+ <?= HtmlInput::title_box("Recherche", "histo_search_d", "hide")?>
+ <form method="GET">
+ <?= HtmlInput::get_to_hidden(array("gDossier", "ac"))?>
+ <table>
+ <tr>
+ <td> Fiche </td>
+ <td> <?= $wcard->input()?><?=$wcard->search()?>
</td>
+ </tr>
+ <tr>
+ <td> A partir de </td>
+ <td> <?= $wdate_start->input()?> </td>
+ </tr>
+ <tr>
+ <td> Jusque </td>
+ <td> <?= $wdate_end->input()?> </td>
+ </tr>
+ <tr>
+ <td> Dépôt </td>
+ <td> <?= $wrepo->input()?> </td>
+ </tr>
+ <tr>
+ <td> Montant supérieur ou égal à </td>
+ <td> <?= $wamount_start->input()?> </td>
+ </tr>
+ <tr>
+ <td> Montant inférieur ou égal à </td>
+ <td> <?= $wamount_end->input()?> </td>
+ </tr>
+ <tr>
+ <td> Code Stock </td>
+ <td> <?= $wcode_stock->input()?> </td>
+ </tr>
+ <tr>
+ <td> Direction </td>
+ <td> <?= $wdirection->input()?> </td>
+ </tr>
+ </table>
+ <?=HtmlInput::submit("search_histo_b","Recherche")?>
+ </form>
+</div>
+
Modified: phpcompta/trunk/sql/upgrade.sql
===================================================================
--- phpcompta/trunk/sql/upgrade.sql 2012-06-15 18:37:18 UTC (rev 4906)
+++ phpcompta/trunk/sql/upgrade.sql 2012-06-16 00:00:01 UTC (rev 4907)
@@ -269,4 +269,21 @@
ALTER TABLE stock_goods ADD COLUMN r_id bigint;
update stock_goods set r_id=1;
CREATE INDEX fk_stock_good_repository_r_id ON stock_goods (r_id );
-alter table action_gestion drop ag_cal;
\ No newline at end of file
+alter table action_gestion drop ag_cal;
+
+
+update menu_ref set me_file=null where me_code='STOCK';
+
+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 profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display)
values ('STOCK_HISTO','STOCK',1,10,'E');
+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');
+
+-- 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);
+
+CREATE INDEX fki_jrnx_j_grpt ON jrnx (j_grpt );
+CREATE INDEX fki_jrn_jr_grpt_id ON jrn (jr_grpt_id );
\ No newline at end of file
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4907 - in phpcompta/trunk: html include include/template sql,
phpcompta-dev <=