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

Conflicts:
	htdocs/fourn/facture/card.php
This commit is contained in:
Laurent Destailleur 2018-04-13 23:27:14 +02:00
commit 6a3c2f9808
2 changed files with 10 additions and 2 deletions

View File

@ -1436,6 +1436,12 @@ class FactureFournisseur extends CommonInvoice
// Check parameters // Check parameters
if ($type < 0) return -1; if ($type < 0) return -1;
if ($rang < 0)
{
$rangmax = $this->line_max();
$rang = $rangmax + 1;
}
// Insert line // Insert line
$this->line=new SupplierInvoiceLine($this->db); $this->line=new SupplierInvoiceLine($this->db);

View File

@ -265,7 +265,7 @@ if (empty($reshook))
$action=''; $action='';
} }
} }
elseif ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) elseif ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
{ {
$object->fetch($id); $object->fetch($id);
@ -999,6 +999,8 @@ if (empty($reshook))
$type = $productsupplier->type; $type = $productsupplier->type;
$price_base_type = 'HT'; $price_base_type = 'HT';
$rang = $object->line_max() +1;
$result=$object->addline( $result=$object->addline(
$desc, $desc,
$productsupplier->fourn_pu, $productsupplier->fourn_pu,
@ -1014,7 +1016,7 @@ if (empty($reshook))
$tva_npr, $tva_npr,
$price_base_type, $price_base_type,
$type, $type,
-1, $rang,
0, 0,
$array_options, $array_options,
$productsupplier->fk_unit, $productsupplier->fk_unit,