From d01796a2149c2c45e28520da7594a10744902868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Jul 2016 14:31:41 +0200 Subject: [PATCH] FIX #5470 User of expense report in bank transactions page is not correct --- htdocs/expensereport/payment/payment.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index b7d40b2e65b..c4351e4d038 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -57,6 +57,9 @@ if ($action == 'add_payment') exit; } + $expensereport = new ExpenseReport($db); + $expensereport->fetch($chid); + $datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); if (! $_POST["fk_typepayment"] > 0) @@ -85,8 +88,7 @@ if ($action == 'add_payment') { if (substr($key,0,7) == 'amount_') { - $other_chid = substr($key,7); - $amounts[$other_chid] = price2num($_POST[$key]); + $amounts[$expensereport->fk_user_author] = price2num($_POST[$key]); $total += price2num($_POST[$key]); } }