Guest Posted September 1, 2004 Share Posted September 1, 2004 correct fix: uncomment the following line in admin/orders_tracking.php: if ($yesterday_month <10) {$yesterday_month = "0$yesterday_month";} I don't remember why I commented it out in the first place . . . -jared Quote Link to comment Share on other sites More sharing options...
FlyingMonkey Posted September 1, 2004 Share Posted September 1, 2004 Ok - - I'm sleepier than I thought. That won't work on days other than the first day of the month. Better fix forthcoming. -jared been there too. no worries, buddy. Quote Most likely your question has been answered, please do a search first. Link to comment Share on other sites More sharing options...
Guest Posted September 2, 2004 Share Posted September 2, 2004 Now I know why I commented it out. It made today's "yesterday" date 009-01 instead of 09-01. I'll put some better login in there than just that line. -jared Quote Link to comment Share on other sites More sharing options...
Guest Posted September 28, 2004 Share Posted September 28, 2004 (edited) Can anyone help me out with upgrading to the latest version of this and please tell me how i can list the product that was bought in orders.php in admin? Thanks Danny Edited September 28, 2004 by computerwiz5 Quote Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2004 Share Posted September 29, 2004 Can anyone help me out with upgrading to the latest version of this and please tell me how i can list the product that was bought in orders.php in admin? <{POST_SNAPBACK}> Are you wanting to see the actual products that were purchased that day? I've been thinking of coding that up (my wife actually suggested it to me today) but haven't yet thought of how would be the best way to display it. A separate page would be appropriate, I suppose. What specific problems are you having while trying to upgrade to this latest version? -jared Quote Link to comment Share on other sites More sharing options...
magnav0x Posted October 12, 2004 Share Posted October 12, 2004 Why is this commented out: // if ($first_day_of_month == 1) // if today is the first day of the month, then run yesterday stats for last_month,day instead of this_month,day Is this needed by anything or can it be deleted? Or does it need to be uncommented? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 13, 2004 Share Posted October 13, 2004 It's commented out because it doesn't work correctly. :) I can't seem to get "yesterday" stats to work consistently on the 1st day of the month. Uncommenting that line made mine work on the 1st of the month, but then messed up the yesterday stats once time rolled over to the 2nd of the month. I have some ideas to fix it, but it's really only possible to test them one day a month. :( As it is, it's not that bad of a bug, as it only happens 1/30th of the time, on average. -jared Quote Link to comment Share on other sites More sharing options...
cilliers Posted October 29, 2004 Share Posted October 29, 2004 Just realized that I've never put in the currency fix from http://www.oscommerce.com/forums/index.php?sho...ndpost&p=330236 . Can a non-US shop verify that the code in that post works for them? Hi Thanks for this contribution, beats the hell out of cut and paste to excell :thumbsup: I have a non US shop and the currency is still in $. I tried the Fix you mentioned for the earlier version but it does not seem to work. Any suggestions Thanks Kobus Quote Link to comment Share on other sites More sharing options...
ecockrell Posted November 1, 2004 Share Posted November 1, 2004 Jared, Thanks for this contribution. I'm fairly new to using OSCommerce. OK, really new. I am getting redirected to the forbiden.php web page when I try to access either of the pages. Can you help me track down this problem? Just point in the right direction and I'll let you know what I find out. I am logged in as admin. Thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted November 1, 2004 Share Posted November 1, 2004 cilliers: I am not sure how to make this work in alternate currencies. I've never tried. I'll have a look at the code and see if I can figure it out. ecockrell: I'm sorry, I'm not aware of any forbiden.php page. Is it from some other contribution you installed? Quote Link to comment Share on other sites More sharing options...
ecockrell Posted November 2, 2004 Share Posted November 2, 2004 I'm sorry, I'm not aware of any forbiden.php page. Is it from some other contribution you installed? <{POST_SNAPBACK}> I have CRELoaded installed. The forbiden.php page is called from the admin\inlcudes\functions\general.php file when the page is not listed in the Admin_Files table. I added the page names to the table and now it's working correctly. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 2, 2004 Share Posted November 2, 2004 great! Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2004 Share Posted November 12, 2004 i just noticed a problem with orders_tracking.php. In my case it affected the "yesterday" totals, but it could affect the other summations as well. For some reason, there was an orders_id missing in the sequence (e.g. 1,2,3,5,6). i think it happened because a transaction was declined, the order was deleted, and the mysql sequencer moved to the next ID for the next order. but regardless of why the ID was missing, it screwed everything up, because of the way $yesterday_last_order_id and $twodaysago_last_order_id rely on sequential order ids. All of that could be updated to not care about order IDs, if you just use some more direct date calculations. For example, to get yesterdays date, use something like this: $time = strtotime( $currDate ); $yesterTime = $time - 24*3600; $yesterday = date( 'Y-m-d', $yesterTime ); Then you can just query for orders based on date rather than based on order ids. If I had some spare time I would crank it out but I don't right now, so HTH... Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2004 Share Posted November 12, 2004 I'll look into the date simplification. You're right, it's a mess. It never occured to me to convert it to Unix time and then convert it back. If that works the way I think it will, it'll make the code _much_ simpler. What's in there now wasn't fun when I was writing it, it doesn't work right a few % of the time, and it's not particularly entertaining now. :) I thought I'd fixed it so that it didn't rely on sequential order numbers - - been a while. You're right though, I just tested it and when I delete orders, it only grabs the most recent sequential ones. Looks like it's time for me to work on it some more. :) -jared Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2004 Share Posted November 12, 2004 one other thing that might help simplify is to use sprintf(). for example, this: if ($yesterday <10) {$yesterday = "0$yesterday";} can be switched to this: $yesterday = sprintf( "%02d", $yesterday ); Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2004 Share Posted November 12, 2004 ok ok so I'm a hack. :) Quote Link to comment Share on other sites More sharing options...
♥radders Posted November 29, 2004 Share Posted November 29, 2004 There have been several questions about using this in other currencies. I think one of the most useful things would be to get this working for other currencies. It should be so simple but I tried and the code is littered with hundreds of $ signs. Knowing which ones represent US$ and which ones are just $ is quite beyond me and I gave up after a couple of hours. The currency fix given last year didn't really explain how to fix the problem. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 30, 2004 Share Posted November 30, 2004 I agree. I hope to be able to spend some time on this soon. -jared Quote Link to comment Share on other sites More sharing options...
Guest Posted December 4, 2004 Share Posted December 4, 2004 David (Radders): I've made some basic changes in the code to use the currency symbol for the store's preferred currency. Here's what I did: The top now reads: require('includes/application_top.php'); // get main currency symbol for this store $currency_query = tep_db_query("select symbol_left from " . TABLE_CURRENCIES . " where currencies_id = '1' "); $currency_symbol_results = tep_db_fetch_array($currency_query); $store_currency_symbol = tep_db_output($currency_symbol_results['symbol_left']); I just added those 4 lines. Then, I did a search and replace, changing all of these: $<?php echo to these: <?php echo $store_currency_symbol . Do it one by one, just to be careful, but that should take care of all of the monetary displays in the bottom 1/2 of the file. It worked in my testing, but please let me know if it suits your needs, or what changes it may need. Yes, the whole thing needs some code clean-up, but I want to know specifically if this takes care of your currency issue. -jared Quote Link to comment Share on other sites More sharing options...
Guest Posted December 13, 2004 Share Posted December 13, 2004 Hi! I have just installed the contriubution which is exactly what the accountants have asked for. It's great! However i have run into a small problem, I am getting an error on the orders_tracking_zones.php page, when it loads I get this. 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Sila ' and date_purchased >= '2004-1-01 00:00:00' and date_purc select count(*) as count from orders where customers_state = 'M'Sila ' and date_purchased >= '2004-1-01 00:00:00' and date_purchased <= '2004-12-31 11:59:59' and I am guessing it comes from line 95 $location_pending_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS . " where customers_state = '". $customers_location['zone_name'] ." ' and date_purchased >= '$year-$startmonth-01 00:00:00' and date_purchased <= '$year-$endmonth-31 11:59:59'"); or something is wrong with the database. I am not sure what 'Sila' is. Any help would be greatly apperciated. Kind Regards Peter Quote Link to comment Share on other sites More sharing options...
Guest Posted December 13, 2004 Share Posted December 13, 2004 The problem seems to be that M'Sila (which I'm guessing is one of the zones listed in your Zones table) has an apostrophe in it, and my code does not yet account for apostrophes. You could delete all the zones that have apostrophes, but, depending on which zones you have installed, that could be a while. I'll try and find the code (several others have already written this type of code) that parses and fixes apostrophes. -jared Quote Link to comment Share on other sites More sharing options...
Guest Posted December 14, 2004 Share Posted December 14, 2004 Hi Jared, thanks for your advice I have been through the table and removed all the ( ' ), but saved a copy orginalfor the fix. It works great now! Just wondering though is there anyway the table organise in terms of domestic and export. I have been asked if we could list our stats by UK and Export? Many thanks Peter Quote Link to comment Share on other sites More sharing options...
Guest Posted December 17, 2004 Share Posted December 17, 2004 Not at present. All we have to do is throw zone_country_id into the query (from the zones table) and sort by it. Perhaps I can do that later tonight - - right now my 1 yo is starting to wake up. :) -jared Quote Link to comment Share on other sites More sharing options...
Guest Posted December 17, 2004 Share Posted December 17, 2004 Hi! Sorry I have been away for a bit, I might have a go at that after the weekend. thanks Peter Quote Link to comment Share on other sites More sharing options...
Guest Posted January 6, 2005 Share Posted January 6, 2005 I was wondering if any one has added SALE TAX tracking to this report? I would like see tax numbers on these reports. Thanks, jeff Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.