Openbravo Issue Tracking System - Modules
View Issue Details
0040556ModulesRemittancepublic2019-04-09 19:092019-05-02 11:35
ngarcia 
nonofrancisco 
urgentmajoralways
closedfixed 
5
 
 
Sandrahuguet
0040556: Cannot reactivate a remittance if a invoice is also included on a remittance in draft status
Cannot reactivate a remittance if a invoice is also included on a remittance in draft status. One of the following error messages is shown:

1) ERROR: update or delete on table "fin_payment_scheduledetail" violates foreign key constraint "rem_remline_finpayschdet" on table "rem_remittanceline" Detail: Key (fin_payment_scheduledetail_id)=(...) is still referenced from table "rem_remittanceline".

2) javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute batch

As group admin role:
   Create a purchase order
   Create a purchase invoice from it
   Create a remittance
   Set an expected data higher than the invoice's due date
   Select Order or Invoices:
      Transaction Type: Payment Out
      Document: Order and Invoices
   Select the line related with previously created documents and pay it partially (do not pay the whole amount)
   Process the remittance
   Create a new remittance
   Set an expected data higher than the invoice's due date
   Select Order or Invoices:
      Transaction Type: Payment Out
      Document: Order and Invoices
   Select the line related with previously created documents and pay the pending amount
   Do not process the remittance

   Return to the first remittance and try to reactivate it. You will get the following error:
     ERROR: update or delete on table "fin_payment_scheduledetail" violates foreign key constraint "rem_remline_finpayschdet" on table "rem_remittanceline" Detail: Key (fin_payment_scheduledetail_id)=(...) is still referenced from table "rem_remittanceline".
No tags attached.
Issue History
2019-04-09 19:09ngarciaNew Issue
2019-04-09 19:09ngarciaAssigned To => Triage Finance
2019-04-09 19:09ngarciaResolution time => 1556575200
2019-04-09 19:09ngarciaIssue Monitored: networkb
2019-04-10 08:41SandrahuguetAssigned ToTriage Finance => nonofrancisco
2019-04-11 10:43miguelmartinezIssue Monitored: miguelmartinez
2019-04-15 18:12nonofranciscoStatusnew => scheduled
2019-04-24 17:58nonofranciscoNote Added: 0111291
2019-04-24 17:59nonofranciscoNote Edited: 0111291bug_revision_view_page.php?bugnote_id=0111291#r18669
2019-04-30 17:59nonofranciscoNote Edited: 0111291bug_revision_view_page.php?bugnote_id=0111291#r18691
2019-05-02 11:34hgbotCheckin
2019-05-02 11:34hgbotNote Added: 0111424
2019-05-02 11:34hgbotStatusscheduled => resolved
2019-05-02 11:34hgbotResolutionopen => fixed
2019-05-02 11:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/210361ae4d4db4227df038490c6a39fd35ddc72e [^]
2019-05-02 11:35SandrahuguetReview Assigned To => Sandrahuguet
2019-05-02 11:35SandrahuguetNote Added: 0111426
2019-05-02 11:35SandrahuguetStatusresolved => closed

Notes
(0111291)
nonofrancisco   
2019-04-24 17:58   
(edited on: 2019-04-30 17:59)
Test Plan No.1:

As group admin role:
   Create a purchase order
   Create a purchase invoice from it
   Create a remittance R1
   Set an expected data higher than the invoice's due date
   Select Order or Invoices:
      Transaction Type: Payment Out
      Document: Order and Invoices
   Select the line related with previously created documents and pay it partially
   Process the remittance
   Create a new remittance R2
   Set an expected data higher than the invoice's due date
   Select Order or Invoices:
      Transaction Type: Payment Out
      Document: Order and Invoices
   Select the line related with previously created documents and pay the pending amount
   Do not process the remittance

   Try to reactivate remittance R1
   Verify an error message is show
   Process the remittance R2
   Try to reactivate remittance R1
   Verify the process completes successfully

Test Plan No.2:

As group admin role:
   Create a purchase order
   Create a purchase invoice from it
   Create another purchase order
   Create a purchase invoice from it
   Create a remittance R1
   Set an expected data higher than the invoice's due date
   Select Order or Invoices:
      Transaction Type: Payment Out
      Document: Order and Invoices
   Select the lines related with previously created documents and pay it partially
   Process the remittance
   Create a new remittance R2
   Set an expected data higher than the invoice's due date
   Select Order or Invoices:
      Transaction Type: Payment Out
      Document: Order and Invoices
   Select the line related with first created document and pay the pending amount
   Do not process the remittance
   Create a new remittance R3
   Set an expected data higher than the invoice's due date
   Select Order or Invoices:
      Transaction Type: Payment Out
      Document: Order and Invoices
   Select the line related with last created document and pay the pending amount
   Do not process the remittance

   Try to reactivate remittance R1
   Verify an error message is shown
   Process remittance R2
   Try to reactivate remittance R1
   Verify an error message is shown
   Process remittance R3
   Try to reactivate remittance R1
   Verify the process completes successfully

(0111424)
hgbot   
2019-05-02 11:34   
Repository: erp/mods/org.openbravo.module.remittance
Changeset: 210361ae4d4db4227df038490c6a39fd35ddc72e
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Thu May 02 11:28:37 2019 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/210361ae4d4db4227df038490c6a39fd35ddc72e [^]

Fixes issue 40556: An error is shown when remittance can not be reactivated

When reactivating a remittance, if exists any line in other non processed
remittances, linked to the same order and invoice of lines in this remittance,
it can not be reactivated; in that case, an errror message is shown.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/module/remittance/process/REM_RemittanceProcess.java
---
(0111426)
Sandrahuguet   
2019-05-02 11:35   
code review + testing OK