[SL] Re: Invoice Number not in sequence

  • From: pvantony@xxxxxxxxxxxxxx
  • To: sql-ledger-users@xxxxxxxxxxxxxx
  • Date: Sat, 03 May 2003 13:09:57 +0800 (SGT)

Dear Tim,

Thanks for the reply. 

I will do this more carefully with a backup.

I am very sorry to trouble you. I just needed to be sure. So a few questions if 
you do not mind.

1. Are you using version 2.0.6?

2. The new code is to replace the small code or just add on to the current code?

3. Where is ar.pl?

Sorry again.

P.V.Anthony


--- Tim A Hall-Woodcock <thw@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> 
> The directories for the backend modules i.e. AR.pm are in
> <sql-ledger
> root>/SL/AR.pm
> 
> Table AR contains invoice headers so take a look in there for your
> empty
> Invoice numbers.
> 
> BACKUP YOUR DATA AND SCRIPTS BEFORE ANY MODS!
> 
> Tim.
> 
> ----- Original Message -----
> From: <pvantony@xxxxxxxxxxxxxx>
> To: <sql-ledger-users@xxxxxxxxxxxxxx>
> Sent: Tuesday, April 29, 2003 2:57 PM
> Subject: [SL] Re: Invoice Number not in sequence
> 
> 
> >
> > Thanks for the patch.
> >
> > I am using 2.0.6
> >
> > As I am newbie in this please let me know the exact directories
> where the
> files are in the sql-ledger folder.
> >
> > I could not find the right ones. I have done the changes in is.pl
> and
> ar.pl in bin/mozella/.
> >
> > I have also made a boo boo. Now I have an invoice without a
> number.
> >
> > Please also let me know which tables I should go and delete the
> records.
> As I am not able to delete from the web.
> >
> > Thanks in advance.
> >
> > P.V.Anthony
> >
> >
> >
> > --- Tim A Hall-Woodcock <thw@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > >
> > > Here is the modification we made to SL to make this happen for
> us.
> > > If no
> > > number is entered the next available is used but this only
> happens
> > > at post
> > > time. If you have your own manual numbering system enter the
> number
> > > in the
> > > blank box and it will record that one instead.
> > >
> > > We use it but I can't gaurantee it will work on anyone elses
> SL.
> > > Maybe
> > > Dieter will implement it if he feels it is a solution.
> > >
> > > Note this one is for AR but is easy to implement for others and
> > > don't forget
> > > to backup if you are going to try it ;)
> > >
> > > Around line 140 of AR.pm (depending on which version of SL you
> are
> > > running),
> > > after the following three lines paste in the <snip>:
> > >
> > >   # record last payment date in ar table
> > >   $form->{datepaid} = $form->{transdate} unless
> $form->{datepaid};
> > >   my $datepaid = ($form->{invpaid} != 0) ?
> qq|'$form->{datepaid}'| :
> > > 'NULL';
> > >
> > > <snip>
> > > # check to see if we have had a variable posted from the form
> > >  if ($form->{invnumber}){
> > >         $currentid = $form->{'invnumber'};
> > >  } else {
> > >    # get the current invoice number
> > >     $query = qq|SELECT invnumber from defaults|;
> > >     $sth = $dbh->prepare($query);
> > >     $sth->execute || $form->dberror($query);
> > >     ($currentid) = $sth->fetchrow_array;
> > >     $sth->finish;
> > >
> > >    # Add 1 to the defaults invnumber id
> > >     $currentid++;
> > >  }
> > >
> > >   $query = qq|UPDATE ar set
> > >               invnumber = '$currentid',
> > >               ordnumber = '$form->{ordnumber}',
> > >               transdate = '$form->{transdate}',
> > >               customer_id = $form->{customer_id},
> > >               taxincluded = '$form->{taxincluded}',
> > >               amount = $form->{invtotal},
> > >               duedate = '$form->{duedate}',
> > >               paid = $form->{invpaid},
> > >               datepaid = $datepaid,
> > >               netamount = $form->{amount},
> > >               curr = '$form->{currency}',
> > >               notes = '$form->{notes}'
> > >               WHERE id = $form->{id}|;
> > >   $dbh->do($query) || $form->dberror($query);
> > >
> > >  # put the new invoice number back, split because I want to
> make
> > > sure the
> > > above query completes.
> > >  if (!$form->{'invnumber'}){
> > >   $query = qq|UPDATE defaults set
> > >               invnumber = '$currentid'
> > >              |;
> > >   $dbh->do($query) || $form->dberror($query);
> > >  }
> > > </snip>
> > >
> > > The next line should read:
> > >
> > >   # amount for AR account
> > > ...
> > >
> > > Also in ar.pl around line 638 hash out the error warning, else
> you
> > > will not
> > > be able to post. The error is handled by the above routine so
> this
> > > line is
> > > no longer needed.
> > >
> > > <snip>
> > >   #$form->isblank("invnumber", $locale->text('Invoice Number
> > > missing!'));
> > > </snip>
> > >
> > > I hope this makes sense and is useful.
> > >
> > > Tim A Hall-Woodcock
> > >
> > > ----- Original Message -----
> > > From: "David A. Bandel" <david@xxxxxxxxxxx>
> > > To: <sql-ledger-users@xxxxxxxxxxxxxx>
> > > Sent: Monday, April 28, 2003 9:21 PM
> > > Subject: [SL] Re: Invoice Number not in sequence
> > >
> > >
> > > > On Mon, 28 Apr 2003 13:04:18 -0700
> > > > "Tim T. Lai" <lai@xxxxxxxxxxxxxxxx> wrote:
> > > >
> > > > > it seems like a good solution.
> > > > >
> > > > > under you suggested solution what about if the print botton
> > > would also
> > > > >
> > > > > do an automatic post prior to printing? in fact, wouldn't it
> not
> > > have
> > > > > an invoice number on the printed invoice have it not been
> > > posted?
> > > > >
> > > >
> > > > This is what I was actually asking for originally, a "Post &
> > > Print" vice
> > > > Print option.  However, that is only a partial solution
> because
> > > you can
> > > > start to work up an invoice (which under the current system
> has a
> > > > number), change your mind (or be interrupted by the boss), go
> to
> > > > something else, and find you can't come back to where you
> were, so
> > > the
> > > > invoice number is lost.
> > > >
> > > > I don't worry about printing an invoice without an invoice
> number
> > > (in
> > > > fact, it should say VOID rather than have a number).  I only
> worry
> > > about
> > > > printing an invoice that has a number but isn't in the
> accounting
> > > system
> > > > (especially if the auditors find it in the trash).
> > > >
> > > > So the real solution is to only pick up an invoice number
> when
> > > the
> > > > invoice is posted, not before (and anything w/o an invoice
> number
> > > would
> > > > say VOID).  I can print VOIDs all day long.  No harm done.
> > > >
> > > > I'd say let's wait for Deiter to digest all this and weigh
> in.
> > > >
> > > > Ciao,
> > > >
> > > > David A. Bandel
> > > > --
> > > > Focus on the dream, not the competition.
> > > > Nemesis Racing Team motto
> > > >
> > > >
> > > > -- Attached file included as plaintext by Ecartis --
> > > >
> > > > -----BEGIN PGP SIGNATURE-----
> > > > Version: GnuPG v1.2.1 (GNU/Linux)
> > > >
> > > >
> iD8DBQE+rY1Lj31PLQNUbV4RAlFBAJ0b0JQXsc/KW2wrnD02vztPOJZ9uACeIhO9
> > > > jqoYNopmgCQw9Qg1jKLBc7A=
> > > > =tUSO
> > > > -----END PGP SIGNATURE-----
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
> >
> 
> 
> 
> 

Other related posts: