mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Fix: uniformize code (in progress)
This commit is contained in:
@@ -28,8 +28,7 @@
|
||||
*/
|
||||
include_once(DOL_DOCUMENT_ROOT."/core/class/commonorder.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/marges/lib/marges.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/margin/lib/margins.lib.php");
|
||||
|
||||
/**
|
||||
* \class Commande
|
||||
@@ -2240,7 +2239,7 @@ class Commande extends CommonOrder
|
||||
// infos marge
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
|
||||
// TODO deprecated
|
||||
$this->line->price=$price;
|
||||
$this->line->remise=$remise;
|
||||
@@ -2998,13 +2997,13 @@ class OrderLine
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
// si prix d'achat non renseign<67> et utilis<69> pour calcul des marges alors prix achat = prix vente (idem pour remises)
|
||||
|
||||
// si prix d'achat non renseign<67> et utilis<69> pour calcul des marges alors prix achat = prix vente (idem pour remises)
|
||||
if ($this->pa_ht == 0) {
|
||||
if ($this->subprice < 0 || ($conf->global->CalculateMarginsOnLinesWithoutBuyingPrice == 1))
|
||||
$this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100);
|
||||
}
|
||||
|
||||
|
||||
// Check parameters
|
||||
if ($this->product_type < 0) return -1;
|
||||
|
||||
@@ -3106,8 +3105,8 @@ class OrderLine
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
// si prix d'achat non renseign<67> et utilis<69> pour calcul des marges alors prix achat = prix vente (idem pour remises)
|
||||
|
||||
// si prix d'achat non renseign<67> et utilis<69> pour calcul des marges alors prix achat = prix vente (idem pour remises)
|
||||
if ($this->pa_ht == 0) {
|
||||
if ($this->subprice < 0 || ($conf->global->CalculateMarginsOnLinesWithoutBuyingPrice == 1))
|
||||
$this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100);
|
||||
|
||||
Reference in New Issue
Block a user