dolibarr-dev
[Top][All Lists]
Advanced

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

Re: [Dolibarr-dev] tout mes changes


From: Franky Van Liedekerke
Subject: Re: [Dolibarr-dev] tout mes changes
Date: Sat, 27 Jan 2007 16:53:29 +0100

On Sat, 27 Jan 2007 15:41:33 +0100 (CET)
Régis Houssin <address@hidden> wrote:

> Bonjour Franky,
> 
> j'ai inclu tes modifications dans le cvs
> 
> 
> merci
> Régis

un grand merci!
En attach tu trouve des modifs pour la partie fournisseurs. De nouveau
rien de special, mais justement j'ai change le code:

$value_label = $fac_ori->lignes[$i-1][0];
par
$value_label = $fac_ori->lignes[$i-1]->description;
(et la meme chose pour [1],[2],...)

Pour cela, j'ai remplace en fournisseur.facture.class.php le code

$obj = $this->db->fetch_object($resql_rows);
$this->lignes[$i][0] = $obj->description;
$this->lignes[$i][1] = $obj->pu_ht;
$this->lignes[$i][2] = $obj->tva_taux;
$this->lignes[$i][3] = $obj->qty;
$this->lignes[$i][4] = $obj->total_ht;
$this->lignes[$i][5] = $obj->tva;
$this->lignes[$i][6] = $obj->total_ttc;
$this->lignes[$i][7] = $obj->rowid;
$this->lignes[$i][8] = $obj->total_tva;

par

$this->lignes[$i] =
$this->db->fetch_object($resql_rows);

(peut-etre encore mieux est le style:
$this->lignes[$i]->description=$obj->description, comme dans
product.class.php, mais ca je laisse a toi pour en decider)

Aussi, dans le patch, j'utilise 2 functions nouveaux dans
product.class.php (c'est pas dans le patch):

  function isproduct() {
     if ($this->type != 1) {
        return 1;
     } else {
        return 0;
     }
  }

  function isservice() {
     if ($this->type==1) {
        return 1;
     } else {
        return 0;
     }
  }

(j'ai encore les functions isproduct_raw(), isproduct_assembly() et
isproduct_stockkit(), mais c'est pas pour maintenant)

au lieu du vieux code
        if ($this->type == 0)
          {
            $this->isproduct = 1;
            $this->isservice = 0;
          }
        else
          {
            $this->isproduct = 0;
            $this->isservice = 1;
          }

parce que ces variables ne sont pas utilise (sauf dans
fourn/product/photos.php et la c'est change dans mon patch), et appeler
une fontion est mieux dans le style ObjectOriented Programming.

Attachment: fourn.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]