diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index da75d86de7c..a115d8bca5e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -485,6 +485,7 @@ class Propal extends CommonObject } } else { $this->error = $line->error; + $this->errors = $line->errors; $this->db->rollback(); return -2; } @@ -711,8 +712,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 { @@ -722,6 +723,7 @@ class Propal extends CommonObject } } else { $this->error = $this->line->error; + $this->errors = $this->line->errors; $this->db->rollback(); return -2; } @@ -914,7 +916,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 4f8e4ab6643..d810a1a7272 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1973,6 +1973,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 e0f48e9498b..363ce28c57f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -591,7 +591,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 5dbf97db2d0..7f686accb4e 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; } @@ -3252,6 +3253,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 60390a62933..cdc4fe4da5d 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 0436034f863..9a71faa5665 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 1440ac393c7..405c34734f3 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; }