Some changes in display for assets
This commit is contained in:
parent
b02119f12b
commit
13c43df7a2
|
|
@ -13,102 +13,109 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="container mt-5">
|
<div class="container mt-5">
|
||||||
<h1 class="heading text-center">Kalkulator amortyzacyjny</h1>
|
|
||||||
|
|
||||||
<form [formGroup]=assetsDepreciationForm class="frame ">
|
<div class="row">
|
||||||
<div class="form-group row">
|
<h1 class="heading text-center">Kalkulator amortyzacyjny</h1>
|
||||||
<label for="initialValueSet" class="form-label col-3" >Wartość początkowa środka trwałego: </label>
|
|
||||||
<div class="col-3">
|
|
||||||
<input type="text" class="form-control" id="initialValueSet" aria-describedby="initialValueHelpInline" formControlName="initialValueSet" required
|
|
||||||
[ngModel]="asset.initialValueAsset"
|
|
||||||
(ngModelChange)="asset.initialValueAsset=$event" />
|
|
||||||
</div>
|
|
||||||
<div class="col-auto">
|
|
||||||
<span>PLN</span>
|
|
||||||
</div>
|
|
||||||
@if(assetsDepreciationForm.get('initialValueSet')?.invalid && assetsDepreciationForm.get('initialValueSet')?.touched){
|
|
||||||
<div class="text-danger col-auto"> Wartość niepoprawna!. Podaj kwotę w zł np 3000.05 (czyli 3000 zł i 5 gr)</div>
|
|
||||||
}@else{
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="depreciationRate" class="form-label col-3" >Stawka amortyzacyjna w procentach :</label>
|
|
||||||
<div class="col-3">
|
|
||||||
<input type="text" class="form-control" id="depreciationRate" formControlName="depreciationRate"
|
|
||||||
[ngModel]="asset.depreciationRate | number:'1.2-2'"
|
|
||||||
(ngModelChange)="asset.depreciationRate=$event"/>
|
|
||||||
</div>
|
|
||||||
<div class="col-auto">
|
|
||||||
<span>%</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label class="form-label col-3">Rok i miesiąc rozpoczęcia amortyzacji</label>
|
|
||||||
<div class="col-1">
|
|
||||||
<input type="number" class="form-control" formControlName="year"
|
|
||||||
[ngModel]=asset.year
|
|
||||||
(ngModelChange)="asset.year=$event;calculate()" />
|
|
||||||
</div>
|
|
||||||
<div class="col-1">
|
|
||||||
<input type="number" class="form-control" formControlName="month"
|
|
||||||
[ngModel]=asset.month
|
|
||||||
(ngModelChange)="asset.month=$event;calculate()" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group row">
|
<form [formGroup]=assetsDepreciationForm class="frame">
|
||||||
<label class="form-label col-3">Metoda amortyzacji</label>
|
<div class="align-items-start" >
|
||||||
<div class="col-3" >
|
<div class="form-group row">
|
||||||
<select class="form-control" formControlName="typeDepreciation"
|
<label for="initialValueSet" class="form-label col-auto" >Wartość początkowa środka trwałego:</label>
|
||||||
[ngModel]=asset.type
|
<div class="col">
|
||||||
(ngModelChange)="asset.type=$event;calculate()" >
|
<input type="text" class="form-control" id="initialValueSet" aria-describedby="initialValueHelpInline" formControlName="initialValueSet" required
|
||||||
<option [ngValue]=TypeDepreciation.linear selected="selected">Liniowa</option>
|
[ngModel]="asset.initialValueAsset"
|
||||||
<option [ngValue]=TypeDepreciation.digressive >Dygresywna</option>
|
(ngModelChange)="asset.initialValueAsset=$event" />
|
||||||
</select>
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<span>PLN</span>
|
||||||
|
</div>
|
||||||
|
@if(assetsDepreciationForm.get('initialValueSet')?.invalid && assetsDepreciationForm.get('initialValueSet')?.touched){
|
||||||
|
<div class="text-danger col-auto"> Wartość niepoprawna!. Podaj kwotę w zł np 3000.05 (czyli 3000 zł i 5 gr)</div>
|
||||||
|
}@else{
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
</div>
|
<label for="depreciationRate" class="form-label col-auto" >Stawka amortyzacyjna w procentach:</label>
|
||||||
@if( TypeDepreciation.digressive === asset.type ){
|
<div class="col">
|
||||||
<div class="form-group row">
|
<input type="text" class="form-control" id="depreciationRate" formControlName="depreciationRate"
|
||||||
<label for="factorValue" class="form-label col-3">Wspólczynnki degresji</label>
|
[ngModel]="asset.depreciationRate | number:'1.2-2'"
|
||||||
<div class="col-auto" >
|
(ngModelChange)="asset.depreciationRate=$event"/>
|
||||||
<input type="text" class="form-control" formControlName="factorValue"
|
</div>
|
||||||
[ngModel]="asset.factorValue | number:'1.2-2' "
|
<div class="col">
|
||||||
(ngModelChange)="asset.factorValue=$event;calculate()"/>
|
<span>%</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="form-label col-auto">Rok i miesiąc rozpoczęcia amortyzacji</label>
|
||||||
|
<div class="col">
|
||||||
|
<input type="number" class="form-control" formControlName="year"
|
||||||
|
[ngModel]=asset.year
|
||||||
|
(ngModelChange)="asset.year=$event;calculate()" />
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<input type="number" class="form-control" formControlName="month"
|
||||||
|
[ngModel]=asset.month
|
||||||
|
(ngModelChange)="asset.month=$event;calculate()" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
|
|
||||||
<input class="btn btn-secondary col-auto" name="calculate"
|
<div class="form-group row">
|
||||||
[disabled]=assetsDepreciationForm.invalid (click)=calculate() type="button" value="Wylicz ">
|
<label class="form-label col-auto">Metoda amortyzacji</label>
|
||||||
|
<div class="col-auto" >
|
||||||
|
<select class="form-control" formControlName="typeDepreciation"
|
||||||
|
[ngModel]=asset.type
|
||||||
|
(ngModelChange)="asset.type=$event;calculate()" >
|
||||||
|
<option [ngValue]=TypeDepreciation.linear selected="selected">Liniowa</option>
|
||||||
|
<option [ngValue]=TypeDepreciation.digressive >Dygresywna</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
</div>
|
||||||
<div class="mt-5">
|
@if( TypeDepreciation.digressive === asset.type ){
|
||||||
<table class="table table-striped frame2">
|
<div class="form-group row">
|
||||||
<thead>
|
<label for="factorValue" class="form-label col-auto">Wspólczynnki degresji</label>
|
||||||
<tr>
|
<div class="col-auto" >
|
||||||
<th scope="col">Lp</th>
|
<input type="text" class="form-control" formControlName="factorValue"
|
||||||
<th scope="col">Rok</th>
|
[ngModel]="asset.factorValue | number:'1.2-2' "
|
||||||
<th scope="col">Miesiąc</th>
|
(ngModelChange)="asset.factorValue=$event;calculate()"/>
|
||||||
<th scope="col">Kwota odpisu</th>
|
</div>
|
||||||
<th scope="col">Lączny odpis</th>
|
</div>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@for (position of positions.positions; track $index) {
|
|
||||||
|
|
||||||
|
|
||||||
<tr [class]="clazz(position)" >
|
|
||||||
|
|
||||||
<th scope="row">{{$index+1}}</th>
|
|
||||||
<td>{{ position.when.year }}</td>
|
|
||||||
<td>{{ position.when.month }}</td>
|
|
||||||
<td>{{ position.calculatedDepreciation | number:'1.2-2' }}</td>
|
|
||||||
<td>{{ position.sum | number:'1.2-2' }}</td>
|
|
||||||
</tr>
|
|
||||||
}
|
}
|
||||||
</tbody>
|
|
||||||
</table>
|
<input class="btn btn-secondary col-auto" name="calculate"
|
||||||
|
[disabled]=assetsDepreciationForm.invalid (click)=calculate() type="button" value="Wylicz ">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mt-5">
|
||||||
|
<table class="table table-striped frame2">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Lp</th>
|
||||||
|
<th scope="col">Rok</th>
|
||||||
|
<th scope="col">Miesiąc</th>
|
||||||
|
<th scope="col">Kwota odpisu</th>
|
||||||
|
<th scope="col">Lączny odpis</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@for (position of positions.positions; track $index) {
|
||||||
|
|
||||||
|
|
||||||
|
<tr [class]="clazz(position)" >
|
||||||
|
|
||||||
|
<th scope="row">{{$index+1}}</th>
|
||||||
|
<td>{{ position.when.year }}</td>
|
||||||
|
<td>{{ position.when.month }}</td>
|
||||||
|
<td>{{ position.calculatedDepreciation | number:'1.2-2' }}</td>
|
||||||
|
<td>{{ position.sum | number:'1.2-2' }}</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue