edx/edx-platform — pull request #1685 by jbau (2013-11-16 10:21:39+00:00)
Title: CSV Reporting of Shopping Cart Purchases, with tests

@dianakhuang

At Stanford, we're running the credit card purchased courses _for_ our medical school. Meaning that the purchased income actually goes into their account from CyberSource. This also means that med school accountants need to be able to access the itemized purchased data from our platform (since CyberSource HOP can't itemize).

We agreed that the easiest way is for us to provide a page in the platfrom from which they can download CSV reports that itemize purchases made over a time range. There's no link to this page anywhere in the platform. They'll just have to bookmark it. The access control for this link is done by a magic `django.contrib.auth.models.Group`, whose name is set in settings.

They also had one "special" requirement, that each itemized line be annotated with a "PTA" number, which is a direct 1-to-1 mapping to the `course_id` of the purchased `PaidCourseRegistration`. (Yes, I suggested that they could simply match up the description with a PTA number. No, somehow they weren't comfortable with that). This leads to the need for the new `PaidCourseRegistrationAnnotation` model.