webERP Forum

Full Version: Solved:Purchase Orders: Lead time not considered for Delivery Date
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
When creating a new Purchase Order, the suggested Delivery Date only shows the current date, it does not take into consideration the Lead Time for this article set up in Purchasing Details.
The Delivery Date should be estimated as Today + Lead Time.

(Nice to have but not too important: Delivery Date can only be a weekday, i. e. if "Today + Lead Time" is a Saturday or Sunday, then Delivery Date will be the following Monday. That´s not crucial though.)
The lead time is used for MRP calculations ... but not for purchase order entry.
It would be useful to have this default. However, lead times vary in practice depending on availability ex-stock or whether the item needs to be manufactured and the availability of raw materials for the manufacturer to make... so it may not be appropriate to code this and probably better to make the phone call.
Thanks for your reply, Phil. Obviously I can only speak for myself and my particular situation, but for me Lead Time means how long it takes from the day I place an order with my supplier until I get the product delivered (I am not using the MRP module at all). My supplier gives me for every product an average Lead Time, e. g. 30 days. So when I place the order today, I know I will receive it quite precisely in 30 days. I. e. when I place the order, the Requested Date will always be Today + Lead Time. Of course the Lead Time can vary, but only if something unforeseen happens.

If a product would usually be sold ex stock, I'd put Lead Time one or two days. My products are all manufactured, so Lead Time is always 30 days. I am aware of that rule "Don't program exceptions" and I agree with it, but in this case, I'd say more often than not Requested Date should be Today + Lead Time.

But of course, that's not a "killer", it would just make webERP a bit smoother (for my purpose, though).

Probably right - I should code this as the default - good idea.
Hi Phil:

I agree with him. It is not exact but (today + lead time) is much closer to reality than Today. In our case suppliers never get it on time :-( but it will show us when we should start pestering suppliers.
thanks for supporting and sharing your thoughts on that.
same for me. I think I brought this up a long time ago.
The lead time in purchasing order setup should be used as default. So I have at least a rough idea when it might arrive.

If the supplier is not just around the corner, today is nearly the most wrong entry that is possible, as this is nearly always impossible to achieve. (only yesterday would be worse... ;-) ).


                // the Purchasing Data for the supplier of the item  
                          $LeadTime = $PurchRow['leadtime'];

                    } else { // no purchasing data setup
                        $PurchPrice = 0;
                        $ConversionFactor = 1;
                        $SupplierDescription =     $ItemRow['description'];
                        $SuppliersUnitOfMeasure = $ItemRow['units'];
                        $SuppliersPartNo = '';
                        $LeadTime = $ItemRow['leadtime'];
                    /* Work out the delivery date based on today + lead time
                     * if > header DeliveryDate then set DeliveryDate to today + leadtime
                                        $DeliveryDate = DateAdd(Date($_SESSION['DefaultDateFormat']),'d',$LeadTime);
                    if (! Date1GreaterThanDate2($DeliveryDate,$_SESSION['PO'.$identifier]->DeliveryDate)){
                        $DeliveryDate = $_SESSION['PO'.$identifier]->DeliveryDate;

So the delivery date is defaulted to today + the lead time from the supplier purchasing data unless the header delivery date is later than this - in which case the header delivery date is defaulted for the line item delivery date.
The system was not using the stock item lead time (it was using the purchasing data lead time specific to the supplier). However, I have modified it as above to now use the stock master lead time if no supplier specific lead time is set up.

I also added the link to print the order after creation as suggested by MacPhotoBiker ... not sure why that was not there already!
That´s great Phil, thank you very much. I will check out the information you provided in another thread ( to learn how to update the system.
Thank you for being so responsive.
thanks Phil, that is very good.

Pages: 1 2
Reference URL's