+ Post New Thread
Page 9 of 20 FirstFirst ... 567891011121319 ... LastLast
Results 121 to 135 of 287
How do you do....it? Thread, Toner inventory Database in Technical; Hi Ctorp, thanks for your comments about the project - I'm pleased it's useful for you and you managed to ...
  1. #121

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    Hi Ctorp, thanks for your comments about the project - I'm pleased it's useful for you and you managed to add an extra column. Also, thanks for posting your solution to it - hopefully it will help others wanting to achieve a similar thing.

    Can you please describe the session problem you have in more detail? I'm not sure what exactly isn't working, or what you want to be able to do.

  2. #122

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by webman View Post
    Hi Ctorp, thanks for your comments about the project - I'm pleased it's useful for you and you managed to add an extra column. Also, thanks for posting your solution to it - hopefully it will help others wanting to achieve a similar thing.

    Can you please describe the session problem you have in more detail? I'm not sure what exactly isn't working, or what you want to be able to do.
    The code in consumables\index.php at line 34 with:
    Code:
    It seems to only set the ?dir php action to 'asc' (i.e. consumables.php?sort=consumables.LastOrder&dir=asc) and does not store that information in the session (cookie?) so that a subsequent follow of that link (the column header) will change the sort direction to 'desc'.

    I think I remember seeing something where fCRUD::printSortableColumn was defined that indicated which sort actions it would work with, but I am not entirely sure, and I gave up on it after breaking it in various ways.

    My next step is going to be to modify the reports page to optionally generate a filled-out re-order form that is in-line with the ones used at the facility where I work. If I get that working I can post it later. ^_^

  3. #123

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    Hi

    OK, I think I might have what you want here. You need to edit two files. In views/consumables/index.php:

    Code:
    And in consumables.php, line ~36:

    Code:
    $sort = fCRUD::getSortColumn(array('consumables.name', 'consumables.qty', 'consumables.last_order'));
    That last one is the line that says which columns can be sorted on. I tested that quickly and it seems to remember the sort setting when I re-visit the consumables page. Give it a go

    The Flourish documentation is pretty good if you need to utilise the classes/functions for extending the project for your own needs - Documentation - Flourish.

  4. #124

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by webman View Post
    Hi

    OK, I think I might have what you want here. You need to edit two files. In views/consumables/index.php:

    Code:
    And in consumables.php, line ~36:

    Code:
    $sort = fCRUD::getSortColumn(array('consumables.name', 'consumables.qty', 'consumables.last_order'));
    That last one is the line that says which columns can be sorted on. I tested that quickly and it seems to remember the sort setting when I re-visit the consumables page. Give it a go

    The Flourish documentation is pretty good if you need to utilise the classes/functions for extending the project for your own needs - Documentation - Flourish.
    hmm. That was actually one of the things I tried before, but it still only organizes that particular field by 'asc' direction no matter how many times it is clicked. I tried again and cleared the cache as well as using two separate browsers, but it will not change the value. The other fields will alternate as usual either way.

    Would you like me to pastebin my changed files?

  5. #125

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I'm enjoying working on this PrintMaster project.

    A few notes
    I still haven't figured out why I can't get sorting to work properly with the Last Order field, but I have forgone that for the moment and started writing a Reorder page for the toner inventory.

    I'm thinking it would be best if I set a specific "Reorder Point" field for each consumable then allow each consumable to populate this Reorder page based on whether the "qty" field is < the "reorder_pt" field.

    Also in the works is an "inactive" field for printers that still have consumables, but are not currently in service, so they do not populate the homepage consumable stock.

    A couple other improvements that I will look into (I currently am not sure how I could implement them) are a password protection for the inventory and the ability to "undo" the last consumed element in case someone uses it by accident (or in case it is taken from the inventory, but is found to be unneeded and returned).

    I will post back if/when I finish these things as I may be moving to another job before this can come to full fruition.

  6. #126

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    Ctorp, I'm liking your enthusiasm

    "Reorder point" for each consumable - this is something I plan to add in the future as I think it'd be a good thing. For obvious reasons - you need more stock of your popular models, and less of the single ACME PhotoSmartJet you have tucked away in an office.

    The inactive idea is good too - that should be really easy to do

    Here's a little tip if you need to decrease consumable stock without installing to a printer (e.g. forgot to log an install): click the button to add stock, but enter a negative value. This must take the stock level to 0 or above. E.g stock is 5, but you want it to read 3. Enter -2 in the quantity.

  7. #127

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I have already added the reorder_pt and updated my db to verify it works. I also created the Reorder page with links and it shows a table that is very similar to the Consumable Stock section on the homepage (I used it as a template).

    I am now in the process of reverse engineering a way to set up Critical as any consumable with:

    - ($status[0]=array('Critical', 'CC0000'); // no stock
    - ($status[$value]=('Low', 'EDD400'); // 1 to reorder_pt minus 1
    - ($status[$value]=('OK', '73D216'); // at or above reorder_pt

    Where $value is set by comparing $reorder to $qty where:

    $reorder=$c->getReorderPt();
    $qty=$c->getQty();

    With something like:

    if($qty <= $reorder) { $value= blah;}
    elseif() {..}

    Sorry if this is a bit slapdash. I'm still working on this part at the moment, actually.

    Once this is done I am hoping that I can use the existing 'Low' and 'Critical' identifiers to populate the Reorder form effectively.

    I still haven't tried tackling the 'undo' feature or the password protection. I am glad you mentioned the +/- adding option for manipulating the stock though. That should prove useful.

  8. #128

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    This is what I have so far. You would need to add a field to the 'consumables' table for last_order and reorder_pt for it to work.

    Attachment: inventory_(modded_by_CTorp).zip

    It is still very much a work in-progress compared to what I have envisioned, but I'll be back next week when I can look at it again.

    My have-done notes:
    - Added Last Order field to keep track of the last time a consumable was ordered
    - Added Reorder Point field to allow each toner it's own 'Low', 'Critical, 'OK' reference
    - Added Reorder page with sorting the same as it was on the home page, but including the reorder point and re-sized for easy print-outs (for Finance dept. heads)

    My want-to-do notes:
    - I want to add at least 2 more columns to addedit.php in the views\consumables folder because beyond a certain point the page scrolling gets ridiculous.
    - I'm probably going to change the dates to mm-dd-yyyy standard. My boss would probably prefer this as it is what he is used to with our old toner db.
    - Printer active/inactive status. If inactive, do not display consumables in reports/stock
    - Consumable toners should allow only one color selection. (Unless there are multi-color toners that come in a single cartridge that I'm not aware of.)
    - Create an 'undo last consumed' option on the off chance someone consumes a cartridge and does not.
    - Password protect the inventory so it can be hosted on the local network for use by all I.T. members without fear of a user stumbling upon and *#%^ing with it.
    Last edited by Ctorp; 15th April 2011 at 10:52 PM.

  9. Thanks to Ctorp from:

    webman (16th April 2011)

  10. #129

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Still working on this. I have used a simple webtoolkit pre-made script to password protect the inventory pages, and it drops authentication every time the browser is restarted which is good enough for me, but probably not the best solution if you're in a true corporate environment.

    I also tried adding the printer name to the reorder page, but couldn't figure it out since I used the homepage stock as a template. (Trying to use something like foreach($printers as $p) then echoing $p->name clearly does not work, but it will make your page explode with many values. ^_^)

    I'm investigating the $status[#]=array('OK', '73D216'); // #+ OK lines at the moment to try to change this dependent on the values set as reorder_pt and qty.. I believe the $status[] portion is defined in views\home\stock.php

    And I've added an Active field to the printers table which is populated by 0 for active and 1 for inactive. I have not incorporated this into the php, yet.
    Last edited by Ctorp; 18th April 2011 at 07:01 PM.

  11. #130

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    The numeric value in the $status array is the quantity of a consumable that must be reached for that level (ok/critical/low). To customise these per consumable, the table will need to be altered to accept these values, which will be entered on the add/edit consumable form.

  12. #131

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by webman View Post
    The numeric value in the $status array is the quantity of a consumable that must be reached for that level (ok/critical/low). To customise these per consumable, the table will need to be altered to accept these values, which will be entered on the add/edit consumable form.
    Ah. Having added the "Reorder_pt" value to the add/edit consumable form and to the consumables table, I was thinking

    0 - Universal 'Critical' value. (or 0&1)
    >0 & < Reorder_pt - 'Low' values
    >= Reorder_pt - 'OK' values

    I have changed the line in views\home\stock.php at 28 to:
    Code:
    foreach($status as $k => $v){
    		if($c->qty >= $k){
    			$qtylevel = strtolower($v[0]);
    			$qtycol = $v[1];
    			$qty = $c->qty;
    			$reorder = $c->reorder_pt;
    			break;
    		}
    	}
    then changed the first lines of config.php to:
    Code:
     0 // OK if qty = or > reorder_pt
    global $qty, $reorder;
    	if($qty=='0') { $status = array('OK', '73D216'); }
    	elseif($qty < $reorder) { $status = array('Low', 'EDD400'); }
    	elseif($qty >= $reorder) { $status = array('Critical', 'CC0000'); }
    but it does not work this way. I'm still muddling through to figure out why.

  13. #132

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    I think you're close! I'd be tempted to create a function for this similar to getQtyStatus() in the consumable model file (or replace that one). The function can return an array of ok/low/critical + the colour based on a) the actual quantity of the consumable, and b) the re-order level for that consumable.

    A sensible place for this would be in the consumable model file. This way, you can call the function on an instance of it, and it will already have access to the data needed.

    So, for example. A consumable with a qty of 6 and a reorder level of 3:

    $this_status = $c->get_status();

    You would then have the info you need in an array like this: Array('ok', '73D216'). $status[0] is the status name, $status[1] is the colour.

    The function could look like some of your code above:

    Code:
    function get_status(){
        $qty = $this->getQty();
        $reorder = $this->getReOrder();
        if ($qty > $reorder) {
            return array('ok', '73D216');
        }
        if ($qty <= $reorder && $qty > 0) {
            return array('low', 'EDD400');
        }
        if ($qty == 0) {
            return array('critical', 'CC0000');
        }
    }
    }
    Or something like that anyway. Just a few ideas...

  14. #133
    ticker's Avatar
    Join Date
    Mar 2006
    Location
    Waterfoot, Rossendale
    Posts
    298
    Thank Post
    55
    Thanked 20 Times in 17 Posts
    Rep Power
    21
    Hi

    i have set this up no problem and can get to the home page but when i click on any of the links it puts the address like this: http://192.168.0.16printmaster//manufacturers.php any ideas why its moving the slash?

  15. #134

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    ticker: Try changing inc/config.php, line 12, to look like this:

    Code:
    define('URL_ROOT', '/printmaster/');

  16. #135
    ticker's Avatar
    Join Date
    Mar 2006
    Location
    Waterfoot, Rossendale
    Posts
    298
    Thank Post
    55
    Thanked 20 Times in 17 Posts
    Rep Power
    21
    just get a syntax error on that line when entering the above?

SHARE:
+ Post New Thread
Page 9 of 20 FirstFirst ... 567891011121319 ... LastLast

Similar Threads

  1. OCS Inventory
    By Geoff in forum Downloads
    Replies: 5
    Last Post: 3rd June 2011, 08:40 AM
  2. Inventory
    By school in forum Scripts
    Replies: 2
    Last Post: 3rd June 2010, 02:18 PM
  3. Inventory
    By mmoseley in forum Network and Classroom Management
    Replies: 15
    Last Post: 20th June 2007, 12:31 PM
  4. Replies: 4
    Last Post: 28th February 2007, 09:37 AM
  5. inventory system
    By bjg5858 in forum General Chat
    Replies: 2
    Last Post: 11th July 2006, 09:10 AM

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Posting Permissions

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