<commit_before>package org.mifos.bi.test

import org.junit.Test

class LoanOfficerPerformanceSummaryDuringPeriodTest {

    def MFIName = '<NAME>'

    def reportName = 'Loan Officer Performance Summary (During Period)'

    def detailsHeader = ['Name', 'Date Joined', 'Total Groups Formed', 'Total Loans Disbursed', 'Total amt of Loans Disbursed',
            'Total amt of Loans Repaid', 'Total # new Savings Accounts', 'Total Clients Recruited', 'Total amt Savings Deposits',
            'Total amt Savings Withdrawals', '# of Dropouts']

    def pageFooter = ['Version 1.1', 'Page', '1 / 1']

    @Test
    void testParams_br2_20100701_20100930() {
        new PrptReport().execute () { t ->

            // Report settings.
            t.reportPath = 'reports/standardReports/prpts/LoanOfficerPerformanceSummaryDuringPeriod.prpt'
            t.reportParams = ['selected_office': '1.1.1.', 'start_date': '2010-07-01', 'end_date': '2010-09-30']

            def branch = ['Office:', 'br2']
            def detailsDuringPeriod = ['br2 LO xxx', '2010-07-20', '3', '1', '3000.0000', '78.0000', '5', '3', '1977.0000', '0.0000', '0']
            def totalDuringPeriod = ['Total During Period', '3', '1', '3000.0000', '78.0000', '5', '3', '1977.0000', '0.0000', '0']
            def grandTotalDuringPeriod = ['Grand Total During Period', '3', '1', '3000.0000', '78.0000', '5', '3', '1977.0000', '0.0000', '0']

            // MFI Name
            t.assertRowEquals(1, [MFIName])

            // Report title
            t.assertRowEquals(2, [reportName])

            // Report params
            t.assertCellEquals(3, 1, 'Office:')
            t.assertCellEquals(3, 2, 'br2')
            t.assertCellEquals(3, 3, 'From:')
            t.assertCellEquals(3, 4, 'To:')

            // 1st Details header
            def offset = 4
            t.assertRowEquals(offset, branch)
            t.assertRowEquals(offset+1, detailsHeader)
            // Details
            t.assertRowEquals(offset+2, detailsDuringPeriod)
            t.assertRowEquals(offset+3, totalDuringPeriod)
            // 1st Details footer
            t.assertRowEquals(offset+4, detailsHeader)
            t.assertRowEquals(offset+5, grandTotalDuringPeriod)

            // Page footer
            offset = 10
            t.assertRowEquals(offset, pageFooter)
            t.assertCellEquals(offset+1, 1, 'Printed by:')
            t.assertCellEquals(offset+1, 2, 'On:')
        }
    }

    @Test
    void testParams_BO1_20100701_20100930() {
        new PrptReport().execute () { t ->

            // Report settings.
            t.reportPath = 'reports/standardReports/prpts/LoanOfficerPerformanceSummaryDuringPeriod.prpt'
            t.reportParams = ['selected_office': '1.1.3.2.', 'start_date': '2010-07-01', 'end_date': '2010-09-30']

            def branch = ['Office:', 'BO 1']
            def detailsDuringPeriod1 = ['br1 lo 1 smith', '2010-07-01', '21', '3', '12000.0000', '3252.9000', '16', '24', '391.0000', '341.0000', '0']
            def detailsDuringPeriod2 = ['br1 lo 2 xxx', '2010-07-04', '4', '0', '0.0000', '0.0000', '5', '2', '756.0000', '0.0000', '0']
            def detailsDuringPeriod3 = ['br1 lo3 Sturt.. ..', '2010-07-29', '1', '0', '0.0000', '0.0000', '0', '0', '0.0000', '0.0000', '0']
            def totalDuringPeriod = ['Total During Period', '26', '3', '12000.0000', '3252.9000', '22', '26', '1147.0000', '341.0000', '0']
            def grandTotalDuringPeriod = ['Grand Total During Period', '26', '3', '12000.0000', '3252.9000', '22', '26', '1147.0000', '341.0000', '0']

            // MFI Name
            t.assertRowEquals(1, [MFIName])

            // Report title
            t.assertRowEquals(2, [reportName])

            // Report params
            t.assertCellEquals(3, 1, 'Office:')
            t.assertCellEquals(3, 2, 'BO 1')
            t.assertCellEquals(3, 3, 'From:')
            t.assertCellEquals(3, 4, 'To:')


            // 1st Details header
            def offset = 4
            t.assertRowEquals(offset, branch)
            t.assertRowEquals(offset+1, detailsHeader)
            // Details
            t.assertRowEquals(offset+2, detailsDuringPeriod1)
            t.assertRowEquals(offset+3, detailsDuringPeriod2)
            t.assertRowEquals(offset+4, detailsDuringPeriod3)
            t.assertRowEquals(offset+5, totalDuringPeriod)
            // 1st Details footer
            t.assertRowEquals(offset+6, detailsHeader)<commit_msg>correct test data due to fixing of MIFOSBI-303 next one<commit_after>package org.mifos.bi.test

import org.junit.Test

class LoanOfficerPerformanceSummaryDuringPeriodTest {

    def MFIName = '<NAME>'

    def reportName = 'Loan Officer Performance Summary (During Period)'

    def detailsHeader = ['Name', 'Date Joined', 'Total Groups Formed', 'Total Loans Disbursed', 'Total amt of Loans Disbursed',
            'Total amt of Loans Repaid', 'Total # new Savings Accounts', 'Total Clients Recruited', 'Total amt Savings Deposits',
            'Total amt Savings Withdrawals', '# of Dropouts']

    def pageFooter = ['Version 1.1', 'Page', '1 / 1']

    @Test
    void testParams_br2_20100701_20100930() {
        new PrptReport().execute () { t ->

            // Report settings.
            t.reportPath = 'reports/standardReports/prpts/LoanOfficerPerformanceSummaryDuringPeriod.prpt'
            t.reportParams = ['selected_office': '1.1.1.', 'start_date': '2010-07-01', 'end_date': '2010-09-30']

            def branch = ['Office:', 'br2']
            def detailsDuringPeriod = ['br2 LO xxx', '2010-07-20', '3', '1', '3000.0000', '78.0000', '5', '3', '1977.0000', '0.0000', '0']
            def totalDuringPeriod = ['Total During Period', '3', '1', '3000.0000', '78.0000', '5', '3', '1977.0000', '0.0000', '0']
            def grandTotalDuringPeriod = ['Grand Total During Period', '3', '1', '3000.0000', '78.0000', '5', '3', '1977.0000', '0.0000', '0']

            // MFI Name
            t.assertRowEquals(1, [MFIName])

            // Report title
            t.assertRowEquals(2, [reportName])

            // Report params
            t.assertCellEquals(3, 1, 'Office:')
            t.assertCellEquals(3, 2, 'br2')
            t.assertCellEquals(3, 3, 'From:')
            t.assertCellEquals(3, 4, 'To:')

            // 1st Details header
            def offset = 4
            t.assertRowEquals(offset, branch)
            t.assertRowEquals(offset+1, detailsHeader)
            // Details
            t.assertRowEquals(offset+2, detailsDuringPeriod)
            t.assertRowEquals(offset+3, totalDuringPeriod)
            // 1st Details footer
            t.assertRowEquals(offset+4, detailsHeader)
            t.assertRowEquals(offset+5, grandTotalDuringPeriod)

            // Page footer
            offset = 10
            t.assertRowEquals(offset, pageFooter)
            t.assertCellEquals(offset+1, 1, 'Printed by:')
            t.assertCellEquals(offset+1, 2, 'On:')
        }
    }

    @Test
    void testParams_BO1_20100701_20100930() {
        new PrptReport().execute () { t ->

            // Report settings.
            t.reportPath = 'reports/standardReports/prpts/LoanOfficerPerformanceSummaryDuringPeriod.prpt'
            t.reportParams = ['selected_office': '1.1.3.2.', 'start_date': '2010-07-01', 'end_date': '2010-09-30']

            def branch = ['Office:', 'BO 1']
            def detailsDuringPeriod1 = ['br1 lo 1 smith', '2010-07-01', '21', '3', '12000.0000', '3252.9000', '16', '24', '391.0000', '341.0000', '0']
            def detailsDuringPeriod2 = ['br1 lo 2 xxx', '2010-07-04', '4', '0', '0.0000', '0.0000', '6', '2', '756.0000', '0.0000', '0']
            def detailsDuringPeriod3 = ['br1 lo3 Sturt.. ..', '2010-07-29', '1', '0', '0.0000', '0.0000', '0', '0', '0.0000', '0.0000', '0']
            def totalDuringPeriod = ['Total During Period', '26', '3', '12000.0000', '3252.9000', '22', '26', '1147.0000', '341.0000', '0']
            def grandTotalDuringPeriod = ['Grand Total During Period', '26', '3', '12000.0000', '3252.9000', '22', '26', '1147.0000', '341.0000', '0']

            // MFI Name
            t.assertRowEquals(1, [MFIName])

            // Report title
            t.assertRowEquals(2, [reportName])

            // Report params
            t.assertCellEquals(3, 1, 'Office:')
            t.assertCellEquals(3, 2, 'BO 1')
            t.assertCellEquals(3, 3, 'From:')
            t.assertCellEquals(3, 4, 'To:')


            // 1st Details header
            def offset = 4
            t.assertRowEquals(offset, branch)
            t.assertRowEquals(offset+1, detailsHeader)
            // Details
            t.assertRowEquals(offset+2, detailsDuringPeriod1)
            t.assertRowEquals(offset+3, detailsDuringPeriod2)
            t.assertRowEquals(offset+4, detailsDuringPeriod3)
            t.assertRowEquals(offset+5, totalDuringPeriod)
            // 1st Details footer
            t.assertRowEquals(offset+6, detailsHeader)
{'fraction_non_alphanumeric': 0.1571842927264614, 'fraction_numerical': 0.09761267291387773, 'mean_word_length': 2.3142329020332717, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1798941', 'n_tokens_mistral': 3409, 'n_tokens_neox': 2805, 'n_words': 666}