# Other Configurable Settings

### App Settings Table

&#x20;There are few configurable settings in Usage and Billing which can be configured by editing ‘dbo.AppSettings’ table in the ‘CloudAssertBilling’ database.

| Key                                            | Values | Default                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Functionality                                                                                                                                                                                                                                                             |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MaxHourlyUnitPriceAllowed                      | Number | 100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Does not calculate the usage cost if the hourly unit price for the resource exceeds the ‘MaxHourlyUnitPriceAllowed’ value                                                                                                                                                 |
| MaxMonthlyUnitPriceAllowed                     | Number | 74400                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Does not calculate the usage cost if the monthly unit price for the resource exceeds the ‘MaxMonthlyUnitPriceAllowed value                                                                                                                                                |
| IsAutoApproveInvoices                          | Text   | False                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Invoice will be auto-approved by admin when the value is set to true and will be ready to be processed in WHMCS payment portal.                                                                                                                                           |
| IsAutoSuspendSubscriptionOnLowCredit           | Text   | False                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | When the value is set to true, subscriptions will be auto-suspended when the credit runs out. This works only if ‘LowCreditChecker’ is enabled Agent Service config file.                                                                                                 |
| PriceCatalogsTheme                             | Text   | EffectivePriceCatalog.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Changing it changes the appearance of the market place tile. Themes for the tile cane be seen in ‘C:\inetpub\MgmtSvc-Tenantsite\Content\CloudAssertBilling\Themes’ folder. Any customized html file can be placed in this folder and can be set in the app setting table. |
| PriceCatalogsViewOptions                       | Text   | GridAndTiles                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Shows both Grid and List view of plans in the tenant portal MARKETPLACE Tab. Other values are ‘Grid’ and ‘Tile’.                                                                                                                                                          |
| MaximumPurchaseLimitForAddOnAtAnInstance       | Number | 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Will not allow the tenants to purchase multiple instances of an add-on beyond ‘5’ at a single purchase.                                                                                                                                                                   |
| DefaultCustomerDomainSuffix                    | Text   | .onmicrosoft.com                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | This will be suffixed to the domain name when a new customer creates a CSP customer profile from the tenant portal                                                                                                                                                        |
| CsvColumnOrderForSubscription                  | Text   | SubscriptionId, ProviderName, ServiceType, MeteredResourceDisplayName:ResourceName, ResourceId, PropertiesJson:Properties, StartTime:Date, ISOCurrencySymbol:CurrencyText, CurrencySymbol, Units:TotalUnits, Cost:TotalCost, PlanName, SubscriptionName                                                                                                                                                                                                                                         | Contains the column order for the subscription summary csv file. (the value given right to the colon is a friendly name, it is optional)                                                                                                                                  |
| CsvColumnOrderForAllUsers                      | Text   | AccountAdminEmailId:User, SubscriptionId:Subscription ID, PlanName:Plan Name, SubscriptionName:Subscription Name, ISOCurrencySymbol:Curreny Text, CurrencySymbol:Currency Symbol, AddOnMonthlyFee:AddOn Cost, ProratedMinimumMonthlyFee:Monthly Fee, OneTimeFee: One-Time Fee, TotalCost:Total Cost, TotalIncludedOfferCredits:Included Offer Credits, TaxAmount:Tax Amount, CreditBalance:User Credits, CurrentBillAmount:Billable Cost, SubscriptionProvisionedDate:Subscription Created Time | Contains the column order for the subscription summary of all users csv file. (the value given right to the colon is a friendly name, it is optional)                                                                                                                     |
| CsvColumnOrderForAllInvoices                   | Text   | <p>Id:Invoice ID, AccountUserId:User, PlanName:Plan Name, SubscriptionName:Subscription Name, Subscription\_Id:Subscription ID, InvoiceStartTime:Start, InvoiceEndTime:End, InvoiceDueDate:Due Date, ProcessingStatusString:Processing Status, PaymentStatusString:Payment Status, IsOfflinePayment:Is Offline Payment, ISOCurrencySymbol:Currency,</p><p>TotalAmountToPay:Total Amount</p>                                                                                                     | Contains the column order for the invoice summary of all users csv file. (the value given right to the colon is a friendly name, it is optional)                                                                                                                          |
| IncludeExtendedResourcePropeties               | Text   | False                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | When the value is set to true, the usage cost will be set based on the custom property of the VM.                                                                                                                                                                         |
| TimeoutIntervalSeconds                         | Number | 300                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Used for subscription sync process after addon is purchased.                                                                                                                                                                                                              |
| PollingIntervalSeconds                         | Number | 20                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Waiting time for subscription sync process state checking.                                                                                                                                                                                                                |
| MaxAutoRetry                                   | Number | 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Maximum auto retries for subscription sync process (if it is failed to sync) when addon purchase is failed.                                                                                                                                                               |
| ShowRemainingDaysInOverviewTile                | Text   | True                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | When the value is set to false, in the tenant portal overview tab, remaining days will not be shown.                                                                                                                                                                      |
| ShowOverviewTileText                           | Text   | False                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | When the value is set to true, in the tenant portal overview tab, a text will be shown just below the Current bill amount.                                                                                                                                                |
| TenantOverviewTileText                         | Text   | Prices do not include tax                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | In the tenant portal overview tab, the specified value will be shown just below the Current bill amount.                                                                                                                                                                  |
| DownloadUsageCsvGranularity                    | Text   | Daily                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | When the value is set to Monthly, the usage will be downloaded for monthly usage instead of daily.                                                                                                                                                                        |
| ShouldSendEmailAlertForAgentServiceHealtStatus | Text   | False                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | When the value is set to True, an email notification will be sent to Admin if Agent service or any usage processor goes down.                                                                                                                                             |
| AgentServiceHealthNotificationCatchupHours     | Number | 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Monitoring the agent service health status every 2 hours.                                                                                                                                                                                                                 |
| UsageRecordProcessorEmailCatchupHours          | Number | 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Monitoring the Usage Record Processor health status every 3 hours.                                                                                                                                                                                                        |
| BillingDailyAggregatorEmailCatchupHours        | Number | 25                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Monitoring the Billing Daily Aggregator health status every 3 hours.                                                                                                                                                                                                      |
| UsageExtensionProcessorEmailCatchupHours       | Number | 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Monitoring the Usage Extension Processor health status every 3 hours.                                                                                                                                                                                                     |
| InvoiceProcessorForWHMCSEmailCatchupHours      | Number | 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Monitoring the Invoice Processor for WHMCS health status every 3 hours.                                                                                                                                                                                                   |
| UpdateBillingHistoryForMonths                  | Number | 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Billing History table will be updated with previous 3 months.                                                                                                                                                                                                             |

### API Service Configuration File

&#x20;The ‘Web.config’ file is located at ‘*C:\inetpub\MgmtSvc-CloudAssertBilling’* in the machines where the Cloud Assert Usage and Billing API Service is installed.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BOsnMI95TbepOS%2F30.png?generation=1568952080389695\&alt=media)

* Replace the ‘Data Source’, ‘User Id’ and ‘Password’ values with the WAP server name, database User Id and Password in the following line if already not set.

*\<add name="WapMembershipDatabase" connectionString="Data Source=**localhost**;User Id=**sa**; Password=**\[\[ReplaceWithYourPassword]]**; Initial Catalog=Microsoft.MgmtSvc.PortalConfigStore;" />*

### Agent Service Configuration File

&#x20;The job processors of Usage and Billing solutions can turned on and off by changing the values in the ‘CloudAssert.WAP.Billing.AgentService.exe.config’ file located at ‘*C:\Program Files\ CloudAssertBilling\ CloudAssert.WAP.Billing.AgentService’* in the machine where the Cloud Assert Usage and Billing Agent Service is installed.

**Updating WAP Membership Connection**

* Find the line that has ‘WapMembershipDatabase’ in it.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BPKVaexRCON0PW%2F31.png?generation=1568952080371691\&alt=media)

* Replace the ‘Data Source’, ‘User Id’ and ‘Password’ values with the WAP server name, database User Id and Password in the following line if already not set.

*\<add name="WapMembershipDatabase" connectionString="Data Source=**localhost**;User Id=**sa**; Password=**\[\[ReplaceWithYourPassword]]**; Initial Catalog=Microsoft.MgmtSvc.PortalConfigStore;" />*

**Invoice Processor Settings**

&#x20;This setting has to be set as ‘TRUE’ for WHMCS integration. It sends the invoices of tenants to the WHMCS portal.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BQyc78SJU9ZhIJ%2F32.png?generation=1568952080423056\&alt=media)

&#x20;Setting ‘IsAutoApproveInvoices’ value to ‘True’ from the above image will auto-approve the invoices by admin, and will be made ready for processing by WHMCS. This has to be set in ‘App Settings’ table also (Refer *App Settings Table*).

**Invoice notifier Settings**

&#x20;Marking this setting ‘True’ will auto-suspend the subscription if the tenants fail to pay the invoice on or before the Due date (Refer step *335* & *6* from *Step 6 – Configure Invoice Settings*). It is also responsible for sending warning and reminder emails to tenants on invoice due date. It also reactivates the subscriptions automatically upon successful payment of invoice.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BRy0WeVIv3XA6c%2F33.png?generation=1568952080384574\&alt=media)

**Low Credit Checker Settings**

&#x20;Marking this setting ‘True’ will auto-suspends the subscriptions of the user if more credits are consumed beyond the allotted limit. It also sends an email notification to the user upon suspending or reactivating the subscriptions.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BSfDt8i1QsS-5G%2F34.png?generation=1568952080383343\&alt=media)

&#x20;Once the setting is set to ‘True’ in configuration file, it has to be set in the ‘App Settings’ table as well (Refer *App Settings Table*).

**User Invoice Aggregator Settings**

&#x20;This setting has to be set as ‘TRUE’ to generate invoices per user.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BTwS5_zsqyKbG8%2F35.png?generation=1568952080372793\&alt=media)

**Subscription State Processor Settings**

&#x20;This setting has to be set as ‘TRUE’ to auto suspend / delete the subscription upon reaching its expiry date/ delete after days.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BURoruAfo2g7i8%2F36.png?generation=1568952080383338\&alt=media)

### &#x20;FTP Push Setting

&#x20;This setting will push the invoice csv files to the ftp server location which can be later used by any ERP system.

* Logon to WAP Admin portal, click on Usage and Billing on the Left.
* Click on the ‘*SETTINGS*’ Tab.
* Click *‘FTP SERVER’* sub tab.
* Check the ‘*IS FTP PUSH ENABLED*’ checkbox for the invoices to be sent to the FTP/SFTP severs.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BVCm9ov8wKi8ac%2F37.png?generation=1568952080428970\&alt=media)

* Specify the fields as seen in the above screenshot.
* Click ‘*Save*’ button.

**Note:** A manual restart of the Billing Agent service might be required for the FTP Push settings to work properly.

### Customizing Column Order in CSV Files

&#x20;Usage and Billing solutions allows to set the column order, remove unwanted columns and give friendly name for any downloadable csv file. This can be done by editing the *App Settings Table* values for ‘CsvColumnOrderForSubscription’, ‘CsvColumnOrderForAllUsers’ and ‘CsvColumnOrderForAllInvoices’.

### Adding Custom Column and Custom Data in Invoice CSV File

&#x20;Custom column and custom data for each and every column for the invoice CSV file can be added.

#### Adding Custom Column

* Logon to the machine where Usage and Billing database is installed.
* Navigate to \[dbo].\[AppSettings] table.

![C:\Users\Aashish\Documents\My Received Files\8ADF05A9.PNG](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BWvKQYuJ_gPz4b%2F38.png?generation=1568952080396620\&alt=media)

* Right click on the table name and click ‘Edit top 200 Rows’.
* Search for the key ‘CsvColumnOrderForAllInvoices’ (Refer *App Settings Table*).
* In the corresponding value add the custom column name anywhere separated by a comma (,).

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BXynPb5yN1zCry%2F39.png?generation=1568952080390360\&alt=media)

#### Adding Custom Data

* Logon to WAP Admin portal, click on Usage and Billing on the Left.
* Click on the ‘*USAGE’* Tab.
* Click *‘SUBSCRIPTION PROPERTIES’* sub tab.
* Drill down into a desired subscription and click on the ‘ADD CUSTOM PROPERTIES’ button at the bottom.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BYF_c3n2mjHGDp%2F40.png?generation=1568952080388994\&alt=media)

* Check the ‘*Include Custom Properties in Invoice Csv?*’ to view the available coumns.
* In the following dialog box that appears, specify the column name from the ‘AVAILABLE COLUMNS’ list and specify the value.
* Click complete button to save the values.
* Click ‘*INVOICES*’ sub tab under ‘*USAGE’* tab.
* Click ‘*Export All Invoices*’ button at the bottom to download the csv file.

![](https://152324049-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fwap-billing%2F-LpBovkTMjROxHIxpUwq%2F-LpBp7BZNbDYyI6PTyHM%2F41.png?generation=1568952080378490\&alt=media)

##
