Skip to content

Commit

Permalink
Merge pull request #9929 from hmislk/Issue#9852_Consumption_report
Browse files Browse the repository at this point in the history
Issue#9852 consumption report  Closes #9852
  • Loading branch information
Irani96 authored Jan 1, 2025
2 parents a68c787 + e5abbeb commit 3d12302
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,17 @@ private CancelledBill createCancelledBillInstance(Bill b) {
sessionController.getLoggedUser().getDepartment(), getBill().getBillType(), BillClassType.PreBill, BillNumberSuffix.ISSCAN));
c.setInsId(getBillNumberBean().institutionBillNumberGenerator(
sessionController.getLoggedUser().getInstitution(), getBill().getBillType(), BillClassType.PreBill, BillNumberSuffix.ISSCAN));
c.setInstitution(sessionController.getLoggedUser().getInstitution());
c.setDepartment(sessionController.getLoggedUser().getDepartment());
c.setCreatedAt(new Date());
c.setCreater(sessionController.getLoggedUser());
c.setComments("Re Add To Stock");
c.setBackwardReferenceBill(b);
c.setReferenceBill(b);
c.setBillClassType(BillClassType.CancelledBill);
c.setBillType(BillType.PharmacyIssue);
c.setBillTypeAtomic(BillTypeAtomic.PHARMACY_ISSUE_CANCELLED);

if (c.getId() == null) {
getBillFacade().create(c);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,8 +1026,8 @@ public void generateConsumptionReportTableByBill(BillType billType) {
JsfUtil.addErrorMessage(e, " Something Went Worng!");
}
totalPurchase = 0.0;
for (Bill i : bills) {
totalPurchase += i.getPaidAmount();
for (Bill b : bills) {
totalPurchase += b.getStockBill().getStockValueAtPurchaseRates();
}

}
Expand Down
16 changes: 3 additions & 13 deletions src/main/webapp/reports/inventoryReports/consumption.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -286,24 +286,14 @@
<h:outputText value="#{b.invoiceNumber}" />
</p:column>

<p:column headerText="Cancel No" width="10em">
<p:column headerText="Cancel No" width="5em">
<h:outputText value="#{b.cancelledBill.deptId}" />
</p:column>

<p:column headerText="Purchase Rate Value" width="4em" style="text-align: right;">
<h:outputText value="#{b.stockBill.stockValueAtPurchaseRates}" >
<f:convertNumber pattern="#,##0.00"/>
</h:outputText>
<f:facet name="footer">
<h:outputLabel value="#{pharmacyController.stockAverages}" >
<f:convertNumber pattern="#,##0.00"/></h:outputLabel>
</f:facet>
</p:column>

<p:column headerText="Retail Sale Value" width="4em" style="text-align: right;">
<h:outputText value="#{b.stockBill.stockValueAsSaleRate}" >
<f:convertNumber pattern="#,##0.00"/>
</h:outputText>
<f:facet name="footer">
<h:outputLabel value="#{pharmacyController.totalPurchase}" >
<f:convertNumber pattern="#,##0.00"/></h:outputLabel>
Expand Down Expand Up @@ -365,11 +355,11 @@
<p:outputLabel value="#{i.item.category.name}" />
</p:column>

<p:column headerText="Quantity" width="6em" style="text-align: right;">
<p:column headerText="Quantity" width="4em" style="text-align: right; padding-right: 20px;">
<p:outputLabel value="#{i.qty}" />
</p:column>

<p:column headerText="Cancel No" width="10em">
<p:column headerText="Cancel No" width="5em">
<p:outputLabel value="#{i.bill.cancelledBill.deptId}" />
</p:column>

Expand Down

0 comments on commit 3d12302

Please sign in to comment.