My Products
Help
MortenFlexyBox
CONTRIBUTOR *

How to delete a JournalTransactionV2 entry ?

by MortenFlexyBox

Hi

It seems there is no way of removing an entire Batch, is that correct ?

We have tried deleting rows again in the Batch, however we are currently getting back:
{"message":"GL transaction line: '0' not found."}

What does this error mean ?

9 REPLIES 9
MortenFlexyBox
CONTRIBUTOR *

by MortenFlexyBox

Hi, there are no remaining lines, iam attempting to first delete all lines and then add in some new ones.

Pretty much a clean and the add.

by Magnus Johnsen

Hi,

Could you please send us the result of a GET for the batch and we can test it on our end.

Thank you. 

MortenFlexyBox
CONTRIBUTOR *

by MortenFlexyBox

 

Initial GET request to get existing Journal data:

GET https://integration.visma.net/API/controller/api/v2/journaltransaction?releasedBatch=False&periodId=202205 HTTP/1.1
Host: integration.visma.net
Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXX
ipp-application-type: Visma.net Financials
ipp-company-id: 4081739
HTTP/1.1 200 OK
Date: Sun, 15 May 2022 14:24:37 GMT
Server: Nginx
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Type: application/json; charset=utf-8
ipp-request-id: 75dd8e87-1b29-4419-9252-6498145dd6da
X-Content-Type-Options: application/json
Pragma: no-cache
X-Handled-By: Acumatica-PX.Export/AuthenticationManagerModule
Referrer-Policy: origin-when-cross-origin
VnfInstanceId: ERP_DK_DEMO_0001
Strict-Transport-Security: max-age=31536000; includeSubDomains
Cache-Control: no-cache,no-cache
Feature-Policy: geolocation 'none'; vr 'none'; payment 'none'; midi 'none'; microphone 'none'; fullscreen 'none'; encrypted-media 'none'; camera 'none'; autoplay 'none';
Expires: -1
X-XSS-Protection: 1;mode=block
Set-Cookie: LegacyUI=0; path=/; secure; HttpOnly,UserBranch=13; path=/; secure; HttpOnly,Locale=TimeZone=GMTE0000U&Culture=en-GB; path=/; secure; HttpOnly,UserDisplayName=; expires=Sat, 14-May-2022 14:24:36 GMT; path=/; secure; HttpOnly
Transfer-Encoding: chunked

1470
[{"module":"ModuleGL","batchNumber":"000012","status":"Balanced","hold":false,"transactionDate":"2022-05-11T00:00:00","postPeriod":"052022","financialPeriod":"202205","ledger":"1","ledgerDescription":"Regnskab","currencyId":"DKK","exchangeRate":1.00000000,"autoReversing":false,"reversingEntry":false,"description":"1111","debitTotal":0.0000,"debitTotalInCurrency":0.0000,"creditTotal":0.0000,"creditTotalInCurrency":0.0000,"controlTotal":0.0000,"controlTotalInCurrency":0.0000,"createVatTransaction":false,"skipVatAmountValidation":false,"lastModifiedDateTime":"2022-05-11T08:06:08.21","branch":"1","journalTransactionLines":[{"lineNumber":2,"accountNumber":"10100","description":"Omsætning Indland","subaccount":{"subaccountNumber":"0","subaccountId":30588,"description":"Ingen","lastModifiedDateTime":"2022-05-06T07:09:18.233","active":true,"segments":[{"segmentId":1,"segmentDescription":"Afdeling","segmentValue":"0","segmentValueDescription":"(Default)"}]},"referenceNumber":"000012","debitAmount":0.0000,"debitAmountInCurrency":0.0000,"creditAmount":400.0000,"creditAmountInCurrency":400.0000,"transactionDescription":"Testing","branch":"1","transactionType":"   ","module":"ModuleGL","project":{"id":"X","description":"Non-Project Code."},"quantity":0.000000},{"lineNumber":4,"accountNumber":"10150","description":"Omsætning Indland uden moms","subaccount":{"subaccountNumber":"0","subaccountId":30588,"description":"Ingen","lastModifiedDateTime":"2022-05-06T07:09:18.233","active":true,"segments":[{"segmentId":1,"segmentDescription":"Afdeling","segmentValue":"0","segmentValueDescription":"(Default)"}]},"referenceNumber":"000012","debitAmount":0.0000,"debitAmountInCurrency":0.0000,"creditAmount":-200.0000,"creditAmountInCurrency":-200.0000,"transactionDescription":"Testing","branch":"1","transactionType":"   ","module":"ModuleGL","project":{"id":"X","description":"Non-Project Code."},"quantity":0.000000},{"lineNumber":6,"accountNumber":"10100","description":"Omsætning Indland","subaccount":{"subaccountNumber":"0","subaccountId":30588,"description":"Ingen","lastModifiedDateTime":"2022-05-06T07:09:18.233","active":true,"segments":[{"segmentId":1,"segmentDescription":"Afdeling","segmentValue":"0","segmentValueDescription":"(Default)"}]},"referenceNumber":"000012","debitAmount":0.0000,"debitAmountInCurrency":0.0000,"creditAmount":-200.0000,"creditAmountInCurrency":-200.0000,"transactionDescription":"Testing","branch":"1","transactionType":"   ","module":"ModuleGL","project":{"id":"X","description":"Non-Project Code."},"quantity":0.000000}],"metadata":{"totalCount":6,"maxPageSize":1000}},{"module":"ModuleGL","batchNumber":"000013","status":"Balanced","hold":false,"transactionDate":"2022-05-15T00:00:00","postPeriod":"052022","financialPeriod":"202205","ledger":"1","ledgerDescription":"Regnskab","currencyId":"DKK","exchangeRate":1.00000000,"autoReversing":false,"reversingEntry":false,"description":"1111","debitTotal":0.0000,"debitTotalInCurrency":0.0000,"creditTotal":0.0000,"creditTotalInCurrency":0.0000,"controlTotal":0.0000,"controlTotalInCurrency":0.0000,"createVatTransaction":false,"skipVatAmountValidation":false,"lastModifiedDateTime":"2022-05-15T16:23:55.647","branch":"1","journalTransactionLines":[{"lineNumber":2,"accountNumber":"10100","description":"Omsætning Indland","subaccount":{"subaccountNumber":"0","subaccountId":30588,"description":"Ingen","lastModifiedDateTime":"2022-05-06T07:09:18.233","active":true,"segments":[{"segmentId":1,"segmentDescription":"Afdeling","segmentValue":"0","segmentValueDescription":"(Default)"}]},"referenceNumber":"000013","debitAmount":0.0000,"debitAmountInCurrency":0.0000,"creditAmount":400.0000,"creditAmountInCurrency":400.0000,"transactionDescription":"Testing","branch":"1","transactionType":"   ","module":"ModuleGL","project":{"id":"X","description":"Non-Project Code."},"quantity":0.000000},{"lineNumber":4,"accountNumber":"10150","description":"Omsætning Indland uden moms","subaccount":{"subaccountNumber":"0","subaccountId":30588,"description":"Ingen","lastModifiedDateTime":"2022-05-06T07:09:18.233","active":true,"segments":[{"segmentId":1,"segmentDescription":"Afdeling","segmentValue":"0","segmentValueDescription":"(Default)"}]},"referenceNumber":"000013","debitAmount":0.0000,"debitAmountInCurrency":0.0000,"creditAmount":-200.0000,"creditAmountInCurrency":-200.0000,"transactionDescription":"Testing","branch":"1","transactionType":"   ","module":"ModuleGL","project":{"id":"X","description":"Non-Project Code."},"quantity":0.000000},{"lineNumber":6,"accountNumber":"10100","description":"Omsætning Indland","subaccount":{"subaccountNumber":"0","subaccountId":30588,"description":"Ingen","lastModifiedDateTime":"2022-05-06T07:09:18.233","active":true,"segments":[{"segmentId":1,"segmentDescription":"Afdeling","segmentValue":"0","segmentValueDescription":"(Default)"}]},"referenceNumber":"000013","debitAmount":0.0000,"debitAmountInCurrency":0.0000,"creditAmount":-200.0000,"creditAmountInCurrency":-200.0000,"transactionDescription":"Testing","branch":"1","transactionType":"   ","module":"ModuleGL","project":{"id":"X","description":"Non-Project Code."},"quantity":0.000000}],"metadata":{"totalCount":6,"maxPageSize":1000}}]
0

 

 

REMOVE AND INSERT - this is the one that fails as can be seen

PUT https://integration.visma.net/API/controller/api/v2/journaltransaction/000013 HTTP/1.1
Host: integration.visma.net
Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXX
ipp-application-type: Visma.net Financials
ipp-company-id: 4081739
Transfer-Encoding: chunked
Cookie: LegacyUI=0; UserBranch=13; Locale=TimeZone=GMTE0000U&Culture=en-GB
Content-Type: application/json; charset=utf-8

47A
{"transactionDate":{"value":"2022-05-15T00:00:00+02:00"},"description":{"value":"1111"},"branch":{"value":"1"},"journalTransactionLines":[{"operation":"Delete","lineNumber":{"value":2.0},"accountNumber":{"value":"10100"},"branch":{"value":"1"}},{"operation":"Delete","lineNumber":{"value":4.0},"accountNumber":{"value":"10150"},"branch":{"value":"1"}},{"operation":"Delete","lineNumber":{"value":6.0},"accountNumber":{"value":"10100"},"branch":{"value":"1"}},{"operation":"Insert","lineNumber":{"value":7.0},"accountNumber":{"value":"10100"},"project":{"value":"X"},"transactionDescription":{"value":"Testing"},"creditAmountInCurrency":{"value":400.0},"vatId":{},"branch":{"value":"1"}},{"operation":"Insert","lineNumber":{"value":8.0},"accountNumber":{"value":"10150"},"project":{"value":"X"},"transactionDescription":{"value":"Testing"},"creditAmountInCurrency":{"value":-200.0},"vatId":{},"branch":{"value":"1"}},{"operation":"Insert","lineNumber":{"value":9.0},"accountNumber":{"value":"10100"},"project":{"value":"X"},"transactionDescription":{"value":"Testing"},"creditAmountInCurrency":{"value":-200.0},"vatId":{},"branch":{"value":"1"}}]}
0


RESULT:

HTTP/1.1 400 Bad Request
Date: Sun, 15 May 2022 14:24:38 GMT
Server: Nginx
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Type: application/json; charset=utf-8
ipp-request-id: fb2304f2-f7de-4b92-bf13-a8bce3226afb
X-Content-Type-Options: application/json
Pragma: no-cache
X-Handled-By: Acumatica-PX.Export/AuthenticationManagerModule
Referrer-Policy: origin-when-cross-origin
VnfInstanceId: ERP_DK_DEMO_0001
Strict-Transport-Security: max-age=31536000; includeSubDomains
Cache-Control: no-cache,no-cache
Feature-Policy: geolocation 'none'; vr 'none'; payment 'none'; midi 'none'; microphone 'none'; fullscreen 'none'; encrypted-media 'none'; camera 'none'; autoplay 'none';
Expires: -1
X-XSS-Protection: 1;mode=block
Set-Cookie: LegacyUI=0; path=/; secure; HttpOnly,UserBranch=13; path=/; secure; HttpOnly,Locale=TimeZone=GMTE0000U&Culture=en-GB; path=/; secure; HttpOnly,UserDisplayName=; expires=Sat, 14-May-2022 14:24:37 GMT; path=/; secure; HttpOnly
Connection: close
Transfer-Encoding: chunked

31
{"message":"GL transaction line: '0' not found."}
0

 

by Magnus Johnsen

Have you tried to delete the same lines and add the same lines in the UI?

Is the batch balanced?

If you send us whats on the remaining lines we can test it on our end and get back to you.

 

by Magnus Johnsen

Hi,

There is no way to delete a whole journalTransaction batch via the API.

The error means that there is no line numbered "0", in Visma.Net Financials, the lines start at 1.

We suggest that you get the transaction first to see what number your lines has, these might be not be in sequential order depending if lines has previously been deleted, as line numbers in Financials are incremental.

MortenFlexyBox
CONTRIBUTOR *

by MortenFlexyBox

Hi Magnus

 

Thanks, however the request iam sending is.
Am i using "Delete" wrong - couldnt seem to find any documentation on the different operations?

{
  "transactionDate": {
    "value": "2022-05-11T00:00:00+02:00"
  },
  "description": {
    "value": "1111"
  },
  "branch": {
    "value": "1"
  },
  "journalTransactionLines": [
    {
      "operation": "Delete",
      "lineNumber": {
        "value": 2
      },
      "accountNumber": {
        "value": "10100"
      },
      "branch": {
        "value": "1"
      }
    },
    {
      "operation": "Delete",
      "lineNumber": {
        "value": 4
      },
      "accountNumber": {
        "value": "10150"
      },
      "branch": {
        "value": "1"
      }
    },
    {
      "operation": "Delete",
      "lineNumber": {
        "value": 6
      },
      "accountNumber": {
        "value": "10100"
      },
      "branch": {
        "value": "1"
      }
    },
    {
      "operation": "Insert",
      "lineNumber": {
        "value": 7
      },
      "accountNumber": {
        "value": "10100"
      },
      "project": {
        "value": "X"
      },
      "transactionDescription": {
        "value": "Testing"
      },
      "creditAmountInCurrency": {
        "value": 400
      },
      "vatId": {},
      "branch": {
        "value": "1"
      }
    },
    {
      "operation": "Insert",
      "lineNumber": {
        "value": 8
      },
      "accountNumber": {
        "value": "10150"
      },
      "project": {
        "value": "X"
      },
      "transactionDescription": {
        "value": "Testing"
      },
      "creditAmountInCurrency": {
        "value": -200
      },
      "vatId": {},
      "branch": {
        "value": "1"
      }
    },
    {
      "operation": "Insert",
      "lineNumber": {
        "value": 9
      },
      "accountNumber": {
        "value": "10100"
      },
      "project": {
        "value": "X"
      },
      "transactionDescription": {
        "value": "Testing"
      },
      "creditAmountInCurrency": {
        "value": -200
      },
      "vatId": {},
      "branch": {
        "value": "1"
      }
    }
  ]
}

 

by Magnus Johnsen

Thank you, we'll try to replicate this on our end. 

MortenFlexyBox
CONTRIBUTOR *

by MortenFlexyBox

Any news ?

by Magnus Johnsen

Hi,

As far as our testing has gone, it does not seem to be possible to both delete all lines and insert new lines in the same PUT operation.

We recommend that you either first insert the new lines and delete the old lines or in the other order.

Example:

PUT journalTransaction/000090

 
View more
{
    "journalTransactionLines": [
        {
            "operation": "Delete",
            "lineNumber": {
                "value": 1
            }
        },
        {
            "operation": "Delete",
            "lineNumber": {
                "value": 2
            }
        },
        {
            "operation": "Delete",
            "lineNumber": {
                "value": 3
            }
        }
    ]
}
 
Followed by PUT journalTransaction/000090:
 
View more
{
    "journalTransactionLines": [
        {
            "operation": "Insert",
            "lineNumber": {
                "value": 0
            },
            "accountNumber": {
                "value": "1920"
            },
            "project": {
                "value": "X"
            },
            "transactionDescription": {
                "value": "Testing"
            },
            "creditAmountInCurrency": {
                "value": 400
            }
        },
        {
            "operation": "Insert",
            "lineNumber": {
                "value": 0
            },
            "accountNumber": {
                "value": "2000"
            },
            "project": {
                "value": "X"
            },
            "transactionDescription": {
                "value": "Testing"
            },
            "debitAmountInCurrency": {
                "value": 200
            }
        },
        {
            "operation": "Insert",
            "lineNumber": {
                "value": 0
            },
            "accountNumber": {
                "value": "1060"
            },
            "project": {
                "value": "X"
            },
            "transactionDescription": {
                "value": "Testing"
            },
            "debitAmountInCurrency": {
                "value": 200
            }
        }
    ]
}