Skip to content

Commit

Permalink
Merge pull request #4591 from hmislk/Issue#4589
Browse files Browse the repository at this point in the history
Issue#4589
  • Loading branch information
DamithDeshan authored Apr 15, 2024
2 parents c97e6b9 + 872ceaf commit 9534049
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0.20240413.1
3.0.0.20240415.3
88 changes: 88 additions & 0 deletions src/main/webapp/pharmacy/pharmacy_reprint_prebill_sale.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?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:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ph="http://xmlns.jcp.org/jsf/composite/pharmacy">

<h:body>

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

<ui:define name="content">
<h:form>
<p:panel header="Reprint" >
<f:facet name="header" >
<h:outputLabel value="Reprint Sale Bill" class="mt-2" ></h:outputLabel>

<div class="d-flex gap-2" style="float: right">

<p:commandButton
accesskey="n"
value="Back to Bill List"
ajax="false"
class="ui-button-secondary"
icon="fa-solid fa-arrow-left"
action="pharmacy_search_sale_pre_bill"
>
</p:commandButton>

<p:commandButton
accesskey="n"
value="New Bill"
ajax="false"
class="ui-button-warning"
action="#{pharmacySaleController.navigateToPharmacyBillForCashier()}"
actionListener="#{pharmacySaleController.resetAll()}"
icon="fa fa-plus"
>
</p:commandButton>
<p:commandButton
value="Reprint"
icon="fa fa-print"
class="ui-button-info"
ajax="false" >
<p:printer target="gpBillPreview" ></p:printer>
</p:commandButton>

<p:commandButton
ajax="false"
value="To Cancel"
icon="fa fa-cancel"
class="ui-button-danger"
action="pharmacy_cancel_bill_retail"
disabled="#{pharmacyBillSearch.bill.cancelled}"
rendered="#{webUserController.hasPrivilege('PharmacySaleCancel')}">
</p:commandButton>
</div>

</f:facet>

<div class="d-flex justify-content-end gap-1">
<p:outputLabel value="Paper Type" class="mt-2"></p:outputLabel>
<p:selectOneMenu value="#{sessionController.departmentPreference.pharmacyBillPaperType}" class="m-1" style="width: 13em;">
<f:selectItem itemLabel="Please Select Paper Type" />
<f:selectItems value="#{enumController.paperTypes}" />
</p:selectOneMenu>
<p:commandButton ajax="false" icon="fa fa-sync-alt" class="ui-button m-1" title="Redraw Bill"></p:commandButton>
</div>

<h:panelGroup id="gpBillPreview" >

<h:panelGroup id="gpBillPreviewDouble" rendered="#{sessionController.departmentPreference.pharmacyBillPaperType eq 'PosPaper'}">
<ph:saleBill bill="#{pharmacyBillSearch.bill}" duplicate="true" ></ph:saleBill>
</h:panelGroup>

<h:panelGroup id="gpBillPreviewFiveFive" rendered="#{sessionController.loggedPreference.pharmacyBillPaperType eq 'FiveFivePaper'}">
<ph:saleBill_five_five bill="#{pharmacyBillSearch.bill}"></ph:saleBill_five_five>
</h:panelGroup>

</h:panelGroup>
</p:panel>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
5 changes: 1 addition & 4 deletions src/main/webapp/pharmacy/pharmacy_search_sale_bill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@
</h:outputLabel>

</f:facet>
<p:column headerText="No" style="width: 2em;" styleClass="alignTop">
<h:outputLabel value="#{i+1}"/>
</p:column>


<!-- <p:column headerText="View">
<p:commandButton ajax="false" value="View Bill" disabled="#{bill.referenceBill eq null}"
action="pharmacy_reprint_bill_sale">
Expand Down
44 changes: 19 additions & 25 deletions src/main/webapp/pharmacy/pharmacy_search_sale_pre_bill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -67,82 +67,76 @@
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15"
>

<p:column headerText="No" styleClass="alignTop">
<h:outputLabel value="#{i+1}"/>
</p:column>

<p:column headerText="View">
<p:commandButton ajax="false" value="View Bill" disabled="#{bill.referenceBill eq null}"
action="pharmacy_reprint_bill_sale">
<f:setPropertyActionListener value="#{bill.referenceBill}" target="#{pharmacyBillSearch.bill}"/>
</p:commandButton>
<p:column headerText="Bill No" >
<p:commandLink
action="pharmacy_reprint_prebill_sale"
value="#{bill.deptId}"
disabled="#{bill.referenceBill eq null}"
>
<f:setPropertyActionListener value="#{bill.referenceBill}" target="#{pharmacyBillSearch.bill}"/>
</p:commandLink>
</p:column>

<p:column headerText="Paid/Not">
<h:outputLabel value="PAID" rendered="#{bill.referenceBill ne null}" style="color: green;"/>
<h:outputLabel value="NOT PAID" rendered="#{bill.referenceBill eq null}" style="color: red;"/>
</p:column>

<p:column headerText="Bill No" >
<h:outputLabel value="#{bill.deptId}" />
</p:column>

<p:column headerText="Department" >
<h:outputLabel value="#{bill.department.name}" />
</p:column>

<p:column headerText="Pre Bill at" >
<p:column headerText="Pre Bill At" >
<h:outputLabel value="#{bill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>

<br/>
<h:panelGroup rendered="#{bill.refunded}" >
<h:outputLabel style="color: red;" value="Return at " />
<h:outputLabel style="color: red;" value="Return At " />
<h:outputLabel style="color: red;" rendered="#{bill.refunded}"
value="#{bill.refundedBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{bill.retired}" >
<h:outputLabel style="color: red;" value="Deleted at " />
<h:outputLabel style="color: red;" value="Deleted At " />
<h:outputLabel style="color: red;"
value="#{bill.retiredAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{bill.cancelled}" >
<h:outputLabel style="color: red;" value="Cancelled at " />
<h:outputLabel style="color: red;" value="Cancelled At " />
<h:outputLabel style="color: red;"
value="#{bill.cancelledBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
</p:column>

<p:column headerText="Billed at" >
<p:column headerText="Billed At" >
<h:outputLabel value="#{bill.referenceBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>

<br/>
<h:panelGroup rendered="#{bill.referenceBill.cancelled}" >
<h:outputLabel style="color: red;" value="Cancelled at " />
<h:outputLabel style="color: red;" value="Cancelled At " />
<h:outputLabel style="color: red;" rendered="#{bill.referenceBill.cancelled}"
value="#{bill.referenceBill.cancelledBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{bill.refunded}" >
<h:outputLabel style="color: red;" value="Refunded at " />
<h:outputLabel style="color: red;" value="Refunded At " />
<h:outputLabel style="color: red;" rendered="#{bill.referenceBill.refunded}"
value="#{bill.referenceBill.refundedBill.createdAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
</h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{bill.retired}" >
<h:outputLabel style="color: red;" value="Deleted at " />
<h:outputLabel style="color: red;" value="Deleted At " />
<h:outputLabel style="color: red;"
value="#{bill.retiredAt}" >
<f:convertDateTime timeZone="Asia/Colombo" pattern="#{sessionController.applicationPreference.longDateTimeFormat}" />
Expand All @@ -151,7 +145,7 @@

</p:column>

<p:column headerText="Pre Bill by" >
<p:column headerText="Pre Bill By" >
<h:outputLabel value="#{bill.creater.webUserPerson.name}" />
<br/>
<h:panelGroup rendered="#{bill.cancelled}" >
Expand All @@ -169,7 +163,7 @@
</h:panelGroup>
</p:column>

<p:column headerText="Billed by" >
<p:column headerText="Billed By" >
<h:outputLabel value="#{bill.referenceBill.creater.webUserPerson.name}" />
<br/>
<h:panelGroup rendered="#{bill.referenceBill.cancelled}" >
Expand Down

0 comments on commit 9534049

Please sign in to comment.