Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2008
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Developing Inventory Software with (Assembleable) Pieces having problems

    Here is my issue (STORY BELOW, and update of where I am)

    I have the basics of this system programmed, but now I need to worry about assembled pieces.

    i.e. (Product AAAA, is made up of 1 BBBB, 1 CCCC, and 4 DDDD's)

    When shipping my items I want to pull these values from the database because they always go out assembled. What is the best way to do this?

    I have only 1 vendor programmed into my database for testing, there will probably be 30 when I am done.



    I can give you my whole code so far, and help would be appreciated.


    message me or email me mnewbegin (at) gmail.com

    Story: and Info

    I have been developing Inventory Software:


    So far have these functions done.

    - Login System (including email / password(md5), system with captcha registration validation and country chooser
    - Add Products (basic 4-5 inputs to update records in database)
    - Edit Products (edit those 4-5 inputs in the database)



    In Development, lost on some parts of this

    - Updating stock counts when same product gets more items shipped in.
    - Moving products out of products table into shipped table, once billed
    - Generating Invoices from shipped table.

  • #2
    Regular Coder
    Join Date
    Aug 2008
    Location
    Northern Ireland
    Posts
    167
    Thanks
    12
    Thanked 6 Times in 6 Posts
    The first thing that came to my mind was a case statement.

    PHP Code:
    switch($product)
    {
    case 
    "AAAA"#remove items from Db
    break;

    default: 
    #do nothing
    break;

    The other way would be to use an Object Orientated Approve, where each product is a class that is made up of the seperate items. This is probably the more elegant solution but depending on how you have coded the rest of your solution this may be a little pointless.

  • #3
    New Coder
    Join Date
    Nov 2008
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I'm at a loss at even how to handle these.


    - All items are in inventory so there is a set number for each thing.


    What I don't understand is how to associate a part when removed to check for the other parts that it needs to be assembled with.


    So .


    Prompt 1: Is the piece AAAA you chose being assembled,

    Prompt 2: Y / N (Y choosen) then it shows this to screen.

    Prompt 3: Item AAAA uses the following parts

    1 BBBB
    1 CCCC
    4 DDDD

    How many assembled items are being shipped


    Prompt 4: 50 (50 typed into box)

    [SUBMIT]


    -------------------------------
    page that loads saying complete:

    Completed adding items to order

    50 BBBB
    50 CCCC
    200 DDDD

    ----------------------------------


    Is how I was going to structure it.



    so it looks like a while or do while loop, and then it send the variables to mysql statement to remove that many from inventory?
    Last edited by mnewbegin; 11-13-2008 at 06:46 PM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •