Optimal control of production and distribution in a supply chain system operating under a JIT delivery policy