Invoices query:
Start date:
End date:
Show query statements
List of invoices from $startdate to $enddate monthly
Total invoices from $startdate to $enddate overall
Total revenue from new packages from $startdate to $enddate overall
Total suspended invoices from $startdate to $enddate monthly
Total suspended invoices from $startdate to $enddate
select sum(amount) as "Total revenue monthly including old and new packages",count(*) as "Invoices total count",substring(dateentered,1,7) Month from invoices where dateentered>=$startdate and dateentered<=$enddate and dateentered<"9999-01-01" and payed="Y" group by Month
select sum(amount) as "Total revenue including old and new packages",count(*) as "Invoices total count" from invoices where dateentered>=$startdate and dateentered<=$enddate and dateentered<"9999-01-01" and payed="Y"
select sum(p.price) as "Total new packages revenue only",count(a.pid) as "Total new packages count" from accounts a,package p where a.startdate>=$startdate and a.startdate<=$enddate and a.pid=p.pid
select c.name,i.* from invoices i,customers c where i.dateentered>=$startdate and i.dateentered<=$enddate and c.cid=i.cid and i.suspend="N" and c.suspend="N" and i.payed!="Y"
select sum(amount) as "Total overall",count(invoiceid) as "Count overall" from invoices where dateentered>$startdate and suspend="Y"