diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index e30e50769bb..166d8d420dc 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -130,7 +130,8 @@ if ($action == 'activate_encryptdbpassconf') { header("Location: security.php"); exit; } else { - setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings'); + //setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings'); + setEventMessages($langs->trans('InstrucToClearPass', $langs->transnoentitiesnoconv("DatabasePassword")), null, 'warnings'); } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 6b8fb22de79..e09a57972c4 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1040,6 +1040,7 @@ if (empty($reshook)) { $object->note_public = trim(GETPOST('note_public', 'restricthtml')); $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client', 'alphanohtml'); + $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); $object->model_pdf = GETPOST('model', 'alphanohtml'); $object->fk_project = GETPOST('projectid', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id', 'int'); @@ -1092,7 +1093,8 @@ if (empty($reshook)) { $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); $object->note_private = trim(GETPOST('note_private', 'restricthtml')); - $object->ref_client = GETPOST('ref_client'); + $object->ref_client = GETPOST('ref_client', 'alphanohtml'); + $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); $object->cond_reglement_id = 0; // No payment term for a credit note @@ -1662,6 +1664,10 @@ if (empty($reshook)) { if ($lines[$i]->subprice < 0 && empty($conf->global->INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN)) { // Negative line, we create a discount line + if (empty($desc)) { + $desc = $label ? $label : $langs->trans('Discount'); + } + $discount = new DiscountAbsolute($db); $discount->fk_soc = $object->socid; $discount->amount_ht = abs($lines[$i]->total_ht); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9ea509677f1..9d119536ced 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1029,7 +1029,7 @@ abstract class CommonObject * @param int|string $type_contact Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL * @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) * @param int $notrigger Disable all triggers - * @return int <0 if KO, 0 if already added, >0 if OK + * @return int <0 if KO, 0 if already added or code not valid, >0 if OK */ public function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0) { @@ -1074,9 +1074,8 @@ abstract class CommonObject } if ($id_type_contact == 0) { - $this->error = 'CODE_NOT_VALID_FOR_THIS_ELEMENT'; dol_syslog("CODE_NOT_VALID_FOR_THIS_ELEMENT: Code type of contact '".$type_contact."' does not exists or is not active for element ".$this->element.", we can ignore it"); - return -3; + return 0; } $datecreate = dol_now(); diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index c66bd73b96e..dd5c4451b60 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -254,7 +254,7 @@ class DiscountAbsolute // Check parameters if (empty($this->description)) { - $this->error = 'BadValueForPropertyDescription'; + $this->error = 'BadValueForPropertyDescriptionOfDiscount'; dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 69a6ff82424..a7d19d6b4e2 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2124,6 +2124,7 @@ class ExtraFields ) { continue; } + $visibility_abs = abs($visibility); // not modify if extra field is not in update form (0 : never, 2 or -2 : list only, 5 or - 5 : list and view only) if (empty($visibility_abs) || $visibility_abs == 2 || $visibility_abs == 5) {