## Adding and Managing Expenses

This guide walks you through adding expenses, managing existing expenses, and using the Expense Manager interface in Alpha Insights.

### Accessing the Expense Manager

1. Go to Alpha Insights in your WordPress dashboard
2. Click Expense Manager from the menu
3. You'll see the Expense Management dashboard with metrics, recent expenses, and recurring expenses

### The Expense Manager Interface

#### Main Dashboard View

The dashboard shows:

- Header: Page title, date range selector, Add Expense button
- Metrics Cards: Paid Expenses, Unpaid Expenses, Net Revenue, Net Profit
- Recent Expenses List: Toggle between paid/unpaid, filterable by date range
- Recurring Expenses: Active recurring expenses with occurrence counts
- Taxonomy Manager: Quick view of categories and suppliers

#### Navigation Tabs

- Dashboard: Overview and recent activity
- Manage All Expenses: Complete expense list with advanced filtering
- Import Expenses: CSV import and bulk manual entry
- Manage Taxonomies: Categories and suppliers management

### Adding a New Expense

#### Opening the Add Expense Modal

Click the Add Expense button (available on all pages) to open the expense entry modal.

#### Expense Fields

Basic Information:

- Expense Name (Required): Descriptive name (e.g., "Office Rent - Main St Location")
- Amount (Required): Numeric amount (no currency symbols)
- Currency (Required): Select from available currencies (defaults to store currency)
- Date (Required): Date expense occurred (for one-time) or start date (for recurring)
- Reference Number: Optional invoice or reference ID

Organization:

- Expense Category: Select or create new category
- Supplier: Select or create new supplier

Status:

- Paid Status: Toggle between Paid/Unpaid (defaults to Paid)
- Note: Unpaid expenses are tracked separately and shown "all time" regardless of date filters

Recurring Options:

- Recurring Expense: Toggle to enable recurring
- Frequency: Daily, Weekly, Fortnightly, Monthly, Quarterly, or Yearly
- Start Date: When recurring begins (required if recurring)
- End Date: Optional - when recurring stops (leave blank for ongoing)

Attachments:

- Upload Files: Attach receipts, invoices, or documentation
- Supported Types: Images (JPG, PNG, GIF, WebP), PDFs, and documents
- Size Limit: 10MB per file
- Multiple Files: Attach multiple documents to one expense

#### Saving the Expense

1. Fill in required fields (marked with *)
2. Click Save Expense
3. The expense will be created and the list will refresh
4. For recurring expenses, occurrences are automatically calculated

### Example: Adding Different Types of Expenses

#### Example 1: One-Time Expense

    Expense Name: Website Redesign
    Amount: 3500
    Currency: USD
    Date: 2024-10-15
    Category: Marketing
    Supplier: WebDesignCo
    Paid: Yes
    Recurring: No
    Reference: Invoice-2024-10-15
    Attachment: WebDesign-Invoice.pdf

#### Example 2: Monthly Recurring Expense

    Expense Name: Office Rent
    Amount: 2500
    Currency: USD
    Frequency: Monthly
    Start Date: 2024-01-01
    End Date: (leave blank)
    Category: Operating Expenses
    Paid: Yes
    Recurring: Yes
    Reference: Lease-Agreement-2024

#### Example 3: Unpaid Expense

    Expense Name: Equipment Purchase - Printer
    Amount: 450
    Currency: USD
    Date: 2024-10-20
    Category: Operating Expenses
    Supplier: Office Supply Co
    Paid: No (Toggle to unpaid)
    Recurring: No
    Reference: PO-2024-1020

### Viewing and Managing Expenses

#### Recent Expenses View (Dashboard)

The dashboard shows recent expenses with:

- Paid/Unpaid Toggle: Switch between viewing paid or unpaid expenses
- Date Range Selector: Filter by 7, 30, 60, 90, 180, or 365 days
- Expense Details: Name, amount, date, category, supplier
- Quick Actions: View/Edit or Delete
- Add Button: Quick access to add new expense

#### Recurring Expenses View (Dashboard)

Shows all active recurring expenses with:

- Expense Name: Title of the recurring expense
- Amount Per Occurrence: Amount charged each time
- Frequency: How often it recurs
- Start/End Dates: When it began and ends (if applicable)
- Total Paid to Date: Cumulative amount paid
- Occurrence Count: Number of times it has occurred
- Actions: View/Edit the recurring expense

#### Manage All Expenses View

Advanced expense management with full filtering:

Filter Options:

- Date Range: Custom from/to dates
- Search: Search by expense name or reference
- Category: Filter by expense category
- Supplier: Filter by supplier
- Paid Status: All, Paid, or Unpaid
- Recurring: All, Recurring, or One-Time
- Attachments: All, With Attachments, or Without Attachments

Bulk Operations:

- Select Multiple: Checkbox to select expenses
- Bulk Delete: Delete selected expenses
- Bulk Update Paid: Mark selected as paid/unpaid
- Bulk Assign Category: Assign category to selected expenses
- Bulk Assign Supplier: Assign supplier to selected expenses

Export Options:

- Export Found: Export currently filtered expenses to CSV
- Export All: Export all expenses to CSV

Pagination:

- 50 expenses per page
- Navigate through pages for large expense lists
- Total count displayed

### Editing an Expense

#### From Any Expense List:

1. Click the Edit button next to the expense
2. The Add/Edit Expense modal opens with existing data
3. Modify any fields
4. Click Update Expense
5. Changes are saved and lists refresh

Important Notes:

- Editing an expense updates all calculations immediately
- For recurring expenses, editing updates the template - future occurrences use new values
- Past occurrences of recurring expenses remain unchanged
- API-created expenses (Facebook/Google) should not be manually edited

### Deleting Expenses

#### Single Expense:

1. Click the Delete button next to the expense
2. Confirm deletion when prompted
3. Expense is permanently deleted
4. All reports and calculations update immediately

#### Bulk Delete:

1. Go to Manage All Expenses
2. Select multiple expenses using checkboxes
3. Click Bulk Actions → Delete
4. Confirm bulk deletion
5. All selected expenses are permanently deleted

Warning: Deletion is permanent and cannot be undone. Consider marking expenses as unpaid or setting an end date for recurring expenses instead of deleting.

### Managing Expense Categories

#### Accessing Category Management:

1. Go to Expense Manager → Manage Taxonomies
2. Click the Expense Categories tab

#### Creating a New Category:

1. Click Add New Category
2. Enter category name
3. Optionally select a parent category (for hierarchical structure)
4. Click Save

#### Editing a Category:

1. Find the category in the list
2. Click Edit
3. Modify name or parent
4. Click Update
5. All expenses automatically update

#### Deleting a Category:

1. Click Delete next to the category
2. Choose what to do with expenses in this category:
   - Move to another category
   - Leave uncategorized
3. Confirm deletion

#### Bulk Category Operations:

- Select multiple categories
- Bulk delete or bulk edit

### Managing Suppliers

#### Accessing Supplier Management:

1. Go to Expense Manager → Manage Taxonomies
2. Click the Suppliers tab

#### Creating a New Supplier:

1. Click Add New Supplier
2. Enter supplier name
3. Optionally add:
   - Tax/VAT number
   - Country
4. Click Save

Note: Suppliers are shared between expenses and products, so you can track all costs associated with a specific supplier across your entire business.

#### Editing and Deleting Suppliers:

Same process as categories - edit to change details, delete to remove (with options for reassignment).

### Common Scenarios

#### Scenario: Converting Unpaid to Paid

When an unpaid expense is paid:

1. Find the expense in the Unpaid expenses list
2. Click Edit
3. Toggle Paid Status to Paid
4. Update the Date to the payment date
5. Add any relevant reference number
6. Click Update Expense

The expense will now appear in paid expenses and be included in date-filtered reports.

#### Scenario: Ending a Recurring Expense

To stop a recurring expense:

1. Find the recurring expense (Dashboard or Manage All)
2. Click Edit
3. Set an End Date (past or future)
4. Click Update Expense

The system will stop calculating occurrences after the end date.

#### Scenario: Changing Recurring Amount

If a recurring expense amount changes (e.g., rent increase):

1. Edit the recurring expense
2. Update the Amount
3. In Reference/Notes, note the effective date
4. Click Update Expense

Note: This will update future calculations but not past occurrences. For precise historical accuracy, you could set an end date on the old expense and create a new recurring expense with the new amount.

#### Scenario: Bulk Categorizing Uncategorized Expenses

1. Go to Manage All Expenses
2. Filter to show uncategorized expenses (or use search)
3. Select the expenses to categorize
4. Click Bulk Actions → Assign Category
5. Select the category
6. Click Apply

### Tips for Effective Expense Management

#### Use Descriptive Names

Good naming helps you find expenses later:

- Good: "Adobe Creative Cloud - Team Plan"
- Bad: "Software"

#### Leverage Categories and Suppliers

Consistent categorization and supplier assignment enables:

- Accurate expense breakdowns
- Supplier-specific cost analysis
- Better filtering and searching
- More meaningful reports

#### Attach Documentation

Always attach:

- Invoices for all significant expenses
- Receipts for in-person purchases
- Contracts for service agreements
- Any supporting documentation

#### Use Reference Numbers

Add invoice numbers, PO numbers, or internal reference codes to make expense tracking easier and more professional.

#### Review Regularly

Set a recurring calendar reminder to:

- Review and approve unpaid expenses
- Verify recurring expenses are still active
- Check for duplicate entries
- Ensure all expenses are properly categorized
- Export data for accounting

#### Use Filters Effectively

The Manage All Expenses filters are powerful:

- Find all expenses without attachments to add documentation
- Filter by supplier to review vendor costs
- Check recurring expenses to verify they're still needed
- Search by reference number for quick lookups

#### Leverage Bulk Operations

Bulk operations save time:

- Bulk assign categories when importing many expenses
- Bulk mark as paid after payment runs
- Bulk assign suppliers when adding historical data

### Keyboard Shortcuts & Quick Actions

- Add Expense Button: Always visible in header for quick access
- Edit Icon: Quick edit from any expense list
- Date Range Selector: Fast filtering on dashboard
- Paid/Unpaid Toggle: Instant view switching
- Export Buttons: One-click CSV export

### Troubleshooting

#### Expense Not Showing in Reports

- Check if expense is marked as Paid (unpaid expenses shown separately)
- Verify the date falls within your selected date range
- Confirm the expense was saved successfully
- Check category/supplier filters aren't excluding it

#### Recurring Expense Not Calculating Correctly

- Verify start date is in the past
- Check end date isn't before current date
- Confirm frequency is set correctly
- Recurring expenses don't calculate beyond current date

#### Can't Delete Expense

- Ensure you have proper permissions
- API-created expenses may need to be deleted from the source
- Try refreshing the page

#### Currency Conversion Issues

- Verify exchange rates are configured in Alpha Insights settings
- Check that currency codes are correct
- Currency conversions use rates from settings