Some changes in asset interface
This commit is contained in:
parent
f930af39c1
commit
b02119f12b
|
|
@ -6,7 +6,7 @@ import { ChatGPTComponent } from './chat-gpt/chat-gpt.component';
|
|||
|
||||
export const routes: Routes = [
|
||||
{ path: "",
|
||||
title: "Kalkulator amprtyzacyjny",
|
||||
title: "Kalkulator amortyzacyjny",
|
||||
component:AssetCalculatorComponent },
|
||||
{ path: "about-me",
|
||||
title:"O mnie",
|
||||
|
|
|
|||
|
|
@ -15,105 +15,100 @@
|
|||
<div class="container mt-5">
|
||||
<h1 class="heading text-center">Kalkulator amortyzacyjny</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<form [formGroup]=assetsDepreciationForm class="frame">
|
||||
<div class="form-group row">
|
||||
<label for="initialValueSet" class="col-7" >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="col-7">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="col-7">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>
|
||||
<form [formGroup]=assetsDepreciationForm class="frame ">
|
||||
<div class="form-group row">
|
||||
<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">
|
||||
<label class="form-label col-3">Metoda amortyzacji</label>
|
||||
<div class="col-3" >
|
||||
<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>
|
||||
|
||||
</div>
|
||||
@if( TypeDepreciation.digressive === asset.type ){
|
||||
<div class="form-group row">
|
||||
<label for="factorValue" class="form-label col-3">Wspólczynnki degresji</label>
|
||||
<div class="col-auto" >
|
||||
<input type="text" class="form-control" formControlName="factorValue"
|
||||
[ngModel]="asset.factorValue | number:'1.2-2' "
|
||||
(ngModelChange)="asset.factorValue=$event;calculate()"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-7">Metoda amortyzacji</label>
|
||||
<div class="col" >
|
||||
<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>
|
||||
<input class="btn btn-secondary col-auto" name="calculate"
|
||||
[disabled]=assetsDepreciationForm.invalid (click)=calculate() type="button" value="Wylicz ">
|
||||
|
||||
</div>
|
||||
@if( TypeDepreciation.digressive === asset.type ){
|
||||
<div class="form-group row">
|
||||
<label for="factorValue" class="col-7">Wspólczynnki degresji</label>
|
||||
<div class="col-auto" >
|
||||
<input type="text" class="form-control" formControlName="factorValue"
|
||||
[ngModel]="asset.factorValue | number:'1.2-2' "
|
||||
(ngModelChange)="asset.factorValue=$event;calculate()"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<input class="btn btn-secondary col-auto" name="calculate"
|
||||
[disabled]=assetsDepreciationForm.invalid (click)=calculate() type="button" value="Wylicz ">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<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)" >
|
||||
</form>
|
||||
<div class="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) {
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue