psdi.app.po

Class POService

    • Field Detail

      • errorVector

        public java.util.Vector errorVector
        Deprecated. 
    • Constructor Detail

      • POService

        public POService()
                  throws java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
      • POService

        public POService(MXServer mxServer)
                  throws java.rmi.RemoteException
        Parameters:
        srvEnv - -- the "Server Environment" this Service is being created in.
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • init

        public void init()
        Initialization
        Specified by:
        init in interface Service
        Overrides:
        init in class AppService
        See Also:
        Starts up this listener
      • createReceipt

        public MboRemote createReceipt(UserInfo userInfo,
                                       MboSetRemote receiptSet,
                                       java.lang.String ponum,
                                       long polinenum,
                                       java.lang.String porevnum,
                                       java.lang.String ownersysid,
                                       java.lang.String siteid)
                                throws MXException,
                                       java.rmi.RemoteException
        Specified by:
        createReceipt in interface POServiceRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.POService#createReceipt(UserInfo, MboSetRemote, String, int, String)
      • createReturn

        public MboRemote createReturn(UserInfo userInfo,
                                      MboSetRemote receiptSet,
                                      java.lang.String ponum,
                                      long polinenum,
                                      java.lang.String porevnum,
                                      java.lang.String ownersysid,
                                      java.lang.String siteid)
                               throws MXException,
                                      java.rmi.RemoteException
        Specified by:
        createReturn in interface POServiceRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.POService#createReturn(UserInfo, MboSetRemote, String, int, String)
      • createReturn

        public MboRemote createReturn(UserInfo userInfo,
                                      MboSetRemote receiptSet,
                                      java.lang.String ponum,
                                      long polinenum,
                                      java.lang.String porevnum,
                                      java.lang.String ownersysid,
                                      java.util.List assets,
                                      java.lang.String siteid,
                                      boolean returnHasReference,
                                      MboRemote origReceipt,
                                      java.lang.String binnum,
                                      java.lang.String lotnum)
                               throws MXException,
                                      java.rmi.RemoteException
        Called for the MEA interface.
        Specified by:
        createReturn in interface POServiceRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • initCriteriaList

        public void initCriteriaList(java.util.Hashtable criteriaTable)
                              throws MXException,
                                     java.rmi.RemoteException
        Criteria defined for the POService object: HISTORY - all closed and cancelled purchase orders. APPR - Approved purchase orders WAPPR - Waiting for approval purchase orders. CLOSE - Closed purchase orders INPRG - Purchase orders to be in progress This method is originally in AppService and it is overridden here Some of the above are for future use
        Overrides:
        initCriteriaList in class AppService
        Throws:
        MXException
        java.rmi.RemoteException
      • getInternalStatus

        public java.lang.String getInternalStatus(java.lang.String extStatus)
                                           throws MXException,
                                                  java.rmi.RemoteException
        Specified by:
        getInternalStatus in interface POServiceRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.POService#getInternalStatus(UserInfo, String, String, String, String, String, String)
      • getPOReferences

        public java.util.Vector getPOReferences(java.lang.String mrnum,
                                                java.lang.String mrlinenum,
                                                UserInfo userInfo)
                                         throws MXException,
                                                java.rmi.RemoteException
        This service method gets all the POs associated with an MRLine.We all know that one MRLine can go into ONLY one POLINE. But there is a peculiar case where the user can cancel a PO created out of an MR and put that POLine into an entirely new PO.So in this case there is more than one PO in which a particular MRLine reference can be found.
        Specified by:
        getPOReferences in interface POServiceRemote
        Parameters:
        - - The Mrnum,MrLineNum of the MRLine whose PO associations need to be found, UserInfo
        Returns:
        - a vector of all the PORemotes associated with this MRLine.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.POService#getPOReferences(UserInfo, String, String, String, String, String, String)
      • createReceipts

        public void createReceipts(UserInfo ui,
                                   java.lang.String ponum,
                                   java.lang.String catalogCode,
                                   java.lang.String itemnum,
                                   java.lang.String itemsetid,
                                   java.lang.String mrnum,
                                   java.lang.String modelnum,
                                   java.lang.String packingSlipNum,
                                   java.lang.String requestedby,
                                   int noOfRows)
                            throws MXException,
                                   java.rmi.RemoteException
        Determine the number of possible MatRecTrans or ServRecTrans records that need to be created so that the user can be warned about this time consuming process. This method is an overloaded version of createReceipts. It first determines the possible number of MatRecTrans and ServRecTrans Mbos that need to be created. It accepts an integer as a parameter. An exception is thrown if the number of records to be created exceeds the integer parameter passed in. For example, if the integer parameter passed in was 25 and if more that 25 records need to be created by MatRecTrans or ServRecTrans this method will give out an error message which will be used by the UI. The UI calls this method to determine if it is OK to proceed if the returned Result set is very large. The user is informed that there might be significant processing time involved in processing his request.
        Specified by:
        createReceipts in interface POServiceRemote
        Parameters:
        - - Includes all the parameters on which the user desires to search on
        1. UserInfo
        2. PONUM
        3. CATALOGCODE
        4. ITEMNUM
        5. ITEMSETID
        6. MRNUM
        7. MODELNUM
        8. PACKINGSLIPNUM
        9. REQUESTEDBY
        10. NO_OF_ROWS
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.POService#createReceipts(UserInfo, String, String, String, String, String, String, String, int)
      • createReceipts

        public java.util.Vector createReceipts(UserInfo ui,
                                               java.lang.String ponum,
                                               java.lang.String catalogCode,
                                               java.lang.String itemnum,
                                               java.lang.String itemsetid,
                                               java.lang.String mrnum,
                                               java.lang.String modelnum,
                                               java.lang.String packingSlipNum,
                                               java.lang.String requestedby,
                                               boolean isPowerApp)
                                        throws MXException,
                                               java.rmi.RemoteException
        Creates Receipts(both MatRecTrans and ServRecTrans) for the POLines that have not yet been received. The following steps are followed while creation receipts.The receipts created may be either service receipts or Material receipts.
        1. A set of POLines are obtained based on the user's criteria.The user can search on 7 different criteria like the Laborcode,ponum,catalogcode,itemnum,itemsetid,mrnum,modelnum,packingslipnum. The searching criteria is implemented specifically for use by buyer. The receipt power app also calls this method but its search criteria is based only on the ponum. The receiving of rotating items and inspection required items are not possible in the buyer app. The receiving power app allows receiving of all items, including rotating and inspection required items. Anybody calling this method must pass in a boolean flag as the last parameter to indicate the caller of this method. The receipt power app must call this method with a boolean value of true and the buyer app must call this with a value of false.
        2. Every line from this POLineSet is picked to find out if any corresponding shipment lines are available for each POLine.If there are no shipment lines available for this POLine , we create a service receipt or Material receipt depending on the type of POLine(whether this POLine is a service or a material line) using the values from the POLine(like qty,ponum,polinenum,polineid).
        3. If there are ShipmentLines available for this POLine, every Shipment line is picked and checked if receipts were already created for this Shipment line.If receipts were not created , new Material receipts are created for this Shipmentline using the values from the ShipmentLine like "shippedqty" etc.. Service receipts are never created for a ShipmentLine.The MATRECTRANS.MATRECTRANSID is copied to SHIPMENTLINE.RECTRANSID to indicate that a MATRECTRANS recors has alreadyy been created from this ShipmentLine Mbo.
        4. Service receipts(SERVRECTRANS) are created directly from POLines because there can be no shipment lines for a service POLine.
        5. Material or Service receipts can be created from POLines only if the PO they belong to is already APPROVED.
        6. A Vector containing 2 elements is returned to the caller of this method.The first element is a set of MatrecTrans records created and the second element in the vector is a set of ServRecTrans created.The UI code would loop through each set and display the contents of the MboSets to the user.
        7. It is important that Rotating asset cannot be received through Desktop Receiving(buyer).
        Parameters:
        - - Includes the parameters on which the user desires to search on and also the ISPOWERAPP boolean flag.
        1. USERINFO
        2. LABORCODE
        3. PONUM
        4. CATALOGCODE
        5. ITEM NUM
        6. MRNUM
        7. MODELNUM
        8. PACKINGSLIPNUM
        9. ISPOWERAPP
        Returns:
        - Vector containing 2 elements,the first element is the MatRecTrans MboSet which contains all the new Matrectrans records and the second element in the Vector is the ServRecTrans MboSet that contains all the newly careated ServRecTrans Mbos
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        POService.servicesToBeReceived(psdi.mbo.MboSetRemote, boolean, java.lang.String, psdi.security.UserInfo), POService.itemsToBeReceived(psdi.mbo.MboSetRemote, boolean, java.lang.String, psdi.security.UserInfo, boolean), POService.setReceiptVariables(psdi.mbo.MboRemote, psdi.mbo.MboRemote, psdi.mbo.MboRemote, psdi.security.UserInfo)
      • servicesToBeReceived

        public MboSetRemote servicesToBeReceived(MboSetRemote poLineSetRemote,
                                                 boolean checkInvBalance,
                                                 java.lang.String ownerSysId,
                                                 UserInfo userInfo)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Create ServRecTrans Mbos from all those POLine whose receipts are incomplete. The set of rules that are followed while creating Service Receipts are
        1. A set of POLines are passed into this method. Each POLine is picked and checked if the PO to which it belongs is either approved or inprg.
        2. SERVRECTRANS Mbos are created from these POLines and a set of pre-created SERVRECTRANS Mbos are returned to the caller.
        3. Due to numerous reasons, the creation of a SERVRECTRANS Mbo from a POLine Mbo may fail. In this case this POLine is ignored and the process moves to the next POLine. The exceptions that were encountered during the process of creating the Servrectrans are stored in a Vector called errorVector on the SERVRECTRANSSET. Anybody(the UI) who wants to further process the error messages must loop through this vector and display the messages or log into into an error log. The error vector is emptied every time this method is called.
        Returns:
        - An MboSetRemote containing the newly created SERVRECTRANS Mbos.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        POService.createReceipts(psdi.security.UserInfo, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
      • itemsToBeReceived

        public MboSetRemote itemsToBeReceived(MboSetRemote poLineSetRemote,
                                              boolean checkInvBalance,
                                              java.lang.String ownerSysId,
                                              UserInfo userInfo,
                                              boolean isPowerApp)
                                       throws MXException,
                                              java.rmi.RemoteException
        Create MatRecTrans Mbos from POLines if the POLines do not have their receipts complete. The following are the rules used in creating Material receipts.
        • A set of POLines is passed into this method. Each POLine from this set is picked and checked if each POLine has any corresponding ShipmentLines.
        • If this method is used by buyer ,it is important that when picking each POLine ,these POLines dont have a rotating item on them. It is also important that these POLine have the inspection required flag set to no.
        • Rotating items and inspection required items can be received only through the Receipt power app.
        • A set of shipmentlines are obtained for each POLine and receipts are created from these ShipmentLines. The values like shippedQty on the Shipmentline are used in the creation of receipts.
        • If any of these ShipmentLines were already used in the creation of receipts, they are ignored.
        • If there are no associated ShipmentLines for a POLine the information from this POLine is directly used to create a material receipt.
        • Due to numerous reasons, the creation of a MATRECTRANS Mbo from a POLine Mbo may fail. In this case this POLine is ignored and the process moves to the next POLine. The exceptions that were encountered during the process of creating the Matrectrans are stored in a Vector called errorVector on the MATRECTRANSSET. Anybody(the UI) who wants to further process the error messages must loop through this vector and display the messages. The error vector is emptied every time this method is called.
        Returns:
        - The MboSet that contains the newly created MatRecTrans Mbos.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        POService.servicesToBeReceived(psdi.mbo.MboSetRemote, boolean, java.lang.String, psdi.security.UserInfo), POService.setReceiptVariables(psdi.mbo.MboRemote, psdi.mbo.MboRemote, psdi.mbo.MboRemote, psdi.security.UserInfo)
      • createReceipts

        public java.util.Vector createReceipts(UserInfo ui,
                                               java.lang.String ponum,
                                               java.lang.String catalogCode,
                                               java.lang.String itemnum,
                                               java.lang.String itemsetid,
                                               java.lang.String mrnum,
                                               java.lang.String modelnum,
                                               java.lang.String packingSlipNum,
                                               java.lang.String requestedby)
                                        throws MXException,
                                               java.rmi.RemoteException
        Called by gui to obtain a set of matrectrans and servrectrans records that are pre-created from the poline. The polines are obtained from the ponum being passed in. This method calls the createReceipt method with 9 paramters. It passes the last parameter as false, since this is called from the buyer.
        Specified by:
        createReceipts in interface POServiceRemote
        Returns:
        Vector containing pre-created MATRECTRANS and SERVRECTRANS records
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.POService#createReceipts(UserInfo, String, String, String, String, String, String)
      • createReceipts

        public java.util.Vector createReceipts(UserInfo ui,
                                               java.lang.String ponum)
                                        throws MXException,
                                               java.rmi.RemoteException
        Called by the Receipts Power App to obtain a set of matrectrans and servrectrans records for a particular PONUM being passed in. Both the MATRECTRANS and the SERVRECTRANS are pre-created and the UI displays these pre-created records.
        Specified by:
        createReceipts in interface POServiceRemote
        Returns:
        Vector containing pre-created MATRECTRANS and SERVRECTRANS records
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.POService#getApprovalLimit(UserInfo, String)
      • isRotating

        public boolean isRotating(MboRemote poLineRemote)
                           throws MXException,
                                  java.rmi.RemoteException
        Checks if the item num on the poline that is passed in is a rotating item.
        Returns:
        true if the item is a rotating item, false otherwise.
        Throws:
        MXException
        java.rmi.RemoteException
      • generateReceipts

        public boolean generateReceipts(UserInfo ui,
                                        MboSetRemote targetMbos,
                                        MboSetRemote dataSheet)
                                 throws MXException,
                                        java.rmi.RemoteException
        Based on the selected rows of the MboSet containing the information required to create receipts, service or material receipts are created and added to the target mbo set passed in as the parameter. If the targetMbos is a ServRecTrans set, only those selected which have service flag on will have receipts created for them. If targetMbos is a MatRecTransSet, only those selected which have service flag turned off will have receipts created for them.
        Specified by:
        generateReceipts in interface POServiceRemote
        Parameters:
        ui - The user Info of who is calling this method.
        targetMbos, - ServRecTransSetRemote or MatRecTransSetRemote, where the newly created receipts will be added to.
        dataSheet - the non persistent mbo set remote of ReceiptInput Mbos which the selected ones will be based on to create the receipts.
        Returns:
        If any new receipts are created, returns true, otherwise, returns false.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.POService#generateReceipts(userInfo, MboSetRemote, MboSetRemote)
      • compareCopyTerms

        public void compareCopyTerms(MboSetRemote fromTermSet,
                                     MboSetRemote toTermSet)
                              throws MXException,
                                     java.rmi.RemoteException
        Copy Terms from one table to another. Do not copy the duplicate records. Compare two term sets fromTermSet and toTermSet. Copy records from fromTermSet to toTermSet, if the records are not in the toTermSet.
        Specified by:
        compareCopyTerms in interface POServiceRemote
        Parameters:
        fromTermSet - The fromTermSet is the base terms to be copied from.
        toTermSet - The toTermSet is the term set to be copied to.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        POService.compareCopyTerms(MboSetRemote, MboSetRemote)
      • changeStatus

        public void changeStatus(PORemote po,
                                 java.lang.String status,
                                 java.util.Date date,
                                 java.lang.String memo)
                          throws MXException,
                                 java.rmi.RemoteException
        Service Method used to change status.
        Specified by:
        changeStatus in interface POServiceRemote
        Parameters:
        po - PO Mbo
        siteid - SiteID of the PO
        status - The new status
        date - The date
        memo - The memo.
        Throws:
        MXApplicationException("po", - "invalidstatuschange"); MXApplicationException("po", "invalidstatus") MXApplicationException("po", "vendor") MXApplicationException("po", "shipmentExists") MXApplicationException("po", "statusdate") MXApplicationException("po", "exceedsMaxRelVol") MXApplicationException("po", "exceededMaxVol", params2") MXApplicationException("po", "approveamountexceeded") MXApplicationException("po","assetwolocglNull", params1) MXApplicationException("po","StoreLocIsNull", params1) MXApplicationException("po", "agreementnotapproved") MXApplicationException("po", "glcreditnotfull", params) MXApplicationException("po", "gldebitnotfull", params) MXApplicationException("financial", "GLRequiredForTrans") MXApplicationException("po", "GLDebitMustBeFull", params) MXApplicationException("po", "cannotClose"); MXApplicationException("po", "InspectionNotApproved", params) MXApplicationException("po", "ReceiptsNotInvoiced", params)
        MXException
        java.rmi.RemoteException
        See Also:
        throws MXException, RemoteException