One of our clients brought this to our attention. In the tax report on all versions I tested and in the order management page in versions older than 7.0.4, the Last month filter doesn't work. In the tax report, it doesn't show any results and in the header it shows 12/31/09 to 12/31/08.
mazhar, have you got a quick fix? I've posted a bug report.
Last month filter
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Last month filter
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
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
Re: Last month filter
Judy I have already posted a fix for Last Month on order admin. Please have a look at it
viewtopic.php?f=42&t=12658
I guess very similar fix would apply on Tax report as well.
viewtopic.php?f=42&t=12658
I guess very similar fix would apply on Tax report as well.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Last month filter
Thank you. I didn't even think of searching for it!
Edit:
I looked in the Taxes report and it is different, and I don't have time to figure it out, especially since it's an Able bug and a possibly minor thing.
What should I change there?
case 4:
//last month
DateTime lastMonth = DateTime.Now.AddMonths(-1);
HiddenStartDate.Value = new DateTime(lastMonth.Year, lastMonth.Month, 1).ToString();
DateTime lastDayOfLastMonth = new DateTime(lastMonth.Year, DateTime.Now.Month, 1).AddDays(-1);
HiddenEndDate.Value = lastDayOfLastMonth.ToString();
break;
Edit:
I looked in the Taxes report and it is different, and I don't have time to figure it out, especially since it's an Able bug and a possibly minor thing.
What should I change there?
case 4:
//last month
DateTime lastMonth = DateTime.Now.AddMonths(-1);
HiddenStartDate.Value = new DateTime(lastMonth.Year, lastMonth.Month, 1).ToString();
DateTime lastDayOfLastMonth = new DateTime(lastMonth.Year, DateTime.Now.Month, 1).AddDays(-1);
HiddenEndDate.Value = lastDayOfLastMonth.ToString();
break;
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
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
Re: Last month filter
Try updating the all code statement with Last month case block of switch statement with following code lines for Tax report.
Code: Select all
DateTime lastMonth = DateTime.Now.AddMonths(-1);
HiddenStartDate.Value = new DateTime(lastMonth.Year, lastMonth.Month, 1,0,0,0).ToString();
DateTime lastDayOfLastMonth = new DateTime(lastMonth.Year, DateTime.Now.Month, 1).AddDays(-1);
lastDayOfLastMonth = new DateTime(lastDayOfLastMonth.Year, lastDayOfLastMonth.Month, lastDayOfLastMonth.Day, 23, 59, 59);
HiddenEndDate.Value = lastDayOfLastMonth.ToString();
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Last month filter
Thanks, but it didn't work.
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
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
Re: Last month filter
I have looked into the matter by debugging the code and it seems its a different issue although time part fix will make it more accurate. The code in Last Month block was calculating wrong year. Here is complete fix
Code: Select all
HiddenStartDate.Value = new DateTime(lastMonth.Year, lastMonth.Month, 1,0,0,0).ToString();
int numberOfDays = DateTime.DaysInMonth(lastMonth.Year, lastMonth.Month);
DateTime lastDayOfLastMonth = new DateTime(lastMonth.Year, lastMonth.Month, numberOfDays);
lastDayOfLastMonth = new DateTime(lastDayOfLastMonth.Year, lastDayOfLastMonth.Month, lastDayOfLastMonth.Day, 23, 59, 59);
HiddenEndDate.Value = lastDayOfLastMonth.ToString();
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Last month filter
Thanks, that worked.
I had to add DateTime lastMonth = DateTime.Now.AddMonths(-1); on the line after
case 4:
//last month.
I was able to patch it into the manage orders page also.
I had to add DateTime lastMonth = DateTime.Now.AddMonths(-1); on the line after
case 4:
//last month.
I was able to patch it into the manage orders page also.
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
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