2
0
forked from Wavyzz/dolibarr

Modif partie creation

This commit is contained in:
Rodolphe Quiedeville
2003-11-07 09:43:31 +00:00
parent ccb636e8f7
commit 33ca72a37a

View File

@@ -35,6 +35,8 @@ class Commande
$this->sources[2] = "Papier";
$this->sources[3] = "T<EFBFBD>l<EFBFBD>phone";
$this->sources[4] = "Fax";
$this->products = array();
}
/**
* Cr<43><72> la facture depuis une propale existante
@@ -120,6 +122,27 @@ class Commande
{
$this->id = $this->db->last_insert_id();
/*
* Insertion des produits dans la base
*/
for ($i = 0 ; $i < sizeof($this->products) ; $i++)
{
$prod = new Product($this->db, $this->products[$i]);
if ($prod->fetch($this->products[$i]))
{
$this->insert_product_generic($prod->libelle,
$prod->price,
$this->products_qty[$i],
$prod->tva_tx,
$this->products[$i],
$this->products_remise_percent[$i]);
}
}
/*
*
*
*/
$sql = "UPDATE llx_commande SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
if ($this->db->query($sql))
{
@@ -264,6 +287,25 @@ class Commande
}
}
}
/**
* Ajoute un produit dans la commande
*
*
*/
Function add_product($idproduct, $qty, $remise_percent=0)
{
if ($idproduct > 0)
{
$i = sizeof($this->products);
$this->products[$i] = $idproduct;
if (!$qty)
{
$qty = 1 ;
}
$this->products_qty[$i] = $qty;
$this->products_remise_percent[$i] = $remise_percent;
}
}
/**
*