diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 10a2238088b..3766c7ba1a1 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -484,6 +484,7 @@ class Propal extends CommonObject } } else { $this->error = $line->error; + $this->errors = $line->errors; $this->db->rollback(); return -2; } @@ -710,8 +711,8 @@ class Propal extends CommonObject // Mise a jour informations denormalisees au niveau de la propale meme $result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. - if ($result > 0) - { + + if ($result > 0) { $this->db->commit(); return $this->line->id; } else { @@ -721,6 +722,7 @@ class Propal extends CommonObject } } else { $this->error = $this->line->error; + $this->errors = $this->line->errors; $this->db->rollback(); return -2; } @@ -913,7 +915,7 @@ class Propal extends CommonObject return $result; } else { $this->error = $this->line->error; - + $this->errors = $this->line->errors; $this->db->rollback(); return -1; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index fae2fefefaa..9cff8d9a412 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1976,6 +1976,7 @@ class Commande extends CommonOrder } } else { $this->error = $line->error; + $this->errors = $line->errors; $this->db->rollback(); return -2; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index b2d499c5f34..0002dbcb8ed 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -575,7 +575,8 @@ class Account extends CommonObject return $accline->id; } else { - $this->error = $this->db->lasterror(); + $this->error = $accline->error; + $this->errors = $accline->errors; $this->db->rollback(); return -2; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 26c40c2c45e..ef0962a0169 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -797,6 +797,7 @@ class Facture extends CommonInvoice if ($result < 0) { $this->error = $newinvoiceline->error; + $this->errors = $newinvoiceline->errors; $error++; break; } @@ -3202,6 +3203,7 @@ class Facture extends CommonInvoice } } else { $this->error = $this->line->error; + $this->errors = $this->line->errors; $this->db->rollback(); return -2; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 7ac1924fec8..35173044971 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -337,6 +337,7 @@ class ExpenseReport extends CommonObject if ($result < 0) { $this->error = $newndfline->error; + $this->errors = $newndfline->errors; $error++; break; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index b3381ea7ebe..f8286216e57 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1649,6 +1649,7 @@ class Product extends CommonObject if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); + $price_min = price($prodcustprice->lines[0]->price_min); $pu_ttc = price($prodcustprice->lines[0]->price_ttc); $price_base_type = $prodcustprice->lines[0]->price_base_type; $tva_tx = $prodcustprice->lines[0]->tva_tx; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 6802d0e84a9..3df802018ef 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -774,7 +774,6 @@ foreach ($listofreferent as $key => $value) // Each element with at least one line is output $qualifiedforfinalprofit = true; if ($key == 'intervention' && empty($conf->global->PROJECT_INCLUDE_INTERVENTION_AMOUNT_IN_PROFIT)) $qualifiedforfinalprofit = false; - if ($key == 'propal' && $element->status != Propal::STATUS_SIGNED && $element->status != Propal::STATUS_BILLED) $qualifiedforfinalprofit = false; //var_dump($key.' '.$qualifiedforfinalprofit); // Calculate margin @@ -783,7 +782,7 @@ foreach ($listofreferent as $key => $value) $total_revenue_ht += $total_ht; } - if ($margin != "add") { // Revert sign + if ($margin != "add") { // Revert sign $total_ht = -$total_ht; $total_ttc = -$total_ttc; } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 890dff34812..b8a10a59bec 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -481,12 +481,14 @@ class SupplierProposal extends CommonObject if ($result < -1) { $this->error = $prod->error; + $this->errors = $prod->errors; $this->db->rollback(); dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_ERR); return -1; } } else { $this->error = $prod->error; + $this->errors = $prod->errors; $this->db->rollback(); return -1; } @@ -622,12 +624,14 @@ class SupplierProposal extends CommonObject $this->db->commit(); return $this->line->id; } else { - $this->error = $this->db->error(); + $this->error = $this->error(); + $this->errors = $this->errors(); $this->db->rollback(); return -1; } } else { $this->error = $this->line->error; + $this->errors = $this->line->errors; $this->db->rollback(); return -2; }