In a multi-period, multi-commodity economy with stock markets, we try to extend the work of Dreze [Investment under private ownership: optimality, equilibrium and stability, in: Allocation under Uncertainty; Equilibrium and Optimality, Wiley, New York, 1974, p. 129] to define the behavior of the firms. We exhibit first-order necessary conditions for a constrained Pareto optimal allocation. The financial constraints lead to non-colinear supporting spot prices for the consumers at each node. Nevertheless, the firms are satisfying a first-order necessary condition for profit maximization with respect to a price computed as the Dreze's prices. These prices are also consistent with the sense that the present values of the firms computed with the personal prices of the stockholders and with the Dreze's prices coincide when short sales are allowed. We also show that these conditions are simpler if we consider an allocation at which each consumer maximizes his preferences, when they are smooth. This allows us to give a formal definition for the objective of the firms, which extend the Dreze's criterion. We also discuss different definitions of constrained feasibility, and, we provide the related necessary conditions, which do not differ for the production sector. (C) 2004 Elsevier B.V. All rights reserved.