In the manufacturing and retail sectors, the challenges of supplier selection revolve around determining the most efficient allocation of raw materials to various suppliers to minimize procurement costs. Concurrently, production planning issues focus on optimizing the quantity of products to be manufactured. Simultaneously, warehouses used to store raw materials and products must also be optimally managed to reduce holding costs. To achieve maximum revenue, decision-makers must make optimal arrangements regarding these three problems. This study introduces a novel mathematical model within the realm of dynamic expected-based probabilistic piecewise programming as a decision support tool for those three problems, which are solved in an integrated manner. It aids in identifying optimal solutions for the combined issues of supplier selection, inventory management, and production planning, which encompass discount and uncertainty factors. The primary objective is to enhance supply chain performance, specifically by maximizing profits derived from production activities. The model accommodates supply chain scenarios involving multiple raw materials, suppliers, products, and buyers. Furthermore, the problem is modeled with numerous observation time instants. Numerical experiments were conducted to assess the proposed model and to demonstrate how optimal decisions can be made. Compared to the deterministic model, the proposed model increased the profit by 6%. The results indicate the model's effectiveness in resolving these challenges and providing optimal solutions. As a result, decision-makers and managers in various industries can consider implementing this proposed model.