Advertisement
Guest User

Display total in sales by client report

a guest
Dec 18th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title><?php echo lang('sales_by_client'); ?></title>
  4. <link rel="stylesheet" href="<?php echo base_url(); ?>assets/default/css/reports.css" type="text/css">
  5. </head>
  6. <body>
  7.  
  8. <h3 class="report_title"><?php echo lang('sales_by_client'); ?></h3>
  9.  
  10. <table>
  11. <tr>
  12. <th><?php echo lang('client'); ?></th>
  13. <th class="amount"><?php echo lang('invoice_count'); ?></th>
  14. <th class="amount"><?php echo lang('sales'); ?></th>
  15. <th class="amount"><?php echo lang('sales_with_tax'); ?></th>
  16. </tr>
  17. <?php
  18. $report_inv_count= 0;
  19. $report_total= 0;
  20. $report_total_tax= 0;
  21. foreach ($results as $result) {
  22. ?>
  23. <tr>
  24. <td><?php echo $result->client_name; ?></td>
  25. <td class="amount"><?php echo $result->invoice_count; $report_inv_count+=$result->invoice_count; ?></td>
  26. <td class="amount"><?php echo format_currency($result->sales); $report_total+=$result->sales; ?></td>
  27. <td class="amount"><?php echo format_currency($result->sales_with_tax); $report_total_tax+=$result->sales_with_tax; ?></td>
  28. </tr>
  29. <?php } ?>
  30. <tr>
  31. <td><?php echo '<b>Total</b>'; ?></td>
  32. <td class="amount"><?php echo '<b>'.$report_inv_count.'</b>'; ?></td>
  33. <td class="amount"><?php echo '<b>'.format_currency($report_total).'</b>'; ?></td>
  34. <td class="amount"><?php echo '<b>'.format_currency($report_total_tax).'</b>'; ?></td>
  35. </tr>
  36. </table>
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement