diff --git a/src/app/accounting/closing-entries/create-closure/create-closure.component.ts b/src/app/accounting/closing-entries/create-closure/create-closure.component.ts index 70496bd8d..3460513fb 100644 --- a/src/app/accounting/closing-entries/create-closure/create-closure.component.ts +++ b/src/app/accounting/closing-entries/create-closure/create-closure.component.ts @@ -35,11 +35,11 @@ export class CreateClosureComponent implements OnInit { * @param {Router} router Router for navigation. */ constructor(private formBuilder: FormBuilder, - private accountingService: AccountingService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + private accountingService: AccountingService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router) { this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); @@ -74,7 +74,7 @@ export class CreateClosureComponent implements OnInit { accountingClosure.locale = this.settingsService.language.code; accountingClosure.dateFormat = this.settingsService.dateFormat; if (accountingClosure.closingDate) { - accountingClosure.closingDate = this.dateUtils.getDate(accountingClosure.closingDate); + accountingClosure.closingDate = this.dateUtils.formatDate(accountingClosure.closingDate, this.settingsService.dateFormat); } this.accountingService.createAccountingClosure(accountingClosure).subscribe((response: any) => { this.router.navigate(['../view', response.resourceId], { relativeTo: this.route }); diff --git a/src/app/accounting/create-journal-entry/create-journal-entry.component.ts b/src/app/accounting/create-journal-entry/create-journal-entry.component.ts index be0a92792..34b0f2ce4 100644 --- a/src/app/accounting/create-journal-entry/create-journal-entry.component.ts +++ b/src/app/accounting/create-journal-entry/create-journal-entry.component.ts @@ -41,22 +41,22 @@ export class CreateJournalEntryComponent implements OnInit { * @param {Router} router Router for navigation. */ constructor(private formBuilder: FormBuilder, - private accountingService: AccountingService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + private accountingService: AccountingService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router) { this.route.data.subscribe((data: { - offices: any, - currencies: any, - paymentTypes: any, - glAccounts: any - }) => { - this.officeData = data.offices; - this.currencyData = data.currencies.selectedCurrencyOptions; - this.paymentTypeData = data.paymentTypes; - this.glAccountData = data.glAccounts; - }); + offices: any, + currencies: any, + paymentTypes: any, + glAccounts: any + }) => { + this.officeData = data.offices; + this.currencyData = data.currencies.selectedCurrencyOptions; + this.paymentTypeData = data.paymentTypes; + this.glAccountData = data.glAccounts; + }); } /** @@ -142,7 +142,7 @@ export class CreateJournalEntryComponent implements OnInit { journalEntry.locale = this.settingsService.language.code; journalEntry.dateFormat = this.settingsService.dateFormat; if (journalEntry.transactionDate) { - journalEntry.transactionDate = this.dateUtils.getDate(journalEntry.transactionDate); + journalEntry.transactionDate = this.dateUtils.formatDate(journalEntry.transactionDate, this.settingsService.dateFormat); } this.accountingService.createJournalEntry(journalEntry).subscribe(response => { this.router.navigate(['../transactions/view', response.transactionId], { relativeTo: this.route }); diff --git a/src/app/accounting/frequent-postings/frequent-postings.component.ts b/src/app/accounting/frequent-postings/frequent-postings.component.ts index 087f1870c..dd0f8c696 100644 --- a/src/app/accounting/frequent-postings/frequent-postings.component.ts +++ b/src/app/accounting/frequent-postings/frequent-postings.component.ts @@ -173,7 +173,7 @@ export class FrequentPostingsComponent implements OnInit { journalEntry.locale = this.settingsService.language.code; journalEntry.dateFormat = this.settingsService.dateFormat; if (journalEntry.transactionDate instanceof Date) { - journalEntry.transactionDate = this.dateUtils.getDate(journalEntry.transactionDate); + journalEntry.transactionDate = this.dateUtils.formatDate(journalEntry.transactionDate, this.settingsService.dateFormat); } this.accountingService.createJournalEntry(journalEntry).subscribe(response => { this.router.navigate(['../transactions/view', response.transactionId], { relativeTo: this.route }); diff --git a/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts b/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts index 043aed38a..b63b660a6 100644 --- a/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts +++ b/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts @@ -46,18 +46,18 @@ export class MigrateOpeningBalancesComponent implements OnInit { * @param {Router} router Router for navigation. */ constructor(private formBuilder: FormBuilder, - private accountingService: AccountingService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + private accountingService: AccountingService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router) { this.route.data.subscribe((data: { - offices: any, - currencies: any - }) => { - this.officeData = data.offices; - this.currencyData = data.currencies.selectedCurrencyOptions; - }); + offices: any, + currencies: any + }) => { + this.officeData = data.offices; + this.currencyData = data.currencies.selectedCurrencyOptions; + }); } /** @@ -111,13 +111,13 @@ export class MigrateOpeningBalancesComponent implements OnInit { openingBalancesData.glAccounts = openingBalancesData.assetAccountOpeningBalances .concat(openingBalancesData.liabityAccountOpeningBalances, - openingBalancesData.equityAccountOpeningBalances, - openingBalancesData.incomeAccountOpeningBalances, - openingBalancesData.expenseAccountOpeningBalances); + openingBalancesData.equityAccountOpeningBalances, + openingBalancesData.incomeAccountOpeningBalances, + openingBalancesData.expenseAccountOpeningBalances); openingBalancesData.glAccounts.forEach((glAccount: any) => { - entry.push(this.createGLAccountEntryForm(glAccount)); - }); + entry.push(this.createGLAccountEntryForm(glAccount)); + }); this.openingBalancesData = openingBalancesData; @@ -142,7 +142,7 @@ export class MigrateOpeningBalancesComponent implements OnInit { openingBalances.locale = this.settingsService.language.code; openingBalances.dateFormat = this.settingsService.dateFormat; if (openingBalances.transactionDate instanceof Date) { - openingBalances.transactionDate = this.dateUtils.getDate(openingBalances.transactionDate); + openingBalances.transactionDate = this.dateUtils.formatDate(openingBalances.transactionDate, this.settingsService.dateFormat); } openingBalances.debits = []; openingBalances.credits = []; diff --git a/src/app/accounting/periodic-accruals/periodic-accruals.component.ts b/src/app/accounting/periodic-accruals/periodic-accruals.component.ts index 4c341138c..c3eb4ead9 100644 --- a/src/app/accounting/periodic-accruals/periodic-accruals.component.ts +++ b/src/app/accounting/periodic-accruals/periodic-accruals.component.ts @@ -32,11 +32,11 @@ export class PeriodicAccrualsComponent implements OnInit { * @param {Router} router Router for navigation. */ constructor(private formBuilder: FormBuilder, - private accountingService: AccountingService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { } + private accountingService: AccountingService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router) { } /** * Creates periodic accruals form. @@ -65,7 +65,7 @@ export class PeriodicAccrualsComponent implements OnInit { periodicAccruals.locale = this.settingsService.language.code; periodicAccruals.dateFormat = this.settingsService.dateFormat; if (periodicAccruals.tillDate instanceof Date) { - periodicAccruals.tillDate = this.dateUtils.getDate(periodicAccruals.tillDate); + periodicAccruals.tillDate = this.dateUtils.formatDate(periodicAccruals.tillDate, this.settingsService.dateFormat); } this.accountingService.executePeriodicAccruals(periodicAccruals).subscribe(() => { this.router.navigate(['../'], { relativeTo: this.route }); diff --git a/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts b/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts index a8f1ddc84..c0954585d 100644 --- a/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts +++ b/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts @@ -32,11 +32,11 @@ export class CreateProvisioningEntryComponent implements OnInit { * @param {Router} router Router for navigation. */ constructor(private formBuilder: FormBuilder, - private accountingService: AccountingService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { } + private accountingService: AccountingService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router) { } /** * Creates the provisioning entry form. @@ -66,7 +66,7 @@ export class CreateProvisioningEntryComponent implements OnInit { provisioningEntry.locale = this.settingsService.language.code; provisioningEntry.dateFormat = this.settingsService.dateFormat; if (provisioningEntry.date instanceof Date) { - provisioningEntry.date = this.dateUtils.getDate(provisioningEntry.date); + provisioningEntry.date = this.dateUtils.formatDate(provisioningEntry.date, this.settingsService.dateFormat); } this.accountingService.createProvisioningEntry(provisioningEntry) .subscribe((response: any) => { diff --git a/src/app/accounting/search-journal-entry/search-journal-entry.component.html b/src/app/accounting/search-journal-entry/search-journal-entry.component.html index f5be252a2..4e60b5b20 100644 --- a/src/app/accounting/search-journal-entry/search-journal-entry.component.html +++ b/src/app/accounting/search-journal-entry/search-journal-entry.component.html @@ -38,6 +38,20 @@ + + Submitted on Date From + + + + + + + Submitted on Date To + + + + + @@ -89,6 +103,11 @@ {{ journalEntry.createdByUserName }} + + Submitted on date + {{ journalEntry.submittedOnDate }} + + Account Code {{ journalEntry.glAccountCode }} diff --git a/src/app/accounting/search-journal-entry/search-journal-entry.component.ts b/src/app/accounting/search-journal-entry/search-journal-entry.component.ts index 61be9b542..bbc03fd88 100644 --- a/src/app/accounting/search-journal-entry/search-journal-entry.component.ts +++ b/src/app/accounting/search-journal-entry/search-journal-entry.component.ts @@ -3,7 +3,7 @@ import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { FormControl } from '@angular/forms'; -import { Router, ActivatedRoute } from '@angular/router'; +import { ActivatedRoute } from '@angular/router'; /** rxjs Imports */ import { merge } from 'rxjs'; @@ -65,8 +65,12 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { transactionDateTo = new FormControl(new Date()); /** Transaction ID form control. */ transactionId = new FormControl(); + /** Submitted on date from form control. */ + submittedOnDateFrom = new FormControl(); + /** Submitted on date to form control. */ + submittedOnDateTo = new FormControl(); /** Columns to be displayed in journal entries table. */ - displayedColumns: string[] = ['id', 'officeName', 'transactionId', 'transactionDate', 'glAccountType', 'createdByUserName', 'glAccountCode', 'glAccountName', 'debit', 'credit']; + displayedColumns: string[] = ['id', 'officeName', 'transactionId', 'transactionDate', 'glAccountType', 'createdByUserName', 'submittedOnDate', 'glAccountCode', 'glAccountName', 'debit', 'credit']; /** Data source for journal entries table. */ dataSource: JournalEntriesDataSource; /** Journal entries filter. */ @@ -89,11 +93,19 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { }, { type: 'fromDate', - value: this.dateUtils.getDate(new Date(new Date().setMonth(new Date().getMonth() - 1))) + value: this.dateUtils.formatDate(new Date(new Date().setMonth(new Date().getMonth() - 1)), this.settingsService.dateFormat) }, { type: 'toDate', - value: this.dateUtils.getDate(new Date()) + value: this.dateUtils.formatDate(new Date(), this.settingsService.dateFormat) + }, + { + type: 'submittedOnDateFrom', + value: '' + }, + { + type: 'submittedOnDateTo', + value: '' }, { type: 'dateFormat', @@ -182,7 +194,7 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { debounceTime(500), distinctUntilChanged(), tap((filterValue) => { - this.applyFilter(this.dateUtils.getDate(filterValue), 'fromDate'); + this.applyFilter(this.dateUtils.formatDate(filterValue, this.settingsService.dateFormat), 'fromDate'); }) ) .subscribe(); @@ -192,7 +204,27 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { debounceTime(500), distinctUntilChanged(), tap((filterValue) => { - this.applyFilter(this.dateUtils.getDate(filterValue), 'toDate'); + this.applyFilter(this.dateUtils.formatDate(filterValue, this.settingsService.dateFormat), 'toDate'); + }) + ) + .subscribe(); + + this.submittedOnDateFrom.valueChanges + .pipe( + debounceTime(500), + distinctUntilChanged(), + tap((filterValue) => { + this.applyFilter(this.dateUtils.formatDate(filterValue, this.settingsService.dateFormat), 'submittedOnDateFrom'); + }) + ) + .subscribe(); + + this.submittedOnDateTo.valueChanges + .pipe( + debounceTime(500), + distinctUntilChanged(), + tap((filterValue) => { + this.applyFilter(this.dateUtils.formatDate(filterValue, this.settingsService.dateFormat), 'submittedOnDateTo'); }) ) .subscribe(); diff --git a/src/app/accounting/view-journal-entry/view-journal-entry.component.html b/src/app/accounting/view-journal-entry/view-journal-entry.component.html index 05a9e7245..f1c91ff49 100644 --- a/src/app/accounting/view-journal-entry/view-journal-entry.component.html +++ b/src/app/accounting/view-journal-entry/view-journal-entry.component.html @@ -99,8 +99,8 @@ - Created on - {{ data.journalEntry.createdDate }} + Submitted on + {{ data.journalEntry.submittedOnDate }} diff --git a/src/app/accounting/view-transaction/view-transaction.component.html b/src/app/accounting/view-transaction/view-transaction.component.html index 150c9ccee..65697eb20 100644 --- a/src/app/accounting/view-transaction/view-transaction.component.html +++ b/src/app/accounting/view-transaction/view-transaction.component.html @@ -41,11 +41,11 @@
- Created On + Submitted on
- {{ dataSource.data[0].createdDate }} + {{ dataSource.data[0].submittedOnDate }}