Skip to main content
Work sheets (SheetProject) are billing documents that track daily operations, resources, and costs for projects. This API allows you to create, update, and manage work sheets and their line items.

Endpoints

List project sheets

Get all work sheets for a specific project.
GET /api/workorders/sheets/project/{project_id}/
project_id
integer
required
The ID of the project to retrieve sheets for
{
  "success": true,
  "data": [
    {
      "id": 1,
      "project_id": 5,
      "series_code": "PSL-PS-2025-0001",
      "date": "2025-03-01",
      "status": "IN_PROGRESS",
      "subtotal": "1500.00",
      "tax_percentage": "15.00",
      "tax_amount": "225.00",
      "total": "1725.00"
    }
  ]
}

Create work sheet

POST /api/workorders/sheets/create/
Creates a new work sheet for a project with automatic series code generation.
project_id
integer
required
Project to associate the work sheet with
date
string
required
Date of the work sheet (YYYY-MM-DD format)
status
string
default:"IN_PROGRESS"
Sheet status. Options: IN_PROGRESS, LIQUIDATED, INVOICED
observations
string
Additional notes or observations
{
  "success": true,
  "message": "Work sheet created successfully",
  "data": {
    "id": 1,
    "series_code": "PSL-PS-2025-0001",
    "project_id": 5,
    "date": "2025-03-01",
    "status": "IN_PROGRESS"
  }
}

Update work sheet

PUT /api/workorders/sheets/update/
Updates an existing work sheet.
id
integer
required
ID of the work sheet to update
date
string
New date (YYYY-MM-DD format)
status
string
New status: IN_PROGRESS, LIQUIDATED, INVOICED
observations
string
Updated observations

Delete work sheet

DELETE /api/workorders/sheets/delete/
Soft deletes a work sheet (marks as inactive).
id
integer
required
ID of the work sheet to delete
{
  "success": true,
  "message": "Work sheet deleted successfully"
}

Get sheet items

GET /api/workorders/sheets/items/{sheet_project_id}/
Retrieves all line items (SheetProjectDetail) for a specific work sheet.
sheet_project_id
integer
required
ID of the work sheet
{
  "success": true,
  "data": [
    {
      "id": 1,
      "date": "2025-03-01",
      "description": "BAÑO SANITARIO HOMBRE BS-001",
      "quantity": 1,
      "unit_price": "50.00",
      "subtotal": "50.00",
      "reference_document": "REF-001"
    }
  ]
}

Update sheet detail days

PUT /api/workorders/sheets/detail/{detail_id}/days/
Updates the days/quantity for a specific sheet detail line item.
detail_id
integer
required
ID of the sheet detail item
days
number
required
Number of days/quantity

Reopen work sheet

POST /api/workorders/sheets/reopen/
Reopens a liquidated or invoiced work sheet, changing its status back to IN_PROGRESS.
id
integer
required
ID of the work sheet to reopen
Reopening a sheet may affect financial reports. Ensure this action is authorized.

Work sheet model

id
integer
Unique identifier
project
object
Associated project
series_code
string
Auto-generated series code (format: PSL-PS-YYYY-NNNN)
date
string
Sheet date (YYYY-MM-DD)
status
string
Current status: IN_PROGRESS, LIQUIDATED, INVOICED
subtotal
decimal
Sum of all line items before tax
tax_percentage
decimal
Tax percentage applied (default 15%)
tax_amount
decimal
Calculated tax amount
total
decimal
Final total including tax
observations
string
Additional notes
is_deleted
boolean
Soft delete flag

Sheet detail model

Line items within a work sheet:
id
integer
Unique identifier
sheet_project
object
Parent work sheet
date
string
Line item date
description
string
Item description (typically equipment name and code)
quantity
decimal
Quantity/days
unit_price
decimal
Price per unit/day
subtotal
decimal
quantity × unit_price
reference_document
string
Reference document number

Workflow example

1

Create a work sheet

Create a new work sheet for billing:
curl -X POST https://mantis.peisol.com.ec/api/workorders/sheets/create/ \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": 5,
    "date": "2025-03-01"
  }'
2

Add line items

Line items are typically created automatically based on project resources, or can be added manually through the UI.
3

Update quantities

Adjust days/quantities for each line item:
curl -X PUT https://mantis.peisol.com.ec/api/workorders/sheets/detail/1/days/ \
  -H "Content-Type: application/json" \
  -d '{"days": 5}'
4

Liquidate the sheet

Change status to LIQUIDATED when ready for billing:
curl -X PUT https://mantis.peisol.com.ec/api/workorders/sheets/update/ \
  -H "Content-Type: application/json" \
  -d '{
    "id": 1,
    "status": "LIQUIDATED"
  }'

Best practices

Series codes are automatically generated in the format PSL-PS-YYYY-NNNN where:
  • PSL: Company prefix (PEISOL)
  • PS: Document type (Project Sheet)
  • YYYY: Current year
  • NNNN: Sequential number
Tax is automatically calculated as 15% (IVA) of the subtotal. The total is subtotal + tax_amount.
Follow this workflow:
  1. IN_PROGRESS: Sheet is being created/edited
  2. LIQUIDATED: Sheet is ready for invoicing
  3. INVOICED: Sheet has been invoiced
Use reopen endpoint to move back to IN_PROGRESS if needed.

Custody chains

Track equipment custody and responsibility

Project resources

Manage project resource allocation