=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/SaveDataValueAction.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/SaveDataValueAction.java 2014-05-31 13:40:53 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/SaveDataValueAction.java 2014-06-02 11:30:23 +0000 @@ -122,14 +122,28 @@ public void setPeriodIso(String periodIso) { - this.periodIso = periodIso; - } + this.periodIso = periodIso; + } + + private String overAllScoreValue; + + public void setOverAllScoreValue( String overAllScoreValue ) + { + this.overAllScoreValue = overAllScoreValue; + } + + private String overAllScoreDeId; + + public void setOverAllScoreDeId( String overAllScoreDeId ) + { + this.overAllScoreDeId = overAllScoreDeId; + } // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- - private int statusCode = 0; + private int statusCode = 0; public int getStatusCode() { @@ -188,7 +202,7 @@ // Update data // --------------------------------------------------------------------- - DataValue dataValue = dataValueService.getDataValue(dataElement, period, organisationUnit, optionCombo); + DataValue dataValue = dataValueService.getDataValue( dataElement, period, organisationUnit, optionCombo); if ( dataValue == null ) { @@ -210,14 +224,62 @@ } else { - if( !(value.trim().equalsIgnoreCase( dataValue.getValue() )) ) + if( !(value.trim().equalsIgnoreCase( dataValue.getValue() ) ) ) { dataValue.setValue( value.trim() ); dataValue.setTimestamp( now ); dataValue.setStoredBy( storedBy ); dataValueService.updateDataValue( dataValue ); } - } + } + + // for saving Over All Score + + if ( overAllScoreValue != null && overAllScoreDeId != null ) + { + overAllScoreValue = overAllScoreValue.trim(); + + DataElement overAllScoreDataElement = dataElementService.getDataElement( Integer.parseInt( overAllScoreDeId ) ); + + if ( overAllScoreDataElement == null ) + { + return logError( "Invalid dataelement identifier: " + overAllScoreDeId ); + } + + DataValue overAllScoreDataValue = dataValueService.getDataValue( overAllScoreDataElement, period, organisationUnit, optionCombo ); + + if ( overAllScoreDataValue == null ) + { + if ( overAllScoreValue != null && (!overAllScoreValue.trim().equals( "" ) ) ) + { + overAllScoreDataValue = new DataValue(); + + overAllScoreDataValue.setPeriod( period ); + overAllScoreDataValue.setDataElement( overAllScoreDataElement ); + overAllScoreDataValue.setSource(organisationUnit); + overAllScoreDataValue.setCategoryOptionCombo( optionCombo ); + + overAllScoreDataValue.setValue( overAllScoreValue.trim() ); + overAllScoreDataValue.setTimestamp( now ); + overAllScoreDataValue.setStoredBy( storedBy ); + + dataValueService.addDataValue( overAllScoreDataValue ); + } + } + else + { + if( !(overAllScoreValue.trim().equalsIgnoreCase( overAllScoreDataValue.getValue() ) ) ) + { + overAllScoreDataValue.setValue( overAllScoreValue.trim() ); + overAllScoreDataValue.setTimestamp( now ); + overAllScoreDataValue.setStoredBy( storedBy ); + dataValueService.updateDataValue( overAllScoreDataValue ); + } + } + + } + + return SUCCESS; } === modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentAction.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentAction.java 2014-05-09 05:53:05 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentAction.java 2014-06-02 11:30:23 +0000 @@ -54,10 +54,11 @@ { qualityscorepayment = qualityScorePaymentService.getQualityScorePayment( id ); - + /* System.out.println( qualityscorepayment.getStartRange() ); System.out.println( qualityscorepayment.getEndRange() ); System.out.println( qualityscorepayment.getAddQtyPayment() ); + */ return SUCCESS; } === modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/report/action/PBFInvoiceReportFormAction.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/report/action/PBFInvoiceReportFormAction.java 2014-04-26 11:27:06 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/report/action/PBFInvoiceReportFormAction.java 2014-06-02 11:30:23 +0000 @@ -93,6 +93,7 @@ for ( Period period : periods ) { period.setName( format.formatPeriod( period ) ); + } return SUCCESS; === added 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 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/report/action/PBFReportFormAction.java 2014-06-02 11:30:23 +0000 @@ -0,0 +1,104 @@ +package org.hisp.dhis.rbf.report.action; + +import java.io.File; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.i18n.I18nFormat; +import org.hisp.dhis.period.CalendarPeriodType; +import org.hisp.dhis.period.MonthlyPeriodType; +import org.hisp.dhis.period.Period; +import org.hisp.dhis.period.PeriodType; +import org.hisp.dhis.system.filter.PastAndCurrentPeriodFilter; +import org.hisp.dhis.system.util.FilterUtils; + +import com.opensymphony.xwork2.Action; + +/** + * @author Mithilesh Kumar Thakur + */ +public class PBFReportFormAction implements Action +{ + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private List periods = new ArrayList(); + + public Collection getPeriods() + { + return periods; + } + + private I18nFormat format; + + public void setFormat( I18nFormat format ) + { + this.format = format; + } + + private String periodTypeName; + + public String getPeriodTypeName() + { + return periodTypeName; + } + + public void setPeriodTypeName( String periodTypeName ) + { + this.periodTypeName = periodTypeName; + } + + private String birtPath; + + public String getBirtPath() + { + return birtPath; + } + + // ------------------------------------------------------------------------- + // Action + // ------------------------------------------------------------------------- + + public String execute() throws Exception + { + birtPath = System.getenv( "DHIS2_HOME" ); + + birtPath += File.separator + "birtreports" + File.separator + "PBFInvoice.rptdesign"; + + //periodTypeName = QuarterlyPeriodType.NAME; + + periodTypeName = MonthlyPeriodType.NAME; + + CalendarPeriodType _periodType = (CalendarPeriodType) CalendarPeriodType.getPeriodTypeByName( periodTypeName ); + + Calendar cal = PeriodType.createCalendarInstance(); + + periods = _periodType.generatePeriods( cal.getTime() ); + + // periods = new ArrayList( + // periodService.getPeriodsByPeriodType( periodType ) ); + + FilterUtils.filter( periods, new PastAndCurrentPeriodFilter() ); + + Collections.reverse( periods ); + // Collections.sort( periods ); + for ( Period period : periods ) + { + period.setName( format.formatPeriod( period ) ); + } + + 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-05-09 05:53:05 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml 2014-06-02 11:30:23 +0000 @@ -463,4 +463,9 @@ scope="prototype"> + + + + + \ 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-05-09 05:53:05 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/resources/org/hisp/dhis/rbf/i18n_module.properties 2014-06-02 11:30:23 +0000 @@ -78,4 +78,10 @@ additional_quality_payment = Additional Quality Payment add_quality_score_payment_details = Add Quality Score Payment Details -quality_score_payment_details = Quality Score Payment Details \ No newline at end of file +quality_score_payment_details = Quality Score Payment Details + +pbf_report = PBF Report +pbf_report_management = PBF Report Management +report = Report +outputFormat = Output Format +generate = Generate \ 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-05-31 13:40:53 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/resources/struts.xml 2014-06-02 11:30:23 +0000 @@ -393,5 +393,18 @@ /dhis-web-maintenance-rbf/menu.vm + + + + /main.vm + /dhis-web-maintenance-rbf/pbfReportForm.vm + javascript/prevNextPeriods.js + /dhis-web-maintenance-rbf/menu.vm + + + + + + \ No newline at end of file === modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScoreDataEntry.js' --- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScoreDataEntry.js 2014-04-26 11:27:06 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScoreDataEntry.js 2014-06-02 11:30:23 +0000 @@ -101,6 +101,12 @@ var period = document.getElementById("selectedPeriodId").value; var valueId = "score_"+dataElementId; + var overAllScoreValue = document.getElementById("all-total").value; + + var overAllScoreDeId = "126"; + + var overAllScorefieldId = "#"+overAllScoreDeId; + var fieldId = "#"+valueId; var defaultValue = document.getElementById(valueId).defaultValue; var value = document.getElementById(valueId).value; @@ -111,7 +117,9 @@ 'dataElementId' : dataElementId, 'organisationUnitId' : $("#selectedOrgunitID").val(), 'periodIso' : period, - 'value' : value + 'value' : value, + 'overAllScoreValue' : overAllScoreValue, + 'overAllScoreDeId' : overAllScoreDeId }; jQuery.ajax( { url: 'saveDataValue.action', @@ -128,15 +136,19 @@ if ( code == '0' || code == 0) // Value successfully saved on server { markValue( fieldId, COLOR_GREEN ); + markValue( overAllScorefieldId, COLOR_GREEN ); + } else if ( code == 2 ) { markValue( fieldId, COLOR_RED ); + markValue( overAllScorefieldId, COLOR_RED ); window.alert( i18n_saving_value_failed_dataset_is_locked ); } else // Server error during save { markValue( fieldId, COLOR_RED ); + markValue( overAllScorefieldId, COLOR_RED ); window.alert( i18n_saving_value_failed_status_code + '\n\n' + code ); } } @@ -148,7 +160,8 @@ function markValue( fieldId, color ) { - document.getElementById(valueId).style.backgroundColor = color; + document.getElementById(valueId).style.backgroundColor = color; + document.getElementById("all-total").style.backgroundColor = color; } } === 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-05-31 13:40:53 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm 2014-06-02 11:30:23 +0000 @@ -18,13 +18,18 @@ - -

$i18n.getString( "aggregation_builder" )

+ +

$i18n.getString( "pbf_report" )

+ + +

$i18n.getString( "Lookup" )

  • $i18n.getString( "Lookup" )
  • === added 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 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm 2014-06-02 11:30:23 +0000 @@ -0,0 +1,152 @@ + + + + + + +

    $i18n.getString( "pbf_report_management" )

    + +
    + + + + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + + +
    + + + + + + + + +
    + #organisationUnitSelectionTree( false, false, false ) +
    + + +
    + +
    \ No newline at end of file === modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScoreEntrySelection.vm' --- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScoreEntrySelection.vm 2014-04-26 11:27:06 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScoreEntrySelection.vm 2014-06-02 11:30:23 +0000 @@ -1,3 +1,4 @@ +

    Quality Score Data Entry

    -