Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php // definimos previamente las 3 variables que suman los totales
- $report_inv_count = '';
- $report_total = '';
- $report_total_tax = '';
- ?>
- <html lang="<?php echo trans('cldr'); ?>">
- <head>
- <title><?php echo trans('sales_by_client'); ?></title>
- <link rel="stylesheet" href="<?php echo base_url(); ?>assets/<?php echo get_setting('system_theme', 'invoiceplane'); ?>/css/reports.css" type="text/css">
- </head>
- <body>
- <h3 class="report_title">
- <?php echo trans('sales_by_client'); ?><br/>
- <small><?php echo $from_date . ' - ' . $to_date ?></small>
- </h3>
- <table>
- <tr>
- <th><?php echo trans('client'); ?></th>
- <th class="amount"><?php echo trans('invoice_count'); ?></th>
- <th class="amount"><?php echo trans('sales'); ?></th>
- <th class="amount"><?php echo trans('sales_with_tax'); ?></th>
- </tr>
- <?php foreach ($results as $result) { ?>
- <tr>
- <td><?php _htmlsc(format_client($result)); ?></td>
- <td class="amount"><?php echo $result->invoice_count; $report_inv_count = $result->invoice_count + $report_inv_count; ?></td>
- <td class="amount"><?php echo format_currency($result->sales); $report_total = $result->sales + $report_total; ?></td>
- <td class="amount"><?php echo format_currency($result->sales_with_tax); $report_total_tax = $result->sales_with_tax + $report_total_tax; ?></td>
- </tr>
- <?php } ?>
- <?php if(isset($report_inv_count) && isset($report_total) && isset($report_total_tax) ){ ?>
- <tr>
- <td><?php echo '<b>Total</b>'; ?></td>
- <td class="amount"><?php echo '<b>'.$report_inv_count.'</b>'; ?></td>
- <td class="amount"><?php echo '<b>'.format_currency($report_total).'</b>'; ?></td>
- <td class="amount"><?php echo '<b>'.format_currency($report_total_tax).'</b>'; ?></td>
- </tr>
- <?php } ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement