Fix: Reload was not working due to changes in how Signals and inputs work. On reload, the input does not change so the resource does not fetch new data.
This commit is contained in:
Vendored
+13
-2
@@ -1,6 +1,12 @@
|
|||||||
{
|
{
|
||||||
// Use WSL paths + Poetry venv interpreter
|
"python.defaultInterpreterPath": "/brewman/.venv/bin/python",
|
||||||
"python.defaultInterpreterPath": "${workspaceFolder}/brewman/.venv/bin/python",
|
"python.terminal.useEnvFile": true,
|
||||||
|
"python.venvFolders": [
|
||||||
|
"barker/.venv",
|
||||||
|
"frank/.venv",
|
||||||
|
".venv"
|
||||||
|
],
|
||||||
|
"python.venvPath": "${workspaceFolder}/barker",
|
||||||
"python.terminal.activateEnvironment": true,
|
"python.terminal.activateEnvironment": true,
|
||||||
// Quality-of-life
|
// Quality-of-life
|
||||||
/* --- Pylance: keep IntelliSense, disable type checking --- */
|
/* --- Pylance: keep IntelliSense, disable type checking --- */
|
||||||
@@ -8,6 +14,11 @@
|
|||||||
// "python.analysis.diagnosticMode": "openFilesOnly",
|
// "python.analysis.diagnosticMode": "openFilesOnly",
|
||||||
"python.analysis.typeCheckingMode": "basic",
|
"python.analysis.typeCheckingMode": "basic",
|
||||||
"python.analysis.extraPaths": [
|
"python.analysis.extraPaths": [
|
||||||
|
"${workspaceFolder}/brewman",
|
||||||
|
"./brewman"
|
||||||
|
],
|
||||||
|
"python.autoComplete.extraPaths": [
|
||||||
|
"${workspaceFolder}/brewman",
|
||||||
"./brewman"
|
"./brewman"
|
||||||
],
|
],
|
||||||
// Ruff (you have ruff installed via poetry)
|
// Ruff (you have ruff installed via poetry)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
|||||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||||
import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
|
import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { provideRouter, withComponentInputBinding, withRouterConfig } from '@angular/router';
|
import { provideRouter, withComponentInputBinding } from '@angular/router';
|
||||||
|
|
||||||
import { dateFormat } from './app.environment';
|
import { dateFormat } from './app.environment';
|
||||||
import { routes } from './app.routes';
|
import { routes } from './app.routes';
|
||||||
@@ -33,13 +33,7 @@ export const appConfig: ApplicationConfig = {
|
|||||||
...(isDevMode() ? [delayInterceptor] : []),
|
...(isDevMode() ? [delayInterceptor] : []),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
provideRouter(
|
provideRouter(routes, withComponentInputBinding()),
|
||||||
routes,
|
|
||||||
withRouterConfig({
|
|
||||||
onSameUrlNavigation: 'reload',
|
|
||||||
}),
|
|
||||||
withComponentInputBinding(),
|
|
||||||
),
|
|
||||||
{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] },
|
{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] },
|
||||||
{ provide: MAT_DATE_FORMATS, useValue: dateFormat },
|
{ provide: MAT_DATE_FORMATS, useValue: dateFormat },
|
||||||
{ provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 3000 } },
|
{ provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 3000 } },
|
||||||
|
|||||||
@@ -99,8 +99,12 @@ export class AttendanceComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const date = moment(this.model().date).format('DD-MMM-YYYY');
|
const date = moment(this.model().date).format('DD-MMM-YYYY');
|
||||||
|
if (this.date() === date) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['/attendance', date]);
|
this.router.navigate(['/attendance', date]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
this.ser.save(this.getAttendance()).subscribe({
|
this.ser.save(this.getAttendance()).subscribe({
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Attendance',
|
permission: 'Attendance',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':date',
|
path: ':date',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Attendance',
|
permission: 'Attendance',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -112,8 +112,12 @@ export class BalanceSheetComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const date = this.getDate();
|
const date = this.getDate();
|
||||||
|
if (this.date() === date) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['balance-sheet', date]);
|
this.router.navigate(['balance-sheet', date]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getDate(): string {
|
getDate(): string {
|
||||||
const formModel = this.formModel();
|
const formModel = this.formModel();
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Balance Sheet',
|
permission: 'Balance Sheet',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':date',
|
path: ':date',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Balance Sheet',
|
permission: 'Balance Sheet',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Product Ledger',
|
permission: 'Product Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -105,6 +105,9 @@ export class CashFlowComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const info = this.getInfo();
|
const info = this.getInfo();
|
||||||
|
if (this.startDate() === info.startDate && this.finishDate() === info.finishDate) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['cash-flow'], {
|
this.router.navigate(['cash-flow'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: info.startDate,
|
startDate: info.startDate,
|
||||||
@@ -112,6 +115,7 @@ export class CashFlowComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getInfo(): CashFlow {
|
getInfo(): CashFlow {
|
||||||
const formModel = this.model();
|
const formModel = this.model();
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Cash Flow',
|
permission: 'Cash Flow',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Cash Flow',
|
permission: 'Cash Flow',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -151,12 +151,16 @@ export class ClosingStockComponent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const info = this.getInfo();
|
const info = this.getInfo();
|
||||||
|
if (this.date() === info.date && this.d() === info.costCentre.id) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['closing-stock', info.date], {
|
this.router.navigate(['closing-stock', info.date], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
d: info.costCentre.id,
|
d: info.costCentre.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
this.ser.save(this.getClosingStock()).subscribe({
|
this.ser.save(this.getClosingStock()).subscribe({
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Closing Stock',
|
permission: 'Closing Stock',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':date',
|
path: ':date',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Closing Stock',
|
permission: 'Closing Stock',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -127,6 +127,9 @@ export class DaybookComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const l = this.prepareSubmit();
|
const l = this.prepareSubmit();
|
||||||
|
if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['daybook'], {
|
this.router.navigate(['daybook'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: l.startDate,
|
startDate: l.startDate,
|
||||||
@@ -134,6 +137,7 @@ export class DaybookComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prepareSubmit(): Daybook {
|
prepareSubmit(): Daybook {
|
||||||
const formModel = this.model();
|
const formModel = this.model();
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Daybook',
|
permission: 'Daybook',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -126,6 +126,13 @@ export class EmployeeAttendanceComponent {
|
|||||||
currentInfo.employee =
|
currentInfo.employee =
|
||||||
typeof formValue.employee !== 'string' && formValue.employee ? formValue.employee : undefined;
|
typeof formValue.employee !== 'string' && formValue.employee ? formValue.employee : undefined;
|
||||||
if (currentInfo.employee) {
|
if (currentInfo.employee) {
|
||||||
|
if (
|
||||||
|
this.id() === currentInfo.employee.id &&
|
||||||
|
this.startDate() === currentInfo.startDate &&
|
||||||
|
this.finishDate() === currentInfo.finishDate
|
||||||
|
) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['/employee-attendance', currentInfo.employee.id], {
|
this.router.navigate(['/employee-attendance', currentInfo.employee.id], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: currentInfo.startDate,
|
startDate: currentInfo.startDate,
|
||||||
@@ -134,6 +141,7 @@ export class EmployeeAttendanceComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
this.ser.save(this.getEmployeeAttendance()).subscribe({
|
this.ser.save(this.getEmployeeAttendance()).subscribe({
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Attendance',
|
permission: 'Attendance',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Attendance',
|
permission: 'Attendance',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'employee-benefit',
|
permission: 'employee-benefit',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'employee-benefit',
|
permission: 'employee-benefit',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'employee-benefit',
|
permission: 'employee-benefit',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Ledger',
|
permission: 'Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'incentive',
|
permission: 'incentive',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'incentive',
|
permission: 'incentive',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Issue',
|
permission: 'Issue',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Issue',
|
permission: 'Issue',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Journal',
|
permission: 'Journal',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'paramsChange',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Journal',
|
permission: 'Journal',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'paramsChange',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -260,7 +260,13 @@ export class LedgerComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const info = this.getInfo();
|
const info = this.getInfo();
|
||||||
if (info.account) {
|
if (
|
||||||
|
this.id() === info.account?.id &&
|
||||||
|
this.startDate() === info.startDate &&
|
||||||
|
this.finishDate() === info.finishDate
|
||||||
|
) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else if (info.account) {
|
||||||
this.router.navigate(['ledger', info.account.id], {
|
this.router.navigate(['ledger', info.account.id], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: info.startDate,
|
startDate: info.startDate,
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Ledger',
|
permission: 'Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Ledger',
|
permission: 'Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -111,8 +111,12 @@ export class MozimoDailyRegisterComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const date = moment(this.model().date).format('DD-MMM-YYYY');
|
const date = moment(this.model().date).format('DD-MMM-YYYY');
|
||||||
|
if (this.date() === date) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['/mozimo-daily-register', date]);
|
this.router.navigate(['/mozimo-daily-register', date]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
this.ser.save(this.getMozimoDailyRegister()).subscribe({
|
this.ser.save(this.getMozimoDailyRegister()).subscribe({
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Product Ledger',
|
permission: 'Product Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':date',
|
path: ':date',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Product Ledger',
|
permission: 'Product Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -136,6 +136,13 @@ export class MozimoProductRegisterComponent {
|
|||||||
show() {
|
show() {
|
||||||
const info = this.getInfo();
|
const info = this.getInfo();
|
||||||
if (info.product) {
|
if (info.product) {
|
||||||
|
if (
|
||||||
|
this.id() === info.product.id &&
|
||||||
|
this.startDate() === info.startDate &&
|
||||||
|
this.finishDate() === info.finishDate
|
||||||
|
) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['mozimo-product-register', info.product.id], {
|
this.router.navigate(['mozimo-product-register', info.product.id], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: info.startDate,
|
startDate: info.startDate,
|
||||||
@@ -144,6 +151,7 @@ export class MozimoProductRegisterComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
this.ser.save(this.getMozimoProductRegister()).subscribe({
|
this.ser.save(this.getMozimoProductRegister()).subscribe({
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Product Ledger',
|
permission: 'Product Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Product Ledger',
|
permission: 'Product Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -117,6 +117,9 @@ export class NetTransactionsComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const l = this.prepareSubmit();
|
const l = this.prepareSubmit();
|
||||||
|
if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['net-transactions'], {
|
this.router.navigate(['net-transactions'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: l.startDate,
|
startDate: l.startDate,
|
||||||
@@ -124,6 +127,7 @@ export class NetTransactionsComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prepareSubmit(): NetTransactions {
|
prepareSubmit(): NetTransactions {
|
||||||
const formModel = this.model();
|
const formModel = this.model();
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Net Transactions',
|
permission: 'Net Transactions',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Product Ledger',
|
permission: 'Product Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'journal',
|
permission: 'journal',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'paramsChange',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'journal',
|
permission: 'journal',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'paramsChange',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -211,6 +211,13 @@ export class ProductLedgerComponent {
|
|||||||
show() {
|
show() {
|
||||||
const info = this.getInfo();
|
const info = this.getInfo();
|
||||||
if (info.product) {
|
if (info.product) {
|
||||||
|
if (
|
||||||
|
this.id() === info.product.id &&
|
||||||
|
this.startDate() === info.startDate &&
|
||||||
|
this.finishDate() === info.finishDate
|
||||||
|
) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['product-ledger', info.product.id], {
|
this.router.navigate(['product-ledger', info.product.id], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: info.startDate,
|
startDate: info.startDate,
|
||||||
@@ -219,6 +226,7 @@ export class ProductLedgerComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getInfo(): ProductLedger {
|
getInfo(): ProductLedger {
|
||||||
const formModel = this.model();
|
const formModel = this.model();
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Product Ledger',
|
permission: 'Product Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Product Ledger',
|
permission: 'Product Ledger',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -117,6 +117,9 @@ export class ProfitLossComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const info = this.getInfo();
|
const info = this.getInfo();
|
||||||
|
if (this.startDate() === info.startDate && this.finishDate() === info.finishDate) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['profit-loss'], {
|
this.router.navigate(['profit-loss'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: info.startDate,
|
startDate: info.startDate,
|
||||||
@@ -124,6 +127,7 @@ export class ProfitLossComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getInfo(): ProfitLoss {
|
getInfo(): ProfitLoss {
|
||||||
const formModel = this.formModel();
|
const formModel = this.formModel();
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Profit & Loss',
|
permission: 'Profit & Loss',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ export class PurchaseEntriesComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const l = this.prepareSubmit();
|
const l = this.prepareSubmit();
|
||||||
|
if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) {
|
||||||
|
this.resource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['purchase-entries'], {
|
this.router.navigate(['purchase-entries'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: l.startDate,
|
startDate: l.startDate,
|
||||||
@@ -128,6 +131,7 @@ export class PurchaseEntriesComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prepareSubmit(): PurchaseEntries {
|
prepareSubmit(): PurchaseEntries {
|
||||||
const formModel = this.formModel();
|
const formModel = this.formModel();
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Purchase Entries',
|
permission: 'Purchase Entries',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Purchase Return',
|
permission: 'Purchase Return',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Purchase Return',
|
permission: 'Purchase Return',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Purchase',
|
permission: 'Purchase',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Purchase',
|
permission: 'Purchase',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ export class PurchasesComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const l = this.prepareSubmit();
|
const l = this.prepareSubmit();
|
||||||
|
if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) {
|
||||||
|
this.resource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['purchases'], {
|
this.router.navigate(['purchases'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: l.startDate,
|
startDate: l.startDate,
|
||||||
@@ -122,6 +125,7 @@ export class PurchasesComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prepareSubmit(): Purchases {
|
prepareSubmit(): Purchases {
|
||||||
const formModel = this.formModel();
|
const formModel = this.formModel();
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Purchases',
|
permission: 'Purchases',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -131,6 +131,9 @@ export class RawMaterialCostComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const model = this.prepareSubmit();
|
const model = this.prepareSubmit();
|
||||||
|
if (!this.id() && this.startDate() === model.startDate && this.finishDate() === model.finishDate) {
|
||||||
|
this.infoResource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['raw-material-cost'], {
|
this.router.navigate(['raw-material-cost'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: model.startDate,
|
startDate: model.startDate,
|
||||||
@@ -138,6 +141,7 @@ export class RawMaterialCostComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prepareSubmit(): RawMaterialCost {
|
prepareSubmit(): RawMaterialCost {
|
||||||
const formModel = this.formModel();
|
const formModel = this.formModel();
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Raw Material Cost',
|
permission: 'Raw Material Cost',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Raw Material Cost',
|
permission: 'Raw Material Cost',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'journal',
|
permission: 'journal',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'paramsChange',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'journal',
|
permission: 'journal',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'paramsChange',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Recipes',
|
permission: 'Recipes',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'new',
|
path: 'new',
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Maintenance', // 'Lock Date'
|
permission: 'Maintenance', // 'Lock Date'
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ export class StockMovementComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const l = this.prepareSubmit();
|
const l = this.prepareSubmit();
|
||||||
|
if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) {
|
||||||
|
this.resource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['stock-movement'], {
|
this.router.navigate(['stock-movement'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startDate: l.startDate,
|
startDate: l.startDate,
|
||||||
@@ -121,6 +124,7 @@ export class StockMovementComponent {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prepareSubmit(): StockMovement {
|
prepareSubmit(): StockMovement {
|
||||||
const formModel = this.formModel();
|
const formModel = this.formModel();
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Stock Movement',
|
permission: 'Stock Movement',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -109,8 +109,12 @@ export class TrialBalanceComponent {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
const info = this.getInfo();
|
const info = this.getInfo();
|
||||||
|
if (this.date() === info.date) {
|
||||||
|
this.resource.reload();
|
||||||
|
} else {
|
||||||
this.router.navigate(['trial-balance', info.date]);
|
this.router.navigate(['trial-balance', info.date]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getInfo(): TrialBalance {
|
getInfo(): TrialBalance {
|
||||||
const formModel = this.formModel();
|
const formModel = this.formModel();
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Trial Balance',
|
permission: 'Trial Balance',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':date',
|
path: ':date',
|
||||||
@@ -20,6 +19,5 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
permission: 'Trial Balance',
|
permission: 'Trial Balance',
|
||||||
},
|
},
|
||||||
runGuardsAndResolvers: 'always',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ a
|
|||||||
text-decoration: underline
|
text-decoration: underline
|
||||||
|
|
||||||
|
|
||||||
button.mat-primary
|
button.mat-primary:not(:disabled)
|
||||||
background: var(--mat-sys-primary) !important
|
background: var(--mat-sys-primary) !important
|
||||||
color: var(--mat-sys-on-primary) !important
|
color: var(--mat-sys-on-primary) !important
|
||||||
|
|
||||||
|
|
||||||
button.mat-warn
|
button.mat-warn:not(:disabled)
|
||||||
background: var(--mat-sys-error) !important
|
background: var(--mat-sys-error) !important
|
||||||
color: var(--mat-sys-on-error) !important
|
color: var(--mat-sys-on-error) !important
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user