psdi.app.pr

Class PRCost

  • All Implemented Interfaces:
    java.rmi.Remote, PRCostRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class PRCost
    extends Mbo
    implements PRCostRemote
    Mbo Object to represent a Purchase Requisition Cost object. Contains the cost information associated with each PRLine. The cost on a PRLine can be distributed across any number of general ledger accounts. Each PRCost contains information about which GLAccount carries the cost and how much percentage of the total cost it carries. Each PRLine will have at least one PRCost line with 100 percent of the cost assigned to one GLAccount.

    This an organiztion level object.
    The key attributes for this object are SiteId, OrgId and PRCostId. The attributes in this object are as follows:


    Attribute Name Description
    FinCntrlId The financial control identifier.
    GLDebitAcct The General Ledger account to which the PRCost is to be charged.
    LineCost The cost associated with this line.
    PRCostId Purchase Requisition cost Id. This Id is unique for each PRCost in the database.
    PRLineId Purchase Request line Id. This Id is unique for each PRLine in the database.
    PRNum Purchase Request num. Indicates the PRNum to which this PRCost line is associated.
    OrgId Identifier of the organization for this Purchase Requisition cost line.
    Percentage The percentage of cost of the PRLine distributed on each PRCost Line.
    SiteIdIdentifier of the site for this Purchase Requisition.

    Last Update: Tuesday, March 26, 2002 - Ganesh - javadocs

    • Constructor Detail

      • PRCost

        public PRCost(MboSet ms)
               throws MXException,
                      java.rmi.RemoteException
        Construct the PRCost object
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • init

        public void init()
                  throws MXException
        Initialize PRCost mbo. Set the following fields to readonly when fetched from database.
        • PRCost Line Id
        • PR Num
        • PR Line Id
        • Loaded Cost
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new PR Cost Line. Required Fields of the PRCost are initialised in this method. The following fields are initialised with their respective values


        Attribute Name Attribute Value.
        costlinenumAdd one to the existing maximum value
        fincntrlid PRLine's fincntrlid.
        gldebitacct PRLine's gldebitacct
        prcostid Unique key.
        prlineid PRLine's prlineid.
        prnum PRLine's prnum.
        quantityOwner PRLine's quantity
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXApplicationException(pr, - addprline) is thrown when the owner of this PRCost is not a PR
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Cannot delete a distribution if the PR is approved and if any receipts exists against the owner PO Line.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        Over-rides the method in the super class. If the field need not be copied during copy() return true else return false. The following fields are not copied from the source Mbo to the target Mbo.
        • PRCOSTID
        • PRLINEID
        • PRNUM
        • ORGID
        • SITEID
        Overrides:
        skipCopyField in class Mbo
        Throws:
        java.rmi.RemoteException
        MXException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        If this costline's percentage is still zero, clear the line cost, quantity and loaded cost.
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • checkPRCostValidity

        public void checkPRCostValidity()
                                 throws MXException,
                                        java.rmi.RemoteException
        Checks if the PRCost lines associated with this PRLine have correct values for percentage and loadedcost. If the percentage is not equal to hundred but the sum of the loadedcosts are equal to that of the parent prline, the percentage on the last distribution line is increased so that the sum of the percentages on the distribution is 100. The loaded cost on the last line is adjusted so that the sum of the loadedcosts on the distribution matches the loadedcost on the PRLine if the percentages total to 100.
        Throws:
        MXException
        java.rmi.RemoteException