Share Product and Share Account views updated

This commit is contained in:
Jose Alberto Hernandez
2024-05-19 00:22:51 -06:00
committed by Jose Alberto Hernandez
parent fafdd0dd20
commit a41df49a3e
83 changed files with 1017 additions and 544 deletions
@@ -605,7 +605,7 @@
<tr mat-header-row *matHeaderRowDef="openSharesColumns"></tr>
<tr mat-row *matRowDef="let row; columns: openSharesColumns;"
[routerLink]="['../', 'shares-accounts', row.id, 'transactions']"></tr>
[routerLink]="['../', 'shares-accounts', row.id, 'general']"></tr>
</table>
@@ -640,7 +640,7 @@
</ng-container>
<tr mat-header-row *matHeaderRowDef="closedSharesColumns"></tr>
<tr mat-row *matRowDef="let row; columns: closedSharesColumns;" [routerLink]="['../', 'shares-accounts', row.id, 'transactions']"></tr>
<tr mat-row *matRowDef="let row; columns: closedSharesColumns;" [routerLink]="['../', 'shares-accounts', row.id, 'general']"></tr>
</table>
+6 -2
View File
@@ -5,8 +5,12 @@ import { OptionData } from 'app/shared/models/option-data.model';
@Injectable({
providedIn: 'root'
})
export class Accounting {
})
export class Accounting {
public getAccountingRulesForShares(): string[] {
return ['NONE', 'Cash'];
}
public getAccountingRulesForSavings(): string[] {
return ['NONE', 'Cash', 'Accrual (periodic)'];
+19
View File
@@ -0,0 +1,19 @@
import { Injectable } from '@angular/core';
import { OptionData } from 'app/shared/models/option-data.model';
@Injectable({
providedIn: 'root'
})
export class Charges {
public getChargeAppliesToOptions(): OptionData[] {
return [
{ 'id': 1, 'code': 'chargeAppliesTo.loan', 'value': 'Loan' },
{ 'id': 2, 'code': 'chargeAppliesTo.savings', 'value': 'Savings' },
{ 'id': 3, 'code': 'chargeAppliesTo.client', 'value': 'Client' },
{ 'id': 4, 'code': 'chargeAppliesTo.shares', 'value': 'Shares' }
];
}
}
@@ -43,7 +43,7 @@
</span></td>
</tr>
<tr *ngIf="recurringDepositsAccountData.minBalanceForInterestCalculation">
<td> {{"labels.inputs.Balance Required For Interest Calculation" | translate }}</td>
<td> {{"labels.inputs.Balance Required for Interest Calculation" | translate }}</td>
<td><span>{{recurringDepositsAccountData.minBalanceForInterestCalculation}}</span></td>
</tr>
<tr *ngIf="recurringDepositsAccountData.witdHoldTax">
@@ -166,7 +166,7 @@
</td>
</tr>
<tr *ngIf="recurringDepositsAccountData.minBalanceForInterestCalculation">
<td> {{"labels.inputs.Balance Required For Interest Calculation" | translate }} </td>
<td> {{"labels.inputs.Balance Required for Interest Calculation" | translate }} </td>
<td class="r-amount">
<span>{{ recurringDepositsAccountData.minBalanceForInterestCalculation | number }}</span>
</td>
@@ -132,6 +132,16 @@
fxFlex="60%">{{ loansAccount.transactionProcessingStrategyCode | find:loansAccountProductTemplate.transactionProcessingStrategyOptions:'code':'name' }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%"> {{"labels.inputs.Installment Amount" | translate}} </span>
<span fxFlex="60%"> {{ loansAccount.fixedEmiAmount | formatNumber }} </span>
</div>
<div fxFlexFill>
<span fxFlex="40%"> {{"labels.inputs.Balloon Repayment Amount" | translate}} </span>
<span fxFlex="60%"> {{ loansAccount.balloonRepaymentAmount | formatNumber }} </span>
</div>
<h3 class="mat-h3" fxFlexFill>{{"labels.heading.Moratorium" | translate}}</h3>
<mat-divider fxFlexFill></mat-divider>
@@ -209,6 +209,16 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%" *ngIf="loansAccountTermsData?.canDefineInstallmentAmount">
<mat-label>{{"labels.inputs.Installment Amount" | translate}}</mat-label>
<input type="number" matInput formControlName="fixedEmiAmount">
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Balloon Repayment Amount" | translate}}</mat-label>
<input type="number" matInput formControlName="balloonRepaymentAmount">
</mat-form-field>
<h4 fxFlex="98%" class="mat-h4">{{"labels.heading.Interest Calculations" | translate}}</h4>
<mat-form-field fxFlex="48%">
@@ -280,11 +290,6 @@
</ng-container>
<mat-form-field fxFlex="48%" *ngIf="loansAccountTermsData?.canDefineInstallmentAmount">
<mat-label>{{"labels.inputs.Installment Amount" | translate}}</mat-label>
<input type="number" matInput formControlName="fixedEmiAmount">
</mat-form-field>
<mat-divider fxFlex="98%"></mat-divider>
<div fxFlexFill>
@@ -145,7 +145,8 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
'transactionProcessingStrategyCode': this.loansAccountTermsData.transactionProcessingStrategyCode,
'interestRateDifferential': this.loansAccountTermsData.interestRateDifferential,
'multiDisburseLoan': this.loansAccountTermsData.multiDisburseLoan,
'interestRateFrequencyType': this.loansAccountTermsData.interestRateFrequencyType.id
'interestRateFrequencyType': this.loansAccountTermsData.interestRateFrequencyType.id,
'balloonRepaymentAmount': this.loansAccountTermsData.balloonRepaymentAmount,
});
this.setAdvancedPaymentStrategyControls();
@@ -237,7 +238,8 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
'transactionProcessingStrategyCode': this.loansAccountTermsData.transactionProcessingStrategyCode,
'interestRateDifferential': this.loansAccountTermsData.interestRateDifferential,
'multiDisburseLoan': this.loansAccountTermsData.multiDisburseLoan,
'interestRateFrequencyType': this.loansAccountTermsData.interestRateFrequencyType.id
'interestRateFrequencyType': this.loansAccountTermsData.interestRateFrequencyType.id,
'balloonRepaymentAmount': this.loansAccountTermsData.balloonRepaymentAmount
});
}
this.createloansAccountTermsForm();
@@ -357,7 +359,8 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
'interestRateDifferential': [''],
'transactionProcessingStrategyCode': ['', Validators.required],
'multiDisburseLoan': [false],
'interestRateFrequencyType': ['']
'interestRateFrequencyType': [''],
'balloonRepaymentAmount': ['']
});
}
@@ -200,6 +200,11 @@
<span fxFlex="50%">{{ loanDetails.principal | currency:currencyCode:'symbol-narrow':'1.2-2' }}</span>
</div>
<div fxFlexFill *ngIf="loanDetails.balloonRepaymentAmount > 0">
<span fxFlex="50%">{{"labels.inputs.Balloon Repayment Amount" | translate}}:</span>
<span fxFlex="50%">{{ loanDetails.balloonRepaymentAmount | currency:currencyCode:'symbol-narrow':'1.2-2' }}</span>
</div>
<div fxFlexFill>
<span fxFlex="50%">{{"labels.inputs.Arrears By" | translate}}:</span>
<span fxFlex="50%">{{"labels.inputs.Not Provided" | translate}}</span>
@@ -5,6 +5,7 @@
h3 {
margin: 1% auto;
}
.performance-history-container {
border: 1px solid;
padding: 1%;
@@ -19,4 +20,4 @@
span {
margin: 0.5em 0;
}
}
+35 -15
View File
@@ -10,10 +10,17 @@
<div class="container">
<div #filter fxLayout="row" fxLayoutGap="20px">
<mat-form-field fxFlex>
<mat-form-field fxFlex fxFlex="68%">
<mat-label>{{'labels.inputs.Filter' | translate}}</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)">
</mat-form-field>
<mat-form-field fxFlex fxFlex="28%">
<mat-select placeholder="{{'labels.inputs.Filter' | translate}}" (selectionChange)="filterByAppliesTo($event.value)">
<mat-option *ngFor="let chargeAppliesTo of chargeAppliesToOptions" [value]="chargeAppliesTo.id">
{{ chargeAppliesTo.value | translateCatalog }}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div #chargesTable class="mat-elevation-z8">
@@ -46,18 +53,23 @@
</ng-container>
<ng-container matColumnDef="penalty">
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.commons.Is" | translate}} {{"labels.inputs.Penalty" | translate}}? </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.commons.Is" | translate}}
{{"labels.inputs.Penalty" | translate}}? </th>
<td mat-cell *matCellDef="let charge" class="center">
<fa-icon *ngIf="charge.penalty" icon="check-circle" size="lg" class="ispenalty" matTooltip="Yes" matTooltipPosition="right"></fa-icon>
<fa-icon *ngIf="!charge.penalty" icon="times-circle" size="lg" class="nopenalty" matTooltip="No" matTooltipPosition="right"></fa-icon>
<fa-icon *ngIf="charge.penalty" icon="check-circle" size="lg" class="ispenalty" matTooltip="Yes"
matTooltipPosition="right"></fa-icon>
<fa-icon *ngIf="!charge.penalty" icon="times-circle" size="lg" class="nopenalty" matTooltip="No"
matTooltipPosition="right"></fa-icon>
</td>
</ng-container>
<ng-container matColumnDef="active">
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.commons.Is" | translate}} {{"labels.status.Active" | translate}}? </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.commons.Is" | translate}}
{{"labels.status.Active" | translate}}? </th>
<td mat-cell *matCellDef="let charge" class="center">
<div [className]="charge.active === true ? 'true' : 'false'">
<fa-icon matTooltip="{{ charge.active === true ? 'Active' : 'Inactive' }}" matTooltipPosition="right" icon="circle" size="lg"></fa-icon>
<fa-icon matTooltip="{{ charge.active === true ? 'Active' : 'Inactive' }}" matTooltipPosition="right"
icon="circle" size="lg"></fa-icon>
</div>
</td>
</ng-container>
@@ -77,26 +89,34 @@
<h2>{{"labels.text.Create Charge" | translate}}</h2>
<p class="mw300">{{"labels.text.Supports Loan charges, Savings & deposits" | translate}}</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">Next</button>
<button mat-raised-button color="primary"
(click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">Next</button>
</div>
</ng-template>
<ng-template #templateFilter let-popover="popover">
<h4>{{"labels.heading.Search bar to filter charges." | translate}}</h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateButtonCreateCharge,buttonCreateCharge , 'bottom', true)">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateChargesTable,chargesTable, 'top', true)">Next</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary"
(click)="popover.close();showPopover(templateButtonCreateCharge,buttonCreateCharge , 'bottom', true)">Back</button>
<button mat-raised-button color="primary"
(click)="popover.close();showPopover(templateChargesTable,chargesTable, 'top', true)">Next</button>
</div>
</ng-template>
<ng-template #templateChargesTable let-popover="popover">
<h4 class="mw300">{{"labels.heading.List of charges in the organization. For more details click" | translate}}: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/72908813/Charges" target="_blank">Charges</a></h4>
<h4 class="mw300">{{"labels.heading.List of charges in the organization. For more details click" | translate}}: <a
href="https://mifosforge.jira.com/wiki/spaces/docs/pages/72908813/Charges" target="_blank">Charges</a></h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">Back</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary"
(click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">Next</button>
</div>
</ng-template>
</ng-template>
+18 -2
View File
@@ -11,6 +11,9 @@ import { of } from 'rxjs';
/** Custom Services */
import { PopoverService } from '../../configuration-wizard/popover/popover.service';
import { ConfigurationWizardService } from '../../configuration-wizard/configuration-wizard.service';
import { Charges } from 'app/core/utils/charges';
import { OptionData } from 'app/shared/models/option-data.model';
import { Charge } from './models/charge.model';
/**
* Charges component.
@@ -23,7 +26,7 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura
export class ChargesComponent implements OnInit, AfterViewInit {
/** Charge data. */
chargeData: any;
chargeData: Charge[] = [];
/** Columns to be displayed in charges table. */
displayedColumns: string[] = ['name', 'chargeAppliesTo', 'chargeTimeType', 'chargeCalculationType', 'amount', 'penalty', 'active'];
/** Data source for charges table. */
@@ -43,6 +46,8 @@ export class ChargesComponent implements OnInit, AfterViewInit {
/* Template for popover on charges table */
@ViewChild('templateChargesTable') templateChargesTable: TemplateRef<any>;
chargeAppliesToOptions: OptionData[] = [];
/**
* Retrieves the charges data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
@@ -53,10 +58,12 @@ export class ChargesComponent implements OnInit, AfterViewInit {
constructor(private route: ActivatedRoute,
private router: Router,
private configurationWizardService: ConfigurationWizardService,
private popoverService: PopoverService) {
private popoverService: PopoverService,
private charges: Charges) {
this.route.data.subscribe(( data: { charges: any }) => {
this.chargeData = data.charges;
});
this.chargeAppliesToOptions = this.charges.getChargeAppliesToOptions();
}
/**
@@ -136,4 +143,13 @@ export class ChargesComponent implements OnInit, AfterViewInit {
this.configurationWizardService.showCharges = true;
this.router.navigate(['/products']);
}
filterByAppliesTo(chargeAppliesTo: number) {
console.log(chargeAppliesTo);
const filteredCharges: Charge[] = this.chargeData.filter((charge: Charge) => {
return (charge.chargeAppliesTo.id === chargeAppliesTo);
});
this.dataSource = new MatTableDataSource(filteredCharges);
}
}
@@ -0,0 +1,52 @@
import { Currency, PaymentTypeOption } from 'app/shared/models/general.model';
import { OptionData } from 'app/shared/models/option-data.model';
export interface Charge {
id: number;
name: string;
active: boolean;
penalty: boolean;
freeWithdrawal: boolean;
freeWithdrawalChargeFrequency: number;
restartFrequency: number;
restartFrequencyEnum: number;
isPaymentType: boolean;
currency: Currency;
amount: number;
chargeTimeType: OptionData;
chargeAppliesTo: OptionData;
chargeCalculationType: OptionData;
chargePaymentMode: OptionData;
feeInterval?: number;
feeFrequency?: OptionData;
feeOnMonthDay?: number[];
paymentTypeOptions?: PaymentTypeOption;
}
export enum ChargeAppliesToCode {
ChargeAppliesToClient = 'chargeAppliesTo.client',
ChargeAppliesToLoan = 'chargeAppliesTo.loan',
ChargeAppliesToSavings = 'chargeAppliesTo.savings',
ChargeAppliesToShares = 'chargeAppliesTo.shares',
ChargeCalculationTypeFlat = 'chargeCalculationType.flat',
ChargeCalculationTypePercentOfAmount = 'chargeCalculationType.percent.of.amount',
ChargeCalculationTypePercentOfAmountAndInterest = 'chargeCalculationType.percent.of.amount.and.interest',
ChargeCalculationTypePercentOfInterest = 'chargeCalculationType.percent.of.interest',
ChargeTimeTypeActivation = 'chargeTimeType.activation',
ChargeTimeTypeAnnualFee = 'chargeTimeType.annualFee',
ChargeTimeTypeDisbursement = 'chargeTimeType.disbursement',
ChargeTimeTypeInstalmentFee = 'chargeTimeType.instalmentFee',
ChargeTimeTypeMonthlyFee = 'chargeTimeType.monthlyFee',
ChargeTimeTypeOverdueInstallment = 'chargeTimeType.overdueInstallment',
ChargeTimeTypeSavingsActivation = 'chargeTimeType.savingsActivation',
ChargeTimeTypeSavingsNoActivityFee = 'chargeTimeType.savingsNoActivityFee',
ChargeTimeTypeSharespurchase = 'chargeTimeType.sharespurchase',
ChargeTimeTypeSharesredeem = 'chargeTimeType.sharesredeem',
ChargeTimeTypeSolidarityFund = 'chargeTimeType.solidarityFund',
ChargeTimeTypeSpecifiedDueDate = 'chargeTimeType.specifiedDueDate',
ChargeTimeTypeWeeklyFee = 'chargeTimeType.weeklyFee',
ChargeTimeTypeWithdrawalFee = 'chargeTimeType.withdrawalFee',
ChargepaymentmodeAccounttransfer = 'chargepaymentmode.accounttransfer',
ChargepaymentmodeRegular = 'chargepaymentmode.regular',
FeeFrequencyperiodFrequencyTypeMonths = 'feeFrequencyperiodFrequencyType.months',
}
@@ -128,7 +128,7 @@
</div>
<div fxFlexFill *ngIf="fixedDepositProductData.minBalanceForInterestCalculation">
<span fxFlex="40%">{{'labels.inputs.Balance Required For Interest Calculation' | translate}}:</span>
<span fxFlex="40%">{{'labels.inputs.Balance Required for Interest Calculation' | translate}}:</span>
<span fxFlex="60%">{{ fixedDepositProductData.minBalanceForInterestCalculation | formatNumber }}</span>
</div>
@@ -24,7 +24,7 @@
<mat-step [stepControl]="shareProductDetailsForm">
<ng-template matStepLabel>DETAILS</ng-template>
<ng-template matStepLabel>{{'labels.inputs.DETAILS' | translate}}</ng-template>
<mifosx-share-product-details-step></mifosx-share-product-details-step>
@@ -32,7 +32,7 @@
<mat-step [stepControl]="shareProductCurrencyForm">
<ng-template matStepLabel>CURRENCY</ng-template>
<ng-template matStepLabel>{{'labels.inputs.CURRENCY' | translate}}</ng-template>
<mifosx-share-product-currency-step [shareProductsTemplate]="shareProductsTemplate"></mifosx-share-product-currency-step>
@@ -40,7 +40,7 @@
<mat-step [stepControl]="shareProductTermsForm">
<ng-template matStepLabel>TERMS</ng-template>
<ng-template matStepLabel>{{'labels.inputs.TERMS' | translate}}</ng-template>
<mifosx-share-product-terms-step></mifosx-share-product-terms-step>
@@ -48,7 +48,7 @@
<mat-step [stepControl]="shareProductSettingsForm">
<ng-template matStepLabel>SETTINGS</ng-template>
<ng-template matStepLabel>{{'labels.inputs.SETTINGS' | translate}}</ng-template>
<mifosx-share-product-settings-step [shareProductsTemplate]="shareProductsTemplate"></mifosx-share-product-settings-step>
@@ -56,7 +56,7 @@
<mat-step [stepControl]="shareProductMarketPriceForm">
<ng-template matStepLabel>MARKET PRICE</ng-template>
<ng-template matStepLabel>{{'labels.inputs.MARKET PRICE' | translate}}</ng-template>
<mifosx-share-product-market-price-step></mifosx-share-product-market-price-step>
@@ -64,7 +64,7 @@
<mat-step>
<ng-template matStepLabel>CHARGES</ng-template>
<ng-template matStepLabel>{{'labels.inputs.CHARGES' | translate}}</ng-template>
<mifosx-share-product-charges-step
[shareProductsTemplate]="shareProductsTemplate"
@@ -76,7 +76,7 @@
<mat-step [stepControl]="shareProductAccountingForm">
<ng-template matStepLabel>ACCOUNTING</ng-template>
<ng-template matStepLabel>{{'labels.inputs.ACCOUNTING' | translate}}</ng-template>
<mifosx-share-product-accounting-step
[shareProductsTemplate]="shareProductsTemplate"
@@ -89,7 +89,7 @@
<mat-step state="preview" *ngIf="shareProductFormValid" completed>
<ng-template matStepLabel>PREVIEW</ng-template>
<ng-template matStepLabel>{{'labels.inputs.PREVIEW' | translate}}</ng-template>
<mifosx-share-product-preview-step
[shareProductsTemplate]="shareProductsTemplate"
@@ -14,6 +14,7 @@ import { ShareProductAccountingStepComponent } from '../share-product-stepper/sh
/** Custom Services */
import { ProductsService } from 'app/products/products.service';
import { SettingsService } from 'app/settings/settings.service';
import { Accounting } from 'app/core/utils/accounting';
@Component({
selector: 'mifosx-create-share-product',
@@ -31,7 +32,7 @@ export class CreateShareProductComponent implements OnInit {
@ViewChild(ShareProductAccountingStepComponent, { static: true }) shareProductAccountingStep: ShareProductAccountingStepComponent;
shareProductsTemplate: any;
accountingRuleData = ['None', 'Cash'];
accountingRuleData: string[] = [];
/**
* @param {ActivatedRoute} route Activated Route.
@@ -43,10 +44,12 @@ export class CreateShareProductComponent implements OnInit {
constructor(private route: ActivatedRoute,
private productsService: ProductsService,
private router: Router,
private settingsService: SettingsService) {
private settingsService: SettingsService,
private accounting: Accounting) {
this.route.data.subscribe((data: { shareProductsTemplate: any }) => {
this.shareProductsTemplate = data.shareProductsTemplate;
});
this.accountingRuleData = this.accounting.getAccountingRulesForShares();
}
ngOnInit() {
@@ -24,7 +24,7 @@
<mat-step [stepControl]="shareProductDetailsForm" completed>
<ng-template matStepLabel>DETAILS</ng-template>
<ng-template matStepLabel>{{'labels.inputs.DETAILS' | translate}}</ng-template>
<mifosx-share-product-details-step [shareProductsTemplate]="shareProductAndTemplate"></mifosx-share-product-details-step>
@@ -32,7 +32,7 @@
<mat-step [stepControl]="shareProductCurrencyForm" completed>
<ng-template matStepLabel>CURRENCY</ng-template>
<ng-template matStepLabel>{{'labels.inputs.CURRENCY' | translate}}</ng-template>
<mifosx-share-product-currency-step [shareProductsTemplate]="shareProductAndTemplate"></mifosx-share-product-currency-step>
@@ -40,7 +40,7 @@
<mat-step [stepControl]="shareProductTermsForm" completed>
<ng-template matStepLabel>TERMS</ng-template>
<ng-template matStepLabel>{{'labels.inputs.TERMS' | translate}}</ng-template>
<mifosx-share-product-terms-step [shareProductsTemplate]="shareProductAndTemplate"></mifosx-share-product-terms-step>
@@ -48,7 +48,7 @@
<mat-step [stepControl]="shareProductSettingsForm" completed>
<ng-template matStepLabel>SETTINGS</ng-template>
<ng-template matStepLabel>{{'labels.inputs.SETTINGS' | translate}}</ng-template>
<mifosx-share-product-settings-step [shareProductsTemplate]="shareProductAndTemplate"></mifosx-share-product-settings-step>
@@ -56,7 +56,7 @@
<mat-step [stepControl]="shareProductMarketPriceForm" completed>
<ng-template matStepLabel>MARKET PRICE</ng-template>
<ng-template matStepLabel>{{'labels.inputs.MARKET PRICE' | translate}}</ng-template>
<mifosx-share-product-market-price-step [shareProductsTemplate]="shareProductAndTemplate"></mifosx-share-product-market-price-step>
@@ -64,7 +64,7 @@
<mat-step completed>
<ng-template matStepLabel>CHARGES</ng-template>
<ng-template matStepLabel>{{'labels.inputs.CHARGES' | translate}}</ng-template>
<mifosx-share-product-charges-step
[shareProductsTemplate]="shareProductAndTemplate"
@@ -76,7 +76,7 @@
<mat-step [stepControl]="shareProductAccountingForm" completed>
<ng-template matStepLabel>ACCOUNTING</ng-template>
<ng-template matStepLabel>{{'labels.inputs.ACCOUNTING' | translate}}</ng-template>
<mifosx-share-product-accounting-step
[shareProductsTemplate]="shareProductAndTemplate"
@@ -89,7 +89,7 @@
<mat-step state="preview" *ngIf="shareProductFormValidAndNotPristine" completed>
<ng-template matStepLabel>PREVIEW</ng-template>
<ng-template matStepLabel>{{'labels.inputs.PREVIEW' | translate}}</ng-template>
<mifosx-share-product-preview-step
[shareProductsTemplate]="shareProductAndTemplate"
@@ -14,6 +14,7 @@ import { ShareProductAccountingStepComponent } from '../share-product-stepper/sh
/** Custom Services */
import { ProductsService } from 'app/products/products.service';
import { SettingsService } from 'app/settings/settings.service';
import { Accounting } from 'app/core/utils/accounting';
@Component({
selector: 'mifosx-edit-share-product',
@@ -31,7 +32,7 @@ export class EditShareProductComponent implements OnInit {
@ViewChild(ShareProductAccountingStepComponent, { static: true }) shareProductAccountingStep: ShareProductAccountingStepComponent;
shareProductAndTemplate: any;
accountingRuleData = ['None', 'Cash'];
accountingRuleData: string[] = [];
/**
* @param {ActivatedRoute} route Activated Route.
@@ -43,10 +44,12 @@ export class EditShareProductComponent implements OnInit {
constructor(private route: ActivatedRoute,
private productsService: ProductsService,
private router: Router,
private settingsService: SettingsService) {
private settingsService: SettingsService,
private accounting: Accounting) {
this.route.data.subscribe((data: { shareProductAndTemplate: any }) => {
this.shareProductAndTemplate = data.shareProductAndTemplate;
});
this.accountingRuleData = this.accounting.getAccountingRulesForShares();
}
ngOnInit() {
@@ -4,7 +4,7 @@
<mat-radio-group fxFlex="98%" fxLayout="row" fxLayoutGap="5%" fxLayout.lt-md="column" formControlName="accountingRule">
<mat-radio-button *ngFor="let accountingRule of accountingRuleData; let i = index" [value]="i+1">
{{ accountingRule }}
{{ 'labels.accounting.' + accountingRule | translate }}
</mat-radio-button>
</mat-radio-group>
@@ -12,67 +12,39 @@
<div *ngIf="shareProductAccountingForm.value.accountingRule === 2" fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<h4 fxFlex="98%" class="mat-h4">Assets</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Assets' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Share reference</mat-label>
<mat-select formControlName="shareReferenceId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Share reference is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="shareProductAccountingForm.controls.shareReferenceId"
[glAccountList]="assetAccountData" [required]="true" [inputLabel]="'Share reference'">
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Liabilities</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Liabilities' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Share suspense control</mat-label>
<mat-select formControlName="shareSuspenseId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Share suspense control is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="shareProductAccountingForm.controls.shareSuspenseId"
[glAccountList]="liabilityAccountData" [required]="true" [inputLabel]="'Share suspense control'">
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Share Equity</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Share Equity' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Equity</mat-label>
<mat-select formControlName="shareEquityId" required>
<mat-option *ngFor="let equityAccount of equityAccountData" [value]="equityAccount.id">
({{ equityAccount.glCode }}) {{ equityAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Equity is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="shareProductAccountingForm.controls.shareEquityId"
[glAccountList]="equityAccountData" [required]="true" [inputLabel]="'Equity'">
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Income</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Income' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Income from fees</mat-label>
<mat-select formControlName="incomeFromFeeAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from fees is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="shareProductAccountingForm.controls.incomeFromFeeAccountId"
[glAccountList]="incomeAccountData" [required]="true" [inputLabel]="'Income from fees'">
</mifosx-gl-account-selector>
</div>
@@ -81,10 +53,10 @@
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
Previous
{{'labels.buttons.Previous' | translate}}
</button>
<button mat-raised-button matStepperNext [disabled]="!shareProductFormValid">
Next
{{'labels.buttons.Next' | translate}}
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
</button>
</div>
@@ -1,7 +1,7 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Charge</mat-label>
<mat-label>{{'labels.inputs.Charge' | translate}}</mat-label>
<mat-select #charge>
<mat-option *ngFor="let charge of chargeData | chargesFilter:chargesDataSource:currencyCode.value" [value]="charge">
{{ charge.name }}
@@ -12,42 +12,42 @@
<div fxFlex="48%" fxFlexAlign="center">
<button type="button" mat-raised-button color="primary" (click)="addCharge(charge)" [disabled]="!charge.value">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
Add
{{'labels.buttons.Add' | translate}}
</button>
</div>
<table fxFlex="98%" class="mat-elevation-z1" mat-table [dataSource]="chargesDataSource" [hidden]="chargesDataSource.length === 0">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Name </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Name' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.name + ', ' + charge.currency.displaySymbol }}
</td>
</ng-container>
<ng-container matColumnDef="chargeCalculationType">
<th mat-header-cell *matHeaderCellDef> Type </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Type' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeCalculationType.value }}
{{ charge.chargeCalculationType.value | translateCatalog }}
</td>
</ng-container>
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef> Amount </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Amount' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.amount }}
{{ charge.amount | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="chargeTimeType">
<th mat-header-cell *matHeaderCellDef> Collected On </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Collected On' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeTimeType.value }}
{{ charge.chargeTimeType.value | translateCatalog }}
</td>
</ng-container>
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef> Actions </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Actions' | translate}} </th>
<td mat-cell *matCellDef="let charge">
<button mat-icon-button color="warn" (click)="deleteCharge(charge)">
<fa-icon icon="trash"></fa-icon>
@@ -65,10 +65,10 @@
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
Previous
{{'labels.buttons.Previous' | translate}}
</button>
<button mat-raised-button matStepperNext>
Next
{{'labels.buttons.Next' | translate}}
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
</button>
</div>
@@ -3,30 +3,30 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Currency</mat-label>
<mat-label>{{'labels.inputs.Currency' | translate}}</mat-label>
<mat-select matTooltip="The currency to be used" formControlName="currencyCode" required>
<mat-option *ngFor="let currency of currencyData" [value]="currency.code">
{{ currency.name }}
</mat-option>
</mat-select>
<mat-error>
Currency is <strong>required</strong>
{{'labels.inputs.Currency' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Decimal Places</mat-label>
<mat-label>{{'labels.inputs.Decimal Places' | translate}}</mat-label>
<input type="number" matTooltip="The number of decimal places to be used to track and report on share accounts" matInput formControlName="digitsAfterDecimal" required>
<mat-error>
Decimal Places is <strong>required</strong>
{{'labels.inputs.Decimal Places' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Currency in multiples of</mat-label>
<mat-label>{{'labels.inputs.Currency in multiples of' | translate}}</mat-label>
<input type="number" matInput matTooltip="The amount to be rounded off (example: 100 rounds off to 200, 300, 400, etc)" formControlName="inMultiplesOf" required>
<mat-error>
Currency in multiples of is <strong>required</strong>
{{'labels.inputs.Currency in multiples of' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
@@ -35,10 +35,10 @@
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
Previous
{{'labels.buttons.Previous' | translate}}
</button>
<button mat-raised-button matStepperNext>
Next
{{'labels.buttons.Next' | translate}}
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
</button>
</div>
@@ -3,23 +3,23 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Product Name</mat-label>
<mat-label>{{'labels.inputs.Product Name' | translate}}</mat-label>
<input matInput formControlName="name" matTooltip="A unique identifier for the share product" required>
<mat-error>
Product Name is <strong>required</strong>
{{'labels.inputs.Product Name' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Short Name</mat-label>
<mat-label>{{'labels.inputs.Short Name' | translate}}</mat-label>
<input matInput formControlName="shortName" matTooltip="A unique identifier for the share product" maxlength="4" required>
<mat-error>
Short Name is <strong>required</strong>
{{'labels.inputs.Short Name' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="98%">
<mat-label>Description</mat-label>
<mat-label>{{'labels.inputs.Description' | translate}}</mat-label>
<textarea matInput formControlName="description" matTooltip="Provides additional information regarding the purpose and characteristics of the share product" required></textarea>
</mat-form-field>
@@ -28,10 +28,10 @@
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious disabled>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
Previous
{{'labels.buttons.Previous' | translate}}
</button>
<button mat-raised-button matStepperNext>
Next
{{'labels.buttons.Next' | translate}}
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
</button>
</div>
@@ -1,32 +1,32 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<h4 fxFlex="23%" class="mat-h4">Market Price Periods <i class="fas fa-question" matTooltip="Add future share value with date range"></i></h4>
<h4 fxFlex="23%" class="mat-h4">{{'labels.inputs.Market Price Period' | translate}} <i class="fas fa-question" matTooltip="Add future share value with date range"></i></h4>
<div fxFlex="73%">
<button type="button" mat-raised-button color="primary" (click)="addMarketPricePeriod()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
Add
{{'labels.buttons.Add' | translate}}
</button>
</div>
<table fxFlex="98%" class="mat-elevation-z1" mat-table [dataSource]="marketPricePeriods.value" *ngIf="marketPricePeriods.value.length">
<ng-container matColumnDef="fromDate">
<th mat-header-cell *matHeaderCellDef> From Date </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.From Date' | translate}} </th>
<td mat-cell *matCellDef="let marketPricePeriod">
{{ marketPricePeriod.fromDate | dateFormat }}
</td>
</ng-container>
<ng-container matColumnDef="shareValue">
<th mat-header-cell *matHeaderCellDef> Nominal/Unit Price </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Nominal/Unit Price' | translate}} </th>
<td mat-cell *matCellDef="let marketPricePeriod">
{{ marketPricePeriod.shareValue }}
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> Actions </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Actions' | translate}} </th>
<td mat-cell *matCellDef="let variation; let i = index">
<button mat-icon-button color="primary" (click)="editMarketPricePeriod(i)">
<fa-icon icon="edit"></fa-icon>
@@ -47,10 +47,10 @@
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
Previous
{{'labels.buttons.Previous' | translate}}
</button>
<button mat-raised-button matStepperNext>
Next
{{'labels.buttons.Next' | translate}}
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
</button>
</div>
@@ -14,6 +14,7 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
/** Custom Services */
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-share-product-market-price-step',
@@ -38,7 +39,8 @@ export class ShareProductMarketPriceStepComponent implements OnInit {
constructor(private formBuilder: UntypedFormBuilder,
public dialog: MatDialog,
private dateUtils: Dates,
private settingsService: SettingsService) {
private settingsService: SettingsService,
private translateService: TranslateService) {
this.createShareProductMarketPriceForm();
}
@@ -99,14 +101,14 @@ export class ShareProductMarketPriceStepComponent implements OnInit {
}
getData(values?: any) {
return { title: 'Market Price Period', formfields: this.getFormfields(values) };
return { title: this.translateService.instant('labels.inputs.Market Price Period'), formfields: this.getFormfields(values) };
}
getFormfields(values?: any) {
const formfields: FormfieldBase[] = [
new DatepickerBase({
controlName: 'fromDate',
label: 'From Date',
label: this.translateService.instant('labels.inputs.From Date'),
value: values ? values.fromDate : undefined,
maxDate: new Date(new Date().setFullYear(new Date().getFullYear() + 10)),
required: true,
@@ -114,7 +116,7 @@ export class ShareProductMarketPriceStepComponent implements OnInit {
}),
new InputBase({
controlName: 'shareValue',
label: 'Nominal/Unit Price',
label: this.translateService.instant('labels.inputs.Nominal/Unit Price'),
value: values ? values.shareValue : undefined,
type: 'number',
required: true,
@@ -4,106 +4,106 @@
<mat-divider fxFlexFill></mat-divider>
<h3 class="mat-h3" fxFlexFill>Details</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Details' | translate}}</h3>
<mat-divider fxFlexFill></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Short Name:</span>
<span fxFlex="40%">{{'labels.inputs.Short Name' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.shortName }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.description">
<span fxFlex="40%">Description:</span>
<span fxFlex="40%">{{'labels.inputs.Description' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.description }}</span>
</div>
<h3 class="mat-h3" fxFlexFill>Currency</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Currency' | translate}}</h3>
<mat-divider fxFlexFill></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Currency:</span>
<span fxFlex="40%">{{'labels.inputs.Currency' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.currencyCode | find:shareProductsTemplate.currencyOptions:'code':'name' }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Decimal Places:</span>
<span fxFlex="40%">{{'labels.inputs.Decimal Places' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.digitsAfterDecimal }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Currency in multiples of:</span>
<span fxFlex="40%">{{'labels.inputs.Currency in multiples of' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.inMultiplesOf }}</span>
</div>
<h3 class="mat-h3" fxFlexFill>Terms</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Terms' | translate}}</h3>
<mat-divider fxFlexFill></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Total Number of Shares:</span>
<span fxFlex="60%">{{ shareProduct.totalShares }}</span>
<span fxFlex="40%">{{'labels.inputs.Total Number of Shares' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.totalShares | formatNumber }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Shares to be Issued:</span>
<span fxFlex="60%">{{ shareProduct.sharesIssued }}</span>
<span fxFlex="40%">{{'labels.inputs.Shares to be Issued' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.sharesIssued | formatNumber }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Nominal/Unit Price:</span>
<span fxFlex="60%">{{ shareProduct.unitPrice }}</span>
<span fxFlex="40%">{{'labels.inputs.Nominal/Unit Price' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.unitPrice | formatNumber }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Capital Value:</span>
<span fxFlex="60%">{{ shareProduct.shareCapital }}</span>
<span fxFlex="40%">{{'labels.inputs.Capital Value' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.shareCapital | formatNumber }}</span>
</div>
<h3 class="mat-h3" fxFlexFill>Settings</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Settings' | translate}}</h3>
<mat-divider fxFlexFill></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Shares per Client:</span>
<span fxFlex="40%">{{'labels.inputs.Shares per Client' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.nominalShares + ' (Min: ' + (shareProduct.minimumShares ? shareProduct.minimumShares : shareProduct.nominalShares) + ', Max: ' + (shareProduct.maximumShares ? shareProduct.maximumShares : shareProduct.nominalShares) + ')' }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.minimumActivePeriodForDividends">
<span fxFlex="40%">Minimum Active Period:</span>
<span fxFlex="40%">{{'labels.inputs.Minimum Active Period' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.minimumActivePeriodForDividends + ' ' + (shareProduct.minimumactiveperiodFrequencyType | find:shareProductsTemplate.minimumActivePeriodFrequencyTypeOptions:'id':'value') }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.lockinPeriodFrequency">
<span fxFlex="40%">Lock-in Period:</span>
<span fxFlex="40%">{{'labels.inputs.Lock-in Period' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.lockinPeriodFrequency + ' ' + (shareProduct.lockinPeriodFrequencyType | find:shareProductsTemplate.lockinPeriodFrequencyTypeOptions:'id':'value') }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Allow dividends for inactive clients:</span>
<span fxFlex="40%">{{'labels.inputs.Allow dividends for inactive clients' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.allowDividendCalculationForInactiveClients | yesNo }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.marketPricePeriods.length" fxLayout="row wrap" fxLayout.lt-md="column">
<h3 class="mat-h3" fxFlexFill>Market Price Periods</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.inputs.Market Price Period' | translate}}</h3>
<mat-divider fxFlexFill></mat-divider>
<table fxFlexFill class="mat-elevation-z1" mat-table [dataSource]="shareProduct.marketPricePeriods">
<ng-container matColumnDef="fromDate">
<th mat-header-cell *matHeaderCellDef> From Date </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.From Date' | translate}} </th>
<td mat-cell *matCellDef="let marketPricePeriod">
{{ marketPricePeriod.fromDate | dateFormat }}
</td>
</ng-container>
<ng-container matColumnDef="shareValue">
<th mat-header-cell *matHeaderCellDef> Nominal/Unit Price </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Nominal/Unit Price' | translate}} </th>
<td mat-cell *matCellDef="let marketPricePeriod">
{{ marketPricePeriod.shareValue }}
{{ marketPricePeriod.shareValue | formatNumber }}
</td>
</ng-container>
@@ -116,37 +116,37 @@
<div fxFlexFill *ngIf="shareProduct.chargesSelected.length" fxLayout="row wrap" fxLayout.lt-md="column">
<h3 class="mat-h3" fxFlexFill>Charges</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Charges' | translate}}</h3>
<mat-divider fxFlexFill></mat-divider>
<table fxFlexFill class="mat-elevation-z1" mat-table [dataSource]="shareProduct.chargesSelected">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Name </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Name' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.name + ', ' + charge.currency.displaySymbol }}
</td>
</ng-container>
<ng-container matColumnDef="chargeCalculationType">
<th mat-header-cell *matHeaderCellDef> Type </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Type' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeCalculationType.value }}
{{ charge.chargeCalculationType.value | translateCatalog }}
</td>
</ng-container>
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef> Amount </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Amount' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.amount }}
{{ charge.amount | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="chargeTimeType">
<th mat-header-cell *matHeaderCellDef> Collected On </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Collected On' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeTimeType.value }}
{{ charge.chargeTimeType.value | translateCatalog }}
</td>
</ng-container>
@@ -157,42 +157,42 @@
</div>
<h3 class="mat-h3" fxFlexFill>Accounting</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Accounting' | translate}}</h3>
<mat-divider fxFlexFill></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Type:</span>
<span fxFlex="40%">{{'labels.inputs.Type' | translate}}:</span>
<span fxFlex="60%">{{ accountingRuleData[shareProduct.accountingRule-1] }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.accountingRule === 2" fxLayout="row wrap" fxLayout.lt-md="column">
<h4 fxFlexFill class="mat-h4">Assets</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Assets' | translate}}</h4>
<div fxFlexFill>
<span fxFlex="40%">Share reference:</span>
<span fxFlex="40%">{{'labels.inputs.Share reference' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.shareReferenceId | find:shareProductsTemplate.accountingMappingOptions.assetAccountOptions:'id':'name' }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Liabilities</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Liabilities' | translate}}</h4>
<div fxFlexFill>
<span fxFlex="40%">Share suspense control:</span>
<span fxFlex="40%">{{'labels.inputs.Share suspense control' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.shareSuspenseId | find:shareProductsTemplate.accountingMappingOptions.liabilityAccountOptions:'id':'name' }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Share Equity</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Share Equity' | translate}}</h4>
<div fxFlexFill>
<span fxFlex="40%">Equity:</span>
<span fxFlex="40%">{{'labels.inputs.Equity' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.shareEquityId | find:shareProductsTemplate.accountingMappingOptions.equityAccountOptions:'id':'name' }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Income</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Income' | translate}}</h4>
<div fxFlexFill>
<span fxFlex="40%">Income from fees:</span>
<span fxFlex="40%">{{'labels.inputs.Income from fees' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.incomeFromFeeAccountId | find:shareProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }}</span>
</div>
@@ -203,12 +203,12 @@
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
Previous
{{'labels.buttons.Previous' | translate}}
</button>
<button mat-raised-button [routerLink]="['../']">
Cancel
{{'labels.buttons.Cancel' | translate}}
</button>
<button mat-raised-button color="primary" (click)="submit.emit()" *mifosxHasPermission="taskPermission">
Submit
{{'labels.buttons.Submit' | translate}}
</button>
</div>
@@ -2,60 +2,60 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<h4 fxFlex="98%" class="mat-h4">Shares per Client <i class="fas fa-question" matTooltip="These fields are used to define the minimum, default, maximum shares per customer"></i></h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.inputs.Shares per Client' | translate}} <i class="fas fa-question" matTooltip="These fields are used to define the minimum, default, maximum shares per customer"></i></h4>
<mat-form-field fxFlex="31%">
<mat-label>Minimum</mat-label>
<mat-label>{{'labels.inputs.Minimum' | translate}}</mat-label>
<input type="number" matInput formControlName="minimumShares">
</mat-form-field>
<mat-form-field fxFlex="31%">
<mat-label>Default</mat-label>
<mat-label>{{'labels.inputs.Default' | translate}}</mat-label>
<input type="number" matInput formControlName="nominalShares" required>
<mat-error>
Default Shares per Client is <strong>required</strong>
{{'labels.inputs.Default Shares per Client' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="31%">
<mat-label>Maximum</mat-label>
<mat-label>{{'labels.inputs.Maximum' | translate}}</mat-label>
<input type="number" matInput formControlName="maximumShares">
</mat-form-field>
<h4 fxFlex="98%" class="mat-h4">Minimum Active Period <i class="fas fa-question" matTooltip="Minimum active period to consider for dividend calculations"></i></h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.inputs.Minimum Active Period' | translate}} <i class="fas fa-question" matTooltip="Minimum active period to consider for dividend calculations"></i></h4>
<mat-form-field fxFlex="48%">
<mat-label>Frequency</mat-label>
<mat-label>{{'labels.inputs.Frequency' | translate}}</mat-label>
<input type="number" matInput formControlName="minimumActivePeriodForDividends">
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Type</mat-label>
<mat-label>{{'labels.inputs.Type' | translate}}</mat-label>
<mat-select formControlName="minimumactiveperiodFrequencyType">
<mat-option *ngFor="let minimumActivePeriodFrequencyType of minimumActivePeriodFrequencyTypeData" [value]="minimumActivePeriodFrequencyType.id">
{{ minimumActivePeriodFrequencyType.value }}
{{ minimumActivePeriodFrequencyType.value | translateCatalog }}
</mat-option>
</mat-select>
</mat-form-field>
<h4 fxFlex="98%" class="mat-h4">Lock-in Period <i class="fas fa-question" matTooltip="Used to indicate the length of time that a share account of this share product type is locked-in and redeems are not allowed"></i></h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.inputs.Lock-in Period' | translate}} <i class="fas fa-question" matTooltip="Used to indicate the length of time that a share account of this share product type is locked-in and redeems are not allowed"></i></h4>
<mat-form-field fxFlex="48%">
<mat-label>Frequency</mat-label>
<mat-label>{{'labels.inputs.Frequency' | translate}}</mat-label>
<input type="number" matInput formControlName="lockinPeriodFrequency">
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Type</mat-label>
<mat-label>{{'labels.inputs.Type' | translate}}</mat-label>
<mat-select formControlName="lockinPeriodFrequencyType">
<mat-option *ngFor="let lockinPeriodFrequencyType of lockinPeriodFrequencyTypeData" [value]="lockinPeriodFrequencyType.id">
{{ lockinPeriodFrequencyType.value }}
{{ lockinPeriodFrequencyType.value | translateCatalog }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox fxFlex="98%" class="margin-v" labelPosition="before" matTooltip="Indicates whether the dividends can be processed even share account of this share product is inactive" formControlName="allowDividendCalculationForInactiveClients">
Allow dividends for inactive clients
{{'labels.inputs.Allow dividends for inactive clients' | translate}}
</mat-checkbox>
</div>
@@ -63,10 +63,10 @@
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
Previous
{{'labels.buttons.Previous' | translate}}
</button>
<button mat-raised-button matStepperNext>
Next
{{'labels.buttons.Next' | translate}}
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
</button>
</div>
@@ -3,34 +3,34 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Total Number of Shares</mat-label>
<mat-label>{{'labels.inputs.Total Number of Shares' | translate}}</mat-label>
<input type="number" matInput matTooltip="Total number of shares that a product is offering" formControlName="totalShares" required>
<mat-error>
Total Number of Shares is <strong>required</strong>
{{'labels.inputs.Total Number of Shares' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Shares to be Issued</mat-label>
<mat-label>{{'labels.inputs.Shares to be Issued' | translate}}</mat-label>
<input type="number" matInput matTooltip="Total number of shares that an orgranization wants to issue to it's clients" formControlName="sharesIssued" required>
<mat-error>
Shares to be Issued is <strong>required</strong>
{{'labels.inputs.Shares to be Issued' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Nominal/Unit Price</mat-label>
<mat-label>{{'labels.inputs.Nominal/Unit Price' | translate}}</mat-label>
<input type="number" matInput matTooltip="Unit/Nominal Price of each share" formControlName="unitPrice" required>
<mat-error>
Nominal Price is <strong>required</strong>
{{'labels.inputs.Nominal Price' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Capital Value</mat-label>
<mat-label>{{'labels.inputs.Capital Value' | translate}}</mat-label>
<input type="number" matInput matTooltip="Total Capital Value" formControlName="shareCapital" readonly>
<mat-hint>
Shares to be Issued * Nominal Price (Auto calculated)
{{'labels.inputs.Shares to be Issued * Nominal Price (Auto calculated)' | translate}}
</mat-hint>
</mat-form-field>
@@ -39,10 +39,10 @@
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
Previous
{{'labels.buttons.Previous' | translate}}
</button>
<button mat-raised-button matStepperNext>
Next
{{'labels.buttons.Next' | translate}}
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
</button>
</div>
@@ -2,7 +2,7 @@
<div #buttonCreateShareProduct class="in-block">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_SHAREPRODUCT'">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
Create Share Product
{{ 'labels.buttons.Create Share Product' | translate }}
</button>
</div>
</div>
@@ -21,17 +21,17 @@
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Name' | translate }} </th>
<td mat-cell *matCellDef="let shareProduct"> {{ shareProduct.name }} </td>
</ng-container>
<ng-container matColumnDef="shortName">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Short Name </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Short Name' | translate }} </th>
<td mat-cell *matCellDef="let shareProduct"> {{ shareProduct.shortName }} </td>
</ng-container>
<ng-container matColumnDef="totalShares">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Total Shares </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Total Shares' | translate }} </th>
<td mat-cell *matCellDef="let shareProduct"> {{ shareProduct.totalShares }} </td>
</ng-container>
@@ -47,29 +47,29 @@
</div>
<ng-template #templateButtonCreateShareProduct let-popover="popover">
<h2>Create share product</h2>
<h2>{{ 'labels.buttons.Create Share Product' | translate }}</h2>
<p class="mw300">This option allows you to create new share product.</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">Next</button>
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{ 'labels.buttons.Close' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">{{ 'labels.buttons.Back' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">{{ 'labels.buttons.Next' | translate }}</button>
</div>
</ng-template>
<ng-template #templateFilter let-popover="popover">
<h4>Search bar to filter share products.</h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateButtonCreateShareProduct,buttonCreateShareProduct , 'bottom', true)">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateShareProductsTable,shareProductsTable, 'top', true)">Next</button>
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{ 'labels.buttons.Close' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateButtonCreateShareProduct,buttonCreateShareProduct , 'bottom', true)">{{ 'labels.buttons.Back' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateShareProductsTable,shareProductsTable, 'top', true)">{{ 'labels.buttons.Next' | translate }}</button>
</div>
</ng-template>
<ng-template #templateShareProductsTable let-popover="popover">
<h4 class="mw300">List of share products in the organization. For more details click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/129531946/Share+products" target="_blank">Share Products</a></h4>
<h4 class="mw300">List of share products in the organization. For more details click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/129531946/Share+products" target="_blank">{{ 'labels.buttons.Share Products' | translate }}</a></h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">Next</button>
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{ 'labels.buttons.Close' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">{{ 'labels.buttons.Back' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">{{ 'labels.buttons.Next' | translate }}</button>
</div>
</ng-template>
@@ -1,11 +1,11 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" [routerLink]="['../edit']" *mifosxHasPermission="'UPDATE_SHAREPRODUCT'">
<fa-icon icon="edit" class="m-r-10"></fa-icon>
Edit
{{'labels.buttons.Edit' | translate}}
</button>
<button mat-raised-button color="primary" [routerLink]="['../dividends']" *mifosxHasPermission="'UPDATE_SHAREPRODUCT'">
<fa-icon icon="hand-holding-usd" class="m-r-10"></fa-icon>
Dividends
{{'labels.buttons.Dividends' | translate}}
</button>
</div>
@@ -21,106 +21,106 @@
<mat-divider [inset]="true"></mat-divider>
<h3 class="mat-h3" fxFlexFill>Details</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.inputs.Details' | translate}}</h3>
<mat-divider [inset]="true"></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Short Name:</span>
<span fxFlex="40%">{{'labels.inputs.Short Name' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.shortName }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.description">
<span fxFlex="40%">Description:</span>
<span fxFlex="40%">{{'labels.inputs.Description' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.description }}</span>
</div>
<h3 class="mat-h3" fxFlexFill>Currency</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Currency' | translate}}</h3>
<mat-divider [inset]="true"></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Currency:</span>
<span fxFlex="40%">{{'labels.inputs.Currency' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.currency.name }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Decimal Places:</span>
<span fxFlex="40%">{{'labels.inputs.Decimal Places' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.currency.decimalPlaces }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Currency in multiples of:</span>
<span fxFlex="40%">{{'labels.inputs.Currency in multiples of' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.currency.inMultiplesOf }}</span>
</div>
<h3 class="mat-h3" fxFlexFill>Terms</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Terms' | translate}}</h3>
<mat-divider [inset]="true"></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Total Number of Shares:</span>
<span fxFlex="60%">{{ shareProduct.totalShares }}</span>
<span fxFlex="40%">{{'labels.inputs.Total Number of Shares' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.totalShares | formatNumber }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Shares to be Issued:</span>
<span fxFlex="60%">{{ shareProduct.totalSharesIssued }}</span>
<span fxFlex="40%">{{'labels.inputs.Shares to be Issued' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.totalSharesIssued | formatNumber }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Nominal/Unit Price:</span>
<span fxFlex="60%">{{ shareProduct.unitPrice }}</span>
<span fxFlex="40%">{{'labels.inputs.Nominal/Unit Price' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.unitPrice | formatNumber }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Capital Value:</span>
<span fxFlex="60%">{{ shareProduct.shareCapital }}</span>
<span fxFlex="40%">{{'labels.inputs.Capital Value' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.shareCapital | formatNumber }}</span>
</div>
<h3 class="mat-h3" fxFlexFill>Settings</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Settings' | translate}}</h3>
<mat-divider [inset]="true"></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Shares per Client:</span>
<span fxFlex="40%">{{'labels.inputs.Shares per Client' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.nominalShares + ' (Min: ' + (shareProduct.minimumShares ? shareProduct.minimumShares : shareProduct.nominalShares) + ', Max: ' + (shareProduct.maximumShares ? shareProduct.maximumShares : shareProduct.nominalShares) + ')' }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.minimumActivePeriod">
<span fxFlex="40%">Minimum Active Period:</span>
<span fxFlex="60%">{{ shareProduct.minimumActivePeriod + ' ' + shareProduct.minimumActivePeriodForDividendsTypeEnum.value }}</span>
<span fxFlex="40%">{{'labels.inputs.Minimum Active Period' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.minimumActivePeriod }} {{ shareProduct.minimumActivePeriodForDividendsTypeEnum.value | translateCatalog }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.lockinPeriod">
<span fxFlex="40%">Lock-in Period:</span>
<span fxFlex="60%">{{ shareProduct.lockinPeriod + ' ' + shareProduct.lockPeriodTypeEnum.value }}</span>
<span fxFlex="40%">{{'labels.inputs.Lock-in Period' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.lockinPeriod }} {{ shareProduct.lockPeriodTypeEnum.value | translateCatalog}}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">Allow dividends for inactive clients:</span>
<span fxFlex="40%">{{'labels.inputs.Allow dividends for inactive clients' | translate}}:</span>
<span fxFlex="60%">{{ shareProduct.allowDividendCalculationForInactiveClients | yesNo }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.marketPrice?.length" fxLayout="row wrap" fxLayout.lt-md="column">
<h3 class="mat-h3" fxFlexFill>Market Price Periods</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.inputs.Market Price Period' | translate}}</h3>
<mat-divider [inset]="true"></mat-divider>
<table fxFlexFill class="mat-elevation-z1" mat-table [dataSource]="shareProduct.marketPrice">
<ng-container matColumnDef="fromDate">
<th mat-header-cell *matHeaderCellDef> From Date </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.From Date' | translate}} </th>
<td mat-cell *matCellDef="let marketPrice">
{{ marketPrice.fromDate | dateFormat }}
</td>
</ng-container>
<ng-container matColumnDef="shareValue">
<th mat-header-cell *matHeaderCellDef> Nominal/Unit Price </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Nominal/Unit Price' | translate}} </th>
<td mat-cell *matCellDef="let marketPrice">
{{ marketPrice.shareValue }}
{{ marketPrice.shareValue | formatNumber }}
</td>
</ng-container>
@@ -133,37 +133,37 @@
<div fxFlexFill *ngIf="shareProduct.charges.length" fxLayout="row wrap" fxLayout.lt-md="column">
<h3 class="mat-h3" fxFlexFill>Charges</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Charges' | translate}}</h3>
<mat-divider [inset]="true"></mat-divider>
<table fxFlexFill class="mat-elevation-z1" mat-table [dataSource]="shareProduct.charges">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Name </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Name' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.name + ', ' + charge.currency.displaySymbol }}
</td>
</ng-container>
<ng-container matColumnDef="chargeCalculationType">
<th mat-header-cell *matHeaderCellDef> Type </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Type' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeCalculationType.value }}
{{ charge.chargeCalculationType.value | translateCatalog }}
</td>
</ng-container>
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef> Amount </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Amount' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.amount | numberFormat }}
</td>
</ng-container>
<ng-container matColumnDef="chargeTimeType">
<th mat-header-cell *matHeaderCellDef> Collected On </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Collected On' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeTimeType.value }}
{{ charge.chargeTimeType.value | translateCatalog }}
</td>
</ng-container>
@@ -174,43 +174,47 @@
</div>
<h3 class="mat-h3" fxFlexFill>Accounting</h3>
<h3 class="mat-h3" fxFlexFill>{{'labels.heading.Accounting' | translate}}</h3>
<mat-divider [inset]="true"></mat-divider>
<div fxFlexFill>
<span fxFlex="40%">Type:</span>
<span fxFlex="60%">{{ shareProduct.accountingRule.value }}</span>
<span fxFlex="40%">{{'labels.inputs.Type' | translate}}:</span>
<span fxFlex="60%">{{ 'labels.accounting.' + getAccountingRuleName(shareProduct.accountingRule.value) | translate }}</span>
</div>
<div fxFlexFill *ngIf="shareProduct.accountingRule.id === 2" fxLayout="row wrap" fxLayout.lt-md="column">
<h4 fxFlexFill class="mat-h4">Assets</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Assets' | translate}}</h4>
<div fxFlexFill>
<span fxFlex="40%">Share reference:</span>
<span fxFlex="60%">({{ shareProduct.accountingMappings.shareReferenceId.glCode }}) {{ shareProduct.accountingMappings.shareReferenceId.name }}</span>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Share reference'"
[glAccount]="shareProduct.accountingMappings.shareReferenceId" [withTitle]="'40%'">
</mifosx-gl-account-display>
</div>
<h4 fxFlexFill class="mat-h4">Liabilities</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Liabilities' | translate}}</h4>
<div fxFlexFill>
<span fxFlex="40%">Share suspense control:</span>
<span fxFlex="60%">({{ shareProduct.accountingMappings.shareSuspenseId.glCode }}) {{ shareProduct.accountingMappings.shareSuspenseId.name }}</span>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Share suspense control'"
[glAccount]="shareProduct.accountingMappings.shareSuspenseId" [withTitle]="'40%'">
</mifosx-gl-account-display>
</div>
<h4 fxFlexFill class="mat-h4">Share Equity</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Share Equity' | translate}}</h4>
<div fxFlexFill>
<span fxFlex="40%">Equity:</span>
<span fxFlex="60%">({{ shareProduct.accountingMappings.shareEquityId.glCode }}) {{ shareProduct.accountingMappings.shareEquityId.name }}</span>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Equity'"
[glAccount]="shareProduct.accountingMappings.shareEquityId" [withTitle]="'40%'">
</mifosx-gl-account-display>
</div>
<h4 fxFlexFill class="mat-h4">Income</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Income' | translate}}</h4>
<div fxFlexFill>
<span fxFlex="40%">Income from fees:</span>
<span fxFlex="60%">({{ shareProduct.accountingMappings.incomeFromFeeAccountId.glCode }}) {{ shareProduct.accountingMappings.incomeFromFeeAccountId.name }}</span>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Income from fees'"
[glAccount]="shareProduct.accountingMappings.incomeFromFeeAccountId" [withTitle]="'40%'">
</mifosx-gl-account-display>
</div>
</div>
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Accounting } from 'app/core/utils/accounting';
@Component({
selector: 'mifosx-share-product-general-tab',
@@ -13,7 +14,8 @@ export class ShareProductGeneralTabComponent implements OnInit {
marketPriceDisplayedColumns: string[] = ['fromDate', 'shareValue'];
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType'];
constructor(private route: ActivatedRoute) {
constructor(private route: ActivatedRoute,
private accounting: Accounting) {
this.route.data.subscribe((data: { shareProduct: any }) => {
this.shareProduct = data.shareProduct;
});
@@ -22,4 +24,8 @@ export class ShareProductGeneralTabComponent implements OnInit {
ngOnInit(): void {
}
getAccountingRuleName(value: string): string {
return this.accounting.getAccountRuleName(value.toUpperCase());
}
}
@@ -5,7 +5,7 @@
<nav mat-tab-nav-bar class="navigation-tabs">
<a mat-tab-link [routerLink]="['./general']" routerLinkActive #general="routerLinkActive"
[active]="general.isActive">
General
{{'labels.inputs.General' | translate}}
</a>
<ng-container *ngFor="let shareProductDatatable of shareProductDatatables">
<a mat-tab-link [routerLink]="['./datatables',shareProductDatatable.registeredTableName]" routerLinkActive
@@ -6,13 +6,14 @@
</div>
<div class="action-button m-b-20" *ngIf="this.chargesData">
<button mat-raised-button color="primary" (click)="toggleCharges()">
{{showInactiveCharges ? viewAllChargeButtons('View Active Charges') : viewAllChargeButtons('View Inactive Charges')}}</button>
{{showInactiveCharges ? viewAllChargeButtons('View Active Charges') : viewAllChargeButtons('View Inactive
Charges')}}</button>
</div>
</div>
<div class="mat-elevation-z1 m-b-25">
<table mat-table #chargesTable [dataSource]="dataSource" >
<table mat-table #chargesTable [dataSource]="dataSource">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Name' | translate}} </th>
@@ -46,22 +47,26 @@
<ng-container matColumnDef="due">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Due' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.amount | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.amount | currency:charge.currency.code:'symbol-narrow':'1.2-2'}}
</td>
</ng-container>
<ng-container matColumnDef="paid">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Paid' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.amountPaid | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.amountPaid |
currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
</ng-container>
<ng-container matColumnDef="waived">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Waived' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.amountWaived | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.amountWaived |
currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
</ng-container>
<ng-container matColumnDef="outstanding">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Outstanding' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.amountOutstanding | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.amountOutstanding |
currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
</ng-container>
<ng-container matColumnDef="actions">
@@ -88,7 +93,8 @@
</button>
<ng-container *ngIf="isRecurringCharge(charge)">
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Inactivate Charge"
*mifosxHasPermission="'INACTIVATE_SAVINGSACCOUNTCHARGE'" (click)="routeEdit($event); inactivateCharge(charge.id)">
*mifosxHasPermission="'INACTIVATE_SAVINGSACCOUNTCHARGE'"
(click)="routeEdit($event); inactivateCharge(charge.id)">
<i class="fa fa-ban"></i>
</button>
</ng-container>
@@ -103,4 +109,4 @@
</div>
</div>
</div>
@@ -1,5 +1,8 @@
<span (mouseenter)="mouseEnter()" (mouseleave)="mouseLeave()">
<span class="m-l-5" *ngIf="displayL && iconVisible" (click)="copyValue()"><b><fa-icon icon="copy" size="sm" title="{{'labels.text.Copy Account Number' | translate }}"></fa-icon></b></span>
<span class="m-l-5">{{ accountNo }}</span>
<span class="m-l-5" *ngIf="accountType">
<a href="{{getAccountLink()}}">{{ accountNo }}</a>
</span>
<span class="m-l-5" *ngIf="!accountType">{{ accountNo }}</span>
<span class="m-l-3" *ngIf="displayR && iconVisible" (click)="copyValue()"><b><fa-icon icon="copy" size="sm" title="{{'labels.text.Copy Account Number' | translate }}"></fa-icon></b></span>
</span>
@@ -9,6 +9,9 @@ import { Clipboard } from '@angular/cdk/clipboard';
export class AccountNumberComponent implements OnInit {
@Input() accountNo: string;
@Input() display = 'right';
@Input() clientId: number | null = null;
@Input() accountId: number | null = null;
@Input() accountType: string | null = null;
iconVisible = false;
displayL = false;
@@ -32,4 +35,19 @@ export class AccountNumberComponent implements OnInit {
mouseLeave() {
this.iconVisible = false;
}
getAccountLink(): string {
if (this.accountType) {
return `/#/clients/${this.clientId}/${this.getAccountType()}/${this.accountId}`;
}
return '';
}
private getAccountType(): string {
if (this.accountType === '1') {
return 'loan-accounts';
} else if (this.accountType === '2') {
return 'savings-accounts';
}
}
}
@@ -0,0 +1,12 @@
<mat-form-field fxFlex fxFlex="28%">
<mat-label>{{getLabelText()}}</mat-label>
<mat-select placeholder="{{getPlaceHolderText()}}" formControlName="controlSelect">
<mat-option *ngFor="let option of selectOptions" [value]="option.id">
{{ option.value | translateCatalog }}
</mat-option>
</mat-select>
<button mat-button *ngIf="controlSelect" matSuffix mat-icon-button
aria-label="Clear" (click)="clearProperty($event)">
<mat-icon>close</mat-icon>
</button>
</mat-form-field>
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DropdownComponent } from './dropdown.component';
describe('DropdownComponent', () => {
let component: DropdownComponent;
let fixture: ComponentFixture<DropdownComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DropdownComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(DropdownComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,35 @@
import { Component, Input, OnInit } from '@angular/core';
import { UntypedFormControl } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-dropdown',
templateUrl: './dropdown.component.html',
styleUrls: ['./dropdown.component.scss']
})
export class DropdownComponent implements OnInit {
@Input() placeHolderText: string;
@Input() labelText: string;
@Input() selectOptions: any[] = [];
@Input() controlSelect: UntypedFormControl;
@Input() required: boolean;
constructor(private translateService: TranslateService) { }
ngOnInit(): void {
}
getPlaceHolderText(): string {
return this.placeHolderText ? this.translateService.instant('labels.inputs.' + this.placeHolderText) : '';
}
getLabelText(): string {
return this.labelText ? this.translateService.instant('labels.inputs.' + this.labelText) : '';
}
clearProperty() {
this.controlSelect.patchValue('');
}
}
+3 -1
View File
@@ -48,6 +48,7 @@ import { GlAccountDisplayComponent } from './accounting/gl-account-display/gl-ac
import { ViewSavingsAccountingDetailsComponent } from './accounting/view-savings-accounting-details/view-savings-accounting-details.component';
import { ThemeToggleComponent } from './theme-toggle/theme-toggle.component';
import { LongTextComponent } from './long-text/long-text.component';
import { DropdownComponent } from './dropdown/dropdown.component';
/**
* Shared Module
@@ -102,7 +103,8 @@ import { LongTextComponent } from './long-text/long-text.component';
GlAccountDisplayComponent,
ViewSavingsAccountingDetailsComponent,
ThemeToggleComponent,
LongTextComponent
LongTextComponent,
DropdownComponent
],
exports: [
FileUploadComponent,
@@ -25,7 +25,7 @@ export class SharesAccountViewResolver implements Resolve<Object> {
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const shareAccountId = route.paramMap.get('shareAccountId');
const shareAccountId = route.paramMap.get('shareAccountId') || route.parent.paramMap.get('shareAccountId');
return this.sharesService.getSharesAccountData(shareAccountId, false);
}
@@ -105,7 +105,7 @@ export class CreateSharesAccountComponent {
const sharesAccount = {
...this.sharesAccount,
clientId: this.sharesAccountTemplate.clientId,
charges: this.sharesAccount.charges.map((charge: any) => ({ chargeId: charge.chargeId, amount: charge.amount })),
charges: this.sharesAccount.charges.map((charge: any) => ({ chargeId: charge.id, amount: charge.amount })),
applicationDate: this.dateUtils.formatDate(this.sharesAccount.applicationDate, dateFormat),
submittedDate: this.dateUtils.formatDate(this.sharesAccount.submittedDate, dateFormat),
unitPrice: this.sharesAccountTermsForm.get('unitPrice').value,
@@ -110,7 +110,7 @@ export class EditSharesAccountComponent {
const sharesAccount = {
...this.sharesAccount,
clientId: this.sharesAccountAndTemplate.clientId,
charges: this.sharesAccount.charges.map((charge: any) => ({ chargeId: charge.chargeId, amount: charge.amount })),
charges: this.sharesAccount.charges.map((charge: any) => ({ chargeId: charge.id, amount: charge.amount })),
applicationDate: this.dateUtils.formatDate(this.sharesAccount.applicationDate, dateFormat),
submittedDate: this.dateUtils.formatDate(this.sharesAccount.submittedDate, dateFormat),
unitPrice: this.sharesAccountTermsForm.get('unitPrice').value,
@@ -20,7 +20,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button [disabled]="!activateSharesAccountForm.valid">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!activateSharesAccountForm.valid">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</form>
@@ -27,7 +27,7 @@
</mat-form-field>
<mat-form-field>
<mat-label>{{'labels.inputs.Today's Price' | translate}}</mat-label>
<mat-label>{{'labels.inputs.Current Price' | translate}}</mat-label>
<input matInput required formControlName="unitPrice">
</mat-form-field>
@@ -37,7 +37,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button [disabled]="!applySharesForm.valid">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!applySharesForm.valid">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</form>
@@ -29,7 +29,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button [disabled]="!approveSharesAccountForm.valid">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!approveSharesAccountForm.valid">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</form>
@@ -4,5 +4,5 @@
</div>
<mat-dialog-actions align="end">
<button mat-raised-button mat-dialog-close>{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button [mat-dialog-close]="{ approve: true }">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="primary" [mat-dialog-close]="{ approve: true }">{{'labels.buttons.Submit' | translate}}</button>
</mat-dialog-actions>
@@ -29,7 +29,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="warn" [disabled]="!closeSharesAccountForm.valid">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="warn" [disabled]="!closeSharesAccountForm.valid">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</form>
@@ -27,7 +27,7 @@
</mat-form-field>
<mat-form-field>
<mat-label>{{"labels.inputs.Today's Price" | translate}}</mat-label>
<mat-label>{{"labels.inputs.Current Price" | translate}}</mat-label>
<input matInput required formControlName="unitPrice">
</mat-form-field>
</div>
@@ -35,7 +35,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="warn" [disabled]="!redeemSharesForm.valid">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="warn" [disabled]="!redeemSharesForm.valid">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</form>
@@ -29,7 +29,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="warn" [disabled]="!rejectSharesAccountForm.valid">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="warn" [disabled]="!rejectSharesAccountForm.valid">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</form>
@@ -4,5 +4,5 @@
</div>
<mat-dialog-actions align="end">
<button mat-raised-button mat-dialog-close>{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="warn" [mat-dialog-close]="{ reject: true }">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="warn" [mat-dialog-close]="{ reject: true }">{{'labels.buttons.Submit' | translate}}</button>
</mat-dialog-actions>
@@ -18,7 +18,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="warn">{{'labels.buttons.Confirm' | translate}}</button>
<button mat-raised-button color="warn">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</form>
@@ -28,7 +28,7 @@
<ng-container matColumnDef="chargeCalculationType">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Type' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeCalculationType.value }}
{{ charge.chargeCalculationType.value | translateCatalog }}
</td>
</ng-container>
@@ -45,7 +45,7 @@
<ng-container matColumnDef="chargeTimeType">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Collected On' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeTimeType.value }}
{{ charge.chargeTimeType.value | translateCatalog }}
</td>
</ng-container>
@@ -10,6 +10,7 @@ import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.componen
/** Custom Models */
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
import { TranslateService } from '@ngx-translate/core';
/**
* Shares Account Charges Step
@@ -42,7 +43,8 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
/**
* @param {MatDialog} dialog Mat Dialog
*/
constructor(public dialog: MatDialog) { }
constructor(private dialog: MatDialog,
private translateService: TranslateService) { }
ngOnInit() {
this.currencyCode.valueChanges.subscribe(() => {
@@ -80,15 +82,15 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
const formfields: FormfieldBase[] = [
new InputBase({
controlName: 'amount',
label: 'Amount',
label: this.translateService.instant('labels.inputs.Amount'),
value: charge.amount || charge.amountOrPercentage,
type: 'number',
required: false,
}),
];
const data = {
title: 'Edit Charge',
layout: { addButtonText: 'Confirm' },
title: this.translateService.instant('labels.heading.Edit Charge'),
layout: { addButtonText: 'Submit' },
formfields: formfields
};
const editNoteDialogRef = this.dialog.open(FormDialogComponent, { data });
@@ -33,24 +33,19 @@
<span fxFlex="60%">{{ sharesAccountTermsForm.get('currencyCode').value | find:[sharesAccountProductTemplate.currency]:'code':'displayLabel' }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">{{'labels.inputs.Decimal Places' | translate}}</span>
<span fxFlex="60%">{{ sharesAccountTermsForm.get('decimal').value }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">{{'labels.inputs.Total Number of Shares' | translate}}</span>
<span fxFlex="60%">{{ sharesAccount.requestedShares }}</span>
<span fxFlex="60%">{{ sharesAccount.requestedShares | formatNumber }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">{{'labels.inputs.Today's Price' | translate}}</span>
<span fxFlex="60%">{{ sharesAccountTermsForm.get('unitPrice').value }}</span>
<span fxFlex="40%">{{'labels.inputs.Current Price' | translate}}</span>
<span fxFlex="60%">{{ sharesAccountTermsForm.get('unitPrice').value | formatNumber }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">{{'labels.inputs.Currency in multiples of' | translate}}</span>
<span fxFlex="60%">{{ sharesAccountTermsForm.get('currencyMultiple').value }}</span>
<span fxFlex="40%">{{'labels.inputs.Amount' | translate}}</span>
<span fxFlex="60%">{{ (sharesAccount.requestedShares * sharesAccountTermsForm.get('unitPrice').value) | formatNumber }}</span>
</div>
<div fxFlexFill>
@@ -60,12 +55,12 @@
<div fxFlexFill *ngIf="sharesAccount.minimumActivePeriod">
<span fxFlex="40%">{{'labels.inputs.Minimum Active Period' | translate}}</span>
<span fxFlex="60%">{{sharesAccount.minimumActivePeriod}}&nbsp;{{sharesAccount.minimumActivePeriodFrequencyType | find:sharesAccountProductTemplate.minimumActivePeriodFrequencyTypeOptions:'id':'value'}}</span>
<span fxFlex="60%">{{sharesAccount.minimumActivePeriod}}&nbsp;{{sharesAccount.minimumActivePeriodFrequencyType | find:sharesAccountProductTemplate.minimumActivePeriodFrequencyTypeOptions:'id':'value' | translateCatalog}}</span>
</div>
<div fxFlexFill *ngIf="sharesAccount.lockinPeriodFrequency">
<span fxFlex="40%">{{'labels.inputs.Lock-in Period' | translate}}</span>
<span fxFlex="60%">{{sharesAccount.lockinPeriodFrequency}}&nbsp;{{sharesAccount.lockinPeriodFrequencyType | find:sharesAccountProductTemplate.lockinPeriodFrequencyTypeOptions:'id':'value'}}</span>
<span fxFlex="60%">{{sharesAccount.lockinPeriodFrequency}}&nbsp;{{sharesAccount.lockinPeriodFrequencyType | find:sharesAccountProductTemplate.lockinPeriodFrequencyTypeOptions:'id':'value' | translateCatalog}}</span>
</div>
<div fxFlexFill>
@@ -75,7 +70,7 @@
<div fxFlexFill>
<span fxFlex="40%">{{'labels.inputs.Allow dividends for inactive clients' | translate}}</span>
<span fxFlex="60%">{{ sharesAccount.allowDividendCalculationForInactiveClients }}</span>
<span fxFlex="60%">{{ sharesAccount.allowDividendCalculationForInactiveClients | yesNo }}</span>
</div>
<div fxFlexFill *ngIf="sharesAccount.charges.length" fxLayout="row wrap" fxLayout.lt-md="column">
@@ -96,7 +91,7 @@
<ng-container matColumnDef="chargeCalculationType">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Type' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeCalculationType.value }}
{{ charge.chargeCalculationType.value | translateCatalog }}
</td>
</ng-container>
@@ -110,7 +105,7 @@
<ng-container matColumnDef="chargeTimeType">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Collected On' | translate}} </th>
<td mat-cell *matCellDef="let charge">
{{ charge.chargeTimeType.value }}
{{ charge.chargeTimeType.value | translateCatalog }}
</td>
</ng-container>
@@ -8,8 +8,8 @@
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{'labels.inputs.Decimal Places' | translate}}</mat-label>
<input type="number" matInput formControlName="decimal">
<mat-label>{{"labels.inputs.Current Price" | translate}}</mat-label>
<input type="number" matInput formControlName="unitPrice">
</mat-form-field>
<mat-form-field fxFlex="48%">
@@ -19,22 +19,13 @@
{{'labels.inputs.Total Number of Shares' | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Today's Price" | translate}}</mat-label>
<input type="number" matInput formControlName="unitPrice">
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{'labels.inputs.Currency in multiples of' | translate}}</mat-label>
<input type="number" matInput formControlName="currencyMultiple" >
</mat-form-field>
<span fxFlex="48%" *ngIf="currency">{{ calculateCurrenValue() | currency:currency.code:'symbol-narrow':'1.2-2' }}</span>
<mat-form-field fxFlex="48%">
<mat-label>{{'labels.inputs.Default Savings Account' | translate}}</mat-label>
<mat-select formControlName="savingsAccountId" required>
<mat-option *ngFor="let account of savingsAccountsData" [value]="account.id">
{{ account.accountNo }}
{{ account.accountNo }} - {{ account.savingsProductName }}
</mat-option>
</mat-select>
<mat-error>
@@ -68,7 +59,7 @@
<mat-label>{{'labels.inputs.Type' | translate}}</mat-label>
<mat-select formControlName="minimumActivePeriodFrequencyType">
<mat-option *ngFor="let minimumActivePeriodFrequencyType of minimumActivePeriodFrequencyTypeData" [value]="minimumActivePeriodFrequencyType.id">
{{ minimumActivePeriodFrequencyType.value }}
{{ minimumActivePeriodFrequencyType.value | translateCatalog }}
</mat-option>
</mat-select>
</mat-form-field>
@@ -84,7 +75,7 @@
<mat-label>{{'labels.inputs.Type' | translate}}</mat-label>
<mat-select formControlName="lockinPeriodFrequencyType">
<mat-option *ngFor="let lockinPeriodFrequencyType of lockinPeriodFrequencyTypeData" [value]="lockinPeriodFrequencyType.id">
{{ lockinPeriodFrequencyType.value }}
{{ lockinPeriodFrequencyType.value | translateCatalog }}
</mat-option>
</mat-select>
</mat-form-field>
@@ -2,6 +2,7 @@
import { Component, OnChanges, OnInit, Input } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
import { SettingsService } from 'app/settings/settings.service';
import { Currency } from 'app/shared/models/general.model';
/**
* Shares Account Terms Step
@@ -33,6 +34,8 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
/** For Edit Shares Account Form */
isSavingsPatched = false;
currency: Currency | null = null;
/**
* @param {FormBuilder} formBuilder Form Builder
* @param {SettingsService} settingsService Settings Service
@@ -44,6 +47,7 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
ngOnChanges() {
if (this.sharesAccountProductTemplate) {
this.currency = this.sharesAccountProductTemplate.currency;
this.sharesAccountTermsForm.patchValue({
'currencyCode': this.sharesAccountProductTemplate.currency.code,
'decimal': this.sharesAccountProductTemplate.currency.decimalPlaces,
@@ -112,4 +116,11 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
return this.sharesAccountTermsForm.value;
}
calculateCurrenValue(): number {
if (this.sharesAccountTermsForm.value.requestedShares && this.sharesAccountProductTemplate.currentMarketPrice) {
return this.sharesAccountProductTemplate.currentMarketPrice * this.sharesAccountTermsForm.value.requestedShares;
}
return 0;
}
}
@@ -20,32 +20,58 @@
<ng-container matColumnDef="paymentDueAt">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Payment Due At' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{ charge.chargeTimeType.value }} </td>
<td mat-cell *matCellDef="let charge"> {{ charge.chargeTimeType.value | translateCatalog }} </td>
</ng-container>
<ng-container matColumnDef="calculationType">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Calculation Type' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.chargeCalculationType.value}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.chargeCalculationType.value | translateCatalog}} </td>
</ng-container>
<ng-container matColumnDef="due">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Due' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.currency.displaySymbol}}&nbsp;{{charge.amount}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.amount | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
</ng-container>
<ng-container matColumnDef="paid">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Paid' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.currency.displaySymbol}}&nbsp;{{charge.amountPaid}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.amountPaid | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
</ng-container>
<ng-container matColumnDef="waived">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Waived' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.currency.displaySymbol}}&nbsp;{{charge.amountWaived}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.amountWaived | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
</ng-container>
<ng-container matColumnDef="outstanding">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Outstanding' | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{charge.currency.displaySymbol}}&nbsp;{{charge.amountOutstanding}} </td>
<td mat-cell *matCellDef="let charge"> {{charge.amountOutstanding | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} </td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Actions' | translate}} </th>
<td mat-cell *matCellDef="let charge">
<span *ngIf="sharesAccountData.status.value === 'Submitted and pending approval'">
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Edit Charge"
*mifosxHasPermission="'UPDATE_SHARESACCOUNTCHARGE'" (click)="routeEdit($event); editCharge(charge)">
<i class="fa fa-pencil"></i>
</button>
<button class="account-action-button" mat-raised-button color="warn" matTooltip="Delete Charge"
*mifosxHasPermission="'DELETE_SHARESACCOUNTCHARGE'" (click)="routeEdit($event); deleteCharge(charge.id)">
<i class="fa fa-trash"></i>
</button>
</span>
<span *ngIf="sharesAccountData.status.value === 'Active'">
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Pay Charge"
*mifosxHasPermission="'PAY_SHARESACCOUNTCHARGE'" (click)="routeEdit($event); payCharge(charge.id)">
<i class="fa fa-dollar"></i>
</button>
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Waive Charge"
*mifosxHasPermission="'WAIVE_SHARESACCOUNTCHARGE'" (click)="routeEdit($event); waiveCharge(charge.id)">
<i class="fa fa-flag"></i>
</button>
</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@@ -4,7 +4,19 @@
h3 {
margin:1% auto;
}
.action-button {
margin-left: auto;
}
table {
width: 100%;
.account-action-button{
min-width: 26px;
padding: 0 6px;
margin: 4px;
line-height: 25px;
}
.select-row:hover {
cursor: pointer;
}
}
}
}
@@ -20,16 +20,7 @@ export class ChargesTabComponent implements OnInit {
/** Data source for charges table. */
dataSource: MatTableDataSource<any>;
/** Columns to be displayed in charges table. */
displayedColumns: string[] = [
'name',
'feeOrPenalty',
'paymentDueAt',
'calculationType',
'due',
'paid',
'waived',
'outstanding',
];
displayedColumns: string[] = ['name', 'feeOrPenalty', 'paymentDueAt', 'calculationType', 'due', 'paid', 'waived', 'outstanding', 'actions' ];
/**
* Retrieves shares account aata from `resolve`.
@@ -40,6 +31,7 @@ export class ChargesTabComponent implements OnInit {
this.sharesAccountData = data.sharesAccountData;
this.chargesData = this.sharesAccountData.charges;
});
console.log(this.sharesAccountData);
}
ngOnInit() {
@@ -1,7 +1,7 @@
<div class="tab-container mat-typography">
<div class="m-b-10">
<h3>{{'labels.inputs.All Dividends' | translate}}</h3>
<h3>{{'labels.inputs.Dividends' | translate}}</h3>
</div>
<div class="mat-elevation-z1 m-b-25">
@@ -15,7 +15,7 @@
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Amount' | translate}} </th>
<td mat-cell *matCellDef="let dividend"> {{shareAccountData.currency.displaySymbol}}&nbsp;{{dividend.amount}} </td>
<td mat-cell *matCellDef="let dividend"> {{dividend.amount | currency:shareAccountData.currency.code:'symbol-narrow':'1.2-2'}} </td>
</ng-container>
<ng-container matColumnDef="transactionReference">
@@ -25,7 +25,7 @@
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Status' | translate}} </th>
<td mat-cell *matCellDef="let dividend"> {{dividend.status.value}} </td>
<td mat-cell *matCellDef="let dividend"> {{ 'labels.status.' + dividend.status.value | translate}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@@ -0,0 +1,65 @@
<div class="tab-container mat-typography">
<div class="shares-account-tables" fxLayout="row" fxLayoutGap="2%">
<div fxFlex="49%">
<h4 class="table-headers">{{'labels.heading.Shares Details' | translate}}</h4>
<table>
<tbody>
<tr>
<td>{{'labels.inputs.Activated On' | translate}}</td>
<td *ngIf="sharesAccountData.timeline.activatedDate">
{{sharesAccountData.timeline.activatedDate | dateFormat}}
</td>
<td *ngIf="!sharesAccountData.timeline.activatedDate">
{{ 'labels.text.Not Activated' | translate}}
</td>
</tr>
<tr>
<td>{{'labels.inputs.Currency' | translate}}</td>
<td>{{sharesAccountData.currency.name}} [{{sharesAccountData.currency.code}}]</td>
</tr>
<tr>
<td>{{'labels.inputs.External Id' | translate}}</td>
<td *ngIf="sharesAccountData.externalId">
<mifosx-external-identifier
externalId="{{sharesAccountData.externalId}}"></mifosx-external-identifier>
</td>
<td *ngIf="!sharesAccountData.externalId">
{{'labels.inputs.Unassigned' | translate}}
</td>
</tr>
<tr>
<td>{{'labels.inputs.Linked Savings Account(Dividend Posting)' | translate}}</td>
<td *ngIf="sharesAccountData.savingsAccountNumber">
<mifosx-account-number accountType="2"
clientId="{{sharesAccountData.clientId}}" accountId="{{sharesAccountData.savingsAccountId}}"
accountNo="{{sharesAccountData.savingsAccountNumber}}"></mifosx-account-number>
</td>
<td *ngIf="!sharesAccountData.savingsAccountNumber">
{{'labels.inputs.Unassigned' | translate}}
</td>
</tr>
</tbody>
</table>
</div>
<div fxFlex="49%">
<h4 class="table-headers">{{'labels.heading.Account Summary' | translate}}</h4>
<table>
<tbody>
<tr>
<td>{{'labels.inputs.Pending for Approval Shares' | translate}}</td>
<td class="r-amount">{{sharesAccountData.summary.totalPendingForApprovalShares | formatNumber}}</td>
</tr>
<tr>
<td>{{'labels.inputs.Approved Shares' | translate}}</td>
<td class="r-amount">{{sharesAccountData.summary.totalApprovedShares | formatNumber}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@@ -0,0 +1,23 @@
.tab-container {
padding: 1%;
margin: 1%;
h3 {
margin: 1% auto;
}
.performance-history-container {
border: 1px solid;
padding: 1%;
margin-bottom: 20px;
}
table {
width: 100%;
margin-bottom: 20px;
}
}
span {
margin: 0.5em 0;
}
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { GeneralTabComponent } from './general-tab.component';
describe('GeneralTabComponent', () => {
let component: GeneralTabComponent;
let fixture: ComponentFixture<GeneralTabComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ GeneralTabComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(GeneralTabComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,26 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'mifosx-general-tab',
templateUrl: './general-tab.component.html',
styleUrls: ['./general-tab.component.scss']
})
export class GeneralTabComponent implements OnInit {
/** Shares Account Data */
sharesAccountData: any;
/**
* Fetches shares account data from `resolve`
* @param {ActivatedRoute} route Activated Route
*/
constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: { sharesAccountData: any }) => {
this.sharesAccountData = data.sharesAccountData;
});
}
ngOnInit(): void {
}
}
@@ -1,4 +1,4 @@
<mat-card class="shares-account-card">
<mat-card class="account-card">
<mat-card-header fxLayout="column" class="header">
@@ -6,119 +6,110 @@
<div class="profile-image-container">
<div>
<img mat-card-md-image class="profile-image"
matTooltip="{{ 'tooltips.Shares Account' | translate}}"
<img mat-card-md-image class="profile-image" matTooltip="{{ 'tooltips.Shares Account' | translate}}"
src="assets/images/shares_account_placeholder.png">
</div>
</div>
<div class="mat-typography account-card-title">
<mat-card-title>
<h3>
<i class="fa fa-stop" [ngClass]="sharesAccountData.status.code | statusLookup" [matTooltip]="sharesAccountData.status.value"></i>
{{'labels.heading.Account Name' | translate}} : {{sharesAccountData.productName}}
</h3>
<div fxLayout="row" fxLayout.lt-md="column">
<div fxFlex="60%">
<h3>
<i class="fa fa-stop" [ngClass]="sharesAccountData.status.code | statusLookup"
[matTooltip]="sharesAccountData.status.value"></i>
<span class="m-r-5">{{'labels.inputs.Share Product' | translate}} :</span>
<span class="m-r-5"><mifosx-long-text
textValue="{{sharesAccountData.productName}}"></mifosx-long-text></span>
<mifosx-account-number accountNo="{{sharesAccountData.accountNo}}"
display="left"></mifosx-account-number>
</h3>
<span class="shares-overview">
<span class="m-r-10">{{'labels.text.' + entityType | translate}} {{"labels.inputs.name" | translate}}
:</span>{{sharesAccountData.clientName || sharesAccountData.groupName}}
<span class="m-l-10" *ngIf="sharesAccountData.clientAccountNo">
<mifosx-account-number accountNo="{{sharesAccountData.clientAccountNo}}"></mifosx-account-number>
</span>
</span>
<div>
<table class="account-overview">
<tbody>
<tr>
<td>{{"labels.inputs.Current Market Price" | translate}} :</td>
<td>{{sharesAccountData.currentMarketPrice | formatNumber}}</td>
</tr>
<tr *ngIf="sharesAccountData.lockinPeriod">
<td>{{"labels.inputs.Lockin Period" | translate}} :</td>
<td>
{{sharesAccountData.lockinPeriod}} {{sharesAccountData.lockPeriodTypeEnum.value | translateCatalog}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<span fxFlex="auto"></span>
<div fxFlex="4%">
<button mat-icon-button [matMenuTriggerFor]="accountMenu" aria-label="Share account actions"
yPosition="below" *ngIf="buttonConfig.singleButtons.length > 0">
<mat-icon matListIcon class="actions-menu">
<fa-icon icon="bars" size="sm"></fa-icon>
</mat-icon>
</button>
</div>
</div>
</mat-card-title>
<mat-card-subtitle>
<p>
{{'labels.inputs.Account' | translate}} #: {{sharesAccountData.accountNo}} | {{'labels.inputs.Client Name' | translate}}: {{sharesAccountData.clientName}}<br/>
{{'labels.inputs.Current Market Price' | translate}}: {{sharesAccountData.currency.displaySymbol}}&nbsp;{{sharesAccountData.currentMarketPrice}}<br/>
{{'labels.inputs.Lockin Period' | translate}}: {{sharesAccountData.lockinPeriod ? sharesAccountData.lockinPeriod : 'N/A'}}
{{sharesAccountData.lockinPeriod ? sharesAccountData.lockPeriodTypeEnum.value : ''}}
</p>
</mat-card-subtitle>
</div>
</mat-card-title-group>
<mat-card-actions class="account-actions">
<mat-menu #accountMenu="matMenu">
<ng-container *ngFor="let button of buttonConfig.singleButtons">
<button mat-raised-button *mifosxHasPermission="button.taskPermissionName" (click)="doAction(button.name)">
<i class="{{button.icon}}"></i> {{button.name}}</button>
<ng-container *ngFor="let item of buttonConfig.singleButtons">
<button mat-menu-item *mifosxHasPermission="item.taskPermissionName" (click)="doAction(item.name)">
<mat-icon matListIcon>
<fa-icon icon="{{item.icon}}" size="sm"></fa-icon>
</mat-icon>
<span>{{'labels.menus.' + item.name | translate}}</span>
</button>
</ng-container>
<ng-container *ngIf="buttonConfig.options.length">
<button mat-raised-button [matMenuTriggerFor]="More">{{'labels.heading.More' | translate}}</button>
<button mat-menu-item [matMenuTriggerFor]="More">{{'labels.menus.More' | translate}}</button>
<mat-menu #More="matMenu">
<span *ngFor="let option of buttonConfig.options">
<button mat-menu-item *mifosxHasPermission="option.taskPermissionName" (click)="doAction(option.name)">{{option.name}}</button>
</span>
<span *ngFor="let option of buttonConfig.options">
<button mat-menu-item *mifosxHasPermission="option.taskPermissionName"
(click)="doAction(option.name)">{{'labels.menus.' + option.name | translate}}</button>
</span>
</mat-menu>
</ng-container>
</mat-card-actions>
</mat-menu>
</mat-card-header>
<mat-card-content class="content">
<div class="shares-account-tables" fxLayout="row" fxLayoutGap="2%">
<div fxFlex="49%">
<h4 class="table-headers">{{'labels.heading.Shares Details' | translate}}</h4>
<table>
<tbody>
<tr>
<td>{{'labels.inputs.Activated On' | translate}}</td>
<td>{{sharesAccountData.timeline.activatedOnDate ? (sharesAccountData.timeline.activatedOnDate | dateFormat) : 'Not Activated'}}</td>
</tr>
<tr>
<td>{{'labels.inputs.Currency' | translate}}</td>
<td>{{sharesAccountData.currency.name}} [{{sharesAccountData.currency.code}}]</td>
</tr>
<tr>
<td>{{'labels.inputs.External Id' | translate}}</td>
<td *ngIf="sharesAccountData.externalId">
<mifosx-external-identifier externalId="{{sharesAccountData.externalId}}"></mifosx-external-identifier>
</td>
<td *ngIf="!sharesAccountData.externalId">
{{'labels.inputs.Unassigned' | translate}}
</td>
</tr>
<tr>
<td>{{'labels.inputs.Linked Savings Account(Dividend Posting)' | translate}}</td>
<td *ngIf="sharesAccountData.savingsAccountNumber">
<mifosx-account-number accountNo="{{sharesAccountData.savingsAccountNumber}}"></mifosx-account-number>
</td>
<td *ngIf="!sharesAccountData.savingsAccountNumber">
{{'labels.inputs.Unassigned' | translate}}
</td>
</tr>
</tbody>
</table>
</div>
<div fxFlex="49%">
<h4 class="table-headers">{{'labels.heading.Account Summary' | translate}}</h4>
<table>
<tbody>
<tr>
<td>{{'labels.inputs.Approved Shares' | translate}}</td>
<td>{{sharesAccountData.summary.totalApprovedShares}}</td>
</tr>
<tr>
<td>{{'labels.inputs.Pending for Approval Shares' | translate}}</td>
<td>{{sharesAccountData.summary.totalPendingForApprovalShares}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<nav mat-tab-nav-bar class="navigation-tabs">
<a mat-tab-link [routerLink]="['./general']" routerLinkActive #general="routerLinkActive"
[active]="general.isActive" *mifosxHasPermission="'READ_SHAREACCOUNTPURCHASE'">
{{'labels.inputs.General' | translate}}
</a>
<a mat-tab-link [routerLink]="['./transactions']" routerLinkActive #transactions="routerLinkActive"
[active]="transactions.isActive" *mifosxHasPermission="'READ_SHAREACCOUNTPURCHASE'">
{{'labels.inputs.Transactions' | translate}}
[active]="transactions.isActive" *mifosxHasPermission="'READ_SHAREACCOUNTPURCHASE'">
{{'labels.inputs.Transactions' | translate}}
</a>
<a mat-tab-link [routerLink]="['./charges']" routerLinkActive #charges="routerLinkActive"
[active]="charges.isActive" *mifosxHasPermission="'READ_SHAREACCOUNTCHARGE'">
{{'labels.inputs.Charges' | translate}}
[active]="charges.isActive" *mifosxHasPermission="'READ_SHAREACCOUNTCHARGE'">
{{'labels.inputs.Charges' | translate}}
</a>
<a mat-tab-link [routerLink]="['./dividends']" routerLinkActive #dividends="routerLinkActive"
[active]="dividends.isActive" *mifosxHasPermission="'READ_SHAREACCOUNTDIVIDENDS'">
{{'labels.inputs.Dividends' | translate}}
[active]="dividends.isActive" *mifosxHasPermission="'READ_SHAREACCOUNTDIVIDENDS'">
{{'labels.inputs.Dividends' | translate}}
</a>
</nav>
@@ -126,4 +117,4 @@
</mat-card-content>
</mat-card>
</mat-card>
@@ -1,53 +1,8 @@
.shares-account-card {
margin: 0 auto;
max-width: 80rem;
width: 90%;
padding: 0;
.header {
padding: 1%;
.header-title-group {
.account-card-title {
color: white;
width: 90%;
p {
color: white;
}
}
}
.profile-image-container {
margin: 1%;
.profile-image {
object-fit: cover;
border-radius: 20px;
}
}
.account-actions {
align-self: flex-end;
margin: 0 1%;
i {
margin-bottom: 2px;
margin-right: 4px;
}
}
}
.navigation-tabs {
background-color: #f2f2f2;
overflow: auto;
}
.content {
.shares-account-tables {
padding: 1%;
margin: 1%;
.table-headers {
margin: 0;
padding: 6px;
}
td {
padding: 3px;
}
}
}
i, img:hover {
cursor: pointer;
}
.shares-overview {
font-size: 14px;
}
.account-overview {
min-width: 60%;
font-weight: 400;
}
@@ -27,6 +27,8 @@ export class SharesAccountViewComponent implements OnInit {
/** Button Configurations */
buttonConfig: SharesButtonsConfiguration;
entityType: string;
/**
* Fetches shares account data from `resolve`
* @param {ActivatedRoute} route Activated Route
@@ -45,6 +47,13 @@ export class SharesAccountViewComponent implements OnInit {
ngOnInit() {
this.setConditionalButtons();
if (this.router.url.includes('clients')) {
this.entityType = 'Client';
} else if (this.router.url.includes('groups')) {
this.entityType = 'Group';
} else if (this.router.url.includes('centers')) {
this.entityType = 'Center';
}
}
/**
@@ -31,22 +31,22 @@ export class SharesButtonsConfiguration {
this.buttonsArray = [
{
name: 'Apply Additional Shares',
icon: 'fa fa-arrow-right',
icon: 'arrow-right',
taskPermissionName: 'APPLYADDITIONAL_SHAREACCOUNT'
},
{
name: 'Approve Additional Shares',
icon: 'fa fa-arrow-right',
icon: 'arrow-right',
taskPermissionName: 'APPROVEADDITIONAL_SHAREACCOUNT'
},
{
name: 'Reject Additional Shares',
icon: 'fa fa-arrow-left',
icon: 'arrow-left',
taskPermissionName: 'REJECTADDITIONAL_SHAREACCOUNT'
},
{
name: 'Redeem Shares',
icon: 'fa fa-arrow-left',
icon: 'arrow-left',
taskPermissionName: 'WITHDRAW_SAVINGSACCOUNT'
}
];
@@ -55,12 +55,12 @@ export class SharesButtonsConfiguration {
this.buttonsArray = [
{
name: 'Modify Application',
icon: 'fa fa-pencil ',
icon: 'pencil',
taskPermissionName: 'UPDATE_SHAREACCOUNT'
},
{
name: 'Approve',
icon: 'fa fa-check',
icon: 'check',
taskPermissionName: 'APPROVE_SHAREACCOUNT'
}
];
@@ -69,12 +69,12 @@ export class SharesButtonsConfiguration {
this.buttonsArray = [
{
name: 'Undo Approval',
icon: 'fa fa-undo',
icon: 'undo',
taskPermissionName: 'APPROVALUNDO_SHAREACCOUNT'
},
{
name: 'Activate',
icon: 'fa fa-check',
icon: 'check',
taskPermissionName: 'ACTIVATE_SHAREACCOUNT'
}
];
+14
View File
@@ -16,6 +16,7 @@ import { SharesAccountViewResolver } from './common-resolvers/share-account-view
import { ShareAccountActionsResolver } from './common-resolvers/share-account-actions.resolver';
import { SharesAccountTemplateResolver } from './common-resolvers/shares-account-template.resolver';
import { SharesAccountAndTemplateResolver } from './common-resolvers/share-account-and-template.resolver';
import { GeneralTabComponent } from './shares-account-view/general-tab/general-tab.component';
/** Shares Routes */
const routes: Routes = [
@@ -42,6 +43,19 @@ const routes: Routes = [
sharesAccountData: SharesAccountViewResolver
},
children: [
{
path: '',
redirectTo: 'general',
pathMatch: 'full'
},
{
path: 'general',
component: GeneralTabComponent,
data: { title: 'Shares Account General', breadcrumb: 'General', routeParamBreadcrumb: false },
resolve: {
sharesAccountData: SharesAccountViewResolver
},
},
{
path: 'transactions',
component: TransactionsTabComponent,
+3 -1
View File
@@ -28,6 +28,7 @@ import { ApproveSharesComponent } from './shares-account-actions/approve-shares/
import { ApproveShareDialogComponent } from './shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component';
import { RejectSharesComponent } from './shares-account-actions/reject-shares/reject-shares.component';
import { RejectShareDialogComponent } from './shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component';
import { GeneralTabComponent } from './shares-account-view/general-tab/general-tab.component';
/**
* Shares Module
@@ -63,7 +64,8 @@ import { RejectShareDialogComponent } from './shares-account-actions/reject-shar
ApproveSharesComponent,
ApproveShareDialogComponent,
RejectSharesComponent,
RejectShareDialogComponent
RejectShareDialogComponent,
GeneralTabComponent
],
providers: [ ]
})