Progress Billing SOV

How can progress billings be setup to use Phases as the SOV lines that can have multiple cost codes assigned to the phase?  Also, how can tasks be associated with cost codes?