Table of Contents

Important - please read first

If you've upgraded to Moneyworks v7.1.9, please download and install an updated version of the Moneyworks component:

Introduction

This is a standalone application (Windows or Mac) using our Moneyworks component which is designed to periodically (or manually) connect to Magento and import transactions into Moneyworks. Transactions may be imported as sales orders, sales invoices or receipts, depending on the customisation code entered and/or the import map used.

We call this process 'syncing', and it is controlled by the Sync menu items:

There are also some customised versions of the Connector which connect to MySQL databases, either directly or via an API. It can also be customised to support other ecommerce platforms e.g. Prestashop. Please contact us for more details if you're interested.

Entering the customisation code

Available from the Sync → Customisation code menu item. This code determines which options are available and must be entered first to enable the other menu items.

By default, the Connector works on the basis that all customers and products have the same codes in Magento and in Moneyworks. However, it is also possible to allow customers to be automatically created in Moneyworks if they don't already exist. By default, the Connector uses both name and code to determine if there's a match for either.

Setting up the sync parameters

Available from the Sync → Setup menu item. This consists of five tabs with settings for the Moneyworks connection and Magento connection parameters, and also some Moneyworks-specific options and advanced options to control the sync process.

Moneyworks connection

This tab controls how the Connector connects to Moneyworks:

It allows you to enter the parameters for the Moneyworks connection:

By default, there is a single connection to the Magento database, but it is now possible for a single instance of the Connector to have multiple connections e.g. you may want to apply different rules and settings for different Magento stores and/or sync them to different Moneyworks data files. Apart from the synchronisation interval, all other settings can be different for each connection:

Moneyworks test

The second tab allows you to send commands to Moneyworks (see the Moneyworks CLI manual for details), and you can use the examples in the Input drop-down menu to check that the connection is setup correctly e.g. selecting evaluate expr=“documentpath” and then clicking on the Execute button should return the Moneyworks document name/path in the Output box (and nothing in the Errors box). Clicking on OK will save the current connection settings, and Cancel will discard any changes made. Note that you should avoid using normal single quotes here as these are used internally to pass the commands to Moneyworks.

For REST connections, the commands need to be formatted appropriately using the correct URL structure and using standard HTTP escape sequences - see the Moneyworks REST documentation for details.

Magento connection

This tab controls how the Connector connects to Magento:

Click on the Test button to verify the connection. Clicking on OK will save the current connection settings, and Cancel will discard any changes made.

If you have multiple connections, you'll be able to select which stores are synced for each connection. Clicking the Reload button will reload the list of stores from Magento.

Moneyworks settings

This tab allows you to customise how imported records appear in Moneyworks. When it is selected, the system attempts to read tax codes and shipping codes from the Moneyworks data file:

Note that most of these settings can be overridden by using a customised Moneyworks import map e.g. it may be necessary to have different tax codes for different transaction currencies, different types of product or different shipping destinations. In this case, the tax codes should be left blank here, and the Connector will use the tax amounts as entered in Magento to work out which tax code to apply on a per-line basis.

Other settings

This tab controls the sync process itself:

Initial setup of Moneyworks datafile

Upgrading the Connector

  1. Make sure that the Connector is not currently syncing (or about to sync) with Magento. One way to check this is to look at the timestamp of the latest log file (in the Logs folder) and compare that with the next scheduled time.
  2. Exit the Connector
  3. Make a backup copy of the Database folder (unless it is a major upgrade, in which case backup the entire Connector folder)
  4. Copy over the updated application files as directed (usually only MoneyworksConnector.4DC and MoneyworksConnector.4DIndy to the Database folder)
  5. If an import map has been updated, then copy it to the Database/Resources folder
  6. Restart the Connector - if prompted for a data file, browse to the *.4DD Connector data file (usually MoneyworksConnector.4DD in the Database folder)
  7. Check the Connector settings and set appropriate values for any which have been newly added since the previous version

It is possible to run multiple Connector instances on the same machine as long as:

Common errors

When an import fails, then the next sync will restart from the same point as the previous one, so any records deleted in Moneyworks may magically be resurrected!

Troubleshooting

  1. Check the log file created for each sync in the Database/Logs folder. Error messages, which prevent the timestamps from being updated, will be prefixed by “Error:”, and warning messages will be prefixed by “Warning:”. Error and/or warning messages will generate an email according to the notification settings on the Other Settings tab.
  2. Switch on Generate CSV import files on the Other Settings tab. This creates CSV files in the Database/Resources/Moneyworks_import folder, which can then be manually imported into Moneyworks using corresponding import map in the Database/Resources folder.
  3. Enable XML debugging (enter “debug_xml_on” as a customisation code, and “debug_xml_off” to switch it back off again). This creates XML files for each Magento API call in the Database/Resources/Moneyworks_import folder.
    1. If the Connector is configured to use a REST connection, enabling XML debugging will also create XML import files in the Components/Sussol_Moneyworks.4dbase/Resources/Moneyworks_import folder.
    2. These XML files can then be manually imported into Moneyworks, either directly in Moneyworks or by making use of the Execute button on the Moneyworks test tab.

Appendix: Magento API fields used by Connector