diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index edd80a0bff5..4d2bc6b9b48 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -506,7 +506,7 @@ class PaymentExpenseReport extends CommonObject $total=$this->total; if ($mode == 'payment_expensereport') $amount=$total; - + // Insert payment into llx_bank $bank_line_id = $acc->addline( $this->datepaid, @@ -543,25 +543,25 @@ class PaymentExpenseReport extends CommonObject dol_print_error($this->db); } } - + // Add link 'user' in bank_url between user and bank transaction if (! $error) { - foreach ($this->amounts as $key => $value) // We should have always same third party but we loop in case of. + foreach ($this->amounts as $key => $value) // We should have always same user but we loop in case of. { if ($mode == 'payment_expensereport') { - $er = new ExpenseReport($this->db); - $er->fetch($key); - $er->fetch_user($er->fk_user_author); + $fuser = new User($this->db); + $fuser->fetch($key); + $result=$acc->add_url_line( $bank_line_id, - $er->user->id, + $fuser->id, DOL_URL_ROOT.'/user/card.php?id=', - $er->user->getFullName($langs), + $fuser->getFullName($langs), 'user' ); - if ($result <= 0) + if ($result <= 0) { $this->error=$this->db->lasterror(); dol_syslog(get_class($this).'::addPaymentToBank '.$this->error); diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index 29e6b2174e3..ad74c7fda05 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -80,7 +80,7 @@ if ($action == 'add_payment') setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToDebit")), null, 'errors'); $error++; } - + if (! $error) { $paymentid = 0; @@ -190,19 +190,19 @@ if ($action == 'create' || empty($action)) print ''; print ''; print ''; - + dol_fiche_head(null, '0', '', -1); $linkback = ''; // $linkback = '' . $langs->trans("BackToList") . ''; - + dol_banner_tab($expensereport, 'ref', $linkback, 1, 'ref', 'ref', ''); - + print '
'; print '
'; - + print ''."\n"; - + print ''; print ''; @@ -221,13 +221,13 @@ if ($action == 'create' || empty($action)) print ''; print '
'.$langs->trans("Period").''.get_date_range($expensereport->date_debut,$expensereport->date_fin,"",$langs,0).'
'.$langs->trans("Amount").''.price($expensereport->total_ttc,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
'; - + print '
'; - + print '
'; - + print ''."\n"; - + print ''; } - + // Number print '
'.$langs->trans("Date").''; $datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaid):0; @@ -248,7 +248,7 @@ if ($action == 'create' || empty($action)) $form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$expensereport->accountid, "accountid", 0, '',1); // Show open bank account list print '
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; @@ -263,7 +263,7 @@ if ($action == 'create' || empty($action)) print '
'; print '
'; - + dol_fiche_end(); // List of expenses ereport not already paid completely @@ -304,7 +304,7 @@ if ($action == 'create' || empty($action)) print ""; print "\n"; - + $total+=$objp->total; $total_ttc+=$objp->total_ttc; $totalrecu+=$objp->am;