diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php
index 6eb10ce6a1a..317eac1ec1a 100644
--- a/htdocs/compta/prelevement/line.php
+++ b/htdocs/compta/prelevement/line.php
@@ -116,7 +116,13 @@ if ($action == 'confirm_rejet') {
* View
*/
-$invoicestatic = new Facture($db);
+if ($type == 'bank-transfer') {
+ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
+ $invoicestatic = new FactureFournisseur($db);
+} else {
+ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+ $invoicestatic = new Facture($db);
+}
$title = $langs->trans("WithdrawalsLine");
if ($type == 'bank-transfer') {
@@ -315,7 +321,11 @@ if ($id) {
print ''.$obj->ref."\n";
}
- print '
';
+ if ($type == 'bank-transfer') {
+ print ' | ';
+ } else {
+ print ' | ';
+ }
print img_object($langs->trans("ShowCompany"), "company").' '.$obj->name." | \n";
print ''.price($obj->total_ttc)." | \n";
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 8aa54ca8904..e2220ec6367 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -581,6 +581,7 @@ if (empty($reshook)) {
$num_prod = count($lines);
for ($i = 0; $i < $num_prod; $i++) {
if ($lines[$i]->id == $line_id) { // we have found line to update
+ $update_done = false;
$line = new ExpeditionLigne($db);
$line->fk_expedition = $object->id;
@@ -621,6 +622,8 @@ if (empty($reshook)) {
if ($line->update($user) < 0) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
+ } else {
+ $update_done=true;
}
} else {
setEventMessages($lotStock->error, $lotStock->errors, 'errors');
@@ -663,6 +666,8 @@ if (empty($reshook)) {
if ($line->update($user) < 0) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
+ } else {
+ $update_done=true;
}
} else {
setEventMessages($line->error, $line->errors, 'errors');
@@ -680,6 +685,8 @@ if (empty($reshook)) {
if ($object->create_line_batch($line, $line->array_options) < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
+ } else {
+ $update_done=true;
}
}
} else {
@@ -717,6 +724,8 @@ if (empty($reshook)) {
if ($line->update($user) < 0) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
+ } else {
+ $update_done=true;
}
}
unset($_POST[$stockLocation]);
@@ -731,6 +740,8 @@ if (empty($reshook)) {
if ($line->update($user) < 0) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
+ } else {
+ $update_done=true;
}
unset($_POST[$qty]);
}
@@ -743,10 +754,17 @@ if (empty($reshook)) {
if ($line->update($user) < 0) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
+ } else {
+ $update_done=true;
}
unset($_POST[$qty]);
}
}
+
+ if (empty($update_done)) {
+ $line->id = $lines[$i]->id;
+ $line->insertExtraFields();
+ }
}
}
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 3ee755bef37..3c2c0ba53ba 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -871,7 +871,7 @@ if ($action == 'create') {
if ($objectsrc->fetch_optionals() > 0) {
$recept->array_options = array_merge($recept->array_options, $objectsrc->array_options);
}
- print $object->showOptionals($extrafields, 'create', $parameters);
+ print $recept->showOptionals($extrafields, 'create', $parameters);
}
// Incoterms