<th>Summa</th> <th>Kommentar</th> </tr> </thead> <tbody> <? foreach(Delivery::selection(array('@order' => 'timestamp:desc')) as $delivery): ?> <tr> <td><a href="/view_delivery/<?php echo $delivery->id; ?> "><?php echo $delivery->timestamp; ?> </a></td> <td><?php echo $delivery->User; ?> </td> <td class="numeric"><?php echo number(DeliveryContent::sum(array('cost', '*', 'count'), array('delivery_id' => $delivery->id))); ?> kr</td> <td class="pre"><?php echo $delivery->description; ?> </td> </tr> <? endforeach ?> </tbody> </table>
</td> </tr> <tr> <th>Kategori</th> <td><a href="/category/<?php echo $product->category_id; ?> "><?php echo $product->Category->name; ?> </a></td> </tr> <tr> <th>Totalt levererat</th> <td><?php echo DeliveryContent::sum('count', array('product_id' => $product->id)); ?> </td> </tr> <tr> <th>Totalt sålt</th> <td><?php echo TransactionContent::sum('count', array('product_id' => $product->id)); ?> </td> </tr> <tr> <th>Totalt sålt för</th> <td><?php echo TransactionContent::sum('amount', array('product_id' => $product->id)); ?>