Jump to content

5.1.4 Sales Report doesn't filter properly


Dirty Butter

Recommended Posts

Now that I've figured out the Google Trusted Store javascript code, I had to create a scheduled shipping feed and a cancellation feed to be uploaded daily.

The problem is that the date filter works correcly in v5.1.4, BUT I can't get the Status sort to work correctly. No matter what I tried, all I get is a list of the Completed Orders in the date range I specify. The Exported file also shows only the Completed Orders.

I added ship_tracking to the array in sources/reports.index.inc.php line 64, so I could export all the information that the daily Google Trusted Store shipping feed requires. (That doesn't have anything to do with Sort not working, as the other store (without any Google Trusted Store code anywhere) does not have that in the array, and Sort does not work properly there, either.)

All I need for the cancellation feed they require is the order ID and their code for why it was cancelled. So a quick export of Cancelled only will be easy to modify manually, IF I can get it to filter properly so I can export that report.

Link to comment
Share on other sites

In the file reports.index.inc.php, at around line 22, there is this:

if(!isset($_POST['report']['status']) || !isset($_GET['report']['status'])) {

This part, isset($_POST['report']['status']), is true and the ! makes it false.

This part, isset($_GET['report']['status']), is false and the ! makes it true.

Therefore the test is true and $report_filter['status'] is hard set to array(2,3).

This is not what is wanted.

Suggest this test instead:

if(!isset($_POST['report']['status']) && !isset($_GET['report']['status'])) {

If there is no POST status and there is no GET status, then fall back on a hard coded array.

Link to comment
Share on other sites

Thanks for the help, Bsmither. Unfortunately,

if(!isset($_POST['report']['status']) && !isset($_GET['report']['status'])) {

sends me back to the Dashboard, no matter what choice I make from the Status choices.

NOT QUITE RIGHT - when I specify a date range I get sent back to the Dashboard. If I only choose one Status without specifying date range, the report worked properly.

Link to comment
Share on other sites

Please describe exactly how you entering the 'from' and 'to' dates for the Report Filter Date Range.

If you manually enter something, and it is not in this specific format:

^([0-9]){4}-([0-9]){2}-([0-9]){2}$

that is, a four digit group, a dash, a two-digit group, a dash, a two digit group with nothing preceding or following those groups,

then you should be bounced back to the default Reports page.

(Personally, I am having some difficulties with where I should be bouncing back to. I'm trying to figure that out.)

But, I am successful in asking for a report with no dates. I also get a report with just a 'from' date entered (the default 'to' is right now).

Link to comment
Share on other sites

Interesting. An end date all by itself works fine for me.

Switch on debugging and see if there is a POST section. Mine shows:

POST:

'report' =>

'date' =>

'from' => ''

'to' => '2012-09-11'

'status' =>

'0' => '1'

'1' => '2'

'2' => '3'

'3' => '6'

'token' => '8dcab29161a45e46fd6ece8e5d0c1fb1'

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...