Class MClient

    • Constructor Detail

      • MClient

        public MClient​(Properties ctx,
                       int AD_Client_ID,
                       boolean createNew,
                       String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        AD_Client_ID - id
        createNew - create new
        trxName - transaction
      • MClient

        public MClient​(Properties ctx,
                       int AD_Client_ID,
                       String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        AD_Client_ID - id
        trxName - transaction
      • MClient

        public MClient​(Properties ctx,
                       ResultSet rs,
                       String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
      • MClient

        public MClient​(Properties ctx,
                       String trxName)
        Simplified Constructor
        Parameters:
        ctx - context
        trxName - transaction
      • MClient

        public MClient​(MClient copy)
        Parameters:
        copy -
      • MClient

        public MClient​(Properties ctx,
                       MClient copy)
        Parameters:
        ctx -
        copy -
    • Method Detail

      • get

        public static MClient get​(int AD_Client_ID)
        Get client from cache (immutable)
        Parameters:
        AD_Client_ID - id
        Returns:
        client
      • get

        public static MClient get​(Properties ctx,
                                  int AD_Client_ID)
        Get client from cache (immutable)
        Parameters:
        ctx - context
        AD_Client_ID - id
        Returns:
        client
      • getAll

        public static MClient[] getAll​(Properties ctx)
        Get all clients
        Parameters:
        ctx - context
        Returns:
        clients
      • getAll

        public static MClient[] getAll​(Properties ctx,
                                       String orderBy)
        Get all clients
        Parameters:
        ctx - context
        orderBy - by clause
        Returns:
        clients
      • get

        public static MClient get​(Properties ctx)
        Get optionally cached client
        Parameters:
        ctx - context
        Returns:
        client
      • getInfo

        public MClientInfo getInfo()
        Get Client Info
        Returns:
        Client Info
      • getC_Currency_ID

        public int getC_Currency_ID()
        Get Default Accounting Currency
        Returns:
        currency or 0
      • getLanguage

        public Language getLanguage()
        Get Language
        Returns:
        client language
      • getLocale

        public Locale getLocale()
        Get Locale
        Returns:
        locale
      • setupClientInfo

        public boolean setupClientInfo​(String language)
        Create Trees and Setup Client Info
        Parameters:
        language - language
        Returns:
        true if created
      • getSetup_AD_Tree_Account_ID

        public int getSetup_AD_Tree_Account_ID()
        Get AD_Tree_Account_ID created in setup client info
        Returns:
        Account Tree ID
      • isAutoArchive

        public boolean isAutoArchive()
        Is Auto Archive on
        Returns:
        true if auto archive
      • getAcctSchema

        public MAcctSchema getAcctSchema()
        Get Primary Accounting Schema
        Returns:
        Acct Schema or null
      • save

        public boolean save()
        Save
        Specified by:
        save in interface I_Persistent
        Overrides:
        save in class PO
        Returns:
        true if saved
      • testEMail

        public String testEMail()
        Test EMail
        Returns:
        OK or error
      • sendEMail

        public boolean sendEMail​(int AD_User_ID,
                                 String subject,
                                 String message,
                                 File attachment)
        Send EMail from Request User - with trace
        Parameters:
        AD_User_ID - recipient
        subject - subject
        message - message
        attachment - optional attachment
        Returns:
        true if sent
      • sendEMailAttachments

        public boolean sendEMailAttachments​(int AD_User_ID,
                                            String subject,
                                            String message,
                                            Collection<File> attachments)
        Send EMail from Request User - with trace
        Parameters:
        AD_User_ID - recipient
        subject - subject
        message - message
        attachments - optional collection of attachments
        Returns:
        true if sent
      • sendEMailAttachments

        public boolean sendEMailAttachments​(int AD_User_ID,
                                            String subject,
                                            String message,
                                            Collection<File> attachments,
                                            boolean html)
        Send EMail from Request User - with trace
        Parameters:
        AD_User_ID - recipient
        subject - subject
        message - message
        attachments - optional collection of attachments
        html -
        Returns:
        true if sent
      • sendEMailAttachments

        public boolean sendEMailAttachments​(MUser from,
                                            MUser to,
                                            String subject,
                                            String message,
                                            List<File> attachments)
        Send EMail from User
        Parameters:
        from - sender
        to - recipient
        subject - subject
        message - message
        attachments - optional attachment
        Returns:
        true if sent
      • sendEMailAttachments

        public boolean sendEMailAttachments​(MUser from,
                                            MUser to,
                                            String subject,
                                            String message,
                                            List<File> attachments,
                                            boolean isHtml)
        Send EMail from User
        Parameters:
        from - sender
        to - recipient
        subject - subject
        message - message
        attachments - optional attachment
        isHtml -
        Returns:
        true if sent
      • sendEMail

        public boolean sendEMail​(String to,
                                 String subject,
                                 String message,
                                 File attachment)
        Send EMail from Request User - no trace
        Parameters:
        to - recipient email address
        subject - subject
        message - message
        attachment - optional attachment
        Returns:
        true if sent
      • sendEMail

        public boolean sendEMail​(String to,
                                 String subject,
                                 String message,
                                 File attachment,
                                 boolean html)
        Send EMail from Request User - no trace
        Parameters:
        to - recipient email address
        subject - subject
        message - message
        attachment - optional attachment
        html -
        Returns:
        true if sent
      • sendEMail

        public boolean sendEMail​(MUser from,
                                 MUser to,
                                 String subject,
                                 String message,
                                 File attachment)
        Send EMail from User
        Parameters:
        from - sender
        to - recipient
        subject - subject
        message - message
        attachment - optional attachment
        Returns:
        true if sent
      • sendEMail

        public boolean sendEMail​(MUser from,
                                 MUser to,
                                 String subject,
                                 String message,
                                 File attachment,
                                 boolean isHtml)
        Send EMail from User
        Parameters:
        from - sender
        to - recipient
        subject - subject
        message - message
        attachment - optional attachment
        isHtml -
        Returns:
        true if sent
      • sendEmailNow

        public boolean sendEmailNow​(MUser from,
                                    MUser to,
                                    EMail email)
        Send Email Now
        Parameters:
        from - optional from user
        to - to user
        email - email
        Returns:
        true if sent
      • createEMail

        public EMail createEMail​(String to,
                                 String subject,
                                 String message)
        Create EMail from Request User
        Parameters:
        to - recipient
        subject - subject
        message - message
        Returns:
        EMail
      • createEMail

        public EMail createEMail​(String to,
                                 String subject,
                                 String message,
                                 boolean html)
        Create EMail from Request User
        Parameters:
        to - recipient
        subject - subject
        message - message
        html -
        Returns:
        EMail
      • createEMailFrom

        public EMail createEMailFrom​(String from,
                                     String to,
                                     String subject,
                                     String message,
                                     boolean html)
        Create EMail with a specific from address
        Parameters:
        from - recipient
        to - recipient
        subject - subject
        message - message
        html -
        Returns:
        EMail
      • createEMail

        public EMail createEMail​(MUser from,
                                 MUser to,
                                 String subject,
                                 String message)
        Create EMail from User
        Parameters:
        from - optional sender
        to - recipient
        subject - subject
        message - message
        Returns:
        EMail
      • createEMail

        public EMail createEMail​(MUser from,
                                 MUser to,
                                 String subject,
                                 String message,
                                 boolean html)
        Create EMail from User
        Parameters:
        from - optional sender
        to - recipient
        subject - subject
        message - message
        html -
        Returns:
        EMail
      • createEMail

        public EMail createEMail​(MUser from,
                                 String to,
                                 String subject,
                                 String message)
        Create EMail from User
        Parameters:
        from - optional sender
        to - recipient
        subject - subject
        message - message
        Returns:
        EMail
      • createEMail

        public EMail createEMail​(MUser from,
                                 String to,
                                 String subject,
                                 String message,
                                 boolean html)
        Create EMail from User
        Parameters:
        from - optional sender
        to - recipient
        subject - subject
        message - message
        html -
        Returns:
        EMail
      • isClientAccounting

        public static boolean isClientAccounting()
      • isClientAccountingQueue

        public static boolean isClientAccountingQueue()
      • isClientAccountingImmediate

        public static boolean isClientAccountingImmediate()
      • isDisplayField

        public boolean isDisplayField​(int aDFieldID)
        Define is a field is displayed based on ASP rules
        Parameters:
        aDFieldID -
        Returns:
        boolean indicating if it's displayed or not
      • isSendCredentialsClient

        public static boolean isSendCredentialsClient()
      • isSendCredentialsSystem

        public static boolean isSendCredentialsSystem()