Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / billing.html @ 279d6e51

History | View | Annotate | Download (3.9 kB)

1
{% extends "im/account_base.html" %}
2

    
3
{% load filters %}
4

    
5

    
6

    
7
{% block page.body %}
8
<div class="billing list"> 
9
        {{ data }}
10
        <div class="highlight">
11
                
12
                <em>{{ data.remainingCredits|floatformat:2 }}</em> credits remaining
13
                <span class="info foo"> 
14
                    <em>more info</em>
15
                    <span>|<br>This month you are given
16
                             {% with data|lookup:'bill_addcredits' as bill_addcredits %}
17
                                                 {{ bill_addcredits.0.totalCredits|floatformat:0}} 
18
                                        {% endwith %} new credits.
19
                        </span>
20
            </span>
21
        </div>
22
        
23
        <h2><span>Billing statement for </span><em>[ {{ today.month|month_name|upper }} {{ today.year }} ]</em></h2>
24
        {% if data.bill|length %}
25
                <p>
26
                        <em>
27
                                This page shows billing report for the period 1 {{ today.month|month_name }} {{ today.year }}- {{ month_last_day }} {{ today.month|month_name }} {{ today.year }}
28
                        </em>
29
                </p>
30
        
31
         
32
        
33
                <br><br>
34
                <table class="alt-style">
35
                    <tr>
36
                        <th>Service</th>
37
                        <th>Monthly Usage</th>
38
                        <th class="last">Charged Credits</th>
39
                    </tr>
40
                    <tr>
41
                              <td>Cyclades 
42
                                      {% with data|lookup:'bill_vmtime' as bill_vmtime %}
43
                                              
44
                                                 {% if bill_vmtime.0.totalCredits != '0.0'  %}
45
                                                         <a href="" class="more-info">&nbsp;</a>
46
                                                 {% endif%}
47
                                        {% endwith %}
48
                              </td>
49
                              <td>
50
                                        {% with data|lookup:'bill_vmtime' as bill_vmtime %}
51
                                                 {{ bill_vmtime.0.totalUnits|floatformat:0}} Hr
52
                                        {% endwith %}
53
                                </td>
54
                              <td  class="last">
55
                                        {% with data|lookup:'bill_vmtime' as bill_vmtime %}
56
                                                 {{ bill_vmtime.0.totalCredits|floatformat:2}}
57
                                        {% endwith %}
58
                                
59
                                </td>
60
                    </tr>
61
                    <tr class="innertable" style="display:none">
62
                              <td colspan="3">
63
                                      <div class="table-div">
64
                                              <table class="alt-style">
65
                                                    
66
                                                    
67
                                                    <tr>
68
                                                        <th>VM</th>
69
                                                        <th>Flavor</th>
70
                                                        <th>Vmtime</th>
71
                                                        <th class="last">Charged Credits</th>
72
                                                    </tr>
73
                                                    {% with data|lookup:'bill_vmtime' as bill_vmtime %}
74
                                                                {% for d in  bill_vmtime %}
75
                                                                        {% for vm in  d.details %}
76
                                                                                <tr>
77
                                                                                        <td>{{ vm.resourceName }}</td>
78
                                                                                        <td>flavor?</td>
79
                                                                                        <td>{{ vm.totalElapsedTime|todate|timeuntil:zerodate }}</td>
80
                                                                                        <td class="last">{{ vm.totalUnits }}</td>
81
                                                                                </tr>
82
                                                                                
83
                                                                        {% endfor %}
84
                                                                {% endfor %}
85
                                                        {% endwith %} 
86
                                                   
87
                                                     
88
                                                 </table>
89
                                         </div>
90
                              </td>
91
                    </tr>
92
                    <tr>
93
                              <td>Pithos +</td>
94
                              <td>
95
                                        {% with data|lookup:'bill_diskspace' as bill_diskspace %}
96
                                                {{ bill_diskspace.0.totalUnits|floatformat:0}} {{ bill_diskspace.0.unitName }}
97
                                        {% endwith %}
98
                                        
99
                                </td>
100
                              <td class="last">
101
                                        {% with data|lookup:'bill_diskspace' as bill_diskspace %}
102
                                                {{ bill_diskspace.0.totalCredits|floatformat:2}}
103
                                        {% endwith %}
104
                                
105
                                </td>
106
                    </tr>
107
                    <tr>
108
                              <td>Total Credits</td>
109
                              <td>&nbsp;</td>
110
                               
111
                              <td class="sum last">{{ data.deductedCredits|floatformat:2 }}</td>
112
                    </tr>
113
                </table>
114
        {% else %}
115
                <p>
116
                        <em>
117
                                There is no billing statement for this month.
118
                        </em>
119
                </p>
120
        {% endif %}
121
        
122
        
123
         <form action={% url astakos.im.views.billing %} class="withlabels"  method="POST">{% csrf_token %}
124
                <div class="form-row">
125
                        <label for="month">Choose another month</label>
126
                        <select name="datefrom">
127
                                {% with user.date_joined|monthssince as periods %}
128
                                        {% for period in periods %}
129
                                                <option value="{{ period.2 }}" {% if  == start  %}selected="selected"{% endif%}> 
130
                                                        
131
                                                           {{ period.1|month_name }} {{period.0}} 
132
                                                </option>
133
                                        {% endfor %}
134
                                {% endwith %}
135
                        </select>
136
                </div>
137
                <div class="form-row submit">
138
                <input type="submit" value="VIEW">
139
            </div> 
140
        </form>
141
        
142
        <br><br><br>
143
        <p>You can download a detailed activity report in Comma Separated Value (CSV) format or as txt file for AUGUST 2012.<br />
144
                <a href="#">Download CSV</a>, <a href="#">Download .txt</a>
145
        </p>
146
                 
147
</div>
148
 
149

    
150
{% endblock %}