CutCodeDown
Web Development => PHP => Topic started by: GrumpyYoungMan on 23 Nov 2022, 07:18:17 am
-
$start = strtotime("now") > strtotime("April 6th") ? date("Y") : date("Y")+1;
$end = strtotime("now") > strtotime("April 6th") ? date("Y")+1 : date("Y");
Which will then be used to do something like:
echo '<hr><table>
<thead>
<tr>
<th>Expense Type</th>
<th>Date</th>
<th>Invoice #</th>
<th>Supplier</th>
<th>Total</th>
</tr>
</thead>
<tbody>';
$inInvoices = $db->prepare("
SELECT
*
FROM
".SQL_TBL_PREFIX."suppliers
WHERE
`Date` BETWEEN ? AND ?
");
$inInvoices->execute([ $start.'-04-06', $end.'-04-05' ]);
while( $r = $inInvoices->fetch() ) {
echo '<tr>
<td>', $r['Expenses Type'],'</td>
<td>', $r['Date'],'</td>
<td>', $r['Invoice #'],'</td>
<td>', $r['Supplier Name'],'</td>
<td>', number_format($r['Total Paid'], 2), '</td>
</tr>';
}
echo '</tbody>
</table>';
As I am trying to predict the tax year(s) by using the above code... Is it really that easy?
At a later stage we may be able to change the tax year to calculate other years from the DB...
-
Considering tax years are either calendar years or arbitrary "fiscal years" ending on the last day of a particular month, I'm not sure why you're checking for the filing due date which should be completely unrelated when looking at customer invoices.
-
Considering tax years are either calendar years or arbitrary "fiscal years" ending on the last day of a particular month, I'm not sure why you're checking for the filing due date which should be completely unrelated when looking at customer invoices.
In the UK the tax year starts April 6th and runs until the following April 05th… don’t ask me why… they are also now forcing all businesses to change to this too…
This is only going to generate a year report of sales/expenses