zackchandler (owner)

Revisions

gist: 220642 Download_button fork
public
Public Clone URL: git://gist.github.com/220642.git
Embed All Files: show embed
custom_template.html #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<html>
  <head>
    <title>Estimate</title>
    <style type="text/css">
    
      body { margin: 20px 50px 20px 50px; color: #000080; }
      
      #customer { margin-left: 15px; }
 
      table { width: 100%; font-size: 10px; border-collapse: collapse; }
      table td { vertical-align: top; }
      
      table#job_details { margin: 20px 0 0 350px; border: 1px solid #000080; border-bottom: none; }
      table#job_details td { padding: 5px; border: 1px solid #000080; border-bottom: none; text-align: center; }
      
      table#line_items { margin-bottom: 30px; border: 1px solid #000080; }
      table#line_items th { background-color: #D1D1FF; }
      table#line_items th, table#line_items td { padding: 5px 10px; border: 1px solid #000080; }
      
      table#line_items tr.totals td { border: none; }
      table#line_items tr.divider td { margin-top: 10px; padding-top: 10px; border-top: 5px solid #000080; }
      table#line_items td.totals_section { background-color: #D1D1FF; font-weight: bold; }
 
      #footer { padding: 5px; text-align: center; background-color: #ffc; }
 
    </style>
  </head>
  <body>
 
    <table id="top">
      <tr>
        <td>
          <div id="company">
            <div>{{ account.logo }}</div>
            <div><strong>{{ account.company_name | h }}</strong></div>
            <div>{{ account_details.billing_address | h }}</div>
            <div>
              {{ account_details.billing_city | h }},
              {{ account_details.billing_state | h }}
              {{ account_details.billing_zip_code | h }}</div>
            <div>{{ account_details.billing_country | h }}</div>
            <div>{{ account_details.billing_phone_number | h }}</div>
          </div>
        </td>
        <td>
          <div id="customer">
            <h1>Estimate # {{ job.job_number }}</h1>
            <div>{{ customer.name | h }}</div>
            <div>{{ customer.service_address | h | newline_to_br }}</div>
            <div>
              {{ customer.service_city | h }},
              {{ customer.service_state | h }}
              {{ customer.service_zip_code | h }}
            </div>
            <div>{{ customer.phone_number | h }}</div>
          </div>
        </td>
      </tr>
    </table>
        
    <table id="job_details">
      <tr>
        <td>Date</td>
        <td>Job #</td>
      </tr>
      <tr>
        <td>{{ job.scheduled_on | date: "%m/%d/%Y" }}</td>
        <td>{{ job.job_number }}</td>
      </tr>
    </table>
    
    <table id="line_items">
      <tr>
        <th align="left">Item</th>
        <th align="left">Description</th>
        <th align="right">Quantity</th>
        <th align="right">Per Unit</th>
        <th align="right">Line Total</th>
      </tr>
      {% for job_charge in job.job_charges %}
        <tr>
          <td width="20%" align="left">{{ job_charge.description | h | newline_to_br }}</td>
          <td width="40%" align="left">{{ job_charge.details | h | newline_to_br }}</td>
          <td align="right">{{ job_charge.quantity }}</td>
          <td align="right">{{ job_charge.price_per_unit | currency }}</td>
          <td align="right">{{ job_charge.total | currency }}</td>
        </tr>
      {% endfor %}
      <tr class="totals divider">
        <td></td>
        <td></td>
        <td></td>
        <td class="totals_section" align="right">Subtotal:</td>
        <td class="totals_section" align="right">{{ job.subtotal | currency }}</td>
      </tr>
      <tr class="totals">
        <td></td>
        <td></td>
        <td></td>
        <td class="totals_section" align="right">Tax:</td>
        <td class="totals_section" align="right">{{ job.tax | currency }}</td>
      </tr>
      <tr class="totals">
        <td></td>
        <td></td>
        <td></td>
        <td class="totals_section" align="right">Total:</td>
        <td class="totals_section" align="right">{{ job.total | currency }}</td>
      </tr>
    </table>
 
    <div id="footer" class="section">
      <strong>
        Estimate price good for 7 days - contact us now to get started!
      </strong>
    </div>
    
  </body>
</html>