From 8f8f5058ded05ee8c7c87b82ce3a8f3fc91c8ff0 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 10 Feb 2021 16:04:29 +0100 Subject: [PATCH] Add link 'user' in bank_url for payment_sc --- .../class/paymentsocialcontribution.class.php | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index c771a664d5f..3814a016b0c 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -514,7 +514,7 @@ class PaymentSocialContribution extends CommonObject */ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) { - global $conf; + global $conf, $langs; // Clean data $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement); @@ -578,6 +578,24 @@ class PaymentSocialContribution extends CommonObject $socialcontrib->fetch($key); $result = $acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_label.(($socialcontrib->lib && $socialcontrib->lib != $socialcontrib->type_label) ? ' ('.$socialcontrib->lib.')' : ''), 'sc'); if ($result <= 0) dol_print_error($this->db); + + $fuser = new User($this->db); + $fuser->fetch($socialcontrib->fk_user); + + // Add link 'user' in bank_url between operation and bank transaction + $result = $acc->add_url_line( + $bank_line_id, + $socialcontrib->fk_user, + DOL_URL_ROOT.'/user/card.php?id=', + $fuser->getFullName($langs), + 'user' + ); + + if ($result <= 0) + { + $this->error = $acc->error; + $error++; + } } } }