Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b947a88
fix: amm-1691 stock quantity issue
snehar-nd Jul 10, 2025
e6293b1
Update version in pom.xml to 3.4.0
5Amogh Jul 21, 2025
a086fe6
Update pom.xml
5Amogh Jul 21, 2025
53b69bb
fix: amm-1250 Item entered date column added in the inventory report
5Amogh Aug 26, 2025
9bb817e
Update pom.xml
5Amogh Sep 25, 2025
f702b94
fix: aam-1882 login credentials should work as per the role
snehar-nd Oct 17, 2025
449db99
Merge branch 'release-3.4.1' into nd/sn/dev
snehar-nd Oct 17, 2025
bc67ed4
Merge pull request #121 from PSMRI/nd/sn/dev
snehar-nd Oct 20, 2025
bdd1fbf
Downgrade version from 3.5.1 to 3.4.1
snehar-nd Oct 23, 2025
eed15a6
fix: report downloaded twice (#129)
vanitha1822 Oct 31, 2025
a832e97
fix: update pom.xml
vanitha1822 Oct 31, 2025
761dc03
Merge branch '3.6.0-tmp' into release-3.4.1
5Amogh Dec 3, 2025
c3c49a4
Merge pull request #130 from PSMRI/release-3.4.1
5Amogh Dec 3, 2025
a33eaa1
Merge branch '3.6.0-tmp' into release-3.5.0
5Amogh Dec 3, 2025
63f32b0
Merge pull request #131 from PSMRI/release-3.5.0
5Amogh Dec 3, 2025
9299039
fix: amm-1931 handled error messages and cleared the storage
snehar-nd Dec 11, 2025
b5c7942
fix: amm-1931 navigating to login page on expiry
snehar-nd Dec 12, 2025
adeb4b5
Merge pull request #133 from PSMRI/sn/wasa
snehar-nd Dec 12, 2025
be450b5
fix: resolve Allocate Batches flickering when toggling System/Manual …
snehar-nd Feb 17, 2026
1204b50
Merge pull request #137 from PSMRI/sn/3.6.1
snehar-nd Mar 3, 2026
c2257a6
Bump version from 3.6.0 to 3.6.1 (#138)
snehar-nd Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.iemr.inventory-ui</groupId>
<artifactId>inventory-ui</artifactId>
<version>3.4.0</version>
<version>3.6.1</version>
<name>Inventory-UI</name>
<description>Piramal - inventory: Module ui</description>
<packaging>war</packaging>
Expand Down
15 changes: 14 additions & 1 deletion src/app/app-modules/core/services/http-interceptor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,20 @@ export class HttpInterceptorService implements HttpInterceptor {
}),
catchError((error: HttpErrorResponse) => {
console.error(error);

if (error.status === 401 || error.status === 403) {
this.confirmationService.alert(
'Session expired. Please log in again to continue',
'error',
);
} else
this.confirmationService.alert(
error.error.errorMessage ||
'Something went wrong. Please try again later.',
'error',
);
this.router.navigate(['/login']);
sessionStorage.clear();
localStorage.clear();
this.spinnerService.show();
return throwError(error.error);
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ export class BeneficiaryDrugIssueReportComponent implements OnInit, DoCheck {
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ export class ConsumptionReportComponent implements OnInit, DoCheck {
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
'adjustmentReceipt',
'adjustmentIssue',
'closingStock',
'itemEnteredDate',
];
const array = this.consumptionList.filter(function (obj: any) {
for (const key in obj) {
Expand Down Expand Up @@ -234,8 +235,7 @@
finalCellName = newcellPosition + cellPosition + '1';
console.log(finalCellName);
}
const newName = this.modifyHeader(headers, i);
// delete report_worksheet[finalCellName].w; report_worksheet[finalCellName].v = newName;

i++;
if (i === 91 + count * 26) {
// i = 65;
Expand All @@ -247,8 +247,9 @@
const workbook = new ExcelJS.Workbook();
const criteria_worksheet = workbook.addWorksheet('Criteria');
const report_worksheet = workbook.addWorksheet('Report');
const prettyHeaders = headers.map((h) => this.modifyHeader(h));

report_worksheet.addRow(headers);
report_worksheet.addRow(prettyHeaders);
criteria_worksheet.addRow(this.criteriaHead);

// Add data
Expand All @@ -273,8 +274,8 @@
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand All @@ -298,12 +299,8 @@
}
}

modifyHeader(headers: any, i: any) {
let modifiedHeader: string;
modifiedHeader = headers[i - 65]
.toString()
.replace(/([A-Z])/g, ' $1')
.trim();
modifyHeader(header: string): string {
let modifiedHeader = header.replace(/([A-Z])/g, ' $1').trim();

Check warning on line 303 in src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String#replaceAll()` over `String#replace()`.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Inventory-UI-NEXT&issues=AZ0F0K7PQsj-WQT-im_W&open=AZ0F0K7PQsj-WQT-im_W&pullRequest=139
modifiedHeader =
modifiedHeader.charAt(0).toUpperCase() + modifiedHeader.substr(1);
return modifiedHeader.replace(/I D/g, 'ID');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@
finalCellName = newcellPosition + cellPosition + '1';
console.log(finalCellName);
}
const newName = this.modifyHeader(headers, i);
// delete report_worksheet[finalCellName].w; report_worksheet[finalCellName].v = newName;

i++;
if (i === 91 + count * 26) {
// i = 65;
Expand All @@ -244,8 +243,9 @@
const workbook = new ExcelJS.Workbook();
const criteria_worksheet = workbook.addWorksheet('Criteria');
const report_worksheet = workbook.addWorksheet('Report');
const prettyHeaders = headers.map((h) => this.modifyHeader(h));

report_worksheet.addRow(headers);
report_worksheet.addRow(prettyHeaders);
criteria_worksheet.addRow(this.criteriaHead);

// Add data
Expand All @@ -272,8 +272,8 @@
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand All @@ -297,15 +297,10 @@
}
}

modifyHeader(headers: any, i: any) {
let modifiedHeader: string;
modifiedHeader = headers[i - 65]
.toString()
.replace(/([A-Z])/g, ' $1')
.trim();
modifyHeader(header: string): string {
let modifiedHeader = header.replace(/([A-Z])/g, ' $1').trim();

Check warning on line 301 in src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String#replaceAll()` over `String#replace()`.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Inventory-UI-NEXT&issues=AZ0F0K4YQsj-WQT-im_U&open=AZ0F0K4YQsj-WQT-im_U&pullRequest=139
modifiedHeader =
modifiedHeader.charAt(0).toUpperCase() + modifiedHeader.substr(1);
//console.log(modifiedHeader);
return modifiedHeader.replace(/I D/g, 'ID');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ export class ExpiryReportComponent implements OnInit, DoCheck {
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ export class InwardStockReportComponent implements OnInit, DoCheck {
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
'adjustmentReceipt',
'adjustmentIssue',
'closingStock',
'itemEnteredDate',
];
const array = this.consumptionList.filter(function (obj: any) {
for (const key in obj) {
Expand Down Expand Up @@ -230,8 +231,6 @@
finalCellName = newcellPosition + cellPosition + '1';
console.log(finalCellName);
}
const newName = this.modifyHeader(headers, i);
// delete report_worksheet[finalCellName].w; report_worksheet[finalCellName].v = newName;
i++;
if (i === 91 + count * 26) {
// i = 65;
Expand All @@ -242,8 +241,9 @@
const workbook = new ExcelJS.Workbook();
const criteria_worksheet = workbook.addWorksheet('Criteria');
const report_worksheet = workbook.addWorksheet('Report');
const prettyHeaders = headers.map((h) => this.modifyHeader(h));

report_worksheet.addRow(headers);
report_worksheet.addRow(prettyHeaders);
criteria_worksheet.addRow(this.criteriaHead);

// Add data
Expand All @@ -268,8 +268,8 @@
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand All @@ -293,15 +293,10 @@
}
}

modifyHeader(headers: any, i: any) {
let modifiedHeader: string;
modifiedHeader = headers[i - 65]
.toString()
.replace(/([A-Z])/g, ' $1')
.trim();
modifyHeader(header: string): string {
let modifiedHeader = header.replace(/([A-Z])/g, ' $1').trim();

Check warning on line 297 in src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String#replaceAll()` over `String#replace()`.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Inventory-UI-NEXT&issues=AZ0F0K6eQsj-WQT-im_V&open=AZ0F0K6eQsj-WQT-im_V&pullRequest=139
modifiedHeader =
modifiedHeader.charAt(0).toUpperCase() + modifiedHeader.substr(1);

return modifiedHeader.replace(/I D/g, 'ID');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ export class ShortExpiryReportComponent implements OnInit, DoCheck {
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ export class TransitReportComponent implements OnInit, DoCheck {
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@
finalCellName = newcellPosition + cellPosition + '1';
console.log(finalCellName);
}
const newName = this.modifyHeader(headers, i);
// delete report_worksheet[finalCellName].w; report_worksheet[finalCellName].v = newName;
i++;
if (i === 91 + count * 26) {
// i = 65;
Expand All @@ -211,8 +209,9 @@
const workbook = new ExcelJS.Workbook();
const criteria_worksheet = workbook.addWorksheet('Criteria');
const report_worksheet = workbook.addWorksheet('Report');
const prettyHeaders = headers.map((h) => this.modifyHeader(h));

report_worksheet.addRow(headers);
report_worksheet.addRow(prettyHeaders);
criteria_worksheet.addRow(this.criteriaHead);

// Add data
Expand All @@ -238,8 +237,8 @@
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
saveAs(blob, wb_name + '.xlsx');
if (navigator.msSaveBlob) {
saveAs(blob, wb_name + '.xlsx');
navigator.msSaveBlob(blob, wb_name);
} else {
const link = document.createElement('a');
Expand All @@ -263,15 +262,10 @@
}
}

modifyHeader(headers: any, i: any) {
let modifiedHeader: string;
modifiedHeader = headers[i - 65]
.toString()
.replace(/([A-Z])/g, ' $1')
.trim();
modifyHeader(header: string): string {
let modifiedHeader = header.replace(/([A-Z])/g, ' $1').trim();

Check warning on line 266 in src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String#replaceAll()` over `String#replace()`.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Inventory-UI-NEXT&issues=AZ0F0K7oQsj-WQT-im_X&open=AZ0F0K7oQsj-WQT-im_X&pullRequest=139
modifiedHeader =
modifiedHeader.charAt(0).toUpperCase() + modifiedHeader.substr(1);

return modifiedHeader.replace(/I D/g, 'ID');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,22 +202,25 @@ export class RxItemDispenseComponent implements OnInit, OnChanges, DoCheck {
this.clearBatchArray(selectionBatchList);

if (this.issueType === 0) {
console.error('Issue Type is 0, allocating batches', this.issueType);
this.allocate();
this.allocated = false;
element.preDefinedBatchList.forEach((batch: any) => {
selectionBatchList.push(
this.utils.initBatchListElement(batch, this.issueType),
);
});
} else if (this.issueType === 1) {
this.allocate();
}
currentGroup.patchValue({
qtyDispensed: null,
});
currentGroup.controls['selectionBatchList'] = selectionBatchList;
});

if (this.issueType === 0) {
this.allocated = false;
this.allocate();
} else if (this.issueType === 1) {
this.allocated = true;
this.allocate();
}
}

clearBatchArray(formArray: any) {
Expand Down
17 changes: 17 additions & 0 deletions src/app/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@ export class LoginComponent implements OnInit {
let roleObj;
if (loginDataResponse.previlegeObj[0].roles) {
roleObj = loginDataResponse.previlegeObj[0].roles;
const hasPharmacist = roleObj.some(
(role: any) => role.RoleName === 'Pharmacist',
);

if (!hasPharmacist) {
sessionStorage.clear();

this.router.navigate(['/login']).then(() => {
this.confirmationService.alert(
'Designation is not matched with your roles , Please map the Designation or include more roles',
'error',
);
});
return;
}

if (roleObj.length > 0) {
roleObj.forEach((role: any) => {
role.serviceRoleScreenMappings.forEach((serviceRole: any) => {
Expand Down Expand Up @@ -285,6 +301,7 @@ export class LoginComponent implements OnInit {
// this.sessionstorage.userID = loginDataResponse.userID;
// this.sessionstorage.userName = loginDataResponse.userName;
// this.sessionstorage.username = this.userName;

const services = loginDataResponse.previlegeObj.map((item: any) => {
if (
item.roles[0].serviceRoleScreenMappings[0].providerServiceMapping
Expand Down
Loading