dasonix2000 Posted May 5, 2005 Share Posted May 5, 2005 Hi guys / gals. Im wondering if you could point me to a contrib that does sales reports that include the cost of Shipping ? I have spent a few days lookign but cant seem to find any. Currently all the reports I have tryed all show order total excluding postage :( If you can help or point me in the right direction Thank you Dasonix Link to comment Share on other sites More sharing options...
boxtel Posted May 5, 2005 Share Posted May 5, 2005 Hi guys / gals. Im wondering if you could point me to a contrib that does sales reports that include the cost of Shipping ? I have spent a few days lookign but cant seem to find any. Currently all the reports I have tryed all show order total excluding postage :( If you can help or point me in the right direction Thank you Dasonix <{POST_SNAPBACK}> well, it is stored in the orders_total table so you would need to do a query on orders_id and class=ot_shipping and then pull the value or the text field. Treasurer MFC Link to comment Share on other sites More sharing options...
dasonix2000 Posted May 6, 2005 Author Share Posted May 6, 2005 well, it is stored in the orders_total table so you would need to do a query on orders_id and class=ot_shipping and then pull the value or the text field. <{POST_SNAPBACK}> Thank you for the reply. I think I have found what you are saying in the sales_report.php file in classes. " $tmp_query = "select sum(ot.value) as shipping FROM " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS . " o WHERE ot.orders_id = o.orders_id and ot.class = 'ot_shipping'"; " Am I right and if so how do I get that called into stats_customers.php ? Im a total Doof when it comes to PHP atm and this is a bit above my knowladge level. any more help would be wonderfull TY Link to comment Share on other sites More sharing options...
boxtel Posted May 6, 2005 Share Posted May 6, 2005 Thank you for the reply. I think I have found what you are saying in the sales_report.php file in classes. " $tmp_query = "select sum(ot.value) as shipping FROM " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS . " o WHERE ot.orders_id = o.orders_id and ot.class = 'ot_shipping'"; " Am I right and if so how do I get that called into stats_customers.php ? Im a total Doof when it comes to PHP atm and this is a bit above my knowladge level. any more help would be wonderfull TY <{POST_SNAPBACK}> correct, simply re-use this code. Treasurer MFC Link to comment Share on other sites More sharing options...
dasonix2000 Posted May 6, 2005 Author Share Posted May 6, 2005 thnak you I think I have cracked it in sales_report.php i changed the following function query() { $tmp_query = "select sum(ot.value) as value, avg(ot.value) as avg, count(ot.value) as count FROM " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS . " o WHERE ot.orders_id = o.orders_id and ot.class = 'ot_subtotal'"; to function query() { $tmp_query = "select sum(ot.value) as value, avg(ot.value) as avg, count(ot.value) as count FROM " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS . " o WHERE ot.orders_id = o.orders_id and ot.class = 'ot_total'"; everythign seems to be right. for anybody who ever needs this hack just take the sub out of the ot_subtotal. thank you for your guidence, hopefully this wont mess things up too much :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.