Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 4.0

This commit is contained in:
Laurent Destailleur 2016-09-10 02:59:10 +02:00
commit c28a62e051
2 changed files with 36 additions and 45 deletions

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com> * Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
@ -699,7 +699,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$i=0; $i=0;
foreach ($listfieldinsert as $f => $value) foreach ($listfieldinsert as $f => $value)
{ {
if ($value == 'price' || preg_match('/^amount/i',$value) || preg_match('/^localtax/i',$value) || $value == 'taux') { if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
} }
else if ($value == 'entity') { else if ($value == 'entity') {
@ -747,7 +747,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$i = 0; $i = 0;
foreach ($listfieldmodify as $field) foreach ($listfieldmodify as $field)
{ {
if ($field == 'price' || preg_match('/^amount/i',$field) || preg_match('/^localtax/i',$field) || $field == 'taux') { if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
} }
else if ($field == 'entity') { else if ($field == 'entity') {
@ -1383,23 +1383,12 @@ if ($id)
$valuetoshow = ''; $valuetoshow = '';
$align="center"; $align="center";
} }
else if ($fieldlist[$field]=='localtax1') { else if ($fieldlist[$field]=='taux') {
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0); $valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
if ($obj->localtax1 == 0) if ($obj->localtax1 == 0)
$valuetoshow = ''; $valuetoshow = '';
$align="right"; $align="right";
} }
else if ($fieldlist[$field]=='localtax2') {
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
if ($obj->localtax2 == 0)
$valuetoshow = '';
$align="right";
}
else if (in_array($fieldlist[$field],array('taux','localtax1','localtax2')))
{
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
$align="right";
}
else if (in_array($fieldlist[$field],array('recuperableonly'))) else if (in_array($fieldlist[$field],array('recuperableonly')))
{ {
$align="center"; $align="center";

View File

@ -271,6 +271,8 @@ class CommandeFournisseur extends CommonOrder
$this->fetchObjectLinked(); $this->fetchObjectLinked();
$this->lines=array();
$sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description,"; $sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description,";
$sql.= " l.qty,"; $sql.= " l.qty,";
$sql.= " l.tva_tx, l.remise_percent, l.subprice,"; $sql.= " l.tva_tx, l.remise_percent, l.subprice,";
@ -617,7 +619,7 @@ class CommandeFournisseur extends CommonOrder
* Returns the following order reference not used depending on the numbering model activated * Returns the following order reference not used depending on the numbering model activated
* defined within COMMANDE_SUPPLIER_ADDON_NUMBER * defined within COMMANDE_SUPPLIER_ADDON_NUMBER
* *
* @param Societe $soc company object * @param Company $soc company object
* @return string free reference for the invoice * @return string free reference for the invoice
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)