Haha! 😃
I had a similar experience recently.
A project started out as "just adding worksheets to a database", as requested over the phone.
OK, I said - that'll cost about 1500USD, including db, scripts, design, tha works.
This is a elevator maintenance company, and the sheets was supposed to cover their maintenance orders, work hours and other maintenance costs.
When I saw the actual worksheet, the db just sprouted 15 tables :p
I: You can't have customerdata, work-hours and the financial stuff in same table as the orders.
Cust: No?
I: Sorry, no good. It's not sound structure.
Cust: OK.
So I raised the price to 5000 and started out, receiving exports from an accounting system they use.
Reading the umpthabyte exported textfile, I called the customer again.
I: Erm.. you have the customers and their elevators in the same table?
Cust: Yes?
I: Well, the field customer_name is covering both the erm.. customer name AND the elevator address? Or rather: the customer name OR the elevator address, as there seem to be a little of each...?
Cust: Yes?
I: Well, how am I (and mr. PHP) supposed to know which is which?
Cust: The chain_id.
I: The chain id?
Cust: Yes, the chain id, yes. You see, the whole secret is in the way the chain id is matched against the customer id: when the chain id is zero and the customer id is below 20000, the item is a customer, else the item is an elevator.
I: Oh? So then the field customer name is (sometimes) actually the elevator address, the field zip_code is actually the serialnumber of the elevator and the field customer_city is the description of which service-contract the elevator belongs to?
And the customer address is the description of previous errors?
Cust: Yes?
I: There is a small chance your invoice will be sent to the wrong customer, you know. Like:
Customer: Lexington Road 44, 3rd floor.
Address: Elevator stopped between floors, fixed with chewing gum
Zip: Thyssen TH-5444677-33
City: Contract 4445339
Cust: Never has been, so far.
I: Good for you, sir.
This is app. at the point where I am now, trying to make this work out 😉
Seems like it's gonna work, once I have identified some locking values.
knutm :-)