Print Page | Close Window

order managment javascript code change

Printed From: SalesCart
Category: Legacy Products
Forum Name: SalesCart Standard / PRO / SQL
Forum Description: All questions pertaining to SalesCart Standard, PRO and SQL should be posted here.
URL: http://forum.salescart.com/forum/forum_posts.asp?TID=109
Printed Date: April/24/24 at 3:35am
Software Version: Web Wiz Forums 11.04 - http://www.webwizforums.com


Topic: order managment javascript code change
Posted By: lleemon
Subject: order managment javascript code change
Date Posted: June/01/04 at 6:39am
Not sure if this is just our order managment pages or not. Today is the 1st and when you go into Control Panel/Manage Orders/Purchase orders ...... you view 'Order Retrieval' with a bunch of sections. The top one 'by Date' has Today, Yesterday, 2 days Ago, and 3 days Ago option buttons. On the first few days of each month your javascript may not provide the proper date if you select anything other then Today.   I have found some code online that may help and I will provide what I have.

Will, can you give some feedback on if you also have this same issue and if this will work?

If anyone finds issues with this please provide some feedback for everyone that uses this.

-page with javascript: shop/online/3_order.asp
-javascript function: AddDay

<code>
function AddDay(xdays){
     var now = new Date()
     var day = now.getDate() - xdays
     var month = now.getMonth() + 1
     var year = now.getYear()
     var dateValue = "" + month + "/" + day + "/" + year
     
     //Start of new code
     if (day < 1){
           // original source code from http://developer.irt.org/script/1127.htm
           var today = new Date();     
           var MonthDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
          
           theYear = today.getYear();
           if (theYear < 1000) theYear +=1900;
          
           StartOfThisYear = new Date(theYear,0,1);
           EndOfThisYear = new Date(theYear,11,31);
          
           StartOfLastYear = new Date(theYear-1,0,1);
           EndOfLastYear = new Date(theYear-1,11,31);
          
           if (today.getMonth()==0) {
           StartOfLastMonth = new Date(theYear-1,11,1);
           EndOfLastMonth = new Date(theYear-1,11,MonthDays[11]);
           }
           else {
           StartOfLastMonth = new Date(theYear,today.getMonth()-1,1);
           LastMonth = today.getMonth()-1;
           DaysInLastMonth = MonthDays[LastMonth];
           if (LastMonth == 1) {
                 // February
                 if (theYear%400==0 || (theYear%4 == 0 && theYear%100!=0) )
                      DaysInLastMonth +=1;
           }
           EndOfLastMonth = new Date(theYear,today.getMonth()-1,DaysInLastMonth);
           }
           //Recalculating date
           now = EndOfLastMonth
           day = now.getDate() - xdays + 1
           month = now.getMonth() + 1
           year = now.getYear()
           dateValue = "" + month + "/" + day + "/" + year
     }
     //End of new code
     
return dateValue;
}

</code>         ;    



Replies:
Posted By: Techno Geek
Date Posted: June/01/04 at 9:01am
I believe the issue has been addressed. Please submit a support ticket and we'll send you the appropriate files.

This was a bug in the order management so the revised files are provided upon request.

-------------
Techno Geek
Customer Support Engineer
ComCity and SalesCart Technical Support


Posted By: lleemon
Date Posted: June/01/04 at 1:22pm
Will,
Thanks for the response. I looked at the support page and looks like you only provide support for 60 days. What url are you referring to when you say a support ticket?

This was just one issue that was fixed. I imagine that others have been fixed as well. Can we get those as well or do we have to pay for them? Just wondering what the process is. Plus, could be a major pain since we may have coded for a lot of these already. Do you also provide what code has changed for us developers that do add-ons to your purchased code?

Thanks


Posted By: Techno Geek
Date Posted: June/02/04 at 9:53am
Actually if it is a bug within the code you get it for free. The only thing that you would need to do is send in the support request and we would give you the files.

As long as you have the current version of the cart, you would have the current files.

-------------
Techno Geek
Customer Support Engineer
ComCity and SalesCart Technical Support



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.04 - http://www.webwizforums.com
Copyright ©2001-2015 Web Wiz Ltd. - http://www.webwiz.co.uk