Skip to content

Commit d89f591

Browse files
authored
Merge pull request #11211 from hmislk/11210-ui-improving-in-pharmacy-direct-purchase-bill
#11210-ui-improving-in-pharmacy-direct-purchase-bill
2 parents 70a3aa5 + 5e5faa4 commit d89f591

File tree

3 files changed

+112
-85
lines changed

3 files changed

+112
-85
lines changed

src/main/java/com/divudi/bean/pharmacy/PharmacyPurchaseController.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,10 @@ public void settle() {
562562

563563
billItemsTotalQty = 0;
564564
for (BillItem i : getBillItems()) {
565+
566+
double lastPurchaseRate = 0.0;
567+
lastPurchaseRate = getPharmacyBean().getLastPurchaseRate(i.getItem());
568+
565569
if (i.getPharmaceuticalBillItem().getQty() + i.getPharmaceuticalBillItem().getFreeQty() == 0.0) {
566570
continue;
567571
}
@@ -591,7 +595,7 @@ public void settle() {
591595

592596
tmpPh.setItemBatch(itemBatch);
593597
Stock stock = getPharmacyBean().addToStock(tmpPh, Math.abs(addingQty), getSessionController().getDepartment());
594-
598+
tmpPh.setLastPurchaseRate(lastPurchaseRate);
595599
tmpPh.setStock(stock);
596600
getPharmaceuticalBillItemFacade().edit(tmpPh);
597601

src/main/webapp/pharmacy/pharmacy_purchase.xhtml

+32-28
Original file line numberDiff line numberDiff line change
@@ -569,35 +569,39 @@
569569
</p:panel>
570570

571571
<p:panel rendered="#{pharmacyPurchaseController.printPreview}">
572-
<p:panel class="m-0 p-0" >
573-
<f:facet name="header" >
574-
<div class="d-flex align-items-center justify-content-between">
575-
<div>
576-
<h:outputText styleClass="fa-solid fa-circle-plus" />
577-
<h:outputLabel value="Direct Purchase Order" class="mx-4"></h:outputLabel>
578-
</div>
579-
<div>
580-
<p:commandButton
581-
ajax="false"
582-
class="ui-button-success"
583-
icon="fa fa-plus"
584-
action="#{pharmacyPurchaseController.makeNull()}"
585-
value="New Bill"/>
586-
<p:commandButton
587-
value="Print"
588-
ajax="false"
589-
action="#"
590-
class="ui-button-info mx-2"
591-
icon="fas fa-print">
592-
<p:printer target="gpBillPreview" ></p:printer>
593-
</p:commandButton>
594-
</div>
572+
<f:facet name="header" >
573+
<div class="d-flex align-items-center justify-content-between">
574+
<div>
575+
<h:outputText styleClass="fa-solid fa-circle-plus" />
576+
<h:outputLabel value="Direct Purchase Order" class="mx-4"></h:outputLabel>
595577
</div>
596-
</f:facet>
597-
<p:panel id="gpBillPreview">
598-
<pharmacy:purhcase bill="#{pharmacyPurchaseController.bill}"/>
599-
</p:panel>
600-
</p:panel>
578+
<div>
579+
<p:commandButton
580+
value="Print"
581+
ajax="false"
582+
action="#"
583+
class="ui-button-info mx-2"
584+
icon="fas fa-print">
585+
<p:printer target="gpBillPreview" ></p:printer>
586+
</p:commandButton>
587+
<p:commandButton
588+
ajax="false"
589+
class="ui-button-success"
590+
icon="fa fa-plus"
591+
action="#{pharmacyPurchaseController.makeNull()}"
592+
value="New Bill"/>
593+
594+
</div>
595+
</div>
596+
</f:facet>
597+
<h:panelGroup id="gpBillPreview" >
598+
<pharmacy:purhcase
599+
bill="#{pharmacyPurchaseController.bill}"
600+
ShowProfit="#{configOptionApplicationController.getBooleanValueByKey('Show Profit % in Direct Purchase Bill', true)}"
601+
ShowRetailValue="#{configOptionApplicationController.getBooleanValueByKey('Show Retail Value in Direct Purchase Bill', true)}">
602+
</pharmacy:purhcase>
603+
</h:panelGroup>
604+
601605
</p:panel>
602606
</h:form>
603607
</ui:define>

0 commit comments

Comments
 (0)