Stock Transaction Pattern for CATS v2

Introduction

CATS is a commodity tracking and reporting system designed to help NDRMC increase traceability and transparency of food commodity movement throughout its supply chain. One of the major design principles of CATS from the very beginning was to implement double-entry accounting pattern at the core of CATS for handling commodity movement transactions. During the initial phase of development, commodity movement at the hubs was the primary focus hence the accounting pattern focused on transactions occurring at the hubs – receiving, dispatch, loss/adjustment, and transfer. Observations and recommendation from the first phase of development are documented on CATS wiki found at https://ndrmcc.atlassian.net/wiki/display/CATS/Transaction+Related+Considerations.

Second phase of CATS development covered upstream processes occurring at federal and regional levels which were primarily planning activities by their nature. At the beginning of the development a review of the transaction pattern was conducted and a comprehensive design pattern to address issues faced during the first phase was drafted to be used as a guideline throughout the development process (https://ndrmcc.atlassian.net/wiki/display/CATS/Accounting+Patterns+in+CATS). After the completion of CATS development, it was rolled out for pilot testing for 18 months using real production data from NDRMC.


A review conducted to assess implementation of transaction pattern in CATS on July 2015 raised concerns on how transactions are implemented and recorded in the database. Incorrect implementation of transactions in CATS means:

  • Transaction patterns are at the core of CATS and poor implementation means further development or changes to the software will be difficult; if not impossible; forcing future phases of software development to dictate rewriting of the current system.
  • Gaps between the documented transaction design and implemented one means it will be too hard to understand the current codebase and introduce future changes
  • Hard-to-trace errors may start to appear in reports since there are gaps between the documented designs and implemented one.

These concerns necessitate a review of existing pattern together with implementation and come up with a revised pattern to address identified issues. This document represents the revised accounting pattern for implementation in CATS v2.

Double-entry transaction pattern

Many computer systems utilizing a relational database contain some sort of accounting information. In the initial design and development stages there is often a debate about what type of accounting strategy should be used by the software to record this information. The decision is usually between a simple and cheap 'single entry' accounting system and a more complex 'double entry' accounting system.
A 'single entry' system is one where the numerical values being stored are only recorded once. In a 'double entry' system each value is stored twice, once as a credit (a positive value), once as a debit (a negative value). There are a number of rules that control these values.

Design Principles

CATS at its core includes an accounting information to trace commodity movement to allow reproduction and generation of reports at any particular point in time. The main rules are as follows:

  • Every entry into the system must balance – i.e. the sum of any transaction must be zero.
  • The sum of all the values in the system at any one time must be zero (the 'trial balance').
  • No values can ever be amended or deleted. They must be negated with an opposing entry (a 'contra') and re-entered ('re-booked'). This provides a completely secure audit trail.

In addition CATS also imposes the following addition requirements for the design of accounting transaction patter.

  1. The table will only record data elements that have:
    1. An identifiable Commodity Type (cereal, pulse, etc.)
    2. A corresponding weight value. In previous versions all weight values were expected to use a single measurement unit (mt) but in the current revision of the document it's recommended to use a uniform measurement unit but as long as corresponding measurement unit is specified for the amount then it should allow recording of values in other units too. For simplicity and to avoid unit conversion at the database level it's recommended to use a single measurement unit per category (weight, length or volume)
  2. Only activities which trigger physical or virtual movement of commodities are recorded in the transaction table. This means that this version avoids recording planning activities hence they don't qualify as either a physical or virtual commodity movement.
  3. Data elements contributing to the CATS KPIs must be included in the transaction table
  4. Data elements that require historical-point-in-time reporting should be included
  5. Conceptually similar events that result in different legal responsibilities or reporting requirements should be denominated into separate accounts
    1. Adjustments to stock due to losses in the DRMFSS stores and Adjustments to stock due to transporter negligence are conceptually similar: both are stock adjustments. 
    2. However, the legal responsibilities are different, and therefore should be registered in separate accounts
  6. Retroactive adjustments to entries in the transaction table will use the difference adjustment accounting method
    1. The original transaction record will remain unchanged, and a new set of records will be inserted into the transaction table. 
    2. The sum of the original records and all related adjustment records will add to the final, revised amount. 
    3. Adjustments are registered in the same accounts the original, and are flagged by the letter 'A' in the sub-account field.

Transaction Activities

Different activities within CATS have a direct or indirect effect on account transactions. These activities are broadly classified as Physical and Planning events. Physical activities are those which trigger physical movement of commodities within the NDRMC supply chain such as receiving, dispatch, transfer, delivery and distribution while planning (virtual) events trigger account transactions with the intention of moving (in or out) commodities which is not reflected physically in the stores. A good example of planning (virtual) event is dispatch allocation which reserves stock within warehouses and affects stock status but do not trigger physical movement of commodities.

Note: In other industries such as manufacturing there is a process called store pickup which moves reserved commodities physically to a different location within the warehouse to represent committed stock.

CATS identifies the following commodity movement activities within NDRMC.

No

Activity

Activity Type

Description

1

Beginning inventory

Virtual

Activity done at the start of inventory cycle (usually yearly) to identify available resources at the warehouses. This process can be done at any interval if desired.

2

Donation

Virtual

Stock movement which is triggered with Gift certificates are issued to NDRMC or when pledges are made by donors. This represents resources NDRMC is expecting to be received in the future.

3

Purchase

Virtual

Commodities which are purchased by NDRMC raising purchase order through MoFED.

4

Loan

Virtual

When resources are acquired through loans from other organizations. This is represented by loan agreement between NDRMC and the other organization (WFP/EFSRA/EGTE etc.)

5

Goods Receiving

Physical

When commodities that are sourced through donation, purchase or loan arrive at the warehouse and receiving note (GRN) is issued.

6

Dispatch Allocation/Stock Reservation

Virtual

Each round (month - depending on the program) resources are earmarked and reserved for distribution based on requests coming from regions. This activity includes preparation of requisition documents and project allocation.

7

Goods Issue

Physical

Based on allocation plan warehouses will release commodities from their stores to destination FDPs by issuing goods issue note (GIN)

8

Delivery

Physical

When commodities released from NDRMC warehouses are moved by transporters and arrive at the FDPs.

9

Utilization/Distribution

Physical

When resources arriving at the FDPs are distributed to beneficiaries and a distribution report is submitted.

10

Transfer

Physical

When resources are moved from one NDRMC warehouse to another.

11

Annual Inventory

Virtual

A recurring activity used to reconcile theoretical stock within the system to that of real stock found within stores.

Data Model

Considering the above principles, the following data model is used to represent double entry transactions in CATS.

Posting

Posting represents the actual double entry transactions. Keeping the figures in one table simplifies calculation of values significantly. Values in this table can never be updated or deleted instead a balancing counter transaction is recorded in the table. Records in this table should also have auto generated globally unique identifier as their primary key to insure no two records have similar ids.
In addition to basic information such as quantity, unit of measure, date; the posting table also keeps attributes such as operation (month/round), donor, warehouse, commodity, FDP, source document etc.

Journal

A journal entry is the data representation of any business transaction that will produce double entries – it represents a complete unit of work i.e. all Posting entries associated with a journal entry must be successfully completed or none must be completed. The numerical sum of all posting entries associated with a journal entry must also equal to zero. The only way the total value contained in the system can be amended is through statistics account (discussed below). Accordingly the following journals are identified for CATS:

No

Journal name

Description

1

Beginning Inventory

Used to group transaction which are recorded when a clean database is configured – when the system is used initially

2

Donation

Holds gift certificate and pledged amounts from donors

3

Purchase

Keeps track of commodities coming through purchase

4

Loan

Resources coming on loan from other organizations

5

Goods Receiving

Tracks commodities which are received at warehouses

6

Dispatch Allocation

Tracks commodities which are earmarked for distribution to FDPs

7

Goods Issue

Journal to keep track of commodities dispatched from warehouses to FDPs

8

Delivery

Keeps track of stock available at FDPs waiting for distribution to beneficiaries

9

Transfer

Resources transferred between warehouses within NDRMC

10

Annual Inventory

Inventory adjustment (loss/gain) from physical inventory count

Account

Account represents the different states the commodity is currently in. In traditional accounting model accounts represents owner of assets in a system but in CATS this is represented by states such as allocated, delivered, goods in transit, good on hand, distributed etc.

No

Account name

Description

1

Receivable

Resources which are purchased, donated or loaned but have not yet been received at NDRMC warehouses. This represents receipt plans created through gift certificates, purchase order or loan agreement.

2

Allocated

Resources committed for dispatch through RRD. In CATS this indicates both dispatch allocation (hub and SI/Project)

3

Receipt

Represents resources which are received at NDRMC hubs. This account is represented by Goods Receiving Note (GRN)

4

Dispatched

Commodities which are dispatched from Hubs and on the way to FDP, Woreda or other Hubs ( in case of transfer)

5

Delivery

Represents current stock at FDP

6

Loss

Commodity amounts which are dispatched from NDRMC warehouses but have not made it to the intended destinations. Reasons for this could be found on CMPM manuals and include damage, theft, etc.

7

Stock

Represents the current physical inventory in NDRMC Hubs

8

Distribution

Value of commodities distributed to beneficiaries from FDPs

9

Statistics

Matches the total amount of commodities in the system. It's updated whenever commodities are taken into (Receivables) or released from (Distributed) the system.


Based on the above model, the following database entity relational model is devised to represent it.


Event types

There are two types of events that trigger transaction entries in CATS namely virtual and physical.

  1. Physical: events that trigger physical movement of commodities in NDRMC supply chain. Examples of this event are Receiving, Dispatch, Transfer, Delivery and Distribution.
  2. Virtual (also called Planning in previous versions): is an intent to do something on commodities. Example of this event include Donation Plan, Dispatch Allocation, Beginning Inventory etc.

Posting Events

Beginning inventory/Starting balance

Description:

Activity conducted when setting the application for the first time or when adding a new hub/warehouse to an existing installation into the system. If the hub/warehouse is being setup and there is no carryover stock information to migrate then there is no need to conduct this activity. If the hub/warehouse was receiving and issuing using manual forms and the need is to start using CATS at the hub/store then this activity allows to capture that information from a specific cut-off date.

Journal:

Beginning Inventory

Account(s):

  • Stock (Cr)
  • Statistics (Db)

Mandatory attributes:

Project, commodity, commodity category, hub, warehouse

Events/Use cases:

Setting up a new hub or warehouse

Expected account values:


Reporting:


Remark: