Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047765Openbravo ERP09. Financial managementpublic2021-09-27 20:372021-10-14 09:53
lbressan 
fernando_merino 
highmajoralways
closedfixed 
5
PR20Q3.4 
PR22Q1 
Core
No
0047765: Problem posting multiple invoices in the same collection
The problem is that the DESCRIPTION field of the FIN_PAYMENT table is defined as VARCHAR2 (255 BYTE), note that they are BYTEs not characters. It is important to note that this occurs on an Oracle database.
The problem occurs when trying to pay multiple bills in the same payment. When they are few, it is saved without problems in the DESCRIPTION field. In English "Invoice No .: and the invoices involved" is saved. When it is saved in Spanish, "Invoice Nº: and the implied invoices" is saved. When there are several and it exceeds the size of 255 characters, the Java algorithm itself cuts the string and places an ellipsis so that the string does not exceed the 255 character limit. The problem occurs when it is exactly 255 characters, because the algorithm in java checks that it is 255 CHARACTERS. If it is 255 characters, it is considered good and sends it to be registered in the database. The problem is that the string has 255 characters, which are not the same as bytes, because the character º does not occupy 1 but 2 bytes. 254 one-byte characters, plus one of 2 bytes make 256 bytes, which do not fit in the field defined in the database. Logically this only occurs with the Spanish language.

Validation in java
https://gitlab.com/openbravo/projects/platform/openbravo/-/blob/master/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java#L302 [^]

ERROR: ORA-12899: el valor es demasiado grande para la columna "OBISOPRO"."FIN_PAYMENT"."DESCRIPTION" (real: 256, máximo: 255)
1.Have the Spanish translation installed (I imagine the Spanish localization pack)
2.In our case, which we also attached, we came up with 7 invoices (the document number contained 12 characters each).
3.Create at least 7 invoices.
4.Create a payment and click 'Add payment details'. Select the 7 invoices and press 'Done'
1. Change column definition from VARCHAR to NVARCHAR
2. [Nice to have] Review other DESCRIPTION columns and adapt them too
No tags attached.
related to design defect 0047832 new Retail Retail Modules Problem introducing long descriptions in some tables (Retail Pack Modules) 
depends on defect 0047840 closed fernando_merino Openbravo ERP API Change: Change DESCRIPTION column from VARCHAR to NVARCHAR type in FIN_PAYMENT table 
related to design defect 0047831 new Triage Omni OMS Openbravo ERP Problem introducing long descriptions in some tables (CORE) 
causes defect 0047868 closed fernando_merino Modules Character mismatch in sql query in PopulateBankInstructions_data.xsql 
png ErrorPago.png (186,692) 2021-09-27 20:40
https://issues.openbravo.com/file_download.php?file_id=16225&type=bug
png
Issue History
2021-09-27 20:37lbressanNew Issue
2021-09-27 20:37lbressanAssigned To => Triage Finance
2021-09-27 20:37lbressanModules => Core
2021-09-27 20:37lbressanRegression date => 2021-10-18
2021-09-27 20:37lbressanTriggers an Emergency Pack => No
2021-09-27 20:39lbressanDescription Updatedbug_revision_view_page.php?rev_id=23114#r23114
2021-09-27 20:40lbressanFile Added: ErrorPago.png
2021-09-28 16:11vmromanosRegression date2021-10-18 =>
2021-09-28 16:11vmromanosProposed Solution updated
2021-09-28 16:11vmromanosStatusnew => acknowledged
2021-09-30 17:35vmromanosAssigned ToTriage Finance => fernando_merino
2021-10-11 13:11hgbotNote Added: 0132298
2021-10-11 13:29fernando_merinoRelationship addedrelated to 0047831
2021-10-13 13:03fernando_merinoRelationship addeddepends on 0047840
2021-10-14 09:53hgbotResolutionopen => fixed
2021-10-14 09:53hgbotStatusacknowledged => closed
2021-10-14 09:53hgbotFixed in Version => PR22Q1
2021-10-14 09:53hgbotNote Added: 0132339
2021-10-14 09:53hgbotNote Added: 0132340
2021-10-14 09:53aferrazRelationship addedrelated to 0047832
2021-10-18 14:45aferrazRelationship addedcauses 0047868

Notes
(0132298)
hgbot   
2021-10-11 13:11   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/439 [^]
(0132339)
hgbot   
2021-10-14 09:53   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: daf70fb0536158e00f6237de654ec2251824e671
Author: fernando_merino <fernando.merino@openbravo.com>
Date: 2021-10-11T13:15:00+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/daf70fb0536158e00f6237de654ec2251824e671 [^]

Fixes ISSUE-47765: Change type definition of column FIN_PAYMENT from VARCHAR to NVARCHAR

---
M src-db/database/model/tables/FIN_PAYMENT.xml
---
(0132340)
hgbot   
2021-10-14 09:53   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/439 [^]