Basic inventory control

Status
Not open for further replies.

jeanl

Member
Hello

I need to create a basic inventory control application. I think I will need three lists. One for all the inventory/stock items, one for purchases (to add stock to the existing stock levels) and one for stock issues (to deduct from existing stock levels).

Can anyone assist me with the basic calculations for this? Any assistance will be appreciated.
 
I recently discussed something very similar with @prophoto. If you look through his posting history, you should find that discussion. It was within the last few weeks.

-- hugh
 
Here it is ...

http://fabrikar.com/forums/index.php?threads/update-field-in-another-table.44953/#post-231353

The take-away from that it, rather than trying to maintain a running total by taking the amount ordered in the purchase form and taking it away from a running total in the stock table, is to generate the stock total from scratch on each transaction, by summing all purchases and restocking of that item, and taking total purchases from total restocks. This avoids all the potential gotchas, like editing a purchase order and changing the amount, or some server error happening and your code doesn't run right one one purchase submission.

So run PHP form submission scripts onAfterProcess on your purchase and issue forms (so the purchase / issue row has been written out to the table) and updating the stock levels with your own queries.

(Note that I think in that thread we're using the term 'purchase' the other way round to you ... in his case, a purchase removes from stock and a restock adds to it, you are talking about a purchase adding to stock and an issue taking away).

-- hugh
 
Here it is ...

http://fabrikar.com/forums/index.php?threads/update-field-in-another-table.44953/#post-231353

The take-away from that it, rather than trying to maintain a running total by taking the amount ordered in the purchase form and taking it away from a running total in the stock table, is to generate the stock total from scratch on each transaction, by summing all purchases and restocking of that item, and taking total purchases from total restocks. This avoids all the potential gotchas, like editing a purchase order and changing the amount, or some server error happening and your code doesn't run right one one purchase submission.

So run PHP form submission scripts onAfterProcess on your purchase and issue forms (so the purchase / issue row has been written out to the table) and updating the stock levels with your own queries.

(Note that I think in that thread we're using the term 'purchase' the other way round to you ... in his case, a purchase removes from stock and a restock adds to it, you are talking about a purchase adding to stock and an issue taking away).

-- hugh


Hugh

Thank you so much. I really appreciate this info. I will go through it and try and make it work.

Jean


Sent from my iPhone using Tapatalk
 
Hugh

I created the three tables where:
table 1 = Stock
table 2 = Purchases (incoming stock) - dbjoin to table 1
table 3 = Stock Issues (outgoing stock) - dbjoin to table 1

I just want to ask if I use the "pseudo" code you mentioned in the above link is placed in table 2 and table 3, with one adding stock to table 2 and one reducing stock? Also, I assume the "pseudo" code is not in the actual correct format. Can anyone help me to understand in what format it should be?

Thanks in advance,

Jean
 
Last edited:
I can't really offer any more help in Community. This is Pro sub / billable custom coding level stuff.

But yes, you'll need a PHP plugin on the forms for 2 and 3. And no, "pseudo code" is not real code. It's just showing the logic you need to implement in the real code.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top