Hi all,
Need to make customization to change the batch number of sales line(on reserved inventory transactions) based on the customer group of the customer for him this sales order,if the customer belongs to certain group will change sales line to pick from batches which have expire date after 6 months from now, Note sales order has automatic reservation
Any help will be appreciated
*This post is locked for comments
Dear Sukrut Parab,
If you can help me
this sales order line
this batches sorted by expire Date
this invent transactions before putting code
this invent transactions after putting code
before putting code its default start from first expire date and continue
and after putting code it start from batch we get based on the condition
but when it's not enough back to first,
need it to continue to next
also I note that it not make sense to put batch number on sales line when it's reservation is automatic,
so i think to change reservation from inventory side for that sales line but don't know how ,I'm really confused about this issue ,please advise me what should i do exactly as you can.
many thanks for you effort
Dear Sukrut Parab,
T2 is the start batch and is correct,sales order line has automatic reservation,it suppose automatically reserve from next batch(T1) ,but it back to first batch (022859), how can i solve this problem .
Thanks a lot and Appreciate you effort
Dear Sukrut Parab,
this my code and I wrote it in the beginning of insert method of SalesLineType Class.
/* Set Inventory Dimension Id*/
if(CustGroup::find(salesLine.CustGroup).SixMonths){
if(salesLine.Reservation==ItemReservation::Automatic){
select firstOnly inventBatch order by expDate asc where
inventBatch.itemId==salesLine.ItemId
&& inventBatch.expDate>=today()+6*30;
inventDim.clear();
inventTable = InventTable::find(salesLine.ItemId);
inventDim.initFromInventTable(inventTable);
inventDim.inventBatchId= inventBatch.inventBatchId;//(your batch id based on
customer Group);
inventDim = InventDim::findOrCreate(inventDim);
salesLine.InventDimId = inventDim.inventDimId;
}
}
/* End*/
Dear Sukrut Parab,
I write the code you tell me
kindly note that img1 is batches on the item sorted by expire date,and img2 is transactions reserved for sales line as you see it correctly start reservation from batch(T2) based on cust Group Customization we written,but I made sales line with 22 qty and Batch(T2) has only 20 qty ,it suppose to get remaining 2 qty from batch(T1) which has expire Date after (T2) ,but it get remainig from(022859) which is the first one,what should i do to made it get remaining from next batch not from the first.
Thanks for you effort
Hi Sukrut Parab ,
Thanks a lot for your reply and your help, It's worked well for me ,but my in case I deal with automatic reservation sales order ,what is done is correctly reserve qty from specified batch based on CustGroup condition but when these batch not sufficient it complete reservation from first batch .what I need is when qty for these batch all reserved get remaining quantity from the next one with expire date not get from first batch.
Appreciate your effort
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156