A problem of optimization for production and storge costs is studied. The problem consists in manufacture of n types of products, with some given restrictions, so that the total production and storage costs are minimal. The mathematical model is built using the framework of driftless control affine systems. Controllability is studied using Lie geometric methods and the optimal solution is obtained with Pontryagin Maximum Principle. It is proved that the economical system is not controllable, in the sense that we can only produce a certain quantity of products. Finally, some numerical examples are given with graphical representation.