Ken Mayer [dBVIPS]
2008-12-06 00:55:53 UTC
I'm working with a client who has an issue with a subsystem in the
application I've been working with him on.
The subsystem is the stock order system, and more specifically the End
of Day stock orders.
End of Day is actually 2:00pm, because the biggest supplier for his firm
needs the orders at that point to expedite shipments, etc.
The problem is that the code that generates the End of Day stock report
(currently) just looks at the date of the quotes (items customers have
ordered but not paid for ...).
After 2, more orders typically come in. However, the "End of Day" report
has been completed.
The next day, they want to be able to generate an "End of Day" stock
report that includes items from the previous day that were ordered after
2. However, I cannot just base this on a timestamp, because of course
people are people, and things happen, and while 2:00 pm is the *stated*
time, I can't imagine that some days the report doesn't get run at 2:15,
or 2:30, etc.
So, here's what I'm *considering* doing, but I'd love to hear if someone
has a better idea:
When the end of day report is done (which copies some fields for the
items needed for ordering to a specific table used for the report, which
includes the Quote Number for reference):
* Copy that table to a "backup" table.
* The next day, empty the current "End of Day" table (which is what
is being done now);
* Look at the quotes for the PREVIOUS day, and see if they are in
the "backup" copy of the table -- if they are, skip them and move on ...
* If they are not, process them like usual (copy to the End of Day
table), and of course then process everything for today (up to 2, or the
time at which the report is being generated).
* When done, overwrite the "backup" table with the current stock
orders, and ... we're done.
* Repeat the next day ...
I haven't started to write this (well, modify the existing code), but as
noted, I thought I'd see if this sounds like an optimal way of handling
it, or do you have a better idea? I am willing to entertain ideas, even
if I don't use 'em, it's a learning process (I've been doing this for
many years and am always learning new things).
Thanks in advance for your thoughts ...
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
application I've been working with him on.
The subsystem is the stock order system, and more specifically the End
of Day stock orders.
End of Day is actually 2:00pm, because the biggest supplier for his firm
needs the orders at that point to expedite shipments, etc.
The problem is that the code that generates the End of Day stock report
(currently) just looks at the date of the quotes (items customers have
ordered but not paid for ...).
After 2, more orders typically come in. However, the "End of Day" report
has been completed.
The next day, they want to be able to generate an "End of Day" stock
report that includes items from the previous day that were ordered after
2. However, I cannot just base this on a timestamp, because of course
people are people, and things happen, and while 2:00 pm is the *stated*
time, I can't imagine that some days the report doesn't get run at 2:15,
or 2:30, etc.
So, here's what I'm *considering* doing, but I'd love to hear if someone
has a better idea:
When the end of day report is done (which copies some fields for the
items needed for ordering to a specific table used for the report, which
includes the Quote Number for reference):
* Copy that table to a "backup" table.
* The next day, empty the current "End of Day" table (which is what
is being done now);
* Look at the quotes for the PREVIOUS day, and see if they are in
the "backup" copy of the table -- if they are, skip them and move on ...
* If they are not, process them like usual (copy to the End of Day
table), and of course then process everything for today (up to 2, or the
time at which the report is being generated).
* When done, overwrite the "backup" table with the current stock
orders, and ... we're done.
* Repeat the next day ...
I haven't started to write this (well, modify the existing code), but as
noted, I thought I'd see if this sounds like an optimal way of handling
it, or do you have a better idea? I am willing to entertain ideas, even
if I don't use 'em, it's a learning process (I've been doing this for
many years and am always learning new things).
Thanks in advance for your thoughts ...
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase