Opa olá bom dia, boa tarde ou boa noite, eu estou com um problema em criar um novo medidor de desempenho no sistema idempiere 5.1.0, abaixo vou colocar os prints das telas que eu estou usando para criar os medidores, tanto o calculo, a parte de medição e da meta
Calculo da medição:
https://drive.google.com/file/d/1r8SBeSCcyltK-cn9t_ky5mrLw0FP8Ipg/view?usp=sharing
Medição:
https://drive.google.com/file/d/1Qd9848BE0-nqYckybIaEYypHrsQf1vkb/view?usp=sharing
Meta de desempenho:
https://drive.google.com/file/d/1K036VucySU8FGL5-i-VTA-KZhzqYawux/view?usp=sharing
A query que eu estou executando para procurar os dados é a seguinte:
SELECT SUM(iv.linenetamt)
FROM fit_c_invoiceline_v iv
WHERE iv.salesrep_id::varchar = @#AD_User_ID@::varchar;
onde eu uso uma variavel de ambiente para verificar qual usuario que esta logado, tem como o objetivo calcular as vendas e devoluções totais, onde cada vendedora poderá ver so o dela, e a parte de admin poderá ver de todos. Porem esta dando o seguinte erro:
jul 04, 2019 12:47:43 PM org.compiere.model.MRole addAccessSQL
GRAVE: TableName not correctly parsed - TableNameIn=FIT_C_InvoiceLine_V - AccessSqlParser[fit_c_invoiceline_v=iv|0] - #1 fit_c_invoiceline_v=iv
= SELECT SUM(iv.linenetamt)
FROM fit_c_invoiceline_v iv WHERE iv.salesrep_id::varchar = @#AD_User_ID@::varchar;
E tambem esse outro erro:
jul 04, 2019 12:47:43 PM org.compiere.util.DB getSQLValueBD
GRAVE: SELECT SUM(iv.linenetamt)
FROM fit_c_invoiceline_v iv WHERE iv.salesrep_id::varchar = @#AD_User_ID@::varchar; AND FIT_C_InvoiceLine_V.AD_Client_ID=0 AND FIT_C_InvoiceLine_V.AD_Org_ID=0
org.postgresql.util.PSQLException: ERROR: column “ad_user_id” does not exist
Posição: 89
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:117)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:353)
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.compiere.db.StatementProxy.invoke(StatementProxy.java:128)
at com.sun.proxy.$Proxy5.executeQuery(Unknown Source)
at org.compiere.util.DB.getSQLValueBDEx(DB.java:1440)
at org.compiere.util.DB.getSQLValueBD(DB.java:1484)
at org.compiere.model.MMeasure.updateCalculatedGoals(MMeasure.java:475)
at org.compiere.model.MMeasure.updateGoals(MMeasure.java:362)
at org.compiere.model.MGoal.updateGoal(MGoal.java:388)
at org.compiere.model.MGoal.afterSave(MGoal.java:599)
at org.compiere.model.PO.saveFinish(PO.java:2285)
at org.compiere.model.PO.saveUpdate(PO.java:2436)
at org.compiere.model.PO.save(PO.java:2177)
at org.compiere.model.GridTable.dataSavePO(GridTable.java:2244)
at org.compiere.model.GridTable.dataSave(GridTable.java:1567)
at org.compiere.model.GridTab.dataSave(GridTab.java:1009)
at org.adempiere.webui.adwindow.ADTabpanel.dataSave(ADTabpanel.java:1759)
at org.adempiere.webui.adwindow.CompositeADTabbox.dataSave(CompositeADTabbox.java:864)
at org.adempiere.webui.adwindow.AbstractADWindowContent.onSave0(AbstractADWindowContent.java:2253)
at org.adempiere.webui.adwindow.AbstractADWindowContent.onSaveCallback(AbstractADWindowContent.java:2246)
at org.adempiere.webui.adwindow.AbstractADWindowContent.access$19(AbstractADWindowContent.java:2215)
at org.adempiere.webui.adwindow.AbstractADWindowContent$30.onCallback(AbstractADWindowContent.java:2189)
at org.adempiere.webui.adwindow.AbstractADWindowContent$30.onCallback(AbstractADWindowContent.java:1)
at org.adempiere.webui.adwindow.validator.WindowValidatorManager$ChainCallback.start(WindowValidatorManager.java:150)
at org.adempiere.webui.adwindow.validator.WindowValidatorManager.fireWindowValidatorEvent(WindowValidatorManager.java:129)
at org.adempiere.webui.adwindow.AbstractADWindowContent.onSave(AbstractADWindowContent.java:2197)
at org.adempiere.webui.adwindow.AbstractADWindowContent.onSave(AbstractADWindowContent.java:2147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.adempiere.webui.adwindow.ADWindowToolbar.doOnClick(ADWindowToolbar.java:447)
at org.adempiere.webui.adwindow.ADWindowToolbar.onEvent(ADWindowToolbar.java:411)
at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3162)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3132)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3074)
at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1846)
at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1618)
at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1321)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:606)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:490)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:856)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:531)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:319)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:175)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:133)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:754)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:672)
at java.lang.Thread.run(Thread.java:748)
Esses erros permitem gravar o arquivo normal, mas a medição real não é atualizada