metasfresh / metasfresh-webui-api-legacy

metasfresh webui API server
GNU General Public License v3.0
30 stars 32 forks source link

Sorting by Virtual Column manually in webui throws error #848

Closed metasnw closed 6 years ago

metasnw commented 6 years ago

Is this a bug or feature request?

bug

What is the current behavior?

when you click on the header of a virtual column in webui you get an error though sorting all other fields works fine

Which are the steps to reproduce?

  1. open billing candidates (you can take any other place where virtual columns are being used)

  2. click on column "total of order" image

  3. error

    
    Error: org.postgresql.util.PSQLException: ERROR: invalid reference...
    Server error
    org.postgresql.util.PSQLException: ERROR: invalid reference to FROM-clause entry for table 


### What is the expected or desired behavior?
should work as any other field
teosarca commented 6 years ago

can be reproduced on w101: https://w101.metasfresh.com:8443/window/540092?page=1&sort=%20TotalOfOrder&viewId=540092-a7c42e17a96d4e2da7edffbd6343b6fd

metas-lc commented 6 years ago

IT open bill candidates and sort by "Total of Order" OK sort by other fields NOK => Product Category does not work org.postgresql.util.PSQLException:` ERROR: column master.m_product_category_id does not exist Position: 228 SQL: INSERT INTO T_WEBUI_ViewSelection ( UUID, Line, Record_ID) SELECT ? , row_number() OVER (ORDER BY (SELECT NULLIF (TRIM(M_Product_Category.Name), '') FROM M_Product_Category WHERE M_Product_Category.M_Product_Category_ID=master.M_Product_Category_ID ) ASC NULLS LAST) , master.C_Invoice_Candidate_ID FROM T_WEBUI_ViewSelection sel LEFT OUTER JOIN C_Invoice_Candidate master ON (master.C_Invoice_Candidate_ID=sel.Record_ID) WHERE sel.UUID=? SQL params: [540092-9f2d794fb3634ceea30b22751eccf4a4, 540092-02914fc2b0054642a11324c0cc58cfb4]

metas-lc commented 6 years ago

created follow-up: https://github.com/metasfresh/metasfresh-webui-api/issues/850 closing this one