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

Re: Please, Advise me



We downloaded the newest version of ledgerSMB to test the situation we have been experiencing in our system.
Here is what we found:

Created new product
Sold the product to create negative quantity
Then purchase item on vendor invoice
Everything at this point was correct, the sales invoice got updated when posting the vendor invoice
Then we reposted the vendor invoice and at this point it duplicated the entries on the sales invoice and created project id records

The example is shown below:

Thanks
Brad and Shaekir

Sales Invoice - selling item that has negative stock

 select * from acc_trans where trans_id  = 302985;
 trans_id | chart_id | transdate  | source | cleared | fx_transaction | project_id | memo | invoice_id | amount | entry_id
----------+----------+------------+--------+---------+----------------+------------+------+------------+--------+----------
   302985 |    10024 | 2009-11-19 |        | f       | f              |            |      |            |      1 |   132020
   302985 |    10025 | 2009-11-19 |        | f       | f              |            |      |            |      1 |   132019
   302985 |    10004 | 2009-11-19 |        | f       | f              |            |      |            |    -22 |   132018
   302985 |    10033 | 2009-11-19 |        | f       | f              |            |      |      76560 |     20 |   132017
(4 rows)

Vendor Invoice - this correct original sales invoice
20091001=# select * from acc_trans where trans_id  = 302985;
 trans_id | chart_id | transdate  | source | cleared | fx_transaction | project_id | memo | invoice_id | amount | entry_id
----------+----------+------------+--------+---------+----------------+------------+------+------------+--------+----------
   302985 |    10045 | 2009-11-19 |        | f       | f              |            |      |      76561 |     -4 |   132022
   302985 |    10007 | 2009-11-19 |        | f       | f              |            |      |      76561 |      4 |   132021
   302985 |    10024 | 2009-11-19 |        | f       | f              |            |      |            |      1 |   132020
   302985 |    10025 | 2009-11-19 |        | f       | f              |            |      |            |      1 |   132019
   302985 |    10004 | 2009-11-19 |        | f       | f              |            |      |            |    -22 |   132018
   302985 |    10033 | 2009-11-19 |        | f       | f              |            |      |      76560 |     20 |   132017
(6 rows)

Repost Vendor Invoice - additional entries created
20091001=# select * from acc_trans where trans_id  = 302985;
 trans_id | chart_id | transdate  | source | cleared | fx_transaction | project_id | memo | invoice_id | amount | entry_id
----------+----------+------------+--------+---------+----------------+------------+------+------------+--------+----------
   302985 |    10045 | 2009-11-19 |        | f       | f              |            |      |      76562 |     -4 |   132029
   302985 |    10007 | 2009-11-19 |        | f       | f              |            |      |      76562 |      4 |   132028
   302985 |    10007 | 2009-11-19 |        | f       | f              |          0 |      |            |     -4 |   132027
   302985 |    10045 | 2009-11-19 |        | f       | f              |          0 |      |            |      4 |   132026
   302985 |    10045 | 2009-11-19 |        | f       | f              |            |      |      76561 |     -4 |   132022
   302985 |    10007 | 2009-11-19 |        | f       | f              |            |      |      76561 |      4 |   132021
   302985 |    10024 | 2009-11-19 |        | f       | f              |            |      |            |      1 |   132020
   302985 |    10025 | 2009-11-19 |        | f       | f              |            |      |            |      1 |   132019
   302985 |    10004 | 2009-11-19 |        | f       | f              |            |      |            |    -22 |   132018
   302985 |    10033 | 2009-11-19 |        | f       | f              |            |      |      76560 |     20 |   132017
(10 rows)

Add additional item on invoice and repost
20091001=# select * from acc_trans where trans_id  = 302985;
 trans_id | chart_id | transdate  | source | cleared | fx_transaction | project_id | memo | invoice_id | amount | entry_id
----------+----------+------------+--------+---------+----------------+------------+------+------------+--------+----------
   302985 |    10045 | 2009-11-19 |        | f       | f              |            |      |      76563 |     -4 |   132036
   302985 |    10007 | 2009-11-19 |        | f       | f              |            |      |      76563 |      4 |   132035
   302985 |    10007 | 2009-11-19 |        | f       | f              |          0 |      |            |     -4 |   132034
   302985 |    10045 | 2009-11-19 |        | f       | f              |          0 |      |            |      4 |   132033
   302985 |    10045 | 2009-11-19 |        | f       | f              |            |      |      76562 |     -4 |   132029
   302985 |    10007 | 2009-11-19 |        | f       | f              |            |      |      76562 |      4 |   132028
   302985 |    10007 | 2009-11-19 |        | f       | f              |          0 |      |            |     -4 |   132027
   302985 |    10045 | 2009-11-19 |        | f       | f              |          0 |      |            |      4 |   132026
   302985 |    10045 | 2009-11-19 |        | f       | f              |            |      |      76561 |     -4 |   132022
   302985 |    10007 | 2009-11-19 |        | f       | f              |            |      |      76561 |      4 |   132021
   302985 |    10024 | 2009-11-19 |        | f       | f              |            |      |            |      1 |   132020
   302985 |    10025 | 2009-11-19 |        | f       | f              |            |      |            |      1 |   132019
   302985 |    10004 | 2009-11-19 |        | f       | f              |            |      |            |    -22 |   132018
   302985 |    10033 | 2009-11-19 |        | f       | f              |            |      |      76560 |     20 |   132017
(14 rows)




Date: Thu, 19 Nov 2009 10:49:56 -0800
From: ..hidden..
To: ..hidden..
Subject: Re: [Ledger-smb-devel] Please, Advise me

Take a look at lines 357-437 of LedgerSMB/IR.pm

I haven't heard of this happening before.

Hope this helps,
Chris Travers


Windows Live: Keep your friends up to date with what you do online.