4.02 Quota and Credits
Posted by Katrina Vuong on 28 October 2020 01:50 PM
LabArchives Scheduler Administrators have the ability to control how much a given resource can be used. There are two key ways to do this: limit the time users can reserve with Resources by using Quotas, or require payment to use resources by using Credits.
A Quota allows an Administrator in LabArchives Scheduler to limit the usage of one or more resources. To create a new Quota, you must have Application Admin Privileges. Assuming you have these privileges, you can create, view, and edit Quotas by clicking Application Management then selecting Quotas. Once you click this, you will be brought to the Quotas screen, which looks like this:
When you click this, you will be brought to the Quotas Screen, which looks like this:
A quota can be applied to all Resources on all Schedules, to all resources within a specific schedule, or to one or more resources individually. If any user attempts to make a reservation which would violate a quota that is enforced for their account, the reservation will be denied and the User will be notified. An example of the message a user receives when they attempt to make a reservation that violates their quota(s) appears in the screenshot below.
A Quota is enforced either for all users in all groups, or for all users in one or more specific groups. Note that this means that quotas cannot be enforced for users that are not in a group. However, any user who is also an Application Admin will be exempt from all Quotas.
When creating a new quota, you must at minimum specify the Resources and/or Groups for which it is enforced, and you must specify the length of the quota. There are a few additional settings that can be controlled for each quota, however.
Quotas applied to a group are enforced for each user in the group individually. It does not apply to the group's aggregated reservations. For example, if you create a 100 Quota for members of Group A, each may reserve up 100 hours with the given resource(s); the quota does not look at
the aggregated time the entire group reserves with said resource(s). The length of the Quota can be specified in number of hours per unit time (day, week, month, year) or number of reservations per unit time.
Note also that you have the option to include or not include existing reservations for your Quota. For example, if you are limiting a Group to 100 hours per month for all resources, and a member of this group has already used 50 hours this month, that same group member will only have 50 hours left for all resources this month if you choose to include existing reservations. If you do not include existing reservations, all the group’s members each have 100 hours left with all resources this month as of the time you create the quota.
Finally, note that you can choose to enforce your quota all day every day, or you can limit your quota to certain days in the week and a specific time range within those days. See an elaboration of this in the below screenshot.
Always remember that the daily time range for some quota is applied according to the time zone of the given schedule. Quotas are not applied according to any specific user account’s time zone.
Once you’ve indicated the applicable schedules/resources, the group(s) for which the Quota will be enforced, the length of the quota, and the time during which it is enforced, you can finalize the Quota’s creation by clicking Add. The quota will then appear in the table below labeled “All Quotas”. To modify any quota after it is created, it will have to be removed and recreated. To remove a quota, click the red trashcan icon on the far right of the quota’s row, as shown below.
A LabArchives Scheduler Administrator may require users to pay to reserve one or more resources with Credits. If your reservation requires credits to be created, you will see this on the reservation screen in the area indicated below:
If you do not have enough credits to complete a reservation, you will need to purchase more credits by going to User icon --> Credits. This is shown below:
Clicking this brings you to the credits screen, as shown below.
Once on this screen, you have a tab for your Credit History, a tab to buy more credits, and a tab for your transaction/purchase history. Note that the price per credit is controlled by the Application Admin for your organization.
Enabling Credits for your Organization
Enabling Credits allows you to collect monetary reimbursement for use of your resources, and allows you to generally control usage of resources in your Organization more thoroughly. So long as the Organization is using the Premium version of LabArchives Scheduler, the App Admin can enable credits by selecting the Gear Icon in the upper right corner of the screen, then selecting Application Configuration. Once there, scroll down to the section labeled Credits, as shown below:
Ensure the options labeled ‘enabled’ and ‘allow.purchase’ are each set to True. After doing this, scroll to the top or bottom of this page and click Update. Once credits have been enabled for your organization, you next need to set up a Credit Cost and at least one Payment Gateway to allow users to purchase credits. Additionally, for all resources for which you’re collecting payment, you’ll need to specify the amount of required credits per timeslot. Finally, you may want to specify peak and non-peak hours, in case you want to collect more or less credits per timeslot during certain times of day.
Specifying Credit Cost and Setting up a Payment Gateway
Before a user can pay for a reservation with credits, they must purchase credits. To purchase credits, you must specify how much each credit will cost, and at least one Payment Gateway will need to be set up for your organization. To do both of these things, an App Admin must first go to Application Management then click Payments.
Once there, you can specify the Cost per Credit by going to the Cost tab, as shown below.
Note: multiple types of currency are made available via the dropdown menu on the right.
Setting up a Payment Gateway
After specifying the credit cost, you are ready to set up a Payment Gateway. To do this, first select the Payment Gateway tab. Once here, you can enable a payment gateway through Stripe and/or PayPal by clicking the appropriate button under either section of the Payment Gateway tab.
LabArchives Scheduler integrates with Stripe using Stripe Checkout, which requires use of the Stripe API. This means that, to use a Stripe Payment Gateway, you must first create a Stripe account if you do not already have one. Once your Stripe account is created, you should be able to access your Test and Live API keys from the Stripe Dashobard. If you are just testing out Stripe, use the Test API Keys. Otherwise, use the Live API keys. Notice that for each set of API Keys (Test and Live) there are two keys: a “Publishable Key” and a “Secret Key.” Once you’ve copied the appropriate set of keys to your clipboard, paste them into the corresponding fields in the Stripe section of the Payment Gateways tab, and click Update.
LabArchives Scheduler integrates with PayPal using Express Checkout, which requires use of the PayPal API. Like with the Stripe Payment Gateway, this means an active PayPal account is required to use this gateway. After your PayPal account is set up, you can access the information you need from the PayPal Developer Dashboard page. Once on this page, click Create App. After filling out some information, you should be given access to Sandbox and Live Credentials. Use Sandbox Credentials if you are just testing PayPal. Note that, for each set of credentials, there is a Client ID and a Secret. You must copy both of these from PayPal into the appropriate fields under the PayPal section of the Payment Gateways tab. Finally, make sure the appropriate Environment (Live or Sandbox) is selected under the “Environment” dropdown menu. Once all of this has been done, click Update.
Specifying Credits needed to Reserve a Resource
Once you have enabled credits, specified the price per credit, and enabled at least one payment gateway, you are now ready to specify how much credits are required (per slot) to reserve one or more resources. The amount of credits required to reserve a resource can be specified by any Resource Admin, Schedule Admin, or App Admin. This is done individually for existing resources under Application Management --> Resources (or Responsibilities--> Resources if you are a Resource or Schedule Admin). You can see an elaboration of this below.
Once you click the pencil icon next to Credits, you will be given the option to specify the number of credits required per slot during “peak” and “off peak” time. Note that, if you do not plan on implementing peak times, you can leave the Non-Peak hours field blank. In this case, all hours on a schedule are considered peak time, and the number of credits required per timeslot for this resource will always be the same.
Specifying Peak Time for a Schedule
If you plan on implementing Peak Time, this is done on a Schedule-by-Schedule basis, and this can be specified by any Schedule Admin or App Admin. To specify a Peak Time for some schedule, go to Application Management --> Schedules (or Responsibilities --> Schedules if you are a Schedule Admin). Once there, modify the Peak Time for each schedule by clicking the pencil next to the “Peak Time” field, as shown below.
Clicking on the pencil next to this field opens the Peak Time settings window. Here, you can specify a Peak Time that is in effect during certain hours of the day, during certain days of the week, and during certain times of year (using the months and dates that book-end these times of year). See an elaboration of this below.
Once you have specified when exactly your Peak Time will be in effect for the given Schedule, click Update. Note that Peak Times are enforced according to the time zone of the given schedule, and not according to the time zone for the account of any specific user.