Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#4671 #4676

Merged
merged 18 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/build/
/dist/
/target/
/src/main/resources/version.txt
/src/main/resources/VERSION.txt
/src/main/webapp/WEB-INF/glassfish-resources.xml
/faces-config.NavData
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ public double addBillItemSingleItem() {
JsfUtil.addErrorMessage("Please not select Expired Items");
return addedQty;
}
System.out.println("getQty() = " + getQty());
if (getQty() == null) {
errorMessage = "Quantity?";
JsfUtil.addErrorMessage("Quantity?");
Expand Down Expand Up @@ -1032,6 +1033,7 @@ public double addBillItemSingleItem() {
return addedQty;
}
addedQty = qty;
System.out.println("qty = " + qty);
billItem.getPharmaceuticalBillItem().setQtyInUnit((double) (0 - qty));
billItem.getPharmaceuticalBillItem().setStock(stock);
billItem.getPharmaceuticalBillItem().setItemBatch(getStock().getItemBatch());
Expand All @@ -1053,13 +1055,13 @@ public double addBillItemSingleItem() {
billItem.setTransUserStock(us);
clearBillItem();
getBillItem();
System.out.println("addedQty = " + addedQty);
return addedQty;
}

public void addBillItemMultipleBatches() {
editingQty = null;
errorMessage = null;


if (billItem == null) {
return;
Expand All @@ -1072,11 +1074,12 @@ public void addBillItemMultipleBatches() {
JsfUtil.addErrorMessage("Please select an Item Batch to Dispense?");
return;
}
Stock userSelectedStock = stock;
Stock userSelectedStock = stock;
// if (getStock().getItemBatch().getDateOfExpire().before(commonController.getCurrentDateTime())) {
// JsfUtil.addErrorMessage("You are NOT allowed to select Expired Items");
// return;
// }
System.out.println("getQty() = " + getQty());
if (getQty() == null) {
errorMessage = "Please enter a Quantity";
JsfUtil.addErrorMessage("Quantity?");
Expand All @@ -1092,6 +1095,8 @@ public void addBillItemMultipleBatches() {
double addedQty = 0.0;
double remainingQty = getQty();

System.out.println("getQty = " + getQty());
System.out.println("getStock().getStock() = " + getStock().getStock());
if (getQty() <= getStock().getStock()) {
double thisTimeAddingQty = addBillItemSingleItem();
if (thisTimeAddingQty >= requestedQty) {
Expand All @@ -1111,7 +1116,6 @@ public void addBillItemMultipleBatches() {
// System.out.println("stock = " + userSelectedStock);
// System.out.println("stock item batch = " + userSelectedStock.getItemBatch());
// System.out.println("stock item batch item= " + userSelectedStock.getItemBatch().getItem());

List<Stock> availableStocks = stockController.findNextAvailableStocks(userSelectedStock);
for (Stock s : availableStocks) {
stock = s;
Expand Down
2 changes: 1 addition & 1 deletion 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/digasiri</jta-data-source>
<jta-data-source>jdbc/arogya</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/VERSION.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/version.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
headerText="Stocks"
styleClass="#{commonController.currentDateTime > i.itemBatch.dateOfExpire ?'ui-messages-fatal': commonController.dateAfterThreeMonthsCurrentDateTime > i.itemBatch.dateOfExpire ?'ui-messages-warn':''}">
<h:outputText value="#{i.stock}" >
<f:convertNumber pattern="#,###" ></f:convertNumber>
<f:convertNumber pattern="#,###.##" ></f:convertNumber>
</h:outputText>
</p:column>
<p:column
Expand Down
8 changes: 7 additions & 1 deletion src/main/webapp/pharmacy/pharmacy_bill_retail_sale.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,13 @@
<f:convertNumber pattern="#,##0.00" />
</h:outputLabel>
<h:outputLabel value="Tendered" ></h:outputLabel>
<p:inputText class="mx-4 my-1" autocomplete="off" accesskey="t" id="paid" value="#{pharmacySaleController.cashPaid}" >
<p:inputText
class="mx-4 my-1"
autocomplete="off"
accesskey="t"
id="paid"
value="#{pharmacySaleController.cashPaid}"
onfocus="this.select()">
<p:ajax process="total dis netTotal paid" update="balance netTotal" event="blur"/>
</p:inputText>
<h:outputLabel value="Balance" ></h:outputLabel>
Expand Down
7 changes: 4 additions & 3 deletions src/main/webapp/resources/pharmacy/adjustmentBill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@
<h:outputLabel value="Before Qty" style="font-weight: bold!important;" />
</f:facet>
<h:outputLabel value="#{bip.pharmaceuticalBillItem.stockHistory.stockQty}">
<f:convertNumber integerOnly="true"/>
<f:convertNumber pattern="#,###.##"/>
</h:outputLabel>
#{bip.pharmaceuticalBillItem.stockHistory.id}
</p:column>

<p:column style="text-align: right!important;">
<f:facet name="header">
<h:outputLabel value="Changed Qty" style="font-weight: bold!important;" />
</f:facet>
<h:outputLabel value="#{bip.pharmaceuticalBillItem.qty}">
<f:convertNumber integerOnly="true"/>
<f:convertNumber pattern="#,###.##"/>
</h:outputLabel>
</p:column>

Expand All @@ -85,7 +86,7 @@
<h:outputLabel value="After QTY" style="font-weight: bold!important;" />
</f:facet>
<h:outputLabel value="#{bip.pharmaceuticalBillItem.qty + bip.pharmaceuticalBillItem.stockHistory.stockQty}">
<f:convertNumber integerOnly="true"/>
<f:convertNumber pattern="#,###.##"/>
</h:outputLabel>
</p:column>

Expand Down