Class MLocation

    • Field Detail

      • LOCATION_MAPS_URL_PREFIX

        public static String LOCATION_MAPS_URL_PREFIX
      • LOCATION_MAPS_ROUTE_PREFIX

        public static String LOCATION_MAPS_ROUTE_PREFIX
      • LOCATION_MAPS_SOURCE_ADDRESS

        public static String LOCATION_MAPS_SOURCE_ADDRESS
      • LOCATION_MAPS_DESTINATION_ADDRESS

        public static String LOCATION_MAPS_DESTINATION_ADDRESS
    • Constructor Detail

      • MLocation

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

        public MLocation​(MCountry country,
                         MRegion region)
        Parent Constructor
        Parameters:
        country - mandatory country
        region - optional region
      • MLocation

        public MLocation​(Properties ctx,
                         int C_Country_ID,
                         int C_Region_ID,
                         String city,
                         String trxName)
        Full Constructor
        Parameters:
        ctx - context
        C_Country_ID - country
        C_Region_ID - region
        city - city
        trxName - transaction
      • MLocation

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

        public MLocation​(MLocation copy)
        Parameters:
        copy -
    • Method Detail

      • get

        public static MLocation get​(int C_Location_ID,
                                    String trxName)
        Get Location from Cache
        Parameters:
        C_Location_ID - id
        trxName - transaction
        Returns:
        MLocation
      • get

        public static MLocation get​(int C_Location_ID)
        Get Location from Cache (immutable)
        Parameters:
        C_Location_ID - id
        Returns:
        MLocation
      • get

        public static MLocation get​(Properties ctx,
                                    int C_Location_ID,
                                    String trxName)
        Get Location from Cache (immutable)
        Parameters:
        ctx - context
        C_Location_ID - id
        trxName - transaction
        Returns:
        MLocation
      • getCopy

        public static MLocation getCopy​(Properties ctx,
                                        int C_Location_ID,
                                        String trxName)
        Get updateable copy of MLocation from cache
        Parameters:
        ctx - context
        C_Location_ID -
        trxName -
        Returns:
        MLocation
      • getBPLocation

        public static MLocation getBPLocation​(Properties ctx,
                                              int C_BPartner_Location_ID,
                                              String trxName)
        Load Location with ID if Business Partner Location
        Parameters:
        ctx - context
        C_BPartner_Location_ID - Business Partner Location
        trxName - transaction
        Returns:
        location or null
      • setCountry

        public void setCountry​(MCountry country)
        Set Country
        Parameters:
        country -
      • getCountry

        public MCountry getCountry()
        Get Country (immutable)
        Returns:
        country
      • getCountryName

        public String getCountryName()
        Get Country Name
        Returns:
        Country Name
      • getCountry

        public String getCountry​(boolean local)
        Get Country Line
        Parameters:
        local - if true only foreign country is returned
        Returns:
        country or null
      • getCountry

        public String getCountry​(boolean local,
                                 String language)
        Get Country Line
        Parameters:
        local - if true only foreign country is returned
        Returns:
        country or null
      • setRegion

        public void setRegion​(MRegion region)
        Set Region
        Parameters:
        region -
      • getRegion

        public MRegion getRegion()
        Get Region
        Returns:
        region
      • getRegionName

        public String getRegionName​(boolean getFromRegion)
        Get Region Name
        Parameters:
        getFromRegion - get from region (not locally)
        Returns:
        region Name or ""
      • equals

        public boolean equals​(int C_Country_ID,
                              int C_Region_ID,
                              String Postal,
                              String Postal_Add,
                              String City,
                              String Address1,
                              String Address2)
        Compares to current record
        Parameters:
        C_Country_ID - if 0 ignored
        C_Region_ID - if 0 ignored
        Postal - match postal
        Postal_Add - match postal add
        City - match city
        Address1 - match address 1
        Address2 - match address 2
        Returns:
        true if equals
      • equals

        public boolean equals​(Object cmp)
        Equals
        Specified by:
        equals in interface Comparator<Object>
        Overrides:
        equals in class PO
        Parameters:
        cmp - comparator
        Returns:
        true if ID the same
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class PO
      • isAddressLinesReverse

        public boolean isAddressLinesReverse()
        Print Address Reverse Order
        Returns:
        true if reverse depending on country
      • getCityRegionPostal

        public String getCityRegionPostal()
        Get formatted City Region Postal line
        Returns:
        City, Region Postal
      • toString

        public String toString()
        Return printable String representation
        Overrides:
        toString in class X_C_Location
        Returns:
        String
      • toStringCR

        public String toStringCR()
        Return String representation with CR at line end
        Returns:
        String
      • toStringX

        public String toStringX()
        Return detailed String representation
        Returns:
        String
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new
        Returns:
        true
      • afterSave

        protected boolean afterSave​(boolean newRecord,
                                    boolean success)
        After Save
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new
        success - success
        Returns:
        success
      • getMapsLocation

        public String getMapsLocation()
        Get edited Value (MLocation) for GoogleMaps / IDEMPIERE-147
        Returns:
        String address
      • getFieldLength

        public static int getFieldLength​(String columnName)
      • setErrorMessage

        public void setErrorMessage​(String errorMessage)
        Set error message
        Parameters:
        errorMessage -
      • getErrorMessage

        public String getErrorMessage()
        Get error message
        Returns:
        error message
      • processOnline

        public boolean processOnline​(int C_AddressValidation_ID)
        Perform online address validation
        Parameters:
        C_AddressValidation_ID -
        Returns:
        true if valid