Implementation of Mobile Point-of-sale Cashier Management System

The traditional fixed point-of-sale cash register is not only expensive and bulky but also inconvenient to use. Therefore, the goal of this research is to realize a live-trading mobile cash register that can handle multiple online transactions concurrently and is capable of intelligent back-end data processing and analysis for transactions, especially applying Web technology and a back-end database for data exchange or third-party payment over the Internet. Regarding the Internet of Things, the wireless networking protocol Bluetooth is used to connect front-end devices to their smart-card-related accessories where near-field communication (NFC) technology is used to read data stored in a smart card for connection and data exchange between the smart card and the front-end devices. In this way, a point-of-sale system is not limited to being installed or fixed on a front desk; instead, it becomes a mobile cash register and accepts online payment, providing consumers with convenience and fast transactions.


Introduction
In this study, we aim to use a relatively low-cost approach to replace the expensive point-of-sale system in the market. Currently, the point-of-sale system in the market is a complete set, which also contains a format system. The system function also determines the sale price. Small stores or street vendors tend to carry inexpensive systems. Some well-design systems are expensive. The system developed in this study is cheaper than most products in the market and has more powerful functions and better support. The functions of the proposed system have been designed according to common operating modes, so that it can meet the needs of general merchants. Each transaction process leads to numerous business opportunities, including information that can improve performance; thus, the proposed system enables the analysis of big data to determine different models and the demand of consumers.
The device system proposed in this study includes three parts: (1) an Android device (2) PHP Web Service, and (3) a cash flow method. The integrated development environment (IDE) is Android Studio and the programming language is Java. A large amount of information accessible on the Internet can be acquired, and updated technologies can be easily found on the Internet. The back-end server uses a virtual host set up by Proxmox Virtual Environment (PVE) (1) to execute WebService, written using PHP as the platform for the data exchange between the front and back-end platforms. (2) Finally, in terms of the cash flow method, money transactions can only be processed with data exchange specifications published by various financial institutions. As the transactions involve the confidential security of financial institutions, the internal operation mode is not public. Only a particular information exchange interface is accessible to the public. Developers can simply communicate with it for cash flow. However, if the financial institution fails to provide an Android communication interface, the on-line transaction definitely does not work here. If the communication interface of another programming language is provided, there are other ways to solve this problem. The research process is shown in Fig. 1.

Related Work
The near-field communication (NFC) technology (3,4) in mobile phones can read and write on a Mifare Card (5,6) made using RFID technology. The i-Cash EasyCard has been launched in cooperation with President Chain Store in 2009 having such specifications. (7,8) If this card can be combined with a merchant's mobile cashier system, the operating efficiency can be improved considerably and consumers become interested in using this card when making purchases, together with the Mifare membership card developed by merchants themselves, which records the membership points gained from their purchases. This system allows consumers themselves to control the information and use of points. A large data database can also be produced through the combination of basic data and the purchase records of members so as to simulate the preferences and consumption habits of consumers, launch discount activities for members, greatly stimulate consumer demand, and increase the operating performance. The data storage block of a Mifare card is shown in Fig. 2. Statistical data have shown that the number of mobile phones with NFC functions would increase by 30% after 2015. Hence, NFC technology is essential in smart phones. (9) The growth trend is shown in Fig. 3. (10) Bluetooth communication technology (11) is used in this study to connect to a thermal printer. Bluetooth communication is a type of short-range wireless communication. (12) The Bluetooth transmission protocol is shown in Fig. 4. (13) As Bluetooth uses the peer-to-peer online mode, its setting is simple and its data transmission is fast. The online distance is at least 10 m. This technology is therefore very convenient to use, and its transmission of text and data is rapid and robust. (14) It is thus a good choice for transmitting and printing documents and other information. Figure 5 shows the advantages and disadvantages of Bluetooth and NFC in terms    of actual transmission time. (15) When the transmission capacity is less than 4 kB, the NFC speed is higher than the Bluetooth speed; however, when the transmission capacity is greater than 4 kB, the Bluetooth speed is much higher than the NFC speed. Although the capacity of a printed text is small, the text transmission speed decreases significantly if the amount of transaction data increases.
For barcode identification, (16) barcodes and QR codes have been widely used in the market, and the use of barcodes and QR codes for identification has become popular. A CCD sensor is also used to receive reflected image as the basic image for identification. The clarity and resolution of the image directly affect the accuracy of identifying results. Three simple steps for barcode identification are to acquire the original image, remove the noise, and capture the image block having the barcode. After image binarization and clarity processing, the granularity of a barcode, or a QR code, can be analyzed and then quantified as the corresponding decimal value. All up-to-date smart phones possess the required devices and high-resolution cameras; thus, they can be used for barcode and QR code identification. (17) As there are free and effective identification modules on the Internet, the operation process is not described in detail here.
The http data exchange framework is widely used in web-based services or mobile applications, (18) and the back-end server host uses the Apache architecture. The user end needs packages provided by Apache to obtain the contents on the Internet by the GET or POST method. In this study, we use such an architecture to change the contents of the webpage into the xml data format and then analyze its Tag to obtain different types of information.
Regardless of the type of system, a small database in a cloud system is required to record the related data for different uses. In an Android system, an in-cloud SQLite database (19) is used to store the user's chat records in the design and implementation of online instant messaging software on the Android platform. The applied Android content provider monitors the changes in the database and displays chat records on the screen of mobile phones in real time to realize one-on-one real-time information exchange. (20) The daily consumption records can be stored in the proposed system to obtain the real-time statistics of sales amount or performance within a certain period of time offline. Moreover, the iPOS system we proposed here can also be used to record login accounts set by the background.

Architecture diagram for main system
First, start the point-of-sale system app installed in a mobile phone; then, the system begins to run after logging into the system. The point-of-sale system has the following three main functions: (1) It runs statistics and records trading items and sales amount. (2) It allows data exchange through the http communication protocol, including the uploading of the communication mode of transaction data and cash flow. (3) It controls the peripheral hardware functions of a smart phone, such as the Bluetooth printing, reading, and writing of a Mifare induction card, and the barcode scanning of a camera. The system architecture is shown in Fig. 6.

Introduction to development tool
In this study, we adopt Android Studio 2.0 as the tool for the development of the system. Such a tool was newly launched by Google, the formal version 1.0 was introduced in December 2014 for free download and use, and the following is the simple procedure for setting up an environment installation. (21,22) (1) Install JDK as the main language of Android using Java (Oracle Java JDK). The download location is http://www.oracle.com/technetwork/java/javase/downloads/index.html. (2) Download and install Android Studio Tools.
(3) A home screen will appear to make users choose to start a new project or import an old project after the first execution. A screenshot is shown in Fig. 7. (4) Open Android Studio to download Android SDK Tools and other relevant information. (5) Please refer to the installation steps in detail. (21)

Transaction process over iPOS
Input the amount first, enter the product number, press the enter key, press the checkout button to choose the payment method, and then press the print button after the end of input. Among these steps, the input of the product number can both adopt the manual input or barcode scanning. The transaction process is shown in Fig. 8. A picture of each function is shown in Fig. 9, that is, the manual input of the amount. The manual input of the product number or the scanning of the barcode is shown in Fig. 10. The product deletion function input is shown in Fig. 11. Press the product button for a long time to delete. The checkout function is shown in Fig. 12. Press the checkout button to choose the payment method and then the checkout   number to print the receipt. The multiple functional menu selection is shown in Fig. 13. There are selection items to set the sales system or the functions of newly added products and sales return. The sales return function is shown in Fig. 14. Sales return is divided into whole return or partial return. Whole return means bringing the purchased products, receipt and electronic invoice to input the transaction number, delete the sales records, and return the payment to the consumers. In the case of partial return, we need to return all of the payment first and then  input the price of products desired into a new sales record. Then, the amount returned to the consumer is re-calculated. The backstage management system is shown in Fig. 15. In the Login Page, input the account number and password to enter the backstage management system. The account management is shown in Fig. 16. Addition, deletion, and modification are allowed in the account management of the sales system here, and the staff can use the accounts listed here to log into the iPOS system. The transaction history record and management page are shown in   Fig. 17. We can see every transaction history record and amount here and the detailed product projects purchased after clicking on the "Detailed Record". A detailed product project is shown in Fig. 18. Click on the "Detailed Record" to see a purchased detailed product project.

Transaction process of electronic purse
The electronic purse is issued by merchants themselves: with this purse, consumers can store money first and then write the amount into the card and background database, and consumers can enjoy discounts in the case of purchases using this card. The process of payment with the electronic purse is shown in Fig. 19.

Implementation of payment system of O'Pay
O'Pay, (23) a mobile payment, provides the data transmission interface (PHP API) to generate a two-dimensional barcode on the web page of a mobile sales system. It asks consumers to scan the code and leads them to the payment page of O'Pay where customers can choose the payment mode they want, such as credit card, online ATM, or O'Pay account payment. The cash flow process of a credit card is shown in Fig. 20.

Real transaction over iPOS
The picture of a two-dimensional barcode generated by the sales system is shown in Fig. 21.
The picture of the consumerʼs payment portal for O'Pay is shown in Fig. 22. In credit card payment, relevant information and complete identification verification are input to finish the payment as shown in Fig. 23. The picture of completing the transaction is shown in Fig. 24,   where the sales system can determine that the payment for this order has been completed, checkout can be done, and the product can be given to consumers. In fact, the mobile cash register cannot print an electronic invoice at present, because it must get the permission from the Ministry of Finance in Taiwan. (24) It is feasible to print an electronic invoice by opening a personal store and its annual turnover reaches a certain threshold. The hardware peripheral that can support mobile phones is currently not comprehensive. Although there are magnetic stripe card readers for mobile phones, their security cannot be identified by banking institutions. (25) If you really want to achieve cash flow directly with banks, you still have to wait for banking institutions to release the method of communication or a list of related hardware devices; otherwise, you are unable to conduct transactions directly with banks at present. The issues mentioned above are the main directions for future work to make the POS system become more complete, closer to the function of a traditional POS system, and more convenient to use.

Conclusion
When its hardware peripheral and functions become more efficient, and its security mechanism becomes more robust concurrently, the proposed system can completely replace a traditional POS system, which can not only greatly reduce the cost, but also bring convenience in use as the size of devices is decreased markedly. Moreover, by adding the concept of warehouse management and integrating it the result of data analysis in the future, one can learn about what products or materials are lacking at this moment in real time only by pressing a few buttons, so as to save storage space and predict future trends to help enterprises make decisions. Furthermore, the system could be linked with the supplier or logistics and one can directly place orders, which not only speeds up the purchasing and saves personnel costs, but also enhances the operating efficiency.