Changing from job-finder to MT
This commit is contained in:
parent
a396b0eeb4
commit
52e73d2ff1
|
|
@ -1,14 +1,11 @@
|
|||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
|
||||
| <a class="navbar-brand" href="/about-me">O mnie</a>
|
||||
| <a class="navbar-brand" href="/quotes">Kursy</a>
|
||||
| <a class="navbar-brand" href="/asset-calculator">Kalkulator</a>
|
||||
<a class="navbar-brand" href="/jobfinder">Oferty</a>
|
||||
|
||||
<div class="container">
|
||||
| <a class="navbar-brand" href="/about-me">O mnie</a>
|
||||
| <a class="navbar-brand" href="/asset-calculator">Kalkulator amortyzacyjny</a>
|
||||
| <a class="navbar-brand" href="/fixed-asset">Środki trwałe</a>
|
||||
| <a class="navbar-brand" href="/quotes">Kursy</a>
|
||||
<!-- <a class="navbar-brand" href="/jobfinder">Oferty</a> -->
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
</div>
|
||||
|
||||
|
||||
<router-outlet />
|
||||
`
|
||||
|
|
@ -3,22 +3,40 @@ import { DashboardComponent } from './components/dashboard/dashboard.component';
|
|||
import { AssetCalculatorComponent } from './asset-calculator/asset-calculator.component';
|
||||
import { AboutMeComponent } from './about-me/about-me.component';
|
||||
import { ChatGPTComponent } from './chat-gpt/chat-gpt.component';
|
||||
import {JobfinderComponent } from './jobfinder/jobfinder.component'
|
||||
import {JobfinderComponent } from './jobfinder/jobfinder.component';
|
||||
import { FixedAssetComponent } from './fixed-asset/fixed-asset.component';
|
||||
|
||||
|
||||
export const routes: Routes = [
|
||||
{ path: "",
|
||||
title: "Wyszukiwacz pracy",
|
||||
component:AssetCalculatorComponent },
|
||||
{ path: "about-me",
|
||||
{
|
||||
path: "",
|
||||
title: "Środki trwałe",
|
||||
component:FixedAssetComponent
|
||||
},
|
||||
{
|
||||
path: "about-me",
|
||||
title:"O mnie",
|
||||
component: AboutMeComponent },
|
||||
{ path: "asset-calculator",
|
||||
component: AboutMeComponent
|
||||
},
|
||||
{
|
||||
path: "asset-calculator",
|
||||
title: "Kalkulator amortyzacyjny",
|
||||
component:AssetCalculatorComponent },
|
||||
{ path: "quotes",
|
||||
component:AssetCalculatorComponent
|
||||
},
|
||||
{
|
||||
path: "quotes",
|
||||
title:"Kursy podstawowych walut i złota",
|
||||
component: DashboardComponent },
|
||||
{ path: "jobfinder",
|
||||
title:"Wyszukiwacz pracy i serwis do jej rejestracji",
|
||||
component: JobfinderComponent }
|
||||
];
|
||||
component: DashboardComponent
|
||||
},
|
||||
{
|
||||
path: "jobfinder",
|
||||
title:"Wyszukiwacz pracy i serwis do jej rejestracji",
|
||||
component: JobfinderComponent
|
||||
},
|
||||
{
|
||||
path: "fixed-asset",
|
||||
title:"Środki trwałe",
|
||||
component: FixedAssetComponent
|
||||
}
|
||||
]
|
||||
;
|
||||
|
|
|
|||
|
|
@ -83,10 +83,10 @@
|
|||
|
||||
</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 ">
|
||||
</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 ">
|
||||
</div>
|
||||
@if( lifeFormArray.controls.length > 0 ){
|
||||
<div>
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
import {Component, effect, computed, OnInit, signal } from '@angular/core';
|
||||
import {ReactiveFormsModule, FormGroup, Validators, FormControl, FormArray} from '@angular/forms';
|
||||
import {CurrencyPipe,DecimalPipe,PercentPipe, NgFor} from '@angular/common';
|
||||
import {AssetsModule} from './assets/assets.module'
|
||||
|
||||
|
||||
import {Asset, Positions, AssetPlanPosition, TypeDepreciation, YearMonth, AssetLifeChange } from './assets/asset';
|
||||
import {AssetService} from './assets/service/asset.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-asset-calculator',
|
||||
standalone: true,
|
||||
imports: [ CurrencyPipe, DecimalPipe, PercentPipe, AssetsModule, ReactiveFormsModule, NgFor ] ,
|
||||
imports: [ CurrencyPipe, DecimalPipe, PercentPipe, ReactiveFormsModule, NgFor ] ,
|
||||
templateUrl: "asset-calculator.component.html",
|
||||
styleUrl: 'asset-calculator.component.css'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ export class AssetLifeChange{
|
|||
}
|
||||
|
||||
|
||||
|
||||
export class Asset {
|
||||
|
||||
start : YearMonth ;
|
||||
depreciationRate : number ;
|
||||
type : TypeDepreciation;
|
||||
|
|
@ -47,8 +49,8 @@ export class Asset {
|
|||
}
|
||||
|
||||
constructor( depreciationRate : number,
|
||||
start : YearMonth,
|
||||
type : TypeDepreciation,
|
||||
start : YearMonth,
|
||||
type : TypeDepreciation,
|
||||
factorValue : number ){
|
||||
this.depreciationRate = depreciationRate;
|
||||
this.start = start;
|
||||
|
|
@ -58,6 +60,40 @@ export class Asset {
|
|||
|
||||
}
|
||||
|
||||
export class AssetsContainer{
|
||||
|
||||
assets: Map<string,Asset> = new Map();
|
||||
|
||||
constructor(){
|
||||
this.initDefault();
|
||||
}
|
||||
|
||||
initDefault(){
|
||||
const yearMonth = new YearMonth('2024-11');
|
||||
this.assets.set('Inv01', new Asset( 1000, yearMonth, TypeDepreciation.linear, 20 ) );
|
||||
this.assets.set('Inv02', new Asset( 3000, yearMonth, TypeDepreciation.linear, 20 ) );
|
||||
this.assets.set('Inv03', new Asset( 5000, yearMonth, TypeDepreciation.linear, 15 ) );
|
||||
|
||||
}
|
||||
|
||||
delete( nrInv: string ){
|
||||
this.assets.delete(nrInv);
|
||||
}
|
||||
|
||||
put( invNumber:string, asset: Asset ){
|
||||
this.assets.set( invNumber, asset );
|
||||
}
|
||||
|
||||
get( invNumber:string ){
|
||||
return this.assets.get( invNumber );
|
||||
}
|
||||
|
||||
getNrAssets( ){
|
||||
return Array.from( this.assets.entries() );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export class AssetPlanPosition{
|
||||
when : YearMonth = new YearMonth('0-0');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
<div class="container">
|
||||
|
||||
<h2>Lista środków trwałych</h2>
|
||||
|
||||
<table id="assets" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-2">Numer inwentarzowy</th>
|
||||
<th class="col-2">KŚT</th>
|
||||
<th class="col-2">Zmiany wartości</th>
|
||||
<th class="col-2">Metoda amortyzacji</th>
|
||||
<th class="col-2">Plan</th>
|
||||
<th class="col-2" ></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<div class="row">
|
||||
|
||||
<td class="col-2"><a href="/assets/Inv1/edit">Inv1</a></td>
|
||||
<td class="col-2" >001</td>
|
||||
<td class="col-2">
|
||||
<a href="/assets/Inv1/life-browsing"><b>1</b> zmian</a></td>
|
||||
<td class="col-2">
|
||||
<a href="/assets/Inv1/methods-browsing"><b>1</b> metod</a></td>
|
||||
|
||||
<td class="col-2"><a href="/assets/Inv1/plan-calculate"><b>Wylicz plan</b></a></td>
|
||||
<td class="col-2"><a type="button" class="btn btn-outline-secondary"
|
||||
href="/assets/Inv1/remove">Usuń Składnik</a></td>
|
||||
|
||||
</div>
|
||||
</tr>
|
||||
<tr>
|
||||
<div class="row">
|
||||
|
||||
<td class="col-2"><a href="/assets/Inv2/edit">Inv2</a></td>
|
||||
<td class="col-2" >002</td>
|
||||
<td class="col-2">
|
||||
<a href="/assets/Inv2/life-browsing"><b>2</b> zmian</a></td>
|
||||
<td class="col-2">
|
||||
<a href="/assets/Inv2/methods-browsing"><b>1</b> metod</a></td>
|
||||
|
||||
<td class="col-2"><a href="/assets/Inv2/plan-calculate"><b>Wylicz plan</b></a></td>
|
||||
<td class="col-2"><a type="button" class="btn btn-outline-secondary"
|
||||
href="/assets/Inv2/remove">Usuń Składnik</a></td>
|
||||
|
||||
</div>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a type="button" class="btn btn-outline-secondary" href="/assets/new">Dodaj środek trwały</a>
|
||||
<a type="button" class="btn btn-outline-secondary" href="/assets/init-default">Zainicjuj domyślną listę</a>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FixedAssetComponent } from './fixed-asset.component';
|
||||
|
||||
describe('FixedAssetComponent', () => {
|
||||
let component: FixedAssetComponent;
|
||||
let fixture: ComponentFixture<FixedAssetComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [FixedAssetComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(FixedAssetComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { AssetsContainer, Asset } from '../asset-calculator/assets/asset';
|
||||
|
||||
@Component({
|
||||
selector: 'app-fixed-asset',
|
||||
standalone: true,
|
||||
imports: [],
|
||||
template:`
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h2 class="text-center m-2">Lista środków trwałych( w toku )</h2>
|
||||
<div class="table-responsive">
|
||||
<table id="assets" class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-2">Numer inwentarzowy</th>
|
||||
<th class="col-2">Zmiany wartości</th>
|
||||
<th class="col-2">Metoda amortyzacji</th>
|
||||
<th class="col-2">Plan</th>
|
||||
<th class="col-2" ></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for( asset of assetsContainer.getNrAssets(); track asset[0] ) {
|
||||
<tr>
|
||||
<td class="col-2"> {{asset[0]}} </td>
|
||||
<td class="col-2">
|
||||
<a href="/assets/Inv1/life-browsing"><b>1</b> zmian</a></td>
|
||||
<td class="col-2">
|
||||
<a href="/assets/Inv1/methods-browsing"><b>1</b> metod</a></td>
|
||||
|
||||
<td class="col-2"><a href="/assets/Inv1/plan-calculate"><b>Wylicz plan</b></a></td>
|
||||
<td class="col-2">
|
||||
<input type="button" class="btn btn-outline-secondary" (click)="delete(asset[0])" value="Usuń Składnik">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<input type="button" (click)=initDefault() class="btn btn-outline-secondary" value="Zainicjuj domyślną listę">
|
||||
</div>
|
||||
`,
|
||||
styleUrl: './fixed-asset.component.css'
|
||||
})
|
||||
export class FixedAssetComponent {
|
||||
assetsContainer : AssetsContainer;
|
||||
|
||||
|
||||
constructor(){
|
||||
this.assetsContainer = new AssetsContainer ();
|
||||
|
||||
}
|
||||
initDefault(){
|
||||
this.assetsContainer.initDefault();
|
||||
}
|
||||
|
||||
delete( nrInv : string){
|
||||
this.assetsContainer.delete( nrInv );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { ReactiveFormsModule, FormsModule, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { ReactiveFormsModule, FormBuilder, FormGroup } from '@angular/forms';
|
||||
@Component({
|
||||
selector: 'app-jobfinder',
|
||||
standalone: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue