This patch is done in respect to the patch on https://sourceforge.net/tracker/?func=detail&aid=2780328&group_id=184070&atid=907783 ... It adds an additional table, OrderHistory, where each change to an item's quantity is logged, and other changes.
Details and notes:
- Added additional table, OrderHistory (for sqlite - but not MySQL!!!), where each change to an item's quantity is logged
- "Order History" view added, as well as single history entry view.
- History order entries are created whenever an item is being edited; they can be avoided by keeping both the order type and the description empty. There are no facilities to erase order history entries throgh the interface (at the moment, one has to delete them directly in the database)
- When editing the item's quantity, you can now either specify total items in inventory, or specify difference relative to current state - use negative numbers (-2) to indicate items removed from inventory, and positive numbers (2) to indicate items added to inventory, when specifying change in quantity. Both change and final quantity are save as part of orders history.
- Added facility for avoiding real deletion of items in the database - there is an additional ITM_Deletion column in the Item table (for sqlite - but not MySQL!!!), which is set to 1 if an item is deleted without real deletion, and subsequently it (or its history entries) are not shown. Real deletion can be controlled through the definitions in environment.php
- Use single words for order types as tags - there is a facility to sort according to them in Order History view..
- If a quantity of a given item fails below a specified number (set in environment.php), then an email can be sent (parameters like recipients etc are set in environment.php).
- Inventory name is now specified as a constant, and used also in email information.
- Line-breaks and http://... links are now automatically parsed for detailed item and history entry views.
- [ Added missing semicolons to sqlite statements :) ]
A quick view of this patch can be seen on http://pastebin.com/f4270eabc .
History table addition patch