mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 13:51:55 +00:00
MIFOSX-1252 javascript/html changes and MIFOSX-1500 javascript/html/localisation changes
This commit is contained in:
parent
239f72fbdb
commit
004fb22b2e
@ -75,6 +75,9 @@
|
||||
"label.heading.count": "Count",
|
||||
"label.heading.percentage": "Percentage",
|
||||
"label.heading.due.savings.collections":"Due Savings Collections",
|
||||
"label.heading.loanamount" : "Original Loan",
|
||||
"label.heading.outstandingamount" : "Loan Balance",
|
||||
"label.heading.dueamount" : "Amount Paid",
|
||||
|
||||
"#Menu Links": "..",
|
||||
"label.menu.selectloanofficer": "Select Staff",
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
(function (module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
ViewSavingDetailsController: function (scope, routeParams, resourceFactory, location, route, dateFilter, $sce, $rootScope, API_VERSION) {
|
||||
ViewSavingDetailsController: function (scope, routeParams, resourceFactory, location, $modal, route, dateFilter, $sce, $rootScope, API_VERSION) {
|
||||
scope.report = false;
|
||||
scope.hidePentahoReport = true;
|
||||
scope.showActiveCharges = true;
|
||||
scope.formData = {};
|
||||
scope.date = {};
|
||||
scope.staffData = {};
|
||||
scope.fieldOfficers = [];
|
||||
scope.isDebit = function (savingsTransactionType) {
|
||||
return savingsTransactionType.withdrawal == true || savingsTransactionType.feeDeduction == true;
|
||||
};
|
||||
@ -28,7 +30,6 @@
|
||||
scope.savingaccountdetails.transactions[i][dateFieldName] = new Date(scope.savingaccountdetails.transactions[i].date);
|
||||
}
|
||||
};
|
||||
|
||||
scope.isRecurringCharge = function (charge) {
|
||||
return charge.chargeTimeType.value == 'Monthly Fee' || charge.chargeTimeType.value == 'Annual Fee' || charge.chargeTimeType.value == 'Weekly Fee';
|
||||
}
|
||||
@ -95,11 +96,15 @@
|
||||
case "close":
|
||||
location.path('/savingaccount/' + accountId + '/close');
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
resourceFactory.savingsResource.get({accountId: routeParams.id, associations: 'all'}, function (data) {
|
||||
scope.savingaccountdetails = data;
|
||||
scope.staffData.staffId = data.staffId;
|
||||
|
||||
scope.date.toDate = new Date();
|
||||
scope.date.fromDate = new Date(data.timeline.activatedOnDate);
|
||||
scope.status = data.status.value;
|
||||
@ -227,6 +232,13 @@
|
||||
annualdueDate.push(new Date().getFullYear());
|
||||
scope.annualdueDate = new Date(annualdueDate);
|
||||
};
|
||||
if(!(data.fieldOfficerId)){
|
||||
resourceFactory.savingsResource.get({accountId: routeParams.id, template: 'true'}, function (data) {
|
||||
scope.staffField = true;
|
||||
scope.fieldOfficers = data.fieldOfficerOptions;
|
||||
scope.formData.fieldOfficerId = data.fieldOfficerOptions[0].id;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
resourceFactory.DataTablesResource.getAllDataTables({apptable: 'm_savings_account'}, function (data) {
|
||||
@ -285,6 +297,57 @@
|
||||
scope.printbtn = false;
|
||||
};
|
||||
|
||||
scope.savingsAccountStaffCenter = function (staffId,command,tempUrl) {
|
||||
$modal.open({
|
||||
templateUrl: tempUrl,
|
||||
controller: SavingsStaffCtrl,
|
||||
resolve : {
|
||||
"parameters": function () {
|
||||
return {
|
||||
staffId :function()
|
||||
{
|
||||
return staffId;
|
||||
},
|
||||
command : function()
|
||||
{
|
||||
return command;
|
||||
},
|
||||
fieldOfficers: function(){
|
||||
return scope.fieldOfficers;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
var SavingsStaffCtrl = function ($scope, $modalInstance,parameters) {
|
||||
scope.staffData.staffId = parameters.staffId();
|
||||
$scope.command = parameters.command();
|
||||
$scope.fieldOfficers = parameters.fieldOfficers();
|
||||
$scope.unassign = function () {
|
||||
switch($scope.command)
|
||||
{
|
||||
case "unassignFieldOfficer":
|
||||
resourceFactory.savingsResource.save({accountId: routeParams.id, command:'unassignFieldOfficer'}, scope.staffData, function () {
|
||||
$modalInstance.close('unassignFieldOfficer');
|
||||
route.reload();
|
||||
});
|
||||
break;
|
||||
case "assignFieldOfficer":
|
||||
scope.staffData.staffId = scope.formData.fieldOfficerId;
|
||||
resourceFactory.savingsResource.save({accountId: routeParams.id, command: 'assignFieldOfficer'}, scope.staffData, function () {
|
||||
$modalInstance.close('assignFieldOfficer');
|
||||
route.reload();
|
||||
});
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
||||
scope.viewDataTable = function (registeredTableName,data){
|
||||
if (scope.datatabledetails.isMultirow) {
|
||||
location.path("/viewdatatableentry/"+registeredTableName+"/"+scope.savingaccountdetails.id+"/"+data.row[0]);
|
||||
@ -297,6 +360,8 @@
|
||||
scope.report = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
scope.viewprintdetails = function () {
|
||||
scope.printbtn = true;
|
||||
scope.hidePentahoReport = true;
|
||||
@ -324,7 +389,7 @@
|
||||
scope.printReport = function () {
|
||||
window.print();
|
||||
window.close();
|
||||
}
|
||||
};
|
||||
|
||||
scope.deleteAll = function (apptableName, entityId) {
|
||||
resourceFactory.DataTablesResource.delete({datatablename: apptableName, entityId: entityId, genericResultSet: 'true'}, {}, function (data) {
|
||||
@ -352,9 +417,8 @@
|
||||
};
|
||||
|
||||
}
|
||||
})
|
||||
;
|
||||
mifosX.ng.application.controller('ViewSavingDetailsController', ['$scope', '$routeParams', 'ResourceFactory', '$location', '$route', 'dateFilter', '$sce', '$rootScope', 'API_VERSION', mifosX.controllers.ViewSavingDetailsController]).run(function ($log) {
|
||||
});
|
||||
mifosX.ng.application.controller('ViewSavingDetailsController', ['$scope', '$routeParams', 'ResourceFactory', '$location','$modal', '$route', 'dateFilter', '$sce', '$rootScope', 'API_VERSION', mifosX.controllers.ViewSavingDetailsController]).run(function ($log) {
|
||||
$log.info("ViewSavingDetailsController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
|
||||
@ -165,9 +165,9 @@
|
||||
<tr class="graybg">
|
||||
<th>{{'label.heading.accnum' | translate}}</th>
|
||||
<th>{{'label.heading.loanaccount' | translate}}</th>
|
||||
<th>Loan Amount</th>
|
||||
<th>Outstd Amt.</th>
|
||||
<th>Due Amount</th>
|
||||
<th>{{'label.heading.loanamount' | translate}}</th>
|
||||
<th>{{'label.heading.outstandingamount' | translate}}</th>
|
||||
<th>{{'label.heading.dueamount' | translate}}</th>
|
||||
<th>{{'label.heading.type' | translate}}</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
@ -181,9 +181,9 @@
|
||||
{{loanaccount.accountNo}}
|
||||
</td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)">{{loanaccount.productName}}</td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)"> - </td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)"> - </td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)"> - </td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)">{{loanaccount.originalLoan}}</td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)">{{loanaccount.loanBalance}} </td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)">{{loanaccount.amountPaid}}</td>
|
||||
<td class="pointer center" data-ng-click="routeToLoan(loanaccount.id)" ng-if="loanaccount.loanType.value == 'Individual'">
|
||||
<i tooltip="{{loanaccount.loanType.value}}" class="icon-user icon-large"></i>
|
||||
</td>
|
||||
@ -221,6 +221,9 @@
|
||||
{{loanaccount.accountNo}}
|
||||
</td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)">{{loanaccount.productName}}</td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)">{{loanaccount.originalLoan}}</td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)">{{loanaccount.loanBalance}}</td>
|
||||
<td class="pointer" data-ng-click="routeToLoan(loanaccount.id)">{{loanaccount.amountPaid}}</td>
|
||||
<td class="pointer center" data-ng-click="routeToLoan(loanaccount.id)" ng-if="loanaccount.loanType.value == 'Individual'">
|
||||
<i tooltip="{{loanaccount.loanType.value}}" class="icon-user icon-large"></i>
|
||||
</td>
|
||||
|
||||
@ -6,6 +6,35 @@
|
||||
<li class="active">{{savingaccountdetails.savingsProductName}}({{savingaccountdetails.accountNo}})</li>
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/ng-template" id="savingsunassignstaff.html">
|
||||
<div class="modal-header silver">
|
||||
<h3 class="bolder">{{'label.heading.unassignstaff' | translate}}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<api-validate></api-validate>
|
||||
<br>
|
||||
<button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button>
|
||||
<button class="btn btn-primary" ng-click="unassign()">{{'label.button.confirm' | translate}}</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="savingsassignstaff.html">
|
||||
<div class="modal-header silver">
|
||||
<h3 class="bolder">{{'label.heading.assignstaff' | translate}}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<select chosen="fieldOfficers" id="fieldOfficerId" ng-model="formData.fieldOfficerId" class="form-control"
|
||||
ng-options="fieldOfficer.id as fieldOfficer.displayName for fieldOfficer in fieldOfficers" value="{{fieldOfficer.id}}">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
<api-validate></api-validate>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button>
|
||||
<button class="btn btn-primary" ng-click="unassign()">{{'label.button.confirm' | translate}}</button>
|
||||
<br>
|
||||
</div>
|
||||
</script>
|
||||
<div class="form-horizontal col-md-12" ng-show="report">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.fromdate' | translate}}<span
|
||||
@ -27,6 +56,8 @@
|
||||
max="restrictDate"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-offset-2">
|
||||
<button ng-click="viewprintdetails()" class="btn btn-primary ng-binding">
|
||||
{{'label.button.viewprint' | translate}}
|
||||
@ -59,7 +90,19 @@
|
||||
ng-click="clickEvent(button.name.replace('button.',''), savingaccountdetails.id)"
|
||||
class="btn btn-primary"><i class="{{button.icon}} icon-white"></i>{{'label.'+button.name |
|
||||
translate}}</a>
|
||||
</span>
|
||||
</span>
|
||||
<button type="button" class="btn btn-primary"
|
||||
data-ng-click="savingsAccountStaffCenter(savingaccountdetails.fieldOfficerId,'assignFieldOfficer','savingsassignstaff.html')"
|
||||
data-ng-hide="savingaccountdetails.fieldOfficerId" has-permission='ASSIGNFIELDOFFICER_SAVINGSACCOUNT'><i class="icon-user icon-white"></i>{{"label.button.assignstaff"
|
||||
|
|
||||
translate}}
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" data-ng-click="savingsAccountStaffCenter(savingaccountdetails.fieldOfficerId,'unassignFieldOfficer','savingsunassignstaff.html')"
|
||||
data-ng-show="savingaccountdetails.fieldOfficerId" has-permission='UNASSIGNFIELDOFFICER_SAVINGSACCOUNT'><i class="icon-user icon-white"></i>{{"label.button.unassignstaff"
|
||||
|
|
||||
translate}}
|
||||
</button>
|
||||
|
||||
<span ng-show="buttons.options" class="btn-group dropdown" on-toggle="toggled(open)">
|
||||
<a class="btn btn-primary dropdown-toggle">
|
||||
{{'label.button.more' | translate}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user