Skip to content

FarmTablet integration — invoice display app foundation #3

Description

@TheCodingDad-TisonK

As we discussed on Discord, here is what my findings are and what we have already been building as a foundation.

What we've built so far (FarmTablet side)

I've added a Invoices app to FS25_FarmTablet that acts as a display layer for invoice data. It supports two modes:

Mode 1 — RoleplayPhone integration (primary)

When g_currentMission.roleplayPhoneAPI is detected, the app reads invoice data from your mod's API instead of the built-in system.

Mode 2 — Built-in fallback

When your mod isn't installed, FarmTablet's own FT_InvoiceManager handles invoice storage and display. Invoices persist to {savegameDir}/FS25_FarmTablet_Invoices.xml.


What we need from your side — API shape

The FarmTablet integration currently uses an anticipated API shape (marked with TODO comments). Once your API is ready, I just need to update one adapter function in RoleplayPhoneApp.lua.

Anticipated interface (please correct as needed):

-- Set on g_currentMission by your mod:
g_currentMission.roleplayPhoneAPI = {
    -- Returns array of invoice tables for a given type
    getInvoices = function(invoiceType)  -- "incoming" | "outgoing"
        -- returns: { { party, description, amount, status, createdDay, dueDay }, ... }
    end,

    -- Optional: if you expose totals directly
    getTotals = function()
        -- returns: totalOwed, totalReceivable
    end,
}

Invoice status values we expect: "pending", "paid", "overdue"


What the app displays

  • Summary bar — total receivable (green) vs total owed (red)
  • INCOMING section — money others owe you, with party name, description, amount, status badge, due date countdown
  • OUTGOING section — money you owe others, same layout
  • + NEW button — in built-in mode, opens an invoice creation dialog (in progress). In phone mode, we'd call your creation flow if you expose one.

Questions for you

  1. What global name does your mod attach to g_currentMission? (I assumed roleplayPhoneAPI — let me know the real one)
  2. What fields does an invoice object have in your system?
  3. Do you expose a creation flow we can hook into, or should the NEW button always use FarmTablet's own dialog?
  4. Do you want the app to also cross-post invoices created in FarmTablet into your phone system?

Happy to adjust the integration to match your actual implementation — just point me at the API and I'll update the adapter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions