Timestamp crsd = verifyitem. getrequestshipdate ();
Calendar Cal = calendar. getinstance ();
Calendar now = calendar. getinstance ();
Calendar calcrsd = calendar. getinstance ();
Calcrsd. settimeinmillis (crsd. gettime ());
Cal. Set (calcrsd. Get (calendar. Year ),
Calcrsd. Get (calendar. month ),
Calcrsd. Get (calendar. Date), 0, 0, 0 );
Cal. Add (calendar. Date,-leadtime); // If delivery is allowed three days in advance, and the customer requests delivery on the 8 th, delivery can be allowed as early as five days.
Now. Set (now. Get (calendar. Year), now. Get (calendar. month), now. Get (calendar. Date), 0, 0, 0 );
If (now. compareto (CAL) <0 ){
Simpledateformat df = new simpledateformat ("yyyy-mm-dd ");
Infos. Add ("Order [Ticket No.:" + So + ", row number:" + soline
+ "] Not included in the plan! Reason: orders to be scheduled can only be placed in advance "+ leadtime
+ "Daily delivery of goods [the date of delivery requested by the customer is" + DF. Format (calcrsd. gettime ())
+ ", The earliest date allowed for delivery is" + DF. Format (Cal. gettime () + "]! ");
Fails. Add (verifyitem. GETID ());
Removeids. Add (verifyitem );
Continue;
}