before add to gitea
This commit is contained in:
parent
2f7530c3f9
commit
fc6debd7ca
|
|
@ -41,8 +41,8 @@
|
|||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "500kB",
|
||||
"maximumError": "1MB"
|
||||
"maximumWarning": "1.5MB",
|
||||
"maximumError": "2MB"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
32
package.json
32
package.json
|
|
@ -12,21 +12,23 @@
|
|||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^19.1.5",
|
||||
"@angular/cdk": "^18.2.14",
|
||||
"@angular/cdk": "^19.1.3",
|
||||
"@angular/common": "^19.1.5",
|
||||
"@angular/compiler": "^19.1.5",
|
||||
"@angular/core": "^19.1.5",
|
||||
"@angular/forms": "^19.1.5",
|
||||
"@angular/material": "^18.2.14",
|
||||
"@angular/material": "^19.1.3",
|
||||
"@angular/platform-browser": "^19.1.5",
|
||||
"@angular/platform-browser-dynamic": "^19.1.5",
|
||||
"@angular/router": "^19.1.5",
|
||||
"@ngx-translate/core": "^16.0.3",
|
||||
"@ngx-translate/http-loader": "^16.0.0",
|
||||
"@ngx-translate/core": "^16.0.4",
|
||||
"@ngx-translate/http-loader": "^16.0.1",
|
||||
"bootstrap": "^5.3.3",
|
||||
"date-fns": "^4.1.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"tslib": "^2.3.0",
|
||||
"glob": "^11.0.1",
|
||||
"rimraf": "^6.0.1",
|
||||
"rxjs": "~7.8.1",
|
||||
"tslib": "^2.8.1",
|
||||
"zone.js": "~0.15.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -34,18 +36,18 @@
|
|||
"@angular/cli": "^19.1.6",
|
||||
"@angular/compiler-cli": "^19.1.5",
|
||||
"@angular/localize": "^19.1.5",
|
||||
"@schematics/angular": "^19.0.0",
|
||||
"@types/jasmine": "~5.1.0",
|
||||
"@schematics/angular": "^19.1.6",
|
||||
"@types/jasmine": "~5.1.5",
|
||||
"angular-eslint": "19.1.0",
|
||||
"eslint": "^9.13.0",
|
||||
"jasmine-core": "~5.2.0",
|
||||
"karma": "~6.4.0",
|
||||
"eslint": "^9.20.1",
|
||||
"jasmine-core": "~5.6.0",
|
||||
"karma": "~6.4.4",
|
||||
"karma-chrome-launcher": "~3.2.0",
|
||||
"karma-coverage": "~2.2.0",
|
||||
"karma-coverage": "~2.2.1",
|
||||
"karma-jasmine": "~5.1.0",
|
||||
"karma-jasmine-html-reporter": "~2.1.0",
|
||||
"typescript": "~5.5.2",
|
||||
"typescript-eslint": "8.10.0",
|
||||
"vite": "^5.4.10"
|
||||
"typescript": "~5.7.3",
|
||||
"typescript-eslint": "8.24.0",
|
||||
"vite": "^6.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@
|
|||
"addChangeValue" :"Add a value change",
|
||||
"linear" :"linear",
|
||||
"digressive" :"digressive",
|
||||
"depreciationPlan" :"Depreciatin plan"
|
||||
"depreciationPlan" :"Depreciatin plan",
|
||||
"recalculate" :"Recalculate"
|
||||
},
|
||||
"friendly_pages":{
|
||||
"bodypainter_eu":
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@
|
|||
"addChangeValue" :"Dodaj zmianę wartości",
|
||||
"linear" :"liniowa",
|
||||
"digressive" :"dygresywna",
|
||||
"depreciationPlan" :"Plan amortyzacji"
|
||||
"depreciationPlan" :"Plan amortyzacji",
|
||||
"recalculate" :"Przelicz"
|
||||
},
|
||||
"friendly_pages":{
|
||||
"bodypainter_eu":
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -23,28 +23,8 @@
|
|||
</mat-toolbar> -->
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
|
||||
<div class="me-auto col-auto">
|
||||
<a class="navbar-brand ms-2">
|
||||
<a
|
||||
class="navbar-brand ms-2"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="switchLanguage( translate.currentLang === 'pl' ? 'en' : 'pl' )"
|
||||
(keydown)="handleKeyDown($event)">
|
||||
<img
|
||||
loading="lazy"
|
||||
class="border border-dark"
|
||||
height="25"
|
||||
src= "/flag-icons-main/flags/4x3/{{ translate.currentLang === 'pl' ? 'us' : 'pl' }}.svg"
|
||||
alt="Switch language"
|
||||
>
|
||||
</a>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="container d-flex justify-content-between align-items-center">
|
||||
<a class="navbar-brand" [routerLink]="'/about-me'">{{ 'topBar.aboutMe' | translate }}</a>
|
||||
<a class="navbar-brand" [routerLink]="'/asset-calculator'">{{ 'topBar.depreciationCalculator' | translate }}</a>
|
||||
<a class="navbar-brand" [routerLink]="'/quotes'">{{ 'topBar.courses' | translate }}</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ export class AppComponent implements OnDestroy {
|
|||
console.log('Language set to:', event.lang);
|
||||
localStorage.setItem('lang', event.lang);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
<div class="container mt-5">
|
||||
<!-- Language Switcher in app.component.html -->
|
||||
<!-- Language Switcher in app.component.html -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
|
@ -11,17 +10,18 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col mx-2 mx-lg-0 mb-2 col-lg-4 frame">
|
||||
<div class="row text-center h5 "><h5>{{ 'asset-calculator.fixedAsset' | translate }}</h5></div>
|
||||
<div class="form-group row align-items-center mb-1">
|
||||
<div class="row ">
|
||||
<div class="h5 text-center">{{ 'asset-calculator.fixedAsset' | translate }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group align-items-center mb-1">
|
||||
<div class="col-5 col-lg-6 text-start">
|
||||
<label class="form-label" for="initialValueAsset" >
|
||||
<label class="form-label" for="initialValueAsset">
|
||||
{{ 'asset-calculator.initialValue' | translate }}</label>
|
||||
</div>
|
||||
<div class="col col-lg">
|
||||
<input class="form-control" [(ngModel)]="initialValueAsset"
|
||||
type="number"
|
||||
id="initialValueAsset"
|
||||
required >
|
||||
<input class="form-control" [(ngModel)]="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>
|
||||
|
|
@ -31,9 +31,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="row form-group align-items-center">
|
||||
<div class="col-5 col-lg-6 text-start ">
|
||||
<label class="form-label" for="rate" >{{ 'asset-calculator.depreciationRate' | translate }}</label>
|
||||
<label class="form-label" for="rate">{{ 'asset-calculator.depreciationRate' | translate }}</label>
|
||||
</div>
|
||||
<div class="col-3 col-lg-3">
|
||||
<input class="form-control" [(ngModel)]="rate" type="number" id="rate" />
|
||||
|
|
@ -46,7 +46,8 @@
|
|||
<div class="form-group row align-items-center ">
|
||||
|
||||
<div class="col-5 col-lg-6 text-start ">
|
||||
<label class="form-label" for="startDepreciation" >{{ 'asset-calculator.startOfDepreciation' | translate }} </label>
|
||||
<label class="form-label" for="startDepreciation">{{ 'asset-calculator.startOfDepreciation' |
|
||||
translate }} </label>
|
||||
</div>
|
||||
|
||||
<div class="col-7 col-lg-6">
|
||||
|
|
@ -54,64 +55,81 @@
|
|||
<mat-label>{{ 'asset-calculator.startOfDepreciation' | translate }}</mat-label>
|
||||
<input matInput [(ngModel)]="startDepreciation" [matDatepicker]="picker" readonly>
|
||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker startView="multi-year" (monthSelected)="onMonthSelected($event, picker)" panelClass="month-picker"></mat-datepicker>
|
||||
<mat-datepicker #picker startView="multi-year" (monthSelected)="onMonthSelected($event, picker)"
|
||||
panelClass="month-picker"></mat-datepicker>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="col-5 col-lg text-start " >
|
||||
<label class="form-label" for="typeDepreciation" >{{ 'asset-calculator.depreciationMethod' | translate }}</label>
|
||||
<div class="col-5 col-lg text-start ">
|
||||
<label class="form-label" for="typeDepreciation">{{ 'asset-calculator.depreciationMethod' |
|
||||
translate }}</label>
|
||||
</div>
|
||||
<div class="col col-lg" >
|
||||
<select class="form-select" [(ngModel)]="typeDepreciation" id="typeDepreciation" >
|
||||
<option [ngValue]=TypeDepreciation.linear selected="selected" >{{ 'asset-calculator.linear' | translate }}</option>
|
||||
<option [ngValue]=TypeDepreciation.digressive >{{ 'asset-calculator.digressive' | translate }}</option>
|
||||
<div class="col col-lg">
|
||||
<select class="form-select" [(ngModel)]="typeDepreciation" id="typeDepreciation">
|
||||
<option [ngValue]=TypeDepreciation.linear selected="selected">{{ 'asset-calculator.linear' |
|
||||
translate }}</option>
|
||||
<option [ngValue]=TypeDepreciation.digressive>{{ 'asset-calculator.digressive' | translate }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if( TypeDepreciation.digressive === typeDepreciation() ) {
|
||||
<div class="form-group row align-items-center">
|
||||
<div class="row form-group align-items-center">
|
||||
<div class="col-5 col-lg text-start ">
|
||||
<label for="factor" class="form-label">{{ 'asset-calculator.degressionCoefficients' | translate }}</label>
|
||||
<label for="factor" class="form-label">{{ 'asset-calculator.degressionCoefficients' | translate
|
||||
}}</label>
|
||||
</div>
|
||||
<div class="col col-lg" >
|
||||
<div class="col col-lg">
|
||||
<input type="text" class="form-control" [(ngModel)]="factor" id="factor" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="col-1">
|
||||
<input class="btn btn-secondary col-auto" name="addChangeValue"
|
||||
(click)=addLifeChange() type="button" value="{{ 'asset-calculator.addChangeValue' | translate }}">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<input class="btn btn-secondary " name="addChangeValue" (click)=addLifeChange()
|
||||
type="button" value="{{ 'asset-calculator.addChangeValue' | translate }}">
|
||||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<input class="btn btn-secondary " name="calculate" (click)=reCalculate() type="button"
|
||||
value="{{ 'asset-calculator.recalculate' | translate }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@if( lifeChangesSignal().length > 0 ){
|
||||
<div class="col col-lg-6 mb-2 ms-lg-3">
|
||||
<div class="row">
|
||||
<div class="h5 text-center my-1" ><h5>{{ 'asset-calculator.valueChanges' | translate }}</h5></div>
|
||||
<div class="h5 text-center my-1">
|
||||
<h5>{{ 'asset-calculator.valueChanges' | translate }}</h5>
|
||||
</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"> {{ 'asset-calculator.lp' | translate }}</th>
|
||||
<th class="col-2 text-center" scope="col-auto"> {{ 'asset-calculator.month' | translate }}</th>
|
||||
<th class="col-2 text-center" scope="col" > {{ 'asset-calculator.change' | translate }}</th>
|
||||
<th class="col-2 text-center" scope="col-auto"> {{ 'asset-calculator.month' | translate }}
|
||||
</th>
|
||||
<th class="col-2 text-center" scope="col"> {{ 'asset-calculator.change' | translate }}</th>
|
||||
<th class="col-1 text-center" scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for( life of lifeChangesSignal(); track $index ) {
|
||||
<tr >
|
||||
<tr>
|
||||
<th class="align-middle text-center col-auto" scope="row">{{$index+1}}</th>
|
||||
<td><input class="form-control" type="month" [(ngModel)]="life.when" ></td>
|
||||
<td><input class="form-control" type="number" [(ngModel)]="life.initial" placeholder="Wprowadź wartość {{$index}}"></td>
|
||||
<td><button class="btn btn-sm btn-secondary" type="button" (click)=removeLifeChange($index)>{{ 'asset-calculator.remove' | translate }}</button>
|
||||
<td><input class="form-control" type="month" [(ngModel)]="life.when"></td>
|
||||
<td><input class="form-control" type="number" [(ngModel)]="life.initial"
|
||||
placeholder="Wprowadź wartość {{$index}}"></td>
|
||||
<td><button class="btn btn-sm btn-secondary" type="button"
|
||||
(click)=removeLifeChange($index)>{{ 'asset-calculator.remove' | translate
|
||||
}}</button>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
|
@ -123,7 +141,9 @@
|
|||
</div>
|
||||
|
||||
<div class="row justify-content-center frame2 ">
|
||||
<div class="row h2 text-center" style="--bs-bg-opacity: .2;"><h2 i18n="@@depreciationPlan">{{ 'asset-calculator.depreciationPlan' | translate }}</h2></div>
|
||||
<div class="row h2 text-center" style="--bs-bg-opacity: .2;">
|
||||
<h2 i18n="@@depreciationPlan">{{ 'asset-calculator.depreciationPlan' | translate }}</h2>
|
||||
</div>
|
||||
<div class="mt-lg-3 mt-0 col justify-content-center ">
|
||||
<div class="row justify-content-center">
|
||||
<table class="table table-striped table-bordered ">
|
||||
|
|
@ -139,7 +159,7 @@
|
|||
<tbody>
|
||||
@for (position of amortizationsSignal(); track $index) {
|
||||
<tr [class]="clazz(position)" class="text-center">
|
||||
<th scope="row" >{{$index+1}}</th>
|
||||
<th scope="row">{{$index+1}}</th>
|
||||
<td>{{ position.when.year }}</td>
|
||||
<td>{{ position.when.month }}</td>
|
||||
<td>{{ position.calculatedDepreciation | number:'1.2-2' }}</td>
|
||||
|
|
@ -151,7 +171,8 @@
|
|||
</td>
|
||||
<td colspan="2">
|
||||
<div class="row justify-content-end text-center">
|
||||
<div class="frame col-auto">{{ 'asset-calculator.totalInTheYear' | translate:{ year: position.when.year, total : position.sumThisYear| number:'1.2-2' } }} </div>
|
||||
<div class="frame col-auto">{{ 'asset-calculator.totalInTheYear' | translate:{ year:
|
||||
position.when.year, total : position.sumThisYear| number:'1.2-2' } }} </div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -172,4 +193,3 @@
|
|||
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ export class AssetCalculatorComponent {
|
|||
localStorage.setItem(CACHE_KEY, JSON.stringify(positions));
|
||||
}
|
||||
|
||||
private reCalculate() {
|
||||
reCalculate() {
|
||||
this.calculateAmortizationsForAsset(this.controlsToAsset());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue