Readers may be aware that quite a good number of software packages are available in Windows, notwithstanding the security risks associated with the Windows. In Linux good open source software packages are available based on C language, C++ language, and Java. But most of them need installations. They also need databases such as sqlite, mysql, postgresql, h2 db, hsqldb, etc. etc. For individuals and small businesses which do bourgeoisie businesses/occupations/professions, they may require complex, hitec accounting packages. For those individuals who do not have much secret private transactions or sensitive information, I feel that we can think of some script which does not require installation of databases. I also feel that text files will be more convenient to enter/record daily transactions, receipts, payments, using delimiters as column separators. Keeping this objective in view, I have designed a php script, which can be used even offline on laptops / PCs, where there is already an installed php and apache2 server. The above is the screenshot, taken when using the php script designed by me.
This php script is mainly intended for individuals, small professionals, small businesses.
Transactions, Receipts and Payments, Transfer from one a/c to another a/c can be entered in a suitable text file, say accsdiary.txt, using text editors such as notepads, geany, gedit. Better not to enter private sensitive narrations, details, and account names.
Additions, modifications and deletions will be easy, because we use text files.
Based on double-entry book keeping, which is a standard procedure globally.
In this php script, to distinguish account names from other search terms, the prefix 'ac' is added before account name. This is not compulsory. But seems to be convenient.
Any number of accounts can be opened with any new names, depending upon needs.
Asset accountsShould normally show debit balances. Example: When an asset is purchased:
cr acbank or acbankloan or accash (depending on how we pay).
Cash in hand, cash in wallet, cash drawer (or whatever name we may give), balance in Bank a/c etc. are all assets, and hence they should ordinarily show debit balances.
Liability a/csShould normally show credit balances.
Example. When a vehicle is purchased with a bank loan.
dr acvehicles. cr acbankvehiloan.
Income AccountsNormally. they show credit balances.
Expenses accountsNormally, they show debit balances.
Some examplesWhen incomes such as salaries are received (when the employer credits our bank SB account), entry to be passed: dr acbank. cr acsalaries.
When cash is drawn from atmdr accash. cr acbank.
When we take cash from home, and pay in bankdr acbank. cr accash.
The above Screenshot shows how transactions can be entered in a text file, by giving anyname such as, say somename.txt.
As already mentioned above, in Double Entry Book Keeping, every transaction will have two legs, a debit leg, and a credit leg. In those days of manual accounting methods, Business Organisations used to prepare two manual paper vouchers, one for debit entry and one for credit entry, and enter into some manual Register called "Transfer Scroll" or "Daily Transactions Register". Of course, there can be more than one debit voucher, for debit leg, and more than one credit voucher for credit leg. Some Accountants seem to call these vouchers "split transactions".
Example of a Split voucher
One Debit voucher for Expenses a/c (Advertising) Rs. 1,50,000/-
One Credit voucher. Credit to Bank 1 Account Rs. 1,00,000/- (Being cheque No.... issued in favour of the Flex Board Manufacturer.)
2nd Credit Voucher. Credit to Bank 1 Account Rs. 20,000/- (Being cheque No.... issued in favour of Transport Company for transporting the Boards to Locations.
3rd Credit Voucher. Credit to Bank 1 Account: Rs. 18,000/- (Being cheque No. ... issued in favour of Municipal Corporation towards taxes).
4th Credit Voucher. Credit to Cash Account. Rs. 12,000/- (Being Cash paid to Laborers for erecting the Flex Boards at Locations).
Total of one debit voucher Rs. 1,50,000/-. Total of four credit vouchers Rs. 1.50,000/-. Thus, total debits and credits should tally to Rs. 1,50,000/-.
Now Readers scan examine the above screenshot, where for every debit entry, there is only one credit entry i.e. 1-to-1 method, which is simpler for beginners.
Why there is a gap of one line, between entries?
Ans: We are not using any database like mysql or postgresql. Hence, even in text files, we have to separate one record from another record. (In database tables, these are called 'rows'. Here we are using two linefeeds as 'record separators' or 'row separators'.
Why there are pipes i.e."|" in each transaction line?
Ans: These pipes separate columns, in each row.
In the following Testarea, I have pasted the entire contents of the somename.php file which I am successfully using. The code is expected to work off-line, on http://localhost/furtherfoldernames/somename.php i.e. http://127.0.0.1/furtherfoldernames/somename.php, in any browser. I have tested it on firefox browser. For sending the statements of account to a .doc file or to a .txt file, will depend on read-write-permissions on the folder designated as localhost. For seeing the accounts on browser, ordinarily, there will not be any problems. In the textarea, Readers will find that the code is starting with "html coding" and ending with body/html tags. Thus, our php file will be a two-in-one file serving both the html tags and the php commands.
For those, who wish to download a zip file, consisting of "accs1806.php file, trans.txt file, subjlistaccs.txt file, may.doc file", here I am giving a download link to the file where I have uploaded:
I have tested the above download link. It is working as on date.
Can transactions be entered in Telugu language, other Indian Languages , other World languages.
Ans: In the code above, you will see meta tag. "META http-equiv='content-type; content='text/html' charset='utf-8'; lang='hi'; lang='te'; encoding='utf-8'; dir='ltr';" in the head of html. Here I have given the language names as 'hi' for Hindi, 'te' for Telugu. When I entered transactions in Telugu and Hindi languages in geany Text editor for the somefile.txt file of transactions, I did not encounter any problems. In the same manner, for seeing results in Firefox browser, there are no problems for html and php files. These lang encodings can be changed in a text editor. Ordinarily for typing in any language, in Text Editors such as Notepad, Notepad+, Geany, Gedit etc. etc., we may need to have at least one font. Besides, we need some keyboard support. In Linux and Ubuntu as everything is Open Source and Free, there will not be any problem. Even in case of Windows, there may not be tough problems. I shall shortly be uploading here two screenshots of entries made in Telugu and Hindi Languages, for the benefit of our readers.
Question: How many .txt files we can open and use for entering transactions?Ans: no limit. For example we can use home.txt file for home accounts, perso.txt file for personal accounts, shop.txt file for shop accounts, workshop.txt file for Factory accounts etc. etc. For all these accounts, one single somefile.php file will be sufficient.
A person engaged in the occupation of writing accounts for other Firms/Companies for a fee, he can open any number of .txt files for each Firm / Company. For example, in India, some firms/Companies maintain two sets of books of accounts. One for Income tax,GST purposes. Another, for true accounts, to know the actual profit or loss. I do not support this idea of multiple books of accounts for avoiding taxes. However, from the point of view of Computer Technicalities and this php script. many .txt files can be used for different purposes, of the same Firm/Company.
Question: Can different .txt files be combined, to get a combined result?
Ans: It is possible. In the above php script, Readers can under the line file_get_contents("filename.txt"), add more lines of file_get_contents("filename2.txt"), file_get_contents("filename3.txt") etc. Some "mutatis mutandis" changes will be necessary in the next-succeeding "$doughall" statement.
Questions are welcome. Answers will be given to the best of my ability.