1.Some changes graphical with calculator
2. Calculate sum depreciation for every year
This commit is contained in:
parent
9f03a0418d
commit
db7147571d
|
|
@ -6,16 +6,19 @@
|
||||||
background-color: #f8f9fa; /* Tło formularza */
|
background-color: #f8f9fa; /* Tło formularza */
|
||||||
}
|
}
|
||||||
.frame2 {
|
.frame2 {
|
||||||
border: 2px solid rgb(225, 228, 86); /* Kolor ramki */
|
border: 2px solid rgb(197, 195, 231); /* Kolor ramki */
|
||||||
border-radius: 8px; /* Zaokrąglenie krawędzi */
|
border-radius: 8px; /* Zaokrąglenie krawędzi */
|
||||||
padding: 20px; /* Odstęp wewnętrzny */
|
padding: 20px; /* Odstęp wewnętrzny */
|
||||||
background-color: #f8f9fa; /* Tło formularza */
|
background-color: #f8f9fa; /* Tło formularza */
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="container mt-5">
|
<div class="container mt-5">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h1 class="heading text-center">Kalkulator amortyzacyjny</h1>
|
<div class="h1 text-center">Kalkulator amortyzacyjny</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
<form [formGroup]=assetsDepreciationForm class="frame">
|
<form [formGroup]=assetsDepreciationForm class="frame">
|
||||||
|
|
||||||
|
|
@ -87,8 +90,11 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mt-5">
|
|
||||||
<table class="table table-striped frame2">
|
<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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Lp</th>
|
<th scope="col">Lp</th>
|
||||||
|
|
@ -100,19 +106,28 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@for (position of positions.positions; track $index) {
|
@for (position of positions.positions; track $index) {
|
||||||
|
|
||||||
|
|
||||||
<tr [class]="clazz(position)" >
|
<tr [class]="clazz(position)" >
|
||||||
|
|
||||||
<th scope="row">{{$index+1}}</th>
|
<th scope="row">{{$index+1}}</th>
|
||||||
<td>{{ position.when.year }}</td>
|
<td>{{ position.when.year }}</td>
|
||||||
<td>{{ position.when.month }}</td>
|
<td>{{ position.when.month }}</td>
|
||||||
<td>{{ position.calculatedDepreciation | number:'1.2-2' }}</td>
|
<td>{{ position.calculatedDepreciation | number:'1.2-2' }}</td>
|
||||||
<td>{{ position.sum | number:'1.2-2' }}</td>
|
<td>{{ position.sum | number:'1.2-2' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@if( 12 == position.when.month || $index == positions.positions.length-1){
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">
|
||||||
|
</td>
|
||||||
|
<td colspan="1">
|
||||||
|
<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>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,19 @@ export class AssetCalculatorComponent implements OnInit{
|
||||||
|
|
||||||
calculateToValues() {
|
calculateToValues() {
|
||||||
let sum :number = 0;
|
let sum :number = 0;
|
||||||
|
let sumThisYear: number = 0;
|
||||||
for(let position of this.positions.positions ){
|
for(let position of this.positions.positions ){
|
||||||
position.calculatedDepreciation = position.calculatedDepreciation *0.01;
|
position.calculatedDepreciation = position.calculatedDepreciation *0.01;
|
||||||
|
|
||||||
sum += position.calculatedDepreciation;
|
sum += position.calculatedDepreciation;
|
||||||
position.sum = sum;
|
position.sum = sum;
|
||||||
|
|
||||||
|
if( 1 == position.when.month ){
|
||||||
|
sumThisYear = position.calculatedDepreciation;
|
||||||
|
}else{
|
||||||
|
sumThisYear += position.calculatedDepreciation
|
||||||
|
}
|
||||||
|
position.sumThisYear = sumThisYear
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ export class AssetPlanPosition{
|
||||||
when : YearMonth = new YearMonth();
|
when : YearMonth = new YearMonth();
|
||||||
calculatedDepreciation : number = 0;
|
calculatedDepreciation : number = 0;
|
||||||
sum:number = 0;
|
sum:number = 0;
|
||||||
|
sumThisYear:number = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue