// and then we will count on the un-billed purchases of all the subscriptions of the
// customer
Map<Integer, Payment> purchaseOrders = new HashMap<Integer, Payment>();
for (Subscription subscription : customerSubscriptions) {
dataAccessObject.fillUnbilledPayments(subscription, purchaseOrders, invoice );
}
for (Payment payment : purchaseOrders.values()) {
invoice.addPayment(payment);
}
customer.setActiveInvoice(invoice);