Skip to main content

Fuel Buy

Available to: Admin, Super Admin, Machinery Owner, Machinery Operator, Bunk Salesman

Manage fuel purchase records from bunks for machinery operations.

Workflow

A fuel buy request goes through the following lifecycle:

Owner/Operator adds buy → Status: "Pending" → Owner reviews & clicks "Request" → Status: "Requested" → Bunk Salesman reviews → Accepted or Declined

Step-by-step

  1. Machinery Owner or Operator opens /fuels/buy and clicks Add to create a new buy request with fuel details and proof uploads
  2. The request is created with status "Pending" — this is a draft state where the owner can review and edit the details
  3. Owner/Operator opens the request detail view to review the filled details
    • The allowed service limit is displayed at the top
    • A "Pending" badge with a pencil icon and cancel option is shown
    • The form remains editable — the owner can update any field
    • A "Request" button is shown at the bottom
  4. Owner/Operator clicks "Request" to submit the request to the bunk — status changes to "Requested"
  5. Bunk Salesman opens the same /fuels/buy page, sees the request, and clicks into the detail view
    • The form is read-only for the salesman — they cannot edit any fields
    • They see Accept and Decline buttons at the bottom
  6. Salesman takes action:
    • Accept — Status changes to "Accepted", salesman ID and timestamp are recorded. A settlement is created with status "Pending" and a due date (see Settlement Lifecycle below)
    • Decline — A modal appears to enter a decline reason. Status changes to "Declined" with the reason stored
  7. If Declined, the Owner/Operator can edit the request and resubmit — status goes back to "Requested" for the salesman to review again
  8. If status is Pending, the Owner/Operator can Cancel the request

Settlement Lifecycle

When a buy request is accepted, a settlement is automatically created and eventually credited to the bunk owner's company wallet:

  1. Acceptance — Settlement created with status "Pending" and a due date calculated as: accepted date + bunk's settlement duration days
  2. Due date arrives — A daily automated job finds all pending settlements that are due
  3. Auto-settlement — The job marks the settlement as "Paid" and credits the final amount (bill amount minus commission) to the bunk owner's company wallet with source "Bunk Settlement"
Day 0: Salesman accepts buy request (₹5,000)
→ Settlement created: Pending, commission ₹200, due in 7 days

Day 7: Auto-settlement runs
→ Settlement: Pending → Paid
→ Company wallet: +₹4,800 (source: "Bunk Settlement")

You can track settlements at Fuels → Settlements (/fuels/settlements), and the wallet credit appears in the company's wallet history at Companies → [Company] → Account → Wallet.

Status Flow

┌─────────┐ Owner clicks "Request" ┌──────────┐
│ Pending │ ────────────────────────► │ Requested│
└────┬────┘ └────┬─────┘
│ │
│ Owner cancels Salesman reviews
▼ ┌──────┴──────┐
┌──────────┐ ▼ ▼
│ Canceled │ ┌──────────┐ ┌──────────┐
└──────────┘ │ Accepted │ │ Declined │
└──────────┘ └─────┬────┘

Owner/Operator
edits & resubmits


┌──────────┐
│ Requested│ (back to review)
└──────────┘

Who can do what

RoleCan CreateCan EditCan RequestCan Accept/DeclineCan Cancel
Machinery OwnerYesYes (when Pending/Declined)Yes (when Pending)NoYes (when Pending)
Machinery OperatorYesYes (when Pending/Declined)Yes (when Pending)NoYes (when Pending)
Bunk SalesmanNoNo (read-only)NoYes (when Requested)No
Admin / Super AdminYesYesYesYesYes
info

All roles use the same /fuels/buy page. There is no separate interface for the salesman — the detail view shows different actions based on your role.

Buy List

Navigate to Fuels → Buy (/fuels/buy) to view all fuel buy records.

List Features

  • Table and Card views — Switch between table layout and card-based display
  • Global search — Search across bunk name, machinery, operator, and other fields
  • Aggregated totals — Diesel and Petrol amount totals displayed at the top

List Columns

ColumnDescription
MachineryRegistration number and fuel type badge
AmountPurchase amount in ₹
UserOwner/Operator name
VolumeFuel volume in litres with filled-into icon
BillView icon for bunk bill
DateRequest date
Fuel BunkBunk name and mobile number
StatusColor-coded status badge
Accepted bySalesman name and timestamp, or "Yet to be accepted"

Filtering

Use the filter panel to narrow results:

FilterDescription
Fuel BunkFilter by specific bunk
Fuel TypePetrol or Diesel
StatusRequested, Accepted, Declined, Canceled, Pending, Direct
Filled IntoMachinery, Can Single, Can Multiple
MachineryFilter by specific machinery
OperatorFilter by machinery operator
OwnerFilter by machinery owner
Date RangeFilter by creation date
Amount RangeFilter by amount (min/max)
Rate RangeFilter by fuel rate (min/max)
Volume RangeFilter by volume (min/max)

Buy Request Statuses

StatusColorDescription
RequestedYellowSubmitted, awaiting bunk salesman response
AcceptedGreenBunk salesman has accepted the request
DeclinedRedBunk salesman has declined (reason recorded)
CanceledRequest was canceled by owner/operator
PendingTertiaryDraft — created but not yet submitted to bunk
DirectDirect purchase without prior request

Creating a Buy Request

  1. Navigate to Fuels → Buy and click Add
  2. Choose From Bunk (purchase from a fuel bunk)
  3. Fill in the required fields and click Add — the request is saved with status "Pending"
  4. Open the request detail view to review your entries
  5. Click "Request" to submit it to the bunk — status changes to "Requested"

Core Fields

FieldRequiredDescription
Fuel BunkYesSelect the bunk where fuel will be purchased
Fuel TypeYesPetrol or Diesel
Filled IntoYesWhere the fuel is being filled — Machinery, Can Single, or Can Multiple
RateYesPrice per unit
AmountYesTotal amount
VolumeAutoCalculated from rate and amount

Conditional Fields

When Filled Into is set to Machinery or Can Single:

FieldDescription
MachinerySelect the machinery being fueled
OperatorOperator performing the fill
OwnerMachinery owner

Proof Uploads

UploadPurpose
Before Filled ProofPhoto of fuel gauge/tank before filling
After Filled ProofPhoto after filling is complete
Bunk Meter ProofPhoto of the bunk's meter reading
Bunk BillScanned copy of the fuel bill

Notes

Add optional notes for additional context about the fuel purchase.

Viewing & Editing a Buy Request

Click any record in the Buy list to open the detail view (/fuels/buy/$fuelBuyId).

As Owner/Operator

  • Review details and click "Request" to submit to bunk (when status is Pending)
  • Edit fields and proof uploads (when status is Pending or Declined)
  • Resubmit a declined request (status goes back to "Requested")
  • Cancel a pending request

As Bunk Salesman

  • View request details (all fields are read-only)
  • Accept — Confirms the fuel purchase
  • Decline — Opens a modal to enter a decline reason

Decline History

When a request is declined, the reason, declined-by user, and timestamp are stored. A request can be declined multiple times (if resubmitted after each decline), and the full decline history is viewable.

Editing Proof Uploads

Proof files can be re-uploaded or replaced when editing, depending on status and role:

StatusCan Edit Proofs?
PendingYes
DeclinedYes
CanceledYes
RequestedNo (locked)
AcceptedNo (locked)
note

Bunk Salesman users cannot edit proof uploads on any existing request regardless of status.