psdi.app.common.purchasing

Class PurchasingLineMbo

  • java.lang.Object
    • Constructor Detail

      • PurchasingLineMbo

        public PurchasingLineMbo(MboSet ms)
                          throws MXException,
                                 java.rmi.RemoteException
        Construct the PRLine or POLine
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • initFieldFlagsOnMbo

        public void initFieldFlagsOnMbo(java.lang.String attrName)
                                 throws MXException
        Description copied from class: Mbo
        The logic of setting the readonly and required field flags to the mbo. Any setting of the field flags that require expensive operation, such as database query should be moved from init() to this method. However, those which don't require steps such as fetching Mbos can be left in init(). You can group the logic for a few attributes together if logic of deciding their flag is the same, or in other words, can be handled at once.
        Overrides:
        initFieldFlagsOnMbo in class Mbo
        Throws:
        MXException
      • setDefaultValues

        public void setDefaultValues()
        Insures that default value for LINETYPE is set first if this attribute has a default value
        Overrides:
        setDefaultValues in class Mbo
        See Also:
        Mbo.setDefaultValues()
      • copy

        public MboRemote copy(MboSetRemote mboset)
                       throws MXException,
                              java.rmi.RemoteException
        Description copied from class: Mbo
        Adds a new mbo to the set passed in and copies the information for each of the fields into the new mbo from this.
        Specified by:
        copy in interface MboRemote
        Overrides:
        copy in class Mbo
        Parameters:
        mboset - The set into which the new mbo will be added.
        Returns:
        The new mbo, with values copied from this mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.copy(MboSetRemote, long)
      • getTaxCodes

        public void getTaxCodes()
                         throws MXException,
                                java.rmi.RemoteException
        This method gets taxexempt and taxcodes for the poline/prline . The logic to get the taxexempt is based on taxorder table: This method also gets tax1code..taxncode for the poline/prline . if taxexempt is true, then no need to get taxcode. The logic to get the taxcodes is based on taxorder table as well: check for first table in taxorder table - if any of taxcodes(1-n) are populated, use all from the item. If all item taxcodes are null, check for next table taxcodes. If any are populated, use all . note : the default taxcodes for poline/prline are obtained initially from company or shipto based on PO's vendor during poline/prline's add(). primary use: validation of itemnum,storeloc fields of poline\prline.
        Specified by:
        getTaxCodes in interface PurchasingLineMboRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PurchasingLineMbo.getTaxCodes()
      • getDefaultTaxExempt

        public void getDefaultTaxExempt(MboRemote itemRemote,
                                        MboRemote invVendor)
                                 throws MXException,
                                        java.rmi.RemoteException
        This method gets taxexempt and taxcodes for the poline/prline . The logic to get the taxexempt is as follows: First check for itemorginfo, if record exist use it, else check for invvendor if record exist use it, else check item. This method also gets tax1code..tax5code for the poline/prline . if taxexempt is true, then no need to get taxcode. The logic to get the taxcodes is as follows: First check for item taxcodes - if any of taxcodes(1-5) are populated, use all 5 from the item. If all item taxcodes are null, check for invvendor taxcodes. If any are populated, use all 5. note : the default taxcodes for poline/prline are obtained initially from company based on PO's vendor during poline/prline's add(). primary use: validation of itemnum,storeloc fields of poline\prline.
        Throws:
        MXException
        java.rmi.RemoteException
      • getDefaultTaxCodes

        public void getDefaultTaxCodes(MboRemote itemRemote,
                                       MboRemote invVendor)
                                throws MXException,
                                       java.rmi.RemoteException
        This method gets taxexempt and taxcodes for the poline/prline . The logic to get the taxexempt is as follows: First check for itemorginfo, if record exist use it, else check for invvendor if record exist use it, else check item. This method also gets tax1code..tax5code for the poline/prline . if taxexempt is true, then no need to get taxcode. The logic to get the taxcodes is as follows: First check for item taxcodes - if any of taxcodes(1-5) are populated, use all 5 from the item. If all item taxcodes are null, check for invvendor taxcodes. If any are populated, use all 5. note : the default taxcodes for poline/prline are obtained initially from company based on PO's vendor during poline/prline's add(). primary use: validation of itemnum,storeloc fields of poline\prline.
        Throws:
        MXException
        java.rmi.RemoteException
      • setReceiptTolerance

        public void setReceiptTolerance(MboRemote Itemorg,
                                        MboRemote Invvendor)
                                 throws MXException,
                                        java.rmi.RemoteException
        This method set ReceiptTolerance for the poline . The logic to get the ReceiptTolerance is as follows: First check for invvendor, if record exist use it, else check for invvendor if record exist use it, else check itemorginfo.
        Throws:
        MXException
        java.rmi.RemoteException
      • isValidMRIfAny

        public void isValidMRIfAny()
                            throws MXException,
                                   java.rmi.RemoteException
        This method checks if the MRNUM on the POLINE is an approved MR if not it throws an exception. If this MR is not found in the database it checks the MXCOLLAB MRCHECK to see if an exception is need to be thrown. If this MR is from an outside system we do not throw and exception
        Specified by:
        isValidMRIfAny in interface PurchasingLineMboRemote
        Throws:
        MXApplicationException(po, - MRMissing) is thrown when the MRNUM mentioned on this POLine or PRLine does not exist.
        MXException
        java.rmi.RemoteException
        See Also:
        PurchasingLineMbo.isValidMRIfAny()
      • setDefaultOrderPrice

        public void setDefaultOrderPrice()
                                  throws MXException,
                                         java.rmi.RemoteException
        Get default order price. If there is contract reference, get orderqty, unitcost, manufacturer, modelnum, catalogcode, and orderunit from Contract Line. If there is no contract reference, get unitcost, manufacturer, modelnum, catalogcode, and orderunit from InvVendor table.
        Throws:
        MXException
        java.rmi.RemoteException
      • getInvVendorValues

        public void getInvVendorValues()
                                throws MXException,
                                       java.rmi.RemoteException
        Get InvVendor info for this item on POLine/PRLine. Get unitcost, manufacturer, modelnum, catalogcode, conditioncode and orderunit from InvVendor table.
        Throws:
        MXException
        java.rmi.RemoteException
      • getInvVendorValues

        public void getInvVendorValues(boolean callingfromContition)
                                throws MXException,
                                       java.rmi.RemoteException
        Get InvVendor info for this item on POLine/PRLine. Get unitcost, manufacturer, modelnum, catalogcode, conditioncode and orderunit from InvVendor table.
        Parameters:
        callingfromContition - If callingfromContition is true, it was called from Condition Code validation
        Throws:
        MXException
        java.rmi.RemoteException
      • setUnitCost

        public void setUnitCost(boolean gettingPriceFromInvCost,
                                double price)
                         throws MXException,
                                java.rmi.RemoteException
        Set unit cost. If the price is coming from InvCost, should get the base currency.
        Parameters:
        gettingPriceFromInvCost - To indicate the price is coming from InvCost.
        price - The price
        Throws:
        MXException
        java.rmi.RemoteException
      • setPriceQtyFields

        public void setPriceQtyFields()
                               throws MXException,
                                      java.rmi.RemoteException
        Based on ContractLine ChgPriceOnUse and ChgQtyOnUse value to set line cost, unit cost, order unit and quantity to be read only or editable. If ChgPriceOnUse is true, UnitCost and LineCost are editable. Otherwise, they are read only. If ChgQtyOnUse is true, OrderQty and OrderUnit are editable. Otherwise, they are read only.
        Specified by:
        setPriceQtyFields in interface PurchasingLineMboRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PurchasingLineMbo.setPriceQtyFields()
      • foundOtherLines

        public boolean foundOtherLines()
                                throws MXException,
                                       java.rmi.RemoteException
        If there is any other line with vendor exists, return true. Otherwise, return false.
        Throws:
        MXException
        java.rmi.RemoteException
      • validateDeliveryDate

        public void validateDeliveryDate()
                                  throws MXException,
                                         java.rmi.RemoteException
        Validation for ReqDeliveryDate and VenDeliveryDate in POLine/PRLine. If ReqDeliveryDate is after VenDeliveryDate, throw a warning message.
        Throws:
        MXException
        java.rmi.RemoteException
      • compareContractWithPOPR

        public boolean compareContractWithPOPR(MboRemote contractRemote,
                                               MboRemote poprHeader,
                                               MboRemote contractAuth)
                                        throws MXException,
                                               java.rmi.RemoteException
        Compare Contract vendor, shipvia, fob, paymentterms, freightterms, inclusive1 - inclusive5, ContractAuth billto and billtoattn with PO/PR header's info. If all of them are the same, return true. If any of them is not the same, return false.
        Parameters:
        contractRemote - The Contract object.
        poprHeader - The PO/PR object.
        contractAuth - The ContractAuth object.
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Application validation routine called before the PurchasingLineMbo object is saved. Validates that a line with a storeroom reference has a conversion factor value. *
        GROUPKEYREASON
        inventoryconversionDoesNotExistNullMUif a measure unit could not be determined.
        inventoryconversionDoesNotExist if a conversion unit cannot be found.
        inventoryconversionDoesNotExistInstruction in addition, if either of the above exceptions are thrown.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • checkConsignment

        public void checkConsignment(MboRemote lineMboRemote,
                                     MboRemote inventoryRec)
                              throws MXException,
                                     java.rmi.RemoteException
        This method called from PO/PR validation classes for itemnum and storeloc. It displays warning message when the header PO/PR vendor does not match with POLine/PRLine storeloc vendor.If the user clicks ok, it continues, Otherwise it blanks the POLine/PRLine storeloc.
        Parameters:
        lineMboRemote -
        inventoryRec -
        Throws:
        MXException
        java.rmi.RemoteException
      • setRecentItemNum

        public void setRecentItemNum(java.lang.String itemNum)
                              throws MXException,
                                     java.rmi.RemoteException
        09-23190
        Parameters:
        itemNum -
        Throws:
        MXException
        java.rmi.RemoteException
      • getRecentItemNum

        public java.lang.String getRecentItemNum()
                                          throws MXException,
                                                 java.rmi.RemoteException
        09-23190
        Returns:
        the most recent itemnum successfully set.
        Throws:
        MXException
        java.rmi.RemoteException