parent
b12aecbf3a
commit
29b7b7de3b
|
|
@ -36,6 +36,7 @@ public class MID_MRequisition extends MRequisition implements DocOptions{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean reActivateIt() {
|
public boolean reActivateIt() {
|
||||||
|
set_ValueNoCheck("IsReactivate", "Y");
|
||||||
setDocStatus(DocAction.STATUS_InProgress);
|
setDocStatus(DocAction.STATUS_InProgress);
|
||||||
setDocAction(DocAction.ACTION_Complete);
|
setDocAction(DocAction.ACTION_Complete);
|
||||||
setProcessed(false);
|
setProcessed(false);
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@ package andromedia.midsuit.model;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import org.adempiere.exceptions.AdempiereException;
|
||||||
import org.compiere.model.MRequisition;
|
import org.compiere.model.MRequisition;
|
||||||
import org.compiere.model.MRequisitionLine;
|
import org.compiere.model.MRequisitionLine;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
|
import org.compiere.util.Msg;
|
||||||
|
|
||||||
public class MID_MRequisitionLine extends MRequisitionLine{
|
public class MID_MRequisitionLine extends MRequisitionLine{
|
||||||
|
|
||||||
|
|
@ -25,10 +27,32 @@ public class MID_MRequisitionLine extends MRequisitionLine{
|
||||||
super(ctx, rs, trxName);
|
super(ctx, rs, trxName);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
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
|
@Override
|
||||||
protected boolean afterSave(boolean newRecord, boolean success) {
|
protected boolean afterSave(boolean newRecord, boolean success) {
|
||||||
MID_MRequisition requisition = new MID_MRequisition(getCtx(), getM_Requisition_ID(), get_TrxName());
|
|
||||||
super.afterSave(newRecord, success);
|
super.afterSave(newRecord, success);
|
||||||
// requisition.recalculateTax(get_TrxName());
|
// requisition.recalculateTax(get_TrxName());
|
||||||
String sql = "UPDATE M_Requisition SET TaxAmt = "
|
String sql = "UPDATE M_Requisition SET TaxAmt = "
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue