Evergreen tries to inexplicitly strip out dollar signs when adding Total Balance to Current Bills Receipt

Bug #1464025 reported by Erica Rohlfs
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

Evergreen version 2.8.1
Scott Thomas posted a question to the general mailing list regarding the display of total owed on the bills_current receipt.
Here is the link to the conversation:
http://georgialibraries.markmail.org/thread/27tb3wu35vtc64d5
Assuming the library makes use of print_win.js and doesn’t adjust the Library Setting: Printing: Custom Javascript File, the potential workaround would be:
Lineitem:
<dt><b>Bill #%mbts_id%</b></dt>
<dd> <table>
<tr valign="top"><td>Date:</td><td>%mbts_xact_start%</td></tr>
<tr valign="top"><td>Type:</td><td>%xact_type%</td></tr>
<tr><td>Title:</td><td>%title%</td></tr>
<tr valign="top"><td>Last Billing:</td><td>%last_billing_type%<br/>%last_billing_note%</td></tr>
<tr valign="top"><td>Total Billed:</td><td>$%total_owed%</td></tr>
<tr valign="top"><td>Last Payment:</td><td>%last_payment_type%<br/>%last_payment_note%</td></tr>
<tr valign="top"><td>Total Paid:</td><td>$%total_paid%</td></tr>
<tr valign="top"><td><b>Balance:</b></td><td><b>$<span sum="bal">%balance_owed%</span></b></td></tr>
</table><br/>
Footer:
</ol>
<b>Total Balance: <span sumout="bal" fixed="2"></span></b>
<hr />%SHORTNAME% %TODAY_TRIM%<br/>
<br/>
However, Evergreen is trying to inexplicitly strip out dollar signs. So, it's effectively striping out the first character if that character is not a minus sign or a digit. The end result would be, for a patron who owes you .70 cents; the Total Balance would read $70.00.
The problem exists within this bit of code: newVal = newVal.replace(/^[^-0-9]/,”).

Jason Etheridge has created a fix.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/phasefx/sumoutfix

Revision history for this message
Erica Rohlfs (erohlfs) wrote :

It appears the link to the mailing list discussion is not working. The subject line of the discussion is: Bills Current Receipt Template and Total Owed and was posted by Scott Thomas on 6/10/15, if you would like to search for it.

Revision history for this message
Erica Rohlfs (erohlfs) wrote :

Scott found https://bugs.launchpad.net/evergreen/+bug/821640, where adding grand_total_billed to the receipt gives the desired results. This ticket isn't exactly a duplicate, because Jason still fixed a separate issue in the process.

tags: added: printing receipt
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.