Exemple #1
0
def update_expense(ID, category, amount, date):
    EM = ExpenseManager()
    EM.from_csv(expense_csv)

    expense = Expense(ID, category, amount, date)
    EM.upd_expense(ID, expense)
    EM.override_to_csv(expense_csv)
Exemple #2
0
def delete_expense(ID):
    """ Delete the expense record from the list

    :return: None
    :rtype: None
    """
    # Load the list of expenses from csv, then put it into EM to manipulate
    # Finally put it back to the csv
    EM = ExpenseManager()
    EM.from_csv(expense_csv)
    EM.del_expense(ID)
    EM.override_to_csv(expense_csv)
Exemple #3
0
def update_expense(ID, category, amount, date):
    """ 
    Updates the specified expense
    :param ID: ID of expense to be updated
    :type ID: int
    
    :return: None
    :rtype: None
    """
    EM = ExpenseManager()
    EM.from_csv(expense_csv)

    expense = Expense(ID, category, amount, date)
    EM.upd_expense(ID, expense)
    EM.override_to_csv(expense_csv)