Upgrading¶
Version 3.0.0 Upgrade Guide¶
Optional: Create debtors in Billecta when contracts are created¶
By default, the debtor in Billecta (creditordebtor) is created when the first order for a contract is sent to Billecta. The new @billecta_contract decorator creates it as soon as the contract has a creditor and an invoice recipient. Incoming autogiro and e-invoice events can then be matched to the debtor before the first invoice.
Using the decorator is optional. Without it, everything works as before.
The decorator uses the same lookup as invoicing: one creditordebtor per creditor and invoice recipient.
Step 1: Check the configuration in Lime Admin¶
Contract Propertyunder the debtor configuration must point to the debtor's relation to contracts where the debtor is the invoice recipient, e.g.leaseinvoicerecipient. If it points to another relation, such as the tenant, thecreditordebtorwill be created for the wrong debtor.- The contract limetype must have a relation named
creditorto the creditor limetype.
Step 2: Add the decorator to the contract limetype in the solution¶
from lime_type.limeobjects import LimeObject
from limepkg_billecta_integration.decorators.contract_decorator import billecta_contract
@billecta_contract()
class Lease(LimeObject):
pass
def register_limeobject_classes(register_class):
register_class("lease", Lease)
If the solution already has a custom class for the contract limetype, add @billecta_contract() to that class.
Step 3: Verify¶
Create a contract with a creditor and an invoice recipient. Check that a creditordebtor with a debtor public ID is created and that the log under create_contract_creditordebtor in the integration monitor has status ok.
See Decorator Documentation for details.
Creditor: new, changed and removed fields¶
"Update in Billecta" on the creditor (Fakturaavsändare) now sends more settings to Billecta, so they no longer have to be set by hand in Billecta. Some fields are added, one changes type, and duplicate fields from the debt collection setup are removed.
All fields below belong to the limetype creditor. Do the steps in this order.
The package works both before and after these steps. Fields that don't exist yet are skipped when the creditor is sent to Billecta. You can upgrade the package first and do the LISA changes afterwards.
Step 1: Upgrade the package¶
Install this version before you remove any fields in step 6. Older versions read gln directly and fail when it's missing.
Do the check in step 4 before anyone runs "Update in Billecta" on the new version. Otherwise settings made by hand in Billecta can be overwritten.
Step 2: Add new fields in LISA¶
Add these fields to creditor.
| Database name | Type | Length | Default | Swedish label | English label |
|---|---|---|---|---|---|
showpaymentinformationoninvoice |
Yes/No | – | No | Visa prioriterad betalmetod och OCR på faktura | Show preferred payment method and OCR on invoice |
otherinvoiceaddress |
Text | 255 | empty | Annan fakturaadress | Other invoice address |
otherinvoiceaddress2 |
Text | 255 | empty | Annan fakturaadress 2 | Other invoice address 2 |
otherinvoicezipcode |
Text | 20 | empty | Annat postnummer | Other postal code |
otherinvoicecity |
Text | 255 | empty | Annan postort | Other city |
otherinvoicecountry |
Option | – | SE |
Annat land | Other country |
showpaymentinformationoninvoice is sent to Billecta as ShowPaymentInformationOnInvoice. Give it this help text:
- Swedish: Om aktiverad inkluderas den prioriterade betalmetoden och OCR-numret i fakturamejlet
- English: If enabled, the preferred payment method and the OCR number are included in the invoice email
otherinvoicecountry gets these options:
| Key | Swedish label | English label |
|---|---|---|
empty |
||
SE (default) |
Sverige | Sweden |
The key is sent to Billecta as it is, so it must be the two-letter country code (ISO 3166-1 alpha-2) in capital letters.
⚠️ Don't mix these up with the language keys of communicationlanguage. Sweden is SE as a country but SV as a language.
The otherinvoice* fields set the creditor's own billing address in Billecta, which is used for example in the debt collection flow. If any of the address fields has a value, all five are sent as the creditor's invoice address. "Annat land" alone doesn't count, since it is SE by default. If "Annat land" is left empty, the creditor's own country is used. If all address fields are empty, the creditor's own address is sent, as before.
Step 3: Replace communicationlanguage with an option field¶
communicationlanguage (Kundspråk / Communication language) changes from a two-character text field to an option field, because Billecta only accepts SV, EN and FI. LISA can't change the type of an existing field, so the field has to be deleted and created again. Deleting it also deletes its values, so write them down first.
- Write down the current value of
communicationlanguagefor each creditor. - Remove
communicationlanguagefrom all views in Lime Admin (card, lists, filters and reports). - Delete the field
communicationlanguagein LISA. -
Create a new field on
creditor:Database name Type Default Required Swedish label English label communicationlanguageOption SVNo Kundspråk Communication language With these options:
Key Swedish label English label SV(default)Svenska Swedish ENEngelska English FIFinska Finnish The keys must be exactly
SV,ENandFI, in capital letters. Don't add other languages, since Billecta doesn't support them. -
Set the value on each creditor again, using what you wrote down in step 1.
- Add
communicationlanguageback to the views in Lime Admin, in the same place as before.
Until the field has been replaced, the package sends the old text value in capital letters, so sv is sent as SV. Don't run "Update in Billecta" between step 3 and step 5. While the field is missing, no language is sent, and Billecta may fall back to its default language.
Step 4: Check existing fields that are now sent to Billecta¶
These fields already exist. No schema change is needed, but check that the option keys match.
| Database name | Swedish label | Sent as | Check |
|---|---|---|---|
startdebtcollectionactionlevel |
Startnivå för krav | StartDebtCollectionActionLevel |
Keys are Billecta's names (LatePaymentFee, Reminders, DebtCollection, Bailiff) or 0–3. A key None or empty is not sent. |
numberofreminders |
Antal påminnelser att skicka innan inkassokrav | NumberOfReminders |
Keys are 0, 1 and 2 (see 2.1.1). With the old keys empty, one and two, "Update in Billecta" fails. |
interesttype |
Typ av ränta | InterestType |
Keys are NoInterest, AboveEffectiveReference and Fixed |
interestpercentage |
Ränta | InterestPercentage |
Decimal field |
nextinvoicenumber |
Nästa fakturanummer | NextInvoiceNumber |
See below |
Billecta increases the next invoice number by itself as invoices are created. To make sure an old value in Lime never lowers it, the number in Lime is only sent when it's higher than Billecta's. Otherwise nothing is sent, and Lime is updated with Billecta's number. Values that aren't numbers are never sent. To start a new series at a higher number, enter it in Lime.
⚠️ Compare the values with Billecta before the first "Update in Billecta" after the upgrade. These settings used to be set by hand in Billecta. From this version, the values in Lime are sent and overwrite what Billecta has. This happens as soon as the package is upgraded, even if no fields have been added in LISA yet.
For each creditor, open the creditor in Billecta and check that these match Lime. If they don't, update Lime to the value in Billecta before anyone runs "Update in Billecta":
- Startnivå för krav (
startdebtcollectionactionlevel) - Antal påminnelser att skicka innan inkassokrav (
numberofreminders) - Typ av ränta (
interesttype) - Ränta (
interestpercentage) - Kundspråk (
communicationlanguage) - Visa prioriterad betalmetod och OCR på faktura (
showpaymentinformationoninvoice) - Annan fakturaadress (
otherinvoiceaddress) - Annan fakturaadress 2 (
otherinvoiceaddress2) - Annat postnummer (
otherinvoicezipcode) - Annan postort (
otherinvoicecity) - Annat land (
otherinvoicecountry)
The invoice address in Billecta is overwritten with the creditor's own address as long as the otherinvoice* fields are empty. If the creditor has a different invoice address in Billecta, enter it in the fields you added in step 2.
The next invoice number doesn't need to be checked, since it's never lowered.
Step 5: Add a card section in Lime Admin¶
In the creditor's card view, add a section "Annan fakturaadress" / "Other invoice address" right after "Adress och kontaktuppgifter". Add the fields in this order:
otherinvoiceaddressotherinvoiceaddress2otherinvoicezipcodeotherinvoicecityotherinvoicecountry
Add showpaymentinformationoninvoice next to "Bifoga fakturan i e-postmeddelandet" (includepdfinemail).
Step 6: Remove fields¶
For each field: first remove it from all views in Lime Admin (card, lists, filters and reports), then delete it in LISA.
| Database name | Label today | Why it's removed |
|---|---|---|
paymenttermsindays |
Betalningsvillkor i dagar för krav_TBD | Duplicate of debtcollectionpaymenttermsindays |
startdebtcollectionactionlevel_tbd |
(marked TBD) | Replaced by startdebtcollectionactionlevel |
enddebtcollectionactionlevel_tbd |
(marked TBD) | Replaced by enddebtcollectionactionlevel |
gln |
GLN_TBD | Only showed Billecta's value and couldn't be changed from Lime. GLN is managed in Billecta, and the package now sends Billecta's own value back unchanged. |
⚠️ Only remove gln after step 1. Don't remove gln on creditordebtor. That field is still used for debtors.
Step 7: Verify¶
Run "Update in Billecta" on a creditor. Check that the error message field on the creditor is empty. Then check in Billecta that these match Lime:
- the debt collection settings
- the interest type and interest rate
- the language
- the next invoice number
- "Visa prioriterad betalmetod och OCR på faktura"
- the invoice address
Version 2.1.1 Upgrade Guide¶
For the field creditor.numberofreminders, the option keys are numeric values instead of text.
Use:
- 0
- 1
- 2
Version 2.1.x Upgrade Guide¶
Add new yesno-field on orderdocument called iscoversheet. ("Försättsblad", "Cover Sheet")\
Checking this on the orderdocument will make it cover sheet of the invoice when created in Billecta.
Version 2.x.x Upgrade Guide¶
When upgrading to version 2.x.x, the following manual configuration changes are required:
Payment Object Changes¶
The payment limetype has been updated with a breaking change to its property naming:
Step 1: Rename Property¶
- Old property name:
overpaymentstatus - New property name:
paymentstatus - Rename this property in your Lime CRM limetype configuration
Step 2: Add Default Option¶
- Add a new option to the
paymentstatusproperty - Set the option key to
empty - Set this as the default value for the property
Step 3: Update Admin Configurations¶
- Review all configurations in Lime Admin where
overpaymentstatusis referenced - Update these references to use
paymentstatusinstead - Common locations to check:
- View field configurations
- Report configurations
- Integration mappings
- Filter configurations
⚠️ Important: Failure to update all references will result in views and reports not functioning correctly after the upgrade.
Testing After Upgrade¶
After completing these steps:
- Verify views containing payment objects display correctly
- Test payment record creation and editing
- Confirm reports that reference payment data work as expected