CoreBOSBB

Full Version: Informe agrupado / resumido
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hola Necesito sacar informes de ventas (facturación) de por ejemplo clientes que se ha facturado mas de 3.000€, algo que es obligatorio y no veo como sacarlo puesto que por mucho que lo intente, sigue sacando todos los registros uno y no el cliente y la suma de los importes facturados.

¿Alguna idea?

Gracias!
He estado intentando hacer esto sin éxito.

Supongo que lo más fácil será lanzar directamente en mysql:

Code:
SELECT accountname as 'Accounts_accountname', concat(vtiger_invoice.currency_id,'::',sum(total)) as 'Invoice_Total',
vtiger_account.accountid as 'LBL_ACTION'
from vtiger_invoice
inner join vtiger_crmentity on crmid=vtiger_invoice.invoiceid
inner join vtiger_account on vtiger_invoice.accountid=vtiger_account.accountid
WHERE vtiger_invoice.invoiceid > 0 AND deleted=0
group by vtiger_invoice.accountid ,vtiger_invoice.currency_id
having sum(vtiger_invoice.total) >= 3000
(10-13-2017, 11:03 PM)joebordes Wrote: [ -> ]He estado intentando hacer esto sin éxito.

Supongo que lo más fácil será lanzar directamente en mysql:



Code:
SELECT accountname as 'Accounts_accountname', concat(vtiger_invoice.currency_id,'::',sum(total)) as 'Invoice_Total',
vtiger_account.accountid as 'LBL_ACTION'
from vtiger_invoice
inner join vtiger_crmentity on crmid=vtiger_invoice.invoiceid
inner join vtiger_account on vtiger_invoice.accountid=vtiger_account.accountid
WHERE vtiger_invoice.invoiceid > 0 AND deleted=0
group by vtiger_invoice.accountid ,vtiger_invoice.currency_id
having sum(vtiger_invoice.total) >= 3000

Gracias Joe

Él pegó el código tal cual y no aparece ningún registro ...
En vez de 3000 él puso 1 y lo mismo 
He dicho "directamente en mysql" no "informe corebos SQL". Eso es lo que no me salía, no se porque la consulta de arriba funciona en mysql pero no atraves de corebos.
Disculpa, no lo había entendido.
Pensaba que te referías a informe "nirmal" no te salía y usaste informe SQL...