# Movex Canada Finance / Accounts Laravel Starter

This package was prepared from the uploaded Laravel base app and converted into a Canada-localized finance/accounting starter portal.

## Database configured in `.env`

```env
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=movecdxj_ca_finance
DB_USERNAME=movecdxj_ca_finance
DB_PASSWORD="CHANGE_ME"
SESSION_DRIVER=file
```

`SESSION_DRIVER=file` is intentional so the login page does not crash before the database migrations are completed.

## Seeded accounts

Admin:

```text
admin@finance.test
Password@123
```

Users:

```text
user1@finance.test
Password@123

user2@finance.test
Password@123

user3@finance.test
Password@123
```

## Important role rule

Registration creates `role = user` only. Admin role can be changed manually in the database:

```sql
UPDATE users SET role = 'admin' WHERE email = 'someone@example.com';
```

Or through the seeded admin user under Admin > Users.

## Main modules included

### Admin portal

- Dashboard
- Chart of Accounts
- Finance Contacts: Canadian suppliers, customers, employees, province, postal code, CRA/GST-HST identifiers
- Canadian Bank Accounts with institution, transit and account number fields
- Invoices / Receivables
- Bills / Payables
- Expense Claims approval and reimbursement
- Cash Advances approval
- Manual Journal Entries
- Budgets
- Payroll records
- Canadian tax records: GST/HST, PST/QST, payroll remittance and other obligations
- Reports: trial balance, income statement, balance sheet summary
- User role/status management
- Audit logs

### User portal

- Dashboard
- Profile update
- Expense claim submission and tracking
- Cash advance request and tracking

## Deployment commands

Run these from the folder that contains `artisan`:

```bash
php artisan optimize:clear
php artisan config:clear
php artisan cache:clear
php artisan route:clear
php artisan migrate --seed
chmod -R 775 storage bootstrap/cache
```

If you get `Could not open input file: artisan`, you are in the wrong folder. Run:

```bash
find . -maxdepth 4 -name artisan -type f
```

Then `cd` into the folder containing `artisan`.

## Database privilege fix if needed

If you see error 1044 access denied, the MySQL user has not been attached to the database. In cPanel:

1. Go to MySQL Databases.
2. Add user `movecdxj_ca_finance` to database `movecdxj_ca_finance`.
3. Grant ALL PRIVILEGES.
4. Save.
5. Run `php artisan migrate --seed` again.

## Canada localization notes

- Default currency is CAD and display symbol is C$.
- Tax labels are GST/HST by default with PST, QST, payroll remittance and other Canadian tax types available.
- Demo contact data uses Canadian phone, province and postal-code examples.
- Do not leave `DB_PASSWORD=CHANGE_ME` in production, because apparently attackers also enjoy free accounting software.
