Updated Login to use lnapp, and minor update to Invoice
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user