Fuel Bill / Expense Bill
Fuel Bill / Expense Bill records vehicle fuel and operational expense bills. It captures vehicle/partner/account context, amount, bill date, evidence, branch/company data, transport linkage, and retry behavior for integration failures.
App Entry Points
| App | Target |
|---|---|
| Mobile | ExpenseBillList -> ExpenseBillDetail |
| POS Terminal | expenseBill -> ExpenseBillDetailForm |
Workflow
Data And API Rules
Form Validation And List Actions
| Action | Guard / behavior |
|---|---|
| Create | Requires expense-bill create authority; Terminal additionally requires main-branch context unless the configured override applies. |
| Vehicle/account/company | Selectors populate both codes and display names used by the payload and integration. |
| Company code | Must be BFPDB, BFP, NFFDB, or NFF (case-insensitive); other values show validation and stop submission. |
| Evidence | Evidence is part of the record lifecycle; deleting/replacing it must be followed by a server refresh. |
| Delete from list | Permission-guarded, confirmed, and executed against the existing bill id. |
| Retry | Uses the failed bill id and must not create a duplicate accounting document. |
| Transport launch | Successful save marks the fuel task handled on the linked transport before returning. |
| Rule | Behavior |
|---|---|
| List source | Terminal split list calls /bills with selected branchId, pageLimit: 200, ignoreDraft: true. |
| Dedupe | Expense bill list dedupes by billId, falling back to billNo. |
| Create/update | Detail form creates or updates expense bill payloads. |
| Company code | Before saving, only BFPDB, BFP, NFFDB, or NFF is accepted. Other values, such as warehouse code SSK, are not sent to the API. |
| Transport company context | A new transport starts with BFPDB; selecting a vehicle uses the vehicle company code as the transport company before opening the fuel-bill form. |
| Transport link | When launched from transport, saving can update transport gas/fuel flags. |
| Retry | Retry uses existing bill id to avoid duplicate expense records. |
| Evidence | Slip/photo/evidence belongs to the bill record and must refresh from server after save. |
Permissions And Guards
| Topic | Behavior |
|---|---|
| Terminal menu key | expenseBill |
| deptCode menu set | -2, 1, 2, 3, 4, 7, 29, 21, 8, 9, 13, 16, 14, 27, 30 |
| Branch rule | Main branch only in Terminal config (requiresMainBranch = true). |
| Create guard | Create button uses canCreateExpenseBill(...). |
Mobile vs POS Terminal
| Topic | Mobile | POS Terminal |
|---|---|---|
| Navigation | Expense bill stack list/detail | HomeScreen split-pane menu key expenseBill |
| Detail | Full-screen expense bill form | ExpenseBillDetailForm |
| Vehicle/account | Mobile form selectors | Terminal detail selectors/panels |
| Retry | Detail/list action | Split list/detail action |
Developer Handoff Map
| Area | Code |
|---|---|
| Mobile list/detail | apps/mobile/src/screens/expenseBillStack/expenseBillListScreen, expenseBillDetailScreen |
| Terminal detail | apps/pos-terminal/src/screens/HomeScreen/ExpenseBillDetailForm.tsx, ExpenseBillPanels.tsx |
| Service | apps/*/src/services/expenseBill.ts / expense bill service module |
| Transport dependency | TransportDetailForm.tsx, transport update service |