Monday 30 December 2013

Mimi kumshtaki

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree  is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

On the odd occasion I manage to beat the censor and manage to give my advice to people on the webERP forums and mailing lists I find that +Phil Daintree removes the advice I give. As can be seen here:

http://weberp.org/forum/showthread.php?tid=1949
and http://weberp.org/forum/showthread.php?tid=1945

and many other places on that forum, my advice that I freely give just gets removed. I wasn't able to understand this until recently, when I got informed by several people that what happens is that once they have posted an issue to the mailing lists or forums +Phil Daintree writes privately to them saying he will give them the solution in return for money. This explains why he doesn't want me helping them for free as it undermines his business. Now I have no problem with people earning money out of the work I have done on webERP but if I give my advice for free on a forum supposedly meant for a free exchange of advice I think it should at lest be left there. I will leave it up to the readers to judge on the honesty and morality of a person who would act like this.

+Phil Daintree has taken to publishing private emails between us without first seeking my consent. Here http://weberp.org/forum/showthread.php?tid=2005&pid=4483#pid4483 and in one of his comments here http://weberpafrica.blogspot.com/2013/12/banned-for-trying-to-help-african.html for instance. Now there is nothing in t6hese emails that is either relevant or that I would not want published (indeed the first is an example of his stupidity in banning me from the forums) but it is generally accepted both in email and written correspondence that you don't publish private correspondence without the agreement of all parties. I will leave it up to the readers to judge on the honesty and morality of a person who would act like this.

+Phil Daintree has said that I was never banned on the forums. However this screenshot from the forum shows that he is telling yet another untruth:
As can be seen it is a lie that I have not ever been banned from the forum. I will leave it up to the readers to judge on the honesty and morality of a person who would act like this.

+Phil Daintree has said that he never refused to allow me to post my thoughts to the mailing list when a long term contributor to webERP died. Here is a screenshot:
Nearly 6 months on it has still not been accepted my the mailing list administrator (+Phil Daintree). As can be seen it is a lie that he has never stopped me sending my thoughts on Mo's death. I will leave it up to the readers to judge on the honesty and morality of a person who would act like this

The comments to this post include serious allegations against me and so I have forwarded details of this serious allegation against me to Windsor Engineering Group Limited (the employer of +Phil Daintree  ), the New Zealand online police department, the ACCA, and to my solicitors. - Tim

Friday 27 December 2013

Project Mtuha on android.

Am very happy to announce that an android client for Project Mtuha our new open sourced health information system for Africa is being developed. Here is a preview of this client working on android device:


This fantastic app is being developed by Firas Ataya, Firas Tanan, Ammar Aranjy and Mostafa Natafji of the University of Damascus in Syria. We hope to have some very exciting news related to this project very soon.

Stay tuned!!

Tuesday 3 December 2013

Banned for trying to help African hospitals improve services

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree  is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

Earlier today I politely asked +Phil Daintree if I could mention Project Mtuha on the webERP forum and mailing list. The KwaMoja code is descended from webERP and so there is a great deal of webERP code in Project Mtuha. I asked him if he could come up with a form of words that was acceptable and I would use that  wording. Unfortunately not only did he say no, he has again banned me from helping webERP users on the forums and mailing lists, in order to stop me from mentioning our integrating our open source hospital for Africa.

The exact text of my email to him was :

"Subject: Project Mtuha

 Phil,

I would like to publicise this project on webERP. I realise you will
find a lot of things sensitive about it, so I am asking if you have
any ideas how this can be done to our mutual satisfaction?

Thanks
Tim"


I think it is clear that I was trying to be conciliatory, and at no point did I threaten to publicise the hospital system without the permission of +Phil Daintree  .


It is most disappointing that he should try to punish the webERP user base in this way.

It is also very strange as +Phil Daintree frequently uses the forums and mailing lists to promote his own commercial proprietary projects, while denying me the chance to put forward our open sourced free solution for African hospitals.

I thought we had moved past such silly behaviour when we spoke recently on the phone, but it seems Phil was not telling the truth. This is not the first time he has made such an agreement verbally and then reneged on it a short time later. It seems any agreement with him cannot be trusted!

It is typical of the way that +Phil Daintree works to make vague allegations and then when pressed for details he changes the subject. His tactics are to throw mud around and hope that some of it sticks. He has been proven again and again to be a liar and to be untrustworthy.

Friday 22 November 2013

Announcing Project Mtuha

I blogged recently about a plan to produce an application based on merging +KwaMoja with Care2x, and I thought it was time to update on progress. Currently the project is called Mtuha.

We have been working on the interface, Registration, Admissions, and Billing modules, but to continue much further with the project we require some form of sponsorship to make it happen. Please let me know if you have any ideas for this.

The interface now looks like this:

The icons along the top left of the toolbar represent different security tokens that the user will have in their login. For information about the security tokens used in KwaMoja see this blog post here
 
Holding the mouse over one of these icons brings down a menu containing those options allowed for that security token.

Clicking on any of these options loads up that script in the browser.

We have created a minimal framework that enables forms to be designed, and submitted. Also all forms can be edited, and each element in a form can be made mandatory, and it's visibility can be toggled on and off. This can be used for all forms, and converting the current forms in KwaMoja and Care2x to this framework is very easy.

The registration form contains many elements, a few of which can be seen below, but any of these can be hidden, or added, made mandatory, or optional.
There is a stock type of "Registration Items", and any items set up with this category will appear as options at the bottom of the registration screen:
On completion of the registration, the above appears, and any options that user is entitled to perform are shown on the right. Clicking on print, just prints the patient detail label. Mtuha can be setup to use the bar code, so that when the bar code is scanned by a mobile device (phone etc.) you can be taken to a chosen place in Mtuha for that patient.
There is a new patient search facility, which is the same as used throughout Mtuha when a patient number needs to be found. When you start to type in any of the search fields, the list of possible patients automatically updates. At the far right of each patient details there is a small icon. Clicking that icon will bring up a list of options that the particular user can choose to perform on that patient record.

This particular user can only modify the registration details, or admit the patient. If the user was a cashier then they would see options to bill the patient.
Clicking to admit the patient takes you to the admissions form shown here.


Like the registration form it is fully customisable, and all fields can be made optional/mandatory, or be hidden/shown.


As with the registration form, there is a stock type called Admission. Any items setup with this stock type will appear at the bottom of the admissions form. You can select one or many of these billable items, just as with registration.


If the user then logs in as a cashier, and searches for a patient they are then presented with an option to bill the patient, rather than previously seeing the options to register and admit. Selecting that option brings up this screen, showing any unpaid items for that patient.


Clicking on the button prints a bill for this patient. However it also does a lot more. If any of the items are physical stock items then the required stock movements are processed, together with all related General Ledger transactions. Each cashier has a separate cash account set up for them, and processing this bill will debit that account, and credit the profit and loss account with the sale. At the end of their shift there is a report that should be run by the cashier detailing all the cash they should have received. This report is checked against the physical amount of money the cashier has, and is then passed on to the accounts department.

As I said at the beginning of this article, what we really require now is funding to hire more African developers, and pay for my time.

Wednesday 16 October 2013

Help required!!

I have had a plan bubbling away for sometime to take care2x and KwaMoja and merge them together as one complete integrated package. I have written before about how KwaMoja and Care2x have been used in African hospitals, using the KwaMoja api to communicate between the two applications. Now my idea is to create a single open sourced application with a unified interface and a single login that can be rolled out across hospitals all over the continent.

However this requires resources which as ever are in short supply. To get good African programmers who can work full time on this project requires money.

My idea to raise this is to start a Kickstarter project to generate the funding. However I need some help, as a lot of this stuff requires marketing skills that I do not possess. For instance they say a promotional video is more or less essential to a successful project, but I do not have the first idea of how to create one.

There is no money to pay for these services up front, but if someone wants to volunteer (remember that KwaMoja and Care2x have been written by volunteers down the years) I could look to recompensing them later if and when the project gets funded, as a promotional video could be useful in pushing the final software to hospitals. Obviously anybody helping would also gain a lot of publicity for their skills.

If anyone is interested in helping this in any way, then please send me an email on tim.schofield1960@gmail.com.

Thanks in advance!!

Wednesday 9 October 2013

Africa and Open Source software

Africa is the most under represented continent when it comes to contributing to open source projects, yet it stands to gain the most of any continent from it. This seems so sad to me.

Why is this so?

There is a perception with many African developers I have met that Open Source is something done by rich western volunteers, in order to benefit people like themselves. There is a tendency to mix it up with the work of Save the children fund, or Oxfam. I have heard the following said many times: "I am an African I can't afford to be a volunteer". It is viewed as a resource to be taken from, but not to give back to.

This is not to say there are no African open source developers, just far fewer than there should be given the wealth of talent on the African continent.

Why should Africans should participate fully Open Source? 

There are two very obvious reasons why individuals can gain from fully participating in open source projects

Firstly by interacting with other programmers it is possible to increase your skill set in ways that would otherwise be impossible. Many of the worlds best programmers are involved in open source projects and are happy to mentor those who are new.

Secondly by contributing to open source projects you enhance your reputation globally. Most if not all the worlds big software companies monitor open source projects looking for talented programmers. In what other way could a student at an African university bring their talents to the attention of the likes of Google or Facebook? Open source show cases your skills.

Proposal to build an African software industry

So much for how contributing to open source can help individuals progress, but what about on a country level? Every year African countries spend millions of dollars on software licenses, almost all, if not all of this money is paid to western companies and none of this money ends up in the African economy. This is despite the fact that all the software necessary is available through open source. So my proposal is this:

I will use Uganda as my example here but this applies equally to any African country.

I propose that the largest university in Uganda (Makerere University) would create a Linux Distribution, based on one of the big distributions such as Ubuntu, Debian, Suse or Fedora. This would be branded for Uganda, and include any applications specific to Uganda, together with any local language translations. This distribution would be maintained by the university and would be used as the basis for their teaching, and funded by the government with money that would otherwise have gone abroad. It would be an excellent resource for all areas that are taught in the computer science department. Creating this is not a huge task as there is a large amount of documentation on this subject to be found on the web.

The distribution would contain all the applications needed, such as LibreOffice for word processing and spreadsheets, Firefox for web browsing etc.

The government would commit to moving all their computers to this distribution. If the city of Munich in Germany can achieve this I see no reason why Kampala can't.

The contracts to support the government departments would then be handed out to local support companies, who would have been trained in the distribution at the university. Thus the money instead of going to large American multinationals would stay in Uganda and would circulate within the Ugandan economy, making a sustainable Ugandan IT industry.

Private industry would see the increase in skills with Linux, and the consequent decrease in the skill levels in other operating systems. They would start to take the pragmatic decision to move to this Linux distribution.

We have seen recently how the big American corporations have been "encouraged" to give the security services back doors into their operating systems, allowing the likes of the NSA to view what is on the computers of anybody in the world using their operating systems. This would include (in theory) any member of the Ugandan government. Using a Ugandan operating system built in Uganda, with the code open to view would stop this happening.

So there it is, a simple recipe for creating a sustainable IT industry within Africa, keeping the money in Africa, and potentially exporting IT to the rest of the world, instead of constantly leaking the money out of the Africa. All of this could be achieved with the technology available now. All it takes the will in the government to make it happen. Lets put pressure on them to start making it happen today!

Tuesday 8 October 2013

How the webERP community takes second place to Phil's vendetta

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree  will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

Back at the end of July a user posted a bug report on the webERP forums (http://www.weberp.org/forum/showthread.php?tid=981). As +Phil Daintree has made it so I am not allowed to help people on the forum I sent the user the fix privately and sent it on to +Phil Daintree

I also posted the fix to the nabble forum in order that the maximum number of users got the benefit of the fix.

Unfortunately +Phil Daintree refused to commit my bug fix, being happier that the community should use buggy software than recognise that I had fixed the bug. My post to the nabble forum was also taken down by +Phil Daintree  at the same time as the post about how many bytes a particular JavaScript function used.

The same user has now upgraded and found that 4.11 has over written the fix given to him (http://www.weberp.org/forum/showthread.php?tid=1935).

Who suffers in this scenario? Not me, I have the fix. Not +Phil Daintree, or +Phil Daintree's paying customers, they too are given the fix. No the people he makes suffer are the webERP community who are denied the bug fixes I am supplying.

The project is being run to help +Phil Daintree in his vendetta against me rather than for the benefit of the community.

Come on +Phil Daintree step aside and let the community run this project!

Monday 30 September 2013

What KwaMoja is and what KwaMoja is not

This is a post about what exactly KwaMoja is, and why we are doing it, and also to explain properly what it is not.

Origins

KwaMoja has its origins in some lectures I did at a community college in Kenya. The basis of the lectures was extending the webERP software in various directions. After the lectures some of the students wanted to carry on the work. Due to the unfriendly and often abusive style of management at webERP and I suggested they speak to Munir Patel who had previously talked to me about doing an African/Indian based fork of webERP, and so KwaMoja was born.

When it became obvious that certain people were intent on destroying the project for their own selfish ends, I got involved more deeply.

Vision

Our vision at KwaMoja is to make African businesses more competitive with those in the west. In the Eighties, western businesses went through a revolution, lowering inventory costs, improving efficiencies, improving quality, and raising profits for their shareholders. Central to this revolution was the rolling out of ERP software. Very few businesses in the west do not now take advantage of ERP. We believe that KwaMoja is that ERP software for African businesses.

Free Software

KwaMoja is Free software. Now free in this sense means that KwaMoja code comes to you free of restrictions. You can do whatever you like with it, so long as you maintain those freedoms. When you buy software from Apple for instance, the software comes with many restrictions as to what you can and cannot do with it. You can only use it to do what some people in grey suits at Apple's HQ want you to do with it. Free software does not necessarily mean that you cannot charge people for the software, anybody who wants to charge for KwaMoja can do, and anybody who wishes to give it away free can also do that.

Where is the money?

KwaMoja itself has no funding. It is not a company, we have no income, and we have no employees. It is made possible by donations of time and money from those of us involved. However we are not super rich philanthropists. Far from it, and we have had to earn money elsewhere while getting the project ready for release. There is no money to pay web designers, programmers etc.

Many people and companies in the west have become wealthy by being consultants in the implementation of ERP systems. They have no financial interest in the software themselves. They merely work on the implementation side, and people like SAP get the software fees themselves. These fees are often prohibitive to African companies. Our aim at KwaMoja is to build an ecosystem so that many people can get rich on the back of the KwaMoja project. Our aim is to get as many people as possible selling consultancy services around this project.

Consultants who work for $250 a day are considered very cheap, even in African countries. The rewards can be huge.

Why would someone need consultancy?

According to research at least 65% of ERP implementations fail. Failure can often have disastrous implications for a business, whilst success can bring huge benefits to a business. Employing good experienced consultants is often the difference between success and failure. This is why western businesses will always pay for consultancy.

Why would I want to donate my time and skills?

Good question. As I have said above we are none of us rich philanthropists, and we are all seeking to make some money in the end. Imagine you are a company that is looking for consultancy support for it's implementation . Would you choose a consultant who has been actively involved in the building of the software, or someone who has done nothing for it? My guess is that those who contribute the most will earn the most as consultants. You would also gain a global audience to showcase your skills.

Is it just for Africa?

No, definitely not. This software can be used anywhere in the world.

Conclusion

So there it is, that is what KwaMoja is. Sound interesting? Then join us, there is always tons to do.

Saturday 28 September 2013

The "illegal characters" debate

This page is written in response to the lies tha +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree  is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies..

In response to this blog post of mine, +Phil Daintree has posted this to the mailing list. I tried to post a reply to the mailing list, but it was rejected, so I publish it here in the hope it is useful to the debate:

"Phil,

It seems to me that in your attempts to control what characters the user can use you have lost sight of why you are trying to do it. The point of an ERP is to help the user do what is best for their business rather than to tell them what you think is best for their business.

For instance you have recently put a check on what characters can be used in the users company name. Why should it be up to you to decide how a user should spell their company name? What you should be doing is trying these characters in the company name, and then looking at all the places in the code where that field is used, and seeing if these characters cause a problem. I suspect they don't cause any issues, but if they do you should be trying to resolve those issues, not just banning the characters.

Likewise with item codes. The code 3.5K/V-5"x3" would be a perfectly legitimate code for a user to want to use, but would fail the new illegal character tests on several grounds. Yes a user could work around this problem, but why should they when most other ERP packages will allow it?

It seems to me that this desire of yours to control everyone and everything is pulling webERP down. Let us free the users up to do what is best for them, instead of all the time telling them what you think is best for them.

Thanks
Tim"

Thursday 26 September 2013

Setting up your computer for KwaMoja

KwaMoja is a web application. This means that the software runs on a server, and is viewed through a web browser. These need not be on different computers, it is perfectly possible to have both the server and the browser on the same machine.

For best results the browser should be a relatively recent release but as all browsers are freely available for download this should not be a problem.

The web server can be run on most operating systems released in the last decade. It should include a web server, a database server, and the PHP language.

On windows we recommend using the WampServer. This can be downloaded for free and installed with one click. This will install all of the above applications. You will find a folder called something like c:\wamp\www where you should unpack your KwaMoja code. Once the wamp server is started, just point your browser at http://localhost/KwaMoja and you should be greeted by the KwaMoja installer.

On Debian based Linux systems the packages can be installed by using the following command (https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu):

sudo apt-get install apache2 php5 mysql-server


sudo yum install httpd mysql mysql-server php php-mysql

On Apple computers you can setup a one click install using MAMP. Like with windows it will install everything in one go.

Of course as with most things there are many other ways to achieve this, (use nginx instead of apache, use mariadb instead of mysql) but the above methods will get you started with the new beta of KwaMoja.

Wednesday 25 September 2013

New installer for KwaMoja

The final bit of the new +KwaMoja version is now complete and just needs testing. This is the brand new installer. 

Firstly it should be said that this builds on the excellent work of +Exson Qu and +iced lava. After downloading +KwaMoja and placing the code in the web root, point your browser to the code.

You should be taken automatically to the installer screen.

This is the wizard that will guide you through the entire installation process.

The first selection you must make is the language that you want to use for the installation, and for the admin user.
 
Changing this language setting will immediately refresh the screen, and you should now see it in your chosen language.


This language setting will remain constant through the rest of the installation process.

NB You must have the correct language setup on your server.

The final step on this first page is to choose the database management system that you want to use in +KwaMoja

Currently only MariaDB, MySQL, and MySQLi are supported, although +Fahad Hatib has nearly completed his work to have PostgreSQL  supported in +KwaMoja. However it was decided to leave this till after this release to give maximum testing time for his work. Clicking on "Next Step" takes you to the second screen of the installer.


This screen will make all the necessary checks on your system to ensure that
+KwaMoja can be installed and run on your server.

If you get any failures here then you will be presented with a button to "Check Again". Just correct the problem and then click this button, until all problems are resolved, and you get a screen like the one on the right. Then move on to the next step.


This screen is for details of the database connection that we are going to use.

The first field is for the host machine that the database is on, relative to the web server, not to the client machine. So if the web server and the database server are on the same machine this can be left as "localhost". An IP address can also be used.

The last two fields are for the login details to your database. This shouldn't be confused with the login details to +KwaMoja. The second field is for the name of the database that you will use. This should only contains alphanumeric characters, and no spaces. If the database login that you supply doesn't have permissions to create a database (a lot of shared hosting companies do not allow this) then this database must be created manually before the installation process begins.


Clicking on "Next Step" takes us to the final screen of the installer. The first field is for the name of your company. This should be the full name that you want to appear on all paper work. Next we select a chart of accounts to be used for our company. Currently we have 27 charts kindly donated from all around the world - Many thanks to all those who have donated. Next is the timezone that the server is located in +KwaMoja should choose the correct for you. Finally you can upload your company logo which appears throughout +KwaMoja If you don't upload a logo the default +KwaMoja logo will be used instead.

Next we have the option to install some random test data.
Choose this if you are just evaluating +KwaMoja otherwise leave this unchecked.
Finally you need to enter the details for the +KwaMoja system administrator account. Default is a userid of admin, and a password of "kwamoja", but you can decide your own.

Once done click on the install button, and the installation process will start.

This will firstly create a config.php file based on the settings you give. Then create a database for you (this process is quite slow as it performs many checks along the way to ensure the database is correct). Finally if you have elected to load the random demonstration data, this will then be loaded.

Once this is done, a button will be shown to start +KwaMoja. You will need to login using the system administrator login that you provided.

Once logged in, you will be taken to some of the configuration screens to setup your +KwaMoja. It is important you read these screens properly, and give the correct information. If in doubt consult the manual.

You can download this version of +KwaMoja for free from here

All feedback is appreciated. Please log any issues you find here.

Wednesday 18 September 2013

The importance of free and open discussion in projects

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree  is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

+Phil Daintree has frequently said on webERP that when he gives his opinion on a subject then nobody is allowed to contradict his opinion and no more discussion on the subject should happen. People who ignore this and express different opinions on any subject find themselves banned from any future discussions.

This is fine as long as the decision that +Phil Daintree has come up with is correct, and that no better solution can ever exist. However when the decision is wrong then the repercussions can be very damaging.

For instance recently +Phil Daintree decided to use regular expressions to filter input into forms. This is a good idea in theory, but needs careful thought and planning, as the implications for non English characters are huge. As Phil had announced this decision as his, then no discussion was allowed.

We now have a webERP system (versions 4.11 and 4.11.1) which is totally unusable to anybody not using the standard 26 English alphabet characters. Not only this, but many of the other bugs already found in 4.11.1 and many of the others that await discovery could have been avoided by allowing free and open discussions.

This is a mistake that we intend to avoid in +KwaMoja. Anybody is allowed to contribute anything to any discussion. Even arguments are good as they force both sides to think through their ideas carefully.

"The only people who are afraid to argue are those who know themselves to be wrong".

Friday 6 September 2013

Introducing the KwaMoja dashboard

+KwaMoja now has a customisable dashboard.



This code has been kindly donated to +KwaMoja by +Mythri Hegde of Netelity and adds considerably to the usability of +KwaMoja.

We can produce any number of small reports to show in the dashboard. +Mythri Hegde has already contributed nine, and they look like this:

Each of these mini reports has a security token assigned to it. The user can only add the report to their dashboard if they have that security token. See here for more details of security tokens.

All a user has to do to remove it from their dashboard is co click on the X in the top right hand corner of the report.

At the bottom of the dashboard is a selection box
Clicking on this drops down a list of all those reports that a user can add to their dashboard, as follows:
Choosing from here adds the report to the users dashboard. The screen shot above shows 6 reports, but the user can have any number of reports showing depending on what they want.

Many thanks to +Mythri Hegde for her hard work and for contributing the code back to the project.

See the dashboard in operation by going to the KwaMoja demo at http://www.kwamoja.com/demo

Tuesday 3 September 2013

KwaMoja as it is used in African hospitals

People always talk about the use of +KwaMoja  in manufacturing, and distribution businesses, but +KwaMoja  also plays a big part in the administration of several hospitals.

We have written some extensions to +KwaMoja  that enable it to link seamlessly with an open source health information system project Care2x. All the financial and inventory transactions are delegated to +KwaMoja , and Care2x deals with the clinical information side.

When a patient is admitted in Care2x, +KwaMoja  Care2x will send this information to +KwaMoja  and if the patient is not already setup as a customer they will be setup. The interface with Care2x uses customer branches to indicate who will be paying the bill. If the patient pays in cash then they will get a branch with a code of CASH setup. If they are an insurance customer then they get a branch with an identical code to the customer code for that insurance company.

When any transaction occurs in Care2x which affects the financial status of the hospital then that information is sent to +KwaMoja.

So, when as in this example the doctor prescribes drugs for a patient in Care2x the transaction will be sent to +KwaMoja.

The cashier, who uses +KwaMoja will search for this patient and will be shown a list of all unpaid transactions for that patient, as can be seen here.

Once the items are paid for then the cashier will give the patient a receipt, which they can then exchange for the drugs, or test, or whatever the item is for.

If the item is a physical item, such as drugs as in this case +KwaMoja will automatically deduct the amount from the stock held. +KwaMoja will also do all the double entry bookkeeping for this transaction behind the scenes.

At the end of the cashiers shift, they can produce a report of all monies that they have taken, which should tally with the physical amount of money they have. This is transferred both physically and within +KwaMoja to a central cash account.

Using +KwaMoja the hospital can gain greater efficiency. It can also gain greater security against fraud, and as +KwaMoja is web based if there are remote funders of the hospital, such as a western charity, or central government, they get greater visibility on how the hospital is performing. All this leads to better health care for the people, and +KwaMoja is playing a central part in this.

Sunday 25 August 2013

Using regex patterns for verifying input

We have recently been using HTML 5 and JavaScript to do form verification, as Fahad blogged about here

I have just added pattern matching to this for email and telephone number verification. Thanks to +Exson Qu  for the regex ju-ju. 

HTML5 allows form elements of type "tel" and "email". We want to add in a regular expression to each of these types to verify the element as it is typed. The regular expressions we have used are "[0-9 +s()]*" for the telephone numbers, and "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" for email addresses. Neither of these are 100% as it is not possible to deal with every method in the world of writing telephone numbers, and every method of constructing emails addresses, however these will do a good job on most.

It is feasible to add html in the form:

<input type="tel" name="Telephone" pattern="[0-9 +s()]*" value="" />

However this would need to be done wherever there is a telephone or fax number to be entered into KwaMoja. Then if we decide to improve the regex we would need to go through all these entries again. This can get messy.

It would be better to do this via JavaScript. We have a function called initial() that gets called when the page has been loaded. This function iterates through all the form elements in the page that has just been loaded and appends the regex pattern any with a type "tel" or a type "email". Here is the function:

function initial() {
    var n = document.getElementsByTagName("input");
    for (i = 0; i < n.length; i++) {
        if (n[i].type == "tel") n[i].pattern = "[0-9 +s()]*";
        if (n[i].type == "email") n[i].pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
    }
}


We also use this function to assign other properties to form elements.

Saturday 17 August 2013

Warehouse management - Part 1

I have been giving a lot of thought recently to how we should implement warehouse management. Just using row/bay/bin is too restrictive. 

If we have a warehouse structured like this :


it will not fit well to a rigid system of warehouse management.
 

What I propose a system where we have just one table for areas that can contain stock items. The best name would be "Locations" but that has already been taken, so I will for the moment call them "Containers". All containers can have parent containers. The above warehouse now looks like this:

As you can see the warehouse now can be modeled as a tree diagram. Each container can be set as to whether it can contain items, or just act as a container for child containers.







Each container has details of its physical position in the warehouse, and it's size. Also properties as to what it can contain (refrigeration unit for instance). Whether the contents are liquid etc.


Starting to implement this is easy, as each warehouse can be defined as a container. We just need a new table to hold the container information.

Monday 5 August 2013

How to sort HTML tables in JavaScript

A short while ago I blogged that KwaMoja now has the facility to sort HTML tables in JavaScript. I have had numerous requests to explain more about how this is done, so here is a brief tutorial on achieving this.

The table has to be constructed in a specific way. The area of the table to be sorted has to contain one row of <th> cells followed by any number of <td> rows.

So the following HTML would be suitable:

<tr>
        <th>Header1</th>
        <th>Header2</th>
</tr>
<tr>
        <td>Data11</td>
        <td>Data12</td>
</tr>
<tr>
        <td>Data21</td>
        <td>Data22</td>
</tr>

which will look like this:


Header1 Header2
Data11 Data12
Data21 Data22

This area to be sorted must be completely contained within a pair of tags, for instance between a <table> and a </table>. If you require other things in the table, then I generally use a <tbody> and a </tbody> to surround the area to be sorted.

The JavaScript function starts with the following:



1 function SortSelect(selElem) {
2    table=selElem.parentNode.parentNode;
3    headerRow = table.rows[0];


The function is called by clicking on the <th></th> element of the column that we wish to sort by. Thus the parameter "selElem" will be that cell. The parent of that cell will be the row (<tr>) containing the header, and the parent of the row will be the element that contains the whole of the sortable table.

Thus line 2 will give us the entire table that we wish to sort. Line 3 assigns the first row of that table to the variable "headerRow"

4    columnText=selElem.innerHTML;
5    for (var j = 0, col; col = headerRow.cells[j]; j++) {
6        if (
headerRow.cells[j].innerHTML==columnText) {
7            columnNumber=j;

8    }

This section finds the column number that is to be sorted on. Line 4 finds the column header, and then lines 5 to 8 loop through the columns until the correct one is found.

09    var tmpArray = new Array();
10    for (var i = 1, row; row = table.rows[i]; i++) {
11        var rowArray = new Array();
12        for (var j = 0, col; col = row.cells[j]; j++) {
13            if (row.cells[j].tagName == 'TD' ) {
14                rowArray[j]=row.cells[j].innerHTML;
15            }
16        }
17        tmpArray[i]=rowArray;
18    }

 
This section gets the information from each cell, and feeds it into a JavaScript array object before sorting it. Line 9 creates the array object then we cycle through each row (starting at the second line, as the first contains the headings), creating an array object for each row, and finally line 17 adds that row array to the main array.

19    tmpArray.sort(
20        function(a,b) {
21                if (columnClass=="number") {
22                    return parseFloat(a[columnNumber])-parseFloat(b[columnNumber]);
23                } else if (columnClass=="date") {
24                    da=new Date(a[columnNumber]);
25                    db=new Date(b[columnNumber]);
26                    return da>db;
27                } else {
28                    return a[columnNumber].localeCompare(b[columnNumber])

29                }
30        }
31    );
 

This section performs a standard JavaScript 3d array sorting routine. It will sort by number, alphabetic, and date. Other sorting routines can be included as needed.

Finally we need to feed the sorted array back into the html table as here

32    for (var i = 0, row; row = table.rows[i+1]; i++) {
33        var rowArray = new Array();
34        rowArray=tmpArray[i];
35        for (var j = 0, col; col = row.cells[j]; j++) {
36            if (row.cells[j].tagName == 'TD' ) {
37                row.cells[j].innerHTML=rowArray[j];
38            }
39        }
40    }
 

and we have fully sorted the HTML table in 40 lines of JavaScript. I have added in some nice formatting, and cursors in, and get the following full function:

function SortSelect(selElem) {
    var tmpArray = new Array();
    th=document.getElementById("Theme").value;
    columnText=selElem.innerHTML;
    table=selElem.parentNode.parentNode;
    row = table.rows[0];
    for (var j = 0, col; col = row.cells[j]; j++) {
        if (row.cells[j].innerHTML==columnText) {
            columnNumber=j;
            s=getComputedStyle(row.cells[j], null);
            if (s.cursor=="s-resize") {
                row.cells[j].style.cursor="n-resize";
                row.cells[j].style.backgroundImage="url('css/"+th+"/images/descending.png')";
                row.cells[j].style.backgroundPosition="right center";
                row.cells[j].style.backgroundRepeat="no-repeat";
                row.cells[j].style.backgroundSize="12px";
                direction="a";
            } else {
                row.cells[j].style.cursor="s-resize";
                row.cells[j].style.backgroundImage="url('css/"+th+"/images/ascending.png')";
                row.cells[j].style.backgroundPosition="right center";
                row.cells[j].style.backgroundRepeat="no-repeat";
                row.cells[j].style.backgroundSize="12px";
                direction="d";
            }
        }
    }
    for (var i = 1, row; row = table.rows[i]; i++) {
        var rowArray = new Array();
        for (var j = 0, col; col = row.cells[j]; j++) {
            if (row.cells[j].tagName == 'TD' ) {
                rowArray[j]=row.cells[j].innerHTML;
                columnClass=row.cells[columnNumber].className;
            }
        }
        tmpArray[i]=rowArray;
    }
    tmpArray.sort(
        function(a,b) {
            if (direction=="a") {
                if (columnClass=="number") {
                    return parseFloat(a[columnNumber])-parseFloat(b[columnNumber]);
                } else if (columnClass=="date") {
                    da=new Date(a[columnNumber]);
                    db=new Date(b[columnNumber]);
                    return da>db;
                } else {
                    return a[columnNumber].localeCompare(b[columnNumber])
                }
            } else {
                if (columnClass=="number") {
                    return parseFloat(b[columnNumber])-parseFloat(a[columnNumber]);
                } else if (columnClass=="date") {
                    da=new Date(a[columnNumber]);
                    db=new Date(b[columnNumber]);
                    return da<=db;
                } else {
                    return b[columnNumber].localeCompare(a[columnNumber])
                }
            }
        }
    );
    for (var i = 0, row; row = table.rows[i+1]; i++) {
        var rowArray = new Array();
        rowArray=tmpArray[i];
        for (var j = 0, col; col = row.cells[j]; j++) {
            if (row.cells[j].tagName == 'TD' ) {
                row.cells[j].innerHTML=rowArray[j];
            }
        }
    }
    return;
}


This is called by including this inline onclick handler

 onclick="SortSelect(this)"

I hope this explanation is useful to some people.