parent
b12aecbf3a
commit
29b7b7de3b
|
|
@ -36,6 +36,7 @@ public class MID_MRequisition extends MRequisition implements DocOptions{
|
|||
|
||||
@Override
|
||||
public boolean reActivateIt() {
|
||||
set_ValueNoCheck("IsReactivate", "Y");
|
||||
setDocStatus(DocAction.STATUS_InProgress);
|
||||
setDocAction(DocAction.ACTION_Complete);
|
||||
setProcessed(false);
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ package andromedia.midsuit.model;
|
|||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.MRequisition;
|
||||
import org.compiere.model.MRequisitionLine;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
public class MID_MRequisitionLine extends MRequisitionLine{
|
||||
|
||||
|
|
@ -27,8 +29,30 @@ public class MID_MRequisitionLine extends MRequisitionLine{
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean afterSave(boolean newRecord, boolean success) {
|
||||
protected boolean beforeSave(boolean newRecord) {
|
||||
if(!newRecord){
|
||||
MID_MRequisition requisition = new MID_MRequisition(getCtx(), getM_Requisition_ID(), get_TrxName());
|
||||
Boolean isReactivate = requisition.get_ValueAsBoolean("IsReactivate");
|
||||
if(isReactivate){
|
||||
if(is_ValueChanged("M_Product_ID")){
|
||||
throw new AdempiereException("Product cannot be changed !!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.beforeSave(newRecord);
|
||||
}
|
||||
@Override
|
||||
protected boolean beforeDelete() {
|
||||
MID_MRequisition requisition = new MID_MRequisition(getCtx(), getM_Requisition_ID(), get_TrxName());
|
||||
Boolean isReactivate = requisition.get_ValueAsBoolean("IsReactivate");
|
||||
if(isReactivate){
|
||||
log.saveError("DeleteError", "Line Reactivate !!! Cannot be deleted !!!");
|
||||
return false;
|
||||
}
|
||||
return super.beforeDelete();
|
||||
}
|
||||
@Override
|
||||
protected boolean afterSave(boolean newRecord, boolean success) {
|
||||
super.afterSave(newRecord, success);
|
||||
// requisition.recalculateTax(get_TrxName());
|
||||
String sql = "UPDATE M_Requisition SET TaxAmt = "
|
||||
|
|
|
|||
Loading…
Reference in New Issue