Moved to uv from poetry
Updated ruff and mypy, accepted all changes Central exception management and injected the Session. This removed a lot of duplicated boilerplate code. Added health check Updated to Angular 21
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
<ngx-loading-bar></ngx-loading-bar>
|
||||
<app-nav-bar></app-nav-bar>
|
||||
<div class="mat-app-background basic-container">
|
||||
<router-outlet></router-outlet>
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { LoadingBarModule } from '@ngx-loading-bar/core';
|
||||
|
||||
import { NavBarComponent } from './core/nav-bar/nav-bar.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
imports: [LoadingBarModule, NavBarComponent, RouterOutlet],
|
||||
styleUrls: ['./app.component.sass'],
|
||||
imports: [NavBarComponent, RouterOutlet],
|
||||
})
|
||||
export class AppComponent {
|
||||
title = 'app';
|
||||
|
||||
@@ -18,7 +18,6 @@ import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { provideRouter, withRouterConfig } from '@angular/router';
|
||||
|
||||
import { dateFormat } from './app.environment';
|
||||
@@ -34,7 +33,6 @@ export const appConfig: ApplicationConfig = {
|
||||
BrowserModule,
|
||||
LayoutModule,
|
||||
MatButtonModule,
|
||||
|
||||
MatDividerModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
@@ -52,7 +50,6 @@ export const appConfig: ApplicationConfig = {
|
||||
{ provide: LOCALE_ID, useValue: 'en-IN' },
|
||||
AuthService,
|
||||
provideHttpClient(withFetch(), withInterceptors([refreshInterceptor, jwtInterceptor, authInterceptor])),
|
||||
provideAnimations(),
|
||||
provideRouter(
|
||||
routes,
|
||||
withRouterConfig({
|
||||
|
||||
@@ -65,7 +65,7 @@ export class AttendanceComponent implements OnInit {
|
||||
displayedColumns = ['code', 'name', 'designation', 'department', 'status', 'prints'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
|
||||
@@ -49,7 +49,7 @@ export class BalanceSheetComponent implements OnInit {
|
||||
displayedColumns = ['group', 'name', 'subAmount', 'total'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
|
||||
@@ -47,7 +47,7 @@ export class CashFlowComponent implements OnInit {
|
||||
displayedColumns = ['name', 'amount'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -77,7 +77,7 @@ export class ClosingStockComponent implements OnInit {
|
||||
costCentres: CostCentre[];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<span class="spacer"></span>
|
||||
|
||||
<mat-menu #userMenu="matMenu">
|
||||
<a mat-menu-item (click)="logout()">Logout {{ (auth.currentUser | async)?.name }}</a>
|
||||
<button mat-menu-item (click)="logout()">Logout {{ (auth.currentUser | async)?.name }}</button>
|
||||
<a mat-menu-item routerLink="/users/me">Change Password</a>
|
||||
<a mat-menu-item routerLink="/users">Users</a>
|
||||
<a mat-menu-item routerLink="/roles">Roles</a>
|
||||
|
||||
@@ -50,7 +50,7 @@ export class DaybookComponent implements OnInit {
|
||||
displayedColumns = ['date', 'type', 'narration', 'debitText', 'debitAmount', 'creditText', 'creditAmount'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -17,10 +17,15 @@ export class DaybookService {
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
list(startDate: string | null, finishDate: string | null): Observable<Daybook> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return this.http
|
||||
.get<Daybook>(`${url}${startDateWithSlash}${finishDateWithSlash}`)
|
||||
.get<Daybook>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Daybook>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class EmployeeAttendanceComponent implements OnInit, AfterViewInit {
|
||||
employees: Observable<Employee[]>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -89,7 +89,7 @@ export class EmployeeBenefitsComponent implements OnInit, AfterViewInit {
|
||||
employees: Observable<Employee[]>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { CurrencyPipe, DecimalPipe } from '@angular/common';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { AfterViewInit, Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
@@ -20,16 +21,16 @@ import { EmployeeListDataSource } from './employee-list-datasource';
|
||||
templateUrl: './employee-list.component.html',
|
||||
styleUrls: ['./employee-list.component.css'],
|
||||
imports: [
|
||||
MatIconModule,
|
||||
RouterModule,
|
||||
ReactiveFormsModule,
|
||||
CommonModule,
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatTableModule,
|
||||
MatSortModule,
|
||||
MatPaginatorModule,
|
||||
DecimalPipe,
|
||||
CurrencyPipe,
|
||||
MatSortModule,
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
RouterModule,
|
||||
],
|
||||
})
|
||||
export class EmployeeListComponent implements OnInit, AfterViewInit {
|
||||
|
||||
@@ -61,7 +61,7 @@ export class EntriesComponent implements OnInit {
|
||||
issue = false;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -69,7 +69,7 @@ export class IncentiveComponent implements OnInit {
|
||||
displayedColumns = ['name', 'designation', 'department', 'daysWorked', 'points', 'amount'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
|
||||
@@ -73,14 +73,14 @@ export class IssueComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('dateElement', { static: true }) dateElement!: ElementRef<HTMLInputElement>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.s', ['$event'])
|
||||
saveListner(event: KeyboardEvent) {
|
||||
saveListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.canSave()) {
|
||||
this.save();
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<div class="row-container">
|
||||
@for (item of voucher.files; track item) {
|
||||
<div class="img-container" class="flex-auto basis-1-5">
|
||||
<img [src]="item.thumbnail" (click)="zoomImage(item)" />
|
||||
<img [src]="item.thumbnail" alt="img" (click)="zoomImage(item)" (keyup.enter)="zoomImage(item)" tabindex="0" />
|
||||
<button mat-icon-button class="overlay" (click)="deleteImage(item)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
@@ -138,6 +138,7 @@
|
||||
<div class="img-container" class="flex flex-auto basis-1-5">
|
||||
<label ng-href for="fileUp">
|
||||
<img
|
||||
alt="add"
|
||||
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTUwIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjE1MCIgZmlsbD0iI2VlZSIvPjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHg9IjUwIiB5PSI3NSIgc3R5bGU9ImZpbGw6I2FhYTtmb250LXdlaWdodDpib2xkO2ZvbnQtc2l6ZToxMDBweDtmb250LWZhbWlseTpBcmlhbCxIZWx2ZXRpY2Esc2Fucy1zZXJpZjtkb21pbmFudC1iYXNlbGluZTpjZW50cmFsIj4rPC90ZXh0Pjwvc3ZnPg=="
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -91,14 +91,14 @@ export class JournalComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('tagInput') tagInput?: ElementRef<HTMLInputElement>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f5', ['$event'])
|
||||
redirectToPayment(event: KeyboardEvent) {
|
||||
redirectToPayment(event: Event) {
|
||||
event.preventDefault();
|
||||
this.router.navigate(['payment'], {
|
||||
queryParams: {
|
||||
@@ -109,7 +109,7 @@ export class JournalComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f6', ['$event'])
|
||||
redirectToReciept(event: KeyboardEvent) {
|
||||
redirectToReciept(event: Event) {
|
||||
event.preventDefault();
|
||||
this.router.navigate(['receipt'], {
|
||||
queryParams: {
|
||||
@@ -120,12 +120,12 @@ export class JournalComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f7', ['$event'])
|
||||
redirectToJournal(event: KeyboardEvent) {
|
||||
redirectToJournal(event: Event) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.s', ['$event'])
|
||||
saveListner(event: KeyboardEvent) {
|
||||
saveListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.canSave()) {
|
||||
this.save();
|
||||
@@ -133,7 +133,7 @@ export class JournalComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.p', ['$event'])
|
||||
postListner(event: KeyboardEvent) {
|
||||
postListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.voucher.id && !this.voucher.posted && this.auth.allowed('post-vouchers')) {
|
||||
this.post();
|
||||
|
||||
@@ -103,7 +103,7 @@ export class LedgerComponent implements OnInit, AfterViewInit {
|
||||
accounts: Observable<Account[]>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -51,7 +51,7 @@ export class NetTransactionsComponent implements OnInit {
|
||||
displayedColumns = ['type', 'name', 'debit', 'credit'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -17,10 +17,15 @@ export class NetTransactionsService {
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
list(startDate: string | null, finishDate: string | null): Observable<NetTransactions> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return this.http
|
||||
.get<NetTransactions>(`${url}${startDateWithSlash}${finishDateWithSlash}`)
|
||||
.get<NetTransactions>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<NetTransactions>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<div class="row-container">
|
||||
@for (item of voucher.files; track item) {
|
||||
<div class="img-container" class="flex-auto basis-1-5">
|
||||
<img [src]="item.thumbnail" (click)="zoomImage(item)" />
|
||||
<img [src]="item.thumbnail" alt="img" (click)="zoomImage(item)" (keyup.enter)="zoomImage(item)" tabindex="0" />
|
||||
<button mat-icon-button class="overlay" (click)="deleteImage(item)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
@@ -141,6 +141,7 @@
|
||||
<div class="img-container" class="flex flex-auto basis-1-5">
|
||||
<label ng-href for="fileUp">
|
||||
<img
|
||||
alt="add"
|
||||
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTUwIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjE1MCIgZmlsbD0iI2VlZSIvPjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHg9IjUwIiB5PSI3NSIgc3R5bGU9ImZpbGw6I2FhYTtmb250LXdlaWdodDpib2xkO2ZvbnQtc2l6ZToxMDBweDtmb250LWZhbWlseTpBcmlhbCxIZWx2ZXRpY2Esc2Fucy1zZXJpZjtkb21pbmFudC1iYXNlbGluZTpjZW50cmFsIj4rPC90ZXh0Pjwvc3ZnPg=="
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -91,19 +91,19 @@ export class PaymentComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('tagInput') tagInput?: ElementRef<HTMLInputElement>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f5', ['$event'])
|
||||
redirectToPayment(event: KeyboardEvent) {
|
||||
redirectToPayment(event: Event) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f6', ['$event'])
|
||||
redirectToReciept(event: KeyboardEvent) {
|
||||
redirectToReciept(event: Event) {
|
||||
event.preventDefault();
|
||||
this.router.navigate(['receipt'], {
|
||||
queryParams: {
|
||||
@@ -115,7 +115,7 @@ export class PaymentComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f7', ['$event'])
|
||||
redirectToJournal(event: KeyboardEvent) {
|
||||
redirectToJournal(event: Event) {
|
||||
event.preventDefault();
|
||||
this.router.navigate(['journal'], {
|
||||
queryParams: {
|
||||
@@ -127,7 +127,7 @@ export class PaymentComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.s', ['$event'])
|
||||
saveListner(event: KeyboardEvent) {
|
||||
saveListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.canSave()) {
|
||||
this.save();
|
||||
@@ -135,7 +135,7 @@ export class PaymentComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.p', ['$event'])
|
||||
postListner(event: KeyboardEvent) {
|
||||
postListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.voucher.id && !this.voucher.posted && this.auth.allowed('post-vouchers')) {
|
||||
this.post();
|
||||
|
||||
@@ -35,7 +35,7 @@ export class PeriodDetailComponent implements OnInit {
|
||||
item: Period = new Period();
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -89,7 +89,7 @@ export class ProductLedgerComponent implements OnInit, AfterViewInit {
|
||||
products: Observable<ProductSku[]>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -49,7 +49,7 @@ export class ProfitLossComponent implements OnInit {
|
||||
displayedColumns = ['group', 'name', 'amount', 'total'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -17,10 +17,15 @@ export class ProfitLossService {
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
list(startDate: string | null, finishDate: string | null): Observable<ProfitLoss> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return this.http
|
||||
.get<ProfitLoss>(`${url}${startDateWithSlash}${finishDateWithSlash}`)
|
||||
.get<ProfitLoss>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<ProfitLoss>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export class PurchaseEntriesComponent implements OnInit {
|
||||
displayedColumns = ['date', 'supplier', 'product', 'quantity', 'rate', 'tax', 'discount', 'amount'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -17,10 +17,15 @@ export class PurchaseEntriesService {
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
list(startDate: string | null, finishDate: string | null): Observable<PurchaseEntries> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return this.http
|
||||
.get<PurchaseEntries>(`${url}${startDateWithSlash}${finishDateWithSlash}`)
|
||||
.get<PurchaseEntries>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<PurchaseEntries>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
<div class="row-container">
|
||||
@for (item of voucher.files; track item) {
|
||||
<div class="img-container" class="flex-auto basis-1-5">
|
||||
<img [src]="item.thumbnail" (click)="zoomImage(item)" />
|
||||
<img [src]="item.thumbnail" alt="img" (click)="zoomImage(item)" (keyup.enter)="zoomImage(item)" tabindex="0" />
|
||||
<button mat-icon-button class="overlay" (click)="deleteImage(item)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
@@ -169,6 +169,7 @@
|
||||
<div class="img-container" class="flex flex-auto basis-1-5">
|
||||
<label ng-href for="fileUp">
|
||||
<img
|
||||
alt="add"
|
||||
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTUwIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjE1MCIgZmlsbD0iI2VlZSIvPjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHg9IjUwIiB5PSI3NSIgc3R5bGU9ImZpbGw6I2FhYTtmb250LXdlaWdodDpib2xkO2ZvbnQtc2l6ZToxMDBweDtmb250LWZhbWlseTpBcmlhbCxIZWx2ZXRpY2Esc2Fucy1zZXJpZjtkb21pbmFudC1iYXNlbGluZTpjZW50cmFsIj4rPC90ZXh0Pjwvc3ZnPg=="
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -85,14 +85,14 @@ export class PurchaseReturnComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('tagInput') tagInput?: ElementRef<HTMLInputElement>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.s', ['$event'])
|
||||
saveListner(event: KeyboardEvent) {
|
||||
saveListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.canSave()) {
|
||||
this.save();
|
||||
@@ -100,7 +100,7 @@ export class PurchaseReturnComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.p', ['$event'])
|
||||
postListner(event: KeyboardEvent) {
|
||||
postListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.voucher.id && !this.voucher.posted && this.auth.allowed('post-vouchers')) {
|
||||
this.post();
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
<div class="row-container">
|
||||
@for (item of voucher.files; track item) {
|
||||
<div class="img-container" class="flex-auto basis-1-5">
|
||||
<img [src]="item.thumbnail" (click)="zoomImage(item)" />
|
||||
<img [src]="item.thumbnail" alt="img" (click)="zoomImage(item)" (keyup.enter)="zoomImage(item)" tabindex="0" />
|
||||
<button mat-icon-button class="overlay" (click)="deleteImage(item)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
@@ -188,6 +188,7 @@
|
||||
<div class="img-container" class="flex flex-auto basis-1-5">
|
||||
<label ng-href for="fileUp">
|
||||
<img
|
||||
alt="add"
|
||||
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTUwIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjE1MCIgZmlsbD0iI2VlZSIvPjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHg9IjUwIiB5PSI3NSIgc3R5bGU9ImZpbGw6I2FhYTtmb250LXdlaWdodDpib2xkO2ZvbnQtc2l6ZToxMDBweDtmb250LWZhbWlseTpBcmlhbCxIZWx2ZXRpY2Esc2Fucy1zZXJpZjtkb21pbmFudC1iYXNlbGluZTpjZW50cmFsIj4rPC90ZXh0Pjwvc3ZnPg=="
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -87,14 +87,14 @@ export class PurchaseComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('tagInput') tagInput?: ElementRef<HTMLInputElement>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.s', ['$event'])
|
||||
saveListner(event: KeyboardEvent) {
|
||||
saveListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.canSave()) {
|
||||
this.save();
|
||||
@@ -102,7 +102,7 @@ export class PurchaseComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.p', ['$event'])
|
||||
postListner(event: KeyboardEvent) {
|
||||
postListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.voucher.id && !this.voucher.posted && this.auth.allowed('post-vouchers')) {
|
||||
this.post();
|
||||
|
||||
@@ -52,7 +52,7 @@ export class PurchasesComponent implements OnInit {
|
||||
displayedColumns = ['product', 'quantity', 'rate', 'amount'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -17,10 +17,15 @@ export class PurchasesService {
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
list(startDate: string | null, finishDate: string | null): Observable<Purchases> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return this.http
|
||||
.get<Purchases>(`${url}${startDateWithSlash}${finishDateWithSlash}`)
|
||||
.get<Purchases>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Purchases>;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ export class RateContractDetailComponent implements OnInit, AfterViewInit {
|
||||
products: Observable<ProductSku[]>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
|
||||
@@ -63,7 +63,7 @@ export class RawMaterialCostComponent implements OnInit {
|
||||
columnsId = ['name', 'group', 'quantity', 'net', 'gross'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<div class="row-container">
|
||||
@for (item of voucher.files; track item) {
|
||||
<div class="img-container" class="flex-auto basis-1-5">
|
||||
<img [src]="item.thumbnail" (click)="zoomImage(item)" />
|
||||
<img [src]="item.thumbnail" alt="img" (click)="zoomImage(item)" (keyup.enter)="zoomImage(item)" tabindex="0" />
|
||||
<button mat-icon-button class="overlay" (click)="deleteImage(item)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
@@ -141,6 +141,7 @@
|
||||
<div class="img-container" class="flex flex-auto basis-1-5">
|
||||
<label ng-href for="fileUp">
|
||||
<img
|
||||
alt="add"
|
||||
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTUwIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjE1MCIgZmlsbD0iI2VlZSIvPjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHg9IjUwIiB5PSI3NSIgc3R5bGU9ImZpbGw6I2FhYTtmb250LXdlaWdodDpib2xkO2ZvbnQtc2l6ZToxMDBweDtmb250LWZhbWlseTpBcmlhbCxIZWx2ZXRpY2Esc2Fucy1zZXJpZjtkb21pbmFudC1iYXNlbGluZTpjZW50cmFsIj4rPC90ZXh0Pjwvc3ZnPg=="
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -91,14 +91,14 @@ export class ReceiptComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('tagInput') tagInput?: ElementRef<HTMLInputElement>;
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f5', ['$event'])
|
||||
redirectToPayment(event: KeyboardEvent) {
|
||||
redirectToPayment(event: Event) {
|
||||
event.preventDefault();
|
||||
this.router.navigate(['payment'], {
|
||||
queryParams: {
|
||||
@@ -110,12 +110,12 @@ export class ReceiptComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f6', ['$event'])
|
||||
redirectToReciept(event: KeyboardEvent) {
|
||||
redirectToReciept(event: Event) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.f7', ['$event'])
|
||||
redirectToJournal(event: KeyboardEvent) {
|
||||
redirectToJournal(event: Event) {
|
||||
event.preventDefault();
|
||||
this.router.navigate(['journal'], {
|
||||
queryParams: {
|
||||
@@ -127,7 +127,7 @@ export class ReceiptComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.s', ['$event'])
|
||||
saveListner(event: KeyboardEvent) {
|
||||
saveListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.canSave()) {
|
||||
this.save();
|
||||
@@ -135,7 +135,7 @@ export class ReceiptComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.p', ['$event'])
|
||||
postListner(event: KeyboardEvent) {
|
||||
postListner(event: Event) {
|
||||
event.preventDefault();
|
||||
if (this.voucher.id && !this.voucher.posted && this.auth.allowed('post-vouchers')) {
|
||||
this.post();
|
||||
|
||||
@@ -16,10 +16,10 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import moment from 'moment';
|
||||
import { BehaviorSubject, Observable, of as observableOf } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators';
|
||||
import { Period } from 'src/app/period/period';
|
||||
|
||||
import { Product } from '../../core/product';
|
||||
import { ProductSku } from '../../core/product-sku';
|
||||
import { Period } from '../../period/period';
|
||||
import { ProductService } from '../../product/product.service';
|
||||
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { MathService } from '../../shared/math.service';
|
||||
|
||||
@@ -11,9 +11,9 @@ import { MatSort, MatSortModule } from '@angular/material/sort';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { Period } from 'src/app/period/period';
|
||||
|
||||
import { ProductGroup } from '../../core/product-group';
|
||||
import { Period } from '../../period/period';
|
||||
import { Recipe } from '../recipe';
|
||||
import { RecipeListDatasource } from './recipe-list-datasource';
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<img [src]="data" (click)="close()" />
|
||||
<img [src]="data" alt="image" (click)="close()" (keyup.enter)="close()" (keyup.space)="close()" tabindex="0" />
|
||||
|
||||
@@ -50,7 +50,7 @@ export class StockMovementComponent implements OnInit {
|
||||
displayedColumns = ['group', 'name', 'opening', 'purchase', 'issue', 'closing'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -17,10 +17,15 @@ export class StockMovementService {
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
list(startDate: string | null, finishDate: string | null): Observable<StockMovement> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWishSlash = finishDate ? `/${finishDate}` : '';
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return this.http
|
||||
.get<StockMovement>(`${url}${startDateWithSlash}${finishDateWishSlash}`)
|
||||
.get<StockMovement>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<StockMovement>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ConfirmDialogComponent } from 'src/app/shared/confirm-dialog/confirm-dialog.component';
|
||||
|
||||
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { Tag } from '../tag';
|
||||
import { TagService } from '../tag.service';
|
||||
|
||||
|
||||
@@ -49,8 +49,9 @@ export class TrialBalanceComponent implements OnInit {
|
||||
displayedColumns = ['type', 'name', 'debit', 'credit'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.dateElement.nativeElement.focus();
|
||||
this.dateElement.nativeElement.select();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user