How to remove dollar sign $ and replace with KES/KSHS

Am new in openvpms, i would like to replace the currency $ with KSHS or KES, i have setup the country code to Kenya, KE but the same is not reflecting on the invoice, receipts documents, any help i will appreciate.

Thanks,

David

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: How to remove dollar sign $ and replace with KES/KSHS

There's a few things you need to do:

  1. Make sure you have set up the currency code on the practice
    This is used to determine the minimum denomination and currency rounding convention.

    See https://openvpms.org/documentation/csh/2.1/admin/lookup/currency
     

  2. Set the locale
    The system locale determines currency formatting.
    You can see what the current locale is by going to Help -> About.
    E.g.
    Version: 2.1.3 (20200427-101216.eaa7ffe) en-AU Australia/Sydney

    See https://openvpms.org/documentation/csh/2.1/topics/install/windows-locale...

 

 

Re: How to remove dollar sign $ and replace with KES/KSHS

Thanks alot, i have added the country Kenya in the Lookups and ISO code KE, further i have configured locale as described, and changed the currency sign.

However, the invoice still displaying the $ sign instead of Kshs.

Any help will be appreciated.

 

Re: How to remove dollar sign $ and replace with KES/KSHS

If you click on Help on the menu, what is the locale it displays?

(Mistakenly called Help - About previously).

Re: How to remove dollar sign $ and replace with KES/KSHS

this is what it is displaying 

 
en-US Africa/Nairobi
 
the sign now is £ but i need KES.

Re: How to remove dollar sign $ and replace with KES/KSHS

The issue is the en-US. This indicates that the system locale has English as the language, and US as the country. The Africa/Nairobi part is the timezone.

The way to get KES to display is by setting the language and country to a Kenyan locale that supports them. The following are all supported* Kenyan locales in Java 8:

Display Name     Code   Sample
-------------------------------
Somali (Kenya)   so-KE  Ksh1.00
Kamba (Kenya)    kam-KE Ksh1.00
Oromo (Kenya)    om-KE  Ksh1.00
Luyia (Kenya)    luy-KE KES1.00
Kikuyu (Kenya)   ki-KE  Ksh1.00
Meru (Kenya)     mer-KE Ksh1.00
Embu (Kenya)     ebu-KE Ksh1.00
Teso (Kenya)     teo-KE Ksh1.00
Luo (Kenya)      luo-KE 1.00KES
Samburu (Kenya)  saq-KE Ksh1.00
Kalenjin (Kenya) kln-KE Ksh1.00
Gusii (Kenya)    guz-KE Ksh1.00
Swahili (Kenya)  sw-KE  Ksh1.00
Taita (Kenya)    dav-KE Ksh1.00
Masai (Kenya)    mas-KE Ksh1.00

 

If you don't want to set your system locale to one of these, you can pass them as system variables to Java. For Tomcat, this means changing the CATALINA_OPTS variable e.g.:

CATALINA_OPTS=-Duser.language=so -Duser.country=KE

If you are running the standard Tomcat scripts, this can be done by setting the CATALINA_OPTS environment variable:

 

Windows
In a setenv.bat script in the same directory as catalina.bat, add:

set CATALINA_OPTS=-Duser.language=so -Duser.country=KE

Unix
In a setenv.sh script in the same directory as catalina.sh, add:

export CATALINA_OPTS=-Duser.language=so -Duser.country=KE

If you are running Tomcat as a service on Windows, the setenv.bat script is ignored. You will need to consult https://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html for instructions on setting the JvmOptions parameter.

 

* Locales were listed using the following code:

public class KenyanLocales {

    public static void main(String[] args) {
        System.setProperty("java.locale.providers", "COMPAT,CLDR");
        System.out.println("Available locales: " + Locale.getAvailableLocales().length);
        System.out.println("Kenyan locales:");
        System.out.printf("%-16s %-6s %s\n", "Display Name", "Code", "Sample");
        System.out.println("-------------------------------");
        for (Locale locale : Locale.getAvailableLocales()) {
            if (locale.getCountry().equals("KE")) {
                System.out.printf("%-16s %-6s %s\n", locale.getDisplayName(),
                                  locale.getLanguage() + "-" + locale.getCountry(),
                                  NumberFormat.getCurrencyInstance(locale).format(1));
            }
        }
    }
}

Re: How to remove dollar sign $ and replace with KES/KSHS

Hey, am still unable to locate 

Windows
In a setenv.bat script in the same directory as catalina.bat, add:

CATALINA_OPTS=-Duser.language=so -Duser.country=KE

i have setup the region country Kenya, language swa-ke, but still the currency sign is £ .

Help appreciated

Re: How to remove dollar sign $ and replace with KES/KSHS

What locale does Help now display?

Re: How to remove dollar sign $ and replace with KES/KSHS

 

en-GB Africa/Nairobi

 

Re: How to remove dollar sign $ and replace with KES/KSHS

My original entry for Windows was missing 'set'. Try:

set CATALINA_OPTS=-Duser.language=so -Duser.country=KE

You can verify that they have been set correctly by:

  1. going to Administration - System
  2. clicking on the Diagnostics button
  3. clicking on the Properties tab

Down the very bottom of the properties list, you should see entries for user.country and user.language corresponding to the values above.

 

Re: How to remove dollar sign $ and replace with KES/KSHS

I have this set , i dont know am going wrong

rem Get standard environment variables
if not exist "%CATALINA_BASE%\bin\setenv.bat" goto checkSetenvHome
call "%CATALINA_BASE%\bin\setenv.bat"
goto setenvDone
:checkSetenvHome
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
set CATALINA_OPTS=-Duser.language=so -Duser.country=KE
:setenvDone

Re: How to remove dollar sign $ and replace with KES/KSHS

The set CATALINA_OPTS should be in the setenv.bat script.

In your case, if the setenv.bat file exists, your set CATALINA_OPTS will never be invoked, execution will go to :setenvDone.

You can check CATALINA_OPTS has been set by adding:

echo CATALINA_OPTS=%CATALINA_OPTS%      

before the call(s) to _EXECJAVA in the catalina.bat script

rem Execute Java with the applicable properties

echo CATALINA_OPTS=%CATALINA_OPTS%
if not "%JPDA%" == "" goto doJpda
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%

 

Re: How to remove dollar sign $ and replace with KES/KSHS

Tanderson, thanks alot for the support, am now able to see KE on the system, but the user.country is showing GB, so on the invoice am seeing £ sign. see attached screenshot

AttachmentSize
country.PNG 13.35 KB

Re: How to remove dollar sign $ and replace with KES/KSHS

Your screenshot indicates you are running Tomcat as Windows service. This doesn't execute catalina.bat, so CATALINA_OPTS will not be set.

You need to pass -Duser.language and -Duser.country via the --JvmOptions parameter.
Alternatively, you can configure them using the Tomcat8w application.

See https://tomcat.apache.org/tomcat-8.0-doc/windows-service-howto.html#Tomc...

You can also try passing -Djava.locale.providers=JRE,CLDR but I have been able to get it to work without it.

 

For reference, you can see all of the available locales supported by your java installation using:

java -Djava.locale.providers=JRE,CLDR -XshowSettings -version

To override the defaults, use:

 java -Duser.language=so -Duser.country=KE -XshowSettings  -version

In the available locales, you should see:

so_ET, so_KE, so_SO, sq, sq_AL, sr, sr_BA, sr_BA_#Cyrl,

 

 

Re: How to remove dollar sign $ and replace with KES/KSHS

Please guide me on how to do this, am stuck. And its the only thing that is remaining we pay the subscription as we have done migrating all the clients.

Re: How to remove dollar sign $ and replace with KES/KSHS

Can you run Tomcat from the command line using the catalina.bat script with your environment changes, and get it to work?

Re: How to remove dollar sign $ and replace with KES/KSHS

if i run catalina.bat this is what am getting,

C:\>catalina.bat
'catalina.bat' is not recognized as an internal or external command,
operable program or batch file.

Re: How to remove dollar sign $ and replace with KES/KSHS

You need to run it from the <TOMCAT_HOME>\bin directory.

If you ran the Tomcat installer, it will be something like:

c:\Program Files\Apache Software Foundation\Tomcat 8.5\bin

i.e. the directory where you changed catalina.bat

Re: How to remove dollar sign $ and replace with KES/KSHS

this is the output 

C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>catalina.bat
Using CATALINA_BASE:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_HOME:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 8.5\t
emp"
Using JRE_HOME:        "C:\Program Files\Java\jre1.8.0_251"
Using CLASSPATH:       "C:\Program Files\Apache Software Foundation\Tomcat 8.5\b
in\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\tomc
at-juli.jar"
CATALINA_OPTS=-Duser.language=so -Duser.country=KE
'-Djava.util.logging.manager' is not recognized as an internal or external comma
nd,
operable program or batch file.
'JAVA_OPTS' is not recognized as an internal or external command,
operable program or batch file.
Usage:  catalina ( commands ... )
commands:
  debug             Start Catalina in a debugger
  debug -security   Debug Catalina with a security manager
  jpda start        Start Catalina under JPDA debugger
  run               Start Catalina in the current window
  run -security     Start in the current window with security manager
  start             Start Catalina in a separate window
  start -security   Start in a separate window with security manager
  stop              Stop Catalina
  configtest        Run a basic syntax check on server.xml
  version           What version of tomcat are you running?

C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Re: How to remove dollar sign $ and replace with KES/KSHS

These lines indicate CATALINA_OPTS has not be set correctly:

CATALINA_OPTS=-Duser.language=so -Duser.country=KE
'-Djava.util.logging.manager' is not recognized as an internal or external comma
nd,operable program or batch file.
'JAVA_OPTS' is not recognized as an internal or external command,
operable program or batch file.

Please revert catalina.bat to its original version and do the following:

1. Create a file named setenv.bat in the same directory as catalina.bat
    This file should contain a single line:

set CATALINA_OPTS=-Duser.language=so -Duser.country=KE

2. From the command line, run:

catalina.bat run

3. Log in to OpenVPMS and check if the locale has been set correctly

 

 

Re: How to remove dollar sign $ and replace with KES/KSHS

its running, i wait for it to finish?

21-May-2020 14:59:21.903 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\Apache Software Foundation\Tomca
21-May-2020 14:59:21.903 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\T
21-May-2020 14:59:21.949 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this
uring scanning can improve startup time and JSP compilation time.
21-May-2020 14:59:21.949 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundati
21-May-2020 14:59:21.949 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\T
21-May-2020 14:59:22.012 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this
uring scanning can improve startup time and JSP compilation time.
21-May-2020 14:59:22.012 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundati
21-May-2020 14:59:22.012 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\T
21-May-2020 14:59:22.059 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this
uring scanning can improve startup time and JSP compilation time.
21-May-2020 14:59:22.074 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundati
21-May-2020 14:59:22.074 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 49708 ms
[INFO,ScheduledDispatcher,pool-3-thread-1 - ] Not rescheduling until there are Azure Service Bus queues available

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Re: How to remove dollar sign $ and replace with KES/KSHS

Its running in the console window. You can connect to it from your browser.

Once you have checked that the locale is set correctl or not, you can kill it by pressing Ctrl-C in the console window.

Re: How to remove dollar sign $ and replace with KES/KSHS

its showing GB as user.country

Re: How to remove dollar sign $ and replace with KES/KSHS

i have restarted tomcat but nothing is changing

Re: How to remove dollar sign $ and replace with KES/KSHS

1. stop tomcat (including any Windows service)

2. change setenv.bat to include:

set CATALINA_OPTS=-Duser.language=so -Duser.country=KE -Djava.locale.providers=JRE,CLDR -Ddummyflag=true

2. From the command line, run:

catalina.bat run

3. Log in to OpenVPMS and check if the locale has been set correctly

4. If not go to Administration - System - Diagnostics

5. click on the Properties tab

6. If you don't see a property named 'dummyflag' with value 'true', then your setenv.bat script has not been run. You can stick echo statements in catalina.bat to find out why.

7. If you do see dummyflag, then your CATALINA_OPTS is being executed.
    If your locale is still not displaying what you expect, run:

java -Djava.locale.providers=JRE,CLDR -XshowSettings -version 

.....

Locale settings:
    default locale = English
    default display locale = English (Australia)
    default format locale = English (Australia)
    available locales = , aa, aa_DJ, aa_ER, aa_ET, af, af_NA, af_ZA,
        agq, agq_CM, ak, ak_GH, am, am_ET, ar, ar_AE,
        ar_BH, ar_DZ, ar_EG, ar_IQ, ar_JO, ar_KW, ar_LB, ar_LY,
...
        sk, sk_SK, sl, sl_SI, sn, sn_ZW, so, so_DJ,
        so_ET, so_KE, so_SO, sq, sq_AL, sr, sr_BA, sr_BA_#Cyrl,
        sr_BA_#Latn, sr_CS, sr_ME, sr_ME_#Cyrl, sr_ME_#Latn, sr_RS, sr_RS_#Cyrl, sr_RS_#Latn,
...

If you don't see so_KE in the output, try updating to the latest version of Java 8.

Re: How to remove dollar sign $ and replace with KES/KSHS

Hey, thanks alot.

I have setup as you described, it is now working as it should see below;

sw-KE Africa/Nairobi

TOTAL Ksh 522.00 Total includes VAT Ksh 72.00 Your account balance is Ksh 1,682.00

 

But the system goes back to GB after i restart tomcat.

Re: How to remove dollar sign $ and replace with KES/KSHS

see below screenshot showing system locale configuration;

 

AttachmentSize
locale.png 18.64 KB

Re: How to remove dollar sign $ and replace with KES/KSHS

If you are running Tomcat as a Windows service, then the catalina.bat and setenv.bat scripts aren't used. You need to configure the service with the changes you put in setenv.bat, using Tomcat8w.

1. Run Tomcat8w.exe, which is located in the Tomcat bin directory

2. Go to the Java tab

3. In the Java Options field, append the properties you added to setenv.bat, one property per line e.g.:

-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.5
-Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 8.5
-Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\logging.properties
-Duser.language=sw
-Duser.country=KE

4. Click Apply

5. Restart the service on the General tab

 

Re: How to remove dollar sign $ and replace with KES/KSHS

Tanderson, this worked.

Thanks alot for your patience and support. 

one more question, how do i exclude tax ....i have disabled tax on lookups and on practice but still showing total inclusive of tax on the invoice, how do i remove tax ?

 

Re: How to remove dollar sign $ and replace with KES/KSHS

You need to:

  1. remove taxes from the Practice
    Edit the Practice and on the Taxes tab, move all taxes from the Selected column to Available column, and click OK
     
  2. log out and back in again, to get the updated version of the Practice

Notes:

  • Printed invoices will always display a Tax Total line even if no taxes are configured.
  • Invoices that were done with tax enabled will record the tax amount when they were done. That is, subsequent changes to tax rates won't affect existing invoices

 

Re: How to remove dollar sign $ and replace with KES/KSHS

Thanks alot,

I resolved this, i removed taxes on product types:) and true its showing taxes 0.00 which is okay with me.

How do i change color on individual tabs, e.g. on customers(blue), products(pink), workflow(purple), etc

Thanks again

 

Syndicate content