Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Weekly sales reporting in admin help needed


14steve14

Recommended Posts

Does anyone know of a good admin report that will show total sales on a weekly basis. My new accountant wants weekly reports if possible when I only have monthly. I have tried several addons but so far no found anything suitable.

I am currently using Detailed Monthly Sales Report which has all the information needed for monthly, which is great.  When the month is clicked a new page opens with totals which show order number, customer name, date, order sub total, shipping total, tax total and order total. There is a printer friendly button which allows printing of the information which is what is needed. That would all be fine if they wanted monthly but they insist on having weekly sheets printed.

The addon is here https://apps.oscommerce.com/QVI4T&detailed-monthly-sales.

Any help appreciated.

 

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

12 hours ago, YePix said:

and change in classes/sales_report.php

ot.class = 'ot_subtotal'

to

ot.class = 'ot_total'

This change is not required. The original report uses sales excluding tax and delivery. The change is only required if you need to use sales inclusive of  tax and delivery.

 

 

Link to comment
Share on other sites

14 hours ago, JcMagpie said:

This is one that I updated to get rid of core changes it's one of @BrockleyJohn originaly. Just copy all files over and it should just show up in the admin side.

I personaly don't use it so not sure if it's what your looking for.

sales-report-hook-zi.zip

 

image.thumb.png.d07302425746bb803bfb1d3cfc15cdd0.png

Many thanks. I have already tried this one. Whilst it gives a weekly total I need to have the customers info as well as a breakdown of individual order totals. 

The accountants may have to have monthly figures instead.

I have trie da google search and found and tried several other addons nothing which I can find gives the information that they require. Its all to do with saving paper and not printing off individual invoices to keep as copies, but just printing out a report that on Monday such and such customers checked out and the total for the order and shipping was what ever the amount was. The same with Tuesday and a weekly total at the bottom.

A couple of images may help.

Using detailed monthly reports the initial page shows totals by month for a year as in the first image.

When clicking on a month a new page opens with figures for each invoice that show the following details as in the image. This is monthly, but I want weekly.

 

reports monthly.jpg

reports daily.jpg

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

17 hours ago, 14steve14 said:

I am currently using Detailed Monthly Sales Report which has all the information needed for monthly, which is great.  When the month is clicked a new page opens with totals which show order number, customer name, date, order sub total, shipping total, tax total and order total. There is a printer friendly button which allows printing of the information which is what is needed. That would all be fine if they wanted monthly but they insist on having weekly sheets printed.

The addon is here https://apps.oscommerce.com/QVI4T&detailed-monthly-sales.

Find the code 

		$months_query = tep_db_query( "SELECT DISTINCT( monthname( date_purchased ) ) AS month, month( date_purchased ) AS m FROM " . TABLE_ORDERS . " WHERE date_purchased LIKE '" . $years['y'] . "-%' ORDER BY date_purchased DESC" );
		while ( $months = tep_db_fetch_array( $months_query ) ) {
			$net_total_query = tep_db_query( "SELECT SUM( value ) AS total FROM orders_total ot, orders o WHERE ot.orders_id=o.orders_id AND year( o.date_purchased ) = " . $years['y'] . " AND month( o.date_purchased ) = " . $months['m'] . "  AND ot.class = 'ot_subtotal'" );
			$net_total = tep_db_fetch_array( $net_total_query );
			$shipping_total_query = tep_db_query( "SELECT SUM( value ) AS total FROM orders_total ot, orders o WHERE ot.orders_id=o.orders_id AND year( o.date_purchased ) = " . $years['y'] . " AND month( o.date_purchased ) = " . $months['m'] . "  AND ot.class = 'ot_shipping'" );
			$shipping_total = tep_db_fetch_array( $shipping_total_query );
			$tax_total_query = tep_db_query( "SELECT SUM( value ) AS total FROM orders_total ot, orders o WHERE ot.orders_id=o.orders_id AND year( o.date_purchased ) = " . $years['y'] . " AND month( o.date_purchased ) = " . $months['m'] . "  AND ot.class = 'ot_tax'" );

Change to

		$months_query = tep_db_query( "SELECT DISTINCT( YEARWEEK( date_purchased ) ) AS month, WEEK( date_purchased ) AS m FROM orders WHERE YEAR(date_purchased) = '" . $years['y'] . "' ORDER BY date_purchased DESC" );
		while ( $months = tep_db_fetch_array( $months_query ) ) {
			$net_total_query = tep_db_query( "SELECT SUM( value ) AS total FROM orders_total ot, orders o WHERE ot.orders_id=o.orders_id AND year( o.date_purchased ) = " . $years['y'] . " AND WEEK( o.date_purchased ) = " . $months['m'] . "  AND ot.class = 'ot_subtotal'" );
			$net_total = tep_db_fetch_array( $net_total_query );
			$shipping_total_query = tep_db_query( "SELECT SUM( value ) AS total FROM orders_total ot, orders o WHERE ot.orders_id=o.orders_id AND year( o.date_purchased ) = " . $years['y'] . " AND WEEK( o.date_purchased ) = " . $months['m'] . "  AND ot.class = 'ot_shipping'" );
			$shipping_total = tep_db_fetch_array( $shipping_total_query );
			$tax_total_query = tep_db_query( "SELECT SUM( value ) AS total FROM orders_total ot, orders o WHERE ot.orders_id=o.orders_id AND year( o.date_purchased ) = " . $years['y'] . " AND WEEK( o.date_purchased ) = " . $months['m'] . "  AND ot.class = 'ot_tax'" );

See if that does what you want for that page.  If so, change the other query the same way

	$orders_query = tep_db_query( "SELECT * FROM orders WHERE YEAR( date_purchased ) = " . (int)$_REQUEST['year'] . " AND YEARWEEK( date_purchased ) = '" . (int)$_REQUEST['month'] . "' ORDER BY date_purchased DESC" );

 

Always back up before making changes.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...