Hi there,
I noticed that there some error on reports. For example, the Report TAX - Total Tax is not separating the Real and Draft status of invoices preferences.
Link: http://www.simpleinvoices.org/demo/index.php?module=reports&view=report_tax_total
Example: I have Invoice and Quotes. Since Quotes are set as draft (since there is no REAL transaction yet) I don't want the tax involved on Quotes to be showed on reports.. and all of the others reports.
I change the query on modules/reports/report_tax_total.php and now I think the issue is solved. Please can someone check if this is correct and if yes, maybe this can be fixed on svn for later versions.
The code - before - not working:
<?php
// include phpreports library
require_once("./include/reportlib.php");
$sSQL = "select sum(ii.tax_amount) as sum_tax_total from ".TB_PREFIX."invoice_items ii";
$oRpt->setXML("./modules/reports/report_tax_total.xml");
// include phpreports run code
include("./include/reportrunlib.php");
$smarty -> assign('pageActive', 'report');
$smarty -> assign('active_tab', '#home');
?>
The code - "fixed" - separating real from draft:<?php
// include phpreports library
require_once("./include/reportlib.php");
$sSQL = "select sum(ii.tax_amount) as sum_tax_total from ".TB_PREFIX."invoice_items ii, ".TB_PREFIX."invoices i, ".TB_PREFIX."preferences p
where
i.preference_id = p.pref_id
and
i.id = ii.invoice_id
and
p.status = '1';
";
$oRpt->setXML("./modules/reports/report_tax_total.xml");
// include phpreports run code
include("./include/reportrunlib.php");
$smarty -> assign('pageActive', 'report');
$smarty -> assign('active_tab', '#home');
?>
Justin, can you confirm that this is the real fix?
BTW: how can I get this fixed on statements? I want to list just the "real" documents. Same for total of products sold.. just want the ones that are on real documents.
thanks NA
your code looks fine - should be correct - have added to fix this in our todo list
refer: http://code.google.com/p/simpleinvoices/wiki/todo
re statements
- good idea, have added this to our ideas list
-- refer: http://code.google.com/p/simpleinvoices/wiki/ideas
- re how to fix now - just need to do a similar edit as your first one to the statement code
cheers
justin
Hey people,
About the same subject with the reports not working 100%...
Can someone help me to correct the statements reports? I want to list just the "real" documents but can't find the correct way to do that.
I Really need this, because I'm getting a lot of invoices and I need to print the statements to check all the values.. but getting wrong values is really annoying :/
hey reallyna
at line 68
http://code.google.com/p/simpleinvoices/source/browse/trunk/modules/statement/index.php#68
add $invoice->having_and2 = "real";
this should make statements only show 'real' invoices
give it a test and let us know if it works OK
sorry for the delay - very busy at the moment
cheers
Justin
Statements Solved.
Refer to: http://simpleinvoices.org/forum/discussion/1415/how-to-only-show-real-invoices-in-statements
I'm going to investigate how can we solve the product sales report to show only the products in real documents.
Hi ReallyNA,
Try taking a look at the code that powers the real invoices filter, if you apply this to the product sales reports you should be able to get the results you desire.
Let me know if you need any help on this.
Matt
thanks matt!!!