My Products
Help
KonsultVn
CHAMPION ***

Error when creating customer invoices with restrictions on subaccounts

by KonsultVn

Hi, 

 

We have an issue when trying to create a customer invoice with restriction for subaccounts enabled. It's similar to earlier issues we've had when creating supplier invoices and also journal transactions. We get the response:

 

"Error creating customer invoice. Error: Kostnadsställe, Kostnadsbärare of SubID do not exist"
 
"Kostnadsställe" and "Kostnadsbärare" is segment 1 and segment 2. The invoice we're trying to create has a valid set of segments and can be created in the GUI. 
 
 
 
7 REPLIES 7
Yıldırım
VISMA

by Yıldırım

Update:

Development team checked the database of this customer and:

  • Restriction groups are inactive now.
  • Restriction by GLaccount shows that accounts 3911 and 3230 are restricted A inverse in 2 groups ("Kb ej noll invert", "Kst ej noll invert"),
  • Restriction by subaccount show that subaccounts 937-999000-00-0000 and 931-999000-00-0000 do not have restrictions.
  • Restriction by subsegment shows that:
    • segmentID 1 with segment value 000 is restricted to group "Kst ej noll invert" and segment value 937 and 931 are not restricted
    • segmentID 2 with segment value 000000 is restricted to group "Kb ej noll invert"and segment value 999000 is not restricted
    • segmentID 3 with segment value 00 is restricted to group "Bolagskod ej noll invert"
    • segmentID 4 with segment value 0000 is not restricted

Because Restriction groups are inactive now, when testing the API json POST customer invoice, it works and the system creates the invoice.

When activating the groups "Kb ej noll inverta" and "Kst ej noll invert" the Restriction by GL account for accounts 3911 and 3230 get activated and the Restriction by subsegment segmentID 1 with segment value 000 and segmentID 2 with segment value 000000 get activated. When testing the API json POST customer invoice, we get an error "message": "VismaId: 14a2619c-9e1d-47a0-b8e8-8660659e6e99. Error creating document. Error: Kostnadsställe of SubID do not exist." even if the subaccounts 937-999000-00-0000 and 931-999000-00-0000 are not restricted. 

This is reproducible on the company database. 

 
KonsultVn
CHAMPION ***

by KonsultVn

Hi, 

 

Any updates regarding this issue? 

Yıldırım
VISMA

by Yıldırım

Hello, the case has been conveyed to the team, and we're waiting for the investigation. We'll keep you informed. 

Yıldırım
VISMA

by Yıldırım

Hello,

please send the following information via developersupport@visma.com

 

1) Request URL & Type (Post-Put)

2) Used JSON
3) ipp-company-id

4) Details of the restriction settings for the specified company

 

Thanks.

KonsultVn
CHAMPION ***

by KonsultVn

1. POST controller/api/v2/customerinvoice

2. 

{
    "Note": {
        "Value": "2371"
    },
    "DocumentDate": {
        "Value": "2023-06-12T10:46:17.667+02:00"
    },
    "CurrencyId": {
        "Value": "SEK"
    },
    "CustomerRefNumber": {
        "Value": "Matilda Holletrz"
    },
    "InvoiceText": {
        "Value": "2023-06-09 - Mathilda Hollertz - SLF Styrelsem\u00F6te"
    },
    "CustomerNumber": {
        "Value": "10318"
    },
    "SalesPerson": {
        "Value": "94"
    },
    "InvoiceLines": [
        {
            "Description": {
                "Value": "Atmosf\u00E4ren"
            },
            "Quantity": {
                "Value": 1
            },
            "UnitPriceInCurrency": {
                "Value": 0
            },
            "Subaccount": [
                {
                    "SegmentId": 1,
                    "SegmentValue": "937"
                },
                {
                    "SegmentId": 2,
                    "SegmentValue": "999000"
                },
                {
                    "SegmentId": 3,
                    "SegmentValue": "00"
                },
                {
                    "SegmentId": 4,
                    "SegmentValue": "0000"
                }
            ],
            "VatCodeId": {
                "Value": "04"
            },
            "AccountNumber": {
                "Value": "3911"
            },
            "Operation": "Insert"
        },
        {
            "Description": {
                "Value": "Bredd sm\u00F6rg\u00E5s med ost och skinka"
            },
            "Quantity": {
                "Value": 8
            },
            "UnitPriceInCurrency": {
                "Value": 31
            },
            "Subaccount": [
                {
                    "SegmentId": 1,
                    "SegmentValue": "931"
                },
                {
                    "SegmentId": 2,
                    "SegmentValue": "999000"
                },
                {
                    "SegmentId": 3,
                    "SegmentValue": "00"
                },
                {
                    "SegmentId": 4,
                    "SegmentValue": "0000"
                }
            ],
            "VatCodeId": {
                "Value": "04"
            },
            "AccountNumber": {
                "Value": "3230"
            },
            "Operation": "Insert"
        },
        {
            "Description": {
                "Value": "Bricklunch   - serveras mellan 11.00 - 13.00"
            },
            "Quantity": {
                "Value": 6
            },
            "UnitPriceInCurrency": {
                "Value": 107
            },
            "Subaccount": [
                {
                    "SegmentId": 1,
                    "SegmentValue": "931"
                },
                {
                    "SegmentId": 2,
                    "SegmentValue": "999000"
                },
                {
                    "SegmentId": 3,
                    "SegmentValue": "00"
                },
                {
                    "SegmentId": 4,
                    "SegmentValue": "0000"
                }
            ],
            "VatCodeId": {
                "Value": "04"
            },
            "AccountNumber": {
                "Value": "3230"
            },
            "Operation": "Insert"
        }
    ]
}

3. 4468219

4. Segment 1 and 2 are not allowed to be 0 for specific accounts. This is the same issue which we have experienced regarding supplier invoice and journal transactions for this company. 

 

Thanks

Yıldırım
VISMA

by Yıldırım

Thanks for the information, the case has been conveyed to the team, and we'll keep you informed of any progress.

Could you please also send us a print screen from the UI showing that the Customer Invoice can manually be created&saved with the same subaccount values in the specified ERP company ? 

KonsultVn
CHAMPION ***

by KonsultVn

Thanks. Here's the requested screenshot: 

 

KonsultVn_1-1688572228782.png