We address the management of a single product over a finite time horizon, with customer arrivals modeled as a heterogeneous compound Poisson process. The arrival rate depends on the inventory level and is adjusted by a time-dependent, unknown weight function, incorporating scenario of shortages. Retail price serves as the control variable for regulating this rate. Within the framework of diffusion approximation for the inventory process and a linear dependence of arrival intensity on price, we formulate and solve the expected revenue maximization problem concerning the weight function. Furthermore, two types of near-optimal weight functions are proposed, and the results of numerical optimization and simulation are presented.