dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31032
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15780: local/in RBF work in progress
------------------------------------------------------------
revno: 15780
committer: Mithilesh Kumar Thakur <mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-06-20 11:21:56 +0100
message:
local/in RBF work in progress
added:
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRate.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRateService.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRateStore.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultUtilizationRateService.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateUtilizationRateStore.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/AddUtilizationRateAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/GetUtilizationRateListAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/GetUtilizationRuleDataElementListAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/RemoveUtilizationRateAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/ShowAddUtilizationRateFormAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/ShowUpdateUtilizationRateFormAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/UpdateUtilizationRateAction.java
local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/UtilizationRate.hbm.xml
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/addUtilizationRateForm.vm
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/images/ajax-loader.gif
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/images/deleteRed.png
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/utilizationRule.js
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/updateUtilizationRateForm.vm
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/utilizationRateList.vm
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/utilizationRuleDataElements.vm
modified:
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PBFDataValue.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/PageInitAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateBankDetailsStore.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernatePBFDataValueStore.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityMaxValueStore.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/report/action/PBFReportFormAction.java
local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/PBFDataValue.hbm.xml
local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties
local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PBFDataValue.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PBFDataValue.java 2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PBFDataValue.java 2014-06-20 10:21:56 +0000
@@ -8,22 +8,25 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
-public class PBFDataValue implements Serializable
+@SuppressWarnings( "serial" )
+public class PBFDataValue implements Serializable
{
private OrganisationUnit organisationUnit;
-
+
private DataElement dataElement;
-
+
private DataSet dataSet;
private Period period;
private Integer quantityReported;
-
+
private Integer quantityValidated;
-
+
+ private Integer quantityExternalVerification;
+
private Double tariffAmount;
-
+
private String storedBy;
private Date timestamp;
@@ -35,10 +38,11 @@
// -------------------------------------------------------------------------
public PBFDataValue()
{
-
+
}
-
- public PBFDataValue( OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet, Period period, Integer quantityReported, Integer quantityValidated, Double tariffAmount )
+
+ public PBFDataValue( OrganisationUnit organisationUnit, DataElement dataElement, DataSet dataSet, Period period,
+ Integer quantityReported, Integer quantityValidated, Integer quantityExternalVerification, Double tariffAmount )
{
this.organisationUnit = organisationUnit;
this.dataElement = dataElement;
@@ -46,6 +50,7 @@
this.period = period;
this.quantityReported = quantityReported;
this.quantityValidated = quantityValidated;
+ this.quantityExternalVerification = quantityExternalVerification;
this.tariffAmount = tariffAmount;
}
@@ -73,7 +78,8 @@
final PBFDataValue other = (PBFDataValue) o;
- return dataElement.equals( other.getDataElement() ) && dataSet.equals( other.getDataSet() ) && organisationUnit.equals( other.getOrganisationUnit() ) && period.equals( other.getPeriod() );
+ return dataElement.equals( other.getDataElement() ) && dataSet.equals( other.getDataSet() )
+ && organisationUnit.equals( other.getOrganisationUnit() ) && period.equals( other.getPeriod() );
}
@Override
@@ -94,103 +100,113 @@
// Getters and setters
// -------------------------------------------------------------------------
- public OrganisationUnit getOrganisationUnit()
- {
- return organisationUnit;
- }
-
- public void setOrganisationUnit(OrganisationUnit organisationUnit)
- {
- this.organisationUnit = organisationUnit;
- }
-
- public DataElement getDataElement()
- {
- return dataElement;
- }
-
- public void setDataElement(DataElement dataElement)
- {
- this.dataElement = dataElement;
- }
-
- public DataSet getDataSet()
- {
- return dataSet;
- }
-
- public void setDataSet(DataSet dataSet)
- {
- this.dataSet = dataSet;
- }
-
- public Period getPeriod()
- {
- return period;
- }
-
- public void setPeriod(Period period)
- {
- this.period = period;
- }
-
- public Integer getQuantityReported()
- {
- return quantityReported;
- }
-
- public void setQuantityReported(Integer quantityReported)
- {
- this.quantityReported = quantityReported;
- }
-
- public Integer getQuantityValidated()
- {
- return quantityValidated;
- }
-
- public void setQuantityValidated(Integer quantityValidated)
- {
- this.quantityValidated = quantityValidated;
- }
-
- public Double getTariffAmount()
- {
- return tariffAmount;
- }
-
- public void setTariffAmount(Double tariffAmount)
- {
- this.tariffAmount = tariffAmount;
- }
-
- public String getStoredBy()
- {
- return storedBy;
- }
-
- public void setStoredBy(String storedBy)
- {
- this.storedBy = storedBy;
- }
-
- public Date getTimestamp()
- {
- return timestamp;
- }
-
- public void setTimestamp(Date timestamp)
- {
- this.timestamp = timestamp;
- }
-
- public String getComment()
- {
- return comment;
- }
-
- public void setComment(String comment)
- {
- this.comment = comment;
- }
+ public OrganisationUnit getOrganisationUnit()
+ {
+ return organisationUnit;
+ }
+
+ public void setOrganisationUnit( OrganisationUnit organisationUnit )
+ {
+ this.organisationUnit = organisationUnit;
+ }
+
+ public DataElement getDataElement()
+ {
+ return dataElement;
+ }
+
+ public void setDataElement( DataElement dataElement )
+ {
+ this.dataElement = dataElement;
+ }
+
+ public DataSet getDataSet()
+ {
+ return dataSet;
+ }
+
+ public void setDataSet( DataSet dataSet )
+ {
+ this.dataSet = dataSet;
+ }
+
+ public Period getPeriod()
+ {
+ return period;
+ }
+
+ public void setPeriod( Period period )
+ {
+ this.period = period;
+ }
+
+ public Integer getQuantityReported()
+ {
+ return quantityReported;
+ }
+
+ public void setQuantityReported( Integer quantityReported )
+ {
+ this.quantityReported = quantityReported;
+ }
+
+ public Integer getQuantityValidated()
+ {
+ return quantityValidated;
+ }
+
+ public void setQuantityValidated( Integer quantityValidated )
+ {
+ this.quantityValidated = quantityValidated;
+ }
+
+ public Integer getQuantityExternalVerification()
+ {
+ return quantityExternalVerification;
+ }
+
+ public void setQuantityExternalVerification( Integer quantityExternalVerification )
+ {
+ this.quantityExternalVerification = quantityExternalVerification;
+ }
+
+ public Double getTariffAmount()
+ {
+ return tariffAmount;
+ }
+
+ public void setTariffAmount( Double tariffAmount )
+ {
+ this.tariffAmount = tariffAmount;
+ }
+
+ public String getStoredBy()
+ {
+ return storedBy;
+ }
+
+ public void setStoredBy( String storedBy )
+ {
+ this.storedBy = storedBy;
+ }
+
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp( Date timestamp )
+ {
+ this.timestamp = timestamp;
+ }
+
+ public String getComment()
+ {
+ return comment;
+ }
+
+ public void setComment( String comment )
+ {
+ this.comment = comment;
+ }
}
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRate.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRate.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRate.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,159 @@
+package org.hisp.dhis.rbf.api;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.hisp.dhis.dataelement.DataElement;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class UtilizationRate implements Serializable
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private DataElement dataElement;
+
+ private Double startRange;
+
+ private Double endRange;
+
+ private Double tariff;
+
+ private String storedBy;
+
+ private Date timestamp;
+
+
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+ public UtilizationRate()
+ {
+
+ }
+
+ public UtilizationRate( DataElement dataElement, Double startRange, Double endRange, Double tariff )
+ {
+ this.dataElement = dataElement;
+ this.startRange = startRange;
+ this.endRange = endRange;
+ this.tariff = tariff;
+ }
+
+ public UtilizationRate( DataElement dataElement, Double startRange, Double endRange, Double tariff, String storedBy, Date timestamp )
+ {
+ this.dataElement = dataElement;
+ this.startRange = startRange;
+ this.endRange = endRange;
+ this.tariff = tariff;
+ this.storedBy = storedBy;
+ this.timestamp = timestamp;
+ }
+
+ // -------------------------------------------------------------------------
+ // hashCode and equals
+ // -------------------------------------------------------------------------
+ @Override
+ public boolean equals( Object o )
+ {
+ if ( this == o )
+ {
+ return true;
+ }
+
+ if ( o == null )
+ {
+ return false;
+ }
+
+ if ( !(o instanceof UtilizationRate) )
+ {
+ return false;
+ }
+
+ final UtilizationRate other = (UtilizationRate) o;
+
+ return dataElement.equals( other.getDataElement() );
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+
+ result = result * prime + dataElement.hashCode();
+
+ return result;
+ }
+
+ // -------------------------------------------------------------------------
+ // Getters and setters
+ // -------------------------------------------------------------------------
+
+ public DataElement getDataElement()
+ {
+ return dataElement;
+ }
+
+ public void setDataElement( DataElement dataElement )
+ {
+ this.dataElement = dataElement;
+ }
+
+ public Double getStartRange()
+ {
+ return startRange;
+ }
+
+ public void setStartRange( Double startRange )
+ {
+ this.startRange = startRange;
+ }
+
+ public Double getEndRange()
+ {
+ return endRange;
+ }
+
+ public void setEndRange( Double endRange )
+ {
+ this.endRange = endRange;
+ }
+
+ public Double getTariff()
+ {
+ return tariff;
+ }
+
+ public void setTariff( Double tariff )
+ {
+ this.tariff = tariff;
+ }
+
+ public String getStoredBy()
+ {
+ return storedBy;
+ }
+
+ public void setStoredBy( String storedBy )
+ {
+ this.storedBy = storedBy;
+ }
+
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp( Date timestamp )
+ {
+ this.timestamp = timestamp;
+ }
+
+}
+
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRateService.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRateService.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRateService.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,31 @@
+package org.hisp.dhis.rbf.api;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.hisp.dhis.dataelement.DataElement;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public interface UtilizationRateService
+{
+ String ID = UtilizationRateService.class.getName();
+
+ void addUtilizationRate( UtilizationRate utilizationRate );
+
+ void updateUtilizationRate( UtilizationRate utilizationRate );
+
+ void deleteUtilizationRate( UtilizationRate utilizationRate );
+
+ UtilizationRate getUtilizationRate( DataElement dataElement, Double startRange, Double endRange );
+
+ Collection<UtilizationRate> getAllUtilizationRate();
+
+ Collection<UtilizationRate> getUtilizationRates( DataElement dataElement );
+
+ Double getUtilizationRateTariffValue( DataElement dataElement, Double startRange, Double endRange );
+
+ Map<Integer, String>getUtilizationRates();
+
+}
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRateStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRateStore.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/UtilizationRateStore.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,31 @@
+package org.hisp.dhis.rbf.api;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.hisp.dhis.dataelement.DataElement;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public interface UtilizationRateStore
+{
+ String ID = UtilizationRateStore.class.getName();
+
+ void addUtilizationRate( UtilizationRate utilizationRate );
+
+ void updateUtilizationRate( UtilizationRate utilizationRate );
+
+ void deleteUtilizationRate( UtilizationRate utilizationRate );
+
+ UtilizationRate getUtilizationRate( DataElement dataElement, Double startRange, Double endRange );
+
+ Collection<UtilizationRate> getAllUtilizationRate();
+
+ Collection<UtilizationRate> getUtilizationRates( DataElement dataElement );
+
+ Double getUtilizationRateTariffValue( DataElement dataElement, Double startRange, Double endRange );
+
+ Map<Integer, String>getUtilizationRates();
+
+}
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java 2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java 2014-06-20 10:21:56 +0000
@@ -10,13 +10,16 @@
import java.util.Set;
import org.apache.velocity.tools.generic.NumberTool;
+import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.constant.Constant;
import org.hisp.dhis.constant.ConstantService;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.datavalue.DataValueService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
@@ -29,6 +32,7 @@
import org.hisp.dhis.rbf.api.PBFDataValue;
import org.hisp.dhis.rbf.api.PBFDataValueService;
import org.hisp.dhis.rbf.api.TariffDataValueService;
+import org.hisp.dhis.rbf.api.UtilizationRateService;
import org.hisp.dhis.user.CurrentUserService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,11 +41,11 @@
/**
* @author Mithilesh Kumar Thakur
*/
-public class LoadDataEntryFormAction
- implements Action
+public class LoadDataEntryFormAction implements Action
{
private final static String TARIFF_SETTING_AUTHORITY = "TARIFF_SETTING_AUTHORITY";
-
+ private final static String UTILIZATION_RULE_DATAELEMENT_ATTRIBUTE = "UTILIZATION_RULE_DATAELEMENT_ATTRIBUTE";
+ private final static String UTILIZATION_RATE_DATAELEMENT_ID = "UTILIZATION_RATE_DATAELEMENT_ID";
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -108,9 +112,22 @@
{
this.constantService = constantService;
}
-
+
@Autowired
private OrganisationUnitGroupService orgUnitGroupService;
+
+ private UtilizationRateService utilizationRateService;
+
+ public void setUtilizationRateService( UtilizationRateService utilizationRateService )
+ {
+ this.utilizationRateService = utilizationRateService;
+ }
+
+ @Autowired
+ private DataElementService dataElementService;
+
+ @Autowired
+ private DataElementCategoryService categoryService;
// -------------------------------------------------------------------------
// Comparator
// -------------------------------------------------------------------------
@@ -216,10 +233,32 @@
return nullTool;
}
+ public Map<Integer, String> utilizationRatesMap = new HashMap<Integer, String>();
+
+ public Map<Integer, String> getUtilizationRatesMap()
+ {
+ return utilizationRatesMap;
+ }
+
+ private List<DataElement> utilizationRateDataElements = new ArrayList<DataElement>();
+
+ public List<DataElement> getUtilizationRateDataElements()
+ {
+ return utilizationRateDataElements;
+ }
+
+ private String utilizationRate = "";
+
+ public String getUtilizationRate()
+ {
+ return utilizationRate;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
+
public String execute()
{
dataValueMap = new HashMap<String, String>();
@@ -339,6 +378,7 @@
pbfDataValueMap.put( de, pbfDataValue );
}
}
+
/*
* for( DataElement dataElement : dataElements ) {
@@ -386,7 +426,46 @@
* System.out.println(" decombo ---" + decombo.getId() +" -- " +
* decombo.getName() ); }
*/
-
+
+
+ Constant utilizationRuleAttribute = constantService.getConstantByName( UTILIZATION_RULE_DATAELEMENT_ATTRIBUTE );
+
+ utilizationRateDataElements = new ArrayList<DataElement>();
+
+ for ( DataElement de : dataElements )
+ {
+ Set<AttributeValue> attrValueSet = new HashSet<AttributeValue>( de.getAttributeValues() );
+ for ( AttributeValue attValue : attrValueSet )
+ {
+ if ( attValue.getAttribute().getId() == utilizationRuleAttribute.getValue() && attValue.getValue().equalsIgnoreCase( "true" ) )
+ {
+ utilizationRateDataElements.add( de );
+ }
+ }
+ }
+
+ utilizationRatesMap = new HashMap<Integer, String>( utilizationRateService.getUtilizationRates() );
+
+ /*
+ for( Integer key : utilizationRatesMap.keySet() )
+ {
+ System.out.println( " Key is ---" + key + " -- Value " + utilizationRatesMap.get( key ) );
+ }
+ */
+
+ //-------------------------------------------------------------
+ // Availbale Amount
+ //-------------------------------------------------------------
+ Constant paymentAmount = constantService.getConstantByName( UTILIZATION_RATE_DATAELEMENT_ID );
+ DataElement dataElement = dataElementService.getDataElement( (int) paymentAmount.getValue() );
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
+ DataValue dataValue = dataValueService.getDataValue( dataElement, period, organisationUnit, optionCombo );
+ if ( dataValue != null )
+ {
+ utilizationRate = dataValue.getValue();
+ }
+
+
return SUCCESS;
}
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/PageInitAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/PageInitAction.java 2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/PageInitAction.java 2014-06-20 10:21:56 +0000
@@ -4,6 +4,8 @@
import java.util.Collections;
import java.util.List;
+import org.hisp.dhis.constant.Constant;
+import org.hisp.dhis.constant.ConstantService;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -11,6 +13,7 @@
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.rbf.api.Lookup;
import org.hisp.dhis.rbf.api.LookupService;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -19,6 +22,8 @@
*/
public class PageInitAction implements Action
{
+ private final static String UTILIZATION_RATE_DATAELEMENT_ID = "UTILIZATION_RATE_DATAELEMENT_ID";
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -51,6 +56,8 @@
this.dataSetService = dataSetService;
}
+ @Autowired
+ private ConstantService constantService;
// -------------------------------------------------------------------------
// Input/output
@@ -77,10 +84,18 @@
return dataSets;
}
+ private String utilizationRateDataElementId;
+
+ public String getUtilizationRateDataElementId()
+ {
+ return utilizationRateDataElementId;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
+
public String execute() throws Exception
{
//selectionManager.clearSelectedOrganisationUnits();
@@ -129,6 +144,10 @@
}
*/
+ Constant utilizationRateDeId = constantService.getConstantByName( UTILIZATION_RATE_DATAELEMENT_ID );
+
+ utilizationRateDataElementId = utilizationRateDeId.getValue()+"";
+
return SUCCESS;
}
}
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java 2014-05-08 11:03:37 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java 2014-06-20 10:21:56 +0000
@@ -338,6 +338,11 @@
pbfDataValue.setQuantityValidated( Integer.parseInt( value ) );
}
+ else if( valueType.equals("3") )
+ {
+ pbfDataValue.setQuantityExternalVerification( Integer.parseInt( value ) );
+ }
+
pbfDataValue.setStoredBy(storedBy);
pbfDataValue.setTimestamp(now);
pbfDataValueService.addPBFDataValue(pbfDataValue);
@@ -355,7 +360,12 @@
{
pbfDataValue.setQuantityValidated( Integer.parseInt( value ) );
}
-
+
+ else if( valueType.equals("3") )
+ {
+ pbfDataValue.setQuantityExternalVerification( Integer.parseInt( value ) );
+ }
+
pbfDataValue.setStoredBy(storedBy);
pbfDataValue.setTimestamp(now);
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultUtilizationRateService.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultUtilizationRateService.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultUtilizationRateService.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,78 @@
+package org.hisp.dhis.rbf.impl;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.rbf.api.UtilizationRate;
+import org.hisp.dhis.rbf.api.UtilizationRateService;
+import org.hisp.dhis.rbf.api.UtilizationRateStore;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+@Transactional
+public class DefaultUtilizationRateService implements UtilizationRateService
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private UtilizationRateStore utilizationRateStore;
+
+ public void setUtilizationRateStore( UtilizationRateStore utilizationRateStore )
+ {
+ this.utilizationRateStore = utilizationRateStore;
+ }
+
+ // -------------------------------------------------------------------------
+ // UtilizationRateService Methods implements
+ // -------------------------------------------------------------------------
+
+ @Override
+ public void addUtilizationRate( UtilizationRate utilizationRate )
+ {
+ utilizationRateStore.addUtilizationRate( utilizationRate );
+ }
+
+ @Override
+ public void updateUtilizationRate( UtilizationRate utilizationRate )
+ {
+ utilizationRateStore.updateUtilizationRate( utilizationRate );
+ }
+
+ @Override
+ public void deleteUtilizationRate( UtilizationRate utilizationRate )
+ {
+ utilizationRateStore.deleteUtilizationRate( utilizationRate );
+ }
+
+ @Override
+ public UtilizationRate getUtilizationRate( DataElement dataElement, Double startRange, Double endRange )
+ {
+ return utilizationRateStore.getUtilizationRate( dataElement, startRange, endRange );
+ }
+
+ @Override
+ public Collection<UtilizationRate> getAllUtilizationRate()
+ {
+ return utilizationRateStore.getAllUtilizationRate();
+ }
+
+ @Override
+ public Collection<UtilizationRate> getUtilizationRates( DataElement dataElement )
+ {
+ return utilizationRateStore.getUtilizationRates( dataElement );
+ }
+
+ public Double getUtilizationRateTariffValue( DataElement dataElement, Double startRange, Double endRange )
+ {
+ return utilizationRateStore.getUtilizationRateTariffValue( dataElement, startRange, endRange );
+ }
+
+ public Map<Integer, String>getUtilizationRates()
+ {
+ return utilizationRateStore.getUtilizationRates();
+ }
+}
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateBankDetailsStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateBankDetailsStore.java 2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateBankDetailsStore.java 2014-06-20 10:21:56 +0000
@@ -65,6 +65,7 @@
return (BankDetails) criteria.uniqueResult();
}
+ @SuppressWarnings( "unchecked" )
@Override
public Collection<BankDetails> getAllBankDetails()
{
@@ -75,6 +76,7 @@
return criteria.list();
}
+ @SuppressWarnings( "unchecked" )
@Override
public Collection<BankDetails> getBankDetails( OrganisationUnit organisationUnit )
{
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernatePBFDataValueStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernatePBFDataValueStore.java 2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernatePBFDataValueStore.java 2014-06-20 10:21:56 +0000
@@ -100,6 +100,7 @@
return ( PBFDataValue ) criteria.uniqueResult();
}
+ @SuppressWarnings( "unchecked" )
@Override
public Collection<PBFDataValue> getPBFDataValues( OrganisationUnit organisationUnit, DataSet dataSet, Period period )
{
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityMaxValueStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityMaxValueStore.java 2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityMaxValueStore.java 2014-06-20 10:21:56 +0000
@@ -138,7 +138,8 @@
return (QualityMaxValue) criteria.uniqueResult();
}
- @Override
+ @SuppressWarnings( "unchecked" )
+ @Override
public Collection<QualityMaxValue> getQuanlityMaxValues(
OrganisationUnit organisationUnit, DataElement dataElement) {
@@ -151,7 +152,8 @@
return criteria.list();
}
- @Override
+ @SuppressWarnings( "unchecked" )
+ @Override
public Collection<QualityMaxValue> getQuanlityMaxValues( OrganisationUnitGroup orgUnitGroup, OrganisationUnit organisationUnit, DataElement dataElement)
{
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateUtilizationRateStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateUtilizationRateStore.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateUtilizationRateStore.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,161 @@
+package org.hisp.dhis.rbf.impl;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hibernate.Criteria;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.criterion.Restrictions;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.rbf.api.UtilizationRate;
+import org.hisp.dhis.rbf.api.UtilizationRateStore;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.support.rowset.SqlRowSet;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class HibernateUtilizationRateStore implements UtilizationRateStore
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private SessionFactory sessionFactory;
+
+ public void setSessionFactory( SessionFactory sessionFactory )
+ {
+ this.sessionFactory = sessionFactory;
+ }
+
+ private JdbcTemplate jdbcTemplate;
+
+ public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
+ {
+ this.jdbcTemplate = jdbcTemplate;
+ }
+
+ // -------------------------------------------------------------------------
+ // UtilizationRateStore Methods implements
+ // -------------------------------------------------------------------------
+
+ public void addUtilizationRate( UtilizationRate utilizationRate )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.save( utilizationRate );
+ }
+
+ public void updateUtilizationRate( UtilizationRate utilizationRate )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.update( utilizationRate );
+ }
+
+ public void deleteUtilizationRate( UtilizationRate utilizationRate )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.delete( utilizationRate );
+ }
+
+
+ public UtilizationRate getUtilizationRate( DataElement dataElement, Double startRange, Double endRange )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( UtilizationRate.class );
+ criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+ criteria.add( Restrictions.eq( "startRange", startRange ) );
+ criteria.add( Restrictions.eq( "endRange", endRange ) );
+
+ return (UtilizationRate) criteria.uniqueResult();
+ }
+
+
+ @SuppressWarnings( "unchecked" )
+ public Collection<UtilizationRate> getAllUtilizationRate()
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( UtilizationRate.class );
+
+ return criteria.list();
+ }
+
+ @SuppressWarnings( "unchecked" )
+ public Collection<UtilizationRate> getUtilizationRates( DataElement dataElement )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( UtilizationRate.class );
+ criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+
+ return criteria.list();
+ }
+
+ public Double getUtilizationRateTariffValue( DataElement dataElement, Double startRange, Double endRange )
+ {
+ Double tariffValue = null;
+
+ try
+ {
+ String query = "SELECT tariff FROM utilizationrate WHERE dataelementid = " + dataElement.getId() + " AND startrange = " + startRange + " AND "
+ + " endrange = " + endRange;
+
+ SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
+
+ if ( rs.next() )
+ {
+ tariffValue = rs.getDouble( 1 );
+ }
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace();
+ }
+
+ return tariffValue;
+ }
+
+
+ public Map<Integer, String>getUtilizationRates()
+ {
+ Map<Integer, String> utilizationRatesMap = new HashMap<Integer, String>();
+
+ try
+ {
+
+ String query = "SELECT dataelementid, startrange, endrange, tariff FROM utilizationrate";
+
+ //System.out.println("Query: " + query );
+ SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
+ while ( rs.next() )
+ {
+ Integer dataElementId = rs.getInt( 1 );
+ Double startRange = rs.getDouble( 2 );
+ Double endRange = rs.getDouble( 3 );
+ Double tariff = rs.getDouble( 4 );
+
+ String value = startRange + ":" + endRange + ":" + tariff;
+ utilizationRatesMap.put( dataElementId, value );
+ //System.out.println( dataElementId + " : " + value );
+ }
+ }
+ catch( Exception e )
+ {
+ System.out.println("In getUtilizationRates Exception :"+ e.getMessage() );
+ }
+
+ return utilizationRatesMap;
+}
+
+
+
+
+
+
+}
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/report/action/PBFReportFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/report/action/PBFReportFormAction.java 2014-06-02 11:30:23 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/report/action/PBFReportFormAction.java 2014-06-20 10:21:56 +0000
@@ -5,9 +5,18 @@
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import org.hisp.dhis.constant.Constant;
+import org.hisp.dhis.constant.ConstantService;
import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.CalendarPeriodType;
import org.hisp.dhis.period.MonthlyPeriodType;
import org.hisp.dhis.period.Period;
@@ -22,12 +31,33 @@
*/
public class PBFReportFormAction implements Action
{
-
+ private final static String REPORTING_GROUP_SET = "REPORTING_GROUP_SET";
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
-
+ private OrganisationUnitService organisationUnitService;
+
+ public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+ {
+ this.organisationUnitService = organisationUnitService;
+ }
+
+ private OrganisationUnitGroupService organisationUnitGroupService;
+
+ public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
+ {
+ this.organisationUnitGroupService = organisationUnitGroupService;
+ }
+
+ private ConstantService constantService;
+
+ public void setConstantService( ConstantService constantService )
+ {
+ this.constantService = constantService;
+ }
+
// -------------------------------------------------------------------------
// Input & Output
@@ -66,6 +96,20 @@
return birtPath;
}
+ private List<OrganisationUnit> orgUnitList;
+
+ public List<OrganisationUnit> getOrgUnitList()
+ {
+ return orgUnitList;
+ }
+
+ private Map<String, String> orgUnitGroupNameMap = new HashMap<String, String>();
+
+ public Map<String, String> getOrgUnitGroupNameMap()
+ {
+ return orgUnitGroupNameMap;
+ }
+
// -------------------------------------------------------------------------
// Action
// -------------------------------------------------------------------------
@@ -97,7 +141,71 @@
{
period.setName( format.formatPeriod( period ) );
}
-
+
+ orgUnitList = new ArrayList<OrganisationUnit>();
+ orgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getAllOrganisationUnits() );
+
+ Constant orgUnitGroupSetId = constantService.getConstantByName( REPORTING_GROUP_SET );
+
+ OrganisationUnitGroupSet organisationUnitGroupSet = organisationUnitGroupService.getOrganisationUnitGroupSet( (int) orgUnitGroupSetId.getValue() );
+
+
+ //System.out.println( " organisationUnit List size " + orgUnitList.size() );orgUnitGroupSetId
+
+ /*
+ List<OrganisationUnitGroupSet> organisationUnitGroupSetList = new ArrayList<OrganisationUnitGroupSet>();
+
+ organisationUnitGroupSetList = new ArrayList<OrganisationUnitGroupSet>();
+
+ organisationUnitGroupSetList = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getAllOrganisationUnitGroupSets() );
+
+ //System.out.println( " organisationUnit Group Set List size Before Remove " + organisationUnitGroupSetList.size() );
+
+ // remove the orgUnitGroupSet which has no any orgUnitGroup
+ Iterator<OrganisationUnitGroupSet> allorganisationUnitGroupSetIterator = organisationUnitGroupSetList.iterator();
+ while ( allorganisationUnitGroupSetIterator.hasNext() )
+ {
+ OrganisationUnitGroupSet organisationUnitGroupSet = allorganisationUnitGroupSetIterator.next();
+
+ if ( organisationUnitGroupSet.getOrganisationUnitGroups().size() == 0 )
+ {
+ //System.out.println(" organisationUnitGroupSet Name " + organisationUnitGroupSet.getName() );
+ allorganisationUnitGroupSetIterator.remove();
+ }
+ }
+ */
+
+ //System.out.println( " organisationUnit Group Set List size After Remove " + organisationUnitGroupSetList.size() );
+
+ orgUnitGroupNameMap = new HashMap<String, String>();
+ for( OrganisationUnit orgUnit : orgUnitList )
+ {
+ for ( OrganisationUnitGroup organisationUnitGroup : organisationUnitGroupSet.getOrganisationUnitGroups() )
+ {
+ if( orgUnit.getGroups() != null && orgUnit.getGroups().size() > 0 )
+ {
+ if( orgUnit.getGroups().contains( organisationUnitGroup ) )
+ {
+ orgUnitGroupNameMap.put( orgUnit.getUid(), organisationUnitGroup.getName() );
+ break;
+ }
+ }
+ }
+ }
+
+
+ //System.out.println( " organisationUnit Group Map size " + orgUnitGroupNameMap.size() );
+
+ /*
+ for( String key : orgUnitGroupNameMap.keySet() )
+ {
+ System.out.println( " OrganisationUnit Uid " + key + " OrganisationUnit Group Name " + orgUnitGroupNameMap.get( key ) );
+ }
+ */
+
+
+
+
return SUCCESS;
}
=== added directory 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement'
=== added directory 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action'
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/AddUtilizationRateAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/AddUtilizationRateAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/AddUtilizationRateAction.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,138 @@
+package org.hisp.dhis.rbf.utilizationRuleManagement.action;
+
+import java.util.Date;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.rbf.api.UtilizationRate;
+import org.hisp.dhis.rbf.api.UtilizationRateService;
+import org.hisp.dhis.user.CurrentUserService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class AddUtilizationRateAction implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private UtilizationRateService utilizationRateService;
+
+ public void setUtilizationRateService( UtilizationRateService utilizationRateService )
+ {
+ this.utilizationRateService = utilizationRateService;
+ }
+
+ private DataElementService dataElementService;
+
+ public void setDataElementService( DataElementService dataElementService )
+ {
+ this.dataElementService = dataElementService;
+ }
+
+ private CurrentUserService currentUserService;
+
+ public void setCurrentUserService( CurrentUserService currentUserService )
+ {
+ this.currentUserService = currentUserService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & output
+ // -------------------------------------------------------------------------
+
+ private String dataElementId;
+
+ public void setDataElementId( String dataElementId )
+ {
+ this.dataElementId = dataElementId;
+ }
+
+ private String startRange;
+
+ public void setStartRange( String startRange )
+ {
+ this.startRange = startRange;
+ }
+
+ private String endRange;
+
+ public void setEndRange( String endRange )
+ {
+ this.endRange = endRange;
+ }
+
+ private String tariff;
+
+ public void setTariff( String tariff )
+ {
+ this.tariff = tariff;
+ }
+ // -------------------------------------------------------------------------
+ // Action
+ // -------------------------------------------------------------------------
+
+
+ public String execute() throws Exception
+ {
+ DataElement dataElement = dataElementService.getDataElement( Integer.parseInt( dataElementId ) );
+
+ if( dataElement != null )
+ {
+ UtilizationRate utilizationRate = utilizationRateService.getUtilizationRate( dataElement, Double.parseDouble( startRange ), Double.parseDouble( endRange ) );
+
+ if( utilizationRate == null )
+ {
+ utilizationRate = new UtilizationRate();
+
+ utilizationRate.setDataElement( dataElement );
+ utilizationRate.setStartRange( Double.parseDouble( startRange ) );
+ utilizationRate.setEndRange( Double.parseDouble( endRange ) );
+ utilizationRate.setTariff( Double.parseDouble( tariff ) );
+
+ String storedBy = currentUserService.getCurrentUsername();
+
+ Date now = new Date();
+
+ if ( storedBy == null )
+ {
+ storedBy = "[unknown]";
+ }
+
+ utilizationRate.setStoredBy( storedBy );
+ utilizationRate.setTimestamp( now );
+
+ utilizationRateService.addUtilizationRate( utilizationRate );
+ }
+
+ else
+ {
+ utilizationRate.setDataElement( dataElement );
+ utilizationRate.setStartRange( Double.parseDouble( startRange ) );
+ utilizationRate.setEndRange( Double.parseDouble( endRange ) );
+ utilizationRate.setTariff( Double.parseDouble( tariff ) );
+
+ String storedBy = currentUserService.getCurrentUsername();
+
+ Date now = new Date();
+
+ if ( storedBy == null )
+ {
+ storedBy = "[unknown]";
+ }
+
+ utilizationRate.setStoredBy( storedBy );
+ utilizationRate.setTimestamp( now );
+
+ utilizationRateService.updateUtilizationRate( utilizationRate );
+ }
+
+ }
+
+ return SUCCESS;
+ }
+
+}
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/GetUtilizationRateListAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/GetUtilizationRateListAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/GetUtilizationRateListAction.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,80 @@
+package org.hisp.dhis.rbf.utilizationRuleManagement.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.rbf.api.UtilizationRate;
+import org.hisp.dhis.rbf.api.UtilizationRateService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class GetUtilizationRateListAction implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private UtilizationRateService utilizationRateService;
+
+ public void setUtilizationRateService( UtilizationRateService utilizationRateService )
+ {
+ this.utilizationRateService = utilizationRateService;
+ }
+
+ private DataElementService dataElementService;
+
+ public void setDataElementService( DataElementService dataElementService )
+ {
+ this.dataElementService = dataElementService;
+ }
+
+
+ // -------------------------------------------------------------------------
+ // Input & output
+ // -------------------------------------------------------------------------
+
+ private String dataElementId;
+
+ public void setDataElementId( String dataElementId )
+ {
+ this.dataElementId = dataElementId;
+ }
+
+ private List<UtilizationRate> utilizationRateList = new ArrayList<UtilizationRate>();
+
+ public List<UtilizationRate> getUtilizationRateList()
+ {
+ return utilizationRateList;
+ }
+
+ private DataElement dataElement;
+
+ public DataElement getDataElement()
+ {
+ return dataElement;
+ }
+ // -------------------------------------------------------------------------
+ // Action
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+ dataElement = dataElementService.getDataElement( Integer.parseInt( dataElementId ) );
+
+ utilizationRateList = new ArrayList<UtilizationRate>();
+
+ if( dataElement != null )
+ {
+ utilizationRateList = new ArrayList<UtilizationRate>( utilizationRateService.getUtilizationRates( dataElement ) );
+
+ }
+
+ return SUCCESS;
+ }
+
+}
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/GetUtilizationRuleDataElementListAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/GetUtilizationRuleDataElementListAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/GetUtilizationRuleDataElementListAction.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,76 @@
+package org.hisp.dhis.rbf.utilizationRuleManagement.action;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.hisp.dhis.attribute.AttributeValue;
+import org.hisp.dhis.constant.Constant;
+import org.hisp.dhis.constant.ConstantService;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class GetUtilizationRuleDataElementListAction implements Action
+{
+ private final static String UTILIZATION_RULE_DATAELEMENT_ATTRIBUTE = "UTILIZATION_RULE_DATAELEMENT_ATTRIBUTE";
+
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private DataElementService dataElementtService;
+
+ public void setDataElementtService( DataElementService dataElementtService )
+ {
+ this.dataElementtService = dataElementtService;
+ }
+
+ private ConstantService constantService;
+
+ public void setConstantService( ConstantService constantService )
+ {
+ this.constantService = constantService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input / Output
+ // -------------------------------------------------------------------------
+
+ private List<DataElement> dataElements = new ArrayList<DataElement>();
+
+ public List<DataElement> getDataElements()
+ {
+ return dataElements;
+ }
+
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+ Constant utilizationRuleAttribute = constantService.getConstantByName( UTILIZATION_RULE_DATAELEMENT_ATTRIBUTE );
+
+ List<DataElement> dataElementList = new ArrayList<DataElement>( dataElementtService.getAllDataElements() );
+ for ( DataElement de : dataElementList )
+ {
+ Set<AttributeValue> attrValueSet = new HashSet<AttributeValue>( de.getAttributeValues() );
+ for ( AttributeValue attValue : attrValueSet )
+ {
+ if ( attValue.getAttribute().getId() == utilizationRuleAttribute.getValue() && attValue.getValue().equalsIgnoreCase( "true" ) )
+ {
+ dataElements.add( de );
+ }
+ }
+ }
+
+ return SUCCESS;
+ }
+}
\ No newline at end of file
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/RemoveUtilizationRateAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/RemoveUtilizationRateAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/RemoveUtilizationRateAction.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,107 @@
+package org.hisp.dhis.rbf.utilizationRuleManagement.action;
+
+import org.hisp.dhis.common.DeleteNotAllowedException;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.rbf.api.UtilizationRate;
+import org.hisp.dhis.rbf.api.UtilizationRateService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class RemoveUtilizationRateAction implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private UtilizationRateService utilizationRateService;
+
+ public void setUtilizationRateService( UtilizationRateService utilizationRateService )
+ {
+ this.utilizationRateService = utilizationRateService;
+ }
+
+ private DataElementService dataElementService;
+
+ public void setDataElementService( DataElementService dataElementService )
+ {
+ this.dataElementService = dataElementService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & output
+ // -------------------------------------------------------------------------
+
+ private String dataElementId;
+
+ public void setDataElementId( String dataElementId )
+ {
+ this.dataElementId = dataElementId;
+ }
+
+ private String startRange;
+
+ public void setStartRange( String startRange )
+ {
+ this.startRange = startRange;
+ }
+
+ private String endRange;
+
+ public void setEndRange( String endRange )
+ {
+ this.endRange = endRange;
+ }
+
+ private I18n i18n;
+
+ public void setI18n( I18n i18n )
+ {
+ this.i18n = i18n;
+ }
+
+ private String message;
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+ DataElement dataElement = dataElementService.getDataElement( Integer.parseInt( dataElementId ) );
+
+ if( dataElement != null )
+ {
+ try
+ {
+ UtilizationRate utilizationRate = utilizationRateService.getUtilizationRate( dataElement, Double.parseDouble( startRange ), Double.parseDouble( endRange ) );
+
+ if( utilizationRate != null )
+ {
+ utilizationRateService.deleteUtilizationRate( utilizationRate );
+ }
+ }
+ catch ( DeleteNotAllowedException ex )
+ {
+ if ( ex.getErrorCode().equals( DeleteNotAllowedException.ERROR_ASSOCIATED_BY_OTHER_OBJECTS ) )
+ {
+ message = i18n.getString( "object_not_deleted_associated_by_objects" ) + " " + ex.getMessage();
+ }
+
+ return ERROR;
+ }
+
+ }
+
+ return SUCCESS;
+ }
+}
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/ShowAddUtilizationRateFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/ShowAddUtilizationRateFormAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/ShowAddUtilizationRateFormAction.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,59 @@
+package org.hisp.dhis.rbf.utilizationRuleManagement.action;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class ShowAddUtilizationRateFormAction implements Action
+{
+
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private DataElementService dataElementService;
+
+ public void setDataElementService( DataElementService dataElementService )
+ {
+ this.dataElementService = dataElementService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input / Output
+ // -------------------------------------------------------------------------
+
+ private String dataElementId;
+
+ public String getDataElementId()
+ {
+ return dataElementId;
+ }
+
+ public void setDataElementId( String dataElementId )
+ {
+ this.dataElementId = dataElementId;
+ }
+
+ private DataElement dataElement;
+
+ public DataElement getDataElement()
+ {
+ return dataElement;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+ dataElement = dataElementService.getDataElement( Integer.parseInt( dataElementId ) );
+
+ return SUCCESS;
+ }
+
+}
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/ShowUpdateUtilizationRateFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/ShowUpdateUtilizationRateFormAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/ShowUpdateUtilizationRateFormAction.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,89 @@
+package org.hisp.dhis.rbf.utilizationRuleManagement.action;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.rbf.api.UtilizationRate;
+import org.hisp.dhis.rbf.api.UtilizationRateService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class ShowUpdateUtilizationRateFormAction implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private UtilizationRateService utilizationRateService;
+
+ public void setUtilizationRateService( UtilizationRateService utilizationRateService )
+ {
+ this.utilizationRateService = utilizationRateService;
+ }
+
+ private DataElementService dataElementService;
+
+ public void setDataElementService( DataElementService dataElementService )
+ {
+ this.dataElementService = dataElementService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & output
+ // -------------------------------------------------------------------------
+
+ private String dataElementId;
+
+ public void setDataElementId( String dataElementId )
+ {
+ this.dataElementId = dataElementId;
+ }
+
+ private String startRange;
+
+ public void setStartRange( String startRange )
+ {
+ this.startRange = startRange;
+ }
+
+ private String endRange;
+
+ public void setEndRange( String endRange )
+ {
+ this.endRange = endRange;
+ }
+
+ private UtilizationRate utilizationRate;
+
+ public UtilizationRate getUtilizationRate()
+ {
+ return utilizationRate;
+ }
+
+ private DataElement dataElement;
+
+ public DataElement getDataElement()
+ {
+ return dataElement;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+ dataElement = dataElementService.getDataElement( Integer.parseInt( dataElementId ) );
+
+ if( dataElement != null )
+ {
+ utilizationRate = utilizationRateService.getUtilizationRate( dataElement, Double.parseDouble( startRange ), Double.parseDouble( endRange ) );
+ }
+
+ return SUCCESS;
+ }
+
+}
+
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/UpdateUtilizationRateAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/UpdateUtilizationRateAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/utilizationRuleManagement/action/UpdateUtilizationRateAction.java 2014-06-20 10:21:56 +0000
@@ -0,0 +1,116 @@
+package org.hisp.dhis.rbf.utilizationRuleManagement.action;
+
+import java.util.Date;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.rbf.api.UtilizationRate;
+import org.hisp.dhis.rbf.api.UtilizationRateService;
+import org.hisp.dhis.user.CurrentUserService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ */
+public class UpdateUtilizationRateAction implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private UtilizationRateService utilizationRateService;
+
+ public void setUtilizationRateService( UtilizationRateService utilizationRateService )
+ {
+ this.utilizationRateService = utilizationRateService;
+ }
+
+ private DataElementService dataElementService;
+
+ public void setDataElementService( DataElementService dataElementService )
+ {
+ this.dataElementService = dataElementService;
+ }
+
+ private CurrentUserService currentUserService;
+
+ public void setCurrentUserService( CurrentUserService currentUserService )
+ {
+ this.currentUserService = currentUserService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & output
+ // -------------------------------------------------------------------------
+
+ private String dataElementId;
+
+ public void setDataElementId( String dataElementId )
+ {
+ this.dataElementId = dataElementId;
+ }
+
+ private String startRange;
+
+ public void setStartRange( String startRange )
+ {
+ this.startRange = startRange;
+ }
+
+ private String endRange;
+
+ public void setEndRange( String endRange )
+ {
+ this.endRange = endRange;
+ }
+
+ private String tariff;
+
+ public void setTariff( String tariff )
+ {
+ this.tariff = tariff;
+ }
+ // -------------------------------------------------------------------------
+ // Action
+ // -------------------------------------------------------------------------
+
+
+ public String execute() throws Exception
+ {
+ DataElement dataElement = dataElementService.getDataElement( Integer.parseInt( dataElementId ) );
+
+ if( dataElement != null )
+ {
+ UtilizationRate utilizationRate = utilizationRateService.getUtilizationRate( dataElement, Double.parseDouble( startRange ), Double.parseDouble( endRange ) );
+
+ if( utilizationRate != null )
+ {
+ //System.out.println( dataElement.getId() + " : " + Double.parseDouble( startRange ) + " : " + Double.parseDouble( endRange ) );
+
+ utilizationRate.setDataElement( dataElement );
+ utilizationRate.setStartRange( Double.parseDouble( startRange ) );
+ utilizationRate.setEndRange( Double.parseDouble( endRange ) );
+ utilizationRate.setTariff( Double.parseDouble( tariff ) );
+
+ String storedBy = currentUserService.getCurrentUsername();
+
+ Date now = new Date();
+
+ if ( storedBy == null )
+ {
+ storedBy = "[unknown]";
+ }
+
+ utilizationRate.setStoredBy( storedBy );
+ utilizationRate.setTimestamp( now );
+
+ utilizationRateService.updateUtilizationRate( utilizationRate );
+ }
+
+ }
+
+ return SUCCESS;
+ }
+
+}
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml 2014-06-02 11:30:23 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml 2014-06-20 10:21:56 +0000
@@ -59,6 +59,28 @@
<property name="qualityScorePaymentStore" ref="org.hisp.dhis.rbf.api.QualityScorePaymentStore" />
</bean>
+
+ <!-- UtilizationRateStore -->
+ <bean id="org.hisp.dhis.rbf.api.UtilizationRateStore" class="org.hisp.dhis.rbf.impl.HibernateUtilizationRateStore">
+ <property name="sessionFactory" ref="sessionFactory" />
+ <property name="jdbcTemplate" ref="jdbcTemplate" />
+ </bean>
+
+ <!-- UtilizationRateService -->
+ <bean id="org.hisp.dhis.rbf.api.UtilizationRateService" class="org.hisp.dhis.rbf.impl.DefaultUtilizationRateService">
+ <property name="utilizationRateStore" ref="org.hisp.dhis.rbf.api.UtilizationRateStore" />
+ </bean>
+
+
+
+
+
+
+
+
+
+
+
<!-- Home page -->
<bean id="org.hisp.dhis.rbf.action.NoAction" class="org.hisp.dhis.rbf.action.NoAction" scope="prototype">
</bean>
@@ -155,7 +177,6 @@
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService"/>
</bean>
-
<!-- Load DataEntry Form -->
<bean id="org.hisp.dhis.rbf.dataentry.LoadDataEntryFormAction" class="org.hisp.dhis.rbf.dataentry.LoadDataEntryFormAction" scope="prototype">
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
@@ -167,6 +188,7 @@
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService"/>
<property name="pbfDataValueService" ref="org.hisp.dhis.rbf.api.PBFDataValueService" />
<property name="constantService" ref="org.hisp.dhis.constant.ConstantService" />
+ <property name="utilizationRateService" ref="org.hisp.dhis.rbf.api.UtilizationRateService" />
</bean>
<!-- Save Value -->
@@ -465,7 +487,66 @@
</bean>
-
-
+ <!-- PBF Reports -->
+ <bean id="org.hisp.dhis.rbf.report.action.PBFReportFormAction" class="org.hisp.dhis.rbf.report.action.PBFReportFormAction"
+ scope="prototype">
+ <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+ <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+ <property name="constantService" ref="org.hisp.dhis.constant.ConstantService" />
+ </bean>
+
+
+ <!-- Utilization Rule Management -->
+
+ <!-- Get DataElement List -->
+ <bean id="org.hisp.dhis.rbf.utilizationRuleManagement.action.GetUtilizationRuleDataElementListAction" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.GetUtilizationRuleDataElementListAction"
+ scope="prototype">
+ <property name="dataElementtService" ref="org.hisp.dhis.dataelement.DataElementService" />
+ <property name="constantService" ref="org.hisp.dhis.constant.ConstantService" />
+ </bean>
+
+ <!-- Add Utilization form -->
+ <bean id="org.hisp.dhis.rbf.utilizationRuleManagement.action.ShowAddUtilizationRateFormAction" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.ShowAddUtilizationRateFormAction"
+ scope="prototype">
+ <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+ </bean>
+
+ <!-- Utilization Rule List -->
+ <bean id="org.hisp.dhis.rbf.utilizationRuleManagement.action.GetUtilizationRateListAction" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.GetUtilizationRateListAction"
+ scope="prototype">
+ <property name="utilizationRateService" ref="org.hisp.dhis.rbf.api.UtilizationRateService" />
+ <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+ </bean>
+
+ <!-- Add Utilization -->
+ <bean id="org.hisp.dhis.rbf.utilizationRuleManagement.action.AddUtilizationRateAction" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.AddUtilizationRateAction"
+ scope="prototype">
+ <property name="utilizationRateService" ref="org.hisp.dhis.rbf.api.UtilizationRateService" />
+ <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+ <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+ </bean>
+
+ <!-- Update Utilization form -->
+ <bean id="org.hisp.dhis.rbf.utilizationRuleManagement.action.ShowUpdateUtilizationRateFormAction" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.ShowUpdateUtilizationRateFormAction"
+ scope="prototype">
+ <property name="utilizationRateService" ref="org.hisp.dhis.rbf.api.UtilizationRateService" />
+ <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+ </bean>
+
+
+ <!-- Upadte Utilization -->
+ <bean id="org.hisp.dhis.rbf.utilizationRuleManagement.action.UpdateUtilizationRateAction" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.UpdateUtilizationRateAction"
+ scope="prototype">
+ <property name="utilizationRateService" ref="org.hisp.dhis.rbf.api.UtilizationRateService" />
+ <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+ <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+ </bean>
+
+ <!-- Remove Utilization -->
+ <bean id="org.hisp.dhis.rbf.utilizationRuleManagement.action.RemoveUtilizationRateAction" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.RemoveUtilizationRateAction"
+ scope="prototype">
+ <property name="utilizationRateService" ref="org.hisp.dhis.rbf.api.UtilizationRateService" />
+ <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+ </bean>
</beans>
\ No newline at end of file
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/PBFDataValue.hbm.xml'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/PBFDataValue.hbm.xml 2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/PBFDataValue.hbm.xml 2014-06-20 10:21:56 +0000
@@ -17,6 +17,8 @@
<property name="quantityValidated" column="qtyValidated" />
+ <property name="quantityExternalVerification" column="qtyexternalverification" />
+
<property name="tariffAmount" column="tariffamount" />
<property name="storedBy" column="storedby" length="100" />
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/UtilizationRate.hbm.xml'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/UtilizationRate.hbm.xml 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/hibernate/UtilizationRate.hbm.xml 2014-06-20 10:21:56 +0000
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+ <class name="org.hisp.dhis.rbf.api.UtilizationRate" table="utilizationrate">
+
+ <composite-id>
+ <key-many-to-one name="dataElement" class="org.hisp.dhis.dataelement.DataElement" column="dataelementid" foreign-key="fk_utilizationrate_dataelementid" />
+ <key-property name="startRange" column="startrange" />
+ <key-property name="endRange" column="endrange" />
+ </composite-id>
+
+ <property name="tariff" column="tariff" />
+
+ <property name="storedBy" column="storedby" length="100" />
+
+ <property name="timestamp" column="lastupdated" type="timestamp" />
+
+ </class>
+</hibernate-mapping>
\ No newline at end of file
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties 2014-06-02 11:30:23 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties 2014-06-20 10:21:56 +0000
@@ -16,7 +16,7 @@
later_periods = Later periods
select = Select
period = Period
-dataelement = Data Element
+dataelement = DataElement
total = Total
qty_reported = Quantity Reported
qty_validated = Quantity Validated
@@ -84,4 +84,11 @@
pbf_report_management = PBF Report Management
report = Report
outputFormat = Output Format
-generate = Generate
\ No newline at end of file
+generate = Generate
+
+
+
+utilization_rule_management = Utilization Rule Management
+select_dataElement = Select DataElement
+confirm_delete_utilization_rate_reule = Are you sure you want to delete Utilization Rule Rate
+qty_external_verification = Quantity External Verification
\ No newline at end of file
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml'
--- local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml 2014-06-02 11:30:23 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml 2014-06-20 10:21:56 +0000
@@ -110,7 +110,12 @@
</action>
-
+ <!-- for PBF DataEntry Role Quanitity External Verification-->
+ <action name="quanitityExternalVerification" class="org.hisp.dhis.rbf.action.NoAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">/dhis-web-maintenance-rbf/loadDataEntryForm.vm</param>
+ <param name="requiredAuthorities">F_QUANTITY_EXTERNAL_VERIFICATION</param>
+ </action>
@@ -403,8 +408,54 @@
</action>
-
-
+ <!-- Utilization Rule Management -->
+
+ <!-- Get DataElement List -->
+ <action name="utilizationRuleManagement" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.GetUtilizationRuleDataElementListAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-rbf/utilizationRuleDataElements.vm</param>
+ <param name="javascripts">javascript/utilizationRule.js</param>
+ <param name="menu">/dhis-web-maintenance-rbf/menu.vm</param>
+ </action>
+
+
+ <!-- Utilization Rule List -->
+ <action name="getUtilizationRateList" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.GetUtilizationRateListAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">/dhis-web-maintenance-rbf/utilizationRateList.vm</param>
+ </action>
+
+
+ <!-- Add Utilization form -->
+ <action name="showAddUtilizationRateForm" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.ShowAddUtilizationRateFormAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">/dhis-web-maintenance-rbf/addUtilizationRateForm.vm</param>
+ </action>
+
+ <!-- Add Utilization -->
+ <action name="addUtilizationRate" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.AddUtilizationRateAction">
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+ </action>
+
+
+ <!-- Update Utilization form -->
+ <action name="showUpdateUtilizationRateForm" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.ShowUpdateUtilizationRateFormAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">/dhis-web-maintenance-rbf/updateUtilizationRateForm.vm</param>
+ </action>
+
+
+ <!-- Update Utilization -->
+ <action name="updateUtilizationRate" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.UpdateUtilizationRateAction">
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+ </action>
+
+ <!-- Remove Utilization -->
+ <action name="removeUtilizationRate" class="org.hisp.dhis.rbf.utilizationRuleManagement.action.RemoveUtilizationRateAction">
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+ <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
+ </action>
+
</package>
</struts>
\ No newline at end of file
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/addUtilizationRateForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/addUtilizationRateForm.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/addUtilizationRateForm.vm 2014-06-20 10:21:56 +0000
@@ -0,0 +1,78 @@
+## Macro for generating the jQuery validation rules
+#macro( validate $type $require )
+ #if( $type == "NUMBER" )
+ {validate:{ number:true #if($require), required:true #end }}
+ #elseif( $require )
+ {validate:{required:true}}
+ #end
+#end
+<script>
+
+ jQuery(document).ready( function(){
+
+ currentDiv = 'addUtilizationRateForm';
+ isSubmit = true;
+ jQuery("#addUtilizationRateForm").validate({
+ meta:"validate"
+ ,errorElement:"span"
+ ,submitHandler: function(form)
+ {
+ if( isSubmit )
+ {
+ addUtilizationRate();
+ }
+ }
+ });
+ });
+
+</script>
+
+<form id="addUtilizationRateForm" name="addUtilizationRateForm" method="post" >
+
+ <input type="hidden" id="dataElementId" name="dataElementId" value="$dataElement.id" />
+ <table width="100%">
+
+ <tr>
+ <th colspan="2">$i18n.getString( "Utilization Rule Details" ) : $dataElement.name</th>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "stare_range" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="startRange" name="startRange" class="{validate:{required:true}}"></td>
+ </tr>
+
+ <tr>
+ <td> </td>
+ <td> </td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "end_range" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="endRange" name="endRange" class="{validate:{required:true}}"></td>
+ </tr>
+
+ <tr>
+ <td> </td>
+ <td> </td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "Tariff Value" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="tariff" name="tariff" class="{validate:{required:true}}"></td>
+ </tr>
+
+ <tr>
+ <td> </td>
+ <td> </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <input type="submit" value="$i18n.getString( 'save' )" style="width:120px" />
+ <input type="button" onclick="closePopUpWindow();" value="$i18n.getString( 'cancel' )" style="width:120px" />
+ </td>
+ </tr>
+
+
+ </table>
+</form>
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm 2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm 2014-06-20 10:21:56 +0000
@@ -1,4 +1,4 @@
-<script>
+<script type="text/javascript">
jQuery(document).ready( function(){
currentDiv = 'pbfDataEntryForm';
@@ -16,6 +16,65 @@
});
});
+
+ function saveUtilizationRateDataValue()
+ {
+ var period = document.getElementById("selectedPeriodId").value;
+ var valueId = "utilizationRate";
+
+ var fieldId = "#"+valueId;
+ var defaultValue = document.getElementById(valueId).defaultValue;
+ var value = document.getElementById(valueId).value;
+
+ if(defaultValue != value)
+ {
+ var dataValue = {
+ 'dataElementId' : $utilizationRateDataElementId,
+ 'organisationUnitId' : $("#selectedOrgunitID").val(),
+ 'periodIso' : period,
+ 'value' : value
+ };
+
+ jQuery.ajax( {
+ url: 'saveDataValue.action',
+ data: dataValue,
+ dataType: 'json',
+ success: handleSuccess,
+ error: handleError
+ } );
+ }
+
+ function handleSuccess( json )
+ {
+ var code = json.c;
+ if ( code == '0' || code == 0) // Value successfully saved on server
+ {
+ markValue( fieldId, COLOR_GREEN );
+ getUtilizationRateTariffValue();
+ }
+ else if ( code == 2 )
+ {
+ markValue( fieldId, COLOR_RED );
+ window.alert( i18n_saving_value_failed_dataset_is_locked );
+ }
+ else // Server error during save
+ {
+ markValue( fieldId, COLOR_RED );
+ window.alert( i18n_saving_value_failed_status_code + '\n\n' + code );
+ }
+ }
+
+ function handleError( jqXHR, textStatus, errorThrown )
+ {
+ markValue( fieldId, COLOR_RED );
+ }
+
+ function markValue( fieldId, color )
+ {
+ document.getElementById(valueId).style.backgroundColor = color;
+ }
+ }
+
</script>
<h3>$i18n.getString( "pbf_dataentry" )</h3>
@@ -27,7 +86,7 @@
</div>
-<div class="inputCriteria" style="width:480px;height:90px;">
+<div class="inputCriteria" style="width:625px;height:90px;">
<table>
<tr>
<td><label for="orgUnitName">$i18n.getString( "organisation_unit" )</label></td>
@@ -44,6 +103,7 @@
#end
</select>
</td>
+
</tr>
<tr>
@@ -56,8 +116,11 @@
</select>
<input type="button" id="prevButton" disabled="disabled" style="width:75px" value="$i18n.getString( 'prev_year' )" title="$i18n.getString('earlier_periods')" onclick="getAvailablePeriodsTemp( 'selectedPeriodId', 'selectedPeriodId', '-1' )" >
<input type="button" id="nextButton" disabled="disabled" style="width:75px" value="$i18n.getString( 'next_year' )" title="$i18n.getString('later_periods')" onclick="getAvailablePeriodsTemp( 'selectedPeriodId', 'selectedPeriodId', '1' )" >
-
</td>
+
+ <td><label for="utilization_rate ">$i18n.getString( "Utilization Rate " )</label></td>
+ <td><input type="text" id="utilizationRate" name = "utilizationRate" style="text-align:center;width:75px;" onblur="saveUtilizationRateDataValue();" onkeyup="getUtilizationRateTariffValue();" ></td>
+
</tr>
</table>
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/images/ajax-loader.gif'
Binary files local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/images/ajax-loader.gif 1970-01-01 00:00:00 +0000 and local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/images/ajax-loader.gif 2014-06-20 10:21:56 +0000 differ
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/images/deleteRed.png'
Binary files local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/images/deleteRed.png 1970-01-01 00:00:00 +0000 and local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/images/deleteRed.png 2014-06-20 10:21:56 +0000 differ
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js 2014-05-08 11:03:37 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js 2014-06-20 10:21:56 +0000
@@ -163,11 +163,16 @@
{
valueId = "pbfdv_qty_reported_"+dataElementId;
}
- else
+ else if( valueType == 2 )
{
valueId = "pbfdv_qty_validated_"+dataElementId;
}
+ else
+ {
+ valueId = "pbfdv_qty_external_verification_"+dataElementId;
+ }
+
var tariffValueId = "pbfdv_tariff_amt_"+dataElementId;
var tariffAmt = document.getElementById( tariffValueId ).value;
@@ -298,16 +303,3 @@
} );
}
-
-
-
-
-
-
-
-
-
-
-
-
-
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/utilizationRule.js'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/utilizationRule.js 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/utilizationRule.js 2014-06-20 10:21:56 +0000
@@ -0,0 +1,187 @@
+
+window.onload=function(){
+
+ jQuery('#addUpdateUtilizationRateDiv').dialog({autoOpen: false});
+}
+
+
+function loadUtilizationRate()
+{
+ $( '#utilizationRateListDiv' ).html('');
+
+ var dataElementId = $( '#dataElementId' ).val();
+
+ if ( dataElementId == "-1" )
+ {
+ $( '#utilizationRateListDiv' ).html('');
+ showWarningMessage( "Please Select DataElement" );
+ return false;
+ }
+
+ else
+ {
+ document.getElementById('overlayUtilization').style.visibility = 'visible';
+ jQuery('#utilizationRateListDiv').load('getUtilizationRateList.action',
+ {
+ dataElementId:dataElementId
+ }, function()
+ {
+ showById('utilizationRateListDiv');
+ document.getElementById('overlayUtilization').style.visibility = 'hidden';
+ });
+ }
+}
+
+
+function showAddUtilizationRateForm()
+{
+ var dataElementId = $( '#dataElementId' ).val();
+
+ if ( dataElementId == "-1" )
+ {
+ showWarningMessage( "Please Select DataElement" );
+ return false;
+ }
+
+ else
+ {
+ //var url = "showAddUtilizationRateForm.action?dataElementId=" + dataElementId;
+ //window.location.href = url;
+
+
+ jQuery('#addUpdateUtilizationRateDiv').dialog('destroy').remove();
+ jQuery('<div id="addUpdateUtilizationRateDiv">' ).load( 'showAddUtilizationRateForm.action?dataElementId='+ dataElementId ).dialog({
+ title: 'Add Utilization Rule',
+ maximize: true,
+ closable: true,
+ modal:true,
+ overlay:{background:'#000000', opacity:0.1},
+ width: 450,
+ height: 300
+ });
+
+ }
+}
+
+function addUtilizationRate()
+{
+ $.ajax({
+ type: "POST",
+ url: 'addUtilizationRate.action',
+ data: getParamsForDiv('addUpdateUtilizationRateDiv'),
+ success: function(json) {
+ var type = json.response;
+
+ jQuery('#addUpdateUtilizationRateDiv').dialog('destroy').remove();
+ loadUtilizationRate();
+
+ }
+ });
+}
+
+
+function closePopUpWindow()
+{
+ jQuery('#addUpdateUtilizationRateDiv').dialog('destroy').remove();
+}
+
+
+function showUpdateutilizationRateForm( startRange, endRange, dataElementId )
+{
+ var dataElementId = $( '#dataElementId' ).val();
+
+ if ( dataElementId == "-1" )
+ {
+ showWarningMessage( "Please Select DataElement" );
+ return false;
+ }
+
+ else
+ {
+ //var url = "showAddUtilizationRateForm.action?dataElementId=" + dataElementId;
+ //window.location.href = url;
+
+
+ jQuery('#addUpdateUtilizationRateDiv').dialog('destroy').remove();
+ jQuery('<div id="addUpdateUtilizationRateDiv">' ).load( 'showUpdateUtilizationRateForm.action?dataElementId='+ dataElementId + "&startRange=" + startRange + "&endRange=" + endRange ).dialog({
+ title: 'Update Utilization Rule',
+ maximize: true,
+ closable: true,
+ modal:true,
+ overlay:{background:'#000000', opacity:0.1},
+ width: 450,
+ height: 300
+ });
+
+ }
+}
+
+
+function updateUtilizationRate()
+{
+ $.ajax({
+ type: "POST",
+ url: 'updateUtilizationRate.action',
+ data: getParamsForDiv('addUpdateUtilizationRateDiv'),
+ success: function(json) {
+ var type = json.response;
+
+ jQuery('#addUpdateUtilizationRateDiv').dialog('destroy').remove();
+ loadUtilizationRate();
+
+ }
+ });
+}
+
+
+function getParamsForDiv( equipmentDiv )
+{
+ var params = '';
+
+ jQuery("#" + equipmentDiv + " :input").each(function()
+ {
+ var elementId = $(this).attr('id');
+
+ if( $(this).attr('type') == 'checkbox' )
+ {
+ var checked = jQuery(this).attr('checked') ? true : false;
+ params += elementId + "=" + checked + "&";
+ }
+ else if( $(this).attr('type') != 'button' )
+ {
+ var value = "";
+ if( jQuery(this).val() != '' )
+ {
+ value = htmlEncode(jQuery(this).val());
+ }
+ params += elementId + "="+ value + "&";
+ }
+
+ });
+
+ //alert( params );
+
+ return params;
+}
+
+
+function removeutilizationRate( startRange, endRange, dataElementId )
+{
+ var result = window.confirm( i18n_confirm_delete );
+
+ if ( result )
+ {
+ $.ajax({
+ type: "POST",
+ url: 'removeUtilizationRate.action?dataElementId='+ dataElementId + "&startRange=" + startRange + "&endRange=" + endRange,
+ success: function( json ) {
+
+ loadUtilizationRate();
+ }
+ });
+ }
+}
+
+
+
+
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm 2014-04-30 05:26:01 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm 2014-06-20 10:21:56 +0000
@@ -1,4 +1,18 @@
+<script type="text/javascript">
+
+ var utilizationRateTariffMap = new Object();
+
+ #foreach( $utilizationRateDe in $utilizationRateDataElements )
+ utilizationRateTariffMap["$utilizationRateDe.getId()"] = '$utilizationRatesMap.get($utilizationRateDe.getId())';
+ #end
+
+ document.getElementById("utilizationRate").value = '$!utilizationRate';
+
+ //getUtilizationRateTariffValue();
+
+</script>
+
## Macro for generating the jQuery validation rules
@@ -21,6 +35,13 @@
#end
#end
+<select id="utilizationRateDataElementLB" size="10" style="display:none" >
+ #foreach( $utilizationRateDataElement in $utilizationRateDataElements )
+ <option value="$utilizationRateDataElement.id">$utilizationRateDataElement.name</option>
+ #end
+</select>
+
+
#set( $tabIndex = 1 )
#if ( $dataElements.size() > 0)
@@ -31,6 +52,7 @@
#if( $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityValidated") )
<th style="text-align: center;width:15%;">$i18n.getString( "qty_validated" )</th>
+ <th style="text-align: center;width:15%;">$i18n.getString( "qty_external_verification" )</th>
<th style="text-align: center;width:15%;">$i18n.getString( "tariff_amount" )</th>
<th style="text-align: center;width:15%;">$i18n.getString( "total" )</th>
#end
@@ -52,23 +74,23 @@
#set( $pbfDataValue = $!pbfDataValueMap.get( $dataElement ) )
<td>
<input onblur="savePBFDataValue('$dataElement.id', 1 )" type="text" name="pbfdv_qty_reported_$dataElement.id" id="pbfdv_qty_reported_$dataElement.id"
- value="$!pbfDataValue.quantityReported" tabindex="$tabIndex" style="text-align: center;"
+ value="$!pbfDataValue.quantityReported" tabindex="$tabIndex" style="text-align: center;" #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityExternalVerification") ) disabled="disabled" #end
#if($dataElement.type =='number') class="{validate:{number:true}}"
#elseif($dataElement.type =='int') class="{validate:{integer:true}}"
#elseif($dataElement.type =='positiveNumber') class="{validate:{positive_integer:true}}"
#elseif($dataElement.type =='negativeNumber') class="{validate:{negative_integer:true}}"
#end />
</td>
- #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityValidated") )
+ #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityValidated") || $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityExternalVerification") )
<td>
<input onblur="savePBFDataValue('$dataElement.id', 2 )" onkeyup="calTariffVal('$dataElement.id')" type="text" name="pbfdv_qty_validated_$dataElement.id" id="pbfdv_qty_validated_$dataElement.id"
- value="$!pbfDataValue.quantityValidated" tabindex="$tabIndex" style="text-align: center;"
+ value="$!pbfDataValue.quantityValidated" tabindex="$tabIndex" style="text-align: center;" #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityExternalVerification") ) disabled="disabled" #end
#if($dataElement.type =='number') class="{validate:{number:true}}"
#elseif($dataElement.type =='int') class="{validate:{integer:true}}"
#elseif($dataElement.type =='positiveNumber') class="{validate:{positive_integer:true}}"
#elseif($dataElement.type =='negativeNumber') class="{validate:{negative_integer:true}}"
#end class="quantity$count" />
- </td>
+ </td>
<script>
function changeInt()
{
@@ -82,6 +104,30 @@
}
changeInt();
</script>
+
+ <td>
+ <input onblur="savePBFDataValue('$dataElement.id', 3 )" type="text" name="pbfdv_qty_external_verification_$dataElement.id" id="pbfdv_qty_external_verification_$dataElement.id"
+ value="$!pbfDataValue.getQuantityExternalVerification()" tabindex="$tabIndex" style="text-align: center;"
+ #if($dataElement.type =='number') class="{validate:{number:true}}"
+ #elseif($dataElement.type =='int') class="{validate:{integer:true}}"
+ #elseif($dataElement.type =='positiveNumber') class="{validate:{positive_integer:true}}"
+ #elseif($dataElement.type =='negativeNumber') class="{validate:{negative_integer:true}}"
+ #end />
+ </td>
+ <script>
+ function changeInt()
+ {
+ var tariff = 0.0;
+ if('$!pbfDataValue.tariffAmount' != '' )
+ {
+ tariff = parseFloat($pbfDataValue.tariffAmount);
+ $('#pbfdv_tariff_amt_'+$dataElement.id).val(tariff);
+ }
+
+ }
+ changeInt();
+ </script>
+
<td>
<input type="text" name="pbfdv_tariff_amt_$dataElement.id" id="pbfdv_tariff_amt_$dataElement.id"
value="$!pbfDataValue.tariffAmount" tabindex="$tabIndex" style="text-align: center;"
@@ -95,67 +141,101 @@
<input type="text" id="total_$dataElement.id" style="text-align: center;" readonly/>
</td>
#end
+
+ <script >
+ function calVal( ) {
+ var total = 0.0;
+ var quantity = 0.0;
+ var tariff = 0.0;
+ if($('#pbfdv_tariff_amt_'+$dataElement.id).val() != '')
+ {
+ tariff = parseFloat($('#pbfdv_tariff_amt_'+$dataElement.id).val());
+ }
+ else
+ {
+ tariff = 0;
+ }
+
+ if($('#pbfdv_qty_validated_'+$dataElement.id).val() != '')
+ {
+ quantity = parseFloat($('#pbfdv_qty_validated_'+$dataElement.id).val());
+
+ }
+ else
+ {
+ quantity = 0;
+ }
+
+ total = quantity * tariff;
+
+ $('#total_'+$dataElement.id).val(total);
+
+ allTotal = allTotal + total;
+
+ $('#all-total').val(allTotal);
+ }
+
+ calVal();
+
+ $('input').on('keyup', function() {
+ calVal();
+ });
+ </script>
- <script >
- function calVal( ) {
- var total = 0.0;
- var quantity = 0.0;
- var tariff = 0.0;
- if($('#pbfdv_tariff_amt_'+$dataElement.id).val() != '')
- {
- tariff = parseFloat($('#pbfdv_tariff_amt_'+$dataElement.id).val());
- }
- else
- {
- tariff = 0;
- }
-
- if($('#pbfdv_qty_validated_'+$dataElement.id).val() != '')
- {
- quantity = parseFloat($('#pbfdv_qty_validated_'+$dataElement.id).val());
-
- }
- else
- {
- quantity = 0;
- }
-
- total = quantity * tariff;
-
- $('#total_'+$dataElement.id).val(total);
-
- allTotal = allTotal + total;
-
- $('#all-total').val(allTotal);
- }
-
- calVal();
-
- $('input').on('keyup', function() {
- calVal();
- });
- </script>
#end
-
#set( $count = $count + 1)
</tr>
#set( $tabIndex = $tabIndex + 1 )
#set( $mark = !$mark)
#end
- #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityValidated") )
+ #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityValidated") || $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityExternalVerification") )
<tr>
<td > </td>
<td > </td>
<td > </td>
<td > </td>
- <td >
+ <td > </td>
+ <td>
<input type="text" id="all-total" style="text-align: center;" readonly/>
</td>
</tr>
#end
- <script>
+ <script>
+
+ function getUtilizationRateTariffValue()
+ {
+ var utilizationRate = $('#utilizationRate').val();
+ //alert( utilizationRate );
+
+ var tempUtilizationRateDataElements = document.getElementById("utilizationRateDataElementLB");
+
+ for ( i=0; i < tempUtilizationRateDataElements.length; i++ )
+ {
+
+ var utilizationRateTariffMapValue = utilizationRateTariffMap[tempUtilizationRateDataElements.options[i].value];
+
+ var startRange = parseFloat( utilizationRateTariffMapValue.split(":")[0] );
+ var endRange = parseFloat( utilizationRateTariffMapValue.split(":")[1] );
+ var tariffValue = parseFloat( utilizationRateTariffMapValue.split(":")[2] );
+
+ //alert( startRange + "--" + endRange + "--" + tariffValue );
+
+ if( utilizationRate >= startRange && utilizationRate < endRange )
+ {
+ //alert( "2 Alert" + " : " + startRange + "--" + endRange + "--" + tariffValue );
+ var dataElementId = tempUtilizationRateDataElements.options[i].value;
+ //alert( '#pbfdv_tariff_amt_'+dataElementId );
+ $('#pbfdv_tariff_amt_'+dataElementId).val( tariffValue );
+
+ //alert( $('#pbfdv_tariff_amt_'+dataElementId).val( tariffValue ) );
+ }
+ }
+
+ }
+
+
function calTariffVal( dataElementId ) {
var total = 0.0;
var quantity = 0.0;
@@ -187,5 +267,8 @@
$('#all-total').val(allTotal);
}
- </script>
+
+
+ getUtilizationRateTariffValue();
+ </script>
</table>
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm 2014-06-02 11:30:23 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm 2014-06-20 10:21:56 +0000
@@ -9,7 +9,10 @@
<li><a href="dataElementTariffManagement.action">$i18n.getString( "dataelement_tariff_target_management" )</a></li>
- <li><a href="bankDetailsManagement.action">$i18n.getString( "bank_details_management" )</a></li>
+ <li><a href="bankDetailsManagement.action">$i18n.getString( "bank_details_management" )</a></li>
+
+ <li><a href="utilizationRuleManagement.action">$i18n.getString( "utilization_rule_management" )</a></li>
+
</ul>
<h2>$i18n.getString( "quality_score_payment" )</h2>
@@ -17,7 +20,6 @@
<li><a href="qualityScorePaymentList.action">$i18n.getString( "quality_score_payment" )</a></li>
</ul>
-
<h2>$i18n.getString( "aggregation_builder" )</h2>
<ul>
<li><a href="aggregationQueryList.action">$i18n.getString( "aggregation_query_list" )</a></li>
@@ -42,7 +44,9 @@
</ul>
#end
+<!--
<h2>$i18n.getString( "reports" )</h2>
<ul>
<li><a href="PBFInvoiceReportForm.action">$i18n.getString( "quarterly_invoice_for_PBF_indicators_PMA" )</a></li>
-</ul>
\ No newline at end of file
+</ul>
+-->
\ No newline at end of file
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm 2014-06-02 11:30:23 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm 2014-06-20 10:21:56 +0000
@@ -1,6 +1,17 @@
<script type="text/javascript">
+ var tempOrgUnitGroupNameMap = new Object();
+
+ #foreach( $orgUnit in $orgUnitList )
+
+ var orgUnitUid = ""+"$orgUnit.getUid()";
+ //tempOrgUnitGroupNameMap[orgUnitUid] = "$orgUnitGroupNameMap.get( orgUnitUid )";
+ tempOrgUnitGroupNameMap["$orgUnit.getUid()"] = '$orgUnitGroupNameMap.get( "$orgUnit.getUid()" )';
+ //tempOrgUnitGroupNameMap["$orgUnit.getUid()"] = "ABCDEF";
+
+ #end
+
function formValidations()
{
@@ -36,6 +47,10 @@
function redirectTorptDesign()
{
+ var period = $('#selectedPeriodId').val();
+
+ var startPeriod = period.split(":")[0];
+ var endPeriod = period.split(":")[1];
var reportList = document.getElementById("selectedReportId");
var reportIndex = reportList.selectedIndex;
@@ -48,32 +63,125 @@
var orgUnitId = selectionTreeSelection.getSelectedUid()[0];
+ //var orgUnitGroupName = tempOrgUnitGroupNameMap.get( orgUnitId );
+
+ var orgUnitGroupName = tempOrgUnitGroupNameMap[orgUnitId];
+
+ //alert( orgUnitGroupName );
+
+
+ if( rprDesign == "MH_PATIENT_ALLOWANCE_CLAIM")
+ {
+ if( orgUnitGroupName == "Health Center")
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/Mathealth_report3_HC.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ else if( orgUnitGroupName == "Province Hospitals")
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/Mathealth_report3_PH.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ else if( orgUnitGroupName == "District hospital type A" || orgUnitGroupName == "District hospital type B" )
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/Mathealth_report3_DH.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ }
+
+ else if( rprDesign == "HEALTH_PROVIDER_PAYMENT_CLAIM")
+ {
+ if( orgUnitGroupName == "Health Center")
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/Healthprovider_HC_report4.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ else if( orgUnitGroupName == "Province Hospitals")
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/healthprovider_report4_PH.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ else if( orgUnitGroupName == "District hospital type A" || orgUnitGroupName == "District hospital type B" )
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/healthprovider_DH_report4.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ }
+
+ else if( rprDesign == "MATERNAL_HEALTH")
+ {
+ if( orgUnitGroupName == "Health Center")
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/MATERNAL_HEALTH_HC.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ else if( orgUnitGroupName == "Province Hospitals")
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/Mathealth_PH.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ else if( orgUnitGroupName == "District hospital type A" || orgUnitGroupName == "District hospital type B" )
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/Mathealth_DH.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ }
+
+ else if( rprDesign == "MONTHLY_PPS")
+ {
+ if( orgUnitGroupName == "Health Center")
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/monthly_pps.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ else if( orgUnitGroupName == "Province Hospitals")
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/monthly_pps.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ else if( orgUnitGroupName == "District hospital type A" || orgUnitGroupName == "District hospital type B" )
+ {
+ var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/monthly_pps.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
+ window.location.href = birtReportURL;
+ }
+
+ }
+
//alert( orgunit + "--" + orgUnitId )
//alert( rprDesign )
- var period = $('#selectedPeriodId').val();
-
- var startPeriod = period.split(":")[0];
- var endPeriod = period.split(":")[1];
+
//alert( startPeriod + " : " + endPeriod + " : " + rprDesign + " : " + orgUnitId );
- var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/"+rprDesign+"&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&District="+orgUnitId;
+ //var birtReportURL = "http://178.79.144.205:8989/birt/run?__report=/home/dqa/tomcat_pbf_laos/webapps/birt/report/"+rprDesign+"&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
//alert( birtReportURL );
- window.location.href = birtReportURL;
+
+ //window.location.href = birtReportURL;
/*
alert( startPeriod + " : " + endPeriod );
- var url = "../birt/run?__report=C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/birt/report/"+rprDesign+"&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&District="+orgUnitId;
+ var url = "../birt/run?__report=C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/birt/report/"+rprDesign+"&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgUnitId;
alert( url );
window.open('url', '_blank');
- window.location.href = "http://localhost:8090/birt/run?__report=C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/birt/report/"+rprDesign+"&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&District="+orgunit;
+ window.location.href = "http://localhost:8090/birt/run?__report=C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/birt/report/"+rprDesign+"&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&orgUnit="+orgunit;
//window.location.href = "http://localhost:8090/birt/run?__report=C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/birt/report/PBF_Payment_Voucher.rptdesign&__format="+reportFormat+"&startDate="+startPeriod+"&endDate="+endPeriod+"&District="+orgunit;
@@ -97,9 +205,24 @@
<td>
<select id="selectedReportId" name="selectedReportId" style="width:220px" >
<option value="-1">[$i18n.getString( "select" )]</option>
+ <option value="MATERNAL_HEALTH" >Maternal Health</option>
+ <option value="MONTHLY_PPS" >Monthly PPS</option>
+ <option value="MH_PATIENT_ALLOWANCE_CLAIM" >MH Patient Allownce Claim</option>
+ <option value="HEALTH_PROVIDER_PAYMENT_CLAIM" >Health Provider Payment Claim</option>
+
+ <!--
<option value="MATERNAL_HEALTH_HC.rptdesign" >Maternal Health HC</option>
<option value="Mathealth_DH.rptdesign" >Maternal Health DH</option>
- <option value="Mathealth_PH.rptdesign" >Maternal Health PH</option>
+ <option value="Mathealth_PH.rptdesign" >Maternal Health PH</option>
+ <option value="monthly_pps.rptdesign" >Monthly PPS</option>
+
+ <option value="Mathealth_report3_DH.rptdesign" >MH Patient Allownce Claim DH</option>
+ <option value="Mathealth_report3_HC.rptdesign" >MH Patient Allownce Claim HC</option>
+ <option value="Mathealth_report3_PH.rptdesign" >MH Patient Allownce Claim PH</option>
+ <option value="healthprovider_DH_report4.rptdesign" >Health Provider Payment Claim DH</option>
+ <option value="Healthprovider_HC_report4.rptdesign" >Health Provider Payment Claim HC</option>
+ <option value="healthprovider_report4_PH.rptdesign" >Health Provider Payment Claim PH</option>
+ -->
</select>
</td>
</tr>
@@ -143,8 +266,9 @@
</tr>
<tr>
<td>
- <input type="submit" id="submitButton" value="$i18n.getString( 'generate' )" style="width:10em" />
- <input type="text" id="birtpath" name="birtpath" value="$birtPath" />
+ <!--<input type="submit" id="submitButton" value="$i18n.getString( 'generate' )" style="width:10em" />-->
+ <input type="button" id="submitButton" value="$i18n.getString( 'generate' )" style="width:10em" onclick="formValidations()" />
+ <!--<input type="text" id="birtpath" name="birtpath" value="$birtPath" />-->
</td>
</tr>
</table>
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/updateUtilizationRateForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/updateUtilizationRateForm.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/updateUtilizationRateForm.vm 2014-06-20 10:21:56 +0000
@@ -0,0 +1,78 @@
+## Macro for generating the jQuery validation rules
+#macro( validate $type $require )
+ #if( $type == "NUMBER" )
+ {validate:{ number:true #if($require), required:true #end }}
+ #elseif( $require )
+ {validate:{required:true}}
+ #end
+#end
+<script>
+
+ jQuery(document).ready( function(){
+
+ currentDiv = 'updateUtilizationRateForm';
+ isSubmit = true;
+ jQuery("#updateUtilizationRateForm").validate({
+ meta:"validate"
+ ,errorElement:"span"
+ ,submitHandler: function(form)
+ {
+ if( isSubmit )
+ {
+ updateUtilizationRate();
+ }
+ }
+ });
+ });
+
+</script>
+
+<form id="updateUtilizationRateForm" name="updateUtilizationRateForm" method="post" >
+
+ <input type="hidden" id="dataElementId" name="dataElementId" value="$dataElement.id" />
+ <table width="100%">
+
+ <tr>
+ <th colspan="2">$i18n.getString( "Utilization Rule Details" ) : $dataElement.name</th>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "stare_range" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="startRange" name="startRange" value="$!utilizationRate.getStartRange()" class="{validate:{required:true}}"></td>
+ </tr>
+
+ <tr>
+ <td> </td>
+ <td> </td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "end_range" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="endRange" name="endRange" value="$!utilizationRate.getEndRange()" class="{validate:{required:true}}"></td>
+ </tr>
+
+ <tr>
+ <td> </td>
+ <td> </td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "Tariff Value" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="tariff" name="tariff" value="$!utilizationRate.getTariff()" class="{validate:{required:true}}"></td>
+ </tr>
+
+ <tr>
+ <td> </td>
+ <td> </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <input type="submit" value="$i18n.getString( 'save' )" style="width:120px" />
+ <input type="button" onclick="closePopUpWindow();" value="$i18n.getString( 'cancel' )" style="width:120px" />
+ </td>
+ </tr>
+
+
+ </table>
+</form>
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/utilizationRateList.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/utilizationRateList.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/utilizationRateList.vm 2014-06-20 10:21:56 +0000
@@ -0,0 +1,53 @@
+<script type="text/javascript">
+ jQuery(document).ready(function(){
+ tableSorter( 'listTable' );
+ });
+
+</script>
+
+<table class="mainPageTable">
+ <tr>
+ <td>
+ <table class="listTable" id="listTable">
+ <colgroup>
+ <col width="30"/>
+ <col />
+ <col />
+ <col/>
+ <col width="250"/>
+ </colgroup>
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>$i18n.getString( "stare_range" )</th>
+ <th>$i18n.getString( "end_range" )</th>
+ <th>$i18n.getString( "Tariff Value" )</th>
+ <th class="{sorter: false}" style="text-align:left">$i18n.getString( "operations" )</th>
+ </tr>
+ </thead>
+ <tbody id="list">
+ #set( $count=1 )
+ #foreach( $utilizationRate in $utilizationRateList )
+
+ <tr id="tr${utilizationRate.getStartRange()}">
+ <td>
+ $count
+ </td>
+
+ <td>$encoder.htmlEncode( $!utilizationRate.getStartRange() )</td>
+ <td>$encoder.htmlEncode( $!utilizationRate.getEndRange() )</td>
+ <td>$encoder.htmlEncode( $!utilizationRate.getTariff() )</td>
+
+ <td>
+ <a href="javascript:showUpdateutilizationRateForm( '$!utilizationRate.getStartRange()', '$!utilizationRate.getEndRange()' ,'$dataElement.getId()' )" title='$i18n.getString( "edit" )'><img src="../images/edit.png" alt='$i18n.getString( "edit" )'></a>
+ <a href="javascript:removeutilizationRate( '$!utilizationRate.getStartRange()', '$!utilizationRate.getEndRange()' , '$dataElement.getId()' )" title='$i18n.getString( "remove" )'><img src="images/deleteRed.png" alt='$i18n.getString( "remove" )'></a>
+ </td>
+ </tr>
+ #set($count = $count + 1)
+ #end
+ </tbody>
+ </table>
+ </td>
+ </tr>
+
+</table>
\ No newline at end of file
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/utilizationRuleDataElements.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/utilizationRuleDataElements.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/utilizationRuleDataElements.vm 2014-06-20 10:21:56 +0000
@@ -0,0 +1,57 @@
+<style>
+ #overlayUtilization {
+ z-index:9998;
+ position:absolute;
+ top:0;
+ bottom:0;
+ left:0;
+ width:100%;
+ background:#000;
+ opacity:0.45;
+ -moz-opacity:0.45;
+ filter:alpha(opacity=45);
+ visibility:hidden;
+ }
+ #overlayImgUtilization{ width: 50px; height: 50px; z-index: 9999; position: absolute; left:50%}
+</style>
+<div id="overlayUtilization">
+ <div id="overlayImgUtilization"><img width="50" height="50" src="images/ajax-loader.gif" style="margin:auto;position:fixed;top: 50%;left: 50%;"/></div>
+</div>
+
+
+
+<h3>Utilization Rate Rules Management</h3>
+<!--<div class="inputCriteria" style="width:600px;height:45px;">-->
+ <table style="background-color:#D0EBD0;" width="100%">
+ <tr>
+ <td><label>$i18n.getString( "DataElement" )</label></td>
+ <td>
+ <select id="dataElementId" name = "dataElementId" style="width:200px" onchange="loadUtilizationRate();" #if( $dataElements.size() == 0 ) disabled="disabled" #end>
+ <option value="-1">$i18n.getString( "select_dataElement" )</option>
+ #foreach( $dataElement in $dataElements )
+ <option value="$dataElement.id">$dataElement.name</option>
+ #end
+ </select>
+ </td>
+
+ <td valign='bottom' align='right'>
+ <input type="button" style='width:130px' value='$i18n.getString( "add" )' #if( $dataElements.size() == 0 ) disabled="disabled" #end onclick="showAddUtilizationRateForm();">
+ </td>
+ </tr>
+
+ </table>
+<!--</div>-->
+
+#parse( "/dhis-web-commons/loader/loader.vm" )
+<div id='utilizationRateListDiv'></div> <!-- Utilization Rate List -->
+<div id='addUpdateUtilizationRateDiv'></div> <!-- add update Utilization Rate/Rule -->
+
+<script type="text/javascript">
+
+var i18n_select_dataelement = '$encoder.jsEscape( $i18n.getString( "select_dataElement" ) , "'")';
+var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_utilization_rate_reule" ) , "'" )';
+
+jQuery( document ).ready( function()
+{
+});
+</script>