From 8c019b203a73eb4665910e2d26cbc83ae9219cc3 Mon Sep 17 00:00:00 2001 From: Buddhika Ariyaratne Date: Tue, 24 Dec 2024 13:35:31 +0530 Subject: [PATCH 1/9] Signed-off-by: Buddhika Ariyaratne --- .../divudi/bean/emr/DataUploadController.java | 53 +++++ .../bean/pharmacy/PharmacyController.java | 109 +++++---- .../dataAdmin/admin_data_administration.xhtml | 11 + .../webapp/membership/upload_members.xhtml | 190 +++++++++++++++ .../pharmacy_income_report.xhtml | 2 +- .../reports/inventoryReports/grn_report.xhtml | 10 + .../grn_report_detail_print.xhtml | 220 ++++++++++++++++++ 7 files changed, 552 insertions(+), 43 deletions(-) create mode 100644 src/main/webapp/membership/upload_members.xhtml create mode 100644 src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml diff --git a/src/main/java/com/divudi/bean/emr/DataUploadController.java b/src/main/java/com/divudi/bean/emr/DataUploadController.java index e89b553a8a..f4fb813326 100644 --- a/src/main/java/com/divudi/bean/emr/DataUploadController.java +++ b/src/main/java/com/divudi/bean/emr/DataUploadController.java @@ -89,6 +89,7 @@ import com.divudi.data.dataStructure.PharmacyImportCol; import com.divudi.ejb.PharmacyBean; import com.divudi.entity.Doctor; +import com.divudi.entity.Person; import com.divudi.entity.inward.InwardService; import com.divudi.entity.pharmacy.Ampp; import com.divudi.entity.pharmacy.PharmaceuticalItemCategory; @@ -292,6 +293,7 @@ public class DataUploadController implements Serializable { private List doctorsTosave; private List staffToSave; + private List personsToSave; private boolean pollActive; private boolean uploadComplete; @@ -344,6 +346,11 @@ public String navigateToDepartmentUpload() { uploadComplete = false; return "/admin/institutions/department_upload?faces-redirect=true"; } + + public String navigateToUploadMembers() { + uploadComplete = false; + return "/membership/upload_members?faces-redirect=true"; + } public String navigateToSupplierUpload() { uploadComplete = false; @@ -1480,6 +1487,19 @@ public void uploadStaff() { } pollActive = false; } + + public void uploadMembers() { + pollActive = true; + items = new ArrayList<>(); + if (file != null) { + try (InputStream inputStream = file.getInputStream()) { + personsToSave = readMembersFromExcel(inputStream); + } catch (IOException e) { + e.printStackTrace(); + } + } + pollActive = false; + } public void uploadFeeListItemFees() { itemFees = new ArrayList<>(); @@ -2212,6 +2232,39 @@ public List readStaffFromExcel(InputStream inputStream) throws IOExceptio return stf; } + + + public List readMembersFromExcel(InputStream inputStream) throws IOException { + List persons = new ArrayList<>(); + Workbook workbook = new XSSFWorkbook(inputStream); + Sheet sheet = workbook.getSheetAt(0); + Iterator rowIterator = sheet.rowIterator(); + + + String name=""; + String phoneNumber1=""; + Long phoneNumber; //convert string phone Number to Long + + Person p = new Person(); + p.setName(name); + p.setPhone(phoneNumber1); + p.setMobile(name); + + // Assuming the first row contains headers, skip it + if (rowIterator.hasNext()) { + rowIterator.next(); + } + + while (rowIterator.hasNext()) { + Row row = rowIterator.next(); + + Person person = new Person(); + person.setName(name); + persons.add(person); + } + + return persons; + } public void saveConsultants() { for (Consultant con : consultantsToSave) { diff --git a/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java b/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java index 66d160a872..00af7ecf16 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java +++ b/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java @@ -61,6 +61,7 @@ import com.divudi.data.table.String1Value1; import com.divudi.java.CommonFunctions; import com.divudi.light.pharmacy.PharmaceuticalItemLight; +import com.divudi.service.BillService; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; @@ -112,6 +113,8 @@ public class PharmacyController implements Serializable { // @EJB + BillService billService; + @EJB ItemFacade itemFacade; @EJB VtmFacade vtmFacade; @@ -794,55 +797,77 @@ public void generateGRNReportTableByBillItem(List bt) { totalCashPurchaseValue = 0.0; totalPurchase = 0.0; - billItems = new ArrayList<>(); - - String sql = "SELECT b FROM BillItem b WHERE b.bill.retired = false" - + " and b.bill.billType In :btp" - + " and b.bill.createdAt between :fromDate and :toDate"; - - Map tmp = new HashMap<>(); - - tmp.put("btp", bt); - tmp.put("fromDate", getFromDate()); - tmp.put("toDate", getToDate()); - - if (institution != null) { - sql += " and b.bill.institution = :fIns"; - tmp.put("fIns", institution); - } - - if (site != null) { - sql += " and b.bill.department.site = :site"; - tmp.put("site", site); - } +// billItems = new ArrayList<>(); +// +// String sql = "SELECT b FROM BillItem b WHERE b.bill.retired = false" +// + " and b.bill.billType In :btp" +// + " and b.bill.createdAt between :fromDate and :toDate"; +// +// Map tmp = new HashMap<>(); +// +// tmp.put("btp", bt); +// tmp.put("fromDate", getFromDate()); +// tmp.put("toDate", getToDate()); +// +// if (institution != null) { +// sql += " and b.bill.institution = :fIns"; +// tmp.put("fIns", institution); +// } +// +// if (site != null) { +// sql += " and b.bill.department.site = :site"; +// tmp.put("site", site); +// } +// +// if (dept != null) { +// sql += " and b.bill.department = :dept"; +// tmp.put("dept", dept); +// } +// +// if (paymentMethod != null) { +// sql += " and b.bill.paymentMethod = :pm"; +// tmp.put("pm", paymentMethod); +// } +// +// if (fromInstitution != null) { +// sql += " AND b.bill.fromInstitution = :supplier"; +// tmp.put("supplier", fromInstitution); +// } +// +// sql += " order by b.bill.id desc"; +// +// try { +// billItems = getBillItemFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP); +// +// } catch (Exception e) { +// JsfUtil.addErrorMessage(e, " Something Went Worng!"); +// } +// calculateTotals(bills); +// calculateTotalsForBillItems(billItems); + } - if (dept != null) { - sql += " and b.bill.department = :dept"; - tmp.put("dept", dept); + public String navigateToPrinteGeneratedGrnDetailedRportTable() { + if(bills==null){ + JsfUtil.addErrorMessage("No Bills"); + return null; } - - if (paymentMethod != null) { - sql += " and b.bill.paymentMethod = :pm"; - tmp.put("pm", paymentMethod); + if(bills.isEmpty()){ + JsfUtil.addErrorMessage("Bill List Empty"); + return null; } - - if (fromInstitution != null) { - sql += " AND b.bill.fromInstitution = :supplier"; - tmp.put("supplier", fromInstitution); + for(Bill b:bills){ + if(b.getBillItems()==null || b.getBillItems().isEmpty()){ + b.setBillItems(billService.fetchBillItems(b)); + } } + return "/reports/inventoryReports/grn_report_detail_print?faces-redirect=true"; + } - sql += " order by b.bill.id desc"; - - try { - billItems = getBillItemFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP); - - } catch (Exception e) { - JsfUtil.addErrorMessage(e, " Something Went Worng!"); - } -// calculateTotals(bills); -// calculateTotalsForBillItems(billItems); + public String navigateBackToGeneratedGrnDetailedRportTable() { + return "/reports/inventoryReports/grn_report?faces-redirect=true"; } + public void generateGRNReportTable() { bills = null; totalCreditPurchaseValue = 0.0; diff --git a/src/main/webapp/dataAdmin/admin_data_administration.xhtml b/src/main/webapp/dataAdmin/admin_data_administration.xhtml index 09e87bd9d3..c2aa69cb6f 100644 --- a/src/main/webapp/dataAdmin/admin_data_administration.xhtml +++ b/src/main/webapp/dataAdmin/admin_data_administration.xhtml @@ -41,6 +41,17 @@ + +
+ +
+
+
+ + + + + + + +
+
+
+ Upload Members +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ColumnTitleDescription
ACode.Staff member's Code. Optional
BEPF No.Staff member's EPF No. Required
BTitleTitle of the staff member (e.g. Mr., Ms.). Required.
CNameStaff member's name. Required.
CFull NameStaff Full Name. Required.
DName with initialsStaff member's name with initials. Required.
DAddressStaff member's Address. Required.
Sexsexsex. Required.
Nic NoNic NoStaff member's Nic No. Required.
DOBDOBStaff member's DOB. Required.
Date of RetiredDate of RetiredDate of Retired
DepartmentDepartmentDepartment
BranchBranchBranch.
Account NoAccount NoAccount No.
BankBankBank.
+ + + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + EPF No. Column + + #{item.epfNo} + + + Title Column + + #{item.person.title.label} + + + Name Column + + #{item.person.name} + + + Name with initials Column + + #{item.person.nameWithInitials} + + + + + +
+
diff --git a/src/main/webapp/pharmacy/reports/summary_reports/pharmacy_income_report.xhtml b/src/main/webapp/pharmacy/reports/summary_reports/pharmacy_income_report.xhtml index fc32cb0216..0fd6c99856 100644 --- a/src/main/webapp/pharmacy/reports/summary_reports/pharmacy_income_report.xhtml +++ b/src/main/webapp/pharmacy/reports/summary_reports/pharmacy_income_report.xhtml @@ -171,7 +171,7 @@
- + + +
GRN Report
+ + + + diff --git a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml new file mode 100644 index 0000000000..1e3c74f1d1 --- /dev/null +++ b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
+ +
+ +
+ +
+ + From d4515220a403b522091bdfe9ee21da36dc7acee2 Mon Sep 17 00:00:00 2001 From: Pubudu-Piyankara Date: Tue, 24 Dec 2024 16:28:49 +0530 Subject: [PATCH 2/9] Signed-off-by: Pubudu-Piyankara --- .../divudi/bean/common/ReportsController.java | 233 +++++++++--------- .../reports/inventoryReports/grn_report.xhtml | 180 +++++++------- .../grn_report_detail_print.xhtml | 80 +++++- 3 files changed, 271 insertions(+), 222 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/ReportsController.java b/src/main/java/com/divudi/bean/common/ReportsController.java index e649a05f49..40ddb80d48 100644 --- a/src/main/java/com/divudi/bean/common/ReportsController.java +++ b/src/main/java/com/divudi/bean/common/ReportsController.java @@ -210,7 +210,7 @@ public class ReportsController implements Serializable { List billItem; List userPatientInvestigations; double netTotalValue; - + double subTotal; private ItemLight investigationCode; String menuBarSearchText; @@ -401,7 +401,6 @@ public void setSelectedDateType(String selectedDateType) { this.selectedDateType = selectedDateType; } - public Investigation getInvestigation() { return investigation; } @@ -3640,19 +3639,18 @@ public Double calculateSponsorShareNetTotal() { return subTotal; } - public Double calculateNetAmountNetTotal() { - double netAmountNetTotal = 0.0; - Map> billMap = bundle.getGroupedBillItemsByInstitution(); - - for (Map.Entry> entry : billMap.entrySet()) { - List bills = entry.getValue(); - - netAmountNetTotal += calculateNetAmountSubTotalByBills(bills); - } - - return netAmountNetTotal; - } - +// public Double calculateNetAmountNetTotal() { +// double netAmountNetTotal = 0.0; +// Map> billMap = bundle.getGroupedBillItemsByInstitution(); +// +// for (Map.Entry> entry : billMap.entrySet()) { +// List bills = entry.getValue(); +// +// netAmountNetTotal += calculateNetAmountSubTotalByBills(bills); +// } +// +// return netAmountNetTotal; +// } public Double calculateNetAmountSubTotalByBills(List bills) { Double netTotal = 0.0; @@ -3663,72 +3661,66 @@ public Double calculateNetAmountSubTotalByBills(List bills) { return netTotal; } - public Double calculateGrossAmountSubTotalByBills(List bills) { - Double billTotal = 0.0; - - for (Bill bill : bills) { - billTotal += bill.getBillTotal(); - } - - return billTotal; - } - - public Double calculatePatientShareSubTotalByBills(List bills) { - Double settledAmountByPatient = 0.0; - - for (Bill bill : bills) { - settledAmountByPatient += bill.getSettledAmountByPatient(); - } - - return settledAmountByPatient; - } - - public Double calculateSponsorShareSubTotalByBills(List bills) { - Double settledAmountBySponsor = 0.0; - - for (Bill bill : bills) { - settledAmountBySponsor += bill.getSettledAmountBySponsor(); - } - - return settledAmountBySponsor; - } - - public Double calculateDueAmountSubTotalByBills(List bills) { - Double balance = 0.0; - - for (Bill bill : bills) { - balance += bill.getBalance(); - } - - return balance; - } - - public Double calculateGrossAmountNetTotal() { - double grossAmountNetTotal = 0.0; - Map> billMap = bundle.getGroupedBillItemsByInstitution(); - - for (Map.Entry> entry : billMap.entrySet()) { - List bills = entry.getValue(); - - grossAmountNetTotal += calculateGrossAmountSubTotalByBills(bills); - } - - return grossAmountNetTotal; - } - - public Double calculateDiscountNetTotal() { - double discountNetTotal = 0.0; - Map> billMap = bundle.getGroupedBillItemsByInstitution(); - - for (Map.Entry> entry : billMap.entrySet()) { - List bills = entry.getValue(); - - discountNetTotal += calculateDiscountSubTotalByBills(bills); - } - - return discountNetTotal; - } - +// public Double calculateGrossAmountSubTotalByBills(List bills) { +// Double billTotal = 0.0; +// +// for (Bill bill : bills) { +// billTotal += bill.getBillTotal(); +// } +// +// return billTotal; +// } +// public Double calculatePatientShareSubTotalByBills(List bills) { +// Double settledAmountByPatient = 0.0; +// +// for (Bill bill : bills) { +// settledAmountByPatient += bill.getSettledAmountByPatient(); +// } +// +// return settledAmountByPatient; +// } +// public Double calculateSponsorShareSubTotalByBills(List bills) { +// Double settledAmountBySponsor = 0.0; +// +// for (Bill bill : bills) { +// settledAmountBySponsor += bill.getSettledAmountBySponsor(); +// } +// +// return settledAmountBySponsor; +// } +// public Double calculateDueAmountSubTotalByBills(List bills) { +// Double balance = 0.0; +// +// for (Bill bill : bills) { +// balance += bill.getBalance(); +// } +// +// return balance; +// } +// public Double calculateGrossAmountNetTotal() { +// double grossAmountNetTotal = 0.0; +// Map> billMap = bundle.getGroupedBillItemsByInstitution(); +// +// for (Map.Entry> entry : billMap.entrySet()) { +// List bills = entry.getValue(); +// +// grossAmountNetTotal += calculateGrossAmountSubTotalByBills(bills); +// } +// +// return grossAmountNetTotal; +// } +// public Double calculateDiscountNetTotal() { +// double discountNetTotal = 0.0; +// Map> billMap = bundle.getGroupedBillItemsByInstitution(); +// +// for (Map.Entry> entry : billMap.entrySet()) { +// List bills = entry.getValue(); +// +// discountNetTotal += calculateDiscountSubTotalByBills(bills); +// } +// +// return discountNetTotal; +// } public Double calculateDiscountSubTotalByBills(List bills) { Double discount = 0.0; @@ -3739,45 +3731,42 @@ public Double calculateDiscountSubTotalByBills(List bills) { return discount; } - public Double calculatePatientShareNetTotal() { - double patientShareNetTotal = 0.0; - Map> billMap = bundle.getGroupedBillItemsByInstitution(); - - for (Map.Entry> entry : billMap.entrySet()) { - List bills = entry.getValue(); - - patientShareNetTotal += calculatePatientShareSubTotalByBills(bills); - } - - return patientShareNetTotal; - } - - public Double calculateDueAmountNetTotal() { - double dueAmountNetTotal = 0.0; - Map> billMap = bundle.getGroupedBillItemsByInstitution(); - - for (Map.Entry> entry : billMap.entrySet()) { - List bills = entry.getValue(); - - dueAmountNetTotal += calculateDueAmountSubTotalByBills(bills); - } - - return dueAmountNetTotal; - } - - public Double calculateSponsorShareNetTotal() { - double sponsorShareNetTotal = 0.0; - Map> billMap = bundle.getGroupedBillItemsByInstitution(); - - for (Map.Entry> entry : billMap.entrySet()) { - List bills = entry.getValue(); - - sponsorShareNetTotal += calculateSponsorShareSubTotalByBills(bills); - } - - return sponsorShareNetTotal; - } - +// public Double calculatePatientShareNetTotal() { +// double patientShareNetTotal = 0.0; +// Map> billMap = bundle.getGroupedBillItemsByInstitution(); +// +// for (Map.Entry> entry : billMap.entrySet()) { +// List bills = entry.getValue(); +// +// patientShareNetTotal += calculatePatientShareSubTotalByBills(bills); +// } +// +// return patientShareNetTotal; +// } +// public Double calculateDueAmountNetTotal() { +// double dueAmountNetTotal = 0.0; +// Map> billMap = bundle.getGroupedBillItemsByInstitution(); +// +// for (Map.Entry> entry : billMap.entrySet()) { +// List bills = entry.getValue(); +// +// dueAmountNetTotal += calculateDueAmountSubTotalByBills(bills); +// } +// +// return dueAmountNetTotal; +// } +// public Double calculateSponsorShareNetTotal() { +// double sponsorShareNetTotal = 0.0; +// Map> billMap = bundle.getGroupedBillItemsByInstitution(); +// +// for (Map.Entry> entry : billMap.entrySet()) { +// List bills = entry.getValue(); +// +// sponsorShareNetTotal += calculateSponsorShareSubTotalByBills(bills); +// } +// +// return sponsorShareNetTotal; +// } public void generateDiscountReport() { if (visitType == null || visitType.trim().isEmpty()) { JsfUtil.addErrorMessage("Please select a visit type"); @@ -4115,9 +4104,7 @@ public void exportCollectionCenterBillWiseDetailReportToExcel() { response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setHeader("Content-Disposition", "attachment; filename=Collection_Center_Report.xlsx"); - try (XSSFWorkbook workbook = new XSSFWorkbook(); - OutputStream out = response.getOutputStream()) { - + try (XSSFWorkbook workbook = new XSSFWorkbook(); OutputStream out = response.getOutputStream()) { XSSFSheet sheet = workbook.createSheet("Report"); int rowIndex = 0; diff --git a/src/main/webapp/reports/inventoryReports/grn_report.xhtml b/src/main/webapp/reports/inventoryReports/grn_report.xhtml index c1ea4dc1a8..6aa2601110 100644 --- a/src/main/webapp/reports/inventoryReports/grn_report.xhtml +++ b/src/main/webapp/reports/inventoryReports/grn_report.xhtml @@ -198,169 +198,171 @@ - - + rowKey="#{b.id}" + rowIndexVar="n" + paginator="true" + rows="10" + paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" + currentPageReportTemplate="Showing {startRecord} to {endRecord} of {totalRecords}" + rowsPerPageTemplate="5,10,15,25,50,100,500,1000"> + + + - + - - +
+ + - - + +
- - + +
+ + - + + + - + + + + + + + + + - - - + + + + - + + - - + + - - + + + + - - + + - - + + + + - - + + - - + + + + - - + + - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml index 1e3c74f1d1..b29567168c 100644 --- a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml +++ b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml @@ -135,20 +135,32 @@ - - + + + + + - - + + + + + - - + + + + + - - + + + + + - + @@ -188,8 +200,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + From 5d45ce8db433054fc2c0aa726335af7f09389e81 Mon Sep 17 00:00:00 2001 From: Pubudu-Piyankara Date: Tue, 24 Dec 2024 16:51:17 +0530 Subject: [PATCH 3/9] Signed-off-by: Pubudu-Piyankara --- .../grn_report_detail_print.xhtml | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml index b29567168c..1fa31ab127 100644 --- a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml +++ b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml @@ -75,29 +75,29 @@ - + - + - + - + - + - + - + @@ -169,19 +169,19 @@ - + - + - + - + - + @@ -189,10 +189,10 @@ - + - + @@ -202,49 +202,49 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + From 493b0e269de4a5aad1ba1da7c28f1541223f27f9 Mon Sep 17 00:00:00 2001 From: Pubudu-Piyankara Date: Tue, 24 Dec 2024 16:59:47 +0530 Subject: [PATCH 4/9] Signed-off-by: Pubudu-Piyankara --- .../reports/inventoryReports/grn_report_detail_print.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml index 1fa31ab127..a4a1d28dc2 100644 --- a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml +++ b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml @@ -185,7 +185,7 @@ - + From 0b849d155612daf4e8ab15e89ea50ce3bd106b65 Mon Sep 17 00:00:00 2001 From: Pubudu-Piyankara Date: Tue, 24 Dec 2024 17:09:17 +0530 Subject: [PATCH 5/9] Signed-off-by: Pubudu-Piyankara --- .../inventoryReports/grn_report_detail_print.xhtml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml index a4a1d28dc2..cb965bd49e 100644 --- a/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml +++ b/src/main/webapp/reports/inventoryReports/grn_report_detail_print.xhtml @@ -15,18 +15,17 @@ + action="#{pharmacyController.navigateBackToGeneratedGrnDetailedRportTable()}"> From efa71dda09e339f21010d064d51858dcfd681ff0 Mon Sep 17 00:00:00 2001 From: Pubudu-Piyankara Date: Tue, 24 Dec 2024 17:46:58 +0530 Subject: [PATCH 6/9] Signed-off-by: Pubudu-Piyankara Closed #9824 --- .../bean/pharmacy/PharmacyController.java | 18 +- .../reports/inventoryReports/grn_report.xhtml | 31 ++- .../grn_report_return_print.xhtml | 232 ++++++++++++++++++ 3 files changed, 267 insertions(+), 14 deletions(-) create mode 100644 src/main/webapp/reports/inventoryReports/grn_report_return_print.xhtml diff --git a/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java b/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java index 00af7ecf16..022a536bf2 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java +++ b/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java @@ -862,10 +862,26 @@ public String navigateToPrinteGeneratedGrnDetailedRportTable() { } return "/reports/inventoryReports/grn_report_detail_print?faces-redirect=true"; } + public String navigateToPrinteGeneratedGrnReturnReportTable() { + if(bills==null){ + JsfUtil.addErrorMessage("No Bills"); + return null; + } + if(bills.isEmpty()){ + JsfUtil.addErrorMessage("Bill List Empty"); + return null; + } + for(Bill b:bills){ + if(b.getBillItems()==null || b.getBillItems().isEmpty()){ + b.setBillItems(billService.fetchBillItems(b)); + } + } + return "/reports/inventoryReports/grn_report_return_print?faces-redirect=true"; + } public String navigateBackToGeneratedGrnDetailedRportTable() { return "/reports/inventoryReports/grn_report?faces-redirect=true"; - } + } public void generateGRNReportTable() { diff --git a/src/main/webapp/reports/inventoryReports/grn_report.xhtml b/src/main/webapp/reports/inventoryReports/grn_report.xhtml index 6aa2601110..77d1e5b559 100644 --- a/src/main/webapp/reports/inventoryReports/grn_report.xhtml +++ b/src/main/webapp/reports/inventoryReports/grn_report.xhtml @@ -160,12 +160,22 @@ - - - - - - + + + + @@ -190,12 +200,7 @@
GRN Report
- - + - + diff --git a/src/main/webapp/reports/inventoryReports/grn_report_return_print.xhtml b/src/main/webapp/reports/inventoryReports/grn_report_return_print.xhtml new file mode 100644 index 0000000000..e2729aa5aa --- /dev/null +++ b/src/main/webapp/reports/inventoryReports/grn_report_return_print.xhtml @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + +
+ +
+ +
+ +
+ + From dc7cb03fbde4bcfb603ee405eb48afcab3ec9c07 Mon Sep 17 00:00:00 2001 From: Pubudu-Piyankara Date: Tue, 24 Dec 2024 17:47:33 +0530 Subject: [PATCH 7/9] Signed-off-by: Pubudu-Piyankara --- .../reports/inventoryReports/grn_report_return_print.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/reports/inventoryReports/grn_report_return_print.xhtml b/src/main/webapp/reports/inventoryReports/grn_report_return_print.xhtml index e2729aa5aa..24b8e02b6b 100644 --- a/src/main/webapp/reports/inventoryReports/grn_report_return_print.xhtml +++ b/src/main/webapp/reports/inventoryReports/grn_report_return_print.xhtml @@ -208,7 +208,7 @@