Topic: Tax Report rep702 order by date

Dears,

How can I get the tax report to sort entries by date instead of Transaction type?
I tried to look around but being a novice I couldn't make it out.

Any ideas?

Post's attachments

rep709_date.png 81.8 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Tax Report rep702 order by date

@@ -67,7 +67,7 @@ function getTaxTransactions($from, $to)
         $sql .= " AND taxrec.tran_date >= '$fromdate'
                        AND taxrec.tran_date <= '$todate'
         GROUP BY taxrec.id
-               ORDER BY taxrec.trans_type, taxrec.tran_date, taxrec.trans_no, taxrec.ex_rate";
+               ORDER BY taxrec.tran_date, taxrec.trans_type, taxrec.trans_no, taxrec.ex_rate";
 
     return db_query($sql,"No transactions were returned");

3 (edited by rafat 02/10/2020 12:53:12 pm)

Re: Tax Report rep702 order by date

Thanks Braath,

I actually tried this before and I got this error in the log:

[10-Feb-2020 13:48:11 Europe/Berlin] <b>DATABASE ERROR :</b> No transactions were returned<br>error code : 1054<br>error message : Unknown column 'taxrec.trans_date' in 'order clause'<br>sql that failed was : SELECT tt.name as taxname, taxrec.*, taxrec.amount*ex_rate AS amount,

I could not understand why the ORDER BY gives such an error if one changes the order.

4 (edited by rafat 02/10/2020 01:13:40 pm)

Re: Tax Report rep702 order by date

Sorry Braath

Your change works perfectly.

I was too quick to answer. Should have paid more attention.

Thanks

Post's attachments

rep709_date_mod.png 79 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Tax Report rep702 order by date

@joe: This (date wise) should be the way it is by default. Alternatively, a report request flag for this mod can be in the core.