diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index eb82d04a190..5b10b742d87 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -590,7 +590,7 @@ class Account extends CommonObject // Check parameters if (!$oper) { - $this->error = "oper not defined"; + $this->error = "Operation code not defined"; return -1; } if (!$this->id) { diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 6cc6a576d74..fb9a2ed3b49 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -48,6 +48,13 @@ class PaymentSalary extends CommonObject */ public $picto = 'payment'; + /** + * @var int chid + * @deprecated + * @see $fk_salary + */ + public $chid; + /** * @var int ID */ @@ -133,13 +140,6 @@ class PaymentSalary extends CommonObject */ public $datev = ''; - /** - * @var int chid - * @deprecated - * @see $id from CommonObject - */ - public $chid; - /** * @var array */ @@ -265,7 +265,7 @@ class PaymentSalary extends CommonObject if ($remaintopay == 0) { $result = $tmpsalary->setPaid($user); } else { - dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing."); + dol_syslog("Remain to pay for salary id=".$contribid." not null. We do nothing."); } } } @@ -583,7 +583,7 @@ class PaymentSalary extends CommonObject */ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) { - global $conf, $langs; + global $langs; // Clean data $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement); diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 4b2d721a93f..bc7c81e3e80 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -106,11 +106,11 @@ if (($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == ' // Create a line of payments $paiement = new PaymentSalary($db); - $paiement->id = $id; + $paiement->fk_salary = $id; $paiement->chid = $id; // deprecated $paiement->datep = $datepaye; $paiement->amounts = $amounts; // Tableau de montant - $paiement->paiementtype = GETPOST("paiementtype", 'alphanohtml'); + $paiement->fk_typepayment = GETPOST("paiementtype", 'alphanohtml'); $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); $paiement->note = GETPOST("note", 'restricthtml'); $paiement->note_private = GETPOST("note", 'restricthtml'); @@ -126,6 +126,7 @@ if (($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == ' if (!$error) { $result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOST('accountid', 'int'), '', ''); + if (!($result > 0)) { $error++; setEventMessages($paiement->error, null, 'errors'); @@ -237,7 +238,9 @@ if ($action == 'create') { print ''; print ''.$langs->trans("Comments").''; - print ''; + print ''; print ''; print '';