Cannot Get Monthly Sales Report Page Crashes

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 96
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Cannot Get Monthly Sales Report Page Crashes

Post by rlopez » Tue Jan 28, 2014 7:43 pm

We are running Gold R6 Build 6169 Live. We cannot get the Monthly Sales report to run. When clicking on the button in Admin we receive and error.

Code: Select all


Server Error in '/' Application
Year, Month, and Day parameters describe an un-representable DateTime. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
Stack Trace: 
[ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.]
   System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day) +12728000
   AbleCommerce.Admin.Reports.MonthlySales.Page_Load(Object sender, EventArgs e) +375
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
 
What's ironic is we can't get to the page to set any Params Year, Month, day i.e. Also I see that when R6 build was released this [AC8-1910] - Monthly Sales Report should allow for a custom date range] was included with the build. I can't find any other set-up we may have missed. I searched the forums but did not find anyone else with this problem. All other reports under the sales category in admin run fine.
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Cannot Get Monthly Sales Report Page Crashes

Post by jmestep » Wed Jan 29, 2014 5:48 am

I just tried on a couple of sites and got the same crash. I will post a bug. It can possibly be fixed with code change on the page but I don't have time to do it. Here is a screenshot of the error with debug turned on.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

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

Re: Cannot Get Monthly Sales Report Page Crashes

Post by AbleMods » Wed Jan 29, 2014 9:15 am

Easy to fix. Just modify the /admin/reports/MonthlySales.aspx.cs file.

Find this code:

Code: Select all

        fromDate = new DateTime(localNow.Year, localNow.Month - 1, 1);
and replace it with this code:

Code: Select all

        // BEGIN MOD: AbleMods LLC
        // DATE:  01/29/2014
        // BUG FIX: math to subtract from current date is flawed when current month is January

        //fromDate = new DateTime(localNow.Year, localNow.Month - 1, 1);

        fromDate = localNow.AddMonths(-1);
        fromDate = new DateTime(fromDate.Year, fromDate.Month, 1);

        // END MOD: AbleMods LLC
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

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 96
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: Cannot Get Monthly Sales Report Page Crashes

Post by rlopez » Wed Jan 29, 2014 6:29 pm

Joe, thanks for the fix. Applied and is now working.
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Cannot Get Monthly Sales Report Page Crashes

Post by mazhar » Fri Jan 31, 2014 4:58 am

Thanks for reporting this. I just confirmed and registered it in our logs.

Post Reply