Fixes for statement
This commit is contained in:
parent
06cbec3a94
commit
e2b84fc063
@ -51,7 +51,7 @@ class Controller_Reseller_Statement extends Controller_Statement {
|
|||||||
|
|
||||||
$result[$key] = $o;
|
$result[$key] = $o;
|
||||||
|
|
||||||
$total += Currency::round($o->total());
|
$total -= Currency::round($o->total());
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($ao->invoice->list_active() as $o) {
|
foreach ($ao->invoice->list_active() as $o) {
|
||||||
@ -62,7 +62,7 @@ class Controller_Reseller_Statement extends Controller_Statement {
|
|||||||
|
|
||||||
$result[$key] = $o;
|
$result[$key] = $o;
|
||||||
|
|
||||||
$total -= Currency::round($o->total());
|
$total += Currency::round($o->total());
|
||||||
}
|
}
|
||||||
|
|
||||||
krsort($result);
|
krsort($result);
|
||||||
|
@ -29,7 +29,7 @@ class Controller_User_Statement extends Controller_Statement {
|
|||||||
|
|
||||||
$result[$key] = $o;
|
$result[$key] = $o;
|
||||||
|
|
||||||
$total += Currency::round($o->total());
|
$total -= Currency::round($o->total());
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->ao->invoice->list_active() as $o) {
|
foreach ($this->ao->invoice->list_active() as $o) {
|
||||||
@ -40,7 +40,7 @@ class Controller_User_Statement extends Controller_Statement {
|
|||||||
|
|
||||||
$result[$key] = $o;
|
$result[$key] = $o;
|
||||||
|
|
||||||
$total -= Currency::round($o->total());
|
$total += Currency::round($o->total());
|
||||||
}
|
}
|
||||||
|
|
||||||
krsort($result);
|
krsort($result);
|
||||||
|
47
modules/statement/views/statement/user/show.php
Normal file
47
modules/statement/views/statement/user/show.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php $pag = new Pagination(array('total_items'=>count($result))); ?>
|
||||||
|
<?php echo (string)$pag; ?>
|
||||||
|
|
||||||
|
<table class="table table-striped table-condensed table-hover span6" id="list-table">
|
||||||
|
<thead><tr>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Amt</th>
|
||||||
|
<th>Total</th>
|
||||||
|
</tr></thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<?php $i=0;foreach ($result as $o) :
|
||||||
|
$adjust = 0;
|
||||||
|
|
||||||
|
if ($o instanceof Model_Invoice)
|
||||||
|
$adjust = $o->total();
|
||||||
|
elseif ($o instanceof Model_Payment)
|
||||||
|
$adjust = -$o->total();
|
||||||
|
|
||||||
|
$total = Currency::round($total-$adjust);
|
||||||
|
|
||||||
|
if (++$i < $pag->current_first_item())
|
||||||
|
continue;
|
||||||
|
elseif ($i > $pag->current_last_item())
|
||||||
|
break;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<?php if ($o instanceof Model_Invoice) : ?>
|
||||||
|
<td><?php echo $o->display('date_orig'); ?></td>
|
||||||
|
<td><?php echo 'Invoice '.HTML::anchor(URL::link('user','invoice/view/'.$o->id),$o->id()); ?></td>
|
||||||
|
<?php elseif ($o instanceof Model_Payment) : ?>
|
||||||
|
<?php $adjust = -$o->total(); ?>
|
||||||
|
<td><?php echo $o->display('date_payment'); ?></td>
|
||||||
|
<td><?php printf('Payment %s (%s)',$o->id,$o->checkout->display('name')); ?></td>
|
||||||
|
<?php else : ?>
|
||||||
|
<td>-</td>
|
||||||
|
<td><?php echo 'Unknown '.$o->id; ?></td>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<td class="text-right"><?php echo $o->total(TRUE); ?></td>
|
||||||
|
<td class="text-right"><?php echo Currency::display($total+$adjust); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
Reference in New Issue
Block a user