Advertisement
josequinta

InvoicePlane get total in reports by year

Oct 19th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.02 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <?php // definimos previamente las 3 variables que suman los totales
  4.  
  5. $report_inv_count = '';
  6. $report_total = '';
  7. $report_total_tax = '';
  8.    
  9.     ?>
  10.  
  11. <html lang="<?php echo trans('cldr'); ?>">
  12. <head>
  13.     <title><?php echo trans('sales_by_client'); ?></title>
  14.     <link rel="stylesheet" href="<?php echo base_url(); ?>assets/<?php echo get_setting('system_theme', 'invoiceplane'); ?>/css/reports.css" type="text/css">
  15. </head>
  16. <body>
  17.  
  18. <h3 class="report_title">
  19.     <?php echo trans('sales_by_client'); ?><br/>
  20.     <small><?php echo $from_date . ' - ' . $to_date ?></small>
  21. </h3>
  22.  
  23. <table>
  24.     <tr>
  25.         <th><?php echo trans('client'); ?></th>
  26.         <th class="amount"><?php echo trans('invoice_count'); ?></th>
  27.         <th class="amount"><?php echo trans('sales'); ?></th>
  28.         <th class="amount"><?php echo trans('sales_with_tax'); ?></th>
  29.     </tr>
  30.     <?php foreach ($results as $result) { ?>
  31.         <tr>
  32.             <td><?php _htmlsc(format_client($result)); ?></td>
  33.             <td class="amount"><?php echo $result->invoice_count; $report_inv_count = $result->invoice_count + $report_inv_count; ?></td>
  34.             <td class="amount"><?php echo format_currency($result->sales); $report_total = $result->sales + $report_total; ?></td>
  35.             <td class="amount"><?php echo format_currency($result->sales_with_tax); $report_total_tax = $result->sales_with_tax + $report_total_tax; ?></td>            
  36.            
  37.         </tr>
  38.     <?php } ?>
  39.    
  40.     <?php if(isset($report_inv_count) && isset($report_total) && isset($report_total_tax) ){ ?>
  41.    
  42.             <tr>
  43.                 <td><?php echo '<b>Total</b>'; ?></td>
  44.                 <td class="amount"><?php echo '<b>'.$report_inv_count.'</b>'; ?></td>
  45.                 <td class="amount"><?php echo '<b>'.format_currency($report_total).'</b>'; ?></td>
  46.                 <td class="amount"><?php echo '<b>'.format_currency($report_total_tax).'</b>'; ?></td>
  47.             </tr>
  48.            
  49.             <?php } ?>
  50.    
  51. </table>
  52.  
  53. </body>
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement