New version of depreciations
This commit is contained in:
parent
7f683639c6
commit
5a911436e0
|
|
@ -1,121 +1,123 @@
|
|||
|
||||
<div class="container mt-5">
|
||||
<div class="container mt-5 ">
|
||||
|
||||
<div class="row">
|
||||
<div class="h1 text-center text-lg-start">Kalkulator amortyzacyjny</div>
|
||||
<div class="h1 text-center text-lg-start ">Kalkulator amortyzacyjny</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-1 col-lg-4">
|
||||
<form [formGroup]=assetsDepreciationFormGroup class="frame">
|
||||
<div class="form-group row align-items-center mb-1">
|
||||
<div class="col-5 col-lg-6 text-start">
|
||||
<label class="form-label" for="initialValueAsset" >Wartość początkowa ŚT:</label>
|
||||
</div>
|
||||
<div class="col col-lg">
|
||||
<input class="form-control" formControlName="initialValueAsset" type="number" id="initialValueAsset" required >
|
||||
|
||||
@if(assetsDepreciationFormGroup.get('initialValueSet')?.invalid && assetsDepreciationFormGroup.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="row">
|
||||
<div class="col mx-2 mx-lg-0 mb-2 col-lg-4 frame">
|
||||
<div class="row text-center h5 "><h5>Środek trwały</h5></div>
|
||||
<form [formGroup]=assetsDepreciationFormGroup >
|
||||
<div class="form-group row align-items-center mb-1">
|
||||
<div class="col-5 col-lg-6 text-start">
|
||||
<label class="form-label" for="initialValueAsset" >Wartość początkowa:</label>
|
||||
</div>
|
||||
<div class="col col-lg">
|
||||
<input class="form-control" formControlName="initialValueAsset" type="number" id="initialValueAsset" required >
|
||||
|
||||
@if(assetsDepreciationFormGroup.get('initialValueSet')?.invalid && assetsDepreciationFormGroup.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 align-items-center">
|
||||
<div class="col-5 col-lg-6 text-start ">
|
||||
<label class="form-label" for="rate" >Stawka amortyzacyjna:</label>
|
||||
</div>
|
||||
<div class="col-3 col-lg-3">
|
||||
<input class="form-control" formControlName="rate" type="number" id="rate" />
|
||||
</div>
|
||||
<div class="col-1 col-lg-1 text-start">
|
||||
<label for="rate">%</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row align-items-center ">
|
||||
<div class="col-5 col-lg-6 text-start ">
|
||||
<label class="form-label">Rozpoczęcie amortyzacji:</label>
|
||||
</div>
|
||||
<div class="col-7 col-lg-6">
|
||||
<input type="month" lang="pl" class="form-control" formControlName="year_month" id="year_month" placeholder="2024" />
|
||||
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-5 col-lg-6 text-start ">
|
||||
<label class="form-label" for="rate" >Stawka amortyzacyjna:</label>
|
||||
</div>
|
||||
<div class="col-3 col-lg-3">
|
||||
<input class="form-control" formControlName="rate" type="number" id="rate" />
|
||||
</div>
|
||||
<div class="col-1 col-lg-1 text-start">
|
||||
<label for="rate">%</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group row align-items-center ">
|
||||
<div class="col-5 col-lg-6 text-start ">
|
||||
<label class="form-label">Rozpoczęcie amortyzacji:</label>
|
||||
</div>
|
||||
<div class="col-7 col-lg-6">
|
||||
<input type="month" lang="pl" class="form-control" formControlName="year_month" id="year_month" placeholder="2024" />
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-5 col-lg text-start " >
|
||||
<label class="form-label">Metoda amortyzacji:</label>
|
||||
</div>
|
||||
<div class="col col-lg" >
|
||||
<select class="form-select" formControlName="typeDepreciation" >
|
||||
<option [ngValue]=TypeDepreciation.linear selected="selected">Liniowa</option>
|
||||
<option [ngValue]=TypeDepreciation.digressive >Dygresywna</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if( TypeDepreciation.digressive === assetsDepreciationFormGroup.get( 'typeDepreciation' )?.value ) {
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-5 col-lg text-start ">
|
||||
<label for="factor" class="form-label">Wspólczynnki degresji</label>
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-5 col-lg text-start " >
|
||||
<label class="form-label">Metoda amortyzacji:</label>
|
||||
</div>
|
||||
<div class="col col-lg" >
|
||||
<input type="text" class="form-control" formControlName="factor" id="factor" />
|
||||
<select class="form-select" formControlName="typeDepreciation" >
|
||||
<option [ngValue]=TypeDepreciation.linear selected="selected">Liniowa</option>
|
||||
<option [ngValue]=TypeDepreciation.digressive >Dygresywna</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- <input class="btn btn-secondary col-auto" name="calculate"
|
||||
[disabled]=assetsDepreciationFormGroup.invalid (click)=calculate() type="button" value="Wylicz "> -->
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<input class="btn btn-secondary col-auto" name="addChangeValue"
|
||||
[disabled]=assetsDepreciationFormGroup.invalid (click)=addChangeValue() type="button" value="Dodaj zmianę wartości ">
|
||||
@if( TypeDepreciation.digressive === assetsDepreciationFormGroup.get( 'typeDepreciation' )?.value ) {
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-5 col-lg text-start ">
|
||||
<label for="factor" class="form-label">Wspólczynnki degresji</label>
|
||||
</div>
|
||||
<div class="col col-lg" >
|
||||
<input type="text" class="form-control" formControlName="factor" id="factor" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</form>
|
||||
<div class="col-1">
|
||||
<input class="btn btn-secondary col-auto" name="addChangeValue"
|
||||
[disabled]=assetsDepreciationFormGroup.invalid (click)=addChangeValue() type="button" value="Dodaj zmianę wartości ">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@if( lifeFormArray.controls.length > 0 ){
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-11 h1 text-center mt-3" >Zmiany wartości</div>
|
||||
<div class="col col-lg-6 mb-2 mx-1 frame2">
|
||||
<div class="row">
|
||||
<div class="h2 text-center my-1" >Zmiany wartości</div>
|
||||
</div>
|
||||
<div class="row p-2 ">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-1 text-center" scope="col-auto">Lp</th>
|
||||
<th class="col-2 text-center" scope="col-auto">Miesiąc</th>
|
||||
<th class="col-2 text-center" scope="col">Zmiana</th>
|
||||
<th class="col-1 text-center" scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for( changeGroup of lifeFormArray.controls; track $index ) {
|
||||
<tr [formGroup] = changeGroup >
|
||||
<th class="align-middle text-center col-auto" scope="row">{{$index+1}}</th>
|
||||
<td><input class="form-control" type="month" formControlName="year_month" ></td>
|
||||
<td><input class="form-control" type="number" formControlName="initialValueAsset" placeholder="Wprowadź wartość {{$index}}"></td>
|
||||
<td ><button class="btn btn-sm btn-secondary" type="button" (click)=removeChange($index)>Usuń</button>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-1">
|
||||
<table class="table table-striped ">
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="row justify-content-center m-1 frame2">
|
||||
<div class="row h2 text-center" style="--bs-bg-opacity: .2;"><h2>Plan amortyzacji</h2></div>
|
||||
<div class="mt-3 col-11 justify-content-center ">
|
||||
<div class="row justify-content-center">
|
||||
<table class="table table-striped table-bordered ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Lp</th>
|
||||
<th scope="col">Miesiąc</th>
|
||||
<th scope="col">Zmiana</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for( changeGroup of lifeFormArray.controls; track $index ) {
|
||||
<tr [formGroup] = changeGroup >
|
||||
<th scope="row">{{$index+1}}</th>
|
||||
<td><input class="form-control" type="month" formControlName="year_month" ></td>
|
||||
<td><input class="form-control" type="number" formControlName="initialValueAsset" placeholder="Wprowadź wartość {{$index}}"></td>
|
||||
<td><button class="btn btn-secondary" type="button" (click)=removeChange($index)>Usuń</button>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
<div class="row m-1">
|
||||
<div class="h1 text-center mt-3" style="--bs-bg-opacity: .2;">Plan amortyzacji</div>
|
||||
<div class="frame2 ">
|
||||
<div class="row">
|
||||
<table class="table table-striped ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Lp</th>
|
||||
<th scope="col">Rok</th>
|
||||
<tr class="text-center fw-bold ">
|
||||
<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>
|
||||
|
|
@ -123,23 +125,30 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
@for (position of amortizations.positions; track $index) {
|
||||
<tr [class]="clazz(position)" >
|
||||
<th scope="row">{{$index+1}}</th>
|
||||
<tr [class]="clazz(position)" class="text-center">
|
||||
<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>
|
||||
@if( 12 == position.when.month || $index == amortizations.positions.length-1){
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div class="row justify-content-end text-center">
|
||||
<div class="frame col-auto">Łącznie w roku {{position.when.year}} odpis : {{ position.sumThisYear| number:'1.2-2' }} </div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div class="row justify-content-end text-center">
|
||||
<div class="frame col-auto">Łącznie w roku {{position.when.year}} odpis : {{ position.sumThisYear| number:'1.2-2' }} </div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="text-center fw-bold frame">
|
||||
<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>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
|
|
|
|||
Loading…
Reference in New Issue