noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
stock_summary_list.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  *   This file is part of NOALYSS.
00005  *
00006  *   NOALYSS is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   NOALYSS is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with NOALYSS; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 /* $Revision$ */
00021 
00022 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00023 
00024 /**
00025  * @file
00026  * @brief show the result to stock state in list format (more detailled)
00027  *
00028  */
00029 $a_repo=$cn->get_array("select distinct t.r_id,r_name,r_adress,r_city,r_country,r_phone from stock_repository as s join tmp_stockgood_detail as t
00030         on (s.r_id=t.r_id)
00031         where
00032         s_id=$1
00033         order by 2
00034         ",array($tmp_id));
00035 ?>
00036 <div class="content">
00037 <?php for ($r=0;$r<count($a_repo);$r++):?>
00038 <h1><?php echo $a_repo[$r]['r_name']?></h1>
00039 <p><?php echo _("Adresse")?> <?php echo $a_repo[$r]['r_adress']?></p>
00040 <p><?php echo _("Ville")?> <?php echo $a_repo[$r]['r_city']?></p>
00041 <p><?php echo _("Pays")?> <?php echo $a_repo[$r]['r_country']?></p>
00042 <p><?php echo _("Téléphone")?> <?php echo $a_repo[$r]['r_phone']?></p>
00043 <table class="result">
00044         <tr>
00045                 <th><?php echo _("Code")?></th>
00046                 <th><?php echo _("Détail")?></th>
00047                 <th style="text-align: right"><?php echo _("IN")?></th>
00048                 <th style="text-align: right"><?php echo _("OUT")?></th>
00049                 <th style="text-align: right"><?php echo _("En Stock")?></th>
00050         </tr>
00051         <?php 
00052                 $a_stock=$cn->get_array(
00053                                 "
00054                                         select coalesce(sum(s_qin),0) as qin,coalesce(sum(s_qout),0) as qout,sg_code
00055                                                 from tmp_stockgood_detail  where r_id=$1 and s_id=$2
00056                                                 group by sg_code
00057                                                 order by sg_code
00058 
00059                                         ",array($a_repo[$r]['r_id'],$tmp_id));
00060                 for ($s=0;$s<count($a_stock);$s++):
00061                         $a_card=$cn->get_array(
00062                                         "
00063                                                 select f_id,vw_name,quick_code
00064                                                 from vw_fiche_attr
00065                                                 where
00066                                          f_id in (
00067                                                         select distinct f_id
00068                                                         from                            tmp_stockgood_detail
00069                                                         where
00070                                                         r_id=$1
00071                                                         and s_id=$2
00072                                                         and sg_code=$3)
00073                                                 order by vw_name,quick_code
00074                                         ",array($a_repo[$r]['r_id'],$tmp_id,$a_stock[$s]['sg_code']));
00075         ?>
00076         <tr>
00077                 <td>
00078                         <?php echo HtmlInput::card_detail($a_stock[$s]['sg_code'],'','',true)?>
00079                 </td>
00080                 <td>
00081                         <?php 
00082                                 $sep="";
00083                                 for ( $c=0;$c<count($a_card);$c++):
00084                                         echo $sep.HtmlInput::card_detail($a_card[$c]['quick_code'], $a_card[$c]['vw_name'], ' class="line" ');
00085                                         $sep="  ,";
00086                                 endfor;
00087                                 if ( count($a_card)== 0 ) echo '<span class="notice">'._("Changement manuel").'</span>';
00088                         ?>
00089                 </td>
00090                 <td class="num">
00091                         <?php echo nbm($a_stock[$s]['qin'])?>
00092                 </td>
00093                 <td class="num">
00094                         <?php echo nbm($a_stock[$s]['qout'])?>
00095 
00096                 </td>
00097                 <td class="num">
00098                         <?php echo nbm(bcsub($a_stock[$s]['qin'],$a_stock[$s]['qout']))?>
00099                 </td>
00100         </tr>
00101 <?php endfor; ?>
00102 </table>
00103 <?php endfor; ?>
00104 
00105 </div>
 All Data Structures Namespaces Files Functions Variables Enumerations