noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
class_gestion_sold.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief definition of the class gestion_sold
00024  */
00025 
00026 /*! \brief this object handles the table quant_sold
00027  *
00028  */
00029 
00030 require_once ('class_gestion_table.php');
00031 
00032 
00033 class gestion_sold extends gestion_table
00034 {
00035     var $qs_id;                                         /*!< $qs_id primary key */
00036     var $qs_internal;                           /*!< qs_internal */
00037     var $qs_fiche;                              /*!< f_id code  */
00038     var $qs_quantite;                           /*!< quantity of the card */
00039     var $qs_price;                              /*!< price */
00040     var $qs_vat;                                        /*!< vat_amount */
00041     var $qs_vat_code;                           /*!< vat_code */
00042     var $qs_client;                             /*!< f_id of the customer */
00043     var $qs_valid;                              /*!< will not be used */
00044     var $j_id;                                  /*!< jrnx.j_id */
00045     /*!\brief return an array of gestion_table, the object are
00046      * retrieved thanks the qs_internal
00047      */
00048     function get_list()
00049     {
00050         if ($this->qs_internal=="")
00051             exit (__FILE__.__LINE__." qs_internal est vide");
00052         $sql="select  qs_id,
00053              qs_internal,
00054              qs_fiche,
00055              qs_quantite,
00056              qs_price,
00057              qs_vat,
00058              tva_label,
00059              tva_rate,
00060              qs_vat_code,
00061              qs_client,
00062              j_id
00063              from quant_sold left join tva_rate on (qs_vat_code=tva_id)
00064              where qs_internal='".$this->qs_internal."'";
00065         $ret=$this->db->exec_sql($sql);
00066         // $res contains all the line
00067         $res=Database::fetch_all($ret);
00068 
00069         if ( sizeof($res)==0) return null;
00070         $count=0;
00071 
00072         foreach ($res as $row)
00073         {
00074             $t_gestion_sold=new gestion_sold($this->db);
00075             foreach ($row as $idx=>$value)
00076             $t_gestion_sold->$idx=$value;
00077             $array[$count]=clone $t_gestion_sold;
00078             $count++;
00079         }
00080         return $array;
00081     }
00082 }
 All Data Structures Namespaces Files Functions Variables Enumerations