Start with the invoice
Take the gross amount of the subcontractor's invoice and take away what they paid for: VAT, consumable stores, fuel (except for travelling), plant hired for the job, manufacturing or prefabricating materials, and materials they bought themselves.