lk | adds ability to print multiple receipts for freecyclery clients

This commit is contained in:
Louis Knapp
2016-05-07 10:14:30 -05:00
parent bbc84247b4
commit 2ca3ae21a8
10 changed files with 147 additions and 35 deletions
+74
View File
@@ -0,0 +1,74 @@
.col-xs-6
.receipt
%h2
%strong= client.bike.name
%br
.horizontal-line
.client-information
= client.name
%br
= client.agency.agency_name if client.agency
.horizontal-line
%br
Includes:
%br
= 'Helmet' if client.helmet
%br
= 'Lock' if client.lock
%br
%br
Date Received
%br
_______________
%br
Client Signature
%br
________________
%br
Recyclery Volunteer Initials
%br
___
%br
CLIENT COPY
.col-xs-6
.receipt
%h2
%strong= client.bike.name
%br
.horizontal-line
.client-information
= client.name
%br
= client.agency.agency_name if client.agency
.horizontal-line
.row
.col-xs-6
%br
= 'Will make 25$ payment for lock and helmet' if client.will_pay
%br
Includes:
%br
= 'Helmet' if client.helmet
%br
= 'Lock' if client.lock
%br
%br
Date Received
%br
_______________
%br
Client Signature
%br
________________
.col-xs-6
.client-info-header CLIENT INFO
.client-email= "Agency Email: " + client.agency.email
.client-phone= "Agency Phone #: " + client.agency.phone_number
.client-photo-consent [ ] I grant consent to the Recyclery to use and publish photographs of me.
%br
Recyclery Volunteer Initials
%br
___
%br
RECYCLERY COPY
@@ -0,0 +1,4 @@
.container.print-receipts
- @clients.each do |client|
.row
= render partial: "receipt", locals: {client: client}
+18
View File
@@ -0,0 +1,18 @@
.container
%h1 Select the clients whose receipts you would like to print
=form_tag("/clients/print_receipts", method: "get") do
%table.table.table-striped.table-bordered.table-hover
%thead
%tr
%th Client
%th Bike
%th Select
-@clients.each do |client|
%tr
%td= client.name
%td= client.bike.name
%td= check_box("print_clients", client.id)
=will_paginate @clients
%br
=submit_tag 'Generate Receipts', class: "btn btn-default"