Skip to content

Commit

Permalink
Merge pull request #6492 from hmislk/Issue#6473
Browse files Browse the repository at this point in the history
Issue#6473 Closes #6473
  • Loading branch information
DeshaniPubudu authored Jul 21, 2024
2 parents c84852c + 508b2ed commit 2de714f
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 211 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>3.0.0</version>
<packaging>war</packaging>
<name>sethma</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ public void addPaymentToInitialFundBill() {
calculateInitialFundBillTotal();
currentPayment = null;
getCurrentPayment();
getCurrentPayment().setCurrencyDenominations(null);
getCurrentPayment().setCurrencyDenominationsJson("");
}

public void addPaymentToFundTransferBill() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="hmisPU" transaction-type="JTA">

<jta-data-source>jdbc/arogya</jta-data-source>
<jta-data-source>jdbc/demos</jta-data-source>

<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="create-or-extend-tables"/>
</properties>
</persistence-unit>
<persistence-unit name="hmisAuditPU" transaction-type="JTA">
<jta-data-source>jdbc/arogyaAudit</jta-data-source>
<jta-data-source>jdbc/demoaudit</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
</properties>
Expand Down
214 changes: 6 additions & 208 deletions src/main/webapp/cashier/initial_fund_bill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:prints="http://xmlns.jcp.org/jsf/composite/ezcomp/prints"
xmlns:pa="http://xmlns.jcp.org/jsf/composite/paymentMethod"
xmlns:ftm="http://xmlns.jcp.org/jsf/composite/ezcomp/ftm"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:body>

<ui:composition template="./index.xhtml">
<ui:define name="subcontent">
<h:form>

<p:panel >
<f:facet name="header">
<i class="fa fa-money-bill-wave mt-2"/>
Expand All @@ -27,7 +24,6 @@
</p:commandButton>
</f:facet>
<p:panel header="Add Funds" >

<div class="row">
<div class="col-md-4">
<p:outputLabel value="Payment Method" ></p:outputLabel>
Expand All @@ -43,136 +39,8 @@
</div>
<div class="col-md-7" >
<h:panelGroup id="paymentDetails" >
<h:panelGroup
class="d-flex"
layout="block"
id="cheque"
rendered="#{financialTransactionController.currentPayment.paymentMethod eq 'Cheque'}" >

<div class="d-flex">
<p:inputText
autocomplete="off"
onfocus="this.select()"
value="#{financialTransactionController.currentPayment.paidValue}" id="txtVal">
<p:ajax process="@this" ></p:ajax>
</p:inputText>
<p:watermark value="Value" for="txtVal" />

<p:inputText class="mx-2" autocomplete="off" value="#{financialTransactionController.currentPayment.chequeRefNo}" id="chequNo">
<p:ajax process="@this" ></p:ajax>
</p:inputText>

<p:selectOneMenu value="#{financialTransactionController.currentPayment.bank}" style="width: 10em;">
<f:selectItem itemLabel="Select Bank"/>
<f:selectItems value="#{institutionController.banks}" var="inst" itemLabel="#{inst.name}" itemValue="#{inst}"/>
<p:ajax process="@this" ></p:ajax>
</p:selectOneMenu>

<p:calendar class="mx-2" value="#{financialTransactionController.currentPayment.chequeDate}" pattern="#{sessionController.applicationPreference.longDateFormat}" id="ChequeDate">
<p:ajax process="@this" ></p:ajax>
</p:calendar>

<p:watermark value="Cheque No" for="chequNo"/>
<p:watermark value="Cheque Date" for="ChequeDate"/>
</div>

</h:panelGroup>

<h:panelGroup class="container" layout="block" id="cash" rendered="#{financialTransactionController.currentPayment.paymentMethod eq 'Cash'}">
<h:panelGroup layout="block" class="w-100">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-6">
<label>Total Value</label>
</div>
<div class="col-md-6">
<p:inputText id="txtCashPaidValue" value="#{financialTransactionController.currentPayment.paidValue}" readonly="true" class="form-control" />
</div>
</div>
<div class="row">
<div class="col-md-12">
<label>Denominations</label>
</div>
</div>
<ui:repeat value="#{financialTransactionController.currentPayment.currencyDenominations}" var="denomination">
<div class="row">
<div class="col-md-4">
<p:outputLabel value="#{denomination.value}:" class="m-2" />
</div>
<div class="col-md-4">
<p:inputText
class="ml-5 m-2 form-control"
style="width:10em;"
value="#{denomination.count}"
required="true"
requiredMessage="Please enter the amount for #{denomination.value}">
<p:ajax
event="keyup"
process="@this"
update=":#{p:resolveFirstComponentWithId('txtCashPaidValue', view).clientId}"
listener="#{financialTransactionController.updateCashDenominations}" />
</p:inputText>
</div>
</div>
</ui:repeat>
</div>
</div>
</h:panelGroup>
</h:panelGroup>



<h:panelGroup
class="row my-1"
layout="block"
id="creditCard" rendered="#{opdBillController.paymentMethod eq 'Card'}" >
<pa:creditCard paymentMethodData="#{opdBillController.paymentMethodData}"/>
</h:panelGroup>
<h:panelGroup
class="row my-1"
layout="block"
id="eWallet" rendered="#{opdBillController.paymentMethod eq 'ewallet'}" >
<pa:ewallet paymentMethodData="#{opdBillController.paymentMethodData}" />
</h:panelGroup>
<h:panelGroup
class="row my-1"
layout="block"
id="cheque" rendered="#{opdBillController.paymentMethod eq 'Cheque'}" >
<pa:cheque paymentMethodData="#{opdBillController.paymentMethodData}"/>
</h:panelGroup>
<h:panelGroup
class="row my-1"
layout="block"
id="slip" rendered="#{opdBillController.paymentMethod eq 'Slip'}" >
<pa:slip paymentMethodData="#{opdBillController.paymentMethodData}"/>
</h:panelGroup>







<h:panelGroup
class="d-flex"
layout="block"
id="card"
rendered="#{financialTransactionController.currentPayment.paymentMethod eq 'Card'}" >
<p:outputLabel value="Value" class="mt-2"></p:outputLabel>
<p:inputText
class="mx-3"
id="txtCardValue"
value="#{financialTransactionController.currentPayment.paidValue}" >
</p:inputText>

</h:panelGroup>

<p:watermark value="0.00" for="txtCardValue" />

<ftm:ftmPaymentDetailCapture/>
</h:panelGroup>


</div>
<div class="col-md-1">
<p:commandButton
Expand All @@ -182,88 +50,18 @@
icon="fa fa-plus"
class="ui-button-success"
process="btnAdd cmdPayment paymentDetails"
update="tblPayments totals cmdPayment paymentDetails"
update="paymentMethodsAddedTable cmdPayment paymentDetails"
action="#{financialTransactionController.addPaymentToInitialFundBill()}" >
</p:commandButton>
</div>
</div>

</p:panel>
<p:panel header="Funds" >
<f:facet name="header">
<h:panelGroup id="totals">
<div class="d-flex justify-content-between">
<div>
<h:outputText value="Funds List" ></h:outputText>
</div>
<div class="d-flex">
<h:outputText value=" Total Funds : " ></h:outputText>
<p:outputLabel

class="mx-2"
value="#{financialTransactionController.currentBill.total}" >
</p:outputLabel>
</div>
</div>

</h:panelGroup>
</f:facet>

<p:dataTable id="tblPayments" value="#{financialTransactionController.currentBillPayments}" var="bp" >
<p:column headerText="Payment Method" width="20%">
<h:outputText value="#{bp.paymentMethod}" ></h:outputText>
</p:column>

<p:column headerText="Details" class="row d-grid" >
<h:panelGroup rendered="#{bp.paymentMethod eq 'Cheque'}">
<div class="row ">
<h:outputLabel value="Bank Name : #{bp.bank.name}" ></h:outputLabel>
</div>
<div class="row ">
<h:outputLabel value="Cheque No : #{bp.chequeRefNo}" ></h:outputLabel>
</div>
<div class="row ">
<h:outputLabel value="Cheque Date : #{bp.chequeDate}" >
<f:convertDateTime pattern="#{sessionController.applicationPreference.longDateFormat}" ></f:convertDateTime>
</h:outputLabel>
</div>
</h:panelGroup>
</p:column>

<p:column headerText="Value" width="20%">
<h:outputText value="#{bp.paidValue}" ></h:outputText>
</p:column>

<p:column headerText="Denominations" width="20%">
<ui:repeat value="#{bp.humanReadableDenominations}" var="denomination">
<h:outputText value="#{denomination}" />
<br />
</ui:repeat>
#{bp.currencyDenominationsJson}
</p:column>

<p:column headerText="Action" width="20%">
<p:commandButton
class="ui-button-danger"
icon=" fa-solid fa-trash"
id="btnRemove"
value="Remove"
action="#{financialTransactionController.removePayment}"
process="btnRemove tblPayments"
update=":#{p:resolveFirstComponentWithId('tblPayments',view).clientId} :#{p:resolveFirstComponentWithId('totals',view).clientId}"
>
<f:setPropertyActionListener value="#{bp}" target="#{financialTransactionController.removingPayment}" ></f:setPropertyActionListener>
</p:commandButton>
</p:column>
</p:dataTable>

</p:panel>
<h:panelGroup id="paymentMethodsAddedTable" >
<ftm:ftmPaymentMethoDetailsAddedTable/>
</h:panelGroup>
</p:panel>

</h:form>

</ui:define>
</ui:composition>

</h:body>
</html>
Loading

0 comments on commit 2de714f

Please sign in to comment.