diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 5ec1599c2cb..abe7eb24555 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -46,6 +46,8 @@ if ($user->societe_id > 0) */ if ($_POST["action"] == 'add_paiement') { + $error=0; + if ($_POST["cancel"]) { $loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid; @@ -76,6 +78,7 @@ if ($_POST["action"] == 'add_paiement') $paymentid = 0; // Read possible payments + // FIXME add error message if no payment is defined foreach ($_POST as $key => $value) { if (substr($key,0,7) == 'amount_') @@ -99,7 +102,7 @@ if ($_POST["action"] == 'add_paiement') if (! $error) { $paymentid = $paiement->create($user); - if (! $paymentid > 0) + if ($paymentid < 0) { $errmsg=$paiement->error; $error++; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 60caa013278..6b91c2bb69d 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -71,6 +71,7 @@ class PaymentSocialContribution extends CommonObject function create($user) { global $conf, $langs; + $error=0; // Validation parametres