src/scripts/script.js
//Remove the expenses from the incomes
Remove the expenses from the incomes
Remove the expenses from the incomes
total() {
    total = calculateTransactions.incomes() + calculateTransactions.expenses()
    if (total < 0) {
      document.querySelector('.card.total').classList.remove('income')
      document.querySelector('.card.total').classList.add('expense')
      document.getElementById('total-image').src = './assets/total.svg'
    } else if (total > 0) {
      document.querySelector('.card.total').classList.remove('expense')
      document.querySelector('.card.total').classList.add('income')
      document.getElementById('total-image').src = './assets/total.svg'
    } else {
      document.querySelector('.card.total').classList.remove('income')
      document.querySelector('.card.total').classList.remove('expense')
      document.getElementById('total-image').src = './assets/total-base.svg'
    }
    return total
  }
total ( ) { total = calculateTransactions . incomes ( ) + calculateTransactions . expenses ( ) if ( total < 0 ) { document . querySelector ( '.card.total' ) . classList . remove ( 'income' ) document . querySelector ( '.card.total' ) . classList . add ( 'expense' ) document . getElementById ( 'total-image' ) . src = './assets/total.svg' } else if ( total > 0 ) { document . querySelector ( '.card.total' ) . classList . remove ( 'expense' ) document . querySelector ( '.card.total' ) . classList . add ( 'income' ) document . getElementById ( 'total-image' ) . src = './assets/total.svg' } else { document . querySelector ( '.card.total' ) . classList . remove ( 'income' ) document . querySelector ( '.card.total' ) . classList . remove ( 'expense' ) document . getElementById ( 'total-image' ) . src = './assets/total-base.svg' } return total }
Remove the expenses from the incomes
Remove the expenses from the incomes