Openbravo Issue Tracking System - Modules
View Issue Details
0050016ModulesFrench Fiscalpublic2022-08-19 16:012022-09-05 17:07
jose_duque 
Triage Omni OMS 
highmajoralways
closedno change required 
5
 
 
aferraz
0050016: Error when paying a cancel and replace with another ticket using pay open tickets
We get an error when paying two open tickets, one a cancel and replace and a normal one.
Basically because there is no update of a seq number related to taxes.

Error:
Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into OBCFR_TicketTax (AD_Client_ID, AD_Org_ID, Isactive, Created, Createdby, Updated, Updatedby, Obcfr_Ticket_ID, Obpos_Applications_ID, Taxrate, Taxbase, Taxamt, Prevhash, Hash, Hashtime, Documentno, Terminal, Seqno, Export, Obcfr_Tickettax_ID) values ('wwwwwwwwwwwwwwwww', 'xxxxxxxxxxxxxxx', 'Y', '2022-08-02 11:35:19.218+02', 'yyyyyyyyyyyyyy', '2022-08-02 11:35:19.218+02', 'zzzzzzzzzzzzzzzz', 'rrrrrrrrrrrrrrrrrrr', 'bbbbbbbbbbbbbbbbbbb', '20', '4.93', '0.98', 'aaaaaaaaaaaaaa', 'cccccccccccccccccc', 1659432919210, 'C0016A05/0000135', 'C0016A05', 154, 'N', 'ggggggggggggggggggg') was aborted: ERROR: duplicate key value violates unique constraint "obcfr_tickettax_term_seq"
  Detail: Key (obpos_applications_id, seqno)=(zzzzzzzzzzzzzzzzzzzzzzzzzzzz, 154) already exists. Call getNextException to see other errors in the batch.
Install module org.openbravo.certification.france

- Create and complete an order
- Load the order created in the POS
- Make a cancel and replace
- Add a product to the order
- Create a new ticket
- Pay both orders using Pay open tickets

Check related issue for more details
No tags attached.
related to defect 0049770 closed ranjith_qualiantech_com Retail Modules Cancel and replace ticket not displaying in pay open tickets 
Issue History
2022-08-19 16:01jose_duqueNew Issue
2022-08-19 16:01jose_duqueAssigned To => Retail
2022-08-19 16:01jose_duqueTriggers an Emergency Pack => No
2022-08-19 16:01jose_duqueIssue generated from0049791
2022-08-19 16:02jose_duqueRelationship addedrelated to 0049770
2022-08-21 08:00marvintmAssigned ToRetail => Triage Omni OMS
2022-08-23 12:33vmromanosProjectRetail Modules => Modules
2022-08-23 12:33vmromanosCategoryWeb POS => French Fiscal
2022-08-23 12:33vmromanosversionRR20Q3.4 =>
2022-08-23 12:33vmromanosStatusnew => acknowledged
2022-08-30 13:22aaroncaleroNote Added: 0140503
2022-09-05 17:06aferrazSticky IssueNo => Yes
2022-09-05 17:06aferrazSticky IssueYes => No
2022-09-05 17:06aferrazStatusacknowledged => scheduled
2022-09-05 17:07aferrazReview Assigned To => aferraz
2022-09-05 17:07aferrazNote Added: 0140719
2022-09-05 17:07aferrazStatusscheduled => closed
2022-09-05 17:07aferrazResolutionopen => no change required

Notes
(0140503)
aaroncalero   
2022-08-30 13:22   
Adding a bit more context:
The issue is reproducible only in older Openbravo versions (20Q3 and earlier) since the synchronization mechanism was changed (the issue only occurs when there are multiple orders in the same import entry, which is no longer the case).

In older versions:
If, during the processing of multiple orders, a C&R order is processed before the other orders, this method [1] fails to store the new sequence when processing the negative ticket of the C&R and ends up duplicating it.

As a workaround, on the client environment we have added a hook during the synchronization process to reorder the receipts within the import entry, to ensure that the Cancel and Replace order is always sent in the last position, therefore avoiding the problem in the certification code.



[1] https://gitlab.com/openbravo/ci/modules/org.openbravo.certification.france.dev/-/blob/master/src/org/openbravo/certification/france/ticket/TicketUtils.java#L87 [^]
(0140719)
aferraz   
2022-09-05 17:07   
No change is required because workaround is working fine.