- Este debate está vacío.
-
AutorEntradas
-
17 mayo, 2010 a las 6:23 pm #31409Hermann D. SchimpfMiembro
Hola, este viernes comencé a tener problemas al intentar agregar nuevas EC.
La consulta sql que esta queriendo ejecutar intenta agregar un ID negativo en el campo M_PriceList_ID. Esta es la consulta armada por la clase PO en el metodo saveNew():Code:(org.openXpertya.util.CPreparedStatement)
CPreparedStatement[
Local=Pooled statement wrapping physical statement
INSERT INTO C_BPartner (
program_amt_used, IsVendor, Value, program_amt, IsActive, IsOneTime, AD_Org_ID, isiso, IsCustomer, FlatDiscount, Created, SalesVolume, ShareOfCustomer, NumberEmployees, SendEMail, AcqusitionCost, M_PriceList_ID, Name, Updated, SO_CreditUsed, DocumentCopies, SO_CreditLimit, ShelfLifeMinPct, PotentialLifeTimeValue, min_order_qty, IsDiscountPrinted, IsTaxExempt, Goal, C_BP_Group_ID, ActualLifeTimeValue, AD_Client_ID, IsSalesRep, IsProspect, TotalOpenBalance, IsSummary, C_PaymentTerm_ID, IsCompoundtax, IsEmployee, C_BPartner_ID, UpdatedBy, CreatedBy, AD_Language, SOCreditStatus, SalesRep_ID, DUNS, TaxID
) VALUES (
0, ‘N’, 000000654654, 0, ‘Y’, ‘N’, 1000047, ‘N’, ‘N’, 0, ‘2010-05-17 13:50:23.767000 -0400’, 0, 0, 0, ‘N’, 0, -1, 32132132, ‘2010-05-17 13:50:23.767000 -0400’, 0, 0, 0, 0, 0, 0, ‘N’, ‘N’, 0, 1010040, 0, 1000010, ‘N’, ‘Y’, 0, ‘N’, 1000077, ‘N’, ‘N’, 1012197, 100, 100, ‘es_PY’, Null, 100, Null, 3251321
)]Desde el momento que se ejecuta el comando de guardar hasta la pantalla de error, el sistema expulsa estas excepciones:
Code:———–> MBPartner.set_ValueNoCheck: SOCreditStatus – Value too long – truncated to length=1
===========> MBPartner.saveNew: saveNew
org.postgresql.util.PSQLException: ERROR: inserción o actualización en la tabla «c_bpartner» viola la llave foránea «mpricelist_cbpartner»
Detail: La llave (m_pricelist_id)=(-1) no está presente en la tabla «m_pricelist».; State=23503; ErrorCode=0
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:307)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.postgresql.ds.common.PooledConnectionImpl$StatementHandler.invoke(PooledConnectionImpl.java:467)
at $Proxy1.executeUpdate(Unknown Source)
at org.openXpertya.util.CPreparedStatement.executeUpdate(CPreparedStatement.java:223)
at org.openXpertya.model.PO.saveNew(PO.java:2466)
at org.openXpertya.model.PO.save(PO.java:1693)
at org.openXpertya.model.MTable.dataSavePO(MTable.java:2280)
at org.openXpertya.model.MTable.dataSave(MTable.java:1536)
at org.openXpertya.model.MTab.dataSave(MTab.java:893)
at org.openXpertya.apps.APanel.cmd_save(APanel.java:1662)
at org.openXpertya.apps.APanel.actionPerformed(APanel.java:1492)
at org.openXpertya.apps.AppsAction.actionPerformed(AppsAction.java:292)===========> MBPartner.saveError: Error – El registro está relacionado con uno o mas registros de otras entidades / documentos. Para eliminar el registro se deberán eliminar primero todos los registros que están relacionados, o marcar este registro como no Activo.
===========> MBPartner.saveNew: Not inserted – INSERT INTO C_BPartner (program_amt_used,IsVendor,Value,program_amt,IsActive,IsOneTime,AD_Org_ID,isiso,IsCustomer,FlatDiscount,Created,SalesVolume,ShareOfCustomer,NumberEmployees,SendEMail,AcqusitionCost,M_PriceList_ID,Name,Updated,SO_CreditUsed,DocumentCopies,SO_CreditLimit,ShelfLifeMinPct,PotentialLifeTimeValue,min_order_qty,IsDiscountPrinted,IsTaxExempt,Goal,C_BP_Group_ID,ActualLifeTimeValue,AD_Client_ID,IsSalesRep,IsProspect,TotalOpenBalance,IsSummary,C_PaymentTerm_ID,IsCompoundtax,IsEmployee,C_BPartner_ID,UpdatedBy,CreatedBy,AD_Language,SOCreditStatus,SalesRep_ID,DUNS,TaxID) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
===========> DB.executeUpdate: Update=INSERT INTO C_BP_Customer_Acct (C_BPartner_ID, C_AcctSchema_ID, AD_Client_ID,AD_Org_ID,IsActive, Created,CreatedBy,Updated,UpdatedBy ,C_Prepayment_Acct,C_Receivable_Acct) SELECT 1012198, p.C_AcctSchema_ID, p.AD_Client_ID,0,’Y’, CURRENT_TIMESTAMP,100,CURRENT_TIMESTAMP,100,p.C_Prepayment_Acct,p.C_Receivable_Acct FROM C_BP_Group_Acct p WHERE p.AD_Client_ID=1000010 AND p.C_BP_Group_ID=1010040 AND NOT EXISTS (SELECT * FROM C_BP_Customer_Acct e WHERE e.C_AcctSchema_ID=p.C_AcctSchema_ID AND e.C_BPartner_ID=1012198) [null]
org.postgresql.util.PSQLException: ERROR: inserción o actualización en la tabla «c_bp_customer_acct» viola la llave foránea «cbuspartner_cbpcustomer_acct»
Detail: La llave (c_bpartner_id)=(1012198) no está presente en la tabla «c_bpartner».; State=23503; ErrorCode=0
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:307)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.postgresql.ds.common.PooledConnectionImpl$StatementHandler.invoke(PooledConnectionImpl.java:467)
at $Proxy1.executeUpdate(Unknown Source)
at org.openXpertya.util.CPreparedStatement.executeUpdate(CPreparedStatement.java:223)
at org.openXpertya.util.DB.executeUpdate(DB.java:839)
at org.openXpertya.util.DB.executeUpdate(DB.java:800)
at org.openXpertya.model.PO.insert_Accounting(PO.java:2962)
at org.openXpertya.model.MBPartner.afterSave(MBPartner.java:1048)
at org.openXpertya.model.PO.saveFinish(PO.java:1717)
at org.openXpertya.model.PO.saveNew(PO.java:2506)
at org.openXpertya.model.PO.save(PO.java:1693)
at org.openXpertya.model.MTable.dataSavePO(MTable.java:2280)
at org.openXpertya.model.MTable.dataSave(MTable.java:1536)
at org.openXpertya.model.MTab.dataSave(MTab.java:893)
at org.openXpertya.apps.APanel.cmd_save(APanel.java:1662)
at org.openXpertya.apps.APanel.actionPerformed(APanel.java:1492)
at org.openXpertya.apps.AppsAction.actionPerformed(AppsAction.java:292)===========> DB.saveError: DBExecuteErrorrr – ERROR: inserción o actualización en la tabla «c_bp_customer_acct» viola la llave foránea «cbuspartner_cbpcustomer_acct»
Detail: La llave (c_bpartner_id)=(1012198) no está presente en la tabla «c_bpartner».
———–> MBPartner.insert_Accounting: #-1 – Table=C_BP_Customer_Acct from C_BP_Group_Acct
===========> DB.executeUpdate: Update=INSERT INTO C_BP_Vendor_Acct (C_BPartner_ID, C_AcctSchema_ID, AD_Client_ID,AD_Org_ID,IsActive, Created,CreatedBy,Updated,UpdatedBy ,V_Liability_Acct,V_Liability_Services_Acct,V_Prepayment_Acct) SELECT 1012198, p.C_AcctSchema_ID, p.AD_Client_ID,0,’Y’, CURRENT_TIMESTAMP,100,CURRENT_TIMESTAMP,100,p.V_Liability_Acct,p.V_Liability_Services_Acct,p.V_Prepayment_Acct FROM C_BP_Group_Acct p WHERE p.AD_Client_ID=1000010 AND p.C_BP_Group_ID=1010040 AND NOT EXISTS (SELECT * FROM C_BP_Vendor_Acct e WHERE e.C_AcctSchema_ID=p.C_AcctSchema_ID AND e.C_BPartner_ID=1012198) [null]
org.postgresql.util.PSQLException: ERROR: inserción o actualización en la tabla «c_bp_vendor_acct» viola la llave foránea «c_buspartner_c_bp_vendor_acct»
Detail: La llave (c_bpartner_id)=(1012198) no está presente en la tabla «c_bpartner».; State=23503; ErrorCode=0
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:307)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.postgresql.ds.common.PooledConnectionImpl$StatementHandler.invoke(PooledConnectionImpl.java:467)
at $Proxy1.executeUpdate(Unknown Source)
at org.openXpertya.util.CPreparedStatement.executeUpdate(CPreparedStatement.java:223)
at org.openXpertya.util.DB.executeUpdate(DB.java:839)
at org.openXpertya.util.DB.executeUpdate(DB.java:800)
at org.openXpertya.model.PO.insert_Accounting(PO.java:2962)
at org.openXpertya.model.MBPartner.afterSave(MBPartner.java:1049)
at org.openXpertya.model.PO.saveFinish(PO.java:1717)
at org.openXpertya.model.PO.saveNew(PO.java:2506)
at org.openXpertya.model.PO.save(PO.java:1693)
at org.openXpertya.model.MTable.dataSavePO(MTable.java:2280)
at org.openXpertya.model.MTable.dataSave(MTable.java:1536)
at org.openXpertya.model.MTab.dataSave(MTab.java:893)
at org.openXpertya.apps.APanel.cmd_save(APanel.java:1662)
at org.openXpertya.apps.APanel.actionPerformed(APanel.java:1492)
at org.openXpertya.apps.AppsAction.actionPerformed(AppsAction.java:292)===========> DB.saveError: DBExecuteErrorrr – ERROR: inserción o actualización en la tabla «c_bp_vendor_acct» viola la llave foránea «c_buspartner_c_bp_vendor_acct»
Detail: La llave (c_bpartner_id)=(1012198) no está presente en la tabla «c_bpartner».
———–> MBPartner.insert_Accounting: #-1 – Table=C_BP_Vendor_Acct from C_BP_Group_Acct
===========> DB.executeUpdate: Update=INSERT INTO C_BP_Employee_Acct (C_BPartner_ID, C_AcctSchema_ID, AD_Client_ID,AD_Org_ID,IsActive, Created,CreatedBy,Updated,UpdatedBy ,E_Expense_Acct,E_Prepayment_Acct) SELECT 1012198, p.C_AcctSchema_ID, p.AD_Client_ID,0,’Y’, CURRENT_TIMESTAMP,100,CURRENT_TIMESTAMP,100,p.E_Expense_Acct,p.E_Prepayment_Acct FROM C_AcctSchema_Default p WHERE p.AD_Client_ID=1000010 AND NOT EXISTS (SELECT * FROM C_BP_Employee_Acct e WHERE e.C_AcctSchema_ID=p.C_AcctSchema_ID AND e.C_BPartner_ID=1012198) [null]
org.postgresql.util.PSQLException: ERROR: inserción o actualización en la tabla «c_bp_employee_acct» viola la llave foránea «cbuspartner_c_bpemployeeacct»
Detail: La llave (c_bpartner_id)=(1012198) no está presente en la tabla «c_bpartner».; State=23503; ErrorCode=0
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:307)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.postgresql.ds.common.PooledConnectionImpl$StatementHandler.invoke(PooledConnectionImpl.java:467)
at $Proxy1.executeUpdate(Unknown Source)
at org.openXpertya.util.CPreparedStatement.executeUpdate(CPreparedStatement.java:223)
at org.openXpertya.util.DB.executeUpdate(DB.java:839)
at org.openXpertya.util.DB.executeUpdate(DB.java:800)
at org.openXpertya.model.PO.insert_Accounting(PO.java:2962)
at org.openXpertya.model.MBPartner.afterSave(MBPartner.java:1050)
at org.openXpertya.model.PO.saveFinish(PO.java:1717)
at org.openXpertya.model.PO.saveNew(PO.java:2506)
at org.openXpertya.model.PO.save(PO.java:1693)
at org.openXpertya.model.MTable.dataSavePO(MTable.java:2280)
at org.openXpertya.model.MTable.dataSave(MTable.java:1536)
at org.openXpertya.model.MTab.dataSave(MTab.java:893)
at org.openXpertya.apps.APanel.cmd_save(APanel.java:1662)
at org.openXpertya.apps.APanel.actionPerformed(APanel.java:1492)
at org.openXpertya.apps.AppsAction.actionPerformed(AppsAction.java:292)===========> DB.saveError: DBExecuteErrorrr – ERROR: inserción o actualización en la tabla «c_bp_employee_acct» viola la llave foránea «cbuspartner_c_bpemployeeacct»
Detail: La llave (c_bpartner_id)=(1012198) no está presente en la tabla «c_bpartner».
———–> MBPartner.insert_Accounting: #-1 – Table=C_BP_Employee_Acct from C_AcctSchema_Default
===========> MTable.saveError: DBExecuteErrorrr – ERROR: inserción o actualización en la tabla «c_bp_employee_acct» viola la llave foránea «cbuspartner_c_bpemployeeacct»
Detail: La llave (c_bpartner_id)=(1012198) no está presente en la tabla «c_bpartner».
———–> Msg.getMsg: NOT found: DBExecuteErrorrr
———–> Msg.getMsg: NOT found: DBExecuteErrorrrAgradezco la ayuda.
Atte
Hermann D. Schimpf17 mayo, 2010 a las 6:26 pm #34545Hermann D. SchimpfMiembroAqui adjunto la imagen del debug.
18 mayo, 2010 a las 10:53 am #34546Federico CristinaSuperadministradorHermann,
Modifiqué tu post ya que el mismo no podía ser leido (cambié los tags quote por code).
Respecto de tu consulta específica, realizaste alguna modificación que podría originar ésto? Por las dudas, verificá que no existan valores por defecto que estén generando este problema (tabla AD_Preference).
Posiblemente quedó seteado un valor para el camop pricelist en bparter, y éste logre incidir en los valores a setear en la carga de una nueva EC.
Saludos,
Federico19 mayo, 2010 a las 2:01 pm #34547Hermann D. SchimpfMiembroFederico,
Muchas gracias, el inconveniente era los valores por defecto.
Lo que paso es que modificamos las tarifas y eliminamos las predeterminadas. Entonces LY buscaba una tarifa inexistente.Gracias otra vez
Un abrazoHermann D. Schimpf
-
AutorEntradas
- Debes estar registrado para responder a este debate.