Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Autoselect the closest expiration lot/serial
01-25-2018, 03:21 AM
Post: #1
Autoselect the closest expiration lot/serial
Hi

Could someone point me in the right direction to automatically inject in the cart a lot number for each line?

What I'm trying to achieve: when landing on ConfirmDispatch_Invoice.php, I want the "this dispatch quantity" being equal to "ordered", acting like I would have already selected my batches if I had clicked on the "enter batch/roll/lot#" link, depleting batches with closest expiration date first.

Doable? Would save countless hours since our orders have up to 150 lines!

Thank you for your input!
Find all posts by this user
Quote this message in a reply
01-26-2018, 11:11 AM
Post: #2
RE: Autoselect the closest expiration lot/serial
Hi,
It is doable!
And it can be auto committed according to the expiration date.
But you have to do lots of customization for this.
The SelectOrderItems.php must be revised to handle the committed quantity, and you have to rework the DefineCartClass.php to handle the different kinds of situation such as users add, reduce, delete the items selected etc.
And a reserved serial no items tables have to be established for items reserved. At the same time, you have to calculate item available which is quite compliate scenario. And you have to rewrite the serial items lot no handling scripts to meet those changes.
Best regards!
Exson



(01-25-2018 03:21 AM)HDeriauFF Wrote:  Hi

Could someone point me in the right direction to automatically inject in the cart a lot number for each line?

What I'm trying to achieve: when landing on ConfirmDispatch_Invoice.php, I want the "this dispatch quantity" being equal to "ordered", acting like I would have already selected my batches if I had clicked on the "enter batch/roll/lot#" link, depleting batches with closest expiration date first.

Doable? Would save countless hours since our orders have up to 150 lines!

Thank you for your input!
Find all posts by this user
Quote this message in a reply
01-26-2018, 12:40 PM
Post: #3
RE: Autoselect the closest expiration lot/serial
Thank you for your input! Seems quite complex and out of my league …
I'm still digging trying to figure out how the information is passed and when we go from ConfirmDispatchControlled_Invoice where we select the lot and quantity to when we go back to ConfirmDispatch_Invoice.
Where are stored the lots/qty pairs before we click on "process order" ?

One more thing that puzzles me:
1) where is the information regarding lots that have been stored in the database once the sale order order has been placed? If a customer asks several months after if his order contained such or such lot, how do I know which lot was used for order x?
2) on which PDF are we supposed to see the lot numbers printed for a sale order? I'm unable to see them in my workflow…

Thank you for your help!
Find all posts by this user
Quote this message in a reply
01-26-2018, 06:02 PM
Post: #4
RE: Autoselect the closest expiration lot/serial
In answer to (1) the stockserialmoves table holds a reference to the stockmoves table (the stockmoveno field) and the debtorno/branchcode can be found there, as well as the transaction type and transaction number. There is a "Serial item research tool" option which gives this information.

Hope that helps,
Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
04-14-2018, 03:24 AM (This post was last modified: 04-14-2018 03:25 AM by HDeriauFF.)
Post: #5
RE: Autoselect the closest expiration lot/serial
Well, after a lot of research and analysis, I did it: it's all about manipulating the cart's sessions values and arrays using the SerialItem class. The solution in itself is quite simple and does not require a lot of customization, everything fits in 40 lines of code
It handles all situations the same way ConfirmDispatchControlled_Invoice does.
Available quantities are automatically selected in all lots (I use the PO line during order entry to indicate which minimal expiration date is acceptable) rolling over through the next available lot if quantity needed exceeds the lot quantity, and indicates directly on ConfirmDispatch_Invoice which quantities have been picked in each lot, if complete or partial.
Everything of course is still editable accessing ConfirmDispatchControlled_Invoice.
Screenshot of the modified page (showing what we see when we land on the page, without any manual intervention)


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)