Modified file: Reports to show Australian GST and Export values

I’ve modified my application/views/reports/payment_history.php file to display two more columns and sum values for taxes (australian GST) and Exports so when you get the quartely report you can get straight values to report them.

NOTE: On my client profile form I’m using Google Map API to validate my customer’s addresses so the value ‘AU’ it’s probably ‘Australia’ otherwise, modify it if neccedary.

<!DOCTYPE html>
<html lang="<?php echo trans('cldr'); ?>">
<head>
    <title><?php echo trans('payment_history'); ?></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('payment_history'); ?><br/>
    <small><?php echo $from_date . ' - ' . $to_date ?></small>
</h3>

<table>
    <tr>
        <th><?php echo trans('date'); ?></th>
        <th><?php echo trans('invoice'); ?></th>
        <th><?php echo trans('client'); ?></th>
        <th><?php echo trans('payment_method'); ?></th>
        <th><?php echo trans('country'); ?></th>
        <th class="amount"><?php echo trans('amount'); ?></th>
		<th><?php echo 'GST Included'; ?></th>
		<th><?php echo 'Exports'; ?></th>

    </tr>
    <?php
    $sum = 0;
    $sum2 = 0;
    $sum3 = 0;

    foreach ($results as $result) {
        ?>
        <tr>
            <td><?php echo date_from_mysql($result->payment_date, true); ?></td>
            <td><?php echo $result->invoice_number; ?></td>
            <td><?php echo format_client($result); ?></td>
            <td><?php _htmlsc($result->payment_method_name); ?></td>
            <td><?php echo ($result->client_country) ? $result->client_country : ''; ?></td>
            <td class="amount"><?php echo format_currency($result->payment_amount);
                $sum = $sum + $result->payment_amount; 
				?></td>		
                <td><?php echo format_currency($result->invoice_item_tax_total); 
				$sum2 = $sum2 + $result->invoice_item_tax_total; ?>
                </td>
			<td class="amount">				
			<?php if($result->client_country != 'AU') {
					echo format_currency($result->payment_amount);
					$sum3 = $sum3 + $result->payment_amount;
					} ?></td>                
        </tr>
        <?php
    }

    if (!empty($results)) {
        ?>
        <tr>
            <td colspan=5><?php echo trans('total'); ?></td>
            <td class="amount"><?php echo format_currency($sum); ?></td>
            <td><?php echo format_currency($sum2); ?></td>
            <td><?php echo format_currency($sum3); ?></td>
        </tr>
    <?php } ?>
</table>

</body>
</html>

1 Like