Fix bug reported by scrutinizer
This commit is contained in:
parent
a8e06abc4f
commit
6b24d81afc
@ -87,7 +87,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
|||||||
* @param string $date Date
|
* @param string $date Date
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function pt ($db, $sql, $date)
|
function pt($db, $sql, $date)
|
||||||
{
|
{
|
||||||
global $conf, $bc,$langs;
|
global $conf, $bc,$langs;
|
||||||
|
|
||||||
@ -104,12 +104,19 @@ function pt ($db, $sql, $date)
|
|||||||
print '<td align="right">'.$langs->trans("PaidDuringThisPeriod").'</td>';
|
print '<td align="right">'.$langs->trans("PaidDuringThisPeriod").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$totalclaimed = 0;
|
||||||
|
$totalpaid = 0;
|
||||||
$amountclaimed = 0;
|
$amountclaimed = 0;
|
||||||
$amountpaid = 0;
|
$amountpaid = 0;
|
||||||
|
$previousmonth = '';
|
||||||
$previousmode = '';
|
$previousmode = '';
|
||||||
|
$mode = '';
|
||||||
|
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
$mode = $obj->mode;
|
||||||
|
|
||||||
|
//print $obj->dm.' '.$obj->mode.' '.$previousmonth.' '.$previousmode;
|
||||||
if ($obj->mode == 'claimed' && ! empty($previousmode))
|
if ($obj->mode == 'claimed' && ! empty($previousmode))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -143,19 +150,21 @@ function pt ($db, $sql, $date)
|
|||||||
$amountclaimed = 0;
|
$amountclaimed = 0;
|
||||||
$amountpaid = 0;
|
$amountpaid = 0;
|
||||||
$previousmode = '';
|
$previousmode = '';
|
||||||
|
$previousmonth = '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$previousmode = $obj->mode;
|
$previousmode = $obj->mode;
|
||||||
|
$previousmonth = $obj->dm;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj->mode == 'claimed' && ! empty($previousmode))
|
if ($mode == 'claimed' && ! empty($previousmode))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$obj->dm."</td>\n";
|
print '<td class="nowrap">'.$previousmonth."</td>\n";
|
||||||
print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n";
|
print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n";
|
||||||
print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n";
|
print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -87,7 +87,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
|||||||
* @param string $date Date
|
* @param string $date Date
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function pt ($db, $sql, $date)
|
function pt($db, $sql, $date)
|
||||||
{
|
{
|
||||||
global $conf, $bc,$langs;
|
global $conf, $bc,$langs;
|
||||||
|
|
||||||
@ -104,6 +104,8 @@ function pt ($db, $sql, $date)
|
|||||||
print '<td align="right">'.$langs->trans("PaidDuringThisPeriod").'</td>';
|
print '<td align="right">'.$langs->trans("PaidDuringThisPeriod").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$totalclaimed = 0;
|
||||||
|
$totalpaid = 0;
|
||||||
$amountclaimed = 0;
|
$amountclaimed = 0;
|
||||||
$amountpaid = 0;
|
$amountpaid = 0;
|
||||||
$previousmonth = '';
|
$previousmonth = '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user