[OPEN-ILS-DEV] Setting the currency in the patron billing interface

Cerninakova Eva cernin at jabok.cz
Fri Aug 2 09:49:34 EDT 2019


Hi,

Some time ago, I sent a message to the mailing list  asking for a help with
the currency settings in the patron billing interface and receipt templates in
the web staff client, where the dollar sign is used as a default currency
symbol, regardless of localization . With the kind help of Daniel that
directed me to the Angular filters, I was able to edit few TT2 templates
and adjust currency symbol in the print templates and most parts of the
billing interfaces.

However, I was not successful in removing the dollar sing from the grid in
the billing interface (see the attachment).
Could someone help me to identify, where does the currency value in the
grid comes from?

Thanks for any help.

Note: I have added some comments on the issue to the  bug 1171338
<https://bugs.launchpad.net/evergreen/+bug/1171338>

Eva








---------- Forwarded message ---------
Od: Linda Jansova <skolkova at chello.cz>
Date: st 22. 5. 2019 v 20:04
Subject: Re: [OPEN-ILS-GENERAL] Setting the currency in the patron billing
interface
To: Evergreen Discussion Group <open-ils-general at list.georgialibraries.org>,
Daniel Wells <dbwells at gmail.com>, <cerninakova at jabok.cz>


Hi Dan,

It really seems there is no easy way in Angular to change default currency
parameters across the application as mentioned in Angular Wiki (
https://www.angularjswiki.com/angular/angular-currency-pipe-formatting-currency-in-angular/)
and further elaborated in a GitHub discussion (
https://github.com/angular/angular/issues/25461).

However, the Angular Wiki page cited above mentions a workaround (with a
code example):

"we can define our own custom Angular currency Pipe to do the same.

Create a new file called custom.currencypipe.ts file and add the below code
to it. You can change the paramters as per your requirements."

If implemented in Evergreen, maybe the currency parameters could be changed
in a single place?

Linda

On 5/20/19 9:38 PM, Daniel Wells wrote:

Hello Eva,

The AngularJS interfaces are using the built-in currency filter, which
supplies a dollar sign by default.  More here:

https://docs.angularjs.org/api/ng/filter/currency

It does appear that the filter can specify a different symbol; it is fairly
limited otherwise.  The newer Angular looks to be more robust in allowing
locale-specific currency formatting options.

If you care mainly about the symbol, you should be able to change that by
modifying each place that filter is used, but that doesn't seem very
practical.  If that doesn't seem viable for you, we probably need to look
at expanding how that filter is processed to allow for better optional
behavior.  Tacking on a root variable similar to date formatting doesn't
seem too terrible.

Hopefully someone with more direct knowledge will chime in and let us know
there is already an easier way.

Sincerely,
Dan


On Mon, May 20, 2019 at 3:06 PM Cerninakova Eva <cernin at jabok.cz> wrote:

>
> Hi,
>
> The Czech Evergreen community hopes that during the summer we will be
> possible to move our libraries to the web client using Evergreen version
> 3.3. Therefore, we are currently working on testing and removing potential
> localization problems.
>
> Currently, we are dealing with currency setting in the web staff client
> patron billing interface.
>
> There was no currency symbol used in the patron billing interface in the
> XUL staff client.  This has changed with the new web client:  There is the
> "$" symbol  shown in the patron billing interface for each payment amount.
> However, we use the Czech currency, and the dollar symbol shown in the
> interface is quite confusing and does not provide an easy survey of the
> money summary to staff. Even greater complication is that the dollar symbol
> is also used on patron payment receipts (see the attachments). We need the
> currency symbol to be changed (or at least removed).
>
> From the receipt template (Open-ILS/src/templates/staff/share/
> print_templates/t_bills_current.tt2), as well as from the billing
> interface, it is obvious, that a specific currency (particularly USD) is
> automatically inserted into the receipt or into the billing interface. E.g.
> "Total owed: {{xact.summary.total_owed | currency}}" is interpreted as
> something like "Total owed: $1.50". However, unfortunately It is not
> clear to us, where the USD currency comes from.
>
> We suppose there should be probably a similar setting for the currency as
> it is for the date + time format (which is possible to set in the Library
> settings editor and which occurs in the receipt template as {{xact.
> xact_start | date:$root.egDateAndTimeFormat}} )???
>
> Does anyone please have an idea how to set the currency value? (The fact
> that we can't use our own currency is a real web staff blocker for us )
>
> Thanks for any hint
> Eva
>
>
>
>
>
>
>
> ---
> Mgr. Eva Cerniňáková
> cernin at jabok.cz
> Tel. +420 211 222 409
>
> Knihovna Jabok
> http:/knihovna.jabok.cz
> Tel.  +420 211 222 410
> Jabok - Vyšší odborná škola sociálně pedagogická a teologická
> Salmovská 8, 120 00 Praha 2
>
>
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Bez
virů. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20190802/68b12b38/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: currency_grid.png
Type: image/png
Size: 125831 bytes
Desc: not available
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20190802/68b12b38/attachment-0001.png>


More information about the Open-ils-dev mailing list