function processOwnToLoginReport(ownToResult, usrIndex, startIndex)
{
    dbFunction.dbUser.getUsrName(ownToResult[startIndex].toUserId)
    .then((ownToName) => {
        console.log("Owing " + ownToResult[startIndex].debtAmount  + " to "+ ownToName +".")
        if (startIndex == (ownToResult.length - 1))
        {
            process.exit(1);
        }
        else
        {
            processOwnToLoginReport(ownToResult, usrIndex, startIndex + 1);
        }
    })
    .catch((err) => {
        console.error(err);
        process.exit(1);
    });
}
// To print own to login user
To print own to login user
To print own to login user
function processOwnToLoginReport(ownToResult, usrIndex, startIndex)
{
    dbFunction.dbUser.getUsrName(ownToResult[startIndex].toUserId)
    .then((ownToName) => {
        console.log("Owing " + ownToResult[startIndex].debtAmount  + " to "+ ownToName +".")
        if (startIndex == (ownToResult.length - 1))
        {
            process.exit(1);
        }
        else
        {
            processOwnToLoginReport(ownToResult, usrIndex, startIndex + 1);
        }
    })
    .catch((err) => {
        console.error(err);
        process.exit(1);
    });
}
function processOwnToLoginReport ( ownToResult , usrIndex , startIndex ) { dbFunction . dbUser . getUsrName ( ownToResult [ startIndex ] . toUserId ) . then ( ( ownToName ) => { console . log ( "Owing " + ownToResult [ startIndex ] . debtAmount + " to " + ownToName + "." ) if ( startIndex == ( ownToResult . length - 1 ) ) { process . exit ( 1 ) ; } else { processOwnToLoginReport ( ownToResult , usrIndex , startIndex + 1 ) ; } } ) . catch ( ( err ) => { console . error ( err ) ; process . exit ( 1 ) ; } ) ; }
To print own to login user
To print own to login user