/[dolibarr]/dolibarr/htdocs/fourn/commande/fiche.php
ViewVC logotype

Diff of /dolibarr/htdocs/fourn/commande/fiche.php

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

revision 1.22 by eldy, Sun Jul 10 17:46:04 2005 UTC revision 1.23 by erics, Fri Jul 22 16:45:56 2005 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>  /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
4     * Copyright (C) 2005      Eric Seigne <eric.seigne@ryxeo.com>
5   *   *
6   * This program is free software; you can redistribute it and/or modify   * This program is free software; you can redistribute it and/or modify
7   * it under the terms of the GNU General Public License as published by   * it under the terms of the GNU General Public License as published by
# Line 359  if ($_GET["id"] > 0) Line 360  if ($_GET["id"] > 0)
360        $sql = "SELECT l.ref, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice";        $sql = "SELECT l.ref, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice";
361        $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l ";        $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l ";
362        $sql .= " WHERE l.fk_commande = $commande->id ORDER BY l.rowid";        $sql .= " WHERE l.fk_commande = $commande->id ORDER BY l.rowid";
363              
364        $resql = $db->query($sql);        $resql = $db->query($sql);
365        if ($resql)        if ($resql)
366          {          {
# Line 447  if ($_GET["id"] > 0) Line 448  if ($_GET["id"] > 0)
448        if ($_GET["action"] <> 'valid' && $commande->statut == 0 && $user->rights->fournisseur->commande->creer)        if ($_GET["action"] <> 'valid' && $commande->statut == 0 && $user->rights->fournisseur->commande->creer)
449          {          {
450            $sql = "SELECT p.rowid,p.label,p.ref ";            $sql = "SELECT p.rowid,p.label,p.ref ";
451            $sql .=" , pf.price";            $sql .=" , (pf.price / pf.quantity) as priceunit";
452            $sql .= " FROM ".MAIN_DB_PREFIX."product as p ";            $sql .= " FROM ".MAIN_DB_PREFIX."product as p ";
453            $sql .= " , ".MAIN_DB_PREFIX."product_fournisseur_price as pf ";            $sql .= " , ".MAIN_DB_PREFIX."product_fournisseur_price as pf ";
454            $sql .= " WHERE p.rowid = pf.fk_product AND pf.fk_soc = ".$commande->fourn_id;            $sql .= " WHERE p.rowid = pf.fk_product AND pf.fk_soc = ".$commande->fourn_id;
           $sql .= " AND quantity = 1";  
455            $sql .= " ORDER BY p.ref ";            $sql .= " ORDER BY p.ref ";
456            $resql = $db->query($sql);            $resql = $db->query($sql);
457            if ($resql)            if ($resql)
# Line 464  if ($_GET["id"] > 0) Line 464  if ($_GET["id"] > 0)
464                    while ($i < $num)                    while ($i < $num)
465                      {                      {
466                        $objp = $db->fetch_object($resql);                        $objp = $db->fetch_object($resql);
467                        $opt .= "<option value=\"$objp->rowid\">[$objp->ref] $objp->label : $objp->price</option>\n";                        $opt .= "<option value=\"$objp->rowid\">[$objp->ref] $objp->label : $objp->priceunit</option>\n";
468                        $i++;                        $i++;
469                      }                      }
470                  }                  }

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

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