/[dolibarr]/dolibarr/htdocs/facture.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/facture.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.130 by eldy, Fri Nov 4 20:24:40 2005 UTC revision 1.131 by eldy, Fri Nov 11 19:22:57 2005 UTC
# Line 56  class Facture Line 56  class Facture
56          var $paye;          var $paye;
57          var $propalid;          var $propalid;
58          var $projetid;          var $projetid;
         var $prefixe_facture;  
59          var $cond_reglement_id;          var $cond_reglement_id;
60          var $cond_reglement_code;          var $cond_reglement_code;
61          var $mode_reglement_id;          var $mode_reglement_id;
# Line 82  class Facture Line 81  class Facture
81                  $this->total = 0;                  $this->total = 0;
82                  $this->propalid = 0;                  $this->propalid = 0;
83                  $this->projetid = 0;                  $this->projetid = 0;
                 $this->prefixe_facture = '';      // utilisé dans le module de numérotation saturne  
84                  $this->remise_exceptionnelle = 0;                  $this->remise_exceptionnelle = 0;
85    
86                  $this->products = array();        // Tableau de lignes de factures                  $this->products = array();        // Tableau de lignes de factures
# Line 806  class Facture Line 804  class Facture
804                          }                          }
805                          else                          else
806                          {                          {
807                                  $numfa = facture_get_num($soc, $this->prefixe_facture); // définit dans includes/modules/facture                                  $numfa = $this->getNextNumRef($soc);
808                          }                          }
809    
810              $this->db->begin();              $this->db->begin();
# Line 1346  class Facture Line 1344  class Facture
1344          }          }
1345    
1346    
1347        /**
1348         *      \brief      Renvoie la référence de facture suivante non utilisée en fonction du module
1349         *                  de numérotation actif défini dans FACTURE_ADDON
1350         *      \param          soc                             objet societe
1351         *      \return     string                  reference libre pour la facture
1352         */
1353        function getNextNumRef($soc)
1354        {
1355            global $db, $langs;
1356            $langs->load("bills");
1357        
1358            $dir = DOL_DOCUMENT_ROOT . "/includes/modules/facture/";
1359        
1360            if (defined("FACTURE_ADDON") && FACTURE_ADDON)
1361            {
1362                $file = FACTURE_ADDON."/".FACTURE_ADDON.".modules.php";
1363        
1364                // Chargement de la classe de numérotation
1365                $classname = "mod_facture_".FACTURE_ADDON;
1366                require_once($dir.$file);
1367        
1368                $obj = new $classname();
1369        
1370                $numref = "";
1371                $numref = $obj->getNumRef($soc,$this);
1372        
1373                if ( $numref != "")
1374                {
1375                    return $numref;
1376                }
1377                else
1378                {
1379                    dolibarr_print_error($db,"modules_facture::getNextNumRef ".$obj->error);
1380                    return "";
1381                }
1382            }
1383            else
1384            {
1385                print $langs->trans("Error")." ".$langs->trans("Error_FACTURE_ADDON_NotDefined");
1386                return "";
1387            }
1388        }
1389        
1390          /**          /**
1391          *    \brief      Mets à jour les commentaires           *    \brief      Mets à jour les commentaires
1392          *    \param      note        note           *    \param      note        note
1393          *    \return     int         <0 si erreur, >0 si ok           *    \return     int         <0 si erreur, >0 si ok
1394          */           */
1395          function update_note($note)          function update_note($note)
1396          {          {
1397                  $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET note = '".addslashes($note)."'";                  $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET note = '".addslashes($note)."'";

Legend:
Removed from v.1.130  
changed lines
  Added in v.1.131

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26