public class POStatusHandler extends StatusHandler
Modifier and Type | Field and Description |
---|---|
static boolean |
alreadyAsked |
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 |
---|
POStatusHandler(StatefulMbo sm)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
approve(java.util.Date date)
Perform the purchase order approval.
|
void |
canChangeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
long accessModifier)
Defines which status changes are legal.
|
void |
canHold(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Hold is legal.
|
void |
canPndRev(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Pending Revision is legal.
|
void |
canRevise(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Revised is legal.
|
void |
changeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
java.util.Date date,
java.lang.String memo)
Change the status from the current state to a desired state.
|
void |
checkPndRevLines(MboRemote poRemote,
MboSetRemote poLines)
If one of PNDREV POLines don't matched with Approve POLines, cannot approve PNDREV PO.
|
void |
checkStatusChangeAuthorization(java.lang.String desiredExternalStatus)
Checks to see if the user is authorised to make a status changes.
|
static java.lang.String |
getOptionName(java.lang.String status)
Given a PO Status, return the optionName
Note the status passed in is the INTERNAL status code.
|
void |
hold()
Sets the status of the PO to Hold.
|
boolean |
isPOFromPR()
Check if any POLines in this PO are from PR?
|
boolean |
isPOFromRFQ()
Check if any POLines in this PO are from RFQ?
|
void |
pndrev()
Sets the status of the PO to Pending Revision.
|
void |
revise()
Sets the status of the PO to Revised.
|
boolean |
samePOlineOnTwoVersions(MboRemote prLineRemote)
Find out how many polines are in PRLine regardless po revision
|
void |
updateMboForStatus(java.lang.String status)
Set the relevant fields to be read-only based on the status
|
void |
updatePndRevLines(MboRemote poRemote,
MboSetRemote poLines)
Set mrnum/mrlinenum when revision is aproved.
|
void |
updatePRPRLine()
Remove PO reference from PRLines if POLines are deleted and reopen PR status
|
void |
updateRFQRFQLine()
Remove PO reference from PRLines if POLines are deleted and reopen PR status
|
postStatusChange, preStatusChange
public static boolean[][] statusChangeMatrix
Status |   WAPPR  |  APPR  |   CLOSE  |   CANCEL  |  INPRG  |
---|---|---|---|---|---|
WAPPR | false | true | false | true | true |
APPR | true | false | true | true | true |
CLOSE | false | false | false | false | false |
CANCEL | true | false | false | false | false |
INPRG | true | true | true | true | false |
public static boolean alreadyAsked
public POStatusHandler(StatefulMbo sm)
public void canChangeStatus(java.lang.String currentStatus, java.lang.String desiredStatus, long accessModifier) throws MXException, java.rmi.RemoteException
canChangeStatus
in class StatusHandler
currentStatus
- The current external status of the POdesiredStatus
- The desired external status of the POaccessModifier
- MXApplicationException("po",
- "invalidstatus")MXException
java.rmi.RemoteException
possibleStatusChange
,
statusChangeMatrix#matrix
public void checkStatusChangeAuthorization(java.lang.String desiredExternalStatus) throws MXException, java.rmi.RemoteException
checkStatusChangeAuthorization
in class StatusHandler
currentExternalStatus
- The current external status of the PO.desiredExternalStatus
- The desired external status of the PO.MXException
java.rmi.RemoteException
checkUserSecurity
,
possibleStatusChange
public static java.lang.String getOptionName(java.lang.String status)
status
- The status to return the optionName of.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 StatusHandler
currentStatus
- The PO's status now.desiredStatus
- The status to change to.date
- The date as of the status change is to be made.memo
- Memo text.MXException
java.rmi.RemoteException
public void approve(java.util.Date date) throws MXException, java.rmi.RemoteException
MXApplicationException(po,
- blanketunapproved) is thrown when the blanket PO is unapproved.MXApplicationException(po,
- releaseexceedsblanket) is thrown when the release cost exceeds the blanket cost.MXApplicationException(po,
- totalblanketcostzero) is thrown when the blanket cost is zero.MXApplicationException(po,
- approveamountexceeded) is thrown when the PO amount exceeds designated limits.MXApplicationException(po,
- glcreditnotfull) is thrown when the GLCredit Acct is not fully specified.MXApplicationException(po,
- gldebitnotfull) is thrown when the GLDebit Acct is not fully specified.MXApplicationException
- (financial, GLRequiredForTrans) The debit and credit GL accounts for pocosts
require a value.MXException
java.rmi.RemoteException
public void updateMboForStatus(java.lang.String status) throws MXException, java.rmi.RemoteException
updateMboForStatus
in class StatusHandler
MXException
java.rmi.RemoteException
public void revise() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void hold() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void pndrev() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void canPndRev(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canRevise(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canHold(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public boolean isPOFromPR() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public boolean isPOFromRFQ() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void updatePRPRLine() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void updateRFQRFQLine() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void checkPndRevLines(MboRemote poRemote, MboSetRemote poLines) throws MXException, java.rmi.RemoteException
poRemote
- The Approved POpoLines
- The PNDREV POLineSetMXException
java.rmi.RemoteException
public void updatePndRevLines(MboRemote poRemote, MboSetRemote poLines) throws MXException, java.rmi.RemoteException
poRemote
- The Approved POpoLines
- The PNDREV POLineSetMXException
java.rmi.RemoteException
public boolean samePOlineOnTwoVersions(MboRemote prLineRemote) throws MXException, java.rmi.RemoteException
prLineRemote
- PRLine set that has the The Approved POMXException
java.rmi.RemoteException