Invoice generation: Add a hack to make invoice generation possible after SIMS have been allocated to accounts.

Multiple SIM records with the same ICCID (but not overlapping periods) may
exist, after a SIM has been changed. In this case, the old code would not only
update the "current" record but also STOCK records, causing an exception to be
thrown. This hack only updates the current record. The right fix is documented
in the code for later.
Invoice generation: Fix invoicing data CDRs when SIMs only started later in a month.

The old code would check the APN type active at the first of a month to decide
how to invoice a data CDR. This was necessary to correctly aggregate data usage
over a month, but failed when a SIM was only activated later in the month and
used data CDRs immediately during the first month. This patch searches the
first day of the month that a data bundle was active, and returns that APN
type.
Invoice generation: Invoice out-of-bundle usage correctly (per kilobyte tariff instead of per megabyte)
Merge branch 'master' into cdrimporter