Results 1 to 4 of 4

Thread: Stock system

  1. #1
    Join Date
    Nov 2012
    Posts
    23

    Unanswered: Stock system

    Hi - latest project needs to be able to deal with stock items, maintaining stock records and invoicing.

    The problem I have is that when invoicing the stock items are entered via a M2M field with the stock record - therefore I can only have one M2M field on the invoice which is linked to the stock records. Is there any way round this so that I can have more than one M2M linked to the same stock record.

    has any already developed a good stock system?

    many thanks
    Paul

  2. #2
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi Paul.
    What I've done for one company was to create a “Shopping Cart” with in the program.

    Basically, one folder would contain all the stock the company had. The form would have detailed information like unit price and so on.

    When a customer places an order, you would select the items from your stock the customer wanted and then press a button “Add to Cart”.

    This button would then clone the items you selected and move them to the shopping cart folder, while also decreasing the stock levels by the amount ordered by the customer.

    Now you would go to your Invoice folder and press “Create new Invoice”.
    This form would then be populated by the items in the shopping cart, not your stock folder.

    This way you don't need more than one many to many, but if you do it doesn't matter as the relation is between the actual items in the shopping cart and not your stock.

    Regards
    James

  3. #3
    Join Date
    Nov 2012
    Posts
    23
    Thanks James - food for thought, but a couple of questions

    1. The quantity ordered by the customer is this entered on the "Product" form or the "cart" form?

    2. I'm ok with the coding to transfer the information for the first item to the "cart" form but can't work out how the same code/button will work to add a 2nd / 3rd/ 4th etc items to the cart.

    thanks
    Paul

  4. #4
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi Paul.
    Both questions kind of fall under the same answer.

    You go to your Stock Items folder, and you select the item the custom wants to order. You press the “Add to Cart” button and the following script will run...

    Start....
    A “User Input” window pops up asking how many do you want to order.
    You enter a value.
    This value you enter is then populated into a variable called “amount”.
    Another variable called “trace” is populated with the current record ID.
    The record is cloned and the field amount is populated by the variable amount.
    The record is moved to the Shopping Cart folder.
    The Select Folder action brings you back to the Stock Items folder.
    The Select Record action uses the variable “trace” to find and select the original stock item.
    The variable amount is taken away from the current stock amount.
    End.....

    So you would select other items the customer might want, each time the script above runs.

    When the customer is finished order, you go to your invoice folder, create an invoice and populate it's many to many with the contents the customer ordered which are in the shopping cart.

    That's how I wrote the program originally for the company and they used that system for years. As they got bigger they wanted to save some time and have the shopping cart auto populated into the invoice.

    I can explain how to do that, but it's not easy as you have to write a trace system that tracks all orders placed between the time you created the last invoice vs the current system time.

    Regards
    James

Posting Permissions

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