mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 11:36:48 +00:00
Fineract-1410 Allow Payment types to map to all types of Ledgers (#3429)
This commit is contained in:
parent
fc4f9e3882
commit
72456b7a55
@ -1467,6 +1467,7 @@
|
||||
"label.input.interestchargedfrom": "Interest charged from",
|
||||
"label.input.firstrepaymenton": "First repayment on",
|
||||
"label.input.value": "Value",
|
||||
"label.input.stringValue": "String Value",
|
||||
"label.input.existingclient": "Existing client",
|
||||
"label.input.approvedondate": "Approved on",
|
||||
"label.input.rejectedondate": "Rejected on",
|
||||
@ -2896,6 +2897,7 @@
|
||||
"label.tooltip.global.rounding-mode": "Enabling this entity causes the rounding of amounts to be performed. Possible values: 0 - UP, 1 - DOWN, 2 - CEILING, 3 - FLOOR, 4 - HALF_UP, 5 - HALF_DOWN, 6 - HALF_EVEN",
|
||||
"label.tooltip.global.savings-interest-posting-current-period-end": "This entity is recommended to be changed only once during the start of production. When set as false (default), the interest will be posted on the first date of the next period. If set as true, the interest will be posted on the last date of the current period. There is no difference in the interest amount posted.",
|
||||
"label.tooltip.global.skip-repayment-on-first-day-of-month": "Determines whether a repayment landing on the first day of a month will be skipped.",
|
||||
"label.tooltip.global.account-mapping-for-payment-type":"String value: Asset as default for asset, Or use comma seperated values for Liability, Asset and Expense accounts",
|
||||
"#----------------": "------------",
|
||||
"#Admin-Products": "....",
|
||||
"#Headings": "..",
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
scope.configId = routeParams.configId;
|
||||
resourceFactory.configurationResource.get({id: scope.configId}, function (data) {
|
||||
scope.formData = {value: data.value};
|
||||
scope.formData = {value: data.value, stringValue: data.stringValue};
|
||||
});
|
||||
scope.cancel = function () {
|
||||
location.path('/global');
|
||||
|
||||
@ -18,6 +18,24 @@
|
||||
scope.liabilityAccountOptions = scope.product.accountingMappingOptions.liabilityAccountOptions || [];
|
||||
scope.incomeAccountOptions = scope.product.accountingMappingOptions.incomeAccountOptions || [];
|
||||
scope.expenseAccountOptions = scope.product.accountingMappingOptions.expenseAccountOptions || [];
|
||||
scope.paymentOptions = [];
|
||||
//
|
||||
scope.accountMappingForPayment = scope.product.accountMappingForPayment.toLowerCase();
|
||||
var accountMappingForPaymentVar = scope.accountMappingForPayment;
|
||||
if(accountMappingForPaymentVar.indexOf("asset") > -1){
|
||||
scope.paymentOptions = scope.paymentOptions.concat(scope.assetAccountOptions);
|
||||
}
|
||||
if(accountMappingForPaymentVar.indexOf("liability") > -1){
|
||||
scope.paymentOptions = scope.paymentOptions.concat(scope.liabilityAccountOptions);
|
||||
}
|
||||
if(accountMappingForPaymentVar.indexOf("expense") > -1){
|
||||
scope.paymentOptions = scope.paymentOptions.concat(scope.expenseAccountOptions);
|
||||
}
|
||||
if(accountMappingForPaymentVar.indexOf("income") > -1){
|
||||
scope.paymentOptions = scope.paymentOptions.concat(scope.incomeAccountOptions);
|
||||
}
|
||||
|
||||
|
||||
|
||||
scope.formData.currencyCode = data.currencyOptions[0].code;
|
||||
scope.formData.digitsAfterDecimal = data.currencyOptions[0].decimalPlaces;
|
||||
@ -78,12 +96,12 @@
|
||||
|
||||
scope.addConfigureFundSource = function () {
|
||||
if (scope.product.paymentTypeOptions && scope.product.paymentTypeOptions.length > 0 &&
|
||||
scope.assetAccountOptions && scope.assetAccountOptions.length > 0) {
|
||||
scope.paymentOptions && scope.paymentOptions.length > 0) {
|
||||
scope.configureFundOptions.push({
|
||||
paymentTypeId: scope.product.paymentTypeOptions[0].id,
|
||||
fundSourceAccountId: scope.assetAccountOptions[0].id,
|
||||
fundSourceAccountId: scope.paymentOptions[0].id,
|
||||
paymentTypeOptions: scope.product.paymentTypeOptions,
|
||||
assetAccountOptions: scope.assetAccountOptions
|
||||
assetAccountOptions: scope.paymentOptions
|
||||
});
|
||||
}
|
||||
;
|
||||
|
||||
@ -45,6 +45,23 @@
|
||||
daysToDormancy: data.daysToDormancy,
|
||||
daysToEscheat: data.daysToEscheat
|
||||
}
|
||||
scope.paymentOptions = [];
|
||||
//
|
||||
scope.accountMappingForPayment = scope.product.accountMappingForPayment.toLowerCase();
|
||||
var accountMappingForPaymentVar = scope.accountMappingForPayment;
|
||||
if(accountMappingForPaymentVar.indexOf("asset") > -1){
|
||||
scope.paymentOptions = scope.paymentOptions.concat(scope.assetAccountOptions);
|
||||
}
|
||||
if(accountMappingForPaymentVar.indexOf("liability") > -1){
|
||||
scope.paymentOptions = scope.paymentOptions.concat(scope.liabilityAccountOptions);
|
||||
}
|
||||
if(accountMappingForPaymentVar.indexOf("expense") > -1){
|
||||
scope.paymentOptions = scope.paymentOptions.concat(scope.expenseAccountOptions);
|
||||
}
|
||||
if(accountMappingForPaymentVar.indexOf("income") > -1){
|
||||
scope.paymentOptions = scope.paymentOptions.concat(scope.incomeAccountOptions);
|
||||
}
|
||||
|
||||
|
||||
if(data.withHoldTax){
|
||||
scope.formData.taxGroupId = data.taxGroup.id;
|
||||
@ -65,6 +82,8 @@
|
||||
scope.formData.overdraftPortfolioControlId = data.accountingMappings.overdraftPortfolioControl.id;
|
||||
scope.formData.incomeFromInterestId = data.accountingMappings.incomeFromInterest.id;
|
||||
|
||||
|
||||
|
||||
_.each(scope.product.paymentChannelToFundSourceMappings, function (fundSource) {
|
||||
scope.configureFundOptions.push({
|
||||
paymentTypeId: fundSource.paymentType.id,
|
||||
@ -73,7 +92,7 @@
|
||||
assetAccountOptions: scope.assetAccountOptions
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
_.each(scope.product.feeToIncomeAccountMappings, function (fees) {
|
||||
scope.specificIncomeaccounts.push({
|
||||
chargeId: fees.charge.id,
|
||||
@ -120,16 +139,17 @@
|
||||
scope.charges.splice(index, 1);
|
||||
}
|
||||
|
||||
scope.addConfigureFundSource = function () {
|
||||
scope.addConfigureFundSource = function () {
|
||||
if (scope.product.paymentTypeOptions && scope.product.paymentTypeOptions.length > 0 &&
|
||||
scope.assetAccountOptions && scope.assetAccountOptions.length > 0) {
|
||||
scope.paymentOptions && scope.paymentOptions.length > 0) {
|
||||
scope.configureFundOptions.push({
|
||||
paymentTypeId: scope.product.paymentTypeOptions[0].id,
|
||||
fundSourceAccountId: scope.assetAccountOptions[0].id,
|
||||
fundSourceAccountId: scope.paymentOptions[0].id,
|
||||
paymentTypeOptions: scope.product.paymentTypeOptions,
|
||||
assetAccountOptions: scope.assetAccountOptions
|
||||
assetAccountOptions: scope.paymentOptions
|
||||
});
|
||||
}
|
||||
;
|
||||
}
|
||||
|
||||
scope.mapFees = function () {
|
||||
|
||||
@ -1,31 +1,40 @@
|
||||
<div class="content-container" ng-controller="EditConfigurationController">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/global">{{'label.anchor.globalconfigurations' | translate}}</a></li>
|
||||
<li class="active">{{'label.anchor.editconfiguration' | translate}}</li>
|
||||
</ul>
|
||||
<form name="editconfigurationform" novalidate="" class="card form-horizontal well" ng-submit="submit()">
|
||||
<api-validate></api-validate>
|
||||
<fieldset>
|
||||
<legend>{{ 'label.anchor.editconfiguration' | translate }}</legend>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="amount">{{ 'label.input.value' | translate }}<span
|
||||
class="required">*</span></label>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/global">{{'label.anchor.globalconfigurations' | translate}}</a></li>
|
||||
<li class="active">{{'label.anchor.editconfiguration' | translate}}</li>
|
||||
</ul>
|
||||
<form name="editconfigurationform" novalidate="" class="card form-horizontal well" ng-submit="submit()">
|
||||
<api-validate></api-validate>
|
||||
<fieldset>
|
||||
<legend>{{ 'label.anchor.editconfiguration' | translate }}</legend>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="amount">{{ 'label.input.value' | translate }}<span
|
||||
class="required">*</span></label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<input id="amount" ng-autofocus="true" type="text" name="value" ng-model="formData.value" class="form-control" required
|
||||
late-Validate/>
|
||||
<form-validate valattributeform="editconfigurationform" valattribute="value"/>
|
||||
<div class="col-sm-3">
|
||||
<input id="amount" ng-autofocus="true" type="text" name="value" ng-model="formData.value" class="form-control" required
|
||||
late-Validate/>
|
||||
<form-validate valattributeform="editconfigurationform" valattribute="value"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="amount">{{ 'label.input.stringValue' | translate }}</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="amount" ng-autofocus="true" type="text" name="stringValue" ng-model="formData.stringValue" class="form-control" late-Validate/>
|
||||
<form-validate valattributeform="editconfigurationform" valattribute="stringValue"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-offset-3">
|
||||
<button id="cancel" type="reset" class="btn btn-default" ng-click="cancel()">{{ 'label.button.cancel' | translate
|
||||
}}
|
||||
</button>
|
||||
<button id="save" type="submit" ng-disabled="!editconfigurationform.$valid" has-permission='UPDATE_CONFIGURATION' class="btn btn-primary">{{
|
||||
'label.button.save' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="col-md-offset-3">
|
||||
<button id="cancel" type="reset" class="btn btn-default" ng-click="cancel()">{{ 'label.button.cancel' | translate
|
||||
}}
|
||||
</button>
|
||||
<button id="save" type="submit" ng-disabled="!editconfigurationform.$valid" has-permission='UPDATE_CONFIGURATION' class="btn btn-primary">{{
|
||||
'label.button.save' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user