Browse Source

Debug v19

Laurent Destailleur 1 year ago
parent
commit
df7fc7cd4e

+ 1 - 1
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) {

+ 9 - 9
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);

+ 6 - 3
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 '<tr>';
 	print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
-	print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
+	print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'">';
+	print GETPOST('note');
+	print '</textarea></td>';
 	print '</tr>';
 
 	print '</table>';