Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032612Openbravo ERP09. Financial managementpublic2016-04-01 14:062016-04-11 12:37
psanjuan 
AtulOpenbravo 
immediatemajoralways
closedfixed 
20Professional Appliance
 
3.0PR16Q1.13.0PR16Q1.1 
aferraz
Core
Production - Confirmed Stable
2014-10-23
3.0PR14Q4
https://code.openbravo.com/erp/devel/pi/rev/179d97ee602d [^]
No
0032612: It is not possible to execute a payment created in the financial account if it is set up as "Automatic Deposit".
It is not possible to execute a payment created in the financial account if it is set up as "Automatic Deposit".
Go to Financial Account window and select "Cuenta de Banco".
Go to payment method tab and select "Cheque". Configure this payment method as described below:
* Payment In allowed =Yes
* Automatic Deposit = Yes
* Execution type = Automatic
* Execution Process = Print Check simple process
* Deferred = Yes
* Upon receipt use = In transit payment account
* Upon deposit use = Deposited payment account.

Go to sales invoice window and create a new one for F&B España, BP = Alimentos y Supermercados, Payment Method = Cheque. Complete the invoice (ie. invoice number 1000179, total gross amount = 925.65

Go to financial account "Cuenta de Banco" transaction tab and create a new one as described below:
* Transaction type = BP Deposit
Press on + icon to create a payment.

Once in the "Add payment" window filter by "Received From" Alimentos y Supermercados BP and Payment Method = Cheque.
Enter 925.65 in actual payment field and select the invoice 10000179

Press Done by selecting the option "Process Received Payment(s)".

Check that a transaction in "Draft" mode has been created related to a new payment created (ie. payment 10001749. Do not process the transaction (It should not be allowed, see issue 32383)

Navigate to the payment and check that its status is "Awaiting Execution".

Execute the payment in the payment in window by using the button "Execute Payment". Enter a check number. Press Execute.

Check that below error is shown. "Could not execute JDBC batch update".

See error log:

c59635e2 11046029 [http-8080-4] DEBUG reloadXml - XmlEngine 29-11-2001 Initialized
c59635e2 11046189 [http-8080-4] DEBUG reloadXml - XmlEngine 29-11-2001 Initialized
c59635e2 11049903 [http-8080-2] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 insert into FIN_Finacc_Transaction (AD_Client_ID, AD_Org_ID, Created, Createdby, Updated, Updatedby, Isactive, C_Currency_ID, Fin_Financial_Account_ID, Line, Fin_Payment_ID, DateAcct, Status, Paymentamt, Depositamt, Processed, Processing, Posted, Trxtype, Statementdate, Description, CreatedByAlgorithm, EM_APRM_Modify, EM_Aprm_Processed, Fin_Finacc_Transaction_ID) values ('23C59575B9CF467C9620760EB255B389', 'B843C30461EA4501935CB1D125C9C25A', '2016-04-01 13:41:45.769000 +02:00:00', '100', '2016-04-01 13:41:45.769000 +02:00:00', '100', 'Y', '102', 'DEDDE613C5314ACD8DCC60C474D1A107', 6900, '4BB428CED8834F06B20B98CDA9C48A33', '2016-04-01 00:00:00.000000 +02:00:00', 'RPR', '0', '308.55', 'N', 'N', 'N', 'BPD', '2016-04-01 00:00:00.000000 +02:00:00', 'Invoice No.: 1000324.', 'N', 'N', 'P', '4BB428CED8834F06B20B98CDA9C48A33') was aborted. Call getNextException to see the cause.
c59635e2 11049905 [http-8080-2] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "fin_finacc_transaction_un"
  Detail: Key (fin_payment_id)=(4BB428CED8834F06B20B98CDA9C48A33) already exists.
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:205)
    at org.openbravo.advpaymentmngt.dao.TransactionsDao.createFinAccTransaction(TransactionsDao.java:142)
    at org.openbravo.advpaymentmngt.process.FIN_ExecutePayment.execute(FIN_ExecutePayment.java:198)
    at org.openbravo.advpaymentmngt.ad_actionbutton.ExecutePayments.processAndClose(ExecutePayments.java:177)
    at org.openbravo.advpaymentmngt.ad_actionbutton.ExecutePayments.doPost(ExecutePayments.java:100)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:228)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:428)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.client.kernel.KernelFilter$1.doAction(KernelFilter.java:62)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:701)
Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into FIN_Finacc_Transaction (AD_Client_ID, AD_Org_ID, Created, Createdby, Updated, Updatedby, Isactive, C_Currency_ID, Fin_Financial_Account_ID, Line, Fin_Payment_ID, DateAcct, Status, Paymentamt, Depositamt, Processed, Processing, Posted, Trxtype, Statementdate, Description, CreatedByAlgorithm, EM_APRM_Modify, EM_Aprm_Processed, Fin_Finacc_Transaction_ID) values ('23C59575B9CF467C9620760EB255B389', 'B843C30461EA4501935CB1D125C9C25A', '2016-04-01 13:41:45.769000 +02:00:00', '100', '2016-04-01 13:41:45.769000 +02:00:00', '100', 'Y', '102', 'DEDDE613C5314ACD8DCC60C474D1A107', 6900, '4BB428CED8834F06B20B98CDA9C48A33', '2016-04-01 00:00:00.000000 +02:00:00', 'RPR', '0', '308.55', 'N', 'N', 'N', 'BPD', '2016-04-01 00:00:00.000000 +02:00:00', 'Invoice No.: 1000324.', 'N', 'N', 'P', '4BB428CED8834F06B20B98CDA9C48A33') was aborted. Call getNextException to see the cause.
    at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2762)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1999)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:421)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2929)
    at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
    ... 42 more






either:
a) payment is created in awaiting execution status therefore it can be executed in payment in/out window, but no transaction is created in the financial account. Once payment is executed a transaction is created automatically in the financial account (deposit).

b) same way payment is created in awaiting execution status therefore it can be executed in payment in/out window, and a transaction in draft status is created in the financial account. This draft transaction can not be processed (already implemented). Once payment is executed the transaction already created is processed (deposited).
No tags attached.
blocks defect 0032573 closed AtulOpenbravo It is not possible to execute a payment created in the financial account if it is set up as "Automatic Deposit". 
Issue History
2016-04-06 11:17AtulOpenbravoTypedefect => backport
2016-04-06 11:17AtulOpenbravoTarget Version => 3.0PR16Q1.1
2016-04-06 13:32AtulOpenbravoNote Added: 0085467
2016-04-11 12:35hgbotCheckin
2016-04-11 12:35hgbotNote Added: 0085565
2016-04-11 12:35hgbotStatusscheduled => resolved
2016-04-11 12:35hgbotResolutionopen => fixed
2016-04-11 12:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR16Q1.1/rev/aa2ba56110c73458592b9836b3a21f71a01c7552 [^]
2016-04-11 12:35hgbotCheckin
2016-04-11 12:35hgbotNote Added: 0085566
2016-04-11 12:37aferrazReview Assigned To => aferraz
2016-04-11 12:37aferrazNote Added: 0085567
2016-04-11 12:37aferrazStatusresolved => closed
2016-04-11 12:37aferrazFixed in Version => 3.0PR16Q1.1

Notes
(0085467)
AtulOpenbravo   
2016-04-06 13:32   
Test Plan
-Go to Financial Account window and select "Cuenta de Banco".
- Go to payment method tab and select "Cheque". Configure this payment method as described below:
* Payment In allowed =Yes
* Automatic Deposit = Yes
* Execution type = Automatic
* Execution Process = Print Check simple process
* Deferred = Yes
* Upon receipt use = In transit payment account
* Upon deposit use = Deposited payment account.

- Go to sales invoice window and create a new one for F&B España, BP = Alimentos y Supermercados, Payment Method = Cheque. Complete the invoice (ie. invoice number 1000179, total gross amount = 925.65

- Go to financial account "Cuenta de Banco" transaction tab and create a new one as described below:
* Transaction type = BP Deposit
- Press on + icon to create a payment.

- Once in the "Add payment" window filter by "Received From" Alimentos y Supermercados BP and Payment Method = Cheque.
Enter 925.65 in actual payment field and select the invoice 10000179

- Press Done by selecting the option "Process Received Payment(s)".

- Check that a transaction in "Draft" mode has been created related to a new payment created i.e. payment 10001749. Do not process the transaction. (It should not be allowed, see issue 32383)

- Navigate to the payment and check that its status is "Awaiting Execution".

- Execute the payment in the payment in window by using the button "Execute Payment". Enter a check number. Press Execute.

- Check that Payment is processed successfully and status is changed to "Deposit Not Cleared"

- Go to Financial Account Transaction check record related with the above processed payment has status "Deposit Not Cleared".
(0085565)
hgbot   
2016-04-11 12:35   
Repository: erp/backports/3.0PR16Q1.1
Changeset: aa2ba56110c73458592b9836b3a21f71a01c7552
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Apr 06 15:23:01 2016 +0530
URL: http://code.openbravo.com/erp/backports/3.0PR16Q1.1/rev/aa2ba56110c73458592b9836b3a21f71a01c7552 [^]

Fixes bug 32612:Not possible to execute Automatic Deposit payment created in FA

Before creating a record in financial account transaction, check is done: if transaction exists, get it so that no transactiom is created and the same is sent for processing

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java
---
(0085566)
hgbot   
2016-04-11 12:35   
Repository: erp/backports/3.0PR16Q1.1
Changeset: de37bccc6d5889323789858a13f1e6b4cc25a784
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Apr 11 11:02:52 2016 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR16Q1.1/rev/de37bccc6d5889323789858a13f1e6b4cc25a784 [^]

Related to issue 32612: Update copyright

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java
---
(0085567)
aferraz   
2016-04-11 12:37   
Code review OK