public class MRStatusHandler extends StatusHandler
MR Attribute tableMRLine Attribute table.| Modifier and Type | Field and Description |
|---|---|
static boolean[][] |
statusChangeMatrix
A statusChangeMatrix for the legal status changes that can be made.
|
ALLROWS, CHANGEDBY_USER, COUNT_ADDITIONS, COUNT_AFTERSAVE, COUNT_DATABASE, COUNT_DELETED, COUNT_EXISTING, DBCONFIG, DELAYVALIDATION, DELAYVALIDATIONONLY, DISCARDABLE, GOTCOMPLETEWHERE, HIDDEN, NO_RELATEDMBOS_OF_OWNERSCHILDREN_FETCH, NOACCESSCHECK, NOACTION, NOADD, NOCOMMIT, NODELETE, NONE, NOOVERWRITE, NOSAVE, NOSETVALUE, NOUPDATE, NOVALIDATION, NOVALIDATION_AND_NOACTION, NOVALIDATION_AND_NOACTION_ALLOWCROSSOVER, READONLY, REBUILD, REQUIRED, SAMEVALUEVALIDATION, SETBYPARENT, USER| Constructor and Description |
|---|
MRStatusHandler(MR sm)
Constructor to construct the Status Handler object
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
approveMR(java.lang.String desiredStatus,
java.util.Date date)
Approve the MR after making sure that certain business rules have been enforced.
|
boolean |
canAddInvReserve(MboRemote mrlineMbo)
Returns false if the difference between the quantities on the MRLine and the MATUSETRANS
for the mrnum, mrlinenum is zero.
|
void |
canApprove(java.lang.String currentInternalStatus)
Can this MR be approved ?
The MR can be approved only if the current status of the MR is "Waiting for Approval".
|
void |
canCancel(java.lang.String currentInternalStatus)
Can an MR be cancelled ?
If there are any transactions in matusetrans and/or matrectrans against an mr or mrline, the MR cannot be cancelled. |
protected void |
cancelMR(java.lang.String desiredStatus,
java.util.Date date)
Change the status of the MR to the status that was passed in.
|
void |
canChangeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
long accessModifier)
Can a certain status change be performed ?
Checks to see if the specified status change can be performed.
|
void |
canClose(java.lang.String currentInternalStatus)
Can the MR be closed?
An MR can be closed only if all the lines have been completed. |
void |
canUnapprove(java.lang.String currentInternalStatus)
Can this MR be unapproved ?
The MR cannot be unapproved if there is any associated PO. |
void |
changeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
java.util.Date date,
java.lang.String memo)
Change the status from the specified state to a desired state.
|
void |
checkStatusChangeAuthorization(java.lang.String desiredExternalStatus)
Checks to see if the user is authorised to make a status changes.
|
void |
checkUserSecurity(java.lang.String desiredMaxStatus)
Check out the users security rights to call the specified status.
|
protected void |
closeMR(java.lang.String desiredStatus,
java.util.Date date)
Change the status of the MR to CLOSED.
|
protected void |
deleteReservations()
Delete the reservations that were made for this MR.
|
protected void |
deleteReservationsWhenCancel()
Delete the reservations
|
protected void |
reserveItems()
Reserve the Material Requisition line items.
|
protected void |
unapproveMR(java.lang.String desiredStatus,
java.util.Date date)
Change the status of the MR to the status that was passed in.
|
void |
updateMboForStatus(java.lang.String status)
Called to set the state of the Mbo for the specified status.
|
postStatusChange, preStatusChange, statusToOptionNamepublic static boolean[][] statusChangeMatrix
| Status |   WAPPR  |  APPR  |   CLOSE  |   CANCEL  |   DRAFT  |
|---|---|---|---|---|---|
| WAPPR | false | true | false | true | true |
| APPR | true | false | true | true | true |
| CLOSE | false | false | false | false | false |
| CANCEL | false | false | false | false | false |
| DRAFT | false | false | false | false | false |
public MRStatusHandler(MR sm)
public void changeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
java.util.Date date,
java.lang.String memo)
throws MXException,
java.rmi.RemoteException
changeStatus in class StatusHandlercurrentStatus - The Current external status of the MRdesiredStatus - The desired external status of the MRdate - The effective date of the status changememo - Optional memo string for the status changeMXException - Thrown if the status change is not allowedjava.rmi.RemoteExceptionMRStatusHandler.canChangeStatus(java.lang.String, java.lang.String, long)public void canChangeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
long accessModifier)
throws MXException,
java.rmi.RemoteException
canChangeStatus in class StatusHandlercurrentStatus - The current external status of this mrdesiredStatus - The desired external status of this mraccessModifier - If this flag is set to NOACCESSCHECK, signature security is not checkedMXException - thrown when the status change cannot be performed.java.rmi.RemoteExceptionMRLine.validateCombination(),
MRStatusHandler.approveMR(java.lang.String, java.util.Date)public void canUnapprove(java.lang.String currentInternalStatus)
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic void canApprove(java.lang.String currentInternalStatus)
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionMRLine.validateCombination()public void canClose(java.lang.String currentInternalStatus)
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic void canCancel(java.lang.String currentInternalStatus)
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic void checkStatusChangeAuthorization(java.lang.String desiredExternalStatus)
throws MXException,
java.rmi.RemoteException
checkStatusChangeAuthorization in class StatusHandlercurrentExternalStatus - The current external status of the MR.desiredExternalStatus - The desired external status of the MR.MXExceptionjava.rmi.RemoteExceptioncheckUserSecurity,
possibleStatusChangepublic void checkUserSecurity(java.lang.String desiredMaxStatus)
throws MXException,
java.rmi.RemoteException
status - The status to check if we can change to.MXAccessException - Throws an access exception "notauthorized" if the
check fails.MXExceptionjava.rmi.RemoteExceptionprotected void approveMR(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
- - The desired status to which the MR should be changed to.- - The date on which this status change is done which is usually the current date.MXExceptionjava.rmi.RemoteExceptionMRStatusHandler.reserveItems()protected void unapproveMR(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
- - The desired status to which the MR should be changed to.- - The date on which this status change is done which is usually the current date.MXExceptionjava.rmi.RemoteExceptionMRStatusHandler.deleteReservations()protected void cancelMR(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
- - The desired status to which the MR should be changed to.- - The date on which this status change is done which is usually the current date.MXExceptionjava.rmi.RemoteExceptionMRStatusHandler.deleteReservations()protected void deleteReservationsWhenCancel()
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionprotected void closeMR(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
- - The desired status to which the MR should be changed to.- - The date on which this status change is done which is usually the current date.MXExceptionjava.rmi.RemoteExceptionMRStatusHandler.deleteReservations()protected void reserveItems()
throws MXException,
java.rmi.RemoteException
| From | To |
|---|---|
| MR.REQUESTEDBY | INVRESERVE.REQUESTEDBY |
| MR.MRDATE | INVRESERVE.MRDATE |
| MRLINE.MRNUM | INVRESERVE.MRNUM |
| MRLINE.MRLINENUM | INVRESERVE.MRLINENUM |
| MRLINE.ASSETNUM | INVRESERVE.ASSETNUM |
| MRLINE.WONUM | INVRESERVE.WONUM |
| MRLINE.DESCRIPTION | INVRESERVE.DESCRIPTION |
| MRLINE.DIRECTREQ | INVRESERVE.DIRECTREQ |
| MRLINE.ITEMNUM | INVRESERVE.ITEMNUM |
| MRLINE.STORELOC | INVRESERVE.STORELOC |
| MRLINE.GLDEBITACCT | INVRESERVE.GLDEBITACCT |
| MRLINE.REQUIREDDATE | INVRESERVE.REQUIREDDATE |
| MRLINE.QTY | INVRESERVE.QTY |
| MRLINE.LONGDESCRIPTION | INVRESERVE.LONGDESCRIPTION |
MXExceptionjava.rmi.RemoteExceptionprotected void deleteReservations()
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic void updateMboForStatus(java.lang.String status)
throws MXException,
java.rmi.RemoteException
updateMboForStatus in class StatusHandlerstatus - current status of the mrMXExceptionjava.rmi.RemoteExceptionpublic boolean canAddInvReserve(MboRemote mrlineMbo) throws MXException, java.rmi.RemoteException
MXExceptionjava.rmi.RemoteException