<commit_before>import { Injectable } from '@angular/core';
import * as _ from 'lodash';
import { Console } from '@angular/core/src/console';
@Injectable()
export class CommonService {
    constructor() { }
    finalGenerateReport(csvFullData, headarraylist, accountlistdata) {
        let totalHeadsReport = {};
        _.forEach(headarraylist, (value, key) => {
            totalHeadsReport[value['head']] = 0
        })
        _.forEach(csvFullData, (csv, key) => {
            const head = _.find(headarraylist, { '_id': csv['Assigned_head_id'] });
            totalHeadsReport[head['head']] += csv['Transaction_Amount(INR)']
            const account = _.find(accountlistdata, { '_id': csv['AssignedAccountNo'] })
            if(!totalHeadsReport['Opening Balance (A/C: '+account['Account_no']+')']) {
                totalHeadsReport['Opening Balance (A/C: '+account['Account_no']+')'] = csv['Available_Balance(INR)']
            } else {
                totalHeadsReport['Closing Balance (A/C: '+account['Account_no']+ ')'] = csv['Available_Balance(INR)']
            }
            
        })
        if (totalHeadsReport['Income'] && totalHeadsReport['Transfer']) {
            totalHeadsReport['Income-Transfer'] = totalHeadsReport['Income'] - totalHeadsReport['Transfer']
        }
        const finalData = [];
        _.forEach(totalHeadsReport, (value, key) => {
            finalData.push({
                'name': key,
                'value': value
            })
        })
        return finalData;
    }
}
<commit_msg>working on csvtime line error<commit_after>import { Injectable } from '@angular/core';
import * as _ from 'lodash';
import { Console } from '@angular/core/src/console';
@Injectable()
export class CommonService {
    constructor() { }
    finalGenerateReport(csvFullData, headarraylist, accountlistdata) {
        let totalHeadsReport = {};
        _.forEach(headarraylist, (value, key) => {
            totalHeadsReport[value['head']] = 0
        })
        _.forEach(csvFullData, (csv, key) => {
            console.log("csv",csv);
            const head = _.find(headarraylist, { '_id': csv['Assigned_head_id'] });
            if(head){
            totalHeadsReport[head['head']] += csv['Transaction_Amount(INR)']
            }
            const account = _.find(accountlistdata, { '_id': csv['AssignedAccountNo'] })
            if(!totalHeadsReport['Opening Balance (A/C: '+account['Account_no']+')']) {
                totalHeadsReport['Opening Balance (A/C: '+account['Account_no']+')'] = csv['Available_Balance(INR)']
            } else {
                totalHeadsReport['Closing Balance (A/C: '+account['Account_no']+ ')'] = csv['Available_Balance(INR)']
            }
            
        })
        if (totalHeadsReport['Income'] && totalHeadsReport['Transfer']) {
            totalHeadsReport['Income-Transfer'] = totalHeadsReport['Income'] - totalHeadsReport['Transfer']
        }
        const finalData = [];
        _.forEach(totalHeadsReport, (value, key) => {
            finalData.push({
                'name': key,
                'value': value
            })
        })
        return finalData;
    }
}

{'fraction_non_alphanumeric': 0.15518331226295828, 'fraction_numerical': 0.0006321112515802782, 'mean_word_length': 2.474204171240395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '7244767', 'n_tokens_mistral': 940, 'n_tokens_neox': 910, 'n_words': 156}