473,422 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,422 software developers and data experts.

Single item inventory?

Hi,
Stupid question, but here goes.

Someone wants me to design a database to keep track of fuel deliveries
and orders/shipments. Essentially, he'll purchase fuel from some
supplier and then resell it. I'm assuming this is a generic product, so
I would have something like a debit/credit system. Deliveries increase
stock and decrease cash, and sales do the opposite. So is this as
simple as,,,

tblStockChange
----------------------
TransactionID
TransactionType (Purchase/Sale/WriteOff) --- writeoff for lost fuel or
something like that(?)
TransactionDate
FuelAmount
PricePerUnit
ClientID

Or would it be better to have one table for sales and another for
purchases? (Probably so).
If I did that, how would I get a running total of fuel on hand by date?
(see Allen's website for his QuantityOnHand demo?) Thinking about it,
I should probably just make the Sales and Purchases tables union
compatible and then do something like a report doing a running total of
the union query. Of course, I'd have to multiply stock by -1 for
outflows.

Am I on the right track or completely clueless?
(Umm... we don't know... what have you tried so far? has it worked? If
not, what's not working that you expect to be? Where's your code? Your
report design?)

thanks,
Pieter

Nov 30 '05 #1
14 1679
rkc
pi********@hotmail.com wrote:

<snip>
Am I on the right track or completely clueless?
(Umm... we don't know... what have you tried so far? has it worked? If
not, what's not working that you expect to be? Where's your code? Your
report design?)


I think where's your report design is the right question to ask. I don't
know how you can possibly know what data you need to store or in what
form you need to store it if someone hasn't thought about what you need
to see on a page as an end result.
Nov 30 '05 #2
I can't see any reason to have separate tables for sales and purchases. With
what you've said, the fields will be pretty much the same for both, so there
won't be any wasted space or anything. It seems a lot easier to separate the
data with queries than to put together different tables.
my 2 cents
<pi********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi,
Stupid question, but here goes.

Someone wants me to design a database to keep track of fuel deliveries
and orders/shipments. Essentially, he'll purchase fuel from some
supplier and then resell it. I'm assuming this is a generic product, so
I would have something like a debit/credit system. Deliveries increase
stock and decrease cash, and sales do the opposite. So is this as
simple as,,,

tblStockChange
----------------------
TransactionID
TransactionType (Purchase/Sale/WriteOff) --- writeoff for lost fuel or
something like that(?)
TransactionDate
FuelAmount
PricePerUnit
ClientID

Or would it be better to have one table for sales and another for
purchases? (Probably so).
If I did that, how would I get a running total of fuel on hand by date?
(see Allen's website for his QuantityOnHand demo?) Thinking about it,
I should probably just make the Sales and Purchases tables union
compatible and then do something like a report doing a running total of
the union query. Of course, I'd have to multiply stock by -1 for
outflows.

Am I on the right track or completely clueless?
(Umm... we don't know... what have you tried so far? has it worked? If
not, what's not working that you expect to be? Where's your code? Your
report design?)

thanks,
Pieter

Nov 30 '05 #3
that's what I was thinking. Then I'd have a report that did a running
sum, which would tell me the balance in my cash account and in my fuel
"account".

Nov 30 '05 #4
Pieter,

I used to work for a large oil company. You say single item inventory; are
you sure??

Look at a gas station. There are usually three different octane gasolines.
Each is a different product. Then there is Kerosene and it comes in
different grades. There is Diesel Fuel for the big trucks in different
grades and there is home heating oil in different grades. There is aviation
fuel and the list goes on. Just suggesting that maybe you do not have a
single item inventory after all.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

Over 1000 Access users have come to me for help. My fees are very
reasonable.

<pi********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi,
Stupid question, but here goes.

Someone wants me to design a database to keep track of fuel deliveries
and orders/shipments. Essentially, he'll purchase fuel from some
supplier and then resell it. I'm assuming this is a generic product, so
I would have something like a debit/credit system. Deliveries increase
stock and decrease cash, and sales do the opposite. So is this as
simple as,,,

tblStockChange
----------------------
TransactionID
TransactionType (Purchase/Sale/WriteOff) --- writeoff for lost fuel or
something like that(?)
TransactionDate
FuelAmount
PricePerUnit
ClientID

Or would it be better to have one table for sales and another for
purchases? (Probably so).
If I did that, how would I get a running total of fuel on hand by date?
(see Allen's website for his QuantityOnHand demo?) Thinking about it,
I should probably just make the Sales and Purchases tables union
compatible and then do something like a report doing a running total of
the union query. Of course, I'd have to multiply stock by -1 for
outflows.

Am I on the right track or completely clueless?
(Umm... we don't know... what have you tried so far? has it worked? If
not, what's not working that you expect to be? Where's your code? Your
report design?)

thanks,
Pieter

Nov 30 '05 #5
Good point. But then the design would just become more like a normal
DB.

The more I think about it, the more I think I should make separate
"sale" and "purchase" tables and just make them union-compatible. Then
in the query, just do the math to adjust the sales to be "plus cash,
minus fuel" and the purchases to be the reverse. Then I need to just
add a field for fuel type, because as you say, diesel fuel and airplane
fuel are not interchangeable.

Bear with me - I'm still teasing the complexity of this thing out. So
this represents my somewhat simple understanding of the whole thing.

Maybe I'm better off splitting the two tables and then I can have
normal "Supplier" and "Customer" tables and their related "Purchase
Order" and "Invoice" tables. Then everything follows a pretty much
standard design.

Purchased [X] qty/volume of [product] on [date] from [vendor] at
[price]

Sold [X] qty/volume of [product] on [date] to [Customer] at [price]

Then as long as my tables are reasonably union compatible, I can get a
normal running sum.

Thanks for the input!
Pieter

Nov 30 '05 #6

"PC Datasheet" <no****@nospam.spam> schreef in bericht news:u_**************@newsread3.news.atl.earthlink .net...
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

Over 1000 Access users have come to me for help. My fees are very
reasonable.


Steve is a notorious job hunter here, always trying to sell his services.
But before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R
Nov 30 '05 #7
Why don't you take Salad's advise and grow up and get a life and quit
sending emails to my office.

"If you have anything to contribute to the group, contribute. Your war
with Datasheet is simply pissing and moaning in the wind for the sake of
nothing. Grow up and get a life."

Salad

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

Over 1000 Access users have come to me for help. My fees are very
reasonable.

"StopThisAdvertising" <StopThisAdvertising@DataShit> wrote in message
news:43**********************@text.nova.planet.nl. ..

"PC Datasheet" <no****@nospam.spam> schreef in bericht
news:u_**************@newsread3.news.atl.earthlink .net...
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

Over 1000 Access users have come to me for help. My fees are very
reasonable.


Steve is a notorious job hunter here, always trying to sell his services.
But before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R
Nov 30 '05 #8
get ready for the storm
"PC Datasheet" <no****@nospam.spam> wrote in message
news:jO****************@newsread3.news.atl.earthli nk.net...
Nov 30 '05 #9
pi********@hotmail.com wrote:
The more I think about it, the more I think I should make separate
"sale" and "purchase" tables and just make them union-compatible. Then


I wouldn't. The question is, what is the data entity here? It's the
inventory. As Steve says, that inventory is not likely one item, but
regardless, whether or not it is one generic fuel or various types, the
nature of the types of inventory has no real bearing on the nature of
the data entity you're considering.

A sale takes from the inventory, a purchase adds to the inventory, ie,
they are both the same, just one positive, the other negative.

I think it's silly to have two separate tables for this and I'm
perplexed why someone like you who has contributed a lot to the group
would even consider it. 8) Maybe this is a new area for you? Perhaps
there's more to it than I see?

One table to rule them all, one table to find them... etc, etc.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 30 '05 #10
pi********@hotmail.com wrote in
news:11*********************@f14g2000cwb.googlegro ups.com:
Good point. But then the design would just become more like a
normal DB.

The more I think about it, the more I think I should make
separate "sale" and "purchase" tables and just make them
union-compatible. Then in the query, just do the math to
adjust the sales to be "plus cash, minus fuel" and the
purchases to be the reverse. Then I need to just add a field
for fuel type, because as you say, diesel fuel and airplane
fuel are not interchangeable.

Bear with me - I'm still teasing the complexity of this thing
out. So this represents my somewhat simple understanding of
the whole thing.

Maybe I'm better off splitting the two tables and then I can
have normal "Supplier" and "Customer" tables and their related
"Purchase Order" and "Invoice" tables. Then everything
follows a pretty much standard design.

No, I've been doing inventory transaction databases since the
1970s. your original concept of a single table for incoming and
outgoing transactions will prove much more flexible in the long
run. All you need if you have to handle multipler items is add
one field, ( a foreign key to the items definitions tables)
Then as long as my tables are reasonably union compatible, I
can get a normal running sum.
Where do you put your stock adjustments (returns, spillage,
etc)? It becomes much harder to track true current inventory
with separate tables..
Thanks for the input!
Pieter

--
Bob Quintal

PA is y I've altered my email address.
Dec 1 '05 #11
Tim,
here's the _full_ story. Don't ask me about the biz rules - just doing
what I'm told!

There's a small twist to this fuel reseller thing.
Customer purchases coupons (which are redeemed for fuel). In the
"invoice", he specifies a proxy to pick up the fuel. So it's not a
pure purchase/resale thing. What the person who asked for this said
was this:

It's basically to get around corruption in an African country. Person
outside the country buys the coupons (which the recipient/proxy picks
up). The proxy then receives the coupons and can redeem them for fuel.
So the process is something like

1. Company buys fuel shipment.
2. Company issues coupons for sale.
3. Customers outside the country purchase the coupons, specifying a 3rd
party to pick up the coupons.
4. 3rd party then uses the coupons to "purchase" fuel. (Essentially,
the money is converted into coupons and then is spent like money.)

So my guess is this most closely models a gift certificate scenario -
except we're trading fuel.

Okay, so I have a purchase and sale of fuel - no problem. The
weirdness is the intermediate coupon thing. That's what the
intermediate mess was about. Otherwise, it's like a simple account
(Bulk Fuel In, Money Out), (Parcel Fuel Out, Money In). In my case,
though, it's:

Step 1: (Bulk Fuel In, Coupons "Created"),
Step 2: (Coupons Sold, Money In),
Step 3: (Coupons Redeemed, Parcel Fuel Out).

Okay, so the question now is this -
how do I manage the conversion between fuel and coupons? (Sorry, Tim,
blonde moment...)
the rest is just

tblTransaction(
TransactionType Text(1) [P]urchase, [S]ale
Transaction Date,
Volume,
TotalPrice)

Then I'd just query the table to make all sale transactions be
"negative" volumes, and purchases be "negative" sales. So far so good.
But what about the coupons? that's the part I'm having the trouble
with. Essentially, each coupon is supposed to represent some fixed
amount of fuel.

Say I have one table for the movement of fuel (sale/purchase). How do
I store info about Vendors and Customers? I could store them both in
the same field, but then how do I figure out which one I'm relating to?

I guess I'll go play with this idea and see where I get. (Stay off the
sidewalk everybody, I'm driving!)

Thanks for the help!
Pieter

Dec 3 '05 #12
Bob,
The transaction part of this database dealing with the fuel is pretty
easy. I put down the crack and it all works great. (Notice to kids -
just say no, or you could end up like me... and you don't want that!)
The part I'm not sure how to deal with is the coupon issue. The
*business* plan is to sell coupons that will be redeemed for fuel. So
the process is:

1. Buy Fuel (+Fuel, -Cash)
2. Sell coupons ( -Coupons (proxy for fuel), +Cash)
3. Redeem coupons ( +Coupons (cancelled), -Fuel)

The problem I'm having trouble with is the Coupons<-->Fuel part. Right
now I'm planning on creating coupons in the AfterInsert event a
FuelPurchase. (that works, although I'm not sure the approach is OK)

So how do I handle the coupon problem?

I guess the whole story might help a little...
Purchaser will buy coupons for fuel online. He will designate a
delegate to pick up the fuel. The delegate will present identification
and pick up the coupon book(s). He can then presnet them at a fuel
station and redeem the coupons for fuel. If this were just fuel for
money, then this would be easier. How do I deal with the coupons
wrinkle?

Thanks!
Pieter

Dec 3 '05 #13
pi********@hotmail.com wrote in
news:11**********************@g49g2000cwa.googlegr oups.com:
Bob,
The transaction part of this database dealing with the fuel is
pretty easy. I put down the crack and it all works great.
(Notice to kids - just say no, or you could end up like me...
and you don't want that!) The part I'm not sure how to deal
with is the coupon issue. The *business* plan is to sell
coupons that will be redeemed for fuel. So the process is:

1. Buy Fuel (+Fuel, -Cash)
2. Sell coupons ( -Coupons (proxy for fuel), +Cash)
3. Redeem coupons ( +Coupons (cancelled), -Fuel)

The problem I'm having trouble with is the Coupons<-->Fuel
part. Right now I'm planning on creating coupons in the
AfterInsert event a FuelPurchase. (that works, although I'm
not sure the approach is OK)

So how do I handle the coupon problem?

I guess the whole story might help a little...
Purchaser will buy coupons for fuel online. He will designate
a delegate to pick up the fuel. The delegate will present
identification and pick up the coupon book(s). He can then
presnet them at a fuel station and redeem the coupons for
fuel. If this were just fuel for money, then this would be
easier. How do I deal with the coupons wrinkle?

Thanks!
Pieter

Really, you are dealing with two articles in inventory:
fuel and coupons
1. Buy Fuel (+Fuel, -Cash)
2. Sell coupons ( -Coupons (proxy for fuel), +Cash)
3. Redeem coupons ( +Coupons (cancelled), -Cash equivalent )
4. Pump Gas (-Fuel, +cash equivalent)

so you'll need two inventory transactions when someone exchanges
coupons for fuel.
--
Bob Quintal

PA is y I've altered my email address.
Dec 3 '05 #14
Thanks, Bob. As I said, I _knew_ I was missing something! Now it
makes sense... now to see if I can't get the model to work.

Pieter

Dec 3 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Zhang Le | last post by:
Hello, Is there a quick way to replace the content of a single item in tkinter's listbox? Currently my solution is to first delete the item, then insert a new item at the same position. I think...
12
by: Dennis Plöger | last post by:
Hi all! I'm currently having some problems parsing a char array in c++. (And yes, I'm a half-newbie ;-)) Perhaps you can help me with this: #include <iostream> using std::cout; void...
7
by: Bob | last post by:
I've done this before, but can't find the simple code that allows this. I have a multiple item drop down created in a form with FrontPage 2002. I want to highlight or bold selected items, but...
2
by: Gary Brown | last post by:
Hi, I am populating a sorted listbox. If there is a single item it is not displayed. Set the "sorted" property to false and the item shows. Is this a bug or an obscure feature? Is there a...
0
by: Steve Teeples | last post by:
I have a sorted listbox. When just one item is in the collection the item will not appear in my displayed list. If I remove the sort option then the item is displayed correctly. If I have...
1
by: TPK | last post by:
Here is what I want to do with javascript. On a page with text place a javascript link that: 1) When a user clicks the link (onClick) a new browser window opens (the easy part) NewWindow =...
5
by: yancheng.cheok | last post by:
hello, may i know how i can determine whether a pointer is pointing to an array or a single item during runtime? this is because in certain situation, i need to determine whether to use delete...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.