Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#6051 #6184

Merged
merged 5 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion nb-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<libraries xmlns="http://www.netbeans.org/ns/cdnjs-libraries/1"/>
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
Expand All @@ -27,5 +26,7 @@ Any value defined here will override the pom.xml file value but is only applicab
<org-netbeans-modules-css-prep.sass_2e_mappings>/scss:/css</org-netbeans-modules-css-prep.sass_2e_mappings>
<org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>js/libs</org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>pfv5ee8</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
<netbeans.hint.jdkPlatform>JDK_11</netbeans.hint.jdkPlatform>
</properties>
<libraries xmlns="http://www.netbeans.org/ns/cdnjs-libraries/1"/>
</project-shared-configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ public FinancialTransactionController() {

// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Navigational Methods">


public String navigateToFinancialTransactionIndex() {
resetClassVariables();
fillFundTransferBillsForMeToReceive();
Expand Down Expand Up @@ -773,6 +771,8 @@ public void listBillsFromInitialFundBillUpToNow() {
}

public String settleShiftEndFundBill() {
boolean fundTransferBillTocollect = false;

if (currentBill == null) {
JsfUtil.addErrorMessage("Error");
return "";
Expand All @@ -785,6 +785,16 @@ public String settleShiftEndFundBill() {
JsfUtil.addErrorMessage("Error");
return "";
}

if (fundTransferBillsToReceive == null) {
fundTransferBillTocollect = true;
}

if (fundTransferBillTocollect) {
JsfUtil.addErrorMessage("Please collect your transferred money.");
return "";
}

currentBill.setDepartment(sessionController.getDepartment());
currentBill.setInstitution(sessionController.getInstitution());
currentBill.setStaff(sessionController.getLoggedUser().getStaff());
Expand Down
27 changes: 20 additions & 7 deletions src/main/java/com/divudi/bean/common/BillSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ public class BillSearch implements Serializable {

//Edit Bill details
private Doctor referredBy;


public String navigateToBillPaymentOpdBill() {
return "bill_payment_opd?faces-redirect=true";
}

public void editBillDetails() {
Bill editedBill = bill;
Expand Down Expand Up @@ -2737,7 +2742,6 @@ public boolean chackRefundORCancelBill(Bill bill) {
return result;
}


public String navigateToViewSingleOpdBill() {
if (bill == null) {
JsfUtil.addErrorMessage("Nothing to cancel");
Expand All @@ -2759,7 +2763,7 @@ public String navigateToViewSingleOpdBill() {
printPreview = false;
return "/opd/bill_reprint?faces-redirect=true;";
}

public String navigateToViewOpdBill() {
if (bill == null) {
JsfUtil.addErrorMessage("Nothing to cancel");
Expand Down Expand Up @@ -3066,26 +3070,35 @@ public List<BillFee> getBillFees() {
return billFees;
}


public List<BillFee> getBillFees2() {
System.out.println("getBill.getId() = " + getBill().getId());
if (billFees == null) {
if (getBill() != null) {
String sql = "SELECT b FROM BillFee b WHERE b.retired=false and b.bill.id=" + getBill().getId();
billFees = getBillFeeFacade().findByJpql(sql);
Map m = new HashMap();
String sql = "SELECT b FROM BillFee b WHERE b.retired=false and b.bill=:cb";
m.put("cb", getBill());
billFees = getBillFeeFacade().findByJpql(sql, m);
System.out.println("billFees = " + billFees.size());
}

if (getBillSearch() != null) {
String sql = "SELECT b FROM BillFee b WHERE b.bill.id=" + getBillSearch().getId();
billFees = getBillFeeFacade().findByJpql(sql);
Map m = new HashMap();
String sql = "SELECT b FROM BillFee b WHERE b.bill=:cb";
m.put("cb", getBill());
billFees = getBillFeeFacade().findByJpql(sql, m);
System.out.println("billFees2 = " + billFees.size());
}

if (billFees == null) {
billFees = new ArrayList<>();
System.out.println("this = " + this);
}
}

return billFees;
}

public List<BillFee> getPayingBillFees() {
if (getBill() != null) {
String sql = "SELECT b FROM BillFee b WHERE b.retired=false and b.bill.id=" + getBill().getId();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<persistence version="2.2" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
<persistence-unit name="hmisPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/arogyaNew</jta-data-source>
<jta-data-source>jdbc/arogya</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
Expand Down
12 changes: 6 additions & 6 deletions src/main/webapp/opd/bill_cancel.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -176,29 +176,29 @@
<h:panelGroup id="groupPrint" >
<!-- Bill Print Templates -->
<h:panelGroup rendered="#{sessionController.departmentPreference.opdBillPaperType eq 'FiveFivePaper'}" >
<prints:five_five_paper_with_headings bill="#{billSearch.bill.cancelledBill}"/>
<prints:five_five_paper_with_headings bill="#{billSearch.bill}"/>
</h:panelGroup>

<h:panelGroup rendered="#{sessionController.departmentPreference.opdBillPaperType eq 'FiveFivePrintedPaper'}" >
<prints:five_five_paper_without_headings
bill="#{billSearch.bill.cancelledBill}"
bill="#{billSearch.bill}"
duplicate="#{opdBillController.duplicatePrint}"
payments="#{opdBillController.payments}"/>
</h:panelGroup>

<h:panelGroup rendered="#{sessionController.departmentPreference.opdBillPaperType eq 'PosPrintedPaper'}" >
<prints:posOpdBillWithoutLogo bill="#{billSearch.bill.cancelledBill}" duplicate="#{opdBillController.duplicatePrint}"/>
<prints:posOpdBillWithoutLogo bill="#{billSearch.bill}" duplicate="#{opdBillController.duplicatePrint}"/>
</h:panelGroup>

<h:panelGroup rendered="#{sessionController.departmentPreference.opdBillPaperType eq 'PosPaper'}" >
<prints:posOpdBill bill="#{billSearch.bill.cancelledBill}" duplicate="#{opdBillController.duplicatePrint}"/>
<prints:posOpdBill bill="#{billSearch.bill}" duplicate="#{opdBillController.duplicatePrint}"/>
</h:panelGroup>

<h:panelGroup rendered="#{sessionController.departmentPreference.opdBillPaperType eq 'A4Paper'}" >
<prints:A4_paper_with_headings bill="#{billSearch.bill.cancelledBill}" duplicate="#{opdBillController.duplicatePrint}"/>
<prints:A4_paper_with_headings bill="#{billSearch.bill}" duplicate="#{opdBillController.duplicatePrint}"/>
</h:panelGroup>
<h:panelGroup rendered="#{sessionController.departmentPreference.opdBillPaperType eq 'A4PrintedPaper'}" >
<prints:A4_paper_without_headings bill="#{billSearch.bill.cancelledBill}" duplicate="#{opdBillController.duplicatePrint}"/>
<prints:A4_paper_without_headings bill="#{billSearch.bill}" duplicate="#{opdBillController.duplicatePrint}"/>
</h:panelGroup>

</h:panelGroup>
Expand Down
8 changes: 6 additions & 2 deletions src/main/webapp/opd/opd_bill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<h:form id="form" rendered="#{webUserController.hasPrivilege('OpdBilling') or webUserController.hasPrivilege('LabCashier')}" >

<p:growl id="msg" ></p:growl>
<p:growl id="msg" />
<p:panel class="m-0 p-0" >
<f:facet name="header" >
<div class="d-flex justify-content-between align-items-center">
Expand Down Expand Up @@ -433,12 +433,16 @@
<div class="col-7 " >
<h:panelGrid columns="3" class="m-1 w-100">
<p:commandButton
id="btnSettle"
value="Settle"
style="float: right;"
ajax="false"
process="btnSettle"
update="msg"
icon="fa fa-check"
action="#{opdBillController.settleOpdBill()}"
class="ui-button-success mx-2 w-100"
onclick="this.disabled=true; PrimeFaces.ab({source:this}); return false;"
oncomplete="this.disabled=false;"
>
</p:commandButton>
<p:commandButton
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/opd_search_bill_to_pay.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<h6>#{bill.idStr}</h6>
</p:column>
<p:column headerText="View">
<p:commandButton ajax="false" value="Pay" action="bill_payment_opd" disabled="#{bill.cancelledBill ne null}">
<p:commandButton ajax="false" value="Pay" action="#{billSearch.navigateToBillPaymentOpdBill()}" disabled="#{bill.cancelledBill ne null}">
<f:setPropertyActionListener value="#{bill}" target="#{billSearch.bill}"/>
<f:setPropertyActionListener value="#{bill}" target="#{billController.opdBill}"/>
</p:commandButton>
Expand Down