[Vtigercrm-developers] Changing invoice numbers

Enrico Weigelt weigelt at metux.de
Fri May 11 08:22:25 PDT 2007


* Jens Hamisch <jens at Strawberry.COM> schrieb:

Hi,

> originally the invoice number was just the CRMEntity ID.
> As it is for any other entity like quotes, so, ...
> But: hasn't there been a recent change on that (just invoices)?

Ah, I see: The invoice ID is actually an pointer for schema 
internal references. 

And that's the source of the problem: internal references 
should always base on internal object IDs, never on user-
visible idents/names.

> What about a generic solution to that issue, too?
> I was already thinking about introducing "ranges of numbers",
> a table that defines the format of particular numbers, like
> invoice-numbers, product-numbers etc.

Ugh, no. Not for the object references. For such things we 
have sequences, which produce OIDs (which are in fact just
unique numbers). 

Many things which an user would call "number" are names, 
not numbers. So ie. for invoice numbers: they're not object
ID's, but names. Of course names, which follow certain rules,
ie. for automatic allocation, but from the schema's view 
they're just opaque names, strings, text.

> Especially for invoices we need some automatism. Some govern-
> ments - Germany !!! - forces companies to provide an determi-
> nistic numbering scheme for invoices. So this field cannot be
> assigned manually to each invoice.

Leave this to the user/admin. 

It should be clear that the "invoice_no" field cannot be an 
object id. So the first step is to introduce an separate oid 
field (fed by some sequence) and let *all* references point on 
that field. From now on let's call the old invoice_no field
an invoice ident. The second step is to implement an customizable
scheme for autmatic invoice ident allocation. Maybe put this
into an separate class, which can be easily adoped to user's
needs. 

Whether some crm user should be allowed to change the invoice
idents is just an permission issue.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact at metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------



More information about the vtigercrm-developers mailing list