Skip to content

Commit

Permalink
10423 disposal return recievable amount was wrong (#10626)
Browse files Browse the repository at this point in the history
* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* add new view for tranfer issue request and approval process

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* add method to retrive all tranfer request

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Add approval privillage and only privillage holder can approve the request

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

---------

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>
  • Loading branch information
ChinthakaPrasad authored Feb 19, 2025
1 parent b8bfaa1 commit 938c233
Show file tree
Hide file tree
Showing 12 changed files with 506 additions and 204 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.divudi</groupId>
<artifactId>coop</artifactId>
<artifactId>rh</artifactId>
<version>3.0.0</version>
<packaging>war</packaging>
<name>coop</name>
<name>rh</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/divudi/ws/common/ApplicationConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(com.divudi.ws.finance.clinical.Fhir.class);
resources.add(com.divudi.ws.inward.ApiInward.class);
resources.add(com.divudi.ws.lims.Lims.class);
resources.add(com.divudi.ws.lims.LimsMiddlewareController.class);
resources.add(com.divudi.ws.lims.MiddlewareController.class);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/glassfish-web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<context-root>/coop</context-root>
<context-root>/rh</context-root>
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
Expand Down
66 changes: 47 additions & 19 deletions src/main/webapp/pharmacy/pharmacy_bill_return_issue.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

<div class="d-flex justify-content-between align-items-center">
<div>
<p:outputLabel value="Recievable Amount :" class="mt-2"/>
<p:outputLabel value="Recievable Amount : " class="mt-2"/>
<p:outputLabel
class="mx-2 mt-2"
id="total"
value="#{issueReturnController.returnBill.total}"
value=""
styleClass="totalAmount"
>
<f:convertNumber pattern="#,##0.00"></f:convertNumber>
</p:outputLabel>
</div>
<div class="d-flex align-items-center">
Expand Down Expand Up @@ -55,8 +57,7 @@
<p:dataTable
var="ph"
value="#{issueReturnController.billItems}"
scrollable="true"
scrollHeight="250"
scrollable="true"
rows="10"
id="itemList" >

Expand All @@ -69,22 +70,26 @@
<h:outputText value=" #{ph.item.name}" />

</p:column>
<p:column headerText="BillItem id" style="width:50px!important;">
<h:outputText value=" #{ph.id}" />

</p:column>
<p:column headerText="Item id" style="width:50px!important;">
<h:outputText value=" #{ph.item.id}" />

</p:column>
<!-- <p:column headerText="BillItem id" style="width:50px!important;">
<h:outputText value=" #{ph.id}" />
</p:column>
<p:column headerText="Item id" style="width:50px!important;">
<h:outputText value=" #{ph.item.id}" />
</p:column> -->

<p:column headerText="Balance Qty in Unit" style="width:25px!important;">
<h:outputText value="#{ph.remainingQty}" />
</p:column>

<p:column headerText="Purchase Rate" style="width:25px!important;">
<h:outputText value="#{ph.rate}" />
</p:column>
</p:column>

<p:column headerText="Retail Rate" style="width:25px!important;">
<h:outputText value="#{ph.pharmaceuticalBillItem.retailRate}" />
</p:column>


<p:column headerText="Batch No" style="width:25px!important;">
Expand All @@ -96,20 +101,40 @@
<f:convertDateTime pattern="#{sessionController.applicationPreference.longDateFormat}" />
</h:outputText>
</p:column>


<p:column styleClass="revieveItemPrice" headerText="Recievable Amount" style="width:25px!important;">
<h:outputText rendered="#{configOptionApplicationController.getBooleanValueByKey('Disposal bills shows purchase rate of bill items in the bill', false)}" value="#{ph.qty*ph.rate}" >
<f:convertNumber pattern="#,##0.00"></f:convertNumber>
</h:outputText>
<h:outputText rendered="#{!configOptionApplicationController.getBooleanValueByKey('Disposal bills shows purchase rate of bill items in the bill', false)}" value="#{ph.qty*ph.pharmaceuticalBillItem.retailRate}" >
<f:convertNumber pattern="#,##0.00"></f:convertNumber>
</h:outputText>
</p:column>

<p:column headerText="Returning Qty in Unit" style="width:25px!important;" >
<p:inputText autocomplete="off" value="#{ph.qty}" >
<f:ajax
event="blur"
render="@this :#{p:resolveFirstComponentWithId('total',view).clientId}"
execute="@this"
<p:ajax
event="change"
update="@this :#{p:resolveFirstComponentWithId('total',view).clientId} revieveItemPrice itemList"
process="@this"
oncomplete="calculateTotalRecievableAmount()"
listener="#{issueReturnController.onEdit(ph)}" >
</f:ajax>
</p:ajax>
</p:inputText>
</p:column>

</p:dataTable>
</h:panelGroup>
<script>
function calculateTotalRecievableAmount() {
const allItemAmount = document.querySelectorAll('.revieveItemPrice');

const totalAmount = Array.from(allItemAmount).map(td => parseFloat(td.innerText) || 0).reduce((sum, value) => sum + value, 0);
console.log('start');
document.querySelector('.totalAmount').innerText = totalAmount;

}
</script>

<p:panel rendered="#{issueReturnController.printPreview}">
<f:facet name="header">
Expand Down Expand Up @@ -158,6 +183,9 @@
</p:panel>

</h:form>
<script>

</script>
</ui:define>

</ui:composition>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
value="To Return"
class="mx-2 ui-button-warning"
icon="fa fa-money-bill-wave"
action="pharmacy_bill_return_issue"
action="pharmacy_bill_return_issue?faces-redirect=true"
disabled="#{pharmacyBillSearch.bill.cancelled eq true}" >
<f:setPropertyActionListener
value="#{pharmacyBillSearch.bill}"
Expand Down
25 changes: 16 additions & 9 deletions src/main/webapp/pharmacy/pharmacy_search_issue_bill_item.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,22 @@
<p:column headerText="No" styleClass="alignTop" width="2%">
<h:outputLabel value="#{i+1}"/>
</p:column>
<p:column headerText="Bill No" styleClass="alignTop" >
<p:column headerText="Bill No" styleClass="alignTop" width="10em">
<p:commandLink
ajax="false"
value="#{pi.bill.deptId}"
action="/pharmacy/pharmacy_reprint_bill_unit_issue">
<f:setPropertyActionListener value="#{pi.bill}" target="#{pharmacyBillSearch.bill}"/>
</p:commandLink>
</p:column>
<p:column headerText="Item Name" styleClass="alignTop" width="40%">
<p:column headerText="Item Name" styleClass="alignTop" width="20em">
<h:outputLabel value="#{pi.item.code}" ></h:outputLabel>
&nbsp;-&nbsp;
<h:outputLabel value="#{pi.item.name}" />
<h:outputLabel value="#{pi.item.name}" />

</p:column>

<p:column headerText="Billed At" width="10%">
<p:column headerText="Billed At" width="15em">
<h:outputLabel value="#{pi.bill.createdAt}" >
<f:convertDateTime pattern="dd MMM yyyy - hh mm ss a"/>
</h:outputLabel>
Expand All @@ -110,20 +110,27 @@
<f:convertDateTime pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
</p:column>
<p:column headerText="Qty" >
</p:column>

<p:column headerText="Billed By" width="10em" >
<h:outputLabel value="#{pi.bill.creater.name}" style="text-align: left;">
</h:outputLabel>
</p:column>


<p:column headerText="Qty" width="10em">
<h:outputLabel value="#{pi.qty}" >
<f:convertNumber pattern="#0.00"/>
</h:outputLabel>
</p:column>

<p:column headerText="Bill item Value">
<p:column headerText="Bill Retail Total" width="15em">
<h:outputLabel value="#{pi.netValue}" >
<f:convertNumber pattern="#,##0.00"/>
</h:outputLabel>
</p:column>

<p:column headerText="Department" styleClass="alignTop" >
<p:column headerText="To Department" styleClass="alignTop" width="10em">
<h:outputLabel value="#{pi.bill.toDepartment.name}" style="text-align: left;">
</h:outputLabel>
</p:column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<p:commandLink
ajax="false"
value="#{bill.deptId}"
action="pharmacy_reprint_bill_unit_issue_return">
action="pharmacy_reprint_bill_unit_issue_return?faces-redirect=true">
<f:setPropertyActionListener value="#{bill}" target="#{pharmacyIssueController.bill}"/>
</p:commandLink>
</p:column>
Expand Down Expand Up @@ -150,9 +150,7 @@
</h:panelGroup>
</p:column>



<p:column headerText="Value" style="text-align: right" >
<p:column headerText="Total Sale Value" style="text-align: right" >
<h:outputLabel value="#{bill.netTotal}" >
<f:convertNumber pattern="#,##0.00"/>
</h:outputLabel>
Expand Down
Loading

0 comments on commit 938c233

Please sign in to comment.