Skip to content

Commit

Permalink
Merge pull request #6605 from hmislk/Issue#6552
Browse files Browse the repository at this point in the history
Issue#6552 Closes #6552
  • Loading branch information
Irani96 authored Jul 26, 2024
2 parents bf683ca + 2e145a9 commit dc2b5b4
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 55 deletions.
16 changes: 16 additions & 0 deletions src/main/java/com/divudi/bean/opd/OpdBillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ public class OpdBillController implements Serializable, ControllerWithPatient, C
private Double totalSaffFee;
private boolean canChangeSpecialityAndDoctorInAddedBillItem;
private String localNumber;

private String refNo;

/**
*
Expand Down Expand Up @@ -3168,6 +3170,8 @@ public List<Payment> createPayment(Bill bill, PaymentMethod pm) {

case Agent:
case Credit:
p.setReferenceNo(cd.getPaymentMethodData().getCredit().getReferralNo());

case PatientDeposit:
if (getPatient().getRunningBalance() != null) {
getPatient().setRunningBalance(getPatient().getRunningBalance() - cd.getPaymentMethodData().getPatient_deposit().getTotalValue());
Expand Down Expand Up @@ -3221,6 +3225,7 @@ public List<Payment> createPayment(Bill bill, PaymentMethod pm) {

case Agent:
case Credit:
p.setReferenceNo(paymentMethodData.getCredit().getReferralNo());
case PatientDeposit:
case Slip:
p.setBank(paymentMethodData.getSlip().getInstitution());
Expand Down Expand Up @@ -4170,4 +4175,15 @@ public void setLocalNumber(String localNumber) {
this.localNumber = localNumber;
}

public String getRefNo() {
if(refNo == null){
refNo = getPaymentMethodData().getCredit().getReferralNo();
}
return refNo;
}

public void setRefNo(String refNo) {
this.refNo = refNo;
}

}
24 changes: 16 additions & 8 deletions src/main/java/com/divudi/data/dataStructure/ComponentDetail.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public class ComponentDetail {
private PaymentMethodData paymentMethodData;
private int creditDuration;
private Staff toStaff;
private String referralNo;



public List<ComponentDetail> getMultiplePaymentMethodComponentDetails() {
if (multiplePaymentMethodComponentDetails == null) {
Expand All @@ -44,13 +47,13 @@ public List<ComponentDetail> getMultiplePaymentMethodComponentDetails() {
}
return multiplePaymentMethodComponentDetails;
}
public void addAnotherPaymentDetail(){

public void addAnotherPaymentDetail() {
ComponentDetail cd = new ComponentDetail();
getMultiplePaymentMethodComponentDetails().add(cd);
}
public void removePaymentDetail(ComponentDetail cd){

public void removePaymentDetail(ComponentDetail cd) {
getMultiplePaymentMethodComponentDetails().remove(cd);
}

Expand Down Expand Up @@ -115,7 +118,7 @@ public void setPaymentMethod(PaymentMethod paymentMethod) {
}

public PaymentMethodData getPaymentMethodData() {
if(paymentMethodData==null){
if (paymentMethodData == null) {
paymentMethodData = new PaymentMethodData();
}
return paymentMethodData;
Expand All @@ -140,8 +143,13 @@ public Staff getToStaff() {
public void setToStaff(Staff toStaff) {
this.toStaff = toStaff;
}




public String getReferralNo() {
return referralNo;
}

public void setReferralNo(String referralNo) {
this.referralNo = referralNo;
}

}
13 changes: 13 additions & 0 deletions src/main/java/com/divudi/entity/Payment.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ public class Payment implements Serializable {
@Transient
private List<String> humanReadableDenominations;

private String referenceNo;

public Long getId() {
return id;
}
Expand Down Expand Up @@ -428,4 +430,15 @@ public void setCurrencyDenominations(List<Denomination> currencyDenominations) {
this.currencyDenominations = currencyDenominations;
}

public String getReferenceNo() {

return referenceNo;
}

public void setReferenceNo(String referenceNo) {
this.referenceNo = referenceNo;
}



}
4 changes: 0 additions & 4 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<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">
<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 All @@ -11,11 +10,8 @@
</properties>
</persistence-unit>
<persistence-unit name="hmisAuditPU" transaction-type="JTA">

<jta-data-source>jdbc/arogyaAudit</jta-data-source>

<exclude-unlisted-classes>false</exclude-unlisted-classes>

<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
<property name="eclipselink.logging.parameters" value="false"/>
Expand Down
49 changes: 7 additions & 42 deletions src/main/webapp/opd/opd_bill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -645,48 +645,7 @@

<div>
<h:panelGroup id="paymentDetails" >
<h:panelGroup
class="row"
layout="block"
rendered="#{opdBillController.paymentMethod eq 'Credit'}" >
<div class="my-1" id="credit">
<div class="row">
<div class="col-12 d-flex ">
<p:autoComplete
id="creditCompany"
class="w-100 -mx-2"
inputStyleClass="form-control"
forceSelection="true"
value="#{opdBillController.creditCompany}"
completeMethod="#{creditCompanyController.completeCredit}"
var="ix"
minQueryLength="4"
placeholder="Company (Type at least 4 letters to search)"
itemLabel="#{ix.name}"
itemValue="#{ix}"
size="10" >

<f:ajax
event="itemSelect"
listener="#{opdBillController.calTotals()}"
execute="@this"
render=":#{p:resolveFirstComponentWithId('pBillDetails',view).clientId} :#{p:resolveFirstComponentWithId('tblRequests',view).clientId} :#{p:resolveFirstComponentWithId('tblBillItem',view).clientId}" />
</p:autoComplete>

<p:inputText ></p:inputText>

<p:commandLink
id="btnAddNewCreditCom"
value="(+)"
class="mx-3 mt-1"
title="Add New Credit Company"
ajax="false"
action="#{navigationController.navigateToCreditCompany()}"
actionListener="#{creditCompanyController.prepareAdd()}" />
</div>
</div>
</div>
</h:panelGroup>

<h:panelGroup
class="row"
layout="block"
Expand Down Expand Up @@ -783,6 +742,12 @@
id="creditCard" rendered="#{opdBillController.paymentMethod eq 'Card'}" >
<pa:creditCard paymentMethodData="#{opdBillController.paymentMethodData}"/>
</h:panelGroup>
<h:panelGroup
class="row my-1"
layout="block"
id="credit" rendered="#{opdBillController.paymentMethod eq 'Credit'}" >
<pa:credit paymentMethodData="#{opdBillController.paymentMethodData}"/>
</h:panelGroup>
<h:panelGroup
class="row my-1"
layout="block"
Expand Down
59 changes: 59 additions & 0 deletions src/main/webapp/resources/paymentMethod/credit.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://xmlns.jcp.org/jsf/composite"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">

<!-- INTERFACE -->
<cc:interface>
<cc:attribute name="paymentMethodData" type="com.divudi.data.dataStructure.PaymentMethodData" />
<cc:attribute name="valueRequired" type="boolean" />
</cc:interface>

<!-- IMPLEMENTATION -->
<cc:implementation>
<div class="d-flex gap-2" >
<p:autoComplete
id="creditCompany"
class="w-100 -mx-2"
inputStyleClass="form-control"
forceSelection="true"
value="#{opdBillController.creditCompany}"
completeMethod="#{creditCompanyController.completeCredit}"
var="ix"
minQueryLength="4"
placeholder="Company (Type at least 4 letters to search)"
itemLabel="#{ix.name}"
itemValue="#{ix}"
size="10" >

<f:ajax
event="itemSelect"
listener="#{opdBillController.calTotals()}"
execute="@this"
render=":#{p:resolveFirstComponentWithId('pBillDetails',view).clientId} :#{p:resolveFirstComponentWithId('tblRequests',view).clientId} :#{p:resolveFirstComponentWithId('tblBillItem',view).clientId}" />
</p:autoComplete>

<p:inputText
id="polNo"
style="width: 250px;"
value="#{cc.attrs.paymentMethodData.credit.referralNo}"
placeholder="Policy NO" >
</p:inputText>

<p:commandLink
id="btnAddNewCreditCom"
value="(+)"
class="mx-3 mt-1"
title="Add New Credit Company"
ajax="false"
action="#{navigationController.navigateToCreditCompany()}"
actionListener="#{creditCompanyController.prepareAdd()}" />

<p:watermark value="Policy NO" for="polNo" />
</div>

</cc:implementation>
</html>
1 change: 0 additions & 1 deletion src/main/webapp/resources/paymentMethod/creditCard.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@
<p:watermark value="Card Ref. No." for="refno" />
</div>


</cc:implementation>
</html>

0 comments on commit dc2b5b4

Please sign in to comment.