John, Terran

Thank you so much, I have been fighting with this for days, im not particularly 
oh-fey with AngularJS.

Now onto the next receipt…

Stuart

***************************************************
Stuart Forrest PhD
IT Analyst
Beaufort County Library System
843 255 6450
sforr...@bcgov.net

www.beaufortcountylibrary.org

For Leisure, For Learning, For Life

From: Open-ils-general 
[mailto:open-ils-general-boun...@list.georgialibraries.org] On Behalf Of John 
Amundson
Sent: Tuesday, February 13, 2018 5:03 PM
To: Evergreen Discussion Group
Subject: Re: [OPEN-ILS-GENERAL] Web Client Print Templates - "You Saved" 
Calculator

Thanks, Terran!

That seems to do the trick.

If anyone is curious about how I added this to the checkout receipt:

...
<div ng-init="transactions.subtotal=0">
  <ol>
    <li ng-repeat="checkout in circulations" | 
ng-init="transactions.subtotal=transactions.subtotal -- checkout.copy.price" >
    ....
    </li>
  </ol>
    ....
<div>You Saved<br/>{{transactions.subtotal | currency}}</span><br/> by 
borrowing from <br/> 
{{current_location.name<http://current_location.name>}}!</div>
...

[https://lh5.googleusercontent.com/C1fNrKOLEXFs-jfAIXQIMqbKqVBCJrBceOenfgotAcJE6XtZ2ZeeTYFkyfir63-HfzjX6q5zhBQWiO5RZk2tYnWzJ1_rjAADAH4nCmiuhNJuoG8HZLq7MBW-pAU4R9ScKcCybdVO]<http://www.cwmars.org>


John Amundson | Library Applications Associate III | CW MARS

jamund...@cwmars.org<mailto:jamund...@cwmars.org> | 508-755-3323 
x322<tel:%28508%29%20755-3323>

http://www.cwmars.org<http://www.cwmars.org/>


On Tue, Feb 13, 2018 at 4:13 PM, Terran McCanna 
<tmcca...@georgialibraries.org<mailto:tmcca...@georgialibraries.org>> wrote:
I have an example here that subtotals bill amounts:
https://pines.georgialibraries.org/dokuwiki/doku.php?id=circ:workstations:receipts#subtotals
I haven't tested this scenario, but you should be able to do something 
similar...
1) Set up am empty variable before the ng-repeat loop: <div 
ng-init="transactions.subtotal = 0">
2) Somewhere inside the loop do some math: <li ng-init="transactions.subtotal = 
transactions.subtotal -- checkout.copy.price">
3) After the end of the ng-repeat display your subtotal: <div>You Saved: 
{{transactions.subtotal | currency}}</div>

Terran McCanna
PINES Program Manager
Georgia Public Library Service
1800 Century Place, Suite 150 
<https://maps.google.com/?q=1800+Century+Place,+Suite+150+Atlanta,+GA+30345&entry=gmail&source=g>
Atlanta, GA 
30345<https://maps.google.com/?q=1800+Century+Place,+Suite+150+Atlanta,+GA+30345&entry=gmail&source=g>
404-235-7138<tel:(404)%20235-7138>
tmcca...@georgialibraries.org<mailto:tmcca...@georgialibraries.org>

On Tue, Feb 13, 2018 at 3:29 PM, John Amundson 
<jamund...@cwmars.org<mailto:jamund...@cwmars.org>> wrote:
Hi,

We are preparing for our move to the web client and are currently going through 
and updating print templates. For the Checkout, Items Out, and Renew templates, 
many of our libraries print "You saved $x.yz by borrowing from your local 
library." The price of the items out would be added together and displayed at 
the end of the receipt with the above text.

We did this by adding the following code to the line item section of the 
template:
%price% %price% <span style="display: none;" sum="sum1">%price%</span>
and the following in the footer, where the sum is displayed:
<span sumout="sum1" fixed="2"></span>

I updated the line item portion for the web client with the new variable name,
<span style="display: none;" sum="sum1"> {{checkout.copy.price}} </span>
but no matter what I do, the total sum is blank.

I cannot figure how to make this work. I was wondering if anyone has gotten 
this to work yet and would be willing to share their code. If not, does anyone 
have any suggestions I could try?

Thank you,
John

[https://lh5.googleusercontent.com/C1fNrKOLEXFs-jfAIXQIMqbKqVBCJrBceOenfgotAcJE6XtZ2ZeeTYFkyfir63-HfzjX6q5zhBQWiO5RZk2tYnWzJ1_rjAADAH4nCmiuhNJuoG8HZLq7MBW-pAU4R9ScKcCybdVO]<http://www.cwmars.org>


John Amundson | Library Applications Associate III | CW MARS

jamund...@cwmars.org<mailto:jamund...@cwmars.org> | 508-755-3323 
x322<tel:%28508%29%20755-3323>

http://www.cwmars.org<http://www.cwmars.org/>



Reply via email to