Package org.adempiere.model
Class PromotionValidator
java.lang.Object
org.adempiere.model.PromotionValidator
- All Implemented Interfaces:
ModelValidator
Model validator for
MOrder
for application of promotion rules.- Author:
- hengsin
-
Field Summary
Fields inherited from interface org.compiere.model.ModelValidator
CHANGETYPE_CHANGE, CHANGETYPE_DELETE, CHANGETYPE_NEW, DOCTIMING_AFTER_COMPLETE, DOCTIMING_BEFORE_PREPARE, documentEventTopics, documentEventValidators, tableEventTopics, tableEventValidators, TIMING_AFTER_CLOSE, TIMING_AFTER_COMPLETE, TIMING_AFTER_POST, TIMING_AFTER_PREPARE, TIMING_AFTER_REACTIVATE, TIMING_AFTER_REVERSEACCRUAL, TIMING_AFTER_REVERSECORRECT, TIMING_AFTER_VOID, TIMING_BEFORE_CLOSE, TIMING_BEFORE_COMPLETE, TIMING_BEFORE_POST, TIMING_BEFORE_PREPARE, TIMING_BEFORE_REACTIVATE, TIMING_BEFORE_REVERSEACCRUAL, TIMING_BEFORE_REVERSECORRECT, TIMING_BEFORE_VOID, TYPE_AFTER_CHANGE, TYPE_AFTER_CHANGE_REPLICATION, TYPE_AFTER_DELETE, TYPE_AFTER_NEW, TYPE_AFTER_NEW_REPLICATION, TYPE_BEFORE_CHANGE, TYPE_BEFORE_DELETE, TYPE_BEFORE_DELETE_REPLICATION, TYPE_BEFORE_NEW, TYPE_CHANGE, TYPE_DELETE, TYPE_NEW
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondocValidate
(PO po, int timing) Validate Document Action.
Called as first step of DocAction.prepareIt or at the end of DocAction.completeIt.
Note that totals, etc. may not be correct before the prepare stage.int
Get Client to be monitoredvoid
initialize
(ModelValidationEngine engine, MClient client) Initialize validator.login
(int AD_Org_ID, int AD_Role_ID, int AD_User_ID) User logged in.modelChange
(PO po, int type) Model change event of a Table.
-
Constructor Details
-
PromotionValidator
public PromotionValidator()
-
-
Method Details
-
docValidate
Description copied from interface:ModelValidator
Validate Document Action.
Called as first step of DocAction.prepareIt or at the end of DocAction.completeIt.
Note that totals, etc. may not be correct before the prepare stage.- Specified by:
docValidate
in interfaceModelValidator
- Parameters:
po
- persistent objecttiming
- see TIMING_ constants- Returns:
- error message or null - if not null, the document will be marked as Invalid.
-
getAD_Client_ID
public int getAD_Client_ID()Description copied from interface:ModelValidator
Get Client to be monitored- Specified by:
getAD_Client_ID
in interfaceModelValidator
- Returns:
- AD_Client_ID or 0
-
initialize
Description copied from interface:ModelValidator
Initialize validator.- Specified by:
initialize
in interfaceModelValidator
- Parameters:
engine
- validation engineclient
- optional client. null for validator that's applicable to all client.
-
login
Description copied from interface:ModelValidator
User logged in. Called before preferences are set.- Specified by:
login
in interfaceModelValidator
- Parameters:
AD_Org_ID
- orgAD_Role_ID
- roleAD_User_ID
- user- Returns:
- error message or null
-
modelChange
Description copied from interface:ModelValidator
Model change event of a Table.- Specified by:
modelChange
in interfaceModelValidator
- Parameters:
po
- persistent objecttype
- TYPE_ event- Returns:
- error message or null
- Throws:
Exception
- if the recipient wishes the change to be not accept.
-