Re: [Ledger-smb-devel] inventory function

2007-07-16 Thread Victor Sterpu
The last 2 queryes that I posted were proven to be wrong after a little testing. I've just looked on Ed's queryes. It can't last 2 hours on a database like you described(it takes a few seconds on my db). Maybe you nedd a "vacuum analyze" and an update to max_fsm_pages - I had the same problem

Re: [Ledger-smb-devel] inventory function

2007-07-15 Thread Victor Sterpu
This should be the query that will show the quantities also: SELECT p.id, p.description, p.partnumber, sum(i1.qty), sum(i.qty), sum(i.sellprice*-i.qty), sum(acc.amount), sum(i.sellprice*-i.qty)-sum(acc.amount) FROM invoice i JOIN ap a ON (a.id=i.trans_id AND a.transdate<='2007-7-15') JOIN part

Re: [Ledger-smb-devel] inventory function

2007-07-15 Thread Victor Sterpu
I made a query that takes 4 seconds for a database with 3689 ap invoices and 68834 ar invoices. My test system is a dual xeon 2.2Gh with 2Mega RAM. It requires 2 indexes. CREATE INDEX parts_inventory_accno_id ON parts (inventory_accno_id); CREATE INDEX acc_trans_invoice_id ON acc_trans (invoice_

Re: [Ledger-smb-devel] inventory function

2007-07-15 Thread Ashley J Gittins
On Sat, 14 Jul 2007, Charley Tiggs wrote: > One of my clients just did inventory the past two days and we needed > this feature. I ended up doing what Ed did. > > Ed W wrote: > > I wrote a small query to calculate the inventory and then just exported > > it to a spreadsheet. However would be usef

Re: [Ledger-smb-devel] inventory function

2007-07-14 Thread Charley Tiggs
One of my clients just did inventory the past two days and we needed this feature. I ended up doing what Ed did. Charley Ed W wrote: > Victor Sterpu wrote: >> I'm want to make a inventory function that to print the inventory at a >> specific date. >> The inventory must show the quantities and

Re: [Ledger-smb-devel] inventory function

2007-07-13 Thread Ed W
Victor Sterpu wrote: > I'm want to make a inventory function that to print the inventory at a > specific date. > The inventory must show the quantities and also the value of the > inventory account for each group of products. > So it will show the quantities and the values of the ramaining items.

Re: [Ledger-smb-devel] inventory function

2007-07-13 Thread Victor Sterpu
Chris Travers wrote: On 7/13/07, Victor Sterpu <[EMAIL PROTECTED]> wrote: I'm want to make a inventory function that to print the inventory at a specific date. The inventory must show the quantities and also the value of the inventory account for each group of products. So it will show the qu

Re: [Ledger-smb-devel] inventory function

2007-07-13 Thread Chris Travers
On 7/13/07, Victor Sterpu <[EMAIL PROTECTED]> wrote: > I'm want to make a inventory function that to print the inventory at a > specific date. > The inventory must show the quantities and also the value of the > inventory account for each group of products. > So it will show the quantities and the

[Ledger-smb-devel] inventory function

2007-07-13 Thread Victor Sterpu
I'm want to make a inventory function that to print the inventory at a specific date. The inventory must show the quantities and also the value of the inventory account for each group of products. So it will show the quantities and the values of the ramaining items. Do you want to integrate sutc