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#9674 improvements closing stock #9726

Merged
merged 18 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
6f661bf
Signed-off-by: Dr M H B Ariyaratne <buddhika.ari@gmail.com>
buddhika75 Dec 17, 2024
bfc942e
Merge branch '#9639_Initiate_Process' of https://github.com/hmislk/hm…
buddhika75 Dec 17, 2024
e9cd708
Merge branch 'Issue#9645_list_ongoing_processes' of https://github.co…
buddhika75 Dec 17, 2024
443f996
Merge branch 'Issue#9647_list_completed_processes' of https://github.…
buddhika75 Dec 17, 2024
264f71c
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
buddhika75 Dec 18, 2024
a4ba25b
Merge branch 'Issue#9708_Upload_PDF_Issue' of https://github.com/hmis…
buddhika75 Dec 18, 2024
540905e
Merge branch '#9708_Upload_PDF_Issue' of https://github.com/hmislk/hm…
buddhika75 Dec 18, 2024
a5d9811
Merge branch '#9718_Upload_Report_in_Sample_Management' of https://gi…
buddhika75 Dec 18, 2024
deac79a
Merge branch '#9719_Upload_Report_View_in_Courier_Section' of https:/…
buddhika75 Dec 18, 2024
9f0520d
Signed-off-by: Buddhika Ariyaratne <buddhika.ari@gmail.com>
buddhika75 Dec 19, 2024
cf61121
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 19, 2024
8cf2d49
Merge branch 'Issue#9570_F15_report' of https://github.com/hmislk/hmi…
SandithP2001 Dec 19, 2024
38e7d69
Merge branch '9456-phamacy_disbursement_and_procument_improvements' o…
SandithP2001 Dec 19, 2024
1358b0b
Merge branch 'Issue-#9653-Route-Analysis-Report' of https://github.co…
SandithP2001 Dec 19, 2024
58425d4
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 19, 2024
9a97d03
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 19, 2024
4b2ab1d
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 19, 2024
552c0ec
Merge branch 'development' into issue#9674_Improvements_Closing_Stock
SandithP2001 Dec 20, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,30 @@ public ReportTemplate findReportTemplateByName(String name) {
public List<ReportTemplate> completeReportTemplate(String qry) {
List<ReportTemplate> list;
String jpql;
HashMap params = new HashMap();
jpql = "select c from ReportTemplate c "
+ " where c.retired=false "
+ " and (c.name) like :q "
+ " order by c.name";
params.put("q", "%" + qry.toUpperCase() + "%");
HashMap<String, Object> params = new HashMap<>();
jpql = "SELECT c FROM ReportTemplate c "
+ "WHERE c.retired = false "
+ "AND (LOWER(c.name) LIKE :q OR LOWER(c.code) LIKE :q) "
+ "ORDER BY c.name";
params.put("q", "%" + qry.toLowerCase() + "%");
list = getFacade().findByJpql(jpql, params);

if (list == null) {
list = new ArrayList<>();
}
return list;
}

public List<ReportTemplate> completeRootReportTemplate(String qry) {
List<ReportTemplate> list;
String jpql;
HashMap<String, Object> params = new HashMap<>();
jpql = "SELECT c FROM ReportTemplate c "
+ "WHERE c.retired = false "
+ "AND c.parent is null "
+ "AND (LOWER(c.name) LIKE :q OR LOWER(c.code) LIKE :q) "
+ "ORDER BY c.name";
params.put("q", "%" + qry.toLowerCase() + "%");
list = getFacade().findByJpql(jpql, params);

if (list == null) {
Expand Down Expand Up @@ -223,7 +241,6 @@ public ReportTemplateRowBundle generateValueByDepartmentReport(

jpql += " group by bill.department";


// Assuming you have an EJB or similar service to run the query
List<ReportTemplateRow> results = (List<ReportTemplateRow>) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.TIMESTAMP);

Expand All @@ -244,7 +261,7 @@ public ReportTemplateRowBundle generateBillReport(
Institution paramSite,
Boolean excludeCredit,
Boolean creditOnly) {
System.out.println("generateBillReport = " );
System.out.println("generateBillReport = ");
System.out.println("creditOnly = " + creditOnly);
System.out.println("excludeCredit = " + excludeCredit);

Expand Down Expand Up @@ -321,7 +338,7 @@ public ReportTemplateRowBundle generateBillReport(

return pb;
}

public ReportTemplateRowBundle generateBillReportWithoutProfessionalFees(
List<BillTypeAtomic> btas,
Date paramFromDate,
Expand Down Expand Up @@ -371,7 +388,6 @@ public ReportTemplateRowBundle generateBillReportWithoutProfessionalFees(

jpql += " group by bill";


// Assuming you have an EJB or similar service to run the query
List<ReportTemplateRow> results = (List<ReportTemplateRow>) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.TIMESTAMP);

Expand Down Expand Up @@ -411,9 +427,9 @@ public ReportTemplateRowBundle generateBillReportWithoutProfessionalFees(
jpql += " and bill.billTypeAtomic in :btas ";
parameters.put("btas", btas);
}
if(creditBillsOnly!=null && creditBillsOnly){
jpql += " and bill.paymentMethod in :pms ";

if (creditBillsOnly != null && creditBillsOnly) {
jpql += " and bill.paymentMethod in :pms ";
parameters.put("pms", PaymentMethod.getMethodsByType(PaymentType.NON_CREDIT));
}

Expand Down Expand Up @@ -444,7 +460,6 @@ public ReportTemplateRowBundle generateBillReportWithoutProfessionalFees(

jpql += " group by bill";


// Assuming you have an EJB or similar service to run the query
List<ReportTemplateRow> results = (List<ReportTemplateRow>) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.TIMESTAMP);

Expand Down Expand Up @@ -512,7 +527,6 @@ public ReportTemplateRowBundle generatePaymentReport(

jpql += " group by p";


// Assuming you have an EJB or similar service to run the query
List<ReportTemplateRow> results = (List<ReportTemplateRow>) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.TIMESTAMP);

Expand Down Expand Up @@ -1599,7 +1613,6 @@ private ReportTemplateRowBundle handleBillTypeAtomicTotalUsingBills(
parameters.put("wu", paramUser);
}


Double sumResult = ejbFacade.findSingleResultByJpql(jpql, parameters, TemporalType.DATE);

if (sumResult != null) {
Expand Down Expand Up @@ -2177,7 +2190,6 @@ private ReportTemplateRowBundle handleItemDepartmentummaryByBill(
Long paramStartId,
Long paramEndId) {


String jpql;
Map<String, Object> parameters = new HashMap<>();
ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
Expand Down Expand Up @@ -2264,7 +2276,6 @@ private ReportTemplateRowBundle handleItemDepartmentummaryByBill(
// + " and bi.item.department is not null ";
jpql += " group by bi.item.department ";


List<ReportTemplateRow> rs = (List<ReportTemplateRow>) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.TIMESTAMP);

if (rs == null || rs.isEmpty()) {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/divudi/bean/report/PharmacyReportController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,11 @@ public void processClosingStockBatchWiseReport() {
jpql.append("and sh.institution = :ins ");
params.put("ins", institution);
}

if (site != null) {
jpql.append("and sh.department.site = :sit ");
params.put("sit", site);
}

if (department != null) {
jpql.append("and sh.department = :dep ");
Expand Down Expand Up @@ -2054,6 +2059,11 @@ public void processClosingStockItemWiseReport() {
jpql.append("and sh.institution = :ins ");
params.put("ins", institution);
}

if (site != null) {
jpql.append("and sh.department.site = :sit ");
params.put("sit", site);
}

if (department != null) {
jpql.append("and sh.department = :dep ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public enum ReportTemplateType {
ITEM_SUMMARY_BY_BILL("Item Summary by Bill"),
TO_DEPARTMENT_SUMMARY_BY_BILL_FEE("To Department Summary by Bill Fee"),
TO_DEPARTMENT_SUMMARY_BY_BILL_ITEM("To Department Summary by Bill Item"),
TO_DEPARTMENT_SUMMARY_BY_BILL("To Department Summary by Bill");
TO_DEPARTMENT_SUMMARY_BY_BILL("To Department Summary by Bill"),
ANNUAL_AND_DAILY_SUMMARY_RECORD_LIST("Annual and Daily Summary Record List");

;

Expand Down
25 changes: 25 additions & 0 deletions src/main/java/com/divudi/entity/ReportTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@
public class ReportTemplate implements Serializable {

private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Enumerated
private ReportTemplateType reportTemplateType;

private ReportTemplate parent;

private String name;
private String code;
@Lob
Expand All @@ -50,6 +53,8 @@ public class ReportTemplate implements Serializable {
@Lob
private String columns;
@Lob
private String rows;
@Lob
private String totals;

//Created Properties
Expand Down Expand Up @@ -245,6 +250,8 @@ public void setBillTypes(String billTypes) {
this.billTypeAtomics = null;
this.billTypes = billTypes;
}




@Transient
Expand Down Expand Up @@ -334,4 +341,22 @@ public List<ReportTemplateFilter> getReportFilters() {
return reportFilters;
}

public String getRows() {
return rows;
}

public void setRows(String rows) {
this.rows = rows;
}

public ReportTemplate getParent() {
return parent;
}

public void setParent(ReportTemplate parent) {
this.parent = parent;
}



}
114 changes: 114 additions & 0 deletions src/main/java/com/divudi/entity/web/DesignComponentAssignment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.divudi.entity.web;

import com.divudi.entity.process.ProcessDefinition;
import com.divudi.entity.process.ProcessStepActionDefinition;
import com.divudi.entity.process.ProcessStepDefinition;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
*
* @author buddhika
*/
@Entity
public class DesignComponentAssignment implements Serializable {

private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@ManyToOne
private DesignComponent designComponent;
private String assignedEntityType;
@ManyToOne
private ProcessDefinition processDefinition;
@ManyToOne
private ProcessStepDefinition processStepDefinition;
@ManyToOne
private ProcessStepActionDefinition processStepActionDefinition;


public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}



@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}

@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof DesignComponentAssignment)) {
return false;
}
DesignComponentAssignment other = (DesignComponentAssignment) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}

@Override
public String toString() {
return "com.divudi.entity.web.DesignComponentAssignment[ id=" + id + " ]";
}

public ProcessDefinition getProcessDefinition() {
return processDefinition;
}

public void setProcessDefinition(ProcessDefinition processDefinition) {
this.processDefinition = processDefinition;
}

public ProcessStepDefinition getProcessStepDefinition() {
return processStepDefinition;
}

public void setProcessStepDefinition(ProcessStepDefinition processStepDefinition) {
this.processStepDefinition = processStepDefinition;
}

public ProcessStepActionDefinition getProcessStepActionDefinition() {
return processStepActionDefinition;
}

public void setProcessStepActionDefinition(ProcessStepActionDefinition processStepActionDefinition) {
this.processStepActionDefinition = processStepActionDefinition;
}

public DesignComponent getDesignComponent() {
return designComponent;
}

public void setDesignComponent(DesignComponent designComponent) {
this.designComponent = designComponent;
}

public String getAssignedEntityType() {
return assignedEntityType;
}

public void setAssignedEntityType(String assignedEntityType) {
this.assignedEntityType = assignedEntityType;
}

}
26 changes: 25 additions & 1 deletion src/main/webapp/dataAdmin/report_template.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@
<!-- Code -->
<p:outputLabel value="Code:" for="code" />
<p:inputText id="code" value="#{reportTemplateController.current.code}" class="w-100"/>

<!-- Parent -->
<p:outputLabel value="Parent:" for="parent" />
<p:autoComplete
id="parent"
completeMethod="#{reportTemplateController.completeReportTemplate}"
value="#{reportTemplateController.current.parent}" class="w-100"
var =" rt"
itemLabel="#{rt.name}"
itemValue="#{rt}"
>
</p:autoComplete>

<!-- Description -->
<p:outputLabel value="Description:" for="description" />
Expand Down Expand Up @@ -90,7 +102,7 @@


<!-- Columns -->
<p:outputLabel value="Columns:" for="columns" />
<p:outputLabel value="Columns Codes:" for="columns" />
<p:inputTextarea id="columns"
queryDelay="0"
placeholder="Enter Columns"
Expand All @@ -100,6 +112,18 @@
completeMethod="#{enumController.completeReportTemplateColumns}"
minQueryLength="1">
</p:inputTextarea>

<!-- Columns -->
<p:outputLabel value="Row Codes:" for="columns" />
<p:inputTextarea id="rows"
queryDelay="0"
placeholder="Enter Columns"
class="w-100 my-2"
autoResize="true"
value="#{reportTemplateController.current.rows}"
completeMethod="#{enumController.completeReportTemplateColumns}"
minQueryLength="1">
</p:inputTextarea>

<!-- Totals -->
<p:outputLabel value="Totals:" for="totals" />
Expand Down
10 changes: 2 additions & 8 deletions src/main/webapp/forms/data_entry_items.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@
<p:column headerText="Code">
<h:outputText value="#{i.code}" ></h:outputText>
</p:column>
<p:column headerText="Description">
<h:outputText value="#{i.description}" ></h:outputText>
</p:column>
<p:column headerText="Code">
<h:outputText value="#{i.componentDataType}" ></h:outputText>
</p:column>
<p:column headerText="Code">
<h:outputText value="#{i.componentPresentationType}" ></h:outputText>
<p:column headerText="Mapping Type">
<h:outputText value="#{i.componentMappingType}" ></h:outputText>
</p:column>
<p:column headerText="Actions">
<p:commandButton ajax="false"
Expand Down
Loading