Forums / Addon Admin Tools / Sales report 2.0

Sales report 2.0

Started by blindside on 29 Aug 2006, 2:41 AM · Views: 248,184

Results 121 to 140 of 882
6 Dec 2006, 10:27 PM
#121
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Sales report 2.0

Or that we did not sell to anyone in CA that week - I hope that is the problem, certainly possible. Will track it down and pay the tax folks.
If you only collect CA taxes, then I'd say that's definitely the scenario.

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

6 Dec 2006, 10:29 PM
#122
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Sales report 2.0

I'm afraid you're probably thinking of another report. This sorts by manufacturer, but not by state.

I suppose it could, but that would definitely get ugly. What if billing and shipping are different states, for example...

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

10 Dec 2006, 8:52 PM
#123
docfx avatar

docfx

New Zenner

Join Date:
May 2004
Posts:
78
Plugin Contributions:
0

Re: Sales report 2.0

BlindSide:

@ docfx & wapnoj:
I went through the code and couldn't find anything that would cause the tax discrepancy you are seeing. However, I did realize that the Sales Report uses zen_calculate_tax() to process the tax values per product, and remembered that the most recent version of Zen Cart had bug fixes to rounding errors with taxes. So, what version are running? If it's not v1.3.6, at least download it and pull the latest version of zen_calculate_tax() into your installation. You'll need to edit includes/function/functions_taxes.php.

I'm running v1.3.5, but grabbed the latest 1.3.6, compared the two php scripts. I see nothing different betwixt the two, but my eyesight aint whut is once was. Nonetheless, I swapped the v1.3.6 code for the 1.3.5 code and no change. Sample order of 4 items @ $19.95 ea w/ MI 6% tax on $79.80 should be $4.79 (which is does show in the actual order). But the same item in Sales Report is showing as $5.00.

the Imagination Factory & DaVinci Wood Models
https://www.what-if.com & https://www.davincistore.com
Apache2.x (FreeBSD/Linux) PHP 5.x mySQL 5.x

10 Dec 2006, 10:23 PM
#124
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Sales report 2.0

Okay, I'll keep looking. Meantime I should remind everyone that this is all volunteer effort, so you should always be looking to solve your own problems. Please don't take that the wrong way (especially you, docfx), I just get some requests for immediate support on issues in a very precise scenario that I could never recreate.

In short, I'm happy to help, but it's still your store, and you're not paying me. :wink2:

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

10 Dec 2006, 11:59 PM
#125
docfx avatar

docfx

New Zenner

Join Date:
May 2004
Posts:
78
Plugin Contributions:
0

Re: Sales report 2.0

BlindSide:

Okay, I'll keep looking. Meantime I should remind everyone that this is all volunteer effort, so you should always be looking to solve your own problems. Please don't take that the wrong way (especially you, docfx), I just get some requests for immediate support on issues in a very precise scenario that I could never recreate.

In short, I'm happy to help, but it's still your store, and you're not paying me. :wink2:

Blindside:
no offense taken... many lose sight that this is all volunteer and to the benefit to all to werk together to make zen even better. That said... I went back into the suspect code in /admin/includes/classes/sales_report.php and stomped around your code a bit more... and got it to calculate tax correctly by changing the following in the "// build product line items (if requested)" section :

changed this:
$product_tax = (zen_calculate_tax($onetime_charges, $tax)) +
(zen_calculate_tax(($final_price * $quantity), $tax));

to this:
$product_tax = (zen_calculate_tax(($final_price * $quantity), $tax));

to my knowledge, I have NO one-time charges applicable here. I DO have a one-time charge attached to an attribute OF this item - BUT have not ordered the item WITH that attribute (ie T-shirt in XXXL is +$1.00, but I've only ordered the XL so the additional $1 is or shouldn't be in play).

However, if you follow the logic of this sample order... 4 items @19.95 = 79.80 => 6% tax = 4.78. If, I add the 4 unused one-time charges of $1 each (for the XXXL shirt that I'm NOT ordering I get another $0.23 in tax (or much closer to reported $5.00 tax.

The test item IS set to be priced by attribute, w/ a base price $19.95. Only the attribute of XXXL add a buck.

Hence, when I remove the code, the report shows tax correctly. This is not a fix, but is, perhaps, a symptom to look at.

the Imagination Factory & DaVinci Wood Models
https://www.what-if.com & https://www.davincistore.com
Apache2.x (FreeBSD/Linux) PHP 5.x mySQL 5.x

11 Dec 2006, 3:03 AM
#126
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Sales report 2.0

Definitely a place to start! Thanks and good work!

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

11 Dec 2006, 4:44 PM
#127
docfx avatar

docfx

New Zenner

Join Date:
May 2004
Posts:
78
Plugin Contributions:
0

Re: Sales report 2.0

docfx:

changed this:
$product_tax = (zen_calculate_tax($onetime_charges, $tax)) +
(zen_calculate_tax(($final_price * $quantity), $tax));

to this:
$product_tax = (zen_calculate_tax(($final_price * $quantity), $tax));

Sorry, this is a blind alley... didn't fix the symptom after all. Problem still exists in PROD section of report, but not in the TIMELINE or ORDER sections of report. Turned on the "DISPLAY ONE-TIME FEES" category in the report and it shows 0 in fees.

<sigh>back to the drawing board</sigh>

the Imagination Factory & DaVinci Wood Models
https://www.what-if.com & https://www.davincistore.com
Apache2.x (FreeBSD/Linux) PHP 5.x mySQL 5.x

11 Dec 2006, 7:50 PM
#128
scottydvt avatar

scottydvt

New Zenner

Join Date:
Dec 2006
Posts:
5
Plugin Contributions:
0

Re: Sales report 2.0

BlindSide,

Just an FYI - I needed a quick tax report by region, so I started with your Order Line Items report and modified it to print tax region line items. Each line item is a sum of all taxable sales in a region over that timeframe.

The result is a report that lets you see your total sales and taxes for each region where you have to remit taxes. I'd be happy to share the code if anyone else would find this useful.

Scott

11 Dec 2006, 9:47 PM
#129
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Sales report 2.0

Sure! PM me with the details, I'll give you an e-mail address where you can send files (if necessary).

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

7 Feb 2007, 12:21 AM
#130
wmarcy avatar

wmarcy

Zen Follower

Join Date:
Dec 2005
Posts:
113
Plugin Contributions:
0

Re: Sales report 2.0

I was wondering if there was some way to do this:

I want to feed a URL to my ezpages so that a manufacturer (actually an author but, hey!), could access their designated ezpage and have a sales report run for the, month to date would be fine.

So what I am asking for, is there some way to generate the sales report via the URL, with the report defaults built into it? (say, monthly, manufacturer)

My Zen Cart Store: http://www.rblibrary.com

7 Feb 2007, 12:31 AM
#131
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Sales report 2.0

Sure, run the report, then take a look at the URL. :wink2:

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

7 Feb 2007, 12:57 AM
#132
wmarcy avatar

wmarcy

Zen Follower

Join Date:
Dec 2005
Posts:
113
Plugin Contributions:
0

Re: Sales report 2.0

Blah, must be one of those kinda days for me <s>.

Any way to lose the report header (allowing someone to re-run the report? I just want to display the data.

I would gather I could display it frm the CSV, but that is outta my ken right now.

My Zen Cart Store: http://www.rblibrary.com

7 Feb 2007, 5:00 AM
#133
bettysue avatar

bettysue

Inactive

Join Date:
May 2004
Posts:
747
Plugin Contributions:
0

Re: Sales report 2.0

Please excuse me if I missed thi ssomewhere in the past 14 pages.

I have some custom fields added to my products that I need to show up on sales reports. Does this reporting system pull all info from sales? For example I have added a redular field for UPC code, and in my attributes for downloads have also added a place to put UPC codes and ISRC codes (needed on every song). The ISRC codes from sales need to be transmitted daily to an agency.

We hired a programmer, however he disappeared after putting in the fields for the UPC and ISRC and never installed the reporting system.

thank you,
betty

7 Feb 2007, 4:42 PM
#134
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Sales report 2.0

wmarcy:

Blah, must be one of those kinda days for me <s>.

Any way to lose the report header (allowing someone to re-run the report? I just want to display the data.

I would gather I could display it frm the CSV, but that is outta my ken right now.
Well obviously for your needs, you'll need to modify the basic contrib. Fortunately for you, all the calculations are done in an independent class file; you'll just need to call and feed it the necessary info, then handle the output. I think you're going to need a pretty solid PHP foundation for this project; and if you don't have one, this will definitely supply it.
bettysue:

I have some custom fields added to my products that I need to show up on sales reports. Does this reporting system pull all info from sales? For example I have added a redular field for UPC code, and in my attributes for downloads have also added a place to put UPC codes and ISRC codes (needed on every song). The ISRC codes from sales need to be transmitted daily to an agency.
There's no "plug-in" way to add fields, it's all custom. However if you've added the fields to the product table, you should be able to add them without much trouble. You'll need to modify the class file to find and collect the field, then the display file to actually output it. It will require basic programming knowhow, however.
We hired a programmer, however he disappeared after putting in the fields for the UPC and ISRC and never installed the reporting system.
I hear stories about disappearing programmers way more than I should, it's a real shame. I promise we're not all like that. :smile:

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

9 Feb 2007, 12:02 AM
#135
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Sales report 2.0

Blindside,

Is there a proper method to do the following in your contribution?
I've search quite a bit in the language file and this forum, but I can't find all the info I need.

  1. I'd like to remove the following columns from the screen display and maybe the csv output.

Base Price, Tax, Total, Product Total

I just need Product ID, Product Name Model No. and Quantity to show for output to my suppliers for sales.
I know I can delete columns when it gets to Excel, but I'l trying to see if I can streamline it and get it right on the first pass.

  1. Is there a way to modify the output from csv to text.
    I have various product names that have commas in them.
    When I open the csv file in Excel, the items with the extra commas get pushed over to the next Excel column with each comma in the name.
    This probably won't happen in a text output.

  2. Is there a way to look up multiple manufacturers at once if I modify the URL? I tried it a couple times, but it only found the first one.
    Is it only set up to do 1 manufacturer or all?

thank you for your time.....

Jeff

Jeff Michaels,
pres of Musical Creations Ltd.

9 Feb 2007, 7:23 AM
#136
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Sales report 2.0

i have a quantity discount module running and i just noticed that on a report it doesn't show this discount at all? is there a way i can do this? it only shows the group discounts and becasue of this the reports are wrong

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

9 Feb 2007, 3:41 PM
#137
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Sales report 2.0

jeffmic:

  1. I'd like to remove the following columns from the screen display and maybe the csv output.

Base Price, Tax, Total, Product Total

I just need Product ID, Product Name Model No. and Quantity to show for output to my suppliers for sales.
I know I can delete columns when it gets to Excel, but I'l trying to see if I can streamline it and get it right on the first pass.
Simple, just find those outputted columns in the report and comment them out. The regular and print displays will be in admin/stats_sales_report.php, and the CSV is located within the class, admin/includes/classes/sales_report.php. Don't forget to comment out the header column as well.

  1. Is there a way to modify the output from csv to text.
    I have various product names that have commas in them.
    When I open the csv file in Excel, the items with the extra commas get pushed over to the next Excel column with each comma in the name.
    This probably won't happen in a text output.
    By it's very nature, you can't have commas in a field in CSV files. SO you can either (1) remove all the commas through the admin, or (2) dynamically remove commas from product names when running a CSV. I'll assume you voted for the latter. Open the class file (see above) and find this line:
echo $p_data['name'] . CSV_SEPARATOR;

Change it to read as follows (new code in bold):

echo [B]str_replace(',', '', $p_data['name'])[/B] . CSV_SEPARATOR;

Repeat for any other fields where you use commas.

  1. Is there a way to look up multiple manufacturers at once if I modify the URL? I tried it a couple times, but it only found the first one.
    Is it only set up to do 1 manufacturer or all?
    The manufacturer filter was added specifically for users who generate per manufacturer reports to deliver to their contracted suppliers. In that case you only ever need to see one. I suppose I could add the ability to do one or more, but that's more logic that I just don't have time for right now...

Best best is to not use the filter, and instead sort by manufacturer in the product line item display.[/quote]

thank you for your time.....
Your welcome! :smile:
MB1:

i have a quantity discount module running and i just noticed that on a report it doesn't show this discount at all? is there a way i can do this? it only shows the group discounts and becasue of this the reports are wrong
The report calculates based on actual quantities sold and purchase price, so any per product discounts should automagically be calculated in.

Try this. Run the report for a timeframe that includes several orders for your qty-discounted product, and use per product line items. Take a look at the Base Price, Qty., and {B]Product Total[/B] fields. The math probably doesn't match up, which I think prompted your post.

But what you don't realize is that the Product Total field actually contains the correct value. Base Price is gathered the first time a given product_id is hit upon. It obviously could be different, but I can't display every base value for the the product on a single line. So it's a bit of an assumption, but it's usually correct, and when it's not the Product Total is always correct. Check the math if you're still unsure.

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

10 Feb 2007, 7:46 AM
#138
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Sales report 2.0

no it's all off it calculates the group discount but not the quantity discount. and when i tallied up the product totals it was way off.

for yesterdays single order the main total was right if you took off the quantity discount, as for the individual product totals they were to high the totals were bang on.

invoice total was 1,725, the sales report total was 2035.82 (if you took off the quantity discount of 310.59 it would be aok) and if you calculate the product totals you get 2443.58.

anysugestions?

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

10 Feb 2007, 2:18 PM
#139
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Sales report 2.0

Thanks so much for your help.
I was able to customize my screen and csv layouts exactly as I needed.

This is a wonderful add on!

Jeff

Jeff Michaels,
pres of Musical Creations Ltd.

16 Feb 2007, 3:03 AM
#140
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Sales report 2.0

anyword on how i can get the quantity discount to show as default?

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods