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

10555 consumption report bugfixes #10610

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 13 additions & 7 deletions src/main/java/com/divudi/bean/pharmacy/PharmacyController.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@
import com.divudi.data.dataStructure.ItemTransactionSummeryRow;
import com.divudi.data.dataStructure.StockAverage;

import com.divudi.entity.Bill;
import com.divudi.entity.BillItem;
import com.divudi.entity.BilledBill;
import com.divudi.entity.Category;
import com.divudi.entity.Department;
import com.divudi.entity.Institution;
import com.divudi.entity.Item;
import com.divudi.entity.*;
import com.divudi.entity.pharmacy.Amp;
import com.divudi.entity.pharmacy.Ampp;
import com.divudi.entity.pharmacy.Atm;
Expand Down Expand Up @@ -972,6 +966,18 @@ public void generateGrnReportTable() {
calculateTotals(bills);
}

public static String formatDate(Date date) {
if (date == null) {
return "";
}

UserPreference userPreference = new UserPreference();
String pattern = userPreference.getLongDateTimeFormat();

SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format(date);
}

public void createConsumptionReportTable() {
resetFields();

Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/reports/inventoryReports/consumption.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@
width="6em"
filterMatchMode="contains"
sortBy="#{b.createdAt}"
filterBy="#{b.createdAt}">
filterBy="#{pharmacyController.formatDate(b.createdAt)}">
<h:outputText value="#{b.createdAt}">
<f:convertDateTime
pattern="#{sessionController.applicationPreference.longDateTimeFormat}"/>
</h:outputText>
</p:column>

<p:column headerText="Documnet Created By" width="10em">
<p:column headerText="Document Created By" width="10em">
<h:outputText value="#{b.creater.webUserPerson.name}"/>
</p:column>

Expand Down Expand Up @@ -509,7 +509,7 @@
width="8em"
filterMatchMode="contains"
sortBy="#{i.bill.createdAt}"
filterBy="#{i.bill.createdAt}">
filterBy="#{pharmacyController.formatDate(i.bill.createdAt)}">
<p:outputLabel value="#{i.bill.createdAt}">
<f:convertDateTime
pattern="#{sessionController.applicationPreference.longDateTimeFormat}"/>
Expand Down