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).
|
|
|
|
Rank: Advanced Member
Groups: System, Administrators, Developers, Registered, HelpDesk Joined: 10/29/2018(UTC) Posts: 471
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 |
|
|
|
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!
|
|
|
|
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.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close