G
Guest
Hi folks!
I'm putting together some code that will price jobs based on a certain price
structure, but I am unsure if I have the concept totally nailed down. I just
thought I'd ask the big brains at this community for their opinions. Feel
free to let me know what you think...
WHAT I HAVE:
Currently, we have hundreds of customers, many of whom have their own
pricing structure (negotiated by management). Within that pricing structure,
jobs are priced by the process that the parts undergo and the size of the
part. Information about the parts is input into our database manually. The
size of the part is input into a single field using a format similar to this:
"2x4"; "36x24x36". Some of you may have read my posts asking for help with
this. Anyhow, I've got it to work for a single process for only one
customer. I can post the code, but let's leave that for later. Right now,
I'm just asking for conceptual guidance. Lets just assume that this will
work for all circumstances.
WHAT I NEED:
In a nutshell I need the code I currently have (with modifications, of
course) to work for all processes and for all customers.
MY CONCEPT:
Well, I've never worked on code so largescale before, so if anyone has any
tips to make it more managable, please let me know. This is sort of how I
envisioned it:
If [customer] = customer1 then
If [process code] = process code1 then
Select Case [Length]
Case Size1
[Price]=price1
Case Size2
[Price]=price2
Case Size3
[Price]=price3
End Select
If [Process Code] = Process Code2 Then... etc.
If [customer] = customer2 Then
If [process code] = process code1 then
...Different pricing structure...
....etc.
You can imagine that with hundreds of customers and with dozens of process
codes and about fifteen size ranges for each process code, this become quite
an undertaking (for me at least). The code becomes huge. I'm definately not
a wiz when it comes to coding (as I'm sure Stefan can attest) so this is
ambitous to say the least.
WHAT I'M ASKING
Does this coding structure make sense in theory? (Details to be worked out
later) How do you recommend that the errors be handled? Are there
techniques I can use to keep the code from becoming too unmanagable? Is
there a(n effective or useful) way I can break the pricing down by customer
using an event procedure to simplify and isolate my code? Heck, this is
academic at this point.. Just give me your thoughts, words of warning,
pearls of wisdom, critiques, musings, curses, etc. I'd appreciate the input.
Thanks in advance!
I'm putting together some code that will price jobs based on a certain price
structure, but I am unsure if I have the concept totally nailed down. I just
thought I'd ask the big brains at this community for their opinions. Feel
free to let me know what you think...
WHAT I HAVE:
Currently, we have hundreds of customers, many of whom have their own
pricing structure (negotiated by management). Within that pricing structure,
jobs are priced by the process that the parts undergo and the size of the
part. Information about the parts is input into our database manually. The
size of the part is input into a single field using a format similar to this:
"2x4"; "36x24x36". Some of you may have read my posts asking for help with
this. Anyhow, I've got it to work for a single process for only one
customer. I can post the code, but let's leave that for later. Right now,
I'm just asking for conceptual guidance. Lets just assume that this will
work for all circumstances.
WHAT I NEED:
In a nutshell I need the code I currently have (with modifications, of
course) to work for all processes and for all customers.
MY CONCEPT:
Well, I've never worked on code so largescale before, so if anyone has any
tips to make it more managable, please let me know. This is sort of how I
envisioned it:
If [customer] = customer1 then
If [process code] = process code1 then
Select Case [Length]
Case Size1
[Price]=price1
Case Size2
[Price]=price2
Case Size3
[Price]=price3
End Select
If [Process Code] = Process Code2 Then... etc.
If [customer] = customer2 Then
If [process code] = process code1 then
...Different pricing structure...
....etc.
You can imagine that with hundreds of customers and with dozens of process
codes and about fifteen size ranges for each process code, this become quite
an undertaking (for me at least). The code becomes huge. I'm definately not
a wiz when it comes to coding (as I'm sure Stefan can attest) so this is
ambitous to say the least.
WHAT I'M ASKING
Does this coding structure make sense in theory? (Details to be worked out
later) How do you recommend that the errors be handled? Are there
techniques I can use to keep the code from becoming too unmanagable? Is
there a(n effective or useful) way I can break the pricing down by customer
using an event procedure to simplify and isolate my code? Heck, this is
academic at this point.. Just give me your thoughts, words of warning,
pearls of wisdom, critiques, musings, curses, etc. I'd appreciate the input.
Thanks in advance!