The situation
A gym chain runs each club on ABC Fitness for memberships and point of sale, and manages repairs and maintenance in OpenWrench. Accounting is in NetSuite. As the chain added clubs, finance was re-keying each club's sales, refunds, tax and stock movements. It was also entering maintenance invoices a second time after they had been approved in the facilities system.
What we built
Club revenue. Map/Reduce jobs call the club system's API for each club and turn its transactions into NetSuite records:
- point-of-sale sales become cash sales, and returns become credit memos and customer refunds;
- cash and tax differences become adjustment journals;
- stock sold at the club becomes inventory adjustments;
- rewards and wholesale transactions follow their own flows.
Each club is a customer in NetSuite, so revenue and stock land against the right club. A monthly billing process turns the club system's statement and member-collected reports into revenue and state-tax journal entries. A department library maps each line to its GL account and department.
Maintenance payables. A Map/Reduce reads invoices approved in OpenWrench and creates vendor bills. It maps the club, the problem type, the GL code and the vendor, and attaches the invoice file to the bill. Invoices still unapproved at month end go into one reversing accrual journal per subsidiary, so the month carries the cost. User Events on vendor payments and vendor credits send the paid status back to OpenWrench.
What it does now
Revenue from every club posts to NetSuite without manual entry, and each run writes a log record per club. The job records which profit-centre intervals it has processed and skips them, so a rerun does not post a day twice. On the payables side, facilities staff see an invoice marked as imported once it becomes a bill, and as paid once NetSuite pays it. The accrual reverses by itself the following month.
Under the hood
- One Map/Reduce per transaction family, with a shared library for the API, the mapping and the logging.
- Processed intervals are recorded and skipped on rerun.
- GL and department mapping live in one library, so adding a club is a data change.
- Accruals are grouped per subsidiary and set to reverse automatically.
- The status write-back runs on NetSuite events, so the facilities system shows where each invoice stands.
- Invoice documents are attached to the NetSuite bill for audit.