diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 284ec8111d5..a11f0f7c800 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -1617,13 +1617,12 @@ if ($action == 'create')
// Show object lines
if (!empty($object->lines))
{
- //$disableedit=1;
- //$disablemove=1;
+ $canchangeproduct = 1;
$ret = $object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
}
// Form to add new line
- if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline')
+ if ($object->statut == $object::STATUS_DRAFT && $user->rights->facture->creer && $action != 'valid' && $action != 'editline')
{
if ($action != 'editline')
{
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index fadf0831ada..adb117b7b8f 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -665,6 +665,7 @@ if (empty($reshook))
$fk_unit = GETPOST('unit', 'alpha');
+ $objectline->fk_product = GETPOST('idprod', 'int');
$objectline->description = GETPOST('product_desc', 'restricthtml');
$objectline->price_ht = GETPOST('elprice');
$objectline->subprice = GETPOST('elprice');
@@ -1436,8 +1437,6 @@ if ($action == 'create')
$usemargins = 0;
if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) $usemargins = 1;
- $var = false;
-
// Title line for service
$cursorline = 1;
print '
';
@@ -1448,7 +1447,6 @@ if ($action == 'create')
print '';
print '';
print '';
- print '';
print '';
// Area with common detail of line
@@ -1632,17 +1630,29 @@ if ($action == 'create')
// Ligne carac
print '