Post by mandyj123 » Wed Jul 20, 2011 11:27 pm

Hi guys

Is this a bug i done a test run bought the product checked out and then done a return. The return seems ok but my dashboard still says 1 sale and my stock was 12 before buy went to 11 when bought and even though i have done the return it still says 11. Do i have to manually edit the product and put it back to 12 ? Plus do i have to edit my database etc.

Please help because its the only thing i need to do before making my site live.

Newbie

Posts

Joined
Tue Jul 19, 2011 12:18 am

Post by uksitebuilder » Thu Jul 21, 2011 3:16 am

I think this is the correct way to d it because the return could have been faulty and you wouldn't want to re-sell a faulty product.

So, you have to manually check the item when it is returned and if it is ok, manually add it back to stock.

Seems the correct way to do it to me.

--

Might be nice if there was a button against each item on the return to be able to add it back to stock from there though

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by mandyj123 » Thu Jul 21, 2011 3:35 am

yes a button would be a nice feature, the only other thing i dont get is why does the dashboard show there was still a sale though ? If i have done a refund then surely it should show as no sale on dashboard.

Newbie

Posts

Joined
Tue Jul 19, 2011 12:18 am

Post by uksitebuilder » Thu Jul 21, 2011 4:05 am

I thought that too, but the system has no way of knowing what order statuses do what, they are not fixed and can be edited/deleted.

However, as long as you know that you arent going to edit a certain order status then

edit admin/controller/common/home.php

find:

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND (DATE(date_added) = DATE(NOW()) AND HOUR(date_added) = '" . (int)$i . "') GROUP BY HOUR(date_added) ORDER BY date_added ASC");
replace with:

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND order_status_id < '6' AND (DATE(date_added) = DATE(NOW()) AND HOUR(date_added) = '" . (int)$i . "') OR order_status_id = '15' AND (DATE(date_added) = DATE(NOW()) AND HOUR(date_added) = '" . (int)$i . "') GROUP BY HOUR(date_added) ORDER BY date_added ASC");
find:

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND DATE(date_added) = '" . $this->db->escape($date) . "' GROUP BY DATE(date_added)");
replace with:

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND order_status_id < '6' AND DATE(date_added) = '" . $this->db->escape($date) . "' OR order_status_id = '15' AND DATE(date_added) = '" . $this->db->escape($date) . "' GROUP BY DATE(date_added)");
find:

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND (DATE(date_added) = '" . $this->db->escape($date) . "') GROUP BY DAY(date_added)");
replace with:

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND order_status_id < '6' AND (DATE(date_added) = '" . $this->db->escape($date) . "') OR order_status_id = '15' AND (DATE(date_added) = '" . $this->db->escape($date) . "') GROUP BY DAY(date_added)");
find:

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND YEAR(date_added) = '" . date('Y') . "' AND MONTH(date_added) = '" . $i . "' GROUP BY MONTH(date_added)");
replace with:

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND order_status_id < '6' AND YEAR(date_added) = '" . date('Y') . "' AND MONTH(date_added) = '" . $i . "' OR order_status_id = '15' AND YEAR(date_added) = '" . date('Y') . "' AND MONTH(date_added) = '" . $i . "' GROUP BY MONTH(date_added)");
This will mean only orders with the status of the following are counted:

Pending
Processing
Processed
Shipped
Complete


Alas nothing can be done about the customer count, well not unless a whole bunch of new functions are needed to check that they have ordered and that their orders are of a required status. (Over Kill)

vQmod file here if it helps:

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by mandyj123 » Thu Jul 21, 2011 6:06 pm

Thankyou so much that is a great help. Still think a button should be added for the returns to go back to stock if its just an unwanted item etc that would make it complete.

Newbie

Posts

Joined
Tue Jul 19, 2011 12:18 am

Post by Daniel » Sat Jul 23, 2011 12:01 pm

yes i can add a button. no need to keep repeating yourself.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by mandyj123 » Sun Jul 24, 2011 6:59 pm

lol didnt mean to repeat it so when can we expect the button to be added ?

Newbie

Posts

Joined
Tue Jul 19, 2011 12:18 am

Post by opencartisalright » Tue Jul 26, 2011 2:06 am

uksitebuilder wrote:
vQmod file here if it helps:
uksb_admin_dashboard.xml
I uploaded your vQmod but my dashboard is still counting orders towards total sales that fall outside of the 0-6 and 15 order status ID... I checked my order status IDs in phpMyAdmin to verify.

Is this vQmod supposed to stop orders that fall outside of order status 0-6 and 15 from showing up in total sales on the dashboard page? And if not what exactly does this vQmod do?

Active Member

Posts

Joined
Mon Feb 21, 2011 4:09 am

Post by uksitebuilder » Tue Jul 26, 2011 2:59 am

That is exactly wha it is supposed to do

Only test on OC 1.5.x though

Check your vQmod/vqcache folder to make sure the file is being written

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by opencartisalright » Tue Jul 26, 2011 5:01 am

uksitebuilder wrote:That is exactly wha it is supposed to do

Only test on OC 1.5.x though

Check your vQmod/vqcache folder to make sure the file is being written
I'm using OC 1.5.1.1 so maybe that's it.

However the file is being written to my vqcache folder and there is no error generated on the vqmod.log file. And I checked the cache file and verified the code was replaced with your code.

Maybe something changed in OC 1.5.1.1 that is causing this vQmod not to work...

Active Member

Posts

Joined
Mon Feb 21, 2011 4:09 am

Post by uksitebuilder » Wed Jul 27, 2011 10:32 pm

HI,

Please try the attached vQmod file instead

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by ckonig » Wed Jul 27, 2011 10:35 pm

people, be careful what you are doing!
please do not bind the code to specific status ID's
rather give the statuses logical and configurable properties (is done, is cancelled, is in progress)
And while doing, think about that also order_products could have a status, so i dont have to delete an order_product a customer has ordered. I would rather cancel it!

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by uksitebuilder » Wed Jul 27, 2011 11:14 pm

Not sure what you mean.

Please read the whole thread as this is a quick fix only for people who don't edit the default order statuses

For this to be a complete fix, then yes, the order statuses as are would need to be grouped into as you say, completed, cancelled etc and any new statuses added by the user would go into one of these groups.

However, the affected code is purely for the dashboard chart which currently doesn't work exactly by default unless you delete all non-live/non-complete orders

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by ckonig » Wed Jul 27, 2011 11:30 pm

alright, as a fix this will work out alright.
in general, this is one of the largest problem i see with opencart....
Adding new features all the time is nice, but for a business application, some things might need a little more thinking.

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by opencartisalright » Thu Jul 28, 2011 3:55 am

Still not working even with your new vQmod file.

I'm not getting any errors in vqmod log file, the file is being written in my vqcache correctly, the lines of code are actually being replaced with your code, and my order status id's in mypHpAdmin are all correct.

All of my sales that fall outside of the 0-6 and 15 order ID status are still showing on my dashboard in the total sales figures. I refreshed my browser numerous times, cleared cache, F5, and all that jazz... :-\

Active Member

Posts

Joined
Mon Feb 21, 2011 4:09 am

Post by uksitebuilder » Thu Jul 28, 2011 4:04 am

???

Leave it with me to fully test in 1.5.1.1

Seems really weird though.

Please check back tomorrow

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by opencartisalright » Sat Jul 30, 2011 4:34 am

Did you get a chance to look over this one mate?

Active Member

Posts

Joined
Mon Feb 21, 2011 4:09 am

Post by uksitebuilder » Sat Jul 30, 2011 5:39 am

I just re-read this thread over.

My vQmod only affects the chart display.

A lot more code is required to sort out the actual totals.

I have quickly looked in to it, but a lot of the methods/functions are used elsewhere within the admin.

It will take some work and if I'm going to do it, I will bear in mind the grouping of statuses mentioned above and do it properly.

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by opencartisalright » Mon Aug 01, 2011 10:55 pm

Well, if you decide you would like to take the time to develop this and turn it into a commercial mod I would totally buy it (provided it wasn't out of my budget ;D ).

Active Member

Posts

Joined
Mon Feb 21, 2011 4:09 am

Post by Solan » Thu Nov 17, 2011 6:58 am

Im also interested in this

Active Member

Posts

Joined
Sat Feb 19, 2011 7:34 pm
Who is online

Users browsing this forum: No registered users and 10 guests