Updated Login to use lnapp, and minor update to Invoice

This commit is contained in:
Deon George
2016-08-17 22:30:12 +10:00
parent 07de13f678
commit c1cc6b6f69
10 changed files with 107 additions and 148 deletions

View File

@@ -185,24 +185,34 @@ class Model_Invoice extends ORM implements Cartable {
$result = array();
$lo = $this->account->language;
foreach ($this->subitems() as $iio) {
// We only summarise item_type=0
if (! $iio->item_type == 0)
continue;
$track['p'] = $track = array();
foreach ($this->items_render() as $key => $items) {
switch ($key) {
case 's':
$last = '';
foreach ($items as $iio) {
if ($iio->product) {
$p = $iio->product->name($lo);
if ($iio->product) {
$p = $iio->title($lo);
}
if (! isset($result[$p])) {
$result[$p]['quantity'] = 0;
$result[$p]['subtotal'] = 0;
}
if (! isset($result[$p])) {
$result[$p]['quantity'] = 0;
$result[$p]['subtotal'] = 0;
}
$result[$p]['quantity']++;
$result[$p]['subtotal'] += $iio->subtotal();
$result[$p]['quantity']++;
$result[$p]['subtotal'] += $iio->subtotal();
}
break;
case 'other':
break;
}
}
ksort($result);
return $result;
}