Trade credit financing plays a vital role in current business operations. Vendors extend payment dates to encourage sales, and buyers are not required to pay immediately after receiving products. This is equivalent to receiving a price reduction. Besides, buyers reduce their need for capital from bank loans. In addition, a number of defective products are produced during the production process. The number of defective items influences the on-hand inventory levels of buyers, service levels, and frequency of orders. To ensure that the analysis incorporates a realistic production environment, we developed an integrated inventory model with a two-part trade credit and considered an imperfect production process that can be improved by capital investment. The objective was to determine the optimal ordering, shipping, and quality improvement policies to maximize joint total profit. An iterative algorithm was established to determine the optimal strategy. Furthermore, a sensitivity analysis was conducted to examine the effects of changing parameter values on the optimal solution.