2
0
forked from Wavyzz/dolibarr

Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2023-08-10 13:14:19 +02:00
5 changed files with 13 additions and 6 deletions

View File

@@ -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');
}
}

View File

@@ -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);

View File

@@ -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();

View File

@@ -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;
}

View File

@@ -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) {