[ic] A few Interchange queries

marty interchange-users@icdevgroup.org
Sun Jan 19 22:39:00 2003


On Sun, 2003-01-19 at 16:06, Kai and Sally Berberich wrote:
> Hi,
> 
> I am in the process of finding out more about Interchange, and after having
> played with the demo store for a while I have a couple of queries.
> 
> A) Is it possible to build some automation into the order numbering system ?
> What I mean by this is that the in the demo store, the order number appears
> to be a simple iterator of whatever number code is entered. I want to set
> the order number up so that it is a combination of date AND iterator ie at
> the start of each day, the order number is set to the current date plus the
> number 1 eg the first order today would be "20030120-1" - then this number
> is incremented throughout the day until it is reset the next morning eg
> 20030121-1 tomorrow morning. Is this possible and if so - how can it be
> done.

Yep, it's possible.  As is usual with ic, there are many ways to do it. 
You could modify etc/log_transaction and perhaps put in some logic
there.  If it was me, I think I would write a cron job and have it run
at midnight each night and update /etc/order.number with the proper
string. That's a bit risky if you have a busy catalog however.   But if
you did it that way you could do something like echo #COUNTER-1.0\n`date
+%Y%m%d` > /path/order.number

(not tested)

Avoid the hyphen if you can.  The code field in the orderline table will
be the order number seperated by a hyphen and then the line item
number.  It you use a hyphen in your order number, it will make your
queries that much more complicated.

> 
> B) The demo system has a number of lookup tables that bear no relevance to
> my business eg the freight/shipping lookup tables. Is it possible to remove
> or alter these tables and/or create new ones ? Or is the existing table
> structure set in stone ?

Your best bet is to leave those tables just the way they are.  Otherwise
you may be breaking things and not even know it, then spending days and
days finding the problem.   It is usually ok to add a field to tables
(always add fields to the END of the table and reconfig the catalog
after any updates) and it is definitely ok to create your own tables.  

The table structure is definitely not set in stone, in fact, it can be
just about anything.  But unless you are absolutely certain that
removing a field or table will not have any affect on your catalog, your
best off to leave them in tact.  

>  
> Thanks in advance for your assistance with these queries and I look forward
> to your responses.
> 
> Regards
> Kai Berberich
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
-- 
marty <marty@sediva.com>