Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved:Purchase Orders: Lead time not considered for Delivery Date
05-01-2013, 07:22 AM, (This post was last modified: 05-01-2013, 07:28 AM by phil.)
#8
RE: Purchase Orders: Lead time not considered for Delivery Date
Code:
                //...got 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!
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply


Messages In This Thread
RE: Purchase Orders: Lead time not considered for Delivery Date - by phil - 05-01-2013, 07:22 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)