Status Line window

Description

Replace GridTab.getTrxInfo with a window

Environment

None

Attachments

3

Activity

Show:

Nicolas Micoud July 9, 2013 at 11:54 AM

Hi Carlos,

I've updated GridTab here : https://bitbucket.org/nmicoud/idempiere-nm/commits/a30ae5ffb6e44ed2522a47a24dc3caf8541a98c8

The sql statement for invoice is now :
SELECT COUNT(DISTINCT C_OrderLine_ID) AS Lines,o.TotalLines,o.GrandTotal,c.ISO_Code, currencyBase(o.GrandTotal,o.C_Currency_ID,o.DateAcct, o.AD_Client_ID,o.AD_Org_ID) AS ConvAmt
FROM C_Invoice o
INNER JOIN C_Currency c ON (o.C_Currency_ID=c.C_Currency_ID)
LEFT JOIN C_InvoiceLine l ON (o.C_Invoice_ID=l.C_Invoice_ID)
WHERE o.C_Invoice_ID=@C_Invoice_ID@
GROUP BY o.C_Currency_ID, c.ISO_Code, o.TotalLines, o.GrandTotal, o.DateAcct, o.AD_Client_ID, o.AD_Org_ID

Tested and approved !

Carlos Ruiz July 9, 2013 at 4:34 AM

Ah, I see the issue! I was missing something too.

We could get the argument types from the message itself, like the attached IDEMPIERE-1150_Sample.patch illustrates:

  • just for testing purposes

  • we need to add validation in case the message have more parameters than the query it will throw exception, also there could be incorrect value between msg parameter and the query column

  • the example just implement the change for order

Please note also that I needed to change the order of the columns to match the order of the message, and also I changed INNER by LEFT JOIN on C_OrderLine and correspondingly the COUNT by COUNT DISTINCT C_OrderLine_ID - this allowed to show the message even when no lines.

You can also apply the following updates to see how the choice option works:

Regards,

Carlos Ruiz

Nicolas Micoud July 9, 2013 at 2:42 AM

Hi,

I'm lost there ; i've try to modify my code using GridField.getDefault line 577, but that's not so easy.

There is a query which retrieves some data and those data are used in a MessageFormat in order to produce something like "1 Line(s) - 40.50 - Total: 40.50 USD = 40.50" ; means that we must deal with String and number (and maybe with timestamp later).

So if i gather data in String type, i will have to cast it in another type after, no ? So, the args table will be used there ?

Or i missing something ?

Thanks,

Nicolas

Carlos Ruiz July 7, 2013 at 1:50 AM

Hi Nicolas, using context doesn't need parameter definition as the context is always expressed as a String, same as the @SQL logic on default value (look GridField.getDefault line 577) - the last two parameters for Env.parseContext maybe must be false,false as there.

The definition of the query must enclose strings within quotes, and for dates must use the corresponding TO_DATE function. We could also use the usual context syntax to point to a field on a specific tab using pipe (|), and to use a default when null (the : notation that you added on ), and also use login # and global $ variables.

> The TabiInfo table is a very good thing !
> ...
> That could be the aim of another ticket ?

Sure, we must do it in a different ticket - just I'm advising to include the SeqNo here to cover that future development.

> Just wondering if showing this status line in a panel that could be hidden is a good thing.

My idea is to show status line on the status line (the status with SeqNo=0) and records with SeqNo>0 will be shown on the help content pane.

Regards,

Carlos Ruiz

Nicolas Micoud July 6, 2013 at 6:26 PM
Edited

Hi,

Yes, the result is exactly the same. But i will upload a screenshot, that's nice

I've made a change in order that we could now user @xxx@ instead of ?
It should resolve the problem of multi-key-tables.
So, now, you have to replace "C_Order_ID = ?" by "C_Order_ID = @C_Order_ID@"

https://bitbucket.org/nmicoud/idempiere-nm/commits/063648889dfa9195993bf62aa148dd5d7f6bd3ff

Args table is here to define the data type of the columns used in the select clause.
eg: for orders or invoices, there is 5 arguments :
Lines,
TotalLines,
GrandTotal,
ISO_Code,
ConvAmt

That's not very elegant, but i can't see how we can avoid using this table.
Or perhaps, we should determine the type through a search of the column reference ? But performance will decrease

The TabiInfo table is a very good thing !
That's funny because i was asked to implement something similar as you described for right panel, show specific information related to the current record in the window (with ability to have preview of attachments).
That could be the aim of another ticket ?

Just wondering if showing this status line in a panel that could be hidden is a good thing.
I mean, a status line should provide important information (Grand total, number of lines, ...) and i think it should be always shown.
So, perhaps, we could add a AD_StatusLine_ID field on AD_Window, AD_Tab and AD_Table ?

WDYT ?

Regards,

Nicolas

Fixed

Details

Assignee

Reporter

Labels

Priority

Created July 6, 2013 at 5:41 AM
Updated June 6, 2014 at 2:27 PM
Resolved January 13, 2014 at 3:35 AM