How to remove dollar sign $ and replace with KES/KSHS
Submitted by david_cloudegic on Tue, 05/05/2020 - 02:44
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
Re: How to remove dollar sign $ and replace with KES/KSHS
There's a few things you need to do:
This is used to determine the minimum denomination and currency rounding convention.
See https://openvpms.org/documentation/csh/2.1/admin/lookup/currency
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
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:
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:
Unix
In a setenv.sh script in the same directory as catalina.sh, add:
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:
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:
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:
You can verify that they have been set correctly by:
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:
before the call(s) to _EXECJAVA in the catalina.bat script
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
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:
To override the defaults, use:
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:
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:
2. From the command line, 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:
2. From the command line, 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:
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;
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.:
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:
Edit the Practice and on the Taxes tab, move all taxes from the Selected column to Available column, and click OK
Notes:
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