/***
@author: ingenierojosefrancisco@gmail.com
@created:2016-08-03
@lastupdated:2016-08-03 14:36 pm
@version: 1.0
@description:Validating Date Acct
@name: beanshell:ValidateDateAcct
***/
import org.compiere.util.DB;
import org.compiere.util.Env;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
String DATE_FORMAT_NOW = "yyyy-MM-dd hh:mm:ss";
v_date_doc = A_Tab.getValue("DateDoc");
v_date_acct = A_Tab.getValue("DateAcct");
Date today = new Date();
SimpleDateFormat f = new SimpleDateFormat(DATE_FORMAT_NOW);
if(v_date_doc.after(today) || v_date_acct.after(today))
{
A_Tab.setValue("DateDoc", null);
A_Tab.setValue("DateAcct", null);
return result = "iDempiere don't let save future dates, try again it.";
}
return result;
Excelente Ingeniero
ResponderEliminar