dolibarr-bugtrack
[Top][All Lists]
Advanced

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

[Dolibarr-bugtrack] [bug #18592] stock movement issues


From: Franky Van Liedekerke
Subject: [Dolibarr-bugtrack] [bug #18592] stock movement issues
Date: Wed, 27 Dec 2006 23:18:31 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy)

Follow-up Comment #2, bug #18592 (project dolibarr):

Well, I fixed the first problem as well:
-

In htdocs/commande/commande.class.php, function cancel(), before the lines
        $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET fk_statut = -1';
        $sql .= " WHERE rowid = $this->id AND fk_statut = 1 ;";

add the following lines to correctly adjust the stock:

        foreach($this->lignes as $ligne) {
           $product = new Product($this->db);
           $product->id = $ligne->fk_product;
           $product->ajust_stock_commande($ligne->qty, 1);
        }

in the function delete_ligne they use a much more elaborated way of doing
this (a new $obj is created to get the quantity), but this simple way seems
to work just fine :)

This fix is also needed in the function delete() in the same file, but there
I would put these lines after the db->commit, like this:
        $this->db->commit();
        foreach($this->lignes as $ligne) {
           $product = new Product($this->db);
           $product->id = $ligne->fk_product;
           $product->ajust_stock_commande($ligne->qty, 1);
        }
        return 1;

Franky

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18592>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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