Skip to content

Commit

Permalink
Merge pull request #6607 from hmislk/Issue#6599
Browse files Browse the repository at this point in the history
Issue#6599 Closes #6599
  • Loading branch information
Irani96 authored Jul 26, 2024
2 parents 3abf675 + bae2217 commit 3859ec7
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 7 deletions.
18 changes: 18 additions & 0 deletions src/main/java/com/divudi/bean/common/EnumController.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class EnumController implements Serializable {
List<PaymentMethod> paymentMethodsForOpdBilling;
List<PaymentMethod> paymentMethodsForChanneling;
List<PaymentMethod> paymentMethodsForPharmacyBilling;
List<PaymentMethod> paymentMethodsForPatientDeposit;
SessionNumberType[] sessionNumberTypes;

@PostConstruct
Expand All @@ -89,6 +90,13 @@ public List<PaymentMethod> getPaymentMethodsForOpdBilling() {
}
return paymentMethodsForOpdBilling;
}

public List<PaymentMethod> getPaymentMethodsForPatientDeposit() {
if (paymentMethodsForPatientDeposit == null) {
fillPaymentMethodsForPatientDeposit();
}
return paymentMethodsForPatientDeposit;
}

public List<PaymentMethod> getPaymentMethodsForPackageBilling() {
if (paymentMethodsForOpdBilling == null) {
Expand All @@ -102,6 +110,16 @@ public void resetPaymentMethods() {
paymentMethodsForChanneling = null;
}

public void fillPaymentMethodsForPatientDeposit(){
paymentMethodsForPatientDeposit = new ArrayList<>();
for(PaymentMethod pm : PaymentMethod.values()){
boolean include = configOptionApplicationController.getBooleanValueByKey(pm.getLabel() + " is available for Patient Deposit", true);
if(include){
paymentMethodsForPatientDeposit.add(pm);
}
}
}

public void fillPaymentMethodsForOpdBilling() {
paymentMethodsForOpdBilling = new ArrayList<>();
for (PaymentMethod pm : PaymentMethod.values()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/payments/patient/receive.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</f:facet>

<div class="d-flex flex-wrap w-100">
<p:selectOneMenu id="cmbPs" value="#{patientController.bill.paymentMethod}">
<p:selectOneMenu id="cmbPs" value="#{patientController.bill.paymentMethod}">
<f:selectItems value="#{enumController.paymentMethodsForPatientDeposit}"/>
<p:ajax process="cmbPs" update="creditCard cheque slip" event="change" />
</p:selectOneMenu>
Expand Down
223 changes: 223 additions & 0 deletions src/main/webapp/payments/staff_credit_settle.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
template="/resources/template/template.xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.org/ui"
xmlns:bi="http://xmlns.jcp.org/jsf/composite/bill"
xmlns:common="http://xmlns.jcp.org/jsf/composite/ezcomp/common"
xmlns:pa="http://xmlns.jcp.org/jsf/composite/paymentMethod">

<ui:define name="content">


<h:panelGroup rendered="#{!patientController.printPreview}" >
<h:form >
<p:panel>
<f:facet name="header">
<div class="d-flex align-items-center justify-content-between">
<div>
<h:outputText value="Staff Credit Settlee"/>
</div>
<div>
<p:commandButton class="ui-button-success"
icon="fas fa-check"
id="btnSettle"
value="Settle"
action="#{patientController.settlePatientDepositReceive}"
ajax="false"
style="width: 150px; padding: 1px;border: 1px solid ; margin: auto;" >
</p:commandButton>
<p:defaultCommand target="btnSettle"/>
<p:commandButton icon="fas fa-plus" class="mx-2" value="New Bill" ajax="false" action="#{patientController.navigateToReceiveDepositsFromPatientProfile()}" >
</p:commandButton>
</div>
</div>
</f:facet>
<div class="row" >
<div class="col-6" >
<common:patient_details
id="ccPatientDetails"
editable="true"
controller="#{patientController}"/>

</div>
<div class="col-6" >
<p:panel>
<f:facet name="header">
<h:outputLabel value="Patient Deposit Details" />
</f:facet>

<div class="d-flex flex-wrap w-100">
<p:selectOneMenu id="cmbPs" value="#{patientController.bill.paymentMethod}">
<f:selectItems value="#{enumController.paymentMethodsForPatientDeposit}"/>
<p:ajax process="cmbPs" update="creditCard cheque slip" event="change" />
</p:selectOneMenu>


<p:inputText class="mx-1" value="#{patientController.bill.netTotal}" id="txtNetTotal"/>
<p:watermark value="Total" for="txtNetTotal"/>

<p:inputText value="#{patientController.bill.comments}" id="comment"/>
<p:watermark value="Comment" for="comment"/>

<h:panelGroup id="creditCard" style="display: #{patientController.bill.paymentMethod ne 'Card' ? 'none' : 'block'} ; ">
<pa:creditCard paymentMethodData="#{patientController.paymentMethodData}"/>
</h:panelGroup>

<h:panelGroup id="cheque" style="display: #{patientController.bill.paymentMethod ne 'Cheque' ? 'none' : 'block'} ; " >
<pa:cheque paymentMethodData="#{patientController.paymentMethodData}"/>
</h:panelGroup>

<h:panelGroup id="slip" style="display: #{patientController.bill.paymentMethod ne 'Slip' ? 'none' : 'block'} ;">
<pa:slip paymentMethodData="#{patientController.paymentMethodData}"/>
</h:panelGroup>
</div>
</p:panel>
</div>
</div>
</p:panel>
</h:form>
</h:panelGroup>


<h:panelGroup rendered="#{patientController.printPreview}">
<h:form >
<p:panel>

<f:facet name="header">
<h:panelGrid columns="4" style="size: 0.5rem; float: right" >
<p:commandButton value="Print Bill" icon="pi pi-print" class="ui-button-info" ajax="false">
<p:printer target="billPanel"></p:printer>
</p:commandButton>
<p:commandButton icon="fas fa-plus" class="mx-1" value="New Bill"
ajax="false" action="/payments/patient/receive?faces-redirect=true"
actionListener="#{patientController.clearDataForPatientDeposite()}" >
</p:commandButton>
<p:commandButton ajax="false" icon="fas fa-search" value="Patient Lookup" class="mx-1 ui-button-warning"
action="#{patientController.navigateToSearchPatients}"></p:commandButton>
<p:commandButton
value="Profile"
ajax="false"
icon="fa fa-user"
class="ui-button-warning w-100"
action="#{patientController.navigateToOpdPatientProfile()}"
>
<f:setPropertyActionListener
value="#{patientController.bill.patient}"
target="#{patientController.current}" ></f:setPropertyActionListener>
</p:commandButton>
</h:panelGrid>
</f:facet>


<h:outputStylesheet library="css" name="/printing/fivefiveprinting.css" ></h:outputStylesheet>



<div class="container-fluid my-2">
<div class="row justify-content-center align-items-center">
<div class="col-md-6">
<div class="align-items-center my-2" style="max-width: 80%" >
<div>
<h:panelGroup id="billPanel" class="bill" layout="block">
<div class="header">
<h2>
<h:outputText
value="#{patientController.bill.department.printingName}"
style="font-size: var(--font-size-bill) /2 ; font-weight: bold;"></h:outputText>
</h2>
<p>
<h:outputText
value="#{patientController.bill.department.address}"
style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<p>
<h:outputText
value="Telephone: #{patientController.bill.department.telephone1}"
style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<p>
<h:outputText
value="Email: #{patientController.bill.department.email}"
style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
</div>
<hr/>
<div class="header">
<h4>
<h:outputText
value="Patient Deposit Invoice"
style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</h4>
</div>
<hr/>
<p>
<strong>
<h:outputText value="Name:" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</strong>
<h:outputText value="#{patientController.bill.patient.person.nameWithTitle}" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<p>
<strong>
<h:outputText value="Age:" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</strong>
<h:outputText value="#{patientController.bill.ageAtBilledDate}" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<p>
<strong>
<h:outputText value="Sex:" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</strong>
<h:outputText value="#{patientController.bill.patient.person.sex}" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<p>
<strong>
<h:outputText value="Phone:" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</strong>
<h:outputText value="#{patientController.bill.patient.person.phone}" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<p>
<strong>
<h:outputText value="Address:" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</strong>
<h:outputText value="#{patientController.bill.patient.person.address}" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<hr/>
<p:barcode type="code39" value="#{patientController.bill.idStr}" style="width: 100%; height: 6rem;"></p:barcode>
<hr/>
<h4>Payment Details</h4>
<p>
<strong>
<h:outputText value="Total:" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</strong>
<h:outputText value="#{patientController.bill.netTotal}" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<p>
<strong>
<h:outputText value="Payment Method:" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</strong>
<h:outputText value="#{patientController.bill.paymentMethod}" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
<hr/>
<p>
<strong>
<h:outputText value="Cashier:" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</strong>
<h:outputText value="#{patientController.bill.creater.webUserPerson.name}" style="font-size: var(--font-size-bill) /2 ;"></h:outputText>
</p>
</h:panelGroup>
</div>
</div>
</div>
</div>
</div>
</p:panel>
</h:form>

</h:panelGroup>

</ui:define>

</ui:composition>
20 changes: 14 additions & 6 deletions src/main/webapp/resources/ezcomp/menu.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,20 @@
value="Cash To Pay"
rendered="#{webUserController.hasPrivilege('PaymentBilling')}" >
</p:menuitem>
<p:menuitem
ajax="false"
action="/payments/recieve_index?faces-redirect=true"
value="Cash For Receive"
rendered="#{webUserController.hasPrivilege('Payment')}" >
</p:menuitem>
<p:submenu label="Cash">

<p:menuitem
ajax="false"
action="/payments/recieve_index?faces-redirect=true"
value="Cash For Receive"
rendered="#{webUserController.hasPrivilege('Payment')}" >
</p:menuitem>
<p:menuitem
ajax="false"
action="/payments/staff_credit_settle?faces-redirect=true"
value="Staff Credit Settle" >
</p:menuitem>
</p:submenu>
<!-- <p:submenu label="Pay"
rendered="#{webUserController.hasPrivilege('Payment')}">
<p:submenu label="OPD">
Expand Down

0 comments on commit 3859ec7

Please sign in to comment.