osuosl / iam

Invoicing and metrics project
Other
4 stars 0 forks source link

Client billing #241

Closed hsolorza closed 7 years ago

hsolorza commented 7 years ago

fixes issue #224 #238 #236 #244

Changes in this PR.

Testing this PR.

  1. View a client

    • View the billing page
    • Adjust the time frames for billing
  2. Create a new client with a name that already exists

    • Receive the duplicate name error

Expected Output.

The error displayed when a duplicate client is created: screenshot from 2017-03-13 14 22 59

The billing page: screenshot from 2017-05-08 14-44-18

$ rake spec
[...]

@osuosl/devs

ramereth commented 7 years ago

@hsolorza I'm still working on getting my dev environment working however does this branch include totals at the bottom of the VM view and Database view?

hsolorza commented 7 years ago

@ramereth Im not sure what you mean. In this branch the only place where there are totals is in the Clients Billing view.

alxngyn commented 7 years ago

I'm getting:

TypeError at /clients/2/billing/1492473600/1492992000 start_time and end_time should be Time objects

This is what I did for date input: screenshot from 2017-04-21 15 37 35

alxngyn commented 7 years ago

+1 works for me! I'd say make an issue for the bug that the dates disappear on load

ramereth commented 7 years ago

I noticed the units are off when displaying them. Is this related to #246?

ramereth commented 7 years ago

I find the current layout for the billing view to be not ideal. I think it should be formatted more closely to how our invoices look. Something like the following would be much better:

For time period 04/01/2017 - 04/30/2017
Item            Description        Qty
----------------------------------------
Database        foo_db              2
Database        bar_db              5
                  Database Subtotal 7
----------------------------------------
CPU             foo.example.org     2
CPU             bar.example.org     6
                       CPU Subtotal 8
----------------------------------------

Then later on, we could add another column which may list the price and then the total each line item. This allows me and Pam to see a detailed list of where the costs are and the total which we would put in the actual invoice.

hsolorza commented 7 years ago

@ramereth Is the Database your referring to the plugin DBSize?

ramereth commented 7 years ago

@hsolorza yes

ramereth commented 7 years ago

@hsolorza this looks great overall but I did run into one bug. When I tried to select dates outside of the range I have data for I got an error.

ramereth commented 7 years ago

@hsolorza to provide some context on how to replicate the problem, I imported some production data using @Kennric branch in #254 first, and then switched to yours and ran rake migrate and then brought the instance up. When I tried to select a date range for the Drupal client from May 1 to May 30 I got the following error output.

I'm not sure if it's an artifact from his branch or yours but I was surprised when that happened. If I try to use the date range with default data imported I don't get this error.