473,666 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to handle a VERY flexible price structure

I've been given the task of building a database for a manufacturer's
representative. He basically imports product and resells it. He
currently has this spreadsheet that's fairly complex. (Either that or
I'm just plain stupid, because it took me 2 days to figure out how it
all worked!) Most of the sheet is simple and straightforward . Looks
a lot like a normal table in Access would, except there are formulas
thrown in everywhere.

In a section at the top of the sheet, there are costs associated with
the column below it that the user can modify. If I were to do this in
Access and I didn't need to store the results, I would just use
unbound text boxes and restrict the inputs to a valid range etc. and
then base the form on a query. There are problems with this approach,
though. In order to get a sale, there are several variables that the
user can adjust (think of doing this in Excel and it makes a lot more
sense) - manipulating various rates so that the final bid comes in to
the customer's liking.

A few examples - these are all defaults, but can be adjusted to make
the sale:
Gross Margin - 33%
Commission - 5%
Back End Points - 7%
Container cost 40' = $3500

(As my English teacher once said "Make a CASE, not a collage!") Okay,
to the fun stuff.

All of these expenses have to be recorded, because they'll eventually
become part of someone's final bill. What's the best way to deal with
this information? Set up fields in the Invoice, since they're applied
to the whole invoice, not to individual items,(at least as far as I
know)? Then if I store them there, I can calculate everything...
Okay, setting the defaults (so they work in a fashion similar to
Excel)... Store the defaults in a separate table or just in the form?
(maybe I'm just thinking way too hard!) Right now, my gut instinct is
to store them in the form to test things out, and then to maybe move
them to a table with a single record. then I could load the defaults
from the table, and the user could modify them later.

One KEY "rule" here is that once an invoice is billed, that's a final
price (so just store the calculated values because the business rule
trumps the database rule?)

And straight from the boss's mouth: Pretty much ANY cost can be
overridden. So just calculating as if the rules were hard and fast
(IOW in a simple query) won't really work.

Any thoughts? (Okay, you can snicker some, but try not to guffaw...)

And why not use QuickBooks Pro for Manufacturing? He already shot
that down.
He "only" needs it to do Invoices, Quotes, and Purchase Orders. And
he pays the bills, so I guess he's right no matter what.

Thanks!
Pieter

Feb 8 '07 #1
2 1550
pi********@hotm ail.com wrote:
I've been given the task of building a database for a manufacturer's
representative. He basically imports product and resells it. He
currently has this spreadsheet that's fairly complex. (Either that or
I'm just plain stupid, because it took me 2 days to figure out how it
all worked!) Most of the sheet is simple and straightforward . Looks
a lot like a normal table in Access would, except there are formulas
thrown in everywhere.

In a section at the top of the sheet, there are costs associated with
the column below it that the user can modify. If I were to do this in
Access and I didn't need to store the results, I would just use
unbound text boxes and restrict the inputs to a valid range etc. and
then base the form on a query. There are problems with this approach,
though. In order to get a sale, there are several variables that the
user can adjust (think of doing this in Excel and it makes a lot more
sense) - manipulating various rates so that the final bid comes in to
the customer's liking.

A few examples - these are all defaults, but can be adjusted to make
the sale:
Gross Margin - 33%
Commission - 5%
Back End Points - 7%
Container cost 40' = $3500

(As my English teacher once said "Make a CASE, not a collage!") Okay,
to the fun stuff.

All of these expenses have to be recorded, because they'll eventually
become part of someone's final bill. What's the best way to deal with
this information? Set up fields in the Invoice, since they're applied
to the whole invoice, not to individual items,(at least as far as I
know)? Then if I store them there, I can calculate everything...
Okay, setting the defaults (so they work in a fashion similar to
Excel)... Store the defaults in a separate table or just in the form?
(maybe I'm just thinking way too hard!) Right now, my gut instinct is
to store them in the form to test things out, and then to maybe move
them to a table with a single record. then I could load the defaults
from the table, and the user could modify them later.

One KEY "rule" here is that once an invoice is billed, that's a final
price (so just store the calculated values because the business rule
trumps the database rule?)

And straight from the boss's mouth: Pretty much ANY cost can be
overridden. So just calculating as if the rules were hard and fast
(IOW in a simple query) won't really work.

Any thoughts? (Okay, you can snicker some, but try not to guffaw...)

And why not use QuickBooks Pro for Manufacturing? He already shot
that down.
He "only" needs it to do Invoices, Quotes, and Purchase Orders. And
he pays the bills, so I guess he's right no matter what.

Thanks!
Pieter
I would consider having a table to hold the default values. That way
the person could update them without you updating the form.

If the values are for each separate invoice, I'd store the results in
the Invoice table or else a table that is linked to the invoice table by
the invoice id.

Since the values can be calced (via some formula) or overridden, you
need to have those "calced" fields be in some field.

You could put a button on the form to "recalc" the info.

If needed, you could have some sort of flag (like a checkbox) so that
overwritten values aren't recalced if a calc is performed.

I don't fully comprehend what problems you face, so consider this
slinging some mud and hoping something sticks.
Feb 9 '07 #2
On Feb 9, 1:35 am, salad <o...@vinegar.c omwrote:
pietlin...@hotm ail.com wrote:
I've been given the task of building a database for a manufacturer's
representative. He basically imports product and resells it. He
currently has this spreadsheet that's fairly complex. (Either that or
I'm just plain stupid, because it took me 2 days to figure out how it
all worked!) Most of the sheet is simple and straightforward . Looks
a lot like a normal table in Access would, except there are formulas
thrown in everywhere.
In a section at the top of the sheet, there are costs associated with
the column below it that the user can modify. If I were to do this in
Access and I didn't need to store the results, I would just use
unbound text boxes and restrict the inputs to a valid range etc. and
then base the form on a query. There are problems with this approach,
though. In order to get a sale, there are several variables that the
user can adjust (think of doing this in Excel and it makes a lot more
sense) - manipulating various rates so that the final bid comes in to
the customer's liking.
A few examples - these are all defaults, but can be adjusted to make
the sale:
Gross Margin - 33%
Commission - 5%
Back End Points - 7%
Container cost 40' = $3500
(As my English teacher once said "Make a CASE, not a collage!") Okay,
to the fun stuff.
All of these expenses have to be recorded, because they'll eventually
become part of someone's final bill. What's the best way to deal with
this information? Set up fields in the Invoice, since they're applied
to the whole invoice, not to individual items,(at least as far as I
know)? Then if I store them there, I can calculate everything...
Okay, setting the defaults (so they work in a fashion similar to
Excel)... Store the defaults in a separate table or just in the form?
(maybe I'm just thinking way too hard!) Right now, my gut instinct is
to store them in the form to test things out, and then to maybe move
them to a table with a single record. then I could load the defaults
from the table, and the user could modify them later.
One KEY "rule" here is that once an invoice is billed, that's a final
price (so just store the calculated values because the business rule
trumps the database rule?)
And straight from the boss's mouth: Pretty much ANY cost can be
overridden. So just calculating as if the rules were hard and fast
(IOW in a simple query) won't really work.
Any thoughts? (Okay, you can snicker some, but try not to guffaw...)
And why not use QuickBooks Pro for Manufacturing? He already shot
that down.
He "only" needs it to do Invoices, Quotes, and Purchase Orders. And
he pays the bills, so I guess he's right no matter what.
Thanks!
Pieter

I would consider having a table to hold the default values. That way
the person could update them without you updating the form.

If the values are for each separate invoice, I'd store the results in
the Invoice table or else a table that is linked to the invoice table by
the invoice id.

Since the values can be calced (via some formula) or overridden, you
need to have those "calced" fields be in some field.

You could put a button on the form to "recalc" the info.

If needed, you could have some sort of flag (like a checkbox) so that
overwritten values aren't recalced if a calc is performed.

I don't fully comprehend what problems you face, so consider this
slinging some mud and hoping something sticks.
Right now, sling all the mud you want!! Muddy thoughts are better
than no thoughts. At the moment, I'm thinking along the lines of
assuming (probably dangerous) that _some_ fields are going to be
purely calculated. And those that are flexible, I'll store. Then I
won't have to store around 70 fields of data that are superfluous...
Then once I have the data, I can use ADO to shove the data to a
template with named ranges/cells per Dev's article
CopyFromRecords et... now, with marble-like sharpness, I'm off to try
it...

Thanks for the feedback!

Pieter

Feb 10 '07 #3

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

Similar topics

2
2472
by: Zambo via SQLMonster.com | last post by:
Hi! We have Sql Server 2000 in our server (NT 4). Our database have now about +350.000 rows with information of images. Table have lot of columns including information about image name, keywords, location, price, color mode etc. So our database don?t include the images itself, just a path to the location of every image. Keywords -field have data for example like this: cat,animal,pet,home,child with pet,child. Now our search use Full-Text...
4
2462
by: atv | last post by:
Whatis the proper way to handle errors from function calls? For example, i normally have a main function, with calls to mine or c functions. Should i check for errors in the functions called themselves, or should i return a code to main and handle the error there? If i don't return them to main, except for the structure, what use is the main function except for calling functions?
10
6683
by: Adam Warner | last post by:
Hi all, With this structure that records the length of an array of pointers as its first member: struct array { ptrdiff_t length; void *ptr; };
2
10317
by: Christopher Benson-Manica | last post by:
Is the following program conforming under C99? #include <stdio.h> typedef struct foo { int bar; int baz; } foo; foo foos={
2
5726
by: Schorschi | last post by:
Can't seemd to get ReadFile API to work! Returns invalid handle error? =========================================================================== Ok, the visual basic gurus, help! The following is a diskette class (vb .net) that works find, in that I can validate a diskette is mounted, dismount it, lock it, unlock it, get diskette geometry, etc., all with a valid handle from CreateFile API! I can even position the file pointer,...
1
1686
by: Daniel | last post by:
does the windows file handle change? are file handles unique to the whole operating system or just the current directoy? if a file is opened then closed then opened again, does the file handle remain the same?
8
2464
by: ulyses | last post by:
I'm trying to put pointer to flexible array of structures in other structure. I want to have pointer to array of pixels in screen structure. Here is mine code, but I think it isn't quite all right: struct pixel { int x; int y; int color; };
20
1801
by: mechanicfem | last post by:
I thought (as they're in c99) that flexible arrays were there for a number of reasons - but I also thought they'd be great for stepping into structures (say) that were aligned in memory after (say) a header struct, e.g.: struct element { int a; int b; };
3
3885
by: Hallvard B Furuseth | last post by:
to find the required alignment of a struct, I've used #include <stddef.h> struct Align_helper { char dummy; struct S align; }; enum { S_alignment = offsetof(struct Align_helper, align) };
0
8443
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6192
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.