psdi.app.common

Class TaxUtility

  • java.lang.Object
    • psdi.app.common.TaxUtility


  • public class TaxUtility
    extends java.lang.Object
    These are common methods used by tax related objects.
    • Field Detail

      • NUMBEROFTAXCODES

        public static int NUMBEROFTAXCODES
        constant to indicate number of taxcodes, currently, there are 5.
      • refetchNumTax

        public static boolean refetchNumTax
    • Method Detail

      • getTaxUtility

        public static TaxUtility getTaxUtility()
        Returns the static instance of this class. No need to create new instances.
        Returns:
        SKDUtility
      • refetchNumtax

        public void refetchNumtax()
                           throws java.rmi.RemoteException
        Force taxUtil to refetch the number of taxes
        Throws:
        java.rmi.RemoteException
      • setTaxattrValue

        public void setTaxattrValue(MboRemote mbo,
                                    java.lang.String taxattr,
                                    MboRemote mbofrom)
                             throws MXException,
                                    java.rmi.RemoteException
        Set value to all tax fields
        Parameters:
        mbo - need setvalue.
        taxattr - taxattr name.
        mbofrom - mbo to get value
        Throws:
        MXException
        java.rmi.RemoteException
      • setTaxattrValue

        public void setTaxattrValue(MboRemote mbo,
                                    java.lang.String taxattr,
                                    MboRemote mbofrom,
                                    long accessModifier)
                             throws MXException,
                                    java.rmi.RemoteException
        Set value to all tax fields
        Parameters:
        mbo - need setvalue.
        taxattr - taxattr name.
        mbofrom - mbo to get value
        accessModifier -
        Throws:
        MXException
        java.rmi.RemoteException
      • setTaxattrValue

        public void setTaxattrValue(MboRemote mbo,
                                    java.lang.String taxattr,
                                    boolean booleanValue,
                                    boolean checkDefaultValue)
                             throws java.rmi.RemoteException
        Set boolean value to all tax related fields.
        Parameters:
        mbo - need to set value.
        taxattr - Tax attribute name.
        booleanValue - Boolean value needs to be set.
        checkDefaultValue - Check database default value before setting values.
        Throws:
        java.rmi.RemoteException
      • setTaxattrValue

        public void setTaxattrValue(MboRemote mbo,
                                    java.lang.String taxattr,
                                    boolean booleanValue,
                                    boolean checkDefaultValue,
                                    long accessModifier)
                             throws java.rmi.RemoteException
        Set boolean value to all tax related fields.
        Parameters:
        mbo - need to set value.
        taxattr - Tax attribute name.
        booleanValue - Boolean value needs to be set.
        checkDefaultValue - Check database default value before setting values.
        accessModifier -
        Throws:
        java.rmi.RemoteException
      • setTaxattrValue

        public void setTaxattrValue(MboRemote mbo,
                                    java.lang.String taxattr,
                                    double doubleValue,
                                    long accessModifier)
                             throws java.rmi.RemoteException
        Set double value to all tax related fields.
        Parameters:
        mbo - need to set value.
        taxattr - Tax attribute name.
        doubleValue - Double value needs to be set.
        accessModifier -
        Throws:
        java.rmi.RemoteException
      • nullAllTaxcodes

        public void nullAllTaxcodes(MboRemote mbo,
                                    java.lang.String taxattr)
                             throws java.rmi.RemoteException
        Null all tax fields
        Parameters:
        mbo - need setvalue.
        taxattr - taxcode name.
        Throws:
        java.rmi.RemoteException
      • nullAllTaxcodes

        public void nullAllTaxcodes(MboRemote mbo,
                                    java.lang.String taxattr,
                                    long accessModifier)
                             throws java.rmi.RemoteException
        Null all tax fields
        Parameters:
        mbo - need setvalue.
        taxattr - taxcode name.
        accessModifier -
        Throws:
        java.rmi.RemoteException
      • setTaxesReadonly

        public void setTaxesReadonly(MboRemote mbo,
                                     java.lang.String taxattr,
                                     boolean readonly)
                              throws java.rmi.RemoteException
        null all taxcodes
        Parameters:
        mbo - .
        taxattr - taxcode name.
        Throws:
        java.rmi.RemoteException
      • setBaseTaxes

        public void setBaseTaxes(MboRemote mbofrom,
                                 MboRemote mbo,
                                 java.lang.String fromTaxAttr,
                                 java.lang.String taxAttr,
                                 double exchangeRate,
                                 long accessModifier)
                          throws java.rmi.RemoteException
        Calculate Tax Cost
        Parameters:
        mbofrom -
        mbo -
        fromTaxAttr -
        taxAttr -
        exchangeRate -
        accessModifier -
        Throws:
        java.rmi.RemoteException
      • zeroAllTaxes

        public void zeroAllTaxes(MboRemote mbo,
                                 java.lang.String taxattr)
                          throws java.rmi.RemoteException
        Zero all taxes
        Parameters:
        mbo - need setvalue.
        taxattr - tax name.
        Throws:
        java.rmi.RemoteException
      • zeroAllTaxes

        public void zeroAllTaxes(MboRemote mbo,
                                 java.lang.String taxattr,
                                 long accessModifier)
                          throws java.rmi.RemoteException
        Zero all taxes
        Parameters:
        mbo - need setvalue.
        taxattr - tax name.
        accessModifier - Access Modifier
        Throws:
        java.rmi.RemoteException
      • taxcodeDefined

        public boolean taxcodeDefined(MboRemote mbo,
                                      java.lang.String taxattr)
                               throws java.rmi.RemoteException
        check if all taxcode has empty string
        Parameters:
        taxattr -
        Returns:
        The MaxValue for the synonym or null if not found.
        Throws:
        java.rmi.RemoteException
      • getNumberofTaxes

        public int getNumberofTaxes()
                             throws java.rmi.RemoteException
        Return number of taxes using in the system.
        Returns:
        Number of taxes using in the system.
        Throws:
        java.rmi.RemoteException
      • compareTaxattrValue

        public boolean compareTaxattrValue(MboRemote firstMbo,
                                           java.lang.String taxattr,
                                           MboRemote secondMbo)
                                    throws MXException,
                                           java.rmi.RemoteException
        Compare two MBOs tax related fields are same value or not. Return true if two MBOs tax fields (for example, INCLUSIVE) are same value. Return false if tax fields are not the same value in two MBOs.
        Parameters:
        firstMbo - First MBO that needs to compare value.
        taxattr - Tax attribute name.
        secondMbo - Second MBO that needs to compare value.
        Throws:
        MXException
        java.rmi.RemoteException
      • setTaxattrFieldFlag

        public void setTaxattrFieldFlag(MboRemote mbo,
                                        java.lang.String taxattr,
                                        long flag,
                                        boolean state)
                                 throws java.rmi.RemoteException
        Set Tax attribute field flag.
        Parameters:
        mbo - need to set field flag.
        taxattr - Tax attribute name.
        flag - Action flag.
        state - State of the flag.
        Throws:
        java.rmi.RemoteException
      • resetTaxOrder

        public void resetTaxOrder()
                           throws MXException,
                                  java.rmi.RemoteException
        reset Tax exampt and tax code hierarchy order. should be called when the taxorder changes in organization app
        Parameters:
        mbo - need to set the order.
        Throws:
        MXException
        java.rmi.RemoteException
      • setTaxOrder

        public void setTaxOrder(MboRemote mbo)
                         throws MXException,
                                java.rmi.RemoteException
        Set Tax exampt and tax code hierarchy order.
        Parameters:
        mbo - need to set the order.
        Throws:
        MXException
        java.rmi.RemoteException
      • getTaxExemptOrder

        public java.lang.String[] getTaxExemptOrder(MboRemote mbo)
                                             throws MXException,
                                                    java.rmi.RemoteException
        get Tax taxexampt order
        Parameters:
        mbo - need to set tax exempt.
        Throws:
        MXException
        java.rmi.RemoteException
      • getTaxCodeOrder

        public java.lang.String[] getTaxCodeOrder(MboRemote mbo)
                                           throws MXException,
                                                  java.rmi.RemoteException
        get Tax taxcode order
        Parameters:
        mbo - need to set tax code.
        Throws:
        MXException
        java.rmi.RemoteException
      • getTaxesArray

        public double[] getTaxesArray(MboRemote mbo)
                               throws MXException,
                                      java.rmi.RemoteException
        Get Tax1-TaxN to a double array array. Return double array that holds tax1 to taxN.
        Parameters:
        mbo - MBO that needs to get tax.
        Throws:
        MXException
        java.rmi.RemoteException