diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 8e93433847f..16f034d296c 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -122,7 +122,7 @@ if (($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == ' $paymentid = $paiement->create($user, (GETPOST('closepaidcontrib') == 'on' ? 1 : 0)); if ($paymentid < 0) { $error++; - setEventMessages($paiement->error, null, 'errors'); + setEventMessages($paiement->error, $paiement->errors, 'errors'); $action = 'create'; } } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 805413e8354..281d342df20 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -215,6 +215,7 @@ class PaymentSocialContribution extends CommonObject // Check parameters if ($totalamount == 0) { + $this->error = 'ErrorPaymentAmountMustNotBeNull'; return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null } @@ -503,6 +504,7 @@ class PaymentSocialContribution extends CommonObject $object->fetch($fromid); $object->id = 0; $object->statut = 0; + $object->status = 0; // Clear fields // ... diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 00a985673a7..aaa6e83a4a7 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -363,6 +363,7 @@ ErrorThisGroupIsAlreadyDefinedAsThisType=The contacts with this group are alread ErrorIsNotInError=%s is not in error ErrorFilenameExtensionNotAllowed=File %s has a forbidden file extension ErrorNoValueForSelectListType=Error, a value for this type of field is mandatory +ErrorPaymentAmountMustNotBeNull=Error, payment amount must be defined and not zero # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.