solop-develop / frontend-core

ADempiere-Vue is a new UI for ADempiere ERP, CRM & SCM. It is based on Vue and uses the UI Toolkit element-ui. It is a great UI for ADempiere ERP, CRM & SCM, based on the newest development stack of Vue, built-in i18n solution, typical templates for enterprise applications, lots of awesome features. This project was forked from Vue-Element-Admin originally write by PanJiaChen / 花裤衩 over MIT license and was changed to GNU/GPL v3 by Yamel Senih after forked granted by PanJiaChen / 花裤衩 on the issue "Extend as GNU/Gpl v3 License #1434".
https://solop-develop.github.io/frontend-core
GNU General Public License v3.0
2 stars 7 forks source link

[Bug Report] Ventana Selección de Pago no carga las lineas #692

Closed EdwinBetanc0urt closed 1 year ago

EdwinBetanc0urt commented 1 year ago

Bug report

Steps to reproduce

  1. Iniciar sesión con Garden Admin.
  2. Abrir la ventana Selección de Pago.
  3. Navegar entre los registros.
  4. Verificar las lineas.

Screenshot or Gif(截图或动态图)

https://user-images.githubusercontent.com/20288327/211321526-236c64a9-583d-4d3f-8182-32b81e27d6be.mp4

Expected behavior

En el Zk se visualizan las lineas, mas sin embargo en la versión Vue no carga ninguna de las lineas con ningún registro que se seleccione. Version Zk:

https://user-images.githubusercontent.com/20288327/211320932-386beb87-e4ed-48cc-b818-44c6eb7f250c.mp4

Additional context

En el log del backend gRPC se notifica el siguiente error:

===========> RecordUtil.convertListEntitiesResult: ERROR: column c_payselectionline_parent_id_c_payselectionline.as does not exist
  Position: 2895 [47209]
niclopup commented 1 year ago

sigue sin cargar.

Se hace un ejemplo en ZK creando una línea pero no se logra ver en VUE

image

image

EdwinBetanc0urt commented 1 year ago

El error esta en la evaluacion del sql en el backend para eliminar las columnas y extraer los JOIN y restricciones del WHERE, ya la sub consulta del exists coincide con el nombre de la tabla principal

SELECT C_BankAccount.C_BankAccount_ID,NULL,NVL((SELECT NVL(C_Bank.Name,'
')||' - '||NVL(C_Bank.RoutingNo,'') FROM C_Bank WHERE C_BankAccount.C_Bank_ID=C_Bank.C_Bank_ID),'-1') ||'_'|| NVL(C_BankAccount.AccountNo,'-1'),C_BankAccount.IsActive, C_BankAccount.UUID FROM C_BankAccount WHERE  (EXISTS(SELECT 1 FROM C_BankAccount ba INNER JOIN C_Bank b ON(b.C_Bank_ID = ba.C_Bank_ID) WHERE ba.C_BankAccount_ID = C_BankAccount.C_BankAccount_ID AND b.BankType = 'B')) AND C_BankAccount.AD_Client_ID IN(0,11) AND C_BankAccount.AD_Org_ID IN(0,11,12,50000,50002,50001,50004,50006,50005,50007) AND (C_BankAccount.C_BankAccount_ID IS NULL OR C_BankAccount.C_BankAccount_ID NOT IN ( SELECT Record_ID FROM AD_Private_Access WHERE AD_Table_ID = 297 AND AD_User_ID <> 100 AND IsActive = 'Y' )) ORDER BY 3

Sin embargo funciona utilizando la linea comentada: https://github.com/solop-develop/backend/blob/experimental/src/main/java/org/spin/base/util/RecordUtil.java#L567

Pero da error con el lookup de cuentas bancarias.

Se debe mejorar la expresión regular ((\s+(FROM)\s+(C_BankAccount\s+C_BankAccount|C_BankAccount\s+AS\s+C_BankAccount|C_BankAccount)\s+)) agregando evaluación de paréntesis para excluir esa coincidencia https://github.com/solop-develop/backend/blob/experimental/src/main/java/org/spin/base/util/RecordUtil.java#L558

La siguiente expresión regular evalúa correctamente los que esta dentro de una apertura y cierre de paréntesis:

/(\((?:[^)(]|\((?:[^)(]|\((?:[^)(]|\([^)(]*\))*\))*\))*\))/

Sin embargo falta agregar que excluya o coincida exactamente cuando el nombre de la tabla principal de la consulta (C_BankAccount en este caso) este dentro del paréntesis

EXISTS(SELECT 1 FROM C_BankAccount ba INNER JOIN C_Bank b ON(b.C_Bank_ID = ba.C_Bank_ID) WHERE ba.C_BankAccount_ID = C_BankAccount.C_BankAccount_ID AND b.BankType = 'B')