logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Monday, April 10, 2023 7:23:52 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
We launched a new upgrade and on one day at least, there was a discrepancy in Sales over time vs daily sales for that day. It could have just been an edge case because the order was place at 12:00:00 AM. I've attached a doc showing screen shots
SalesDiscrep.docx (156kb) downloaded 5 time(s).

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

Katie S  
#2 Posted : Monday, April 10, 2023 12:02:38 PM(UTC)
Katie S

Rank: Advanced Member

Groups: System, Administrators, Developers, Registered, HelpDesk
Joined: 10/29/2018(UTC)
Posts: 472

Thanks: 4 times
Was thanked: 34 time(s) in 33 post(s)
Hi Judy,

I'll get this reported. Thanks for letting us know!

Thanks for your support!

Katie
Secure eCommerce Software and Hosting
shaharyar  
#3 Posted : Monday, April 17, 2023 6:41:00 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
To fix the issue:

1- Update the Order Table - OrderDate column type to DateTime2
2- Create a .cs file with the following code
Code:
//-----------------------------------------------------------------------
// <copyright file="LocalDateTime2.cs" company="Able Solutions Corporation">
//     (c) 2018 Able Solutions Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace CommerceBuilder.DomainModel
{
    using System.Data;
    using NHibernate.SqlTypes;

    /// <summary>
    /// Provides custom translation of DateTime, using UTC for database storage with
    /// in memory conversion to local time respecting the store timezone setting
    /// </summary>
    public class LocalDateTime2 : LocalDateTime
    {
        /// <summary>  
        /// Gets the SQL types for the columns mapped by this type.   
        /// </summary> 
        public override SqlType[] SqlTypes
        {
            get
            {
                // We store our datetime in a single column in the database that can contain a datetime2
                SqlType[] types = new SqlType[1];
                types[0] = new SqlType(DbType.DateTime2);
                return types;
            }
        }
    }
} 

3- Place LocalDateTime2.cs under the path CommerceBuilder\DomainModel\LocalDateTime2.cs
4- Open file CommerceBuilder\DomainModel\LocalDateTime.cs
5- Search for
Code:
public SqlType[] SqlTypes

6- Replace with
Code:
public virtual SqlType[] SqlTypes

7- Open file CommerceBuilder\Orders\Order.hbm.xml
8- Search for
Code:
<property name="OrderDate" column="OrderDate" type="CommerceBuilder.DomainModel.LocalDateTime, CommerceBuilder" not-null="true" />

9- Replace with
Code:
<property name="OrderDate" column="OrderDate" type="CommerceBuilder.DomainModel.LocalDateTime2, CommerceBuilder" not-null="true" />

10- Compile the code and confirm the reports.

Hope it helps!
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.