From: Phil D. <ph...@du...> - 2004-05-22 04:25:56
|
Jesse, Your gonna be mad! I have done a fair bit on this and have GoodsReceived.php and GoodsReceivedControlled.php going ok - with keyed input only at this stage. The changed scripts are: GoodsReceived.php Locations.php; PO_Header.php; PO_Items.php; Stocks.php; config.php; doc/Change.log; includes/ConnectDB.inc; includes/DefinePOClass.php; includes/PO_ReadInOrder.inc; sql/upgrade2.8-2.9.sql; sql/web-erp-demo.sql; sql/web-erp-new.sql; GoodsReceivedControlled.php; includes/DefineSerialItems.php; I am a worried that you may not like what I have done to your serial stuff. I really need help with this and if you bail on me now cos you dont agree with my direction, I am in trouble. So, I am writing some pre-emptive explanations .... web-erp has adopted a bunch of conventions which I am keen to ensure go right through. I don't think other methods are wrong, just they are not consistent with the style used here. Having adapted to those conventions it is confusing, at least for me, to look at code written without using those conventions. Consistency of application of these conventions throughout are important to me. I have spelled these conventions out elsewhere in the developers list. Perhaps for a younger mind this is probably a non-issue. I have worked through the GoodsReceivedControlled Code and notice that much of the code for PO items received is actually in the StockModules - since it will only ever be used from the goods received script I prefer all code relating to that function to be in that one place so the reader doesn't have to conceptualise through several stages of abstraction. I know the computer scientists would choke on this, but if the code is not re-used or re-used only once then the cost in terms of abstraction is too much (for me). I concede that this is wrong and contrary to accepted wisdom - but I just can't see it. The StockModules Stuff ..... I see what you are doing allowing for alternative validation and separate treatment of other types of stock - I so see the value in this approach.... Information specific to the type of stock is stored in my stockcategory table and perhaps the parameters for validation would be better held together with other like information in that table, rather than hard coded and adding another level of abstraction for those of us who suffer with them. I have not coded up this but see no problem in doing so. Where specific additional inserts for new tables peculiar to the business are required this will always require modification of the code - I like to keep the code nice and simple so other folks can grasp it and add their flourishes to it. When I took out the purchase order receive stuff from the GenericStockModule, there really wasn't enough left to justify its existence. It was on this basis that I dumped the StockModules stuff. Instead I created a DefineSerialItem.php object that just defines the data in the SerialItems array and validates it before adding it - just as I did with the other scripts using arrays of multiple variables. I have the GoodsReceivedControlled.php working for manual input/bar code - I defaulted to manual input mode and lost the choices before input was possible. I felt that from a users perspective this could be tedious having to select an input method - before diving in with the input of serial nos. I don't have the file input stuff going, this again looks a bit tough for me. I've left it in - just commented it out - it needs some TLC from you - I think I've broken it :-( The GoodsReceivedControlled.php screen is labelled specifically for either a serialised item or a controlled (and not serialised) item. The links for entry on the GoodsReceived.php script are also labelled appropriately. The not serialiased option refers to a batch qty which is defaulted to 1 for serialiased items. The quantites are accumulated automatically from the inputs made directly into the GoodsReceived.php $_SESSION['PO']->LineItems variable. I'd like to think that the foundations for Serial and batch control are now firmly in place and we can code up the other scripts. I REALLY hope you are still behind me on this and can live with my mods! Phil |