  Small-to-medium size enterprises (SMEs), including many startup firms, need
to manage interrelated flows of cash and inventories of goods. In this paper,
we model a firm that can finance its inventory (ordered or manufactured) with
loans in order to meet random demand which in general may not be time
stationary. The firm earns interest on its cash on hand and pays interest on
its debt. The objective is to maximize the expected value of the firm's
%working capital at the end of a finite planning horizon. Our study shows that
the optimal ordering policy is characterized by a pair of threshold variables
for each period as function of the initial state of the period. Further, upper
and lower bounds for the threshold values are developed using two
simple-to-compute ordering policies. Based on these bounds, we provide an
efficient algorithm to compute the two threshold values. Since the underlying
state space is two-dimensional which leads to high computational complexity of
the optimization algorithm, we also derive upper bounds for the optimal value
function by reducing the optimization problem to one dimension. Subsequently,
it is shown that policies of similar structure are optimal when the loan and
deposit interest rates are piecewise linear functions, when there is a maximal
loan limit and when unsatisfied demand is backordered. Finally, further
managerial insights are provided with numerical studies.
