Dashboard Order Status Sort Order

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Dashboard Order Status Sort Order

Post by AbleMods » Tue May 20, 2014 4:25 am

Is there any way to make the dashboard order status summary sort by the order status sort order instead of the name? It seems weird to be able to set the order of order statuses, yet the dashboard control doesn't respect it.

A few clients have mentioned it confuses them because they put the statuses in order of their business "flow" but it doesn't show like that on the dashboard.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Dashboard Order Status Sort Order

Post by Katie » Tue May 20, 2014 7:12 am

Hi Joe,

I'm sorry that I don't have some code for you to fix this, but I did report it as a bug.

Thanks,
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Dashboard Order Status Sort Order

Post by jguengerich » Wed May 21, 2014 9:01 am

If you have the source, change the LoadOrderStatusSummaries method in CommerceBuilder\Orders\OrderRepository.cs to this:

Code: Select all

        /// <inheritdoc />
        public IList<OrderStatusSummary> LoadOrderStatusSummaries(DateTime orderDate)
        {
            orderDate = LocaleHelper.FromLocalTime(orderDate);
            return NHibernateHelper.CreateCriteria<CommerceBuilder.Orders.OrderStatus>("OS")
                .CreateCriteria("Orders", "O", NHibernate.SqlCommand.JoinType.LeftOuterJoin, Restrictions.Ge("O.OrderDate", orderDate))
                .SetProjection(Projections.ProjectionList().Add(Projections.Property("OS.Id"), "StatusId")
                .Add(Projections.Property("OS.Name"), "Status")
                .Add(Projections.Count("O.Id"), "Count")
                .Add(Projections.Sum("O.TotalCharges"), "Total")
                .Add(Projections.GroupProperty("OS.Id"))
                .Add(Projections.GroupProperty("OS.Name"))
                .Add(Projections.GroupProperty("OS.OrderBy")))  // CUSTOM MODS changed order from OS.Name to OS.OrderBy, so needed to add OrderBy to grouping
                .AddOrder(new NHibernate.Criterion.Order("OS.OrderBy", true))  // CUSTOM MODS changed order from OS.Name to OS.OrderBy
                .SetResultTransformer(Transformers.AliasToBean(typeof(OrderStatusSummary)))
                .List<OrderStatusSummary>();
        }
Jay

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Dashboard Order Status Sort Order

Post by AbleMods » Fri May 30, 2014 11:30 am

That worked quite nicely, thanks !
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply