Skip to content

Commit

Permalink
Merge pull request #6825 from hmislk/Issue#6824
Browse files Browse the repository at this point in the history
Issue#6824 Closes #6824
  • Loading branch information
Irani96 authored Aug 13, 2024
2 parents 9c50620 + d83c1e2 commit 2876e55
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 2 deletions.
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,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/ruhunuDemo</jta-data-source>
<jta-data-source>jdbc/hims</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
Expand All @@ -11,7 +11,7 @@
</persistence-unit>

<persistence-unit name="hmisAuditPU" transaction-type="JTA">
<jta-data-source>jdbc/ruhunuDemoAudit</jta-data-source>
<jta-data-source>jdbc/himsAduit</jta-data-source>
<class>com.divudi.entity.AuditEvent</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/resources/ezcomp/menu.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@
<p:menuitem ajax="false" action="/store/store_purchase?faces-redirect=true" value="Direct Purchase"
rendered="#{webUserController.hasPrivilege('StorePurchasePurchase')}"
actionListener="#{storePurchaseController.makeNull()}" ></p:menuitem>
<p:menuitem ajax="false" action="/store/store_direct_purchase_return?faces-redirect=true" value="Direct Purchase Return" actionListener="#{searchController.makeListNull()}" rendered="#{webUserController.hasPrivilege('StorePurchaseGRNReturn')}"></p:menuitem>
</p:submenu>
<p:submenu label="Transfer" rendered="#{webUserController.hasPrivilege('StoreTransfer')}">
<p:menuitem ajax="false" action="/store/store_transfer_request?faces-redirect=true" value="Request" actionListener="#{storeTransferRequestController.recreate}" rendered="#{webUserController.hasPrivilege('StoreTransferRequest')}" ></p:menuitem>
Expand Down
210 changes: 210 additions & 0 deletions src/main/webapp/store/store_direct_purchase_return.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
template="/resources/template/template.xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">

<ui:define name="content">
<h:form>
<p:panel>
<f:facet name="header">
<h:outputLabel value="Good Recieve Note List"/>
</f:facet>

<div class="row">
<div class="col-2">
<h:outputLabel value="From Date"/>
<p:calendar id="fromDate" value="#{searchController.fromDate}" navigator="false" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" class="w-100" inputStyleClass="w-100">
</p:calendar>
<h:outputLabel value="To Date"/>
<p:calendar id="toDate" value="#{searchController.toDate}" navigator="false" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" class="w-100" inputStyleClass="w-100">
</p:calendar>

<!--This is copy of GRN Return UI. The logic is not implement yet-->

<!-- <h:panelGroup>
<p:commandButton id="btnSearch" ajax="false" value="Logged Institution Search" icon="fas fa-search" action="#{searchController.createGrnTableStore()}" class="w-100 my-1 ui-button-Warning"/>
<p:commandButton id="btnSearch2" ajax="false" value="All Search" icon="fas fa-search" action="#{searchController.createGrnTableAllInsStore}" class="my-1 w-100 ui-button-Warning"/>
</h:panelGroup>-->

<h:outputLabel value="Grn No"/>
<p:inputText autocomplete="off" value="#{searchController.searchKeyword.billNo}" class="w-100"/>
<h:outputLabel value="Invoice Number"/>
<p:inputText autocomplete="off" value="#{searchController.searchKeyword.number}" class="w-100"/>
<h:outputLabel value="Po Number"/>
<p:inputText autocomplete="off" value="#{searchController.searchKeyword.refBillNo}" class="w-100"/>
<h:outputLabel value="Distributor"/>
<p:inputText autocomplete="off" value="#{searchController.searchKeyword.fromInstitution}" class="w-100"/>
<h:outputLabel value="Po Value"/>
<p:inputText autocomplete="off" value="#{searchController.searchKeyword.total}" class="w-100"/>
<h:outputLabel value="Grn Value"/>
<p:inputText autocomplete="off" value="#{searchController.searchKeyword.netTotal}" class="w-100"/>
</div>
<div class="col-10">
<p:dataTable value="#{searchController.bills}" var="p" >

<p:column headerText="GRN No" >
<h:commandLink action="store_reprint_grn" >
<h:outputLabel value="#{p.deptId}"/>
<f:setPropertyActionListener target="#{storeBillSearch.bill}" value="#{p}"/>
</h:commandLink>
</p:column>
<p:column headerText="Invoice No" >
<h:commandLink action="store_reprint_grn" >
<h:outputLabel value="#{p.invoiceNumber}"/>
<f:setPropertyActionListener target="#{storeBillSearch.bill}" value="#{p}"/>
</h:commandLink>
</p:column>
<p:column headerText="PO No">
<h:commandLink action="store_reprint_grn" >
<h:outputLabel value="#{p.referenceBill.deptId}"/>
<f:setPropertyActionListener target="#{storeBillSearch.bill}" value="#{p}"/>
</h:commandLink>
</p:column>
<p:column headerText="Distributor" >
<h:commandLink action="store_reprint_grn" >
<h:outputLabel value="#{p.fromInstitution.name}"/>
<f:setPropertyActionListener target="#{storeBillSearch.bill}" value="#{p}"/>
</h:commandLink>
</p:column>

<p:column headerText="Billed at" >
<h:commandLink action="store_reprint_grn" >
<h:outputLabel value="#{p.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
<f:setPropertyActionListener value="#{p}" target="#{storeBillSearch.bill}"/>
</h:commandLink>
<br/>
<h:panelGroup rendered="#{p.cancelled}" >
<h:outputLabel style="color: red;" value="Cancelled at " />
<h:outputLabel style="color: red;" rendered="#{p.cancelled}"
value="#{p.cancelledBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{p.refunded}" >
<h:outputLabel style="color: red;" value="Refunded at " />
<h:outputLabel style="color: red;" rendered="#{p.refunded}"
value="#{p.refundedBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
</p:column>

<p:column headerText="Billed by" >
<h:commandLink action="store_reprint_grn" >
<h:outputLabel value="#{p.creater.webUserPerson.name}" >
</h:outputLabel>
<f:setPropertyActionListener value="#{p}" target="#{storeBillSearch.bill}"/>
</h:commandLink>
<br/>
<h:panelGroup rendered="#{p.cancelled}" >
<h:outputLabel style="color: red;" value="Cancelled by " />
<h:outputLabel style="color: red;" rendered="#{p.cancelled}" value="#{p.cancelledBill.creater.webUserPerson.name}" >
</h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{p.refunded}" >
<h:outputLabel style="color: red;" value="Refunded by " />
<h:outputLabel style="color: red;" rendered="#{p.refunded}"
value="#{p.refundedBill.creater.webUserPerson.name}" >
</h:outputLabel>
</h:panelGroup>
</p:column>

<p:column headerText="PO Value" >
<h:commandLink action="store_reprint_grn" >
<h:outputLabel value="#{p.referenceBill.netTotal}">
<f:convertNumber pattern="#,##0.00" />
</h:outputLabel>

<f:setPropertyActionListener target="#{storeBillSearch.bill}" value="#{p}"/>
</h:commandLink>
</p:column>

<p:column headerText="Grn Value" >
<h:commandLink action="store_reprint_grn" >
<h:outputLabel value="#{p.netTotal}">
<f:convertNumber pattern="#,##0.00" />
</h:outputLabel>
<f:setPropertyActionListener target="#{storeBillSearch.bill}" value="#{p}"/>
</h:commandLink>
</p:column>
<p:column>
<p:commandButton ajax="false" value="Return" action="store_return_good" disabled="#{p.cancelled}">
<f:setPropertyActionListener target="#{storeGoodsReturnController.bill}" value="#{p}"/>
</p:commandButton>
</p:column>

<p:column headerText="Return Bill" style="width: 26em;">
<p:dataTable var="b" value="#{p.listOfBill}">
<p:column >
<h:commandLink action="store_reprint_grn_return" >
<h:outputLabel value="#{b.deptId}"/>
<f:setPropertyActionListener target="#{storeBillSearch.bill}" value="#{b}"/>
</h:commandLink>
</p:column>
<p:column >
<h:commandLink action="store_reprint_grn_return" >
<h:outputLabel value="#{b.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
<f:setPropertyActionListener value="#{b}" target="#{storeBillSearch.bill}"/>
</h:commandLink>
<br/>
<h:panelGroup rendered="#{b.cancelled}" >
<h:outputLabel style="color: red;" value="Cancelled at " />
<h:outputLabel style="color: red;" rendered="#{b.cancelled}"
value="#{b.cancelledBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{b.refunded}" >
<h:outputLabel style="color: red;" value="Refunded at " />
<h:outputLabel style="color: red;" rendered="#{b.refunded}"
value="#{b.refundedBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
</p:column>

<p:column >
<h:commandLink action="store_reprint_grn_return" >
<h:outputLabel value="#{b.creater.webUserPerson.name}" >
</h:outputLabel>
<f:setPropertyActionListener value="#{b}" target="#{storeBillSearch.bill}"/>
</h:commandLink>
<br/>
<h:panelGroup rendered="#{b.cancelled}" >
<h:outputLabel style="color: red;" value="Cancelled by " />
<h:outputLabel style="color: red;" rendered="#{p.cancelled}" value="#{p.cancelledBill.creater.webUserPerson.name}" >
</h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{b.refunded}" >
<h:outputLabel style="color: red;" value="Refunded by " />
<h:outputLabel style="color: red;" rendered="#{b.refunded}"
value="#{b.refundedBill.creater.webUserPerson.name}" >
</h:outputLabel>
</h:panelGroup>
</p:column>
<p:column >
<h:commandLink action="store_reprint_grn_return" >
<h:outputLabel value="#{b.netTotal}">
<f:convertNumber pattern="#,##0.00" />
</h:outputLabel>
<f:setPropertyActionListener target="#{storeBillSearch.bill}" value="#{b}"/>
</h:commandLink>
</p:column>

</p:dataTable>
</p:column>
</p:dataTable>
</div>
</div>
</p:panel>
</h:form>
</ui:define>

</ui:composition>

0 comments on commit 2876e55

Please sign in to comment.