r430 - in trunk/chorem-webmotion/src/main/webapp: WEB-INF/jsp/financial js/financial
Author: ymartel Date: 2014-08-08 17:53:20 +0200 (Fri, 08 Aug 2014) New Revision: 430 Url: http://forge.chorem.org/projects/chorem/repository/revisions/430 Log: can remove an entry in an ExpenseAccount Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-08-08 08:10:43 UTC (rev 429) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/financial/expenseAccountView.jsp 2014-08-08 15:53:20 UTC (rev 430) @@ -68,42 +68,43 @@ </dd> </dd> - </dl> - </div> + </dl> + </div> - <div> - <table> - <tr> - <th style='width:15%'>Justif. Nb</th> - <th style='width:15%'>Emitted Date</th> - <th style='width:10%'>Project</th> - <th style='width:15%'>Description</th> - <th style='width:15%'>Category</th> - <th style='width:7%'>Amount</th> - <th style='width:7%'>VAT</th> - <th style='width:6%'>total</th> - <th style='width:10%'>Payment Date</th> - </tr> - <tr ng-repeat="expenseEntry in expenseAccount.expenseAccountEntries"> - <td>{{expenseEntry.justificationNumber}}</td> - <td>{{expenseEntry.emittedDate| date : "dd/MM/yyyy"}}</td> - <td><a href="<c:url value="/wikitty/view/{{expenseEntry.projectId}}"/>">{{expenseEntry.projectName}}</a></td> - <td>{{expenseEntry.description}}</td> - <td>{{expenseEntry.categoryName}}</td> - <td>{{expenseEntry.amount|number:2}}</td> - <td>{{expenseEntry.VAT|number:2}}</td> - <td>{{expenseEntry.total|number:2}}</td> - <td><span ng-if = "expenseEntry.paymentDate"> {{expenseEntry.paymentDate|date : "dd/MM/yyyy"}}</span></td> - </tr> - <tr ng-if="showNewLine == true" ng-include src="'expenseAccountEntryEdit.html'"></tr> - </table> - </div> - <a class="btn btn-success" ng-click="newLine()" ng-show="!showNewLine"><i class="icon-list icon-white"></i> New entry</a> - <a class="btn btn-danger" ng-click="newLine()" ng-show="showNewLine"><i class="icon-list icon-white"></i> Cancel</a> - <div ng-show="hasChanged"> - <a class="btn btn-success" ng-click="saveExpenseAccount()"><i class="icon-od icon-white"></i>Save</a> - </div> + <div> + <table> + <tr> + <th style='width:15%'>Justif. Nb</th> + <th style='width:10%'>Emitted Date</th> + <th style='width:10%'>Project</th> + <th style='width:15%'>Description</th> + <th style='width:15%'>Category</th> + <th style='width:7%'>Amount</th> + <th style='width:7%'>VAT</th> + <th style='width:6%'>total</th> + <th style='width:10%'>Payment Date</th> + <th style='width:5%'></th> + </tr> + <tr ng-repeat="expenseEntry in expenseAccount.expenseAccountEntries" id="tr-entry-{{expenseEntry.id}}"> + <td id="expenseEntry-justif-{{expenseEntry.id}}">{{expenseEntry.justificationNumber}}</td> + <td id="expenseEntry-emittedDate-{{expenseEntry.id}}">{{expenseEntry.emittedDate| date : "dd/MM/yyyy"}}</td> + <td id="expenseEntry-project-{{expenseEntry.id}}"><a href="<c:url value="/wikitty/view/{{expenseEntry.projectId}}"/>">{{expenseEntry.projectName}}</a></td> + <td id="expenseEntry-description-{{expenseEntry.id}}">{{expenseEntry.description}}</td> + <td id="expenseEntry-category-{{expenseEntry.id}}">{{expenseEntry.categoryName}}</td> + <td id="expenseEntry-amount-{{expenseEntry.id}}">{{expenseEntry.amount|number:2}}</td> + <td id="expenseEntry-vat-{{expenseEntry.id}}">{{expenseEntry.VAT|number:2}}</td> + <td id="expenseEntry-total-{{expenseEntry.id}}">{{expenseEntry.total|number:2}}</td> + <td id="expenseEntry-paymentDate-{{expenseEntry.id}}"><span ng-if = "expenseEntry.paymentDate"> {{expenseEntry.paymentDate|date : "dd/MM/yyyy"}}</span></td> + <td id="expenseEntry-edit-{{expenseEntry.id}}"><span class="glyphicon glyphicon-remove" ng-click="deleteLine(expenseEntry)"></span></td> + </tr> + <tr ng-if="showNewLine == true" ng-include src="'expenseAccountEntryEdit.html'"></tr> + </table> + </div> -</div> + <div> + <a class="btn btn-success" ng-click="newLine()" ng-show="!showNewLine"><i class="icon-list icon-white"></i>New entry</a> + <a class="btn btn-danger" ng-click="newLine()" ng-show="showNewLine"><i class="icon-list icon-white"></i>Cancel</a> + <a class="btn btn-success" ng-click="saveExpenseAccount()" ng-show="hasChanged"><i class="icon-od icon-white"></i>Save</a> + </div> </div> Modified: trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js =================================================================== --- trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-08-08 08:10:43 UTC (rev 429) +++ trunk/chorem-webmotion/src/main/webapp/js/financial/expenseAccount.js 2014-08-08 15:53:20 UTC (rev 430) @@ -28,6 +28,17 @@ } } + $scope.deleteLine = function(expenseAccountEntry) { + if (expenseAccountEntry) { + var toDelete = $scope.expenseAccount.expenseAccountEntries.indexOf(expenseAccountEntry); + if (toDelete != -1) { + $scope.expenseAccount.expenseAccountEntries.splice(toDelete, 1); + $scope.hasChanged = true; + } + } + console.log($scope.expenseAccount); + } + $scope.ac_options = { baseURL : $scope.baseURL, };
participants (1)
-
ymartel@users.chorem.org