Sales Trend¶
Lime Admin - Add-on Configuration¶
It's possible to configure several instances in case the Lime database has several invoice tables. The following properties have to be configured for each instance.
Mapping¶
Invoice¶
Parameter | Values | Database type | Comment | Default |
---|---|---|---|---|
limetypeInvoice | String | limetype | Table name of the invoice limetype | invoice |
propertyInvoiceSum | String | decimal | Property for the sum of the invoice | invoice_sum |
propertyInvoiceDate | String | date | Property for the date that the calculations are based on | invoice_date |
propertyConversionrate | String | decimal | Property to convert the sum to the local currency | conversionrate |
propertyCompany | String | belongsto | Relation property to company | company |
Company¶
Parameter | Values | Database type | Comment | Default |
---|---|---|---|---|
limetypeCompany | String | limetype | Table name for the company limetype | company |
propertyYtd | String | decimal | Property to save turnover from invoices this fiscal year | erp_turnover_yearnow |
propertyLytd | String | decimal | Property to save turnover from invoices the same period last fiscal year | erp_turnover_lastyeartodate |
propertyLastyear | String | decimal | Property to save turnover from all invoices last year | erp_turnover_lastyear |
propertyYtdGrowth | String | decimal | Property to save calculated growth: (YTD / LYTD - 1) * 100 |
erp_ytdgrowth |
propertySalestrend | String | option | Property to save calculated trend: YTD/LYTD . Options: empty, increasing, steady, decreasing |
erp_salestrend |
Settings¶
Parameter | Values | Comment | Default |
---|---|---|---|
name | String | Unique instance name | - |
fiscalYearFirstMonth | String | First month of fiscal year (1-12) | - |
turnoverDecreasingRate | decimal | Defines the rate for a decreasing sales trend. 0.8 means that a 20% turnover decrease from last year is considered steady, while more than that will turn the sales trend into decreasing. | 0.8 |
Lime Admin - Web Component¶
Add the following config to the Table view of your Company limetype:
{
"component": {
"props": {},
"name": "lwc-limepkg-erp-connector-sales-trend-table"
},
"property": "erp_ytdgrowth",
"isDefault": true
}
Application Config¶
In order to enable a scheduled task that runs all turnover calculations every night, add the following application config.
For Cloud customers¶
Add this snippet to your config for your application in Cafe.
limepkg-erp-connector:
daily_scheduled_job: True
For On-Premise Customer¶
Add this snippet to your application_config.yaml
file and restart the Task Handler service afterwards.
<APPLICATION-NAME>:
config:
limepkg-erp-connector:
daily_scheduled_job: True
Environment Config¶
For the scheduled task on-premise customers can overwrite their environment config to change the username, the language and the task schedule. Below you can see the default values:
plugins:
limepkg_erp_connector:
sales_trend:
username: erpsync@lime,
language: en_us,
daily_schedule:
hour: '1'
minute: '10'
Copy this to the config file of the Task Handler service and adjust the values. The daily schedule is described as a Crontab
and runs at 1:10AM daily by default. You can find more information on how to configure a Crontab
schedule here.