A point of view of the voucher input module in accounting software
Wuhan Huazhongshi Dafu Department Xie Gang
Summary:
The production and processing of credentials is the most important ring in accounting work, especially for accounting computerization, and more important, application software to achieve traditional accounting processes, and vouchers are the foundation of all other processing. There is no copy of the accounting software without the credentials. For the voucher, the most important is the input of the credentials. The first step in the input of the voucher is to determine the credential number of this credentials, which should be avoided in the accounting software to get the credential number, and the implementable software should be automatically obtained by the program, because the previous saying, The credential number is not wrong. This article discusses the following discussion on the access process of the voucher number. Use development tools: PowerBuilder8.0 MS SQL-Server2000
Keywords:
Accounting Software Credential Enter Credential Number Powerbuilder8.0
SQL-Server2000
text:
One. Discussion on traditional methods:
By investigation and analysis of the current domestic accounting software, discovery that most software credential input modules are basically consistent on the method used above. The method is as follows:
Before a new voucher input, you must first determine the credential number of this credential. The general approach is: Check the PPK (Japanese) record by the program. If there is a record inside, take the last record of the credential number, plus 1, for the number of this credential you are ready to enter; if there is no record in the PPK library (this document is preparing to enter this credentials) The first credential of the day must have access to the Pok & RQ (the monthly "record, if there is a record in it, the document number of the last record is explained, plus 1 for this credential to be entered. Credential number; if there is no record in the Pok library, it means that this day is the first working day of the month (but this situation is only 12 times a year).
two. Experience in personally design:
When I personally design the voucher input program (design with the PowerBuilder MS SQL-Server2000), I found that the above method is implemented by the language:
First: It is inconvenient when code design and maintenance.
Second: More important is that the continuity of the credential number is very convenient, such as the salary certificate from the salary module, has to store these credentials with a new voucher mechanism.
Third: There is also a lot of system resources. For example, always move a lot of database records every time you add a credential, especially in the first working day of the month, facing the same problem at the end of the month (month to the end of the month, The record month in the table, the number of times the movement is more than the month).
Therefore, in the process of actual design, I have explored a new idea to solve this problem. I can solve the above three problems. I feel that this idea will have to discuss it with you. The specific implementation is as follows:
First: Add another new data table (named HQPZBH):
The field name is: ID, PZBH, field attributes: Integer, CHAR type. After establishing a good value (preferably with the programs). The ID field is added to 1, the PZBH field is 0000 (selecting the number according to the specific requirements, such as 000000, etc.).
The code is implemented as follows (for reference only, according to the specific programming language conversion form): (connected to the database statement omitted, the following)
INSERT INTO HQPZBH (hqpzbh.id, hqpzbh.pzbh)
VALUES (1,0000);
Second: Each time you enter the new credentials to get the credential number:
The data sheet has only one record in HQPZBH, and the ID is always 1, and the PZBH is always the number of the last credentials inside the library. Access this data sheet each time you perform the input credentials, access this data table, read the value of the PZBH field in the table, plus 1 is OK.
The code implemented by the program is as follows (reference):
Integer nowpzbh; (Define the credential number of this credential number of the store ready to enter)
/ / Get the value of the PZBH field in the table HQPZBH and put it in the NOWPZBH variable
Select hqpzbh.pzbh
INTO: NOWPZBH
From hqpzbh
WHERE hqpzbh.id = 1;
// Note: There is only one record in this table.
Nowpzbh = nowPZBH 1
// This value has become a credential number of the upcoming credentials after adding.
Third: Ensure that the value of the PZBH field in the data sheet HQPZBH is always the number of the last credential.
Then ask us to replace the values of the original PZBH fields instead of the data table HQPZBH at each credential input while inspected.
The code implemented by the program is as follows (reference):
Assume that the voucher number of the credentials of the store is saved is nowpzbh
Update hqpzbh
Set hqpzbh.pzbh =: nowpzbh
WHERE hqpzbh.id = 1;
There is only one record in the table. And the value of its ID field is always 1
Third, summary
I think this method is better to understand and achieve, and it is more convenient to design and maintain code. At the same time, for those special credentials are also extremely convenient, such as the salary certificate automatically transfer to the voucher library, it is not necessary to use the "specific section of the specific segment" mode of traditional software. The true sense of the credential number can be implemented in the credential library. There is also a considerable amount of data in the database, this method is quite dominant because it only needs to access a document of the secondary database, more importantly, this data table has only one data, when accessible No moving time is required. Avoid the search for the traditional way of credential numbers (especially the first working day of the month and the data of the monthly data). It is greatly saved the time overhead and space overhead of the database.