function processUsrAvailableLoginReport(usrIndex)
{
    // get current amount
    dbFunction.dbUser.getUsrAvailableAmount(usrIndex)
    .then((value) => {
        console.log("Your balance is "+ value + ".");
        // Show own to somebody record
        dbFunction.dbDebtTransaction.getOwnToTransaction(usrIndex)
        .then((ownToResult) => {
            if (ownToResult.length > 0)
            {
                processOwnToLoginReport(ownToResult, usrIndex, 0);
            }
            else
            {
                process.exit(1);
            }
        })
        .catch((err) => {
            console.error(err);
            process.exit(1);
        });
    })
    .catch((err) => {
        console.error(err);
        process.exit(1);
    });
}
// To print remaining amount from login user
To print remaining amount from login user
To print remaining amount from login user
function processUsrAvailableLoginReport(usrIndex)
{
    dbFunction.dbUser.getUsrAvailableAmount(usrIndex)
    .then((value) => {
        console.log("Your balance is "+ value + ".");
        dbFunction.dbDebtTransaction.getOwnToTransaction(usrIndex)
        .then((ownToResult) => {
            if (ownToResult.length > 0)
            {
                processOwnToLoginReport(ownToResult, usrIndex, 0);
            }
            else
            {
                process.exit(1);
            }
        })
        .catch((err) => {
            console.error(err);
            process.exit(1);
        });
    })
    .catch((err) => {
        console.error(err);
        process.exit(1);
    });
}
function processUsrAvailableLoginReport ( usrIndex ) { dbFunction . dbUser . getUsrAvailableAmount ( usrIndex ) . then ( ( value ) => { console . log ( "Your balance is " + value + "." ) ; dbFunction . dbDebtTransaction . getOwnToTransaction ( usrIndex ) . then ( ( ownToResult ) => { if ( ownToResult . length > 0 ) { processOwnToLoginReport ( ownToResult , usrIndex , 0 ) ; } else { process . exit ( 1 ) ; } } ) . catch ( ( err ) => { console . error ( err ) ; process . exit ( 1 ) ; } ) ; } ) . catch ( ( err ) => { console . error ( err ) ; process . exit ( 1 ) ; } ) ; }
To print remaining amount from login user
To print remaining amount from login user
// get current amount // Show own to somebody record