Skip to content

Commit

Permalink
Merge pull request #9943 from hmislk/Issue#9940_Grn_report_improment
Browse files Browse the repository at this point in the history
Issue#9940 grn report improment  Closes #9940
  • Loading branch information
Irani96 authored Jan 2, 2025
2 parents d11e20e + 3ab01f3 commit 362a146
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/main/java/com/divudi/bean/pharmacy/PharmacyController.java
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ public String generateFileNameForReport(String reportName) {
return reportName.trim();
}

@Deprecated
public void generateGRNReportTableByBillItem(List<BillType> bt) {
bills = null;
totalCreditPurchaseValue = 0.0;
Expand Down Expand Up @@ -884,7 +885,7 @@ public String navigateBackToGeneratedGrnDetailedRportTable() {
}


public void generateGRNReportTable() {
public void generateGrnReportTable() {
bills = null;
totalCreditPurchaseValue = 0.0;
totalCashPurchaseValue = 0.0;
Expand All @@ -893,10 +894,8 @@ public void generateGRNReportTable() {
List<BillType> bt = new ArrayList<>();
if ("detailReport".equals(reportType)) {
bt.add(BillType.PharmacyGrnBill);
generateGRNReportTableByBillItem(bt);
} else if ("returnReport".equals(reportType)) {
bt.add(BillType.PharmacyGrnReturn);
generateGRNReportTableByBillItem(bt);
} else if ("summeryReport".equals(reportType)) {
bt.add(BillType.PharmacyGrnBill);
bt.add(BillType.PharmacyGrnReturn);
Expand Down Expand Up @@ -936,10 +935,14 @@ public void generateGRNReportTable() {
tmp.put("pm", paymentMethod);
}

if (fromInstitution != null) {
if (fromInstitution != null && "detailReport".equals(reportType)) {
sql += " AND b.fromInstitution = :supplier";
tmp.put("supplier", fromInstitution);
}
if (fromInstitution != null && "returnReport".equals(reportType)) {
sql += " AND b.toInstitution = :supplier";
tmp.put("supplier", fromInstitution);
}

sql += " order by b.id desc";

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/reports/inventoryReports/grn_report.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
icon="fas fa-cogs"
ajax="false"
value="Process"
action="#{pharmacyController.generateGRNReportTable()}">
action="#{pharmacyController.generateGrnReportTable()}">
</p:commandButton>
<p:commandButton class="ui-button- mx-1" icon="fas fa-print" ajax="false" value="Print All" rendered="#{pharmacyController.reportType eq 'detailReport'}">
<p:printer target="tbl1" />
Expand Down

0 comments on commit 362a146

Please sign in to comment.