diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index b6b5137fe34..67e56d8e942 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -1223,7 +1223,7 @@ function getSourceDocRef($val, $typerecord) $sqlmid = ''; if ($typerecord == 'payment') { - $sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref'; + $sqlmid = 'SELECT payfac.fk_facture as id, f.facnumber as ref'; $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f"; $sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=" . $val["paymentid"]; $ref = $langs->transnoentitiesnoconv("Invoice"); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 54024fe6471..d27a8ac25d2 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -94,7 +94,7 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end) $idpays = $mysoc->country_id; -$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; +$sql = "SELECT f.rowid, f.facnumber as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,"; $sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 7e1073a0f2a..2a6dcde99d4 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -319,6 +319,7 @@ class Mailing extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b3da0634aee..5f8811702b5 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1285,7 +1285,12 @@ class Propal extends CommonObject // Create clone $object->context['createfromclone']='createfromclone'; $result=$object->create($user); - if ($result < 0) $error++; + if ($result < 0) + { + $this->error = $object->error; + $this->errors = array_merge($this->errors, $object->errors); + $error++; + } if (! $error) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4f1d1d21c02..276aa535c63 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5015,7 +5015,7 @@ abstract class CommonObject if ($this->array_options[$key] === '') $mandatorypb=true; if ($mandatorypb) { - dol_syslog($this->error); + dol_syslog("Mandatory extra field ".$key." is empty"); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); return -1; } diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 5dd1fbbb0d4..5e85d313f72 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -356,6 +356,7 @@ class Productbatch extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; } diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index d39849780c1..425b29080bf 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -924,7 +924,8 @@ class Productcustomerprice extends CommonObject // Other options if ($result < 0) { $this->error = $object->error; - $error ++; + $this->errors=array_merge($this->errors, $object->errors); + $error++; } if (! $error) { diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index f487a909b82..9a62b9c1e6f 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -589,6 +589,7 @@ class Propalmergepdfproduct extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; }