diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 26be80caa68..d87a439f404 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -282,6 +282,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $refcomp=$societestatic->getNomUrl(1,'',24); $paiement = $facturestatic->getSommePaiement(); // Payment already done + $paiement+= $facturestatic->getSumDepositsUsed(); + $paiement+= $facturestatic->getSumCreditNotesUsed(); } if ($obj->family == 'social_contribution') { diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 562dcf9d223..03e2c6910cd 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2015 Juanjo Menent + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -407,7 +408,7 @@ function dol_get_next_week($day, $week, $month, $year) { $tmparray = dol_get_first_day_week($day, $month, $year); - $time=dol_mktime(12,0,0,$month,$tmparray['first_day'],$year,1,0); + $time=dol_mktime(12,0,0,$tmparray['first_month'],$tmparray['first_day'],$tmparray['first_year'],1,0); $time+=24*60*60*7; $tmparray=dol_getdate($time,true);