{"action":"created","issue":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/689","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/689/labels{/name}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/689/comments","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/689/events","html_url":"https://github.com/IMA-WorldHealth/bhima/pull/689","id":104805501,"number":689,"title":"Localisation and reworking currency","user":{"login":"sfount","id":2844572,"avatar_url":"https://avatars.githubusercontent.com/u/2844572?v=3","gravatar_id":"","url":"https://api.github.com/users/sfount","html_url":"https://github.com/sfount","followers_url":"https://api.github.com/users/sfount/followers","following_url":"https://api.github.com/users/sfount/following{/other_user}","gists_url":"https://api.github.com/users/sfount/gists{/gist_id}","starred_url":"https://api.github.com/users/sfount/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfount/subscriptions","organizations_url":"https://api.github.com/users/sfount/orgs","repos_url":"https://api.github.com/users/sfount/repos","events_url":"https://api.github.com/users/sfount/events{/privacy}","received_events_url":"https://api.github.com/users/sfount/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-04T00:16:54Z","updated_at":"2015-09-04T07:14:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/pulls/689","html_url":"https://github.com/IMA-WorldHealth/bhima/pull/689","diff_url":"https://github.com/IMA-WorldHealth/bhima/pull/689.diff","patch_url":"https://github.com/IMA-WorldHealth/bhima/pull/689.patch"},"body":"Attempt 2.\r\n\r\nIn this PR:\r\n\r\n1. Localisation using ngLocale, configures angular filters based on locale - the primary change has been updating dates from only US format to respecting the user language. __(Note: this does not apply to the currency filter - as described in this pull request)__\r\n2. Forked the native angular currency filter - it is essential that currencies in BHIMA are __not__ dependent on locale, they must respect the original transactions currency. This filter enables:\r\n  * Safe alternative to intlcurrency, no html binding is used\r\n  * Filter independently of current locale\r\n  * Specifiy BHIMA currency ID to request formatting\r\n  * Render strong warnings if a non-supported currency is used or a mistake is made \r\n  * Asynchronously filter based on available JSON configuration files\r\n3. Updated the database to remove formatting from currency line and create relationship with format configuration files\r\n4. Service to manage async fetching and requesting of currency format files. This can be used by any module that requires information about currency format information (selects showing available currency options) however is primarily intended to drive the currency filter. \r\n5. Deprecated the intlcurrency filter - please note this PR request does not replace all instances of the filter. For now it simple returns an error message on use. \r\n\r\nAn example of how the currency filter can be used\r\n```\r\n{{ transaction.total | currency:transaction.currency }}\r\n```\r\n\r\nThe currency filter provides the configuration boolean ```requiresCurrencyDefinition``` By default this is set to false and the enterprise currency is used if no currency is specified. If this flag is set the filter will display a clear error stating that the developer should explicitly define a currency id. The development team can decide if it is safe to allow implicit use of the enterprise currency.\r\n\r\nIf this change is accepted I am happy to merge the very small conflicts between this branch and ```development```. (See my attempt at being clever here #688)."},"comment":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/comments/137663006","html_url":"https://github.com/IMA-WorldHealth/bhima/pull/689#issuecomment-137663006","issue_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/689","id":137663006,"user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T07:14:05Z","updated_at":"2015-09-04T07:14:05Z","body":"Minor fixes, but a merge with development.  On the whole, it looks awesome!  Can't wait to use this!"}}