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