Fix: récupération de l'avoir de propale vers commande
This commit is contained in:
parent
b677f9e714
commit
c96d42bc7c
@ -63,9 +63,11 @@ class Commande extends CommonObject
|
|||||||
var $adresse;
|
var $adresse;
|
||||||
var $date; // Date commande
|
var $date; // Date commande
|
||||||
var $date_livraison; // Date livraison souhaitée
|
var $date_livraison; // Date livraison souhaitée
|
||||||
|
var $fk_remise_except;
|
||||||
var $remise_percent;
|
var $remise_percent;
|
||||||
var $remise_absolue;
|
var $remise_absolue;
|
||||||
var $modelpdf;
|
var $modelpdf;
|
||||||
|
var $info_bits;
|
||||||
|
|
||||||
var $lines = array();
|
var $lines = array();
|
||||||
|
|
||||||
@ -121,8 +123,10 @@ class Commande extends CommonObject
|
|||||||
$CommLigne->subprice = $propal->lignes[$i]->subprice;
|
$CommLigne->subprice = $propal->lignes[$i]->subprice;
|
||||||
$CommLigne->tva_tx = $propal->lignes[$i]->tva_tx;
|
$CommLigne->tva_tx = $propal->lignes[$i]->tva_tx;
|
||||||
$CommLigne->qty = $propal->lignes[$i]->qty;
|
$CommLigne->qty = $propal->lignes[$i]->qty;
|
||||||
|
$CommLigne->fk_remise_except = $propal->lignes[$i]->fk_remise_except;
|
||||||
$CommLigne->remise_percent = $propal->lignes[$i]->remise_percent;
|
$CommLigne->remise_percent = $propal->lignes[$i]->remise_percent;
|
||||||
$CommLigne->fk_product = $propal->lignes[$i]->fk_product;
|
$CommLigne->fk_product = $propal->lignes[$i]->fk_product;
|
||||||
|
$CommLigne->info_bits = $propal->lignes[$i]->info_bits;
|
||||||
$this->lines[$i] = $CommLigne;
|
$this->lines[$i] = $CommLigne;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -532,7 +536,9 @@ class Commande extends CommonObject
|
|||||||
$this->lines[$i]->qty,
|
$this->lines[$i]->qty,
|
||||||
$this->lines[$i]->tva_tx,
|
$this->lines[$i]->tva_tx,
|
||||||
$this->lines[$i]->fk_product,
|
$this->lines[$i]->fk_product,
|
||||||
$this->lines[$i]->remise_percent
|
$this->lines[$i]->remise_percent,
|
||||||
|
$this->lines[$i]->fk_remise_except,
|
||||||
|
$this->lines[$i]->info_bits
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($resql < 0)
|
if ($resql < 0)
|
||||||
@ -615,7 +621,7 @@ class Commande extends CommonObject
|
|||||||
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,taux_produit)
|
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,taux_produit)
|
||||||
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
|
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
|
||||||
*/
|
*/
|
||||||
function addline($commandeid, $desc, $pu, $qty, $txtva, $fk_product=0, $remise_percent=0)
|
function addline($commandeid, $desc, $pu, $qty, $txtva, $fk_product=0, $remise_percent=0, $fk_remise_except=0, $info_bits=0)
|
||||||
{
|
{
|
||||||
dolibarr_syslog("Commande.class.php::addline this->id=$this->id, $commandeid, $desc, $pu, $qty, $txtva, $fk_product, $remise_percent");
|
dolibarr_syslog("Commande.class.php::addline this->id=$this->id, $commandeid, $desc, $pu, $qty, $txtva, $fk_product, $remise_percent");
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||||
@ -656,6 +662,7 @@ class Commande extends CommonObject
|
|||||||
$ligne->qty=$qty;
|
$ligne->qty=$qty;
|
||||||
$ligne->tva_tx=$txtva;
|
$ligne->tva_tx=$txtva;
|
||||||
$ligne->fk_product=$fk_product;
|
$ligne->fk_product=$fk_product;
|
||||||
|
$ligne->fk_remise_except=$fk_remise_except;
|
||||||
$ligne->remise_percent=$remise_percent;
|
$ligne->remise_percent=$remise_percent;
|
||||||
$ligne->subprice=$pu;
|
$ligne->subprice=$pu;
|
||||||
$ligne->rang=-1;
|
$ligne->rang=-1;
|
||||||
@ -671,7 +678,7 @@ class Commande extends CommonObject
|
|||||||
$result=$ligne->insert();
|
$result=$ligne->insert();
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
// Mise a jour informations denormalisees au niveau de la facture meme
|
// Mise a jour informations denormalisees au niveau de la commande meme
|
||||||
$result=$this->update_price($this->id);
|
$result=$this->update_price($this->id);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
|
|||||||
@ -1332,7 +1332,7 @@ else
|
|||||||
{
|
{
|
||||||
$discount=new DiscountAbsolute($db);
|
$discount=new DiscountAbsolute($db);
|
||||||
$discount->fetch($objp->fk_remise_except);
|
$discount->fetch($objp->fk_remise_except);
|
||||||
print ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl());
|
print ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user