Forum Home Forum Home > Legacy Products > SalesCart Standard / PRO / SQL
  New Posts New Posts RSS Feed - order managment javascript code change
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum Lockedorder managment javascript code change

 Post Reply Post Reply
Author
Message
lleemon View Drop Down
Groupie
Groupie


Joined: March/16/04
Location: United States
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote lleemon Quote  Post ReplyReply Direct Link To This Post Topic: order managment javascript code change
    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>         ;    
Back to Top
Techno Geek View Drop Down
Admin Group
Admin Group
Avatar
Evil monkey living in my closet!

Joined: March/11/04
Location: United States
Status: Offline
Points: 1206
Post Options Post Options   Thanks (0) Thanks(0)   Quote Techno Geek Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
lleemon View Drop Down
Groupie
Groupie


Joined: March/16/04
Location: United States
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote lleemon Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Techno Geek View Drop Down
Admin Group
Admin Group
Avatar
Evil monkey living in my closet!

Joined: March/11/04
Location: United States
Status: Offline
Points: 1206
Post Options Post Options   Thanks (0) Thanks(0)   Quote Techno Geek Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.04
Copyright ©2001-2015 Web Wiz Ltd.

Copyright 2015 by ComCity® LLC and SalesCart™.  All Rights Reserved