Skip to content

Commit

Permalink
Merge pull request #5907 from hmislk/issue#5877
Browse files Browse the repository at this point in the history
Issue#5877 Closed #5877
  • Loading branch information
DeshaniPubudu committed Jun 22, 2024
2 parents 02421f6 + 37ca59a commit 68f04b1
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ public class BookingControllerViewScope implements Serializable, ControllerWithP
private Staff selectedConsultant;
private SessionInstance selectedSessionInstanceForRechedule;
private boolean reservedBooking;
private BillItem selectedBillItem;

public void sessionReschedule() {
if (getSelectedSessionInstanceForRechedule() == null) {
Expand Down Expand Up @@ -2003,6 +2004,22 @@ public void addItemToBooking() {
itemToAddToBooking = null;
fillFees();
}

public void removeAddedAditionalItem(){
if (selectedBillItem==null) {
JsfUtil.addErrorMessage("Pleace Select A Bill Item !");
}
List<ItemFee> itemFeesofTheRemovingItem = billBeanController.fillFees(selectedBillItem.getItem());
List<BillFee> billFeesToRemove = selectedBillItem.getBillFees();
if(billFeesToRemove==null || billFeesToRemove.isEmpty()){
billFeesToRemove=billBeanController.fillBillItemFees(selectedBillItem);
}
if (billFeesToRemove != null) {
selectedBillSession.getBillItem().getBill().getBillFees().removeAll(billFeesToRemove);
}
selectedBillSession.getBillItem().getBill().getBillItems().remove(selectedBillItem);
calculateBillTotalsFromBillFees(selectedBillSession.getBillItem().getBill());
}

public void addItemToBookingAtSettling() {
if (itemToAddToBooking == null) {
Expand Down Expand Up @@ -6764,4 +6781,12 @@ public void setFeeNetTotalForSelectedBill(Double feeNetTotalForSelectedBill) {
this.feeNetTotalForSelectedBill = feeNetTotalForSelectedBill;
}

public BillItem getSelectedBillItem() {
return selectedBillItem;
}

public void setSelectedBillItem(BillItem selectedBillItem) {
this.selectedBillItem = selectedBillItem;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,6 @@ public String settleBill() {

List<BillItem> list = new ArrayList<>();
for (BillEntry billEntry : getLstBillEntries()) {
System.out.println("billEntry = " + billEntry);
list.add(getBillBean().saveBillItem(b, billEntry, getSessionController().getLoggedUser()));
}

Expand Down Expand Up @@ -885,7 +884,6 @@ public void checkBillValues() {

private void saveBillItemSessions() {
for (BillEntry be : lstBillEntries) {
System.out.println("be = " + be);
be.getBillItem().setBillSession(getServiceSessionBean().createBillSession(be.getBillItem()));
if (be.getBillItem().getBillSession() != null) {
getBillSessionFacade().create(be.getBillItem().getBillSession());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void calculateDiscount() {
double billDiscount = 0.0;
double billGross = 0.0;
double billNet = 0.0;

for (Bill b : billsOfBatchBillPre) {
double entryGross = 0.0;
double entryDis = 0.0;
Expand Down Expand Up @@ -1015,14 +1015,12 @@ public String toSettle(Bill preBatchBill) {
HashMap hm = new HashMap();
hm.put("bil", preBatchBill);
Bill b = getBillFacade().findFirstByJpql(sql, hm);
System.out.println("b = " + b);
if (b != null) {
JsfUtil.addErrorMessage("Already Paid");
return "";
}
setPreBill(preBatchBill);
billsOfBatchBillPre = billController.billsOfBatchBill(preBatchBill);
System.out.println("billsOfBatchBillPre = " + billsOfBatchBillPre.size());
for (Bill billOfBatchBillPre : billsOfBatchBillPre) {
if (billOfBatchBillPre.getBillItems() == null) {
billOfBatchBillPre.setBillItems(billController.billItemsOfBill(billOfBatchBillPre));
Expand All @@ -1036,7 +1034,6 @@ public String toSettle(Bill preBatchBill) {
billOfBatchBillPre.setBillFees(billController.billFeesOfBill(billOfBatchBillPre));
}
}
System.out.println("billsOfBatchBillPre = " + billsOfBatchBillPre.size());
getPreBill().setPaymentMethod(preBatchBill.getPaymentMethod());
paymentMethod = getPreBill().getPaymentMethod();
netTotal = getPreBill().getNetTotal();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/divudi/bean/report/CommonReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,7 @@ public BillsTotals getInstitutionPaymentBillsOwn() {
public BillsTotals getInstitutionRefundedBillsOwn() {
if (refundedBills == null) {
getRefundedBills().setBills(billsOwn(new RefundBill(), BillType.OpdBill));
System.out.println("getRefundedBills = " + getRefundedBills().getBills().size());
}
// calTot(getRefundedBills());
return refundedBills;
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
11 changes: 6 additions & 5 deletions src/main/webapp/admin/pricing/manage_item_fees.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,22 @@
var="ix"
itemLabel="#{ix.name}" itemValue="#{ix}" size="30"
class="w-100"
maxResults="15"
inputStyleClass="w-100">
<p:ajax event="itemSelect" process="@this" update="gpFees lblTotal" listener="#{itemFeeManager.fillFees()}"></p:ajax>
<p:column headerText="Type" >
<p:column headerText="Type" style="padding: 6px;" >
<p:outputLabel value="#{ix.class.simpleName}" ></p:outputLabel>
</p:column>
<p:column headerText="Name" >
<p:column headerText="Name" style="padding: 6px;" >
<p:outputLabel value="#{ix.name}" ></p:outputLabel>
</p:column>
<p:column headerText="Institution" >
<p:column headerText="Institution" style="padding: 6px;" >
<p:outputLabel value="#{ix.institution.name}" ></p:outputLabel>
</p:column>
<p:column headerText="Department" >
<p:column headerText="Department" style="padding: 6px;" >
<p:outputLabel value="#{ix.department.name}" ></p:outputLabel>
</p:column>
<p:column headerText="Total" >
<p:column headerText="Total" style="padding: 6px;" >
<p:outputLabel value="#{ix.total}" >
<f:convertNumber pattern="#,##0.00" ></f:convertNumber>
</p:outputLabel>
Expand Down
15 changes: 13 additions & 2 deletions src/main/webapp/channel/manage_booking_by_date.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,17 @@
<p:column >
<h:outputText value="#{bi.netValue}" ></h:outputText>
</p:column>
<p:column >
<p:commandButton
id="btnRemove"
ajax="false"
icon="fas fa-trash"
class="ui-button-danger"
action="#{bookingControllerViewScope.removeAddedAditionalItem()}"
>
<f:setPropertyActionListener target="#{bookingControllerViewScope.selectedBillItem}" value="#{bi}"/>
</p:commandButton>
</p:column>
</p:dataTable>

<p:dataTable
Expand Down Expand Up @@ -759,8 +770,8 @@
<div class="row">
<h:panelGroup class="mt-5" rendered="#{!webUserController.hasPrivilege('ChannellingReprintOriginalBill')}">
<div class="text-center">
<i class="fa-solid fa-triangle-exclamation" style="font-size: 72pt"></i>
<h3>You Do Not Have Permission to Access The Requested Page</h3>
<i class="fa-solid fa-triangle-exclamation" style="font-size: 72pt"></i>
<h3>You Do Not Have Permission to Access The Requested Page</h3>
</div>
</h:panelGroup>
<h:panelGroup rendered="#{webUserController.hasPrivilege('ChannellingReprintOriginalBill')}">
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/resources/cashier/opdBilledSummery.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<!-- IMPLEMENTATION -->
<cc:implementation>

<h1>#{cc.attrs.data.bills.size()}</h1>
<p:dataTable id="billed" rowStyleClass="noDisplayRow" value="#{cc.attrs.data.bills}" var="b" rendered="#{cc.attrs.data.bills.size()>0}" sortBy="#{b.billType}" >

<f:facet name="header">
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/resources/cashier/opdRefunded.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<!-- IMPLEMENTATION -->
<cc:implementation>
<h1>#{cc.attrs.data.bills.size()}</h1>
<p:dataTable id="#{cc.id}" rowStyleClass="noDisplayRow" value="#{cc.attrs.data.bills}" var="b" sortBy="#{b.billType}" rendered="#{cc.attrs.data.bills.size()>0}" >
<f:facet name="header">
<h:outputLabel value="OPD Refunded" />
Expand Down

0 comments on commit 68f04b1

Please sign in to comment.