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

Re: Invoice Creation Failing





On Dec 5, 2007 11:42 AM, BeamEnds <..hidden..> wrote:
On Wed, 2007-12-05 at 11:18 -0800, Chris Travers wrote:
>
>
> On Dec 5, 2007 11:00 AM, BeamEnds <..hidden..> wrote:
>
>         On Tue, 2007-12-04 at 15:33 -0800, Chris Travers wrote:
>         >
>         >
>         > On Dec 3, 2007 5:06 PM, BeamEnds <..hidden.. >
>         wrote:
>         >         Hi All,
>         >         I posted a couple of days back about invoice
>         creation failing
>         >         for
>         >         all parts, and the accounts associated with a part
>         not
>         >         appearing
>         >         in the Parts Report.
>         >
>         >         The problem was that I'd loaded all the parts fro
>         CSV files,
>         >         and
>         >         to get the parts to associate with the accounts each
>         record
>         >         has
>         >         to be updated (with the Update button on the Part
>         record
>         >         window).
>         >
>         >         As I have 26,000 parts to do, this could be a tad
>         boring. Is
>         >         there
>         >         a way to automate this (my SQL knowledge tends
>         towards zero
>         >         I'm
>         >         afraid)?
>         >
>         > I am not sure exactly what you are trying to do-- are you
>         trying to
>         > set default accounts?
>         >
>         > Best WIshes,
>         > Chris Travers
>         >
>
>
>         Hi Chris,
>         this is the story....
>
>         I imported all the parts from a CSV file, in doing so the
>         three "link
>         accounts" were set to :
>
>         Inventory :  1001--Stock
>         Income    :  4000--Sales
>         COGS      :  5000-Metrials Purchased
>
>
> Ok.  Were they set to the numbers (i.e. 1001, 4000, 5000) or to the
> full string (1001--Sales)?

Ok, try taking a look at the actual tables.  The fields are ints so it is probably 1001, 4000, and 5000.

In that case, the thing to do is UPDATE parts SET inventory_accno_id = (select id from chart where accno = '1001') where inventory_accno_id = '1001';

I would test on a copy of oyur db (either back up first or actually copy the db into a new db, as in createdb -T ....)

You can do the same for income_accno_id and expense_accno_id.

Best Wishes,
Chris Travers