Question

I'm trying to retrieve a list of all payments received/entered into a Sage Line 50 database. The company I work for are members of the Sage developer program, so I have access to the SDK, help files and the like but I have been unable to find any specific information regarding payments.

Some of the .dta files contain references to payments (SPLITS.DTA & HEADER.DTA) alongside Invoice rows.

Does anyone know whether or not there is a separate file which contains only payment information, and if so what is it? Alternatively, will I have to pull the full list of rows from the SPLITS/HEADER files and filter them by type?

Many thanks in advance

Was it helpful?

Solution

I pulled data from the Header and Split files for a test customer this afternoon, and they contain (as near as I can tell) all customer activity - Invoices, Invoice payments and Credits are all reflected in both data files (the split data file containing more in depth data) and can be filtered by bank_code and transaction type.

To get the data - first create a reference to a customer object and from there link to all of the header (assuming you have an existing connection and workspace).

dynamic workspace = this._workspaces[workspaceName];
dynamic customer = workspace.CreateObject("SalesRecord");

bool added = customer.AddNew();

customer.MoveFirst(); //find first customer

dynamic headerObject = customer.Link;

bool headerFound = headerObject.MoveFirst(); //use .MoveNext() to cycle headers

You can then pull data from the header object using :

string AccountRef = headerObject.Fields.Item("ACCOUNT_REF").Value;

Where ACCOUNT_REF is a field in the HeaderData object.

Use the following code to get split data

dynamic splitObject = headerObject.Link;

bool splitFound = splitObject.MoveFirst()  //and so on
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top