-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBillerApp.html
More file actions
200 lines (199 loc) · 7.09 KB
/
BillerApp.html
File metadata and controls
200 lines (199 loc) · 7.09 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!doctype html>
<html ng-app="BillerApp">
<head>
<meta charset="UTF-8">
<title>Biller Application</title>
<script src="../AngularJs-src/angular.min.js"></script>
<script src="BillerScript.js"></script>
<link rel="stylesheet" type="text/css" href="BillerAppStyles.css">
</head>
<body ng-controller="BillerController">
<table width="30%" style="float:left">
<tr>
<td colspan="2"><h3>Add Users To Bill</h3></td>
</tr>
<tr>
<td colspan="2"><input type="text" ng-model="username" placeholder="Type in a username and click add user"/></td>
</tr>
<tr>
<td colspan="2"><button ng-click="userAdd(username)">Add User</button></td>
</tr>
</table>
<table width="60%">
<tr><td colspan="5"><h3 class="center_class">User Expense Overview</h3></td></tr>
<tr bgcolor="#AE9B9B" class="center_class">
<th>S.No</th>
<th>Username</th>
<th>Credit Amount</th>
<th>Debit Amount</th>
<th>Total Amount (+ = amount you will recieve, - = amount you should give)</th>
</tr>
<tr ng-repeat="user in users.values()" class="center_class">
<td>{{$index + 1}}</td>
<td>{{user.name}}</td>
<td>{{user.creditAmount}}</td>
<td>{{user.debitAmount}}</td>
<td>{{user.creditAmount + user.debitAmount}}</td>
</tr>
</table>
<br>
<br>
<hr />
<form name="billItemsForm" ng-submit="addBillItems(billItemsForm)">
<table style="float:left" width="30%">
<tr>
<td colspan="4"><h3 class="center_class">Add Bill Items</h3></td>
</tr>
<tr>
<td>Item Name</td>
<td>:</td>
<td><input name="itemName" type="text" ng-model="itemname" required/></td>
<td><span class="error" ng-show="billItemsForm.itemName.$error.required">Required!</span></td>
</tr>
<tr>
<td>Bill Date</td>
<td>:</td>
<td><input name="billDate" type="date" ng-model="billdate" required/></td>
<td><span class="error" ng-show="billItemsForm.billDate.$error.required">Required!</span></td>
</tr>
<tr>
<td>Amount</td>
<td>:</td>
<td><input name="amount" type="number" min="1" ng-model="amount" required/></td>
<td>
<span class="error" ng-show="billItemsForm.amount.$error.required">Required!</span>
<span class="error" ng-show="billItemsForm.amount.$error.min">Minimum amount should be greater than 0</span>
<span class="error" ng-show="billItemsForm.amount.$error.number">Please enter number only!</span>
</td>
</tr>
<tr>
<td>Paid By</td>
<td>:</td>
<td>
<select name="paidBy" ng-model="paidby" required>
<option value ="">select a user</option>
<option value="{{user}}" ng-repeat="user in getUsers()">{{user}}</option>
</select>
</td>
<td><span class="error" ng-show="billItemsForm.paidBy.$error.required">Required!</span></td>
</tr>
<tr>
<td>Shared By</td>
<td>:</td>
<td>
<span ng-repeat="user in getUsers()">
<input name="sharedBy" type="checkbox" ng-click="updateSharedBy(user)" />{{user}}<br>
</span>
</td>
<td><span class="error" ng-show="isSharedByListEmpty()">Required!</span></td>
</tr>
<tr>
<td colspan="4" style="text-align:left"><input type="submit" value="Add Bill Item" ng-disabled="billItemsForm.$invalid || isSharedByListEmpty()"/></td>
</tr>
</table>
<table border="0" width="70%" class="center_class">
<tr>
<td colspan="6"><h3>Bill Items Overview</h3></td>
</tr>
<tr bgcolor="#AE9B9B">
<th>S.No</th>
<th>Item Name</th>
<th>Date</th>
<th>Amount</th>
<th>Paid By</th>
<th>Shared By</th>
</tr>
<tr ng-repeat="billItem in billItems.values()">
<td>{{$index + 1}}</td>
<td>{{billItem.itemname}}</td>
<td>{{billItem.billdate}}</td>
<td>{{billItem.amount}}</td>
<td>{{billItem.paidby}}</td>
<td>
<span ng-repeat="shareby in billItem.sharedbylist">
<span ng-if="!$last">{{shareby}},</span>
<span ng-if="$last">{{shareby}}</span>
</span>
</td>
</tr>
<tr>
<td colspan="6" style="text-align:left"><button ng-show="billItems.length()">Delete</button></td>
</tr>
</table>
</form>
<br>
<div class="div_float">
<hr />
<h3><center>User Bill Expense Detailed View</center></h3>
Search : <input ng-model="searchText" placeholder="Type username to search"/>
<div ng-repeat="user in users.keys() | filter:searchText">
<div class="div_float">
<br><br>
<p><h4>{{user}}'s Detailed Expense</h4></p>
<br>
</div>
<table border="1" width="49%" class="center_float_left">
<tr>
<th colspan="7" bgcolor="#8BF19E">{{user}}'s Credit Expenses</th>
</tr>
<tr bgcolor="#AE9B9B">
<th>S.No</th>
<th>Item Name</th>
<th>Date</th>
<th>Amount</th>
<th>Paid By</th>
<th>Shared By</th>
<th>Individual Share</th>
</tr>
<tr ng-repeat="creditItem in users.get(user).creditBillItemsMap.values()">
<td>{{$index + 1}}</td>
<td>{{creditItem.itemname}}</td>
<td>{{creditItem.billdate}}</td>
<td>{{creditItem.amount}}</td>
<td>{{creditItem.paidby}}</td>
<td>
<span ng-repeat="shareby in creditItem.sharedbylist">
<span ng-if="!$last">{{shareby}},</span>
<span ng-if="$last">{{shareby}}</span>
</span>
</td>
<td>{{creditItem.individualShare}}</td>
</tr>
</table><div style="float:left"> </div>
<table border="1" width="49%" class="center_float_left">
<tr>
<th colspan="7" bgcolor="#FFC596">{{user}}'s Debit Expenses</th>
</tr>
<tr bgcolor="#AE9B9B">
<th>S.No</th>
<th>Item Name</th>
<th>Date</th>
<th>Amount</th>
<th>Paid By</th>
<th>Shared By</th>
<th>Individual Share</th>
</tr>
<tr ng-repeat="debitItem in users.get(user).debitBillItemsMap.values()">
<td>{{$index + 1}}</td>
<td>{{debitItem.itemname}}</td>
<td>{{debitItem.billdate}}</td>
<td>{{debitItem.amount}}</td>
<td>{{debitItem.paidby}}</td>
<td>
<span ng-repeat="shareby in debitItem.sharedbylist">
<span ng-if="!$last">{{shareby}},</span>
<span ng-if="$last">{{shareby}}</span>
</span>
</td>
<td>{{debitItem.individualShare}}</td>
</tr>
</table>
<div class="div_float">
<br>
<br>
<hr />
</div>
</div>
</div>
</body>
</html>