The Implementation of an Enhanced EFD System with an Embedded Tax Evasion Detection Features: A Case of Tanzania

This paper aims at presenting the development of an enhanced Information and Communication Technology tax collection system that in some countries is referred to as Electronic Cash Register while in Tanzania is popularly known as the Electronic Fiscal Device Machine (EFD Machines). In Tanzania, the system was nurtured in 2010 to address the issue of tax evasion and improving revenue collection. Since then it has been used by business entities to print fiscal receipt/invoice and transmit accounting information to Tanzania Revenue Authority (TRA) online system where the revenues raised from the tax were much increased. Regardless of the increase in revenues collection, still, EFD machines and its management system face several challenges concerning tax evasion which are frequently reported by government authorities. The major drawbacks observed from the current system by this study are; under-declaration of sales value, avoid EFD machine usage, the use of fake EFD system, division of business and conducting business in unknown areas without being detected by the EFD system. Therefore this paper presents the development of an improved EFD system that addresses the stipulated drawbacks with pharmaceutical business picked as a case study. The current EFD system weaknesses were fixed by embedding stock tracking and commodity cap-pricing features in the developed system. While developing the system, this study assumed evolutionary prototyping as a system development methodology to develop both EFD machine application software and EFD Management System. The major advances of the new system are its ability to detect; under-priced transactions, avoidance of EFD machine use, and use of fake EFD machines. Thus, stock tracking and cap-pricing capabilities incorporated in the developed system will enable TRA to detect tax evaders and therefore improve revenue collection across the country.


INTRODUCTION Background
Globally, the collection of tax enables a particular government to raise revenue imposed on individuals and business entities which are commonly accompanied by rules and regulations to ensure the process is smooth and fair with evasion being minimized (Ashington, 2017). Both developed and developing countries have conceived ICT systems and tools to enhance tax collection and fighting against evasion wherein some developing countries tax evasion is noted to range between 55% and 65% (Bawaneh, 2017). Such ICT tools that are mostly used particularly in Europe and most of the African countries are Electronic Cash Registers (ECR) also known as Electronic Fiscal Device Machine (EFD Machine) in East Africa. With the use of these devices, a significant decrease in tax evasion was observed (OECD, 2017).
Similarly, Tanzania is also facing the same problem that compelled the government in 2010 to roll out the use of Electronic Fiscal Device (EFD) Machines to ease the process of keeping business records, tax estimation and detection of trader's actions that translate to tax evasion (URT, 2014).
The EFD machine on one side is used by traders and business entities to issue fiscal receipts/invoice to customers and later transmit tax information to TRA online system, while on the other side Electronic Fiscal Device Management System (EFDMS) receives the sales information from EFD machine for appropriate accounting procedures. One of the major advantages of this device is its fiscal memory which is believed to be difficult to erase or modify mechanically, chemically or through electromagnetic interferences; hence business records submitted to TRA are highly trusted (Chege, Kiragu, Lagat, & Muthoni, 2015). Since the inception of EFD machine nations that have been able to use them have experienced a gradual increase in tax collection yearly (Chege, Kiragu, Lagat, & Muthoni, 2015) Though the existence of the EFD system in Tanzania has improved revenue collections, still tax evasion cases are reported by the revenue authority. The most common technique used by business operators to evade tax is the under-pricing of the sales value, in which the current system is missing a function/feature to detect such an act. Similarly, the system cannot identify traders who avoid using the EFD machine and those who use fake EFD machines. Moreover, some traders divide their businesses purposely to reduce the amount of EFD returns which therefore lower their taxes due, while others conduct their businesses in unofficial areas such as home places to avoid being reached by the revenue authority. The current tax collection system (EFD system) cannot locate or identify such transactions or traders (Ikasu, 2014). Therefore, this paper presents an improved EFD system that was developed with the intention of fixing the mentioned system weaknesses with pharmaceutical businesses used as a case study. The system was enhanced by introducing Stock Tracking capabilities to trace drug stock-flow from manufacturers and/or importers to wholesalers, suppliers, retailers and finally to final consumers. With Stock Tracking features incorporated the system is able to fix the last four mentioned challenges. The developed system was also enhanced with commodity cap-pricing features so that in combination with stock tracking features the system identifies the under-priced transactions.
The remainder of this paper consists of three other sections. Section two describes the material and methods chosen by the researcher to develop the new EFD system. Section three presents the system development that includes the development of both EFD application software and its web management system, while section four entails research conclusion, limitation and future works, and recommendations.

Requirements Analysis
For proper system development researchers carried out requirement analysis to determine whether the EFD system to be developed fits traders and TRA business needs. Requirement analysis defines all customer expectations for the system that is to be developed such that it involves all activities that are carried out to identify the needs of all systems stakeholders (ReQtest, 2018). Therefore, this study outlined functional and non-functional requirements for the development of EFD application software and EFDMS with Cap-pricing and Stock Tracking Features embedded. A functional requirement presents the contribution of STF to EFD application software and EFDMS while non-functional describes the qualities of the proposed system. All requirements were derived from tax officers, IT analysts, and Drug traders from Arusha and Kilimanjaro regions. The regions were selected as the case study due to their proximity to the Institution which is the base of the research and also the fact that, apart from the capital city Dar es Salaam, these are the leading regions in tax collection in Tanzania which increases the degree of trader's participation (URT, 2018).
The functional requirements that contributed directly to stock tracking included: Capturing of the stock source, tracing of stock exchange between traders, configuration of commodity cap-price as per unit item, generation of a comparison report between traders stock records and sales, produce a report on traders stock, Issue alert on possible tax evaders, generate projection on the amount of tax to be collected as per business transactions. Other functional requirements were; produce a summary report on total tax collected, produce a summary report on total tax evaded, produce a report on the amount of tax cleared and outstanding, and EFD machine to work in both real-time and stand-alone mode.

Tools and Technologies
While developing EFDMS and EFD machine application software various programming tools and languages were involved. The tools and languages used were; Hypertext Markup Language (HTML) and Cascading Style Sheets (CSS) for designing EFDMS user interfaces. The HTML is used by developers to create content to be displayed on the World Wide Web while CSS controls how the web pages are presented to the system user (Freeman & Freeman, 2018).
The Android studio used as an Integrated Development Environment for EFD application development. It is a unified environment that provides tools for creating, testing and publishing applications for Android devices (Google, 2016). JavaScript used as a scripting language in an android studio for the development of EFD application and EFD Management System. Usually, it is embedded in HTML pages to dynamically react to the user inputs and also validates them (Oyston, 1999). Therefore, in this study JavaScript in combination with other languages were employed to create forms that require user interaction and input validation such as login and user registration forms.
This study also made the use of Extensible Markup Language (XML) to design EFD application user interfaces in Android studio. XML is derived from Standard Generalized Markup Language (SGML) such that its tags identify, store and organize data on the system page (Tutorials Point (I) Pvt. Ltd., 2017).
PHP was used as a scripting language. PHP which stands for Hypertext Preprocessor it is a server-side scripting language that used to develop attractive and dynamic web pages whereby in this study facilitated the development of EFD Management System using NetBeans as an Integrated Development Environment.
In the development process, the system developer decided to use MySQL and SQLite as the Database Management System to develop the EFD Management System and EFD application respectively. MySQL provides the environment for the user to add, delete, modify, replace or view data from the web system database while SQLite does the same for the android devices (Manual, 2013).
On the other hand, MySQL workbench exhausted as the graphical tool to generate Entity Relational Diagrams (ERDs) from the MySQL database while SQLite DB browser used for browsing data from the SQLite database. Other technological tools used were GIMP as an image manipulator and Apache web server for hosting the EFD Management System.

System Design
To end-up building the right system in the right way, various tools and techniques were engaged to design the candidate system. Such tools and techniques are; Use case diagram, data flow diagrams, data transmission logic, and database schema. System design serves the purpose of creating a solution that aligns with the system requirements to satisfy customer business needs and offer vast pluses by eliminating uncertainties, reducing the development cost, and speeding up the system development process (Wasson, 2006). Before developing the system, DFDs were scrambled to allow the developer to model and visualize the EFD system as a network of functional processes connected by data flow lines and data stores (Bernhard, Karsten, & Rainer, 2016;Celko, 2006). This study explored DFD level 0 and level 1 to model the system such that level 0 DFD pictures the systems at a high level while DFD level 1 describes the system at a low level.
As is shown in Figure 1 and 2 (The DFD level 0 & 1) the system consists of Trader, Tax officer, IT officer and Manager as four major users of the system with each user performing his/her specific tasks. The trader configures the trader's details and business items into the system using the EFD application. Specifically, the trader views, inserts, deletes and updates items in the system. Additionally, the trader also views sales, purchase and tax reports. Tax officer registers traders, registers trader's business and as well views various business reports associated with the trader and the system in general. IT officer registers new system users, performs different kinds of system configuration related to the EFD machine and EFDMS. Not only that but IT officer also issues various commands to authorize and/or freeze certain services entitled to system users. Manager views system reports associated with trader's taxes, stock, and sales. However, the manager may issue system commands to authorize and/or cancel services running on the system or assigned to the user.

Database schema
Before going further with the system development the scholar adduced database schema to skeleton the overview structure of the system database which defines how data in the database are stored, organized, and their relationship (Watt & Eng, 2019). Figure 3 represents the database schema of the developed system. Database tables are categorized into: User and Role management tables -the tables that contain details for user login, access levels, personal information, roles, and privileges; Stock and Sales tables -the tables that contain information about stock-flow and EFD returns; Traders, EFD machine and Tax tablesthe tables that store information concerning registration of traders, EFD machines, financial years and various types of taxes charged by TRA. To guarantee that we were developing the right system, the researcher, with the aid of MySQL workbench generated database schema which therefore was taken to stakeholders for validation.

Development Approach
The study adopted an Evolutionary Prototyping as the Software Development Life Cycle methodology in the development of EFDMS and EFD application software. Evolutionary Prototyping provides a better guide to system developers to plan, design, develop, testing and maintain a system whereby in the development process various prototypes produced before arriving at the final product (Hulaas, 2019). The developed system performs sensitive operations that involve finance and pharmacy which both require a high level of authenticity for improved revenue collection and better health services. Therefore, to maximize the degree of achieving such qualities, Evolutionary Prototyping SDLC opted since it involves users during the development such that for each prototype produced user is consulted to use and assess the product before its commitment (Kim, 2019). Figure 4 describes the system development methodology opted by the study.

SYSTEM DEVELOPMENT
The development of Electronic Fiscal Device Management System (EFDMS) and Electronic Fiscal Device application software was based on MySQL and SQLite database management systems respectively. MySQL is the relational database management system, in this study, enabled the developer to create environments for users to insert, update, view or delete from the web system database (Bassil, 2012). On the other hand, SQLite facilitated the development of a database for the EFD machine that runs the Android operating system. So, SQLite is a light relational database management system designed to run on android devices to serve the same purpose as MySQL. Having these environments set already, other stages of system development followed as described in section 3.1 and 3.2.

EFD Application Software Development
The EFD application was developed using the Android Studio platform to provide the same functionalities offered by the current application with stock-tracking and commodity cap-pricing features added. The EFD application was installed and run on the trader's EFD machines. On the first use, the EFD user must first fiscalize the device. Fiscalization process provides necessary information that the EFD machine requires to be identified and communicate with EFDMS. Among the information prompted during Fiscalization include trader's TIN, names, and passwords that are needed for authentication on using the EFD machine. On successful Fiscalization, the user is taken to log in screen where username and password must be supplied to continue with the EFD machine use. Figure 5 (a) and (b) show the Fiscalization screen and login screen of the EFD application respectively.
After login, the EFD machine user is taken to the main screen of where all operation modes are displayed. The major operation modes are: Registration Mode -Allows a trader to sell an item, print receipt and submits report to EFDMS, Programming Modetrader's and server's details are captured for authentication and connection respectively, Service Mode -activated when synchronizing data between EFD machine and EFDMS, X Mode -gives a trader interface to print/view tax reports, Z Mode -allows a trader to print/view the sales report, while Y Mode -enables a trader to print/view purchase reports.

EFD application security
During the study, it was noted that all users of a certain EFD machine model use the same password to authorize a particular operation. For security consideration, this study identified this as the security loophole that has to be fixed. It is for the said purpose that, during the Fiscalization process the trader provides his/her password that is used to initiate the session and as well logout option is provided for session termination.

Real-time mode versus stand-alone mode
One of the major requirements of the EFD machines is that they should work both in real-time and stand-alone mode with each transaction's receipt independently submitted to EFDMS contrary to the current system where daily transactions are submitted as a single summarized receipt at closing day. Therefore, the EFD application was developed in a way that, on performing business transaction the details are both submitted to the EFDMS server and EFD machine local storage.
At first, the EFD application sends data to SQLite (Local storage) followed by internet connectivity check. If the internet connection is available the same data are also sent to a remote server such that in this state we say that the device is operating in real-time mode. For the case when the internet is not available data are saved into the local storage and then, in the background, the EFD application keeps on checking internet connection every after few seconds and when available the transaction data are pulled from the local storage of the EFD machine and submitted to the TRA server (EFDMS) automatically without involving the trader (auto-sync); in this state, we say that the device is operating in standalone mode. The developer used the "Auto-Syncing" technique to accomplish the target of the study; and as it is for this study, the technique is now used in most modern stock tracking technology that also involves the use of RFID technology systems (Ravinchandra, Abdulla, & Thang, 2016).

Figure 6 (a) and (b)
show the EFD machine working in real-time and stand-alone mode respectively. The green tick indicates that the receipt was successfully submitted both to local storage and to the remote server while the red caution indicates that the receipt was not submitted to a remote server but was saved to local storage.
After the sales information saved to local storage and submitted to the EFDMS server, the same information together with additional trader's information queried from the device database is printed using the inbuilt printer to get a physical receipt that is issued to the buyer. Figure 7 pictures a physical receipt being printed by the EFD machine while Figure 8 describes the data transmission logic from the EFD machine to EFDMS.

EFD Management System Development
The Electronic Fiscal Device Management System (EFDMS) was developed to receive and manipulate sales and stock information from the EFD machine. Not only that, but the EFDMS also provided sales, stock, and tax reports when requested by the trader via the EFD machine. Since this study focused much on building algorithms that support TRA to track trader's stock, sales, and generate reports that identify tax evaders, therefore, this section describes only necessary functionalities involved to achieve the stated objectives.
The developed system consists of three categories of users that include system IT officers, tax officers, and managers. The IT officers perform administrative privileges of the system, tax officers perform tax-related activities while managers perform authorization, approval, and report related issues. Each user of the system is provided with login credentials whereby sessions are generated for every successful login and terminated upon logout. To make the security more robust, the system was designed to have different access levels where at each access level, the system was implemented in a role-based fashion, such that, a user of a certain access level can perform only the assigned tasks of that level. Figure 9 presents the EFDMS dashboard showing all necessary system functionalities.

Stock tracking for pharmaceutical business in Tanzania
In Tanzania, drug stock enters the market through local manufacturing industries or imported from other countries. Manufacturers and importers are the stock initiators. For the case of importers, stock information is registered into the EFDMS via Tanzania Customs Integrated System (TANCIS) (Rose, 2014) while manufacturers register their stock information into EFDMS via computer terminal using the web interface provided. The assumption is made that, the stock information registered into EFDMS by importers and manufacturers is correct since TANCIS is owned by the same authority for the case of importers while TRA agents can be placed in manufacturing industries to verify registered stock information.
The EFDMS was developed in a way that, when importer/manufacturer sales stock items to a supplier or wholesaler through the EFD machine, the system deducts the amount from importer/manufacturer stock account and increments it to the supplier's or whole seller's stock account. So it is when wholesaler trade with the retailer, the stock amount is deducted from the wholesaler's stock account and incremented to retailer's stock account and finally when retailer sale to the final consumer the system deducts the stock amount from retailer's stock account.
To track the trader's stock-flow the EFD application captures the following: buyer's and seller's TIN (Trader Identification Number), item name and item quantity. TIN helps to know the stock issuer and receiver; normally buyer's TIN is entered by the seller on the EFD application interface as shown in Figure 7, while the seller's TIN is captured from the user's login session. Item name identifies the type of stock involved in the transaction while item quantity tells the amount of stock being transferred from seller to buyer. For tax evasion detection, the EFD application captures item prices. The item price is used to compute the total cash received by the seller where the tax percentages are calculated from. The details of tax evasion detection are described in section 3.2.3. Figure 10 presents the stock registration interface used by manufacturers to register their stock into EFDMS.

Figure 9. EFDMS Dashboard
Since each transaction prompts for buyer's and seller's TIN which uniquely identifies each trader in the system (David, 2016), therefore, TRA can identify all stock transactions involved with each trader in both buying and selling with their corresponding dates. Not only that but we can also confirm that TRA can tell the total amount of stock received, sold and currently owned by a trader. Figure 11 presents system screenshot showing trader's stock account with details of the amount of stock received, sold and amount remained to date.

Need for cap-price
In Tanzania, every trader sets commodity price depending on the market situation and financial year such that exceptional is made only to petroleum products where traders receive cap-prices from Energy and Water Utilities Regulatory Authority (EWURA) monthly (EWURA, 2019). For the case of pharmaceutical businesses, earlier this year, the Tanzanian government released an official statement showing the intention of having cap-prices as it is for petroleum products to protect final consumers (Eric, 2019). Therefore, during the study the researcher and system users came into agreement that, for the system to identify underpriced transactions, the system should have a reference price set for each drug type so that the system can run a comparison between the sales price supplied by a trader and the one in the system. Figure 12 screenshots the cap-price configuration form.

Identifying tax evaders
For the system to have the ability to identify tax evaders, the parameters concerning the amount and price of the stock involved in a transaction had to be known by the system. As described in section 3.2.1 and 3.2.2 the developed system tracks trader's stock and the cap-price for each drug is configured in the system. Therefore, when a trader executes business transactions the system multiply the stock quantity with a cap-price set in the system to get expected total cash and then compares the product with the real amount submitted by a trader via EFD machine. Thereafter, the system produces a report showing all underpriced transactions with the difference amount indicated. This translates that, for any transaction executed by the EFD machine and its report submitted to EFDMS, the system can tell whether it is underpriced or otherwise. Normally with this nature of the business, TRA calculates tax referring to trader's annual total sales, meaning that the amount of tax evaded in a certain financial year quarter can therefore be stipulated (TRA, 2019).
Not only that the system detects underpriced business transactions but also identifies those who avoid the use of EFD machines and who use fake EFD. From the developed solution TRA officers see how stock-in and stock-out operations take place in the trader's stock account. When several drug stocks are acquired by a trader and time elapses without discharging reasonable amount to other traders/consumers, alert is issued to tax officer where the physical inspection can be arranged to the suspect's store to confirm whether the stock amount really exists or was sold without using EFD machine or using fake EFD machine. Figure  13 presents the trader's stock account with each transaction statured "Ok" if the transaction diverted not more than -4% from . Traders stock account in detail system estimation, "Warning" if diverted -5% from the system estimation and "Evaded " if transaction deviation is above -5% from the system estimation.

CONCLUSION, LIMITATIONS AND FUTURE WORKS, AND RECOMMENDATIONS Conclusion
This study collected data from Arusha and Kilimanjaro both being the regions of Tanzania located in the northern part of the country. The study confirmed the existence of various challenges in the current tax collection system each of them independently turns to be a tax evasion technique. The main objective of this study was to develop an improved EFD system that will identify tax evaders and thereafter improve tax collections. The tax evasion techniques uncovered were; underpricing of sales value, avoiding the use of EFD machines, the use of fake EFD system, division of business and conducting business in unofficial areas. Therefore, this paper presented the development of the improved EFD application software and its management system that deals with tax evasion in Tanzania using the pharmaceutical business as a case study. The developed solution adopted stock tracking and commodity cap-pricing as the techniques that successfully identified tax evaders and the corresponding amounts. Stock-tracking was chosen as a technique to mitigate tax evasion as it gives complete control over purchases, stock, and Sales of goods. Since each trader is uniquely identified by the system using trader's TIN, it provides tax officers and/or managers with the ability to monitor trader's stock status at any given point in time. Additionally, stock tracking features in the EFD system allows a trader to track commodity cost and sales value for proper business management. However, the new EFD system reduces manual work and human resources needed in the tax estimation, collection, and inspection process. Lastly, the whole process of tax collection is more open and accurate; therefore, frictions between traders and TRA are minimized.

Limitation and Future Works
The designed solution presented by this study based only on one type of business (pharmaceutical business) which may not be the case to other businesses. Therefore, this study open doors to TRA and/or other scholars to conduct more research to gradually bring-in more businesses and finally reach all types of business across the country. The study also provides a gateway to other developers to integrate EFDMS with Tanzania Food and Drugs Authority (TFDA) databases to control fake and/or expired drugs and food products in the market.

Recommendations
This research recommends that the Tanzania Revenue Authority (TRA) deploy the developed system to pilot regions in the country. According to the Tanzania tax administration act of 2015, TRA considers a trader as a tax evader when EFD annual returns go below 80% of their expectation (URT, 2015). With commodity cap-pricing and stock tracking features being incorporated in the developed system the uncertainties of the tax estimation process are much minimized, therefore, this study also recommends that the tax evasion relief percentage be minimized from 20% to 5%.