title: App for Repair Service, Database layout questions
body: <p>Need advice on setup of database for Service/parts/repair application. We have 3 types of orders. </p>
  
  <ol>
  <li>Parts only order - we order part, contact customer when it comes in and they pick it up</li>
  <li>Repair only - no parts needed only labor. We perform the repair, call them and they come pickup the item.</li>
  <li>Repair w/parts needed - We have to order the parts, wait for them to arrive and then do the work, contact customer and they pick it up.
  Technically, there could be a 4th type that includes all of the above on one order or any combination.</li>
  </ol>
  
  <p>We have no outside service work. Everything comes to us.</p>
  
  <p>Now whats the best way to setup the database.  Obviously, we'll have an order header, link to customer record, date opened, date completed, etc.  But it's the order details that we need advice on.</p>
  
  <p>In the order-detail record. I'm considering having all fields possible for each type of order with a flag on the record indicating which type it is.  My original idea was an order-detail table for parts and order-detail table for labor. This makes the coding and display of the order more complicated. The other problem with using two tables is which table gets the item that needs repair but also has to wait for parts?</p>
  
  <p>I'm trying to make sure we stay efficient not only in the coding but also performing the business side of the job.</p>
  
  <p>We need to know that a repair is past due or has been here for x number of days.
  We need to know that parts need to be ordered and haven't been for x number of days
  We need to know that if parts are on order and we are waiting that when it gets to 5 days waiting we flag that as well.</p>