forked from Dolibarr/dolibarr
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '7.0' of https://github.com/Dolibarr/dolibarr into 7.0
- Loading branch information
Showing
29 changed files
with
476 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
* Copyright (C) 2013 Florian Henry <[email protected]> | ||
* Copyright (C) 2014-2015 Marcos García <[email protected]> | ||
* Copyright (C) 2018 Frédéric France <[email protected]> | ||
* Copyright (C) 2018 Ferran Marcet <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -415,38 +416,40 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0 | |
global $mysoc, $conf, $langs; | ||
|
||
dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type, fk_remise_except=".$fk_remise_except); | ||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; | ||
|
||
// Clean parameters | ||
if (empty($remise_percent)) $remise_percent=0; | ||
if (empty($qty)) $qty=0; | ||
if (empty($info_bits)) $info_bits=0; | ||
if (empty($rang)) $rang=0; | ||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; | ||
|
||
$remise_percent=price2num($remise_percent); | ||
$qty=price2num($qty); | ||
$pu_ht=price2num($pu_ht); | ||
$pu_ht_devise=price2num($pu_ht_devise); | ||
$pu_ttc=price2num($pu_ttc); | ||
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' | ||
$txlocaltax1=price2num($txlocaltax1); | ||
$txlocaltax2=price2num($txlocaltax2); | ||
$pa_ht=price2num($pa_ht); | ||
if ($price_base_type=='HT') | ||
{ | ||
$pu=$pu_ht; | ||
} | ||
else | ||
if ($this->statut == self::STATUS_DRAFT) | ||
{ | ||
$pu=$pu_ttc; | ||
} | ||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; | ||
|
||
// Clean parameters | ||
if (empty($remise_percent)) $remise_percent=0; | ||
if (empty($qty)) $qty=0; | ||
if (empty($info_bits)) $info_bits=0; | ||
if (empty($rang)) $rang=0; | ||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; | ||
|
||
$remise_percent=price2num($remise_percent); | ||
$qty=price2num($qty); | ||
$pu_ht=price2num($pu_ht); | ||
$pu_ht_devise=price2num($pu_ht_devise); | ||
$pu_ttc=price2num($pu_ttc); | ||
if (!preg_match('/\((.*)\)/', $txtva)) { | ||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' | ||
} | ||
$txlocaltax1=price2num($txlocaltax1); | ||
$txlocaltax2=price2num($txlocaltax2); | ||
$pa_ht=price2num($pa_ht); | ||
if ($price_base_type=='HT') | ||
{ | ||
$pu=$pu_ht; | ||
} | ||
else | ||
{ | ||
$pu=$pu_ttc; | ||
} | ||
|
||
// Check parameters | ||
if ($type < 0) return -1; | ||
// Check parameters | ||
if ($type < 0) return -1; | ||
|
||
if ($this->statut == self::STATUS_DRAFT) | ||
{ | ||
$this->db->begin(); | ||
|
||
$product_type=$type; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* Copyright (C) 2012 Cedric Salvador <[email protected]> | ||
* Copyright (C) 2013 Florian Henry <[email protected]> | ||
* Copyright (C) 2014-2015 Marcos García <[email protected]> | ||
* Copyright (C) 2016-2017 Ferran Marcet <[email protected]> | ||
* Copyright (C) 2016-2018 Ferran Marcet <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -1270,44 +1270,46 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $f | |
|
||
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise", LOG_DEBUG); | ||
|
||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; | ||
|
||
// Clean parameters | ||
if (empty($remise_percent)) $remise_percent=0; | ||
if (empty($qty)) $qty=0; | ||
if (empty($info_bits)) $info_bits=0; | ||
if (empty($rang)) $rang=0; | ||
if (empty($txtva)) $txtva=0; | ||
if (empty($txlocaltax1)) $txlocaltax1=0; | ||
if (empty($txlocaltax2)) $txlocaltax2=0; | ||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; | ||
if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0; | ||
|
||
$remise_percent=price2num($remise_percent); | ||
$qty=price2num($qty); | ||
$pu_ht=price2num($pu_ht); | ||
$pu_ht_devise=price2num($pu_ht_devise); | ||
$pu_ttc=price2num($pu_ttc); | ||
$pa_ht=price2num($pa_ht); | ||
$txtva = price2num($txtva); | ||
$txlocaltax1 = price2num($txlocaltax1); | ||
$txlocaltax2 = price2num($txlocaltax2); | ||
if ($price_base_type=='HT') | ||
{ | ||
$pu=$pu_ht; | ||
} | ||
else | ||
{ | ||
$pu=$pu_ttc; | ||
} | ||
$label=trim($label); | ||
$desc=trim($desc); | ||
if ($this->statut == self::STATUS_DRAFT) | ||
{ | ||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; | ||
|
||
// Clean parameters | ||
if (empty($remise_percent)) $remise_percent=0; | ||
if (empty($qty)) $qty=0; | ||
if (empty($info_bits)) $info_bits=0; | ||
if (empty($rang)) $rang=0; | ||
if (empty($txtva)) $txtva=0; | ||
if (empty($txlocaltax1)) $txlocaltax1=0; | ||
if (empty($txlocaltax2)) $txlocaltax2=0; | ||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; | ||
if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0; | ||
|
||
$remise_percent=price2num($remise_percent); | ||
$qty=price2num($qty); | ||
$pu_ht=price2num($pu_ht); | ||
$pu_ht_devise=price2num($pu_ht_devise); | ||
$pu_ttc=price2num($pu_ttc); | ||
$pa_ht=price2num($pa_ht); | ||
if (!preg_match('/\((.*)\)/', $txtva)) { | ||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' | ||
} | ||
$txlocaltax1 = price2num($txlocaltax1); | ||
$txlocaltax2 = price2num($txlocaltax2); | ||
if ($price_base_type=='HT') | ||
{ | ||
$pu=$pu_ht; | ||
} | ||
else | ||
{ | ||
$pu=$pu_ttc; | ||
} | ||
$label=trim($label); | ||
$desc=trim($desc); | ||
|
||
// Check parameters | ||
if ($type < 0) return -1; | ||
// Check parameters | ||
if ($type < 0) return -1; | ||
|
||
if ($this->statut == self::STATUS_DRAFT) | ||
{ | ||
$this->db->begin(); | ||
|
||
$product_type=$type; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.