Great! Glad it works! Terran McCanna PINES Program Manager Georgia Public Library Service 1800 Century Place, Suite 150 Atlanta, GA 30345 404-235-7138 [email protected]
On Tue, Feb 13, 2018 at 5:03 PM, John Amundson <[email protected]> wrote: > 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}}!</div> > ... > > <http://www.cwmars.org> > > John Amundson | Library Applications Associate III | CW MARS > > [email protected] | 508-755-3323 x322 <%28508%29%20755-3323> > > http://www.cwmars.org > > On Tue, Feb 13, 2018 at 4:13 PM, Terran McCanna < > [email protected]> 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 <(404)%20235-7138> >> [email protected] >> >> >> On Tue, Feb 13, 2018 at 3:29 PM, John Amundson <[email protected]> >> 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 >>> >>> <http://www.cwmars.org> >>> >>> John Amundson | Library Applications Associate III | CW MARS >>> >>> [email protected] | 508-755-3323 x322 <%28508%29%20755-3323> >>> >>> http://www.cwmars.org >>> >> >> >
