[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Items ordered by description



Stroller wrote:
Please don't  hijack threads, by right-clicking on them & changing the  
subject. Instead please send a new message to the list's address - in  
most GUI mail clients you can right-click on the address and choose  
"new message to sender".

On 19 Jan 2010, at 03:31, Eduardo Huertas wrote:
  
Everytime I create an invoice or quotation or sales order, I guess  
is the same module, I have to select the items to add them to the  
invoice for example.  In this task would be very practical to have  
the items ordered by description to look for the item to select.   
Can somebody tell me where I can make this modification to the source?
    

You know you can filter by part number, right?

So if you sell computer parts you can type "PSU" in the "Number" filed  
and only power supplies - i.e PSU-001, PSU-055, &c - will be offered  
for selection. The search is not dependent on the characters being at  
the start of the string, so also ATX-PSU-99 and WW-PSU will be shown.

I suspect you know this already, however.

Wikipedia offers sortable tables, such as the two in this article:
<http://en.wikipedia.org/wiki/List_of_U.S._executive_branch_czars>

If you click on the little icon to the right of the column header then  
you will see the sort performed.

Apparently this is done with CSS & _javascript_. Some technical details  
are at <http://en.wikipedia.org/wiki/Help:Sorting>, and there is a  
link to some source code at <http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/wikibits.js?revision=61023&view=markup 
 >. If you search down for "sort" you'll see it's based on code by  
Stuart Langridge <http://www.kryogenix.org/code/browser/sorttable/>  
and Joost de Valk <http://www.joostdevalk.nl/code/sortable-table/>.

I think this would be a great feature to add to LedgerSMB.

If you look at Langridge's license, I think it's acceptable for you to  
base a patch on. You could either just use an include which pointed to  
his sorttable.js and just follow the 1,2,3 steps he describes, but it  
might be better to (check the license and) base off the wikipedia  
code, as it may be  more up-to-date with bug-fixes (for non-standards  
compliant browsers, for instance) than Langridge's - at a casual  
glance that appears to be unchanged since 2007. de Valk's example is  
certainly prettier, but I'm not sure if that's a function of the  
_javascript_ or just of CSS; he says he has fixed some bugs, but his  
sortable.js (<http://yoast.com/code/sortable-table/current/ 
sortable.js>) seems also to be dated 2007. It is MIT Licensed.

I'd guess you're probably be best basing your patch off the 1.3  
codebase, as I'd imagine that is the best place for inclusion in  
future releases.

Stroller.

  
This is a nice way to achieve the result, but personally I think a better solution would be to sort the SQL Query result before the page is displayed.
This is easier, and can be made a system default easily.
Also it will work even if Java is not available!

If desired the headers could be made clickable to allow changing the sort order at time of display,
but I suspect it is really something that would be set as a default and rarely changed.

I am currently finalising a patch to allow use of vendor partnumbers on the vendor invoice screen.
Once that is done I am willing to look at creating a patch for this as well.