Integration between Manager and SAGA C accounting software (Romania)

Dear Sir,
Kindly note that we are using Manager as an accounting and operation system in our business, but according to the country where we operate, Manager needs a lot of customizations to meet the Romanian requirements authorities, So we have another software for Accounting and integrated with the taxes authorities in Romania, But I’m still using Manager because if it easier and faster and many other benefits we get.
Now after we make the invoice in Manager, We need to create it again in SAGA C, So I was wondering if there is any way to push the invoices from Manager to be created in SAGA with minimum effort.
The progress I made so far is the following:
1- I have created a custom field in Manager in the inventory item profile called S.Code (which means SAGA Code) and I finished the mapping of all products so each item in Manager has 2 codes (An operation code from Manager like 4 digits, and another Code which is used for the same item in SAGA C which is 8 digits)
2- I copy the invoice output with both codes to an Excel file, then delete everything except the Mapped code (S.Code), Quantity, and Price.
3- I import this Excel in the lines of a new invoice in SAGA C or sometimes I upload it Manually or automatically by uploading the tool running field by field.
So I was wondering if anyone faced the same problem with any other software, or maybe you can guide me on where to start.
I don’t have an experience with API but I understand the idea.
Sorry for explaining too much, but I had to do this to give you a full image.
Thank you!

1 Like

Recently reference and code (optional in invoices and inventory item) can be used without translating in a UUID. As such your work may be simpler if you donot use the custom field but enter a reference and code where appropriate as the 8 digit SAGA code, Manager has no limit in length!).

1 Like

Thank you for the fast response, I know that the Manager can do this but we are doing this for easier coding purposes since we have a fast-running business nature.
(The business life cycle is one week only).

As mentioned a recent change allows you to use real code rather than being transformed into keys. As SAGA is itself an accounting application wondering what the benefit of using Manager is.

1 Like

OK consider now that I will change all codes in Manager to be typical with Saga, and item names.
What is next?

What is the excel format for importing invoice data into SAGA?

If only the code (S.Code), Quantity, and Price, it should be easy to get from the sales invoice line tab.

Select the desired column, copy the data to the clipboard and paste it into Excel

Mabaega Yes, and this is what I’m already doing.

Then keep doing it but you no longer have to use a custom field so one step less :slight_smile:

Can we have an exporting tool in general and once I click on the button Export, it gives me the ability to choose which are the columns I need to export?

Manager has API2 to get Sales Invoice Line by field.
Then your problem is, how to make SAGA can read data from Manager API2 and convert it to Invoice automatically.
For this, you need support from SAGA

1 Like

Exactly :100: … and I’m working with them on that now, But at the same time I have to know what I can get out of Manager so I can see what will be into SAGA

What exactly.

Manager tries to meet the legal requirements of all countries.

In contrast customisation to connect to another accounting system is a task specific to just you so you will have to do on your own.

I will give you one example, any Accounting system has to have the following declarations in the approved format from ANAF:
https://static.anaf.ro/static/10/Anaf/Declaratii_R/112.html

So why not create “Multiple Value Custom Fields” where each line represents one of the declaration fields?

Maybe this code can give you an idea, how to get data from Manager using API2 and move it into an Excel worksheet.

This is Excel Macro (VBA Code) from ChatGPT, you can ask ChatGPT to explain the code, and how to implement it into your Excel file.

Sub FetchSalesInvoiceLinesByTermYearMonth()
    Dim httpRequest As Object
    Dim jsonResponse As String
    Dim jsonObject As Object
    Dim salesInvoiceLines As Variant
    Dim sItem As String
    Dim i, j As Long
    Dim dataArray() As Variant
    Dim rowCount As Long
    Dim ItemCount As Long
    
    
    ' Define the API endpoint URL
    Dim salesUrl As String
    salesUrl = "http://127.0.0.1:55667/api2/sales-invoice-lines?term=2024-01&fields=Item&fields=Qty&fields=UnitPrice"
      
    ' Define the Access Token
    Dim accessToken As String
    accessToken = "----Manager Access Tokens----"
    
    ' Create a new HTTP request object
    Set httpRequest = CreateObject("MSXML2.XMLHTTP")
        
    ' Open a connection to the sales invoice lines API endpoint
    httpRequest.Open "GET", salesUrl, False
    httpRequest.SetRequestHeader "accept", "application/json"
    httpRequest.SetRequestHeader "X-API-KEY", accessToken
    httpRequest.Send
    
    ' Check if the request was successful
    If httpRequest.Status = 200 Then
        ' Get the JSON response for sales invoice lines
        jsonResponse = httpRequest.ResponseText
        
        ' Check if jsonResponse is not empty
        If Len(jsonResponse) > 0 Then
            ' Parse the JSON response for sales invoice lines
            Set jsonObject = JsonConverter.ParseJson(jsonResponse)
            
            ' Extract sales invoice lines array
            Set salesInvoiceLines = jsonObject("salesInvoiceLines")
            
            ' Determine the number of rows in the array
            rowCount = salesInvoiceLines.Count
            
            ' Clear existing data in the Excel sheet
            Sheets("Sheet1").UsedRange.ClearContents
            
            ' Write column headers
            Sheets("Sheet1").Cells(1, 1).value = "ItemCode"
            Sheets("Sheet1").Cells(1, 2).value = "Qty"
            Sheets("Sheet1").Cells(1, 3).value = "UnitPrice"
            
            If rowCount > 0 Then
                'Check if Item has Quantity
                For i = 1 To rowCount
                    Set salesInvoiceLine = salesInvoiceLines(i)
                    If Not IsNull(salesInvoiceLine("qty")) Then
                        ItemCount = ItemCount + 1
                    End If
                Next i
                
                ' Redimension the dataArray to match the number of rows
                ReDim dataArray(1 To ItemCount, 1 To 3)
                
                ' Extract data from JSON and populate the array
                For i = 1 To rowCount
                    
                    Set salesInvoiceLine = salesInvoiceLines(i)
                    
                    If Not IsNull(salesInvoiceLine("qty")) Then
                        j = j + 1
                        sItem = salesInvoiceLine("item")
                        If InStr(1, sItem, "-") Then
                            sItem = Trim(Split(sItem, " - ")(0))
                        End If
                    
                        dataArray(j, 1) = sItem
                        dataArray(j, 2) = salesInvoiceLine("qty")
                        dataArray(j, 3) = salesInvoiceLine("unitPrice")("value")
                        
                    End If
                Next i
                                
                ' Write data from the array to the worksheet
                Sheets("Sheet1").Range("A2").Resize(ItemCount, 3).value = dataArray
            
            End If
            
           
            ' Clean up
            Set httpRequest = Nothing
            Set jsonObject = Nothing
             
            MsgBox ItemCount & " Record fetched successfully!", vbInformation
        Else
            MsgBox "JSON response is empty!", vbExclamation
        End If
    Else
        MsgBox "HTTP request failed with status: " & httpRequest.Status, vbCritical
    End If
End Sub

Unfortunately at this time we cannot pull custom field data via API2

2 Likes

@Yaser I see your question about Manager and SAGA. I am not an IT person and I was wondering if you have already found a way to create and upload the required e-invoice (Romania) from Manager into the government system? In addition, also allow SAGA and Manager to correspond with each other on this invoices? Thank You!

Thanks for your comment, I didnt go further, so no progress at all and nothing linked yet, But I wish to find who is interested so we can collaborate!.

Thank you for your response. I can’t imagine we’re the only two.