Skip to content

Commit

Permalink
Merge pull request #9818 from hmislk/bill_type_atomic_for_theatre_iss…
Browse files Browse the repository at this point in the history
…ues_for_requests_#9815

Bill type atomic for theatre issues for requests #9815 Closes #9815
  • Loading branch information
DeshaniPubudu authored Dec 23, 2024
2 parents 5cae96c + 201787c commit 91c769d
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public void makeNull() {
selectedBillItems = null;
paymentMethodData = null;
institution = null;
recreateModel();
}

public void selectInstitutionListener() {
Expand Down Expand Up @@ -516,7 +517,7 @@ public void calulateTotalForSettlingCreditForOpdPackageBills() {
}
getCurrent().setNetTotal(n);
}

public void calulateTotalForSettlingCreditForOpdBatchBills() {
double n = 0.0;
for (BillItem b : selectedBillItems) {
Expand Down Expand Up @@ -770,7 +771,7 @@ public void settleCreditForOpdPackageBills() {
JsfUtil.addSuccessMessage("Bill Saved");
printPreview = true;
}

public void settleCreditForOpdBatchBills() {
if (getSelectedBillItems().isEmpty()) {
JsfUtil.addErrorMessage("No Bill Item ");
Expand Down Expand Up @@ -848,7 +849,7 @@ public void settleBill() {

List payments = createPayment(current, current.getPaymentMethod());
drawerController.updateDrawerForIns(payments);

JsfUtil.addSuccessMessage("Bill Saved");
printPreview = true;

Expand Down Expand Up @@ -1283,12 +1284,14 @@ private void updateSettlingCreditBillSettledValues(BillItem billItemWithReferanc
billItemWithReferanceToCreditBill.getReferenceBill().setSettledAmountBySponsor(settledCreditValueByCompanies);
System.out.println("Settled Amount By Sponsor Set: " + settledCreditValueByCompanies);

double absBillAmount = Math.abs( billItemWithReferanceToCreditBill.getReferenceBill().getNetTotal());
double absSettledAmount = Math.abs( billItemWithReferanceToCreditBill.getReferenceBill().getPaidAmount());
double absBillAmount = Math.abs(billItemWithReferanceToCreditBill.getReferenceBill().getNetTotal());
double absSettledAmount = Math.abs(billItemWithReferanceToCreditBill.getReferenceBill().getPaidAmount());
double difference = absBillAmount - absSettledAmount;
double absDifference = Math.abs(difference);
if(absDifference<1.0) billItemWithReferanceToCreditBill.getReferenceBill().setPaidAt(new Date());

if (absDifference < 1.0) {
billItemWithReferanceToCreditBill.getReferenceBill().setPaidAt(new Date());
}

getBillFacade().edit(billItemWithReferanceToCreditBill.getReferenceBill());
System.out.println("Reference Bill Updated: " + billItemWithReferanceToCreditBill.getReferenceBill());
System.out.println("Completed updateSettlingCreditBillSettledValues");
Expand Down Expand Up @@ -1343,6 +1346,10 @@ public String prepareNewBill() {
return "";
}

public String navigateToCancelCreditSettleBill() {
return "";
}

public Bill getCurrent() {
if (current == null) {
current = new BilledBill();
Expand Down
7 changes: 4 additions & 3 deletions src/main/webapp/credit/company_opd_credit_settle_bills.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
scrollable="true"
var="bill"
rows="10"
rowStyleClass="#{bill.billClass eq 'class com.divudi.entity.CancelledBill' ? 'bg-danger text-white' : ''}"
paginatorAlwaysVisible="false"
paginator="true"
paginatorPosition="top"
Expand All @@ -203,11 +204,11 @@
filterMatchMode="contains" >
<h:outputLabel value="#{bill.deptId}"/>
</p:column>
<p:column headerText="Bill Class" >
<!-- <p:column headerText="Bill Class" >
<h:outputLabel value="#{bill.billClass}"/>
</p:column>
</p:column>-->
<p:column headerText="Bill Type" >
<h:outputLabel value="#{bill.billTypeAtomic}"/>
<h:outputLabel value="#{bill.billTypeAtomic.label}"/>
</p:column>
<p:column headerText="Payment Method" >
<h:outputLabel value="#{bill.paymentMethod}"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/credit/credit_company_bill_reprint.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<hr/>
<p:commandButton
ajax="false"
value="Cancel"
value="To Cancel"
action="credit_company_bill_cancel"
disabled="#{creditCompanyBillSearch.bill.cancelled}"
class="ui-button-danger"
Expand Down
52 changes: 32 additions & 20 deletions src/main/webapp/credit/credit_compnay_bill_opd.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -289,27 +289,39 @@

<p:panel rendered="#{cashRecieveBillController.printPreview}" >

<div class="d-flex justify-content-between align-items-center">
<div>
<p:commandButton
value="New Bill"
ajax="false"
action="#{cashRecieveBillController.prepareNewBill()}"
icon="fa fa-plus"
class="ui-button-warning d-flex">
</p:commandButton>
</div>
<div>
<p:commandButton
value="Print"
ajax="false"
icon="fas fa-print"
class="ui-button-info">
<p:printer target="prints" />
</p:commandButton>
</div>
<div class="d-flex">

<p:commandButton
value="New Bill"
ajax="false"
action="#{cashRecieveBillController.prepareNewBill()}"
icon="fa fa-plus"
class="ui-button-success m-1">
</p:commandButton>

<p:commandButton
value="To Cancel Bill"
disabled="#{cashRecieveBillController.current.cancelled eq true or cashRecieveBillController.current.refunded eq true}"
ajax="false"
action="credit_company_bill_cancel"
icon="pi pi-times"
styleClass="ui-button-danger m-1">
<f:setPropertyActionListener value="#{cashRecieveBillController.current}" target="#{creditCompanyBillSearch.bill}" ></f:setPropertyActionListener>
</p:commandButton>
<p:commandButton
value="Print"
ajax="false"
icon="fas fa-print"
class="ui-button-info m-1">
<p:printer target="prints" />
</p:commandButton>

</div>
<h:panelGroup id="prints">
<p:outputLabel class="w-100 text-center bg-danger text-white m-1 p-1" value="This Bill is Cancelled" rendered="#{cashRecieveBillController.current.cancelled eq true}" ></p:outputLabel>
<p:outputLabel class="w-100 text-center bg-danger text-white m-1 p-1" value="This Bill is Refunded" rendered="#{cashRecieveBillController.current.refunded eq true}" ></p:outputLabel>

<h:panelGroup id="prints" class="align-center">

<bi:five_five_paper_coustom_1_credit_payemnt bill="#{cashRecieveBillController.current}" duplicate="false"/>
</h:panelGroup>
</p:panel>
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/inward/pharmacy_search_sale_bill_bht.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
xmlns:f="http://xmlns.jcp.org/jsf/core">

<h:body>
<ui:composition template="/resources/template/template.xhtml">
<ui:define name="content">
<ui:composition template="/theater/issue_index.xhtml">
<ui:define name="subcontent">
<h:form>
<p:panel header="Search Bills" >
<f:facet name="header" >
Expand Down
8 changes: 7 additions & 1 deletion src/main/webapp/payments/pay_index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@
<p:commandButton class="w-100" ajax="false" value="OPD Due Search" action="/credit/credit_company_opd_due?faces-redirect=true" />
<p:commandButton class="w-100" ajax="false" value="OPD Due Age" action="/credit/credit_company_opd_due_age?faces-redirect=true" />
<p:commandButton class="w-100" ajax="false" value="Settle Credit for OPD Batch Bills" action="/credit/credit_compnay_bill_opd?faces-redirect=true" actionListener="#{cashRecieveBillController.makeNull()}" icon="fa fa-th-large"/>
<p:commandButton class="w-100" ajax="false" value="Settle Credit for OPD Package Bills" action="/credit/credit_compnay_package_bill_opd?faces-redirect=true" actionListener="#{cashRecieveBillController.makeNull()}" icon="fa fa-suitcase"/>
<p:commandButton
class="w-100"
ajax="false"
value="Settle Credit for OPD Package Bills"
action="/credit/credit_compnay_package_bill_opd?faces-redirect=true"
actionListener="#{cashRecieveBillController.makeNull()}"
icon="fa fa-suitcase"/>
<p:commandButton class="w-100" ajax="false" value="OPD Done Search" action="/credit/company_opd_credit_settle_bills?faces-redirect=true" />
<p:separator></p:separator>
<!-- Inward -->
Expand Down
10 changes: 9 additions & 1 deletion src/main/webapp/resources/ezcomp/menu.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,14 @@
</p:submenu>


<p:menuitem
ajax="false"
icon="fa fa-pills"
action="/theater/issue_index?faces-redirect=true"
value="Pharmacy &amp; Stores"
rendered="#{webUserController.hasPrivilege('TheaterIssue')}" />


<p:submenu label="BHT Issue" rendered="#{webUserController.hasPrivilege('TheaterIssue')}" >
<p:submenu label="Pharmacy Issue" rendered="#{webUserController.hasPrivilege('TheaterIssue')}">
<p:menuitem ajax="false" action="/theater/inward_bill_surgery_issue?faces-redirect=true"
Expand Down Expand Up @@ -1561,7 +1569,7 @@
icon="fa fa-database"
rendered="#{webUserController.hasPrivilege('AdminItems')}" >
</p:menuitem>

</p:submenu>

<f:facet name="options">
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/theater/inward_bill_surgery_issue.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
xmlns:bill="http://xmlns.jcp.org/jsf/composite/inward">
<h:body>

<ui:composition template="/resources/template/template.xhtml">
<ui:composition template="/theater/issue_index.xhtml">

<ui:define name="content">
<ui:define name="subcontent">


<h:form id="bill" >
Expand All @@ -24,7 +24,7 @@
<p:panel rendered="#{pharmacySaleBhtController.batchBill eq null}">
<f:facet name="header" >
<h:outputText styleClass="fas fa-mortar-pestle" />
<h:outputLabel value="Pharmacy BHT Issue" class="m-2"></h:outputLabel>
<h:outputLabel value="Direct Issue of Pharmaceuticals for Surgeries" class="m-2"></h:outputLabel>
</f:facet>
<h:outputLabel value="Type Surgery Name or BHT : "/>
<p:autoComplete forceSelection="true"
Expand Down
107 changes: 107 additions & 0 deletions src/main/webapp/theater/issue_index.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:bil="http://xmlns.jcp.org/jsf/composite/bill"
xmlns:phi="http://xmlns.jcp.org/jsf/composite/pharmacy/inward"
xmlns:bill="http://xmlns.jcp.org/jsf/composite/inward">
<h:body>
<ui:composition template="/resources/template/template.xhtml">
<ui:define name="content">

<div class="row" >
<div class="col-2 p-1" >
<h:form >
<p:panelGrid columns="1" layout="tabular" class="m-1 w-100">
<f:facet name="header" >
<h:outputLabel value="Pharmacy Issues for Theatre" ></h:outputLabel>
</f:facet>
<p:commandButton
value="Direct Issue"
styleClass="w-100"
action="/theater/inward_bill_surgery_issue?faces-redirect=true"
actionListener="#{pharmacySaleBhtController.makeNull()}"
rendered="#{webUserController.hasPrivilege('TheaterIssuePharmacy')}"
icon="pi pi-check"
ajax="false"/>

<p:commandButton
value="Search Direct Issues"
class="w-100"
action="/inward/pharmacy_search_sale_bill_bht?faces-redirect=true"
actionListener="#{searchController.makeListNull}"
rendered="#{webUserController.hasPrivilege('TheaterIssuePharmacy')}"
icon="pi pi-search"
ajax="false"/>
<p:commandButton
value="Search Direct Issue Items"
class="w-100"
action="/inward/pharmacy_search_sale_bill_item_bht?faces-redirect=true"
actionListener="#{searchController.makeListNull}"
rendered="#{webUserController.hasPrivilege('TheaterIssuePharmacy')}"
icon="pi pi-search-plus"
ajax="false"/>
<p:commandButton
value="Search Direct Issue Returns"
class="w-100"
action="/inward/pharmacy_search_return_bill_bht?faces-redirect=true"
actionListener="#{searchController.makeListNull}"
rendered="#{webUserController.hasPrivilege('TheaterIssuePharmacy')}"
icon="pi pi-search-minus"
ajax="false"/>
<p:commandButton
value="Search Direct Issue Return Items"
class="w-100"
action="/inward/pharmacy_search_return_bill_bht?faces-redirect=true"
actionListener="#{searchController.makeListNull}"
rendered="#{webUserController.hasPrivilege('TheaterIssuePharmacy')}"
icon="pi pi-search-minus"
ajax="false"/>

</p:panelGrid>
<p:panelGrid columns="1" layout="tabular" class="m-1 w-100">
<f:facet name="header" >
<h:outputLabel value="Store Issues for Theatre" ></h:outputLabel>
</f:facet>

<p:commandButton
value="Direct Issue"
class="w-100"
action="/store/store_retail_sale_bht?faces-redirect=true"
actionListener="#{pharmacySaleBhtController.resetAll()}"
rendered="#{webUserController.hasPrivilege('TheaterIssueStoreBhtBilling')}"
icon="pi pi-shopping-cart"
ajax="false"/>
<p:commandButton
value="Search Issue Bill"
class="w-100"
action="/store/store_search_sale_bill_bht?faces-redirect=true"
actionListener="#{searchController.makeListNull}"
rendered="#{webUserController.hasPrivilege('TheaterIssueStoreBhtSearchBill')}"
icon="pi pi-search"
ajax="false"/>
<p:commandButton
value="Search Issue Bill Items"
class="w-100"
action="/store/store_search_sale_bill_item_bht?faces-redirect=true"
actionListener="#{searchController.makeListNull}"
rendered="#{webUserController.hasPrivilege('TheaterIssueStoreBhtSearchBillItem')}"
icon="pi pi-search-plus"
ajax="false"/>
</p:panelGrid>
</h:form>
</div>
<div class="col-10 p-1" >
<ui:insert name="subcontent" >

</ui:insert>
</div>
</div>

</ui:define>
</ui:composition>
</h:body>
</html>

0 comments on commit 91c769d

Please sign in to comment.